aboutsummaryrefslogtreecommitdiff
path: root/src/game/CreatureAIImpl.h
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-08 00:35:43 -0500
committermegamage <none@none>2009-06-08 00:35:43 -0500
commit963ee5d91749e3c386f272aa67d9f74145833247 (patch)
tree6e8ea5ccb107740a838a83e719102f613e68a5e4 /src/game/CreatureAIImpl.h
parent70423d04ffe2010cc2ccf845b83dd53e021defa0 (diff)
*Some update of kelthuzad script.
--HG-- branch : trunk
Diffstat (limited to 'src/game/CreatureAIImpl.h')
-rw-r--r--src/game/CreatureAIImpl.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/game/CreatureAIImpl.h b/src/game/CreatureAIImpl.h
index e48ef516b2c..4bb21f1d5ba 100644
--- a/src/game/CreatureAIImpl.h
+++ b/src/game/CreatureAIImpl.h
@@ -129,6 +129,20 @@ class EventMap : private std::map<uint32, uint32>
ScheduleEvent(eventId, time, gcd, phase);
}
+ void RepeatEvent(uint32 time)
+ {
+ if(empty())
+ return;
+ uint32 eventId = begin()->second;
+ erase(begin());
+ insert(std::make_pair(time, eventId));
+ }
+
+ void PopEvent()
+ {
+ erase(begin());
+ }
+
uint32 ExecuteEvent()
{
while(!empty())
@@ -147,6 +161,23 @@ class EventMap : private std::map<uint32, uint32>
return 0;
}
+ uint32 GetEvent()
+ {
+ while(!empty())
+ {
+ if(begin()->first > m_time)
+ return 0;
+ else if(m_phase && (begin()->second & 0xFF000000) && !(begin()->second & m_phase))
+ erase(begin());
+ else
+ {
+ uint32 eventId = (begin()->second & 0x0000FFFF);
+ return eventId;
+ }
+ }
+ return 0;
+ }
+
void DelayEvents(uint32 time, uint32 gcd)
{
time += m_time;