diff options
author | Rat <none@none> | 2010-06-04 23:24:48 +0200 |
---|---|---|
committer | Rat <none@none> | 2010-06-04 23:24:48 +0200 |
commit | 1426c2970f42a2d065198806f750bf5dd28d580b (patch) | |
tree | e3247fb0f1770ab214e412e0f2d6edc5b91ec8f4 /src/game/CreatureEventAIMgr.cpp | |
parent | 5ca00bc14d38c5ad49f0ab4500af52e645133826 (diff) |
HIGHLY EXPERIMENTAL - USE AT YOUR OWN RISK
implemented Condition System
all systems should work like before
after applying the sql converter you won't be able to apply any Updatepacks (<=up30) so do updates before this
this revesion is not threated as stable!
--HG--
branch : trunk
Diffstat (limited to 'src/game/CreatureEventAIMgr.cpp')
-rw-r--r-- | src/game/CreatureEventAIMgr.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/game/CreatureEventAIMgr.cpp b/src/game/CreatureEventAIMgr.cpp index 4fa7517d848..83d62ca74dc 100644 --- a/src/game/CreatureEventAIMgr.cpp +++ b/src/game/CreatureEventAIMgr.cpp @@ -26,6 +26,7 @@ #include "Policies/SingletonImp.h" #include "ObjectDefines.h" #include "GridDefines.h" +#include "ConditionMgr.h" INSTANTIATE_SINGLETON_1(CreatureEventAIMgr); @@ -359,11 +360,17 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() sLog.outErrorDb("CreatureEventAI: Creature %u using event %u: param1 (EmoteTextId: %u) are not valid.",temp.creature_id, i, temp.receive_emote.emoteId); continue; } - - if (!PlayerCondition::IsValid(ConditionType(temp.receive_emote.condition), temp.receive_emote.conditionValue1, temp.receive_emote.conditionValue2)) + if (temp.receive_emote.condition) { - sLog.outErrorDb("CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not valid.",temp.creature_id, i, temp.receive_emote.condition); - continue; + Condition* cond = new Condition(); + cond->mConditionType = ConditionType(temp.receive_emote.condition); + cond->mConditionValue1 = temp.receive_emote.conditionValue1; + cond->mConditionValue2 = temp.receive_emote.conditionValue2; + if (!sConditionMgr.isConditionTypeValid(cond)) + { + sLog.outErrorDb("CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not valid.",temp.creature_id, i, temp.receive_emote.condition); + continue; + } } if (!(temp.event_flags & EFLAG_REPEATABLE)) |