mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 19:05:42 +00:00
feat(Core/AI): Implement delay option to the Talk() function (#14950)
This commit is contained in:
@@ -67,13 +67,11 @@ public:
|
||||
boss_captain_skarlocAI(Creature* creature) : ScriptedAI(creature), summons(me) { }
|
||||
|
||||
EventMap events;
|
||||
EventMap events2;
|
||||
SummonList summons;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
events.Reset();
|
||||
events2.Reset();
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
@@ -130,8 +128,24 @@ public:
|
||||
|
||||
if (me->movespline->Finalized())
|
||||
{
|
||||
events2.ScheduleEvent(EVENT_INITIAL_TALK, 500);
|
||||
events2.ScheduleEvent(EVENT_START_FIGHT, 8000);
|
||||
Talk(SAY_ENTER, 500ms);
|
||||
|
||||
me->m_Events.AddEventAtOffset([this]()
|
||||
{
|
||||
me->SetImmuneToAll(false);
|
||||
me->SetInCombatWithZone();
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
{
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
|
||||
{
|
||||
if (summon->GetEntry() != NPC_SKARLOC_MOUNT)
|
||||
{
|
||||
summon->SetImmuneToAll(false);
|
||||
summon->SetInCombatWithZone();
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 8s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,25 +175,6 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
events2.Update(diff);
|
||||
switch (events2.ExecuteEvent())
|
||||
{
|
||||
case EVENT_INITIAL_TALK:
|
||||
Talk(SAY_ENTER);
|
||||
break;
|
||||
case EVENT_START_FIGHT:
|
||||
me->SetImmuneToAll(false);
|
||||
me->SetInCombatWithZone();
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
|
||||
if (summon->GetEntry() != NPC_SKARLOC_MOUNT)
|
||||
{
|
||||
summon->SetImmuneToAll(false);
|
||||
summon->SetInCombatWithZone();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user