239 if (entry.second > 3)
420 SetHitDamage(healthPctDmg < flatDmg ? flatDmg : healthPctDmg);
441 if (!firstTarget || !secondTarget)
455 targets.remove(tank);
457 if (targets.size() < 2)
465 _targets.push_back(targets.front()->GetGUID());
466 _targets.push_back(targets.back()->GetGUID());
557 if (targets.size() <= 1)
565 targets.remove(tank);
567 std::list<WorldObject*> melee, ranged;
571 melee.push_back(target);
573 ranged.push_back(target);
580 targets.push_back(target);
583 targets.push_back(target);
593 priority1.remove(target);
597 priority2.remove(target);
646 _target = targets.front()->GetGUID();
691 aura->RefreshDuration();
std::chrono::seconds Seconds
Seconds shorthand typedef.
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
std::chrono::minutes Minutes
Minutes shorthand typedef.
std::list< ObjectGuid > GuidList
uint32 urand(uint32 min, uint32 max)
#define RegisterSpellAndAuraScriptPair(script_1, script_2)
#define RegisterSpellScript(spell_script)
@ TARGET_UNIT_SRC_AREA_ALLY
@ TARGET_UNIT_SRC_AREA_ENEMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_FAILED_NO_VALID_TARGETS
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_MOD_HEALING_DONE_VERSUS_AURASTATE
@ SPELL_AURA_OVERRIDE_AUTOATTACK_WITH_MELEE_SPELL
@ SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
#define AuraEffectProcFn(F, I, N)
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectApplyFn(F, I, N, M)
#define AuraEffectRemoveFn(F, I, N, M)
@ CURRENT_CHANNELED_SPELL
@ ACTION_EQUIP_INFERNO_BLADE
@ ACTION_EQUIP_DECIMATION_BLADE
@ SPELL_DECIMATION_BLADE_2
@ SPELL_SHARDS_OF_TORMENT_SUMMON
@ SPELL_SHARDS_OF_TORMENT
@ SPELL_TORMENT_PRE_VISUAL
@ SPELL_DECIMATING_STRIKE
@ SPELL_COUNTDOWN_AOE_EXPLOSION
@ SPELL_COUNTDOWN_VISUAL_LINK
@ SPELL_BLADES_OF_BALEROC
void AddSC_boss_baleroc()
void SetAmount(int32 amount)
void PreventDefaultAction()
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
AuraEffect * GetEffect(uint8 effIndex) const
Difficulty GetCastDifficulty() const
HookList< EffectApplyHandler > OnEffectRemove
HookList< EffectProcHandler > OnEffectProc
uint8 GetStackAmount() const
HookList< EffectApplyHandler > OnEffectApply
AuraEffect * GetEffect(uint32 index) const
InstanceScript *const instance
virtual void UpdateAI(uint32 diff) override
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
void LoadEquipment(int8 id=1, bool force=false)
void SetCanDualWield(bool value) override
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell, bool includePets=false, bool includeControlled=false)
static Creature * ToCreature(Object *o)
Unit * GetProcTarget() const
ObjectGuid GetUnitTargetGUID() const
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
static bool ValidateSpellEffect(std::initializer_list< std::pair< uint32, SpellEffIndex > > effects)
HookList< CastHandler > AfterCast
int32 GetHitDamage() const
HookList< HitHandler > OnHit
HookList< EffectHandler > OnEffectHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
HookList< CastHandler > OnCast
void FinishCast(SpellCastResult result, int32 *param1=nullptr, int32 *param2=nullptr)
void SetHitDamage(int32 damage)
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
SpellCastTargets m_targets
TaskContext & Repeat(std::chrono::duration< Rep, Period > duration)
TaskScheduler & CancelAll()
TaskScheduler & Schedule(std::chrono::duration< Rep, Period > time, task_handler_t task)
TaskScheduler & Update(success_t const &callback=nullptr)
TaskScheduler & SetValidator(P &&predicate)
Sets a validator which is asked if tasks are allowed to be executed.
virtual void DoAction(int32)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
virtual uint32 GetData(uint32) const
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
SpellCastResult DoCast(uint32 spellId)
bool IsWithinMeleeRange(Unit const *obj) const
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
void SetAuraStack(uint32 spellId, Unit *target, uint32 stack)
Aura * AddAura(uint32 spellId, Unit *target)
uint32 GetAuraCount(uint32 spellId) const
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
uint64 CountPctFromMaxHealth(int32 pct) const
bool HasUnitState(const uint32 f) const
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
achievement_share_the_pain()
bool OnCheck(Player *, Unit *target) override
bool Validate(SpellInfo const *) override
void ChooseBlade(SpellEffIndex)
void HandleScript(SpellEffIndex)
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
void HandleScript(SpellEffIndex effIndex)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *spellInfo) override
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
WorldObject * GetRandomContainerElement(std::list< WorldObject * > &priority1, std::list< WorldObject * > &priority2) const
static WorldObject * GetRandomContainerElement(std::list< WorldObject * > const *list)
void HandleScript(SpellEffIndex effIndex)
void FilterTargets(std::list< WorldObject * > &targets)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void OnHit(SpellEffIndex)
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex effIndex)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
#define RegisterFirelandsAI(AI)
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
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)
void JustDied(Unit *killer) override
void PreparePhase(Phases phase)
boss_baleroc(Creature *creature)
void JustEngagedWith(Unit *target) override
TaskScheduler separateScheduler
void KilledUnit(Unit *who) override
std::unordered_map< ObjectGuid, uint32 > _sharedThePain
uint32 GetData(uint32 type) const override
void SetGUID(ObjectGuid const &guid, int32 type=0) override
void DoAction(int32 action) override
bool _canYellKilledPlayer
void EnterEvadeMode(EvadeReason reason) override
void UpdateAI(uint32 diff) override
void EquipWeapon(uint8 equipment) const
void JustEngagedWith(Unit *target) override
void JustDied(Unit *killer) override
void EnterEvadeMode(EvadeReason why) override
void IsSummonedBy(WorldObject *) override
void UpdateAI(uint32 diff) override
void SpellHitTarget(WorldObject *, SpellInfo const *spellInfo) override
npc_shard_of_torment(Creature *creature)