aboutsummaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp1
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp6
-rw-r--r--src/game/CreatureAIImpl.h28
3 files changed, 32 insertions, 3 deletions
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
index ff90f7e6a81..1994d580b8d 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
@@ -240,6 +240,7 @@ struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoCast(m_creature, SPELL_VOLCANIC_ERUPTION);
+ me->SetReactState(REACT_PASSIVE);
}
void EnterCombat(Unit *who) {}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp
index 032bccc57ed..80d9a116712 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp
@@ -125,9 +125,9 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI
void ResetTimer(uint32 inc = 0)
{
- events.ScheduleEvent(EVENT_NEEDLE, 10000 + inc, GCD_CAST);
- events.ScheduleEvent(EVENT_SPINE, 20000 + inc, GCD_CAST);
- events.ScheduleEvent(EVENT_SHIELD, 60000 + inc);
+ events.RescheduleEvent(EVENT_NEEDLE, 10000 + inc, GCD_CAST);
+ events.RescheduleEvent(EVENT_SPINE, 20000 + inc, GCD_CAST);
+ events.RescheduleEvent(EVENT_SHIELD, 60000 + inc);
}
void UpdateAI(const uint32 diff)
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