TrinityCore
Loading...
Searching...
No Matches
boss_archavon.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 "ScriptMgr.h"
19#include "ScriptedCreature.h"
20#include "SpellScript.h"
21#include "vault_of_archavon.h"
22
28
41
50
51struct boss_archavon : public BossAI
52{
53 boss_archavon(Creature* creature) : BossAI(creature, DATA_ARCHAVON) { }
54
64
65 // Below UpdateAI may need review/debug.
66 void UpdateAI(uint32 diff) override
67 {
68 if (!UpdateVictim())
69 return;
70
71 events.Update(diff);
72
74 return;
75
76 while (uint32 eventId = events.ExecuteEvent())
77 {
78 switch (eventId)
79 {
84 break;
86 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, -10.0f, true))
87 {
88 DoCast(target, SPELL_CRUSHING_LEAP, true); // 10y~80y, ignore range
89 Talk(EMOTE_LEAP, target);
90 }
92 break;
93 case EVENT_STOMP:
97 break;
98 case EVENT_IMPALE:
100 break;
101 case EVENT_BERSERK:
104 break;
105 default:
106 break;
107 }
108
110 return;
111 }
112 }
113};
114
115// 58941 - Rock Shards
117{
118 bool Validate(SpellInfo const* /*spellInfo*/) override
119 {
120 return ValidateSpellInfo(
121 {
126 });
127 }
128
129 void HandleScript(SpellEffIndex /*effIndex*/)
130 {
131 Unit* caster = GetCaster();
132
133 for (uint8 i = 0; i < 3; ++i)
134 {
135 caster->CastSpell(nullptr, SPELL_ROCK_SHARDS_VISUAL_L, true);
136 caster->CastSpell(nullptr, SPELL_ROCK_SHARDS_VISUAL_R, true);
137 }
138
139 caster->CastSpell(nullptr, SPELL_ROCK_SHARDS_DAMAGE_L, true);
140 caster->CastSpell(nullptr, SPELL_ROCK_SHARDS_DAMAGE_R, true);
141 }
142
147};
148
uint8_t uint8
Definition Define.h:156
uint32_t uint32
Definition Define.h:154
#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:276
ArchavonSpells
@ SPELL_STOMP
@ SPELL_ROCK_SHARDS
@ SPELL_ROCK_SHARDS_DAMAGE_R
@ SPELL_ROCK_SHARDS_VISUAL_R
@ SPELL_ROCK_SHARDS_VISUAL_L
@ SPELL_BERSERK
@ SPELL_CRUSHING_LEAP
@ SPELL_ROCK_SHARDS_DAMAGE_L
@ SPELL_IMPALE
ArchavonTexts
@ EMOTE_LEAP
@ EMOTE_BERSERK
ArchavonEvents
@ EVENT_BERSERK
@ EVENT_ROCK_SHARDS
@ EVENT_STOMP
@ EVENT_IMPALE
@ EVENT_CHOKING_CLOUD
void AddSC_boss_archavon()
void JustEngagedWith(Unit *who) override
EventMap events
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
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Unit * GetCaster() const
HookList< EffectHandler > OnEffectHit
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:180
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:89
Definition Unit.h:635
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override
boss_archavon(Creature *creature)
@ DATA_ARCHAVON
#define RegisterVaultOfArchavonCreatureAI(ai_name)