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:
@@ -47,7 +47,11 @@ bool Condition::Meets(Player * player, Unit* invoker)
|
|||||||
condMeets = true; // empty condition, always met
|
condMeets = true; // empty condition, always met
|
||||||
break;
|
break;
|
||||||
case CONDITION_AURA:
|
case CONDITION_AURA:
|
||||||
|
refId = 0;
|
||||||
|
if (!mConditionValue2)
|
||||||
condMeets = player->HasAuraEffect(mConditionValue1, mConditionValue2);
|
condMeets = player->HasAuraEffect(mConditionValue1, mConditionValue2);
|
||||||
|
else if (Unit* target = player->GetSelectedUnit())
|
||||||
|
condMeets = target->HasAuraEffect(mConditionValue1, mConditionValue2);
|
||||||
break;
|
break;
|
||||||
case CONDITION_ITEM:
|
case CONDITION_ITEM:
|
||||||
condMeets = player->HasItemCount(mConditionValue1, mConditionValue2);
|
condMeets = player->HasItemCount(mConditionValue1, mConditionValue2);
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class LootTemplate;
|
|||||||
enum ConditionType
|
enum ConditionType
|
||||||
{ // value1 value2 value3
|
{ // value1 value2 value3
|
||||||
CONDITION_NONE = 0, // 0 0 0 always true
|
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 = 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_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
|
CONDITION_ZONEID = 4, // zone_id 0 +referenceID true if in zone_id
|
||||||
|
|||||||
Reference in New Issue
Block a user