TrinityCore
Loading...
Searching...
No Matches
boss_doomwalker_anniversary.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 "MovementDefines.h"
19#include "ScriptMgr.h"
20#include "ScriptedCreature.h"
21
35
45
53
59
60// 167749 - Doomwalker
62{
64
65 void JustDied(Unit* killer) override
66 {
69 }
70
71 void KilledUnit(Unit* victim) override
72 {
73 if (victim->GetTypeId() == TYPEID_PLAYER)
75 }
76
87
88 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo*/) override
89 {
90 if (me->HealthBelowPctDamaged(20, damage))
91 {
94 }
95 }
96
97 void MovementInform(uint32 type, uint32 id) override
98 {
99 if (type == POINT_MOTION_TYPE && id == POINT_OVERRUN)
100 {
103
104 if (Creature* overrunTarget = me->FindNearestCreature(NPC_OVERRUN_TARGET, 50.0f))
105 overrunTarget->DespawnOrUnsummon();
106 }
107 }
108
109 void UpdateAI(uint32 diff) override
110 {
111 if (!UpdateVictim())
112 return;
113
114 events.Update(diff);
115
117 return;
118
119 while (uint32 eventId = events.ExecuteEvent())
120 {
121 switch (eventId)
122 {
123 case EVENT_OVERRUN:
124 {
130 break;
131 }
132 case EVENT_EARTHQUAKE:
133 {
137 break;
138 }
140 {
141 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
144 break;
145 }
147 {
150 break;
151 }
152 default:
153 break;
154 }
155
157 return;
158 }
159 }
160};
161
uint32_t uint32
Definition Define.h:154
@ POINT_MOTION_TYPE
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
#define RegisterCreatureAI(ai_name)
Definition ScriptMgr.h:1392
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
DamageEffectType
@ UNIT_STATE_CASTING
Definition Unit.h:276
@ SPELL_OVERRUN_TARGET_SPAWN_EFFECT
void AddSC_boss_doomwalker_anniversary()
TypeID GetTypeId() const
Definition BaseEntity.h:166
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
void SetReactState(ReactStates st)
Definition Creature.h:174
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
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
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 HealthBelowPctDamaged(float pct, uint32 damage) const
Definition Unit.h:793
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3974
void JustDied(Unit *) override
void JustEngagedWith(Unit *) override
WorldBossAI(Creature *creature) noexcept
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:1517
void KilledUnit(Unit *victim) override
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void MovementInform(uint32 type, uint32 id) override