fix(Scripts/Midsummer): Stop Bonfires from spawning more gameobjects (#16618)

* Update midsummer.cpp

* .
This commit is contained in:
Gultask
2023-06-24 20:29:05 -03:00
committed by GitHub
parent 607aea43c2
commit c0bbb52483
2 changed files with 2 additions and 38 deletions

View File

@@ -46,43 +46,6 @@ public:
}
};
struct npc_midsummer_bonfire : public ScriptedAI
{
npc_midsummer_bonfire(Creature* creature) : ScriptedAI(creature)
{
me->IsAIEnabled = true;
goGUID.Clear();
if (GameObject* go = me->SummonGameObject(GO_MIDSUMMER_BONFIRE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0))
{
goGUID = go->GetGUID();
me->RemoveGameObject(go, false);
}
}
ObjectGuid goGUID;
void SpellHit(Unit*, SpellInfo const* spellInfo) override
{
if (!goGUID)
return;
// Extinguish fire
if (spellInfo->Id == SPELL_STAMP_OUT_BONFIRE)
{
if (GameObject* go = ObjectAccessor::GetGameObject(*me, goGUID))
go->SetPhaseMask(2, true);
}
else if (spellInfo->Id == SPELL_LIGHT_BONFIRE)
{
if (GameObject* go = ObjectAccessor::GetGameObject(*me, goGUID))
{
go->SetPhaseMask(1, true);
go->SendCustomAnim(1);
}
}
}
};
struct npc_midsummer_torch_target : public ScriptedAI
{
npc_midsummer_torch_target(Creature* creature) : ScriptedAI(creature)
@@ -542,7 +505,6 @@ void AddSC_event_midsummer_scripts()
{
// NPCs
new go_midsummer_bonfire();
RegisterCreatureAI(npc_midsummer_bonfire);
RegisterCreatureAI(npc_midsummer_torch_target);
// Spells