fix(Scripts/Midsummer): correctly despawn gameobjects (#19387)
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
-- delete SAI of firework objects
|
||||||
|
UPDATE `gameobject_template` SET `AIName` = '' WHERE (`entry` IN (180703, 180704, 180707, 180708, 180720, 180721, 180722, 180723, 180724, 180725, 180726, 180727, 180728, 180729, 180730, 180731, 180733, 180736, 180737, 180738, 180739, 180740, 180741));
|
||||||
|
DELETE FROM `smart_scripts` WHERE (`source_type` = 1 AND `id` IN (0, 1) AND `entryorguid` IN (180703, 180704, 180707, 180708, 180720, 180721, 180722, 180723, 180724, 180725, 180726, 180727, 180728, 180729, 180730, 180731, 180733, 180736, 180737, 180738, 180739, 180740, 180741));
|
||||||
@@ -164,7 +164,7 @@ struct go_firework_show : public GameObjectAI
|
|||||||
uint32 posIdx = _show->schedule.entries[_curIdx].spawnIndex;
|
uint32 posIdx = _show->schedule.entries[_curIdx].spawnIndex;
|
||||||
if (posIdx < _show->spawns.size)
|
if (posIdx < _show->spawns.size)
|
||||||
{
|
{
|
||||||
me->SummonGameObject(_show->schedule.entries[_curIdx].gameobjectId,
|
GameObject* go = me->SummonGameObject(_show->schedule.entries[_curIdx].gameobjectId,
|
||||||
_show->spawns.entries[posIdx].x,
|
_show->spawns.entries[posIdx].x,
|
||||||
_show->spawns.entries[posIdx].y,
|
_show->spawns.entries[posIdx].y,
|
||||||
_show->spawns.entries[posIdx].z,
|
_show->spawns.entries[posIdx].z,
|
||||||
@@ -174,6 +174,13 @@ struct go_firework_show : public GameObjectAI
|
|||||||
_show->spawns.entries[posIdx].rot2,
|
_show->spawns.entries[posIdx].rot2,
|
||||||
_show->spawns.entries[posIdx].rot3,
|
_show->spawns.entries[posIdx].rot3,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
|
// trigger despawn animation for firework explosion
|
||||||
|
if (go)
|
||||||
|
{
|
||||||
|
go->DespawnOrUnsummon();
|
||||||
|
go->AddObjectToRemoveList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 ts = _show->schedule.entries[_curIdx].timestamp;
|
uint32 ts = _show->schedule.entries[_curIdx].timestamp;
|
||||||
|
|||||||
@@ -243,6 +243,7 @@ struct npc_midsummer_bonfire : public ScriptedAI
|
|||||||
if (_spellFocus)
|
if (_spellFocus)
|
||||||
{
|
{
|
||||||
_spellFocus->DespawnOrUnsummon();
|
_spellFocus->DespawnOrUnsummon();
|
||||||
|
_spellFocus->AddObjectToRemoveList();
|
||||||
_spellFocus = nullptr;
|
_spellFocus = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,7 +379,10 @@ struct npc_midsummer_bonfire_despawner : public ScriptedAI
|
|||||||
{
|
{
|
||||||
// spawnID is 0 for temp spawns
|
// spawnID is 0 for temp spawns
|
||||||
if (0 == (*itr)->GetSpawnId())
|
if (0 == (*itr)->GetSpawnId())
|
||||||
|
{
|
||||||
(*itr)->DespawnOrUnsummon();
|
(*itr)->DespawnOrUnsummon();
|
||||||
|
(*itr)->AddObjectToRemoveList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
me->DespawnOrUnsummon();
|
me->DespawnOrUnsummon();
|
||||||
|
|||||||
Reference in New Issue
Block a user