TrinityCore
Loading...
Searching...
No Matches
boss_tharon_ja.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 * Known Issues: Spell 49356 and 53463 will be interrupted for an unknown reason
20 */
21
22#include "ScriptMgr.h"
23#include "drak_tharon_keep.h"
24#include "ScriptedCreature.h"
25#include "SpellScript.h"
26
35
37{
38 // Skeletal Spells (phase 1)
42 SPELL_DECAY_FLESH = 49356, // cast at end of phase 1, starts phase 2
43 // Flesh Spells (phase 2)
49 SPELL_RETURN_FLESH = 53463, // Channeled spell ending phase two and returning to phase 1. This ability will stun the party for 6 seconds.
52 SPELL_DUMMY = 49551
53};
54
70
72{
73 MODEL_FLESH = 27073
74};
75
76// 26632 - The Prophet Tharon'ja
77struct boss_tharon_ja : public BossAI
78{
79 boss_tharon_ja(Creature* creature) : BossAI(creature, DATA_THARON_JA) { }
80
81 void Reset() override
82 {
83 _Reset();
85 }
86
97
98 void KilledUnit(Unit* who) override
99 {
100 if (who->GetTypeId() == TYPEID_PLAYER)
101 Talk(SAY_KILL);
102 }
103
104 void JustDied(Unit* /*killer*/) override
105 {
106 _JustDied();
107
111 }
112
113 void UpdateAI(uint32 diff) override
114 {
115 if (!UpdateVictim())
116 return;
117
118 events.Update(diff);
119
121 return;
122
123 while (uint32 eventId = events.ExecuteEvent())
124 {
125 switch (eventId)
126 {
128 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
130 events.Repeat(10s, 15s);
131 return;
134 events.Repeat(8s, 10s);
135 return;
137 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
138 DoCast(target, SPELL_RAIN_OF_FIRE);
139 events.Repeat(14s, 18s);
140 return;
142 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
144 events.Repeat(6s, 7s);
145 return;
146 case EVENT_EYE_BEAM:
147 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
148 DoCast(target, SPELL_EYE_BEAM);
149 events.Repeat(4s, 6s);
150 return;
153 events.Repeat(10s, 12s);
154 return;
158 return;
164 DoCast(me, SPELL_DUMMY, true);
165
166 events.Reset();
171 break;
175 return;
180
181 events.Reset();
186 break;
187 default:
188 break;
189 }
190
192 return;
193 }
194 }
195};
196
197// 53242 - Clear Gift of Tharon'ja
199{
200 bool Validate(SpellInfo const* /*spellInfo*/) override
201 {
203 }
204
205 void HandleScript(SpellEffIndex /*effIndex*/)
206 {
207 if (Unit* target = GetHitUnit())
208 target->RemoveAura(SPELL_GIFT_OF_THARON_JA);
209 }
210
215};
216
uint32_t uint32
Definition Define.h:154
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_SCRIPT_EFFECT
#define SpellEffectFn(F, I, N)
@ UNIT_STATE_CASTING
Definition Unit.h:290
TharonjaSpells
@ SPELL_CLEAR_GIFT_OF_THARON_JA
@ SPELL_DECAY_FLESH
@ SPELL_ACHIEVEMENT_CHECK
@ SPELL_FLESH_VISUAL
@ SPELL_SHADOW_VOLLEY
@ SPELL_DUMMY
@ SPELL_EYE_BEAM
@ SPELL_CURSE_OF_LIFE
@ SPELL_RETURN_FLESH
@ SPELL_RAIN_OF_FIRE
@ SPELL_GIFT_OF_THARON_JA
@ SPELL_LIGHTNING_BREATH
@ SPELL_POISON_CLOUD
TharonjaTexts
@ SAY_DEATH
@ SAY_FLESH
@ SAY_AGGRO
@ SAY_KILL
@ SAY_SKELETON
TharonjaEvents
@ EVENT_POISON_CLOUD
@ EVENT_GOING_SKELETAL
@ EVENT_DECAY_FLESH
@ EVENT_EYE_BEAM
@ EVENT_SHADOW_VOLLEY
@ EVENT_GOING_FLESH
@ EVENT_RAIN_OF_FIRE
@ EVENT_CURSE_OF_LIFE
@ EVENT_RETURN_FLESH
@ EVENT_LIGHTNING_BREATH
TharonjaMisc
@ MODEL_FLESH
void AddSC_boss_tharon_ja()
TypeID GetTypeId() const
Definition BaseEntity.h:166
void JustEngagedWith(Unit *who) override
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
void SetDisplayId(uint32 displayId, bool setNative=false) override
void Update(uint32 time)
Definition EventMap.h:77
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
EventId ExecuteEvent()
Definition EventMap.cpp:77
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:40
void Reset()
Definition EventMap.cpp:25
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:172
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:71
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:162
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:81
Definition Unit.h:647
void RestoreDisplayId(bool ignorePositiveAurasPreventingMounting=false)
Definition Unit.cpp:10876
bool HasUnitState(const uint32 f) const
Definition Unit.h:755
bool Validate(SpellInfo const *) override
#define RegisterDrakTharonKeepCreatureAI(ai_name)
@ DATA_THARON_JA
void JustDied(Unit *) override
void UpdateAI(uint32 diff) override
void KilledUnit(Unit *who) override
boss_tharon_ja(Creature *creature)
void JustEngagedWith(Unit *who) override
void Reset() override