mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-16 22:15:15 +00:00
refactor(Core): DespawnOrUnsummon (#23141)
This commit is contained in:
@@ -67,7 +67,7 @@ public:
|
||||
summons.DespawnAll();
|
||||
if (InstanceScript* pInstance = me->GetInstanceScript())
|
||||
if (pInstance->GetData(DATA_GUARDIANTIME_EVENT) == 0)
|
||||
me->DespawnOrUnsummon(500);
|
||||
me->DespawnOrUnsummon(500ms);
|
||||
|
||||
me->SummonCreature(NPC_TIME_RIFT, 2337.6f, 1270.0f, 132.95f, 2.79f);
|
||||
me->SummonCreature(NPC_GUARDIAN_OF_TIME, 2319.3f, 1267.7f, 132.8f, 1.0f);
|
||||
@@ -93,11 +93,11 @@ public:
|
||||
{
|
||||
if (cr->GetEntry() == NPC_TIME_RIFT)
|
||||
{
|
||||
cr->DespawnOrUnsummon(1000);
|
||||
cr->DespawnOrUnsummon(1s);
|
||||
}
|
||||
else
|
||||
{
|
||||
cr->DespawnOrUnsummon(5000);
|
||||
cr->DespawnOrUnsummon(5s);
|
||||
cr->RemoveAllAuras();
|
||||
cr->AI()->Talk(SAY_THANKS);
|
||||
}
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
{
|
||||
Talk(SAY_FAIL);
|
||||
summons.DespawnAll();
|
||||
me->DespawnOrUnsummon(500);
|
||||
me->DespawnOrUnsummon(500ms);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
if (finished)
|
||||
{
|
||||
Talk(SAY_OUTRO);
|
||||
me->DespawnOrUnsummon(20000);
|
||||
me->DespawnOrUnsummon(20s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -547,7 +547,7 @@ public:
|
||||
if (Creature* stalker = me->SummonCreature(NPC_INVIS_TARGET, 2026.469f, 1287.088f, 143.596f, 1.37f, TEMPSUMMON_TIMED_DESPAWN, 14000))
|
||||
{
|
||||
me->SetFacingToObject(stalker);
|
||||
stalker->DespawnOrUnsummon(500);
|
||||
stalker->DespawnOrUnsummon(500ms);
|
||||
}
|
||||
break;
|
||||
// Reached first cityman
|
||||
@@ -861,7 +861,7 @@ public:
|
||||
if (Creature* stalker = me->SummonCreature(NPC_INVIS_TARGET, 2081.447f, 1287.770f, 141.3241f, 1.37f, TEMPSUMMON_TIMED_DESPAWN, 10000))
|
||||
{
|
||||
me->SetFacingToObject(stalker);
|
||||
stalker->DespawnOrUnsummon(500);
|
||||
stalker->DespawnOrUnsummon(500ms);
|
||||
}
|
||||
Talk(SAY_PHASE205);
|
||||
ScheduleNextEvent(currentEvent, 4s);
|
||||
@@ -1343,7 +1343,7 @@ void npc_arthas::npc_arthasAI::SpawnTimeRift()
|
||||
if (Creature* cr = me->SummonCreature(/*entry*/(uint32)RiftAndSpawnsLocations[timeRiftId][i][0], RiftAndSpawnsLocations[timeRiftId][0][1], RiftAndSpawnsLocations[timeRiftId][0][2], RiftAndSpawnsLocations[timeRiftId][0][3], RiftAndSpawnsLocations[timeRiftId][0][4]))
|
||||
{
|
||||
if (cr->GetEntry() == NPC_TIME_RIFT)
|
||||
cr->DespawnOrUnsummon(10000);
|
||||
cr->DespawnOrUnsummon(10s);
|
||||
else // x, y, z (0 is entry)
|
||||
{
|
||||
// first infinite
|
||||
@@ -1538,7 +1538,7 @@ public:
|
||||
if (me->GetDistance(2400, 1200, 135) > 20.0f && data >= COS_PROGRESS_FINISHED_CITY_INTRO)
|
||||
{
|
||||
if (data >= COS_PROGRESS_KILLED_SALRAMM)
|
||||
me->DespawnOrUnsummon(500);
|
||||
me->DespawnOrUnsummon(500ms);
|
||||
else
|
||||
InfectMe(3000);
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ public:
|
||||
if (Creature* cr = instance->SummonCreature(NPC_CHROMIE_MIDDLE, pos))
|
||||
{
|
||||
cr->SetVisible(false);
|
||||
cr->DespawnOrUnsummon(1000);
|
||||
cr->DespawnOrUnsummon(1s);
|
||||
sCreatureTextMgr->SendChat(cr, textId, player, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,7 +382,7 @@ public:
|
||||
if (Creature* horse = me->FindNearestCreature(NPC_SKARLOC_MOUNT, 10.0f))
|
||||
{
|
||||
horse->GetMotionMaster()->MovePoint(0, 2501.15f, 572.14f, 54.13f);
|
||||
horse->DespawnOrUnsummon(30 * IN_MILLISECONDS);
|
||||
horse->DespawnOrUnsummon(30s);
|
||||
}
|
||||
Talk(SAY_EMOTE_HORSE);
|
||||
SetEscortPaused(true);
|
||||
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
case NPC_INFINITE_EXECUTIONER_2:
|
||||
case NPC_INFINITE_VANQUISHER:
|
||||
case NPC_INFINITE_VANQUISHER_2:
|
||||
creature->DespawnOrUnsummon(1);
|
||||
creature->DespawnOrUnsummon(1ms);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -109,7 +109,7 @@ struct npc_medivh_bm : public ScriptedAI
|
||||
{
|
||||
if (summon->GetEntry() == NPC_DP_CRYSTAL_STALKER)
|
||||
{
|
||||
summon->DespawnOrUnsummon(25000);
|
||||
summon->DespawnOrUnsummon(25s);
|
||||
summon->CastSpell(summon, RAND(SPELL_BANISH_PURPLE, SPELL_BANISH_GREEN), true);
|
||||
summon->GetMotionMaster()->MoveSplinePath(&_airArray);
|
||||
}
|
||||
@@ -199,19 +199,19 @@ struct npc_medivh_bm : public ScriptedAI
|
||||
events.ScheduleEvent(EVENT_OUTRO_3, 2s);
|
||||
break;
|
||||
case EVENT_OUTRO_3:
|
||||
SummonOrcs(-2046.158f, -3.0f, 37000, 30000, true);
|
||||
SummonOrcs(-2046.158f, -3.0f, 37s, 30000, true);
|
||||
events.ScheduleEvent(EVENT_OUTRO_4, 2s);
|
||||
break;
|
||||
case EVENT_OUTRO_4:
|
||||
SummonOrcs(-2055.97f, -2.0f, 33000, 28000, false);
|
||||
SummonOrcs(-2055.97f, -2.0f, 33s, 28000, false);
|
||||
events.ScheduleEvent(EVENT_OUTRO_5, 2s);
|
||||
break;
|
||||
case EVENT_OUTRO_5:
|
||||
SummonOrcs(-2064.0f, -1.5f, 29000, 26000, false);
|
||||
SummonOrcs(-2064.0f, -1.5f, 29s, 26000, false);
|
||||
events.ScheduleEvent(EVENT_OUTRO_6, 2s);
|
||||
break;
|
||||
case EVENT_OUTRO_6:
|
||||
SummonOrcs(-2074.35f, -0.1f, 26000, 24000, false);
|
||||
SummonOrcs(-2074.35f, -0.1f, 26s, 24000, false);
|
||||
events.ScheduleEvent(EVENT_OUTRO_7, 7s);
|
||||
break;
|
||||
case EVENT_OUTRO_7:
|
||||
@@ -228,7 +228,7 @@ struct npc_medivh_bm : public ScriptedAI
|
||||
}
|
||||
}
|
||||
|
||||
void SummonOrcs(float x, float y, uint32 duration, uint32 homeTime, bool first)
|
||||
void SummonOrcs(float x, float y, Milliseconds duration, uint32 homeTime, bool first)
|
||||
{
|
||||
for (uint8 i = 0; i < 6; ++i)
|
||||
{
|
||||
@@ -236,7 +236,7 @@ struct npc_medivh_bm : public ScriptedAI
|
||||
{
|
||||
cr->GetMotionMaster()->MovePoint(0, (first && i == 3) ? x + 2.0f : x, cr->GetPositionY() + y, cr->GetMapHeight(x, cr->GetPositionY() + y, cr->GetPositionZ(), true));
|
||||
cr->m_Events.AddEvent(new NpcRunToHome(*cr), cr->m_Events.CalculateTime(homeTime + urand(0, 2000)));
|
||||
cr->DespawnOrUnsummon(duration + urand(0, 2000));
|
||||
cr->DespawnOrUnsummon(duration + randtime(0ms, 2s));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -355,7 +355,7 @@ struct npc_time_rift : public NullCreatureAI
|
||||
{
|
||||
if (creature->GetGUID() == _riftKeeperGUID)
|
||||
{
|
||||
me->DespawnOrUnsummon(0);
|
||||
me->DespawnOrUnsummon(0ms);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user