TrinityCore
Loading...
Searching...
No Matches
pet_shaman.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/*
19 * Ordered alphabetically using scriptname.
20 * Scriptnames of files in this file should be prefixed with "npc_pet_sha_".
21 */
22
23#include "ScriptMgr.h"
24#include "ScriptedCreature.h"
25
33
35{
36 // Earth Elemental
38 // Fire Elemental
42};
43
45{
47
48 void Reset() override
49 {
50 _events.Reset();
52 }
53
54 void UpdateAI(uint32 diff) override
55 {
56 if (!UpdateVictim())
57 return;
58
59 _events.Update(diff);
60
62 {
65 }
66
68 }
69
70private:
72};
73
75{
77
85
86 void UpdateAI(uint32 diff) override
87 {
88 if (!UpdateVictim())
89 return;
90
92 return;
93
94 _events.Update(diff);
95
96 while (uint32 eventId = _events.ExecuteEvent())
97 {
98 switch (eventId)
99 {
103 break;
107 break;
111 break;
112 default:
113 break;
114 }
115 }
116
118 }
119
120private:
122};
123
uint32_t uint32
Definition Define.h:133
#define RegisterCreatureAI(ai_name)
Definition ScriptMgr.h:1139
@ UNIT_STATE_CASTING
Definition Unit.h:235
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void Update(uint32 time)
Definition EventMap.h:67
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
void Reset()
Definition EventMap.cpp:21
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
ShamanEvents
@ EVENT_SHAMAN_FIRESHIELD
@ EVENT_SHAMAN_ANGEREDEARTH
@ EVENT_SHAMAN_FIRENOVA
@ EVENT_SHAMAN_FIREBLAST
@ SPELL_SHAMAN_FIRESHIELD
@ SPELL_SHAMAN_ANGEREDEARTH
@ SPELL_SHAMAN_FIRENOVA
@ SPELL_SHAMAN_FIREBLAST
void AddSC_shaman_pet_scripts()
npc_pet_shaman_earth_elemental(Creature *creature)
void UpdateAI(uint32 diff) override
void UpdateAI(uint32 diff) override
npc_pet_shaman_fire_elemental(Creature *creature)