TrinityCore
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
27{
32};
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 }
67
68private:
70};
71
73{
75
76 void Reset() override
77 {
78 _events.Reset();
82 }
83
84 void UpdateAI(uint32 diff) override
85 {
86 if (!UpdateVictim())
87 return;
88
90 return;
91
92 _events.Update(diff);
93
94 while (uint32 eventId = _events.ExecuteEvent())
95 {
96 switch (eventId)
97 {
101 break;
105 break;
109 break;
110 default:
111 break;
112 }
113 }
114 }
115
116private:
118};
119
121{
124}
uint32_t uint32
Definition: Define.h:142
#define RegisterCreatureAI(ai_name)
Definition: ScriptMgr.h:1380
@ UNIT_STATE_CASTING
Definition: Unit.h:270
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void Reset()
Definition: EventMap.cpp:21
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
ShamanEvents
Definition: pet_shaman.cpp:35
@ EVENT_SHAMAN_FIRESHIELD
Definition: pet_shaman.cpp:40
@ EVENT_SHAMAN_ANGEREDEARTH
Definition: pet_shaman.cpp:37
@ EVENT_SHAMAN_FIRENOVA
Definition: pet_shaman.cpp:39
@ EVENT_SHAMAN_FIREBLAST
Definition: pet_shaman.cpp:41
ShamanSpells
Definition: pet_shaman.cpp:27
@ SPELL_SHAMAN_FIRESHIELD
Definition: pet_shaman.cpp:31
@ SPELL_SHAMAN_ANGEREDEARTH
Definition: pet_shaman.cpp:28
@ SPELL_SHAMAN_FIRENOVA
Definition: pet_shaman.cpp:30
@ SPELL_SHAMAN_FIREBLAST
Definition: pet_shaman.cpp:29
void AddSC_shaman_pet_scripts()
Definition: pet_shaman.cpp:120
npc_pet_shaman_earth_elemental(Creature *creature)
Definition: pet_shaman.cpp:46
void UpdateAI(uint32 diff) override
Definition: pet_shaman.cpp:54
void UpdateAI(uint32 diff) override
Definition: pet_shaman.cpp:84
npc_pet_shaman_fire_elemental(Creature *creature)
Definition: pet_shaman.cpp:74