aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Conditions/ConditionMgr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Conditions/ConditionMgr.h')
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.h64
1 files changed, 33 insertions, 31 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h
index 1641642dd86..1a666abbf2b 100755
--- a/src/server/game/Conditions/ConditionMgr.h
+++ b/src/server/game/Conditions/ConditionMgr.h
@@ -30,35 +30,35 @@ enum ConditionType
{ // value1 value2 value3
CONDITION_NONE = 0, // 0 0 0 always true
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
- CONDITION_REPUTATION_RANK = 5, // faction_id min_rank +referenceID true if has min_rank for faction_id
- CONDITION_TEAM = 6, // player_team 0, +referenceID 469 - Alliance, 67 - Horde)
- CONDITION_SKILL = 7, // skill_id skill_value +referenceID true if has skill_value for skill_id
- CONDITION_QUESTREWARDED = 8, // quest_id 0 +referenceID true if quest_id was rewarded before
- CONDITION_QUESTTAKEN = 9, // quest_id 0, +referenceID true while quest active
- CONDITION_DRUNKENSTATE = 10, // DrunkenState 0, +referenceID true if player is drunk enough
- CONDITION_NO_AURA = 11, // spell_id effindex +referenceID true if does not have aura of spell_id with effect effindex
- CONDITION_ACTIVE_EVENT = 12, // event_id 0 +referenceID true if event is active
- CONDITION_INSTANCE_DATA = 13, // entry data +referenceID true if data is set in current instance
- CONDITION_QUEST_NONE = 14, // quest_id 0 +referenceID true if doesn't have quest saved
- CONDITION_CLASS = 15, // class 0 +referenceID true if player's class is equal to class
- CONDITION_RACE = 16, // race 0 +referenceID true if player's race is equal to race
- CONDITION_ACHIEVEMENT = 17, // achievement_id 0 +referenceID true if achievement is complete
- CONDITION_SPELL_SCRIPT_TARGET = 18, // SpellScriptTargetType, TargetEntry, 0
- CONDITION_CREATURE_TARGET = 19, // creature entry 0 +referenceID true if current target is creature with value1 entry
- CONDITION_TARGET_HEALTH_BELOW_PCT = 20, // 0-100 0 +referenceID true if target's health is below value1 percent, false if over or no target
- CONDITION_TARGET_RANGE = 21, // minDistance maxDist +referenceID true if target is closer then minDist and further then maxDist or if max is 0 then max dist is infinit
- CONDITION_MAPID = 22, // map_id 0 +referenceID true if in map_id
- CONDITION_AREAID = 23, // area_id 0 +referenceID true if in area_id
+ CONDITION_ITEM = 2, // item_id count bank true if has #count of item_ids (if 'bank' is set it searches in bank slots too)
+ CONDITION_ITEM_EQUIPPED = 3, // item_id 0 0 true if has item_id equipped
+ CONDITION_ZONEID = 4, // zone_id 0 0 true if in zone_id
+ CONDITION_REPUTATION_RANK = 5, // faction_id min_rank 0 true if has min_rank for faction_id
+ CONDITION_TEAM = 6, // player_team 0, 0 469 - Alliance, 67 - Horde)
+ CONDITION_SKILL = 7, // skill_id skill_value 0 true if has skill_value for skill_id
+ CONDITION_QUESTREWARDED = 8, // quest_id 0 0 true if quest_id was rewarded before
+ CONDITION_QUESTTAKEN = 9, // quest_id 0, 0 true while quest active
+ CONDITION_DRUNKENSTATE = 10, // DrunkenState 0, 0 true if player is drunk enough
+ CONDITION_NO_AURA = 11, // spell_id effindex 0 true if does not have aura of spell_id with effect effindex
+ CONDITION_ACTIVE_EVENT = 12, // event_id 0 0 true if event is active
+ CONDITION_INSTANCE_DATA = 13, // entry data 0 true if data is set in current instance
+ CONDITION_QUEST_NONE = 14, // quest_id 0 0 true if doesn't have quest saved
+ CONDITION_CLASS = 15, // class 0 0 true if player's class is equal to class
+ CONDITION_RACE = 16, // race 0 0 true if player's race is equal to race
+ CONDITION_ACHIEVEMENT = 17, // achievement_id 0 0 true if achievement is complete
+ CONDITION_SPELL_SCRIPT_TARGET = 18, // SpellScriptTargetType, TargetEntry, 0
+ CONDITION_CREATURE_TARGET = 19, // creature entry 0 0 true if current target is creature with value1 entry
+ CONDITION_TARGET_HEALTH_BELOW_PCT = 20, // 0-100 0 0 true if target's health is below value1 percent, false if over or no target
+ CONDITION_TARGET_RANGE = 21, // minDistance maxDist 0 true if target is closer then minDist and further then maxDist or if max is 0 then max dist is infinit
+ CONDITION_MAPID = 22, // map_id 0 0 true if in map_id
+ CONDITION_AREAID = 23, // area_id 0 0 true if in area_id
CONDITION_ITEM_TARGET = 24, // ItemRequiredTargetType, TargetEntry, 0
- CONDITION_SPELL = 25, // spell_id bool +referenceID bool 1 for true 0 for false
- CONDITION_NOITEM = 26, // item_id bank +referenceID true if player does not have any of the item (if 'bank' is set it searches in bank slots too)
- CONDITION_LEVEL = 27, // level opt +referenceID true if player's level is equal to param1 (param2 can modify the statement)
- CONDITION_QUEST_COMPLETE = 28, // quest_id 0 +referenceID true if player has quest_id with all objectives complete, but not yet rewarded
- CONDITION_NEAR_CREATURE = 29, // creature entry distance +referenceID true if there is a creature of entry in range
- CONDITION_NEAR_GAMEOBJECT = 30, // gameobject entry distance +referenceID true if there is a gameobject of entry in range
+ CONDITION_SPELL = 25, // spell_id bool 0 bool 1 for true 0 for false
+ CONDITION_NOITEM = 26, // item_id bank 0 true if player does not have any of the item (if 'bank' is set it searches in bank slots too)
+ CONDITION_LEVEL = 27, // level opt 0 true if player's level is equal to param1 (param2 can modify the statement)
+ CONDITION_QUEST_COMPLETE = 28, // quest_id 0 0 true if player has quest_id with all objectives complete, but not yet rewarded
+ CONDITION_NEAR_CREATURE = 29, // creature entry distance 0 true if there is a creature of entry in range
+ CONDITION_NEAR_GAMEOBJECT = 30, // gameobject entry distance 0 true if there is a gameobject of entry in range
CONDITION_MAX = 31 // MAX
};
@@ -114,6 +114,7 @@ struct Condition
uint32 ErrorTextd;
uint32 mReferenceId;
uint32 mScriptId;
+ bool mNegativeCondition;
Condition()
{
@@ -128,9 +129,10 @@ struct Condition
mReferenceId = 0;
ErrorTextd = 0;
mScriptId = 0;
+ mNegativeCondition = false;
}
- bool Meets(Player* player, Unit* invoker = NULL);
+ bool Meets(WorldObject* player, WorldObject* invoker = NULL);
bool isLoaded() const { return mConditionType > CONDITION_NONE || mReferenceId; }
};
@@ -155,7 +157,7 @@ class ConditionMgr
bool isConditionTypeValid(Condition* cond);
ConditionList GetConditionReferences(uint32 refId);
- bool IsPlayerMeetToConditions(Player* player, ConditionList const& conditions, Unit* invoker = NULL);
+ bool IsObjectMeetToConditions(WorldObject* object, ConditionList const& conditions, WorldObject* invoker = NULL);
ConditionList GetConditionsForNotGroupedEntry(ConditionSourceType sourceType, uint32 entry);
ConditionList GetConditionsForSmartEvent(int32 entryOrGuid, uint32 eventId, uint32 sourceType);
ConditionList GetConditionsForVehicleSpell(uint32 creatureID, uint32 spellID);
@@ -165,7 +167,7 @@ class ConditionMgr
bool addToLootTemplate(Condition* cond, LootTemplate* loot);
bool addToGossipMenus(Condition* cond);
bool addToGossipMenuItems(Condition* cond);
- bool IsPlayerMeetToConditionList(Player* player, ConditionList const& conditions, Unit* invoker = NULL);
+ bool IsObjectMeetToConditionList(WorldObject* player, ConditionList const& conditions, WorldObject* invoker = NULL);
bool isGroupable(ConditionSourceType sourceType) const
{