Exemplo n.º 1
0
void Creature::removeCondition(const Creature* attacker, ConditionType_t type)
{
	ConditionList tmpList = conditions;
	for(ConditionList::iterator it = tmpList.begin(); it != tmpList.end(); ++it)
	{
		if((*it)->getType() == type)
			onCombatRemoveCondition(attacker, *it);
	}
}
Exemplo n.º 2
0
void Creature::removeCondition(const std::string& name, const CombatSource& combatSource)
{
	ConditionList tmpList = conditions;

	for(ConditionList::iterator it = tmpList.begin(); it != tmpList.end(); ++it){
		if((*it)->getName() == name){
			onCombatRemoveCondition(combatSource, *it);
		}
	}
}
Exemplo n.º 3
0
bool Item::IsTargetValidForItemUse(Unit* pUnitTarget)
{
    ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET, GetProto()->ItemId);
    if (conditions.empty())
        return true;

    if (!pUnitTarget)
        return false;

    for (ConditionList::const_iterator itr = conditions.begin(); itr != conditions.end(); ++itr)
    {
        ACE_Auto_Ptr<ItemRequiredTarget> irt(new ItemRequiredTarget((ItemRequiredTargetType)(*itr)->mConditionValue1, (*itr)->mConditionValue2));
        if (irt->IsFitToRequirements(pUnitTarget))
            return true;
    }
    return false;
}
Exemplo n.º 4
0
bool Item::IsTargetValidForItemUse(Unit* pUnitTarget)
{
    ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET, GetTemplate()->ItemId);
    if (conditions.empty())
        return true;

    if (!pUnitTarget)
        return false;

    for (ConditionList::const_iterator itr = conditions.begin(); itr != conditions.end(); ++itr)
    {
        ItemRequiredTarget irt(ItemRequiredTargetType((*itr)->ConditionValue1), (*itr)->ConditionValue2);
        if (irt.IsFitToRequirements(pUnitTarget))
            return true;
    }
    return false;
}
Exemplo n.º 5
0
bool PhaseMgr::NeedsPhaseUpdateWithData(PhaseUpdateData const updateData) const
{
    PhaseDefinitionStore::const_iterator itr = _PhaseDefinitionStore->find(player->GetZoneId());
    if (itr != _PhaseDefinitionStore->end())
    {
        for (PhaseDefinitionContainer::const_iterator phase = itr->second.begin(); phase != itr->second.end(); ++phase)
        {
            ConditionList conditionList = sConditionMgr->GetConditionsForPhaseDefinition(phase->zoneId, phase->entry);
            for (ConditionList::const_iterator condition = conditionList.begin(); condition != conditionList.end(); ++condition)
                if (updateData.IsConditionRelated(*condition))
                    return true;
        }
    }
    return false;
}