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 /*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
64 }
65
66private:
68};
69
75
76// 32348 - Summon Arcane Fiends
102
uint32_t uint32
Definition Define.h:133
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_SCRIPT_EFFECT
@ FACTION_MONSTER_2
#define SpellEffectFn(F, I, N)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
Unit * GetCaster() const
HookList< EffectHandler > OnEffectHit
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
TaskScheduler & CancelAll()
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
TaskScheduler & Update(success_t const &callback=EmptyCallback)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Definition Unit.h:783
void SetFaction(uint32 faction) override
Definition Unit.h:988
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2833
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_mana_tombs_summon_arcane_fiends)
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:47
ScriptedAI(Creature *creature)
void JustAppeared() override
void UpdateAI(uint32 diff) override
TaskScheduler _scheduler
void JustEngagedWith(Unit *) override
void Reset() override