33#include <G3D/Vector3.h>
88#define SPELL_STOMP RAID_MODE<uint32>(62411,62413)
327 { 2134.889893f, -298.632996f, 438.247467f },
328 { 2134.570068f, -440.317993f, 438.247467f },
329 { 2167.820312f, -440.330261f, 438.247589f },
330 { 2213.394287f, -433.318298f, 412.665863f },
331 { 2227.766113f, -433.275818f, 412.177032f },
332 { 2227.551270f, -263.081085f, 412.176880f },
333 { 2202.208008f, -262.939270f, 412.168976f },
334 { 2182.310059f, -263.233093f, 414.739410f }
482 miniBoss->Respawn(
true);
496 controller->RemoveAllAuras();
535 sif->DespawnOrUnsummon(6s);
564 controller->RemoveAllAuras();
566 pillar->RemoveAllAuras();
573 sif->DespawnOrUnsummon(10s);
616 runicColossus->SetImmuneToPC(
false);
742 std::list<Creature*> triggers;
744 triggers.remove_if([](
Creature* bunny)
755 triggers.remove_if([](
Creature* bunny)
765 for (
auto itr = triggers.cbegin(); itr != triggers.cend();)
768 if (itr != triggers.cend())
826 triggerList.remove_if([](
Creature* bunny)
833 if (triggerList.empty())
840 triggerList.push_back(bunny);
853 std::list<Creature*> triggers;
866 std::list<Creature*> triggers;
875 std::list<Creature*> triggers;
893 return runicColossus && !runicColossus->
IsAlive() && runeGiant && !runeGiant->
IsAlive();
907 sif->InterruptNonMeleeSpells(
false);
932 return GetUlduarAI<boss_thorimAI>(creature);
959 heal += spellEffectInfo.CalcValue(caster);
962 heal += spellEffectInfo.GetPeriodicTickCount() * spellEffectInfo.CalcValue(caster);
964 return static_cast<uint32>(heal);
973 heal += aurEff->GetAmount() * aurEff->GetRemainingTicks();
975 return static_cast<uint32>(heal);
1019 Unit* target =
nullptr;
1029 Unit* healTarget =
nullptr;
1031 healTarget = caster;
1045 Unit* target =
nullptr;
1056 bool allowMove =
true;
1188 return GetUlduarAI<npc_thorim_pre_phaseAI>(creature);
1305 return GetUlduarAI<npc_thorim_arena_phaseAI>(creature);
1339 summon->SetImmuneToPC(
false);
1409 giant->SetImmuneToPC(
false);
1473 return GetUlduarAI<npc_runic_colossusAI>(creature);
1553 return GetUlduarAI<npc_ancient_rune_giantAI>(creature);
1654 return GetUlduarAI<npc_sifAI>(creature);
1675 for (Unit::AuraApplicationMap::const_iterator iter = auraMap.begin(); iter != auraMap.end(); ++iter)
1677 Aura const* aura = iter->second->GetBase();
1714 return !creature->IsPet();
1749 if (targets.empty())
1754 targets.push_back(target);
1870 if (targets.empty())
1878 targets.push_back(target);
1992 std::vector<Creature*> triggers;
2042 std::vector<Creature*> triggers;
2048 if (!triggers.empty())
2059 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
bool roll_chance(float chance, PseudoRandomDistributionState &state)
uint32 urand(uint32 min, uint32 max)
#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_EXCLUDE_CASTER
@ SPELL_FAILED_NO_VALID_TARGETS
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ SPELL_AURA_MOD_MELEE_RANGED_CASTING_HASTE
double SpellEffectValue
This is a double instead of float to be able to store full range of int32.
#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
uint8 const ThorimTrashCount
@ 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
CircleBoundary const InvertedBalconyCircle(LightningFieldCenter, 32.0f, true)
Position const ArenaCenter
Position const LightningFieldCenter
ThorimTrashInfo const StaticThorimTrashInfo[ThorimTrashCount]
@ SPELL_CIRCLE_OF_HEALING
61965
@ SPELL_AURA_OF_CELERITY_VISUAL
G3D::Vector3 const LightningOrbPath[]
CircleBoundary const ArenaFloorCircle(ArenaCenter, 45.4f)
@ THORIM_WEAPON_DISPLAY_ID
SummonLocation const GiantAddLocations[]
Position const SifSpawnPosition
@ 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
ObjectGuid const & GetGUID() 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)
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
bool IsInBoundary(Position const *who=nullptr) const
void SetBoundary(CreatureBoundary const *boundary, bool negativeBoundaries=false)
void SetHomePosition(float x, float y, float z, float o)
void SetCanMelee(bool canMelee, bool fleeFromMelee=false)
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, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
void MoveJump(uint32 id, Position const &pos, std::variant< std::monostate, float, Milliseconds > speedOrTime={}, Optional< float > minHeight={}, Optional< float > maxHeight={}, MovementFacingTarget const &facing={}, bool orientationFixed=false, bool unlimitedSpeed=false, Optional< float > speedMultiplier={}, JumpArrivalCastArgs const *arrivalCast=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
RunicSmashExplosionEvent(Creature *owner)
bool Execute(uint64, uint32) override
SpellRange GetMinMaxRange(bool positive=false, WorldObject const *caster=nullptr, Spell *spell=nullptr) const
float GetMaxRange(bool positive=false, WorldObject const *caster=nullptr, Spell *spell=nullptr) const
bool HasAttribute(SpellAttr0 attribute) const
std::vector< SpellEffectInfo > const & GetEffects() const
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
HookList< CastHandler > AfterCast
WorldLocation * GetHitDest() const
HookList< HitHandler > AfterHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
HookList< CastHandler > BeforeCast
void FinishCast(SpellCastResult result, int32 *param1=nullptr, int32 *param2=nullptr)
WorldObject * GetExplTargetWorldObject() const
HookList< EffectHandler > OnEffectLaunch
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
void Despawn(Creature const *summon)
void Summon(Creature const *summon)
bool Execute(uint64 eventTime, uint32) override
TrashJumpEvent(Creature *owner)
bool DoSpellAttackIfReady(uint32 spellId)
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)
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
SpellCastResult DoCast(uint32 spellId)
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
float GetHealthPct() const
void SetVirtualItem(uint32 slot, uint32 itemId, uint16 appearanceModId=0, uint16 itemVisual=0)
void SetControlled(bool apply, UnitState state)
std::multimap< uint32, AuraApplication * > AuraApplicationMap
void SetFaction(uint32 faction) override
std::forward_list< AuraEffect * > AuraEffectList
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
MotionMaster * GetMotionMaster()
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, SpellCastResult result=SPELL_FAILED_INTERRUPTED, Optional< SpellCastResult > resultOther={}, ObjectGuid const &interrupter=ObjectGuid::Empty)
uint64 GetMaxHealth() const
bool HealthBelowPctDamaged(float pct, uint32 damage) const
bool HasUnitState(const uint32 f) const
void RemoveAllAttackers()
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
void SetUnitFlag(UnitFlags flags)
AuraApplicationMap & GetAppliedAuras()
bool SetDisableGravity(bool disable, bool updateAnimTier=true, bool updatePlayHoverAnim=true)
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
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
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
void PeriodicTick(AuraEffect const *)
AuraScript * GetAuraScript() const override
spell_thorim_activate_lightning_orb_periodic()
void HandleScript(SpellEffIndex)
spell_thorim_arena_leap()
SpellScript * GetSpellScript() const override
bool Validate(SpellInfo const *) override
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
bool CheckAreaTarget(Unit *target)
AuraScript * GetAuraScript() const override
spell_thorim_blizzard_effect()
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
spell_thorim_charge_orb()
SpellScript * GetSpellScript() const override
void FilterTargets(std::list< WorldObject * > &targets)
SpellScript * GetSpellScript() const override
spell_thorim_frostbolt_volley()
bool Validate(SpellInfo const *) override
SpellScript * GetSpellScript() const override
spell_thorim_lightning_charge()
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex effIndex)
SpellScript * GetSpellScript() const override
spell_thorim_runic_smash()
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
void HandleScript(SpellEffIndex)
void RecoverHammer(SpellEffIndex)
spell_thorim_stormhammer_boomerang()
SpellScript * GetSpellScript() const override
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
SpellScript * GetSpellScript() const override
spell_thorim_stormhammer_sif()
SpellScript * GetSpellScript() const override
spell_thorim_stormhammer()
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
auto SelectRandomContainerElement(C const &container) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
void RandomResize(C &container, std::size_t requestedSize)
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius)
std::array< WorldObject const *, MAX_CONDITION_TARGETS > mConditionTargets
bool operator()(Position const *who) const
constexpr float GetPositionX() const
constexpr float GetExactDist2dSq(const float x, const float y) const
constexpr float GetPositionZ() const
void AttackStart(Unit *) override
== Triggered Actions Requested ==================
void SetCombatMovement(bool allowMovement)
bool IsCombatMovementAllowed() const
Difficulty GetDifficulty() 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
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
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