34#include <G3D/Vector3.h>
330 { 2134.889893f, -298.632996f, 438.247467f },
331 { 2134.570068f, -440.317993f, 438.247467f },
332 { 2167.820312f, -440.330261f, 438.247589f },
333 { 2213.394287f, -433.318298f, 412.665863f },
334 { 2227.766113f, -433.275818f, 412.177032f },
335 { 2227.551270f, -263.081085f, 412.176880f },
336 { 2202.208008f, -262.939270f, 412.168976f },
337 { 2182.310059f, -263.233093f, 414.739410f }
486 miniBoss->Respawn(
true);
497 pillar->RemoveAllAuras();
500 controller->RemoveAllAuras();
555 sif->DespawnOrUnsummon(6s);
584 controller->RemoveAllAuras();
586 pillar->RemoveAllAuras();
593 sif->DespawnOrUnsummon(10s);
636 runicColossus->SetImmuneToPC(
false);
665 init.MovebyPath(path);
769 std::list<Creature*> triggers;
771 triggers.remove_if([](
Creature* bunny)
782 triggers.remove_if([](
Creature* bunny)
792 for (
auto itr = triggers.cbegin(); itr != triggers.cend();)
795 if (itr != triggers.cend())
855 triggerList.remove_if([](
Creature* bunny)
862 if (triggerList.empty())
869 triggerList.push_back(bunny);
882 std::list<Creature*> triggers;
895 std::list<Creature*> triggers;
904 std::list<Creature*> triggers;
922 return runicColossus && !runicColossus->
IsAlive() && runeGiant && !runeGiant->
IsAlive();
936 sif->InterruptNonMeleeSpells(
false);
961 return GetUlduarAI<boss_thorimAI>(creature);
986 heal += spellEffectInfo.CalcValue(caster);
989 heal += spellInfo->
GetMaxTicks() * spellEffectInfo.CalcValue(caster);
1000 heal += aurEff->GetAmount() * aurEff->GetRemainingTicks();
1046 Unit* target =
nullptr;
1056 Unit* healTarget =
nullptr;
1058 healTarget = caster;
1072 Unit* target =
nullptr;
1083 bool allowMove =
true;
1221 return GetUlduarAI<npc_thorim_pre_phaseAI>(creature);
1338 return GetUlduarAI<npc_thorim_arena_phaseAI>(creature);
1372 summon->SetImmuneToPC(
false);
1442 giant->SetImmuneToPC(
false);
1508 return GetUlduarAI<npc_runic_colossusAI>(creature);
1590 return GetUlduarAI<npc_ancient_rune_giantAI>(creature);
1691 return GetUlduarAI<npc_sifAI>(creature);
1714 for (Unit::AuraApplicationMap::const_iterator iter = auraMap.begin(); iter != auraMap.end(); ++iter)
1716 Aura const* aura = iter->second->GetBase();
1755 return !creature->IsPet();
1792 if (targets.empty())
1797 targets.push_back(target);
1919 if (targets.empty())
1927 targets.push_back(target);
2047 std::vector<Creature*> triggers;
2099 std::vector<Creature*> triggers;
2105 if (!triggers.empty())
2116 instance = caster->GetInstanceScript();
First const & RAND(First const &first, Second const &second, Rest const &... rest)
std::vector< AreaBoundary const * > CreatureBoundary
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
uint32 urand(uint32 min, uint32 max)
bool roll_chance_f(float chance)
#define RegisterSpellScript(spell_script)
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_TRIGGER_SPELL
@ SPELL_EFFECT_APPLY_AURA
@ TARGET_UNIT_SRC_AREA_ENTRY
@ TARGET_UNIT_SRC_AREA_ENEMY
@ SPELL_ATTR1_CANT_TARGET_SELF
@ SPELL_FAILED_NO_VALID_TARGETS
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraCheckAreaTargetFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
SummonLocation const ColossusAddLocations[]
@ ACTION_INCREASE_PREADDS_COUNT
@ ACTION_ACTIVATE_RUNIC_SMASH
CircleBoundary const ArenaFloorCircle(ArenaCenter, 45.4)
uint8 const ThorimTrashCount
std::size_t const LightningOrbPathSize
@ SPELL_TOUCH_OF_DOMINION
@ SPELL_LIGHTNING_BEAM_CHANNEL
@ SPELL_SHEATH_OF_LIGHTNING
@ SPELL_LIGHTNING_PILLAR_2
@ SPELL_TOUCH_OF_DOMINION_TRIGGERED
@ SPELL_UNBALANCING_STRIKE
@ SPELL_DEAFENING_THUNDER
@ SPELL_RUNIC_FORTIFICATION
@ SPELL_ACTIVATE_LIGHTNING_ORB_PERIODIC
@ SPELL_SUMMON_LIGHTNING_ORB
@ SPELL_LIGHTNING_ORB_CHARGED
@ SPELL_LIGHTNING_PILLAR_1
@ SPELL_STORMHAMMER_BOOMERANG
@ SPELL_LIGHTNING_DESTRUCTION
@ SPELL_LIGHTNING_RELEASE
@ SPELL_RUNIC_SMASH_RIGHT
CreatureBoundary const ArenaBoundaries
Position const ArenaCenter
Position const LightningOrbPath[]
CircleBoundary const InvertedBalconyCircle(LightningFieldCenter, 32.0, true)
Position const LightningFieldCenter
ThorimTrashInfo const StaticThorimTrashInfo[ThorimTrashCount]
@ SPELL_CIRCLE_OF_HEALING
61965
@ SPELL_AURA_OF_CELERITY_VISUAL
@ THORIM_WEAPON_DISPLAY_ID
SummonLocation const GiantAddLocations[]
Position const SifSpawnPosition
@ ACHIEVEMENT_LOSE_YOUR_ILLUSION
@ ACHIEVEMENT_DONT_STAND_IN_THE_LIGHTNING
@ EVENT_ACTIVATE_LIGHTNING_FIELD
@ EVENT_RUNIC_FORTIFICATION
@ EVENT_SECONDARY_ABILITY
@ EVENT_START_PERIODIC_CHARGE
@ EVENT_START_SIF_CHANNEL
@ EVENT_UNBALANCING_STRIKE
SummonLocation const PreAddLocations[]
void PreventDefaultAction()
HookList< EffectApplyHandler > AfterEffectRemove
HookList< EffectPeriodicHandler > OnEffectPeriodic
WorldObject * GetOwner() const
HookList< CheckAreaTargetHandler > DoCheckAreaTarget
WorldObject * GetOwner() const
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
void JustSummoned(Creature *summon) override
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
static bool IsInBounds(CreatureBoundary const &boundary, Position const *who)
@ EVADE_REASON_NO_HOSTILES
void DoZoneInCombat(Creature *creature=nullptr)
bool IsInBoundary(Position const *who=nullptr) const
void SetBoundary(CreatureBoundary const *boundary, bool negativeBoundaries=false)
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
void SetHomePosition(float x, float y, float z, float o)
void SetImmuneToPC(bool apply) override
void SetReactState(ReactStates st)
void Repeat(Milliseconds time)
bool IsInPhase(PhaseIndex phase) const
void RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
void SetPhase(PhaseIndex phase)
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
void AddEvent(BasicEvent *event, Milliseconds e_time, bool set_addtime=true)
Milliseconds CalculateTime(Milliseconds t_offset) const
HeightPositionCheck(bool ret)
bool operator()(Position const *pos) const
static float const THORIM_BALCONY_Z_CHECK
Creature * GetCreature(uint32 type)
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
virtual ObjectGuid GetGuidData(uint32 type) const override
GameObject * GetGameObject(uint32 type)
bool Execute(uint64 eventTime, uint32) override
LightningFieldEvent(Creature *owner)
void LaunchMoveSpline(std::function< void(Movement::MoveSplineInit &init)> &&initializer, uint32 id=0, MovementGeneratorPriority priority=MOTION_PRIORITY_NORMAL, MovementGeneratorType type=EFFECT_MOTION_TYPE)
void MoveJump(Position const &pos, float speedXY, float speedZ, uint32 id=EVENT_JUMP, bool hasOrientation=false)
static Creature * ToCreature(Object *o)
void SetFlag(uint16 index, uint32 newFlag)
static ObjectGuid GetGUID(Object const *o)
RunicSmashExplosionEvent(Creature *owner)
bool Execute(uint64, uint32) override
uint32 GetMaxTicks() const
float GetMaxRange(bool positive=false, WorldObject *caster=nullptr, Spell *spell=nullptr) const
float GetMinRange(bool positive=false) const
bool HasAttribute(SpellAttr0 attribute) const
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > const & GetEffects() const
HookList< CastHandler > AfterCast
WorldLocation * GetHitDest() const
HookList< HitHandler > AfterHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
HookList< CastHandler > BeforeCast
WorldObject * GetExplTargetWorldObject() const
HookList< EffectHandler > OnEffectLaunch
SpellInfo const * GetSpellInfo() const
void FinishCast(SpellCastResult result, uint32 *param1=nullptr, uint32 *param2=nullptr)
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
void Despawn(Creature const *summon)
void Summon(Creature const *summon)
bool Execute(uint64 eventTime, uint32) override
TrashJumpEvent(Creature *owner)
void DoMeleeAttackIfReady()
virtual uint32 GetData(uint32) const
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
bool DoSpellAttackIfReady(uint32 spell)
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
SpellCastResult DoCast(uint32 spellId)
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
float GetHealthPct() const
void SetControlled(bool apply, UnitState state)
std::multimap< uint32, AuraApplication * > AuraApplicationMap
void SetFaction(uint32 faction) override
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
MotionMaster * GetMotionMaster()
uint32 GetMaxHealth() const
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
void SetVirtualItem(uint32 slot, uint32 itemId)
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, SpellCastResult result=SPELL_FAILED_INTERRUPTED, Optional< SpellCastResult > resultOther={})
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
bool HasUnitState(const uint32 f) const
void RemoveAllAttackers()
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
void SetUnitFlag(UnitFlags flags)
AuraApplicationMap & GetAppliedAuras()
std::list< AuraEffect * > AuraEffectList
HeightPositionCheck const _check
bool operator()(Creature *target) const
InstanceScript * GetInstanceScript() const
void GetCreatureListWithEntryInGrid(Container &creatureContainer, uint32 entry, float maxSearchRange=250.0f) const
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
void setActive(bool isActiveObject)
void SetFarVisible(bool on)
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
bool IsInRange(WorldObject const *obj, float minRange, float maxRange, bool is3D=true) const
bool IsFriendlyTo(WorldObject const *target) const
Player * GetAffectingPlayer() const
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
bool OnCheck(Player *, Unit *target) override
achievement_dont_stand_in_the_lightning()
bool OnCheck(Player *source, Unit *) override
achievement_i_ll_take_you_all_on()
bool OnCheck(Player *, Unit *target) override
achievement_lose_your_illusion()
CreatureAI * GetAI(Creature *creature) const override
condition_thorim_arena_leap()
HeightPositionCheck _check
bool OnConditionCheck(Condition const *condition, ConditionSourceInfo &sourceInfo) override
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
MostHPMissingInRange(Unit const *referer, float range, uint32 hp, uint32 exclAura=0, bool exclSelf=false)
InstanceScript * instance
PrepareAuraScript(spell_thorim_activate_lightning_orb_periodic_AuraScript)
void PeriodicTick(AuraEffect const *)
AuraScript * GetAuraScript() const override
spell_thorim_activate_lightning_orb_periodic()
PrepareSpellScript(spell_thorim_arena_leap_SpellScript)
void HandleScript(SpellEffIndex)
spell_thorim_arena_leap()
SpellScript * GetSpellScript() const override
PrepareAuraScript(spell_thorim_aura_of_celerity)
bool Validate(SpellInfo const *) override
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
bool CheckAreaTarget(Unit *target)
PrepareAuraScript(spell_thorim_blizzard_effect_AuraScript)
AuraScript * GetAuraScript() const override
spell_thorim_blizzard_effect()
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_thorim_charge_orb_SpellScript)
spell_thorim_charge_orb()
SpellScript * GetSpellScript() const override
PrepareSpellScript(spell_thorim_frostbolt_volley_SpellScript)
void FilterTargets(std::list< WorldObject * > &targets)
SpellScript * GetSpellScript() const override
spell_thorim_frostbolt_volley()
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_thorim_lightning_charge_SpellScript)
SpellScript * GetSpellScript() const override
spell_thorim_lightning_charge()
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex effIndex)
PrepareSpellScript(spell_thorim_runic_smash_SpellScript)
SpellScript * GetSpellScript() const override
spell_thorim_runic_smash()
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_thorim_stormhammer_SpellScript)
PrepareSpellScript(spell_thorim_stormhammer_boomerang_SpellScript)
void RecoverHammer(SpellEffIndex)
spell_thorim_stormhammer_boomerang()
SpellScript * GetSpellScript() const override
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_thorim_stormhammer_sif_SpellScript)
void HandleScript(SpellEffIndex)
SpellScript * GetSpellScript() const override
spell_thorim_stormhammer_sif()
SpellScript * GetSpellScript() const override
spell_thorim_stormhammer()
std::vector< Vector3 > PointsArray
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
void RandomResize(C &container, std::size_t requestedSize)
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
WorldObject * mConditionTargets[MAX_CONDITION_TARGETS]
bool operator()(Position const *who) const
float GetExactDist2dSq(const float x, const float y) const
float GetPositionZ() const
float GetOrientation() const
float GetPositionX() const
float GetPositionY() const
void AttackStart(Unit *) override
void SetCombatMovement(bool allowMovement)
bool IsCombatMovementAllowed() const
void ResetThreatList(Unit *who=nullptr)
void DamageTaken(Unit *attacker, uint32 &damage, DamageEffectType, SpellInfo const *) override
void UpdateAI(uint32 diff) override
boss_thorimAI(Creature *creature)
ObjectGuid _activePillarGUID
uint32 GetData(uint32 type) const override
void KilledUnit(Unit *who) override
void GetTrashSpawnTriggers(std::list< Creature * > &triggerList, uint32 count=1)
void EnterEvadeMode(EvadeReason) override
void SpellHitTarget(WorldObject *target, SpellInfo const *spellInfo) override
void MovementInform(uint32 type, uint32 id) override
void SetGUID(ObjectGuid const &guid, int32 id) override
bool CanStartPhase2(Unit *actor) const
void JustSummoned(Creature *summon) override
bool _dontStandInTheLightning
void JustEngagedWith(Unit *who) override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void DoAction(int32 action) override
void JustDied(Unit *) override
void JustEngagedWith(Unit *) override
npc_ancient_rune_giantAI(Creature *creature)
void UpdateAI(uint32 diff) override
npc_runic_colossusAI(Creature *creature)
void JustDied(Unit *) override
void MoveInLineOfSight(Unit *) override
void DoAction(int32 action) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *) override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void DoAction(int32 action) override
void UpdateAI(uint32 diff) override
npc_sifAI(Creature *creature)
InstanceScript * _instance
void EnterEvadeMode(EvadeReason why) override
void JustEngagedWith(Unit *) override
bool CanAIAttack(Unit const *who) const override
void ExecuteEvent(uint32 eventId) override
npc_thorim_arena_phaseAI(Creature *creature)
void JustSummoned(Creature *summon) final override
npc_thorim_minibossAI(Creature *creature)
bool CanAIAttack(Unit const *who) const final override
void SummonedCreatureDespawn(Creature *summon) final override
void DoAction(int32 action) override
InstanceScript * _instance
npc_thorim_pre_phaseAI(Creature *creature)
void ExecuteEvent(uint32 eventId) override
void JustDied(Unit *) override
void DamageTaken(Unit *attacker, uint32 &damage, DamageEffectType, SpellInfo const *) override
bool ShouldSparWith(Unit const *target) const override
static uint32 GetRemainingHealOn(Unit *target)
returns remaining heal amount on given target
static Unit * GetUnitWithMostMissingHp(SpellInfo const *spellInfo, Unit *caster)
static Unit * GetHealTarget(SpellInfo const *spellInfo, Unit *caster)
static uint32 GetTotalHeal(SpellInfo const *spellInfo, Unit const *caster)
returns heal amount of the given spell including hots
npc_thorim_trashAI(Creature *creature)
void UpdateAI(uint32 diff) final override
InstanceScript * _instance
ThorimTrashInfo const * _info
virtual void ExecuteEvent(uint32 eventId)=0
bool UseAbility(uint32 spellId)
@ NPC_GOLEM_LEFT_HAND_BUNNY
@ NPC_DARK_RUNE_WARBRINGER
@ NPC_DARK_RUNE_ACOLYTE_PRE
@ NPC_MERCENARY_CAPTAIN_A
@ NPC_MERCENARY_SOLDIER_H
@ NPC_MERCENARY_CAPTAIN_H
@ NPC_MERCENARY_SOLDIER_A
@ NPC_GOLEM_RIGHT_HAND_BUNNY