Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port from JadeCore547 Source. #157

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions src/server/scripts/Toys/npc_toy.cpp
Original file line number Diff line number Diff line change
@@ -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();
}
Loading