From f17ab957d6bd447f39cd1d761f38be0e89a6e9c9 Mon Sep 17 00:00:00 2001 From: Terragor <81566364+zTerragor@users.noreply.github.com> Date: Wed, 15 Nov 2023 08:48:43 +0500 Subject: [PATCH] Port from JadeCore547 Source. Port from JadeCore547 Source. --- src/server/scripts/Toys/npc_toy.cpp | 54 +++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/server/scripts/Toys/npc_toy.cpp diff --git a/src/server/scripts/Toys/npc_toy.cpp b/src/server/scripts/Toys/npc_toy.cpp new file mode 100644 index 000000000..f39eb1fd9 --- /dev/null +++ b/src/server/scripts/Toys/npc_toy.cpp @@ -0,0 +1,54 @@ +//////////////////////////////////////////////////////////////////////////////// +/// +/// MILLENIUM-STUDIO +/// Copyright 2015 Millenium-studio SARL +/// All Rights Reserved. +/// +//////////////////////////////////////////////////////////////////////////////// + +#include "ScriptMgr.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" +#include "GridNotifiers.h" +#include "ScriptedCreature.h" + +/// Mini Mana Bomb - 65903 +class npc_toy_mini_maba_bomb : public CreatureScript +{ + public: + npc_toy_mini_maba_bomb() : CreatureScript("npc_toy_mini_maba_bomb") { } + + enum eSpell + { + ArcaneExplosionVisualLarge = 98122 + }; + + struct npc_toy_mini_maba_bombAI : public ScriptedAI + { + npc_toy_mini_maba_bombAI(Creature* p_Creature) : ScriptedAI(p_Creature) { } + + void Reset() override + { + AddTimedDelayedOperation(4 * TimeConstants::IN_MILLISECONDS + 900, [this]() -> void + { + me->CastSpell(me, eSpell::ArcaneExplosionVisualLarge, true); + me->DespawnOrUnsummon(); + }); + } + + void UpdateAI(uint32 const p_Diff) override + { + UpdateOperations(p_Diff); + } + }; + + CreatureAI* GetAI(Creature* p_Creature) const override + { + return new npc_toy_mini_maba_bombAI(p_Creature); + } +}; + +void AddSC_npc_toy() +{ + new npc_toy_mini_maba_bomb(); +}