Core/Db/Conditions: remove ConditionValue2 parameter CONDITION_SPELL which was used for checking if player doesn't have spell and use NegativeCondition parameter instead.
This commit is contained in:
@@ -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;
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user