mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
fix(Scripts/Midsummer): Stop Bonfires from spawning more gameobjects (#16618)
* Update midsummer.cpp * .
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user