TrinityCore
Loading...
Searching...
No Matches
boss_hakkar.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 "zulgurub.h"
19#include "DBCStructure.h"
20#include "InstanceScript.h"
21#include "Player.h"
22#include "ScriptedCreature.h"
23#include "ScriptMgr.h"
24
33
35{
36 SPELL_BLOOD_SIPHON = 24322, // Buggy ?
38 SPELL_CAUSE_INSANITY = 24327, // Spell needs scripting.
40 SPELL_ENRAGE = 24318,
41
42 // The Aspects of all High Priests spells
48};
49
51{
54 EVENT_CAUSE_INSANITY = 3, // Spell needs scripting. Event disabled
57
58 // The Aspects of all High Priests events
64};
65
66struct boss_hakkar : public BossAI
67{
68 boss_hakkar(Creature* creature) : BossAI(creature, DATA_HAKKAR) { }
69
70 void Reset() override
71 {
72 _Reset();
73 }
74
75 void JustDied(Unit* /*killer*/) override
76 {
77 _JustDied();
78 }
79
100
101 void UpdateAI(uint32 diff) override
102 {
103 if (!UpdateVictim())
104 return;
105
106 events.Update(diff);
107
109 return;
110
111 while (uint32 eventId = events.ExecuteEvent())
112 {
113 switch (eventId)
114 {
118 break;
122 break;
124 // DoCast(SelectTarget(SelectTargetMethod::Random, 0, 100, true), SPELL_CAUSE_INSANITY);
125 // events.ScheduleEvent(EVENT_CAUSE_INSANITY, 35s, 45s);
126 break;
128 {
129 // Mind Control is only triggered when there is more than one unit currently fighting Hakkar, including pets/guardians
130 // But it is only actually cast on the player with the highest threat
131 std::list<Unit*> unitList;
132 SelectTargetList(unitList, 2, SelectTargetMethod::MaxThreat, 0, 0.0f, false);
133 if (unitList.size() > 1)
136 break;
137 }
138 case EVENT_ENRAGE:
139 if (!me->HasAura(SPELL_ENRAGE))
142 break;
146 break;
150 break;
154 break;
158 break;
162 break;
163 default:
164 break;
165 }
166
168 return;
169 }
170
172 }
173};
174
176{
177public:
178 at_zulgurub_entrance() : OnlyOnceAreaTriggerScript("at_zulgurub_entrance") { }
179
180 bool TryHandleOnce(Player* player, AreaTriggerEntry const* areaTrigger) override
181 {
182 InstanceScript* instance = player->GetInstanceScript();
183 if (!instance || instance->GetBossState(DATA_HAKKAR) == DONE)
184 return true;
185
186 if (Creature* hakkar = instance->GetCreature(DATA_HAKKAR))
187 {
188 switch (areaTrigger->ID)
189 {
190 case AREA_TRIGGER_1:
191 hakkar->AI()->Talk(SAY_ENTRANCE);
192 break;
193 case AREA_TRIGGER_2:
194 hakkar->AI()->Talk(SAY_PROTECT_ALTAR);
195 break;
196 case AREA_TRIGGER_3:
197 hakkar->AI()->Talk(SAY_MINION_DESTROY);
198 break;
199 default:
200 break;
201 }
202 }
203
204 return true;
205 }
206};
207
uint32_t uint32
Definition Define.h:133
@ DONE
Spells
Definition PlayerAI.cpp:32
@ UNIT_STATE_CASTING
Definition Unit.h:235
@ SAY_PROTECT_ALTAR
@ SAY_AGGRO
@ SAY_MINION_DESTROY
@ SAY_ENTRANCE
@ SAY_FLEEING
@ SPELL_CAUSE_INSANITY
@ SPELL_ASPECT_OF_MARLI
@ SPELL_CORRUPTED_BLOOD
@ SPELL_ENRAGE
@ SPELL_BLOOD_SIPHON
@ SPELL_WILL_OF_HAKKAR
@ SPELL_ASPECT_OF_ARLOKK
@ SPELL_ASPECT_OF_THEKAL
@ SPELL_ASPECT_OF_VENOXIS
@ SPELL_ASPECT_OF_JEKLIK
void AddSC_boss_hakkar()
@ EVENT_WILL_OF_HAKKAR
@ EVENT_CAUSE_INSANITY
@ EVENT_ASPECT_OF_VENOXIS
@ EVENT_ASPECT_OF_THEKAL
@ EVENT_ENRAGE
@ EVENT_ASPECT_OF_JEKLIK
@ EVENT_BLOOD_SIPHON
@ EVENT_ASPECT_OF_MARLI
@ EVENT_CORRUPTED_BLOOD
@ EVENT_ASPECT_OF_ARLOKK
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void Update(uint32 time)
Definition EventMap.h:67
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
Creature * GetCreature(uint32 type)
EncounterState GetBossState(uint32 id) const
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
void SelectTargetList(std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:101
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 DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4535
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1087
bool TryHandleOnce(Player *player, AreaTriggerEntry const *areaTrigger) override
void JustDied(Unit *) override
void JustEngagedWith(Unit *who) override
void Reset() override
boss_hakkar(Creature *creature)
void UpdateAI(uint32 diff) override
#define RegisterZulGurubCreatureAI(ai_name)
Definition zulgurub.h:91
@ AREA_TRIGGER_1
Definition zulgurub.h:80
@ AREA_TRIGGER_2
Definition zulgurub.h:81
@ AREA_TRIGGER_3
Definition zulgurub.h:82
@ DATA_THEKAL
Definition zulgurub.h:34
@ DATA_ARLOKK
Definition zulgurub.h:33
@ DATA_HAKKAR
Definition zulgurub.h:35
@ DATA_MARLI
Definition zulgurub.h:32
@ DATA_JEKLIK
Definition zulgurub.h:30
@ DATA_VENOXIS
Definition zulgurub.h:31