diff options
author | Rat <none@none> | 2010-11-05 22:54:51 +0100 |
---|---|---|
committer | Rat <none@none> | 2010-11-05 22:54:51 +0100 |
commit | b45e12fdf98d857abf71fb820dd6a472c56ffb11 (patch) | |
tree | 6b6dbc1b745020b7150689271ce01bfa0fdee16a /src | |
parent | 9b3ce64f6e5c073a1e7a123af42c5cd1dee18a48 (diff) |
Core/Conditions: updated CONDITION_AURA, if Param3 is set true target is tested for condition, else caster is tested
--HG--
branch : trunk
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Conditions/ConditionMgr.cpp | 6 | ||||
-rwxr-xr-x | src/server/game/Conditions/ConditionMgr.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 4cd00ae322a..b1f6322237d 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -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); diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 4f5dcdf07b3..d245483a6d7 100755 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -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 |