Core/Conditions: updated CONDITION_AURA, if Param3 is set true target is tested for condition, else caster is tested

--HG--
branch : trunk
This commit is contained in:
Rat
2010-11-05 22:54:51 +01:00
parent 9b3ce64f6e
commit b45e12fdf9
2 changed files with 6 additions and 2 deletions

View File

@@ -47,7 +47,11 @@ bool Condition::Meets(Player * player, Unit* invoker)
condMeets = true; // empty condition, always met
break;
case CONDITION_AURA:
condMeets = player->HasAuraEffect(mConditionValue1, mConditionValue2);
refId = 0;
if (!mConditionValue2)
condMeets = player->HasAuraEffect(mConditionValue1, mConditionValue2);
else if (Unit* target = player->GetSelectedUnit())
condMeets = target->HasAuraEffect(mConditionValue1, mConditionValue2);
break;
case CONDITION_ITEM:
condMeets = player->HasItemCount(mConditionValue1, mConditionValue2);

View File

@@ -28,7 +28,7 @@ class LootTemplate;
enum ConditionType
{ // value1 value2 value3
CONDITION_NONE = 0, // 0 0 0 always true
CONDITION_AURA = 1, // spell_id effindex +referenceID true if has aura of spell_id with effect effindex
CONDITION_AURA = 1, // spell_id effindex use target? true if player (or target, if value3) has aura of spell_id with effect effindex
CONDITION_ITEM = 2, // item_id count +referenceID true if has #count of item_ids
CONDITION_ITEM_EQUIPPED = 3, // item_id 0 +referenceID true if has item_id equipped
CONDITION_ZONEID = 4, // zone_id 0 +referenceID true if in zone_id