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 }
67
68private:
70};
71
73{
75
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
uint32_t uint32
Definition Define.h:154
#define RegisterCreatureAI(ai_name)
Definition ScriptMgr.h:1392
@ UNIT_STATE_CASTING
Definition Unit.h:276
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
void Reset()
Definition EventMap.cpp:25
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:180
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
ShamanEvents
@ EVENT_SHAMAN_FIRESHIELD
@ EVENT_SHAMAN_ANGEREDEARTH
@ EVENT_SHAMAN_FIRENOVA
@ EVENT_SHAMAN_FIREBLAST
ShamanSpells
@ 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)