From 6174703d450204adf5f7e708ebf2a94d8f4ae2d7 Mon Sep 17 00:00:00 2001 From: Supabad Date: Sat, 9 Apr 2011 10:12:45 +0200 Subject: Core/Conditions: updated CONDITION_SPELL to allow to return false also --- src/server/game/Conditions/ConditionMgr.cpp | 5 ++++- src/server/game/Conditions/ConditionMgr.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index ca93b89ca88..c8013179956 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -158,7 +158,10 @@ bool Condition::Meets(Player * player, Unit* invoker) break; } case CONDITION_SPELL: - condMeets = player->HasSpell(mConditionValue1); + if (mConditionValue2 == 0) + condMeets = player->HasSpell(mConditionValue1); + else + condMeets = !player->HasSpell(mConditionValue1); break; case CONDITION_NOITEM: condMeets = !player->HasItemCount(mConditionValue1, 1, mConditionValue2 ? true : false); diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 992fdfb0851..9659ff89aff 100755 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -52,7 +52,7 @@ enum ConditionType 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_TARGET = 24, // ItemRequiredTargetType, TargetEntry, 0 - CONDITION_SPELL = 25, // spell_id 0 +referenceID true if knows spell + CONDITION_SPELL = 25, // spell_id bool +referenceID bool 0 for true 1 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 -- cgit v1.2.3