TrinityCore
Loading...
Searching...
No Matches
mana_tombs.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ScriptMgr.h"
19#include "ScriptedCreature.h"
20#include "SpellScript.h"
21#include "Unit.h"
22#include "mana_tombs.h"
23
25{
27};
28
29// 22930 - Yor
30struct npc_yor : public ScriptedAI
31{
33
34 void JustAppeared() override
35 {
36 _scheduler.Schedule(1500ms, [this](TaskContext const& /*task*/)
37 {
39 });
40 }
41
42 void Reset() override
43 {
45 }
46
47 void JustEngagedWith(Unit* /*who*/) override
48 {
49 _scheduler.Schedule(6s, 14s, [this](TaskContext& task)
50 {
52 task.Repeat(8s, 14s);
53 });
54 }
55
56 void UpdateAI(uint32 diff) override
57 {
58 _scheduler.Update(diff);
59
60 if (!UpdateVictim())
61 return;
62 }
63
64private:
66};
67
73
74// 32348 - Summon Arcane Fiends
76{
77 bool Validate(SpellInfo const* /*spellInfo*/) override
78 {
79 return ValidateSpellInfo(
80 {
83 });
84 }
85
86 void HandleScript(SpellEffIndex /*effIndex*/)
87 {
88 Unit* caster = GetCaster();
89 caster->CastSpell(nullptr, SPELL_SUMMON_ARCANE_FIEND_1, true);
90 caster->CastSpell(nullptr, SPELL_SUMMON_ARCANE_FIEND_2, true);
91 }
92
97};
98
uint32_t uint32
Definition Define.h:154
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_SCRIPT_EFFECT
@ FACTION_MONSTER_2
#define SpellEffectFn(F, I, N)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Unit * GetCaster() const
HookList< EffectHandler > OnEffectHit
TaskContext & Repeat(TaskScheduler::duration_t duration)
TaskScheduler & CancelAll()
TaskScheduler & Schedule(duration_t time, task_handler_t task)
TaskScheduler & Update()
Update the scheduler to the current time.
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:172
Definition Unit.h:647
void SetFaction(uint32 faction) override
Definition Unit.h:887
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
bool Validate(SpellInfo const *) override
void AddSC_mana_tombs()
SummonArcaneFiends
@ SPELL_SUMMON_ARCANE_FIEND_1
@ SPELL_SUMMON_ARCANE_FIEND_2
YorSpells
@ SPELL_DOUBLE_BREATH
#define RegisterManaTombsCreatureAI(ai_name)
Definition mana_tombs.h:48
ScriptedAI(Creature *creature, uint32 scriptId=0) noexcept
void JustAppeared() override
void UpdateAI(uint32 diff) override
TaskScheduler _scheduler
void JustEngagedWith(Unit *) override
void Reset() override