diff options
author | KingPin <none@none> | 2008-11-02 16:53:46 -0600 |
---|---|---|
committer | KingPin <none@none> | 2008-11-02 16:53:46 -0600 |
commit | d5beb2bbe97afa0e50df8a2cef49bcac4a607f4a (patch) | |
tree | 4ce9fec826220b2476406e38915a15b6d00a4ce1 /src/game/ObjectMgr.cpp | |
parent | 6633d3c680d4f75d743f705e9b26278674f11ee0 (diff) |
[svn] *Implement new player conditions CONDITION_NO_AURA, CONDITION_ACTIVE_EVENT
* Default behaviour of pets for creatures changed to REACT_DEFENSIVE
* Disallowed sending wrapped items as COD
* Prevent loading and saving single target auras for pet in same way as already implemented for player
* Correctly limit use some flask types to zones.
* Fixed extracting common.MPQ under *nix
* Many small xleanups and fixes.
** mangos merge rev.
TEST REV so be careful of creepy crawly bugs!
--HG--
branch : trunk
Diffstat (limited to 'src/game/ObjectMgr.cpp')
-rw-r--r-- | src/game/ObjectMgr.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 916fa6a9a04..5715af51061 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -6569,6 +6569,10 @@ bool PlayerCondition::Meets(Player const * player) const return true; return false; } + case CONDITION_NO_AURA: + return !player->HasAura(value1, value2); + case CONDITION_ACTIVE_EVENT: + return gameeventmgr.IsActiveEvent(value1); default: return false; } @@ -6689,6 +6693,30 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val sLog.outErrorDb("Quest condition has useless data in value2 (%u)!", value2); break; } + case CONDITION_NO_AURA: + { + if(!sSpellStore.LookupEntry(value1)) + { + sLog.outErrorDb("Aura condition requires to have non existing spell (Id: %d), skipped", value1); + return false; + } + if(value2 > 2) + { + sLog.outErrorDb("Aura condition requires to have non existing effect index (%u) (must be 0..2), skipped", value2); + return false; + } + break; + } + case CONDITION_ACTIVE_EVENT: + { + GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap(); + if(value1 >=events.size() || !events[value1].isValid()) + { + sLog.outErrorDb("Active event condition requires existed event id (%u), skipped", value1); + return false; + } + break; + } } return true; } |