fix(Core/Scripts): use DespawnOrUnsummon respawn parameter (#25457)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Andrew
2026-04-15 05:58:41 -03:00
committed by GitHub
parent bbd192aff9
commit 3c141d7a48
2 changed files with 8 additions and 22 deletions

View File

@@ -176,11 +176,7 @@ public:
case VEHICLE_ARGENT_WARHORSE: case VEHICLE_ARGENT_WARHORSE:
case VEHICLE_ARGENT_BATTLEWORG: case VEHICLE_ARGENT_BATTLEWORG:
if (InstanceProgress < INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED && m_auiEncounter[0] == NOT_STARTED) if (InstanceProgress < INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED && m_auiEncounter[0] == NOT_STARTED)
{
creature->DespawnOrUnsummon();
creature->SetRespawnTime(3);
VehicleList.push_back(creature->GetGUID()); VehicleList.push_back(creature->GetGUID());
}
else else
creature->DespawnOrUnsummon(); creature->DespawnOrUnsummon();
break; break;
@@ -301,6 +297,7 @@ public:
switch (InstanceProgress) switch (InstanceProgress)
{ {
case INSTANCE_PROGRESS_INITIAL: case INSTANCE_PROGRESS_INITIAL:
break;
case INSTANCE_PROGRESS_GRAND_CHAMPIONS_REACHED_DEST: case INSTANCE_PROGRESS_GRAND_CHAMPIONS_REACHED_DEST:
case INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_1: case INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_1:
case INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_2: case INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_2:
@@ -309,10 +306,8 @@ public:
{ {
for (ObjectGuid const& guid : VehicleList) for (ObjectGuid const& guid : VehicleList)
if (Creature* veh = instance->GetCreature(guid)) if (Creature* veh = instance->GetCreature(guid))
{ veh->DespawnOrUnsummon(0ms, 3s);
veh->DespawnOrUnsummon(); VehicleList.clear();
veh->SetRespawnTime(3);
}
for( uint8 i = 0; i < 3; ++i ) for( uint8 i = 0; i < 3; ++i )
{ {
for( uint8 j = 0; j < 3; ++j ) for( uint8 j = 0; j < 3; ++j )
@@ -327,11 +322,9 @@ public:
} }
if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID)) if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID))
{ {
c->DespawnOrUnsummon();
c->SetHomePosition(748.309f, 619.488f, 411.172f, 4.71239f); c->SetHomePosition(748.309f, 619.488f, 411.172f, 4.71239f);
c->SetPosition(748.309f, 619.488f, 411.172f, 4.71239f);
c->SetRespawnTime(3);
c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
c->DespawnOrUnsummon(0ms, 3s);
} }
InstanceProgress = INSTANCE_PROGRESS_INITIAL; InstanceProgress = INSTANCE_PROGRESS_INITIAL;
} }
@@ -340,10 +333,7 @@ public:
{ {
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID)) if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{ {
announcer->DespawnOrUnsummon();
announcer->SetHomePosition(735.81f, 661.92f, 412.39f, 4.714f); announcer->SetHomePosition(735.81f, 661.92f, 412.39f, 4.714f);
announcer->SetPosition(735.81f, 661.92f, 412.39f, 4.714f);
announcer->SetRespawnTime(3);
announcer->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP); announcer->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
for( uint8 i = 0; i < 3; ++i ) for( uint8 i = 0; i < 3; ++i )
@@ -376,6 +366,7 @@ public:
break; break;
} }
} }
announcer->DespawnOrUnsummon(0ms, 3s);
} }
} }
break; break;
@@ -398,11 +389,9 @@ public:
NPC_ArgentChampionGUID.Clear(); NPC_ArgentChampionGUID.Clear();
if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID)) if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID))
{ {
c->DespawnOrUnsummon();
c->SetHomePosition(743.14f, 628.77f, 411.2f, 4.71239f); c->SetHomePosition(743.14f, 628.77f, 411.2f, 4.71239f);
c->SetPosition(743.14f, 628.77f, 411.2f, 4.71239f);
c->SetRespawnTime(3);
c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
c->DespawnOrUnsummon(0ms, 3s);
} }
NPC_MemoryEntry = 0; NPC_MemoryEntry = 0;
InstanceProgress = INSTANCE_PROGRESS_CHAMPIONS_DEAD; InstanceProgress = INSTANCE_PROGRESS_CHAMPIONS_DEAD;
@@ -422,11 +411,9 @@ public:
NPC_BlackKnightGUID.Clear(); NPC_BlackKnightGUID.Clear();
if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID)) if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID))
{ {
c->DespawnOrUnsummon();
c->SetHomePosition(743.14f, 628.77f, 411.2f, 4.71239f); c->SetHomePosition(743.14f, 628.77f, 411.2f, 4.71239f);
c->SetPosition(743.14f, 628.77f, 411.2f, 4.71239f);
c->SetRespawnTime(3);
c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
c->DespawnOrUnsummon(0ms, 3s);
} }
InstanceProgress = INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED; InstanceProgress = INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED;
} }

View File

@@ -172,8 +172,7 @@ public:
if (Creature* sinclari = GetCreature(DATA_SINCLARI)) if (Creature* sinclari = GetCreature(DATA_SINCLARI))
{ {
sinclari->AI()->Talk(SAY_SINCLARI_COMPLETE); sinclari->AI()->Talk(SAY_SINCLARI_COMPLETE);
sinclari->DespawnOrUnsummon(); sinclari->DespawnOrUnsummon(0ms, 3s);
sinclari->SetRespawnTime(3);
} }
} }
else if (state == FAIL || state == NOT_STARTED) else if (state == FAIL || state == NOT_STARTED)