aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQAston <qaston@gmail.com>2012-02-10 18:49:40 +0100
committerQAston <qaston@gmail.com>2012-02-10 18:49:40 +0100
commit46b9942f97b5ca4b14fba865b6f60dba61245b03 (patch)
tree6c8ac741ad6f7bbaa10e6ac4c407813367e9b670
parented3e5d816ab777837a44e9b6ace10b6fe90095e2 (diff)
Core/Db/Conditions: remove ConditionValue2 parameter CONDITION_SPELL which was used for checking if player doesn't have spell and use NegativeCondition parameter instead.
-rw-r--r--sql/updates/world/2012_02_10_03_world_conditions.sql2
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.cpp7
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.h4
3 files changed, 5 insertions, 8 deletions
diff --git a/sql/updates/world/2012_02_10_03_world_conditions.sql b/sql/updates/world/2012_02_10_03_world_conditions.sql
new file mode 100644
index 00000000000..b46684df7d5
--- /dev/null
+++ b/sql/updates/world/2012_02_10_03_world_conditions.sql
@@ -0,0 +1,2 @@
+-- CONDITION_SPELL with ConditionValue2 = 1 -> CONDITION_SPELL + NegativeCondition
+UPDATE `conditions` SET `NegativeCondition` = 1, `ConditionValue2` = 0 WHERE `ConditionTypeOrReference` = 25 AND `ConditionValue2` = 1;
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index a150586f3d5..977657a985c 100755
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -209,12 +209,7 @@ bool Condition::Meets(WorldObject* object, WorldObject* invoker)
case CONDITION_SPELL:
{
if (Player* player = object->ToPlayer())
- {
- if (mConditionValue2 == 1)
- condMeets = player->HasSpell(mConditionValue1);
- else
- condMeets = !player->HasSpell(mConditionValue1);
- }
+ condMeets = player->HasSpell(mConditionValue1);
break;
}
case CONDITION_LEVEL:
diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h
index f3895130c6a..a81f533817b 100755
--- a/src/server/game/Conditions/ConditionMgr.h
+++ b/src/server/game/Conditions/ConditionMgr.h
@@ -53,9 +53,9 @@ enum ConditionType
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 0 bool 1 for true 0 for false
+ CONDITION_SPELL = 25, // spell_id 0 0 true if player has learned spell
CONDITION_UNUSED_26 = 26,
- CONDITION_LEVEL = 27, // level opt 0 true if player's level is equal to param1 (param2 can modify the statement)
+ CONDITION_LEVEL = 27, // level opt 0 true if unit'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