diff options
| author | Shauren <none@none> | 2010-09-10 20:49:29 +0200 |
|---|---|---|
| committer | Shauren <none@none> | 2010-09-10 20:49:29 +0200 |
| commit | 320929ff40a42bfd2bbd1f83c4ff9fa1ea7563a3 (patch) | |
| tree | 51595971c38768d37374ecb7f5343fa8ec82d600 /src/server/game/Conditions/ConditionMgr.cpp | |
| parent | 61075d5101283cc6d485018a40e02b2c44f27ebf (diff) | |
Core/Conditions: Added "player knows spell" condition type
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Conditions/ConditionMgr.cpp')
| -rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 8763e61d95a..abf68389a12 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -166,6 +166,9 @@ bool Condition::Meets(Player * player, Unit* targetOverride) refId = 0;//cant have references for now break; } + case CONDITION_SPELL: + condMeets = player->HasSpell(mConditionValue1); + break; default: condMeets = false; refId = 0; @@ -1217,6 +1220,18 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) sLog.outErrorDb("ItemTarget condition has useless data in value3 (%u)!", cond->mConditionValue3); break; } + case CONDITION_SPELL: + { + if (!sSpellStore.LookupEntry(cond->mConditionValue1)) + { + sLog.outErrorDb("Spell condition has non existing spell (Id: %d), skipped", cond->mConditionValue1); + return false; + } + + if (cond->mConditionValue2) + sLog.outErrorDb("Spell condition has useless data in value2 (%u)!", cond->mConditionValue2); + break; + } case CONDITION_AREAID: case CONDITION_INSTANCE_DATA: break; |
