TrinityCore
boss_rajaxx.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 "ruins_of_ahnqiraj.h"
19#include "ScriptedCreature.h"
20#include "ScriptMgr.h"
21#include "SpellScript.h"
22
24{
25 // The time of our retribution is at hand! Let darkness reign in the hearts of our enemies! Sound: 8645 Emote: 35
26 SAY_ANDOROV_INTRO = 0, // Before for the first wave
27 SAY_ANDOROV_ATTACK = 1, // Beginning the event
28
41 SAY_COMPLETE_QUEST = 12 // Yell when realm complete quest 8743 for world event
42 // Warriors, Captains, continue the fight! Sound: 8640
43};
44
46{
49 SPELL_THUNDERCRASH = 25599
50};
51
53{
54 EVENT_DISARM = 1, // 03:58:27, 03:58:49
55 EVENT_THUNDERCRASH = 2, // 03:58:29, 03:58:50
57};
58
60{
61 public:
62 boss_rajaxx() : CreatureScript("boss_rajaxx") { }
63
64 struct boss_rajaxxAI : public BossAI
65 {
66 boss_rajaxxAI(Creature* creature) : BossAI(creature, DATA_RAJAXX)
67 {
68 Initialize();
69 }
70
72 {
73 enraged = false;
74 }
75
76 void Reset() override
77 {
78 _Reset();
79 Initialize();
82 }
83
84 void UpdateAI(uint32 diff) override
85 {
86 if (!UpdateVictim())
87 return;
88
89 events.Update(diff);
90
92 return;
93
94 while (uint32 eventId = events.ExecuteEvent())
95 {
96 switch (eventId)
97 {
98 case EVENT_DISARM:
101 break;
105 break;
106 default:
107 break;
108 }
109
111 return;
112 }
113 }
114 private:
116 };
117
118 CreatureAI* GetAI(Creature* creature) const override
119 {
120 return GetAQ20AI<boss_rajaxxAI>(creature);
121 }
122};
123
124// 25599 - Thundercrash
126{
127 static void HandleDamageCalc(Unit const* victim, int32& damage, int32& /*flatMod*/, float& /*pctMod*/)
128 {
129 damage = victim->CountPctFromCurHealth(50);
130 }
131
132 void Register() override
133 {
135 }
136};
137
139{
140 new boss_rajaxx();
142}
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
#define SpellCalcDamageFn(F)
Definition: SpellScript.h:879
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ SAY_DEATH
Definition: boss_rajaxx.cpp:38
@ SAY_UNK3
Definition: boss_rajaxx.cpp:37
@ SAY_UNK1
Definition: boss_rajaxx.cpp:35
@ SAY_WAVE3
Definition: boss_rajaxx.cpp:29
@ SAY_WAVE6
Definition: boss_rajaxx.cpp:32
@ SAY_WAVE5
Definition: boss_rajaxx.cpp:31
@ SAY_ANDOROV_ATTACK
Definition: boss_rajaxx.cpp:27
@ SAY_KILLS_ANDOROV
Definition: boss_rajaxx.cpp:40
@ SAY_ANDOROV_INTRO
Definition: boss_rajaxx.cpp:26
@ SAY_UNK2
Definition: boss_rajaxx.cpp:36
@ SAY_CHANGEAGGRO
Definition: boss_rajaxx.cpp:39
@ SAY_COMPLETE_QUEST
Definition: boss_rajaxx.cpp:41
@ SAY_WAVE4
Definition: boss_rajaxx.cpp:30
@ SAY_INTRO
Definition: boss_rajaxx.cpp:34
@ SAY_WAVE7
Definition: boss_rajaxx.cpp:33
@ SPELL_FRENZY
Definition: boss_rajaxx.cpp:48
@ SPELL_THUNDERCRASH
Definition: boss_rajaxx.cpp:49
@ SPELL_DISARM
Definition: boss_rajaxx.cpp:47
void AddSC_boss_rajaxx()
@ EVENT_DISARM
Definition: boss_rajaxx.cpp:54
@ EVENT_THUNDERCRASH
Definition: boss_rajaxx.cpp:55
@ EVENT_CHANGE_AGGRO
Definition: boss_rajaxx.cpp:56
Yells
EventMap events
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
HookList< DamageAndHealingCalcHandler > CalcDamage
Definition: SpellScript.h:878
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
uint64 CountPctFromCurHealth(int32 pct) const
Definition: Unit.h:786
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
CreatureAI * GetAI(Creature *creature) const override
void Register() override
static void HandleDamageCalc(Unit const *victim, int32 &damage, int32 &, float &)
@ DATA_RAJAXX
boss_rajaxxAI(Creature *creature)
Definition: boss_rajaxx.cpp:66
void UpdateAI(uint32 diff) override
Definition: boss_rajaxx.cpp:84