fix(Core/TemporarySummon): Implement TEMPSUMMON_TIMED_DESPAWN_OOC_ALIVE (#9915)

This commit is contained in:
Noxies
2021-12-30 12:05:46 +01:00
committed by GitHub
parent ea2e24f31b
commit bbf08c1aaa
3 changed files with 19 additions and 2 deletions

View File

@@ -1185,9 +1185,9 @@ public:
return;
}
player->CastSpell(player, spellInfoTrigger->Id, false);
// @todo: this is not correct! should despawn 5-6 seconds when out of combat, but can't be handled by tempsummon timer alone apparently
if (TempSummon* summons = go->SummonCreature(npc, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), player->GetOrientation() - M_PI, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5 * 60 * 1000))
if (TempSummon* summons = go->SummonCreature(npc, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), player->GetOrientation() - M_PI, TEMPSUMMON_TIMED_DESPAWN_OOC_ALIVE, 6000))
{
summons->SetCorpseDelay(5 * MINUTE);
summons->SetTarget(player->GetGUID());
summons->SetLootRecipient(player);
summons->CastSpell(summons, SPELL_SPAWN_IN, false);