aboutsummaryrefslogtreecommitdiff
path: root/src/game/CreatureAIImpl.h
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-26 22:46:06 -0500
committermegamage <none@none>2009-05-26 22:46:06 -0500
commit9dda6392c1edc7a3f31ee31e942b0f7ad4d11a33 (patch)
tree23aec69cdae2518b0decf697f230243e53e6c851 /src/game/CreatureAIImpl.h
parent7ac4fb46c417ecbc68cf4844c6078ed88015bc90 (diff)
*Fix the bug that warlord najentus spams spells
*Fix the bug that supremus volcano can move Thanks to Farah --HG-- branch : trunk
Diffstat (limited to 'src/game/CreatureAIImpl.h')
-rw-r--r--src/game/CreatureAIImpl.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/game/CreatureAIImpl.h b/src/game/CreatureAIImpl.h
index 95a16d0ac5b..c7ce3198584 100644
--- a/src/game/CreatureAIImpl.h
+++ b/src/game/CreatureAIImpl.h
@@ -107,6 +107,12 @@ class EventMap : private std::map<uint32, uint32>
insert(std::make_pair(time, eventId));
}
+ void RescheduleEvent(uint32 eventId, uint32 time, uint32 gcd = 0, uint32 phase = 0)
+ {
+ CancelEvent(eventId);
+ ScheduleEvent(eventId, time, gcd, phase);
+ }
+
uint32 ExecuteEvent()
{
while(!empty())
@@ -142,6 +148,28 @@ class EventMap : private std::map<uint32, uint32>
++itr;
}
}
+
+ void CancelEvent(uint32 eventId)
+ {
+ for(iterator itr = begin(); itr != end();)
+ {
+ if(eventId == (itr->second & 0x0000FFFF))
+ erase(itr++);
+ else
+ ++itr;
+ }
+ }
+
+ void CancelEventsByGCD(uint32 gcd)
+ {
+ for(iterator itr = begin(); itr != end();)
+ {
+ if(itr->second & gcd)
+ erase(itr++);
+ else
+ ++itr;
+ }
+ }
};
enum AITarget