From e3796fc2654e75ce8e70ff71a61c291bffd9d3de Mon Sep 17 00:00:00 2001 From: Flekz Date: Fri, 26 Apr 2024 10:05:43 +0100 Subject: [PATCH] Add script to go.181054 (ported from https://github.com/cmangos/mangos-wotlk/commit/c5a27bb5364fd499a7bd9bcac17d1d7c88b68cab) --- sql/scriptdev2/scriptdev2.sql | 1 + .../ScriptDevAI/scripts/world/go_scripts.cpp | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/sql/scriptdev2/scriptdev2.sql b/sql/scriptdev2/scriptdev2.sql index fd7d2ea367..24fb61c36d 100644 --- a/sql/scriptdev2/scriptdev2.sql +++ b/sql/scriptdev2/scriptdev2.sql @@ -89,6 +89,7 @@ UPDATE gameobject_template SET ScriptName='go_elemental_rift' WHERE entry IN (17 UPDATE gameobject_template SET ScriptName='go_dragon_head' WHERE entry IN(179556,179558,179881,179882); UPDATE gameobject_template SET ScriptName='go_unadorned_spike' WHERE entry IN(175787); UPDATE gameobject_template SET ScriptName='go_containment_coffer' WHERE entry=122088; +UPDATE gameobject_template SET ScriptName='go_ectoplasmic_distiller_trap' WHERE entry=181054; /* Outdoor PVP*/ -- si diff --git a/src/game/AI/ScriptDevAI/scripts/world/go_scripts.cpp b/src/game/AI/ScriptDevAI/scripts/world/go_scripts.cpp index 32a6ff2a1a..34490613f9 100644 --- a/src/game/AI/ScriptDevAI/scripts/world/go_scripts.cpp +++ b/src/game/AI/ScriptDevAI/scripts/world/go_scripts.cpp @@ -468,6 +468,29 @@ GameObjectAI* GetAI_go_containment(GameObject* go) return new go_containment(go); } +struct go_ectoplasmic_distiller_trap : public GameObjectAI +{ + go_ectoplasmic_distiller_trap(GameObject* go) : GameObjectAI(go), m_castTimer(1000) {} + + uint32 m_castTimer; + + void UpdateAI(const uint32 uiDiff) override + { + if (m_castTimer <= uiDiff) + { + m_go->CastSpell(nullptr, nullptr, m_go->GetGOInfo()->trap.spellId, TRIGGERED_OLD_TRIGGERED); + m_castTimer = 2 * IN_MILLISECONDS; + } + else + m_castTimer -= uiDiff; + } +}; + +GameObjectAI* GetAI_go_ectoplasmic_distiller_trap(GameObject* go) +{ + return new go_ectoplasmic_distiller_trap(go); +} + void AddSC_go_scripts() { Script* pNewScript; @@ -511,4 +534,9 @@ void AddSC_go_scripts() pNewScript->Name = "go_containment_coffer"; pNewScript->GetGameObjectAI = &GetAI_go_containment; pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_ectoplasmic_distiller_trap"; + pNewScript->GetGameObjectAI = &GetAI_go_ectoplasmic_distiller_trap; + pNewScript->RegisterSelf(); }