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 "ScriptedCreature.h"
24#include "SpellScript.h"
25#include "SpellAuraEffects.h"
26#include "Player.h"
27#include "drak_tharon_keep.h"
28
37
39{
40 // Skeletal Spells (phase 1)
44 SPELL_DECAY_FLESH = 49356, // cast at end of phase 1, starts phase 2
45 // Flesh Spells (phase 2)
51 SPELL_RETURN_FLESH = 53463, // Channeled spell ending phase two and returning to phase 1. This ability will stun the party for 6 seconds.
54 SPELL_DUMMY = 49551
55};
56
72
74{
75 MODEL_FLESH = 27073
76};
77
78// 26632 - The Prophet Tharon'ja
79struct boss_tharon_ja : public BossAI
80{
81 boss_tharon_ja(Creature* creature) : BossAI(creature, DATA_THARON_JA) { }
82
83 void Reset() override
84 {
85 _Reset();
87 }
88
99
100 void KilledUnit(Unit* who) override
101 {
102 if (who->GetTypeId() == TYPEID_PLAYER)
103 Talk(SAY_KILL);
104 }
105
106 void JustDied(Unit* /*killer*/) override
107 {
108 _JustDied();
109
113 }
114
115 void UpdateAI(uint32 diff) override
116 {
117 if (!UpdateVictim())
118 return;
119
120 events.Update(diff);
121
123 return;
124
125 while (uint32 eventId = events.ExecuteEvent())
126 {
127 switch (eventId)
128 {
130 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
132 events.Repeat(10s, 15s);
133 return;
136 events.Repeat(8s, 10s);
137 return;
139 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
140 DoCast(target, SPELL_RAIN_OF_FIRE);
141 events.Repeat(14s, 18s);
142 return;
144 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
146 events.Repeat(6s, 7s);
147 return;
148 case EVENT_EYE_BEAM:
149 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
150 DoCast(target, SPELL_EYE_BEAM);
151 events.Repeat(4s, 6s);
152 return;
155 events.Repeat(10s, 12s);
156 return;
160 return;
166 DoCast(me, SPELL_DUMMY, true);
167
168 events.Reset();
173 break;
177 return;
182
183 events.Reset();
188 break;
189 default:
190 break;
191 }
192
194 return;
195 }
196
198 }
199};
200
201// 53242 - Clear Gift of Tharon'ja
222
uint32_t uint32
Definition Define.h:133
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_SCRIPT_EFFECT
#define SpellEffectFn(F, I, N)
@ UNIT_STATE_CASTING
Definition Unit.h:235
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()
void JustEngagedWith(Unit *who) override
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void SetDisplayId(uint32 modelId) override
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
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
TypeID GetTypeId() const
Definition Object.h:93
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:243
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
void RestoreDisplayId()
Definition Unit.cpp:10415
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_tharon_ja_clear_gift_of_tharon_ja)
#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