fix(Scripts/Midsummer): Stop Bonfires from spawning more gameobjects (#16618)
* Update midsummer.cpp * .
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
--
|
||||||
|
UPDATE `creature_template` SET `ScriptName` = '' WHERE (`entry` = 16592);
|
||||||
@@ -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
|
struct npc_midsummer_torch_target : public ScriptedAI
|
||||||
{
|
{
|
||||||
npc_midsummer_torch_target(Creature* creature) : ScriptedAI(creature)
|
npc_midsummer_torch_target(Creature* creature) : ScriptedAI(creature)
|
||||||
@@ -542,7 +505,6 @@ void AddSC_event_midsummer_scripts()
|
|||||||
{
|
{
|
||||||
// NPCs
|
// NPCs
|
||||||
new go_midsummer_bonfire();
|
new go_midsummer_bonfire();
|
||||||
RegisterCreatureAI(npc_midsummer_bonfire);
|
|
||||||
RegisterCreatureAI(npc_midsummer_torch_target);
|
RegisterCreatureAI(npc_midsummer_torch_target);
|
||||||
|
|
||||||
// Spells
|
// Spells
|
||||||
|
|||||||
Reference in New Issue
Block a user