*Fix the bug that warlord najentus spams spells
*Fix the bug that supremus volcano can move Thanks to Farah --HG-- branch : trunk
This commit is contained in:
@@ -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) {}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user