TrinityCore
Loading...
Searching...
No Matches
boss_armsmaster_harlan.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 "CreatureAI.h"
19#include "CreatureAIImpl.h"
20#include "InstanceScript.h"
21#include "MotionMaster.h"
22#include "ObjectAccessor.h"
23#include "ScriptMgr.h"
24#include "ScriptedCreature.h"
25#include "SpellScript.h"
26#include "SpellAuras.h"
27#include "SharedDefines.h"
28#include "Vehicle.h"
29#include "scarlet_halls.h"
30
46
57
66
72
73// 58632 - Armsmaster Harlan
75{
77
87
95
96 void Reset() override
97 {
98 _Reset();
99 _berserkerRage = false;
100 }
101
102 void JustDied(Unit* /*killer*/) override
103 {
104 _JustDied();
107 }
108
121
122 void DamageTaken(Unit* /*killer*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
123 {
124 if (!_berserkerRage && me->HealthBelowPctDamaged(50, damage))
125 {
126 _berserkerRage = true;
128 }
129 }
130
138
185private:
187};
188
189// 111216 - Blades of Light
191{
193 {
194 Creature* caster = GetCaster()->ToCreature();
195 if (!caster)
196 return;
197
198 caster->GetMotionMaster()->Clear();
199 caster->SetHover(true);
200
201 if (urand(0, 1) == 0)
203 else
205 }
206
211};
212
213// 111394 - Blades of Light
235
236// 112953 - Leave Vehicle
249
250// 113959 - Heavy Armor
263
264// 128930 - Eject Spirits of Redemption
266{
268 {
269 Vehicle* veh = GetCaster()->GetVehicleKit();
270 if (!veh)
271 return;
272
273 for (auto const& [_, seat] : veh->Seats)
274 {
275 Unit* passenger = ObjectAccessor::GetUnit(*GetCaster(), seat.Passenger.Guid);
276 if (!passenger)
277 continue;
278
280 passenger->ExitVehicle();
281 }
282 }
283
288};
289
uint32_t uint32
Definition Define.h:154
@ ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_ENGAGE
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:42
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ EVENT_JUMP
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_SPIRIT_OF_REDEMPTION
@ SPELL_AURA_SCHOOL_ABSORB
#define SpellEffectFn(F, I, N)
#define SpellCastFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
EvadeReason
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
DamageEffectType
@ UNIT_STATE_CASTING
Definition Unit.h:276
@ PATH_HARLAN_BLADES_OF_LIGHT_LEFT
@ PATH_HARLAN_BLADES_OF_LIGHT_RIGHT
@ SPELL_HARLAN_CALL_REINFORCEMENT
@ SPELL_HARLAN_BLADES_OF_LIGHT_VEHICLE
@ SPELL_HARLAN_BLADES_OF_LIGHT_CAST
@ SPELL_HARLAN_HEROIC_LEAP_JUMP
@ SPELL_HARLAN_LEAVE_VEHICLE
@ SPELL_HARLAN_BERSERKERS_RAGE
@ SPELL_SCARLET_DEFENDER_UNARMORED
@ SPELL_HARLAN_BLADES_OF_LIGHT_DAMAGE
@ SPELL_HARLAN_DRAGONS_REACH
@ EVENT_HARLAN_BERSERKER_RAGE
@ EVENT_HARLAN_CALL_FOR_HELP
@ EVENT_HARLAN_FINISH_BLADES_OF_LIGHT
@ EVENT_HARLAN_HEROIC_LEAP
@ EVENT_HARLAN_CALL_REINFORCEMENT
@ EVENT_HARLAN_DRAGONS_REACH
@ EVENT_HARLAN_BLADES_OF_LIGHT
@ ANNOUNCE_HARLAN_BLADE_FOR_LIGHT
@ ANNOUNCE_HARLAN_CALL_FOR_HELP
@ SAY_HARLAN_CALL_FOR_HELP
void AddSC_boss_armsmaster_harlan()
HookList< EffectApplyHandler > AfterEffectRemove
Unit * GetTarget() const
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
TaskScheduler scheduler
SummonList summons
EventMap events
bool _EnterEvadeMode(EvadeReason why=EvadeReason::Other)
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
void CancelEvent(uint32 eventId)
Definition EventMap.cpp:135
void SendEncounterUnit(EncounterFrameType type, Unit const *unit, Optional< int32 > param1={}, Optional< int32 > param2={})
void MovePath(uint32 pathId, bool repeatable, Optional< Milliseconds > duration={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< std::pair< Milliseconds, Milliseconds > > waitTimeRangeAtPathEnd={}, Optional< float > wanderDistanceAtPathEnds={}, Optional< bool > followPathBackwardsFromEndToStart={}, Optional< bool > exactSplinePath={}, bool generatePath=true, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
Creature * ToCreature()
Definition Object.h:121
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
HookList< CastHandler > AfterCast
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
TaskScheduler & Update()
Update the scheduler to the current time.
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:180
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:89
Definition Unit.h:635
MotionMaster * GetMotionMaster()
Definition Unit.h:1723
bool SetHover(bool enable, bool updateAnimTier=true)
Definition Unit.cpp:13577
bool HasAuraType(AuraType auraType) const
Definition Unit.cpp:4814
bool HealthBelowPctDamaged(float pct, uint32 damage) const
Definition Unit.h:793
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
Vehicle * GetVehicleKit() const
Definition Unit.h:1782
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3974
virtual void ExitVehicle(Position const *exitPosition=nullptr)
Definition Unit.cpp:12835
SeatMap Seats
The collection of all seats on the vehicle. Including vacant ones.
Definition Vehicle.h:67
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
@ DATA_ARMSMASTER_HARLAN
#define RegisterScarletHallsCreatureAI(ai_name)
void JustEngagedWith(Unit *who) override
void WaypointPathEnded(uint32, uint32) override
void UpdateAI(uint32 diff) override
boss_armsmaster_harlan(Creature *creature)
void EnterEvadeMode(EvadeReason) override
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void MovementInform(uint32, uint32 id) override