33#include <G3D/Vector3.h>
88#define SPELL_STOMP RAID_MODE<uint32>(62411,62413)
326 { 2134.889893f, -298.632996f, 438.247467f },
327 { 2134.570068f, -440.317993f, 438.247467f },
328 { 2167.820312f, -440.330261f, 438.247589f },
329 { 2213.394287f, -433.318298f, 412.665863f },
330 { 2227.766113f, -433.275818f, 412.177032f },
331 { 2227.551270f, -263.081085f, 412.176880f },
332 { 2202.208008f, -262.939270f, 412.168976f },
333 { 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);
645 init.MovebyPath(path);
749 std::list<Creature*> triggers;
751 triggers.remove_if([](
Creature* bunny)
762 triggers.remove_if([](
Creature* bunny)
772 for (
auto itr = triggers.cbegin(); itr != triggers.cend();)
775 if (itr != triggers.cend())
833 triggerList.remove_if([](
Creature* bunny)
840 if (triggerList.empty())
847 triggerList.push_back(bunny);
860 std::list<Creature*> triggers;
873 std::list<Creature*> triggers;
882 std::list<Creature*> triggers;
900 return runicColossus && !runicColossus->
IsAlive() && runeGiant && !runeGiant->
IsAlive();
914 sif->InterruptNonMeleeSpells(
false);
939 return GetUlduarAI<boss_thorimAI>(creature);
966 heal += spellEffectInfo.CalcValue(caster);
969 heal += spellInfo->
GetMaxTicks() * spellEffectInfo.CalcValue(caster);
980 heal += aurEff->GetAmount() * aurEff->GetRemainingTicks();
1026 Unit* target =
nullptr;
1036 Unit* healTarget =
nullptr;
1038 healTarget = caster;
1052 Unit* target =
nullptr;
1063 bool allowMove =
true;
1194 return GetUlduarAI<npc_thorim_pre_phaseAI>(creature);
1311 return GetUlduarAI<npc_thorim_arena_phaseAI>(creature);
1345 summon->SetImmuneToPC(
false);
1415 giant->SetImmuneToPC(
false);
1479 return GetUlduarAI<npc_runic_colossusAI>(creature);
1559 return GetUlduarAI<npc_ancient_rune_giantAI>(creature);
1660 return GetUlduarAI<npc_sifAI>(creature);
1681 for (Unit::AuraApplicationMap::const_iterator iter = auraMap.begin(); iter != auraMap.end(); ++iter)
1683 Aura const* aura = iter->second->GetBase();
1720 return !creature->IsPet();
1755 if (targets.empty())
1760 targets.push_back(target);
1876 if (targets.empty())
1884 targets.push_back(target);
1998 std::vector<Creature*> triggers;
2048 std::vector<Creature*> triggers;
2054 if (!triggers.empty())
2065 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)
if(posix_memalign(&__mallocedMemory, __align, __size)) return NULL
@ TARGET_UNIT_SRC_AREA_ENTRY
@ TARGET_UNIT_SRC_AREA_ENEMY
@ SPELL_ATTR1_EXCLUDE_CASTER
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_TRIGGER_SPELL
@ SPELL_EFFECT_APPLY_AURA
@ SPELL_FAILED_NO_VALID_TARGETS
@ 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)
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
@ 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< 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)
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
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)
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
bool IsInPhase(uint8 phase) const
void SetPhase(uint8 phase)
void RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
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, JumpArrivalCastArgs const *arrivalCast=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
static Creature * ToCreature(Object *o)
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::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()
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
uint64 GetMaxHealth() 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
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
void SetUnitFlag(UnitFlags flags)
AuraApplicationMap & GetAppliedAuras()
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
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 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()
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 const * mConditionTargets[MAX_CONDITION_TARGETS]
bool operator()(Position const *who) const
constexpr float GetPositionX() const
constexpr float GetPositionY() const
constexpr float GetExactDist2dSq(const float x, const float y) const
constexpr float GetOrientation() 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