396 _selfSpec(
Trinity::Helpers::Entity::GetPlayerSpecialization(player)),
397 _isSelfHealer(
Trinity::Helpers::Entity::IsPlayerHealer(player)),
398 _isSelfRangedAttacker(
Trinity::Helpers::Entity::IsPlayerRangedAttacker(player))
427 uint32 knownRank, nextRank;
432 nextRank =
sSpellMgr->GetNextSpellInChain(spellId);
437 nextRank =
sSpellMgr->GetFirstSpellInChain(spellId);
442 knownRank = nextRank;
443 nextRank =
sSpellMgr->GetNextSpellInChain(knownRank);
458 return{ spell, target };
466 Unit* pTarget =
nullptr;
493 totalWeights += wSpell.second;
501 delete wSpell.first.first;
505 if (randNum < wSpell.second)
506 selected = wSpell.first;
509 randNum -= wSpell.second;
510 delete wSpell.first.first;
522 spell.first->prepare(targets);
537 uint32 rangedAttackSpell = 0;
542 switch (rangedTemplate->SubClass)
558 if (!rangedAttackSpell)
590 std::set<Aura*> removableShapeshifts;
593 Aura* aura = auraEff->GetBase();
603 removableShapeshifts.insert(aura);
606 for (
Aura* aura : removableShapeshifts)
630 if (!charmer->IsValidAttackTarget(who))
639 if (
UnitAI* charmerAI = charmer->GetAI())
716 if (creatureCharmer->IsDungeonBoss() || creatureCharmer->isWorldBoss())
790 uint32 builder = 0, finisher = 0;
880 bool hasFF =
false, hasBP =
false;
900 if (!creatureCharmer->IsDungeonBoss() && !creatureCharmer->isWorldBoss())
963 if (maelstrom->GetStackAmount() == 5)
986 if (abAura->GetStackAmount() >= 3)
1031 if (victim->HealthBelowPct(25))
1085 uint8 lifebloomStacks = 0;
1087 lifebloomStacks = lifebloom->GetStackAmount();
1088 if (lifebloomStacks < 3)
1091 creatureCharmer->GetAuraApplicationOfRankedSpell(
SPELL_REGROWTH))
1166 if (aura->GetCasterGUID() == charmer->
GetGUID() && aura->GetBase()->IsPermanent())
@ ITEM_SUBCLASS_WEAPON_CROSSBOW
@ ITEM_SUBCLASS_WEAPON_GUN
@ ITEM_SUBCLASS_WEAPON_BOW
@ ITEM_SUBCLASS_WEAPON_WAND
@ ITEM_SUBCLASS_WEAPON_THROWN
@ SPELL_SEED_OF_CORRUPTION
@ SPELL_HAMMER_OF_JUSTICE
@ SPELL_DEMONIC_EMPOWERMENT
@ SPELL_DIVINE_ILLUMINATION
@ PASSIVE_ELEMENTAL_FOCUS
@ SPELL_DIVINE_PROTECTION
@ SPELL_UNSTABLE_AFFLICTION
@ SPELL_SHIELD_OF_RIGHTEOUS
@ SPELL_BLESSING_OF_MIGHT
@ SPELL_POWER_WORD_SHIELD
@ SPELL_HAND_OF_SACRIFICE
@ SPELL_SHADOW_PROTECTION
@ SPELL_SURVIVAL_INSTINCTS
@ SPELL_UNBREAKABLE_ARMOR
@ PASSIVE_SPIRIT_REDEMPTION
@ SPELL_HAMMER_OF_RIGHTEOUS
@ SPELL_EMPOWER_RUNE_WEAP
@ SPELL_ELEMENTAL_MASTERY
@ SPELL_ICEBORN_FORTITUDE
@ SPELL_INTIMIDATING_SHOUT
@ PASSIVE_MASTER_OF_GHOUL
@ SPELL_HAND_OF_PROTECTION
@ SPELL_SHADOW_WORD_DEATH
static const float CASTER_CHASE_DISTANCE
#define INVENTORY_SLOT_BAG_0
uint32 urand(uint32 min, uint32 max)
@ SPEC_WARRIOR_PROTECTION
@ SPEC_PALADIN_RETRIBUTION
@ SPEC_WARLOCK_DEMONOLOGY
@ SPEC_PALADIN_PROTECTION
@ SPEC_DEATH_KNIGHT_FROST
@ SPEC_HUNTER_BEAST_MASTERY
@ SPEC_DEATH_KNIGHT_UNHOLY
@ SPEC_DEATH_KNIGHT_BLOOD
@ SPEC_HUNTER_MARKSMANSHIP
@ SPEC_WARLOCK_DESTRUCTION
@ SPEC_SHAMAN_RESTORATION
@ SPEC_ROGUE_ASSASSINATION
@ SPEC_WARLOCK_AFFLICTION
@ SPEC_SHAMAN_ENHANCEMENT
@ SPELL_ATTR0_CANT_CANCEL
@ SPELL_AURA_MOD_SHAPESHIFT
@ TRIGGERED_CAST_DIRECTLY
Will ignore combo point requirement.
#define SPELL_POWER_WORD_SHIELD
SpellInfo const * GetSpellInfo() const
bool IsEngaged() const override
bool IsInEvadeMode() const
ItemTemplate const * GetTemplate() const
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={})
void MoveFollow(Unit *target, float dist, ChaseAngle angle, MovementSlot slot=MOTION_SLOT_ACTIVE)
void Remove(MovementGenerator *movement, MovementSlot slot=MOTION_SLOT_ACTIVE)
static ObjectGuid GetGUID(Object const *o)
void DoRangedAttackIfReady()
virtual Unit * SelectAttackTarget() const
uint8 GetSpec(Player const *who=nullptr) const
void VerifyAndPushSpellCast(PossibleSpellVector &spells, uint32 spellId, T target, uint32 weight)
std::pair< TargetedSpell, uint32 > PossibleSpell
void DoCastAtTarget(TargetedSpell spell)
void DoAutoAttackIfReady()
TargetedSpell SelectSpellCast(PossibleSpellVector &spells)
TargetedSpell VerifySpellCast(uint32 spellId, Unit *target)
bool _isSelfRangedAttacker
bool IsRangedAttacker(Player const *who=nullptr) const
std::vector< PossibleSpell > PossibleSpellVector
void CancelAllShapeshifts()
bool IsHealer(Player const *who=nullptr) const
Creature * GetCharmer() const
Item * GetItemByPos(uint16 pos) const
bool HasSpell(uint32 spell) const override
void OnCharmed(bool isNew) override
bool CanAIAttack(Unit const *who) const override
TargetedSpell SelectAppropriateCastForSpec()
void UpdateAI(uint32 diff) override
Unit * SelectAttackTarget() const override
void SetUnitTarget(Unit *target)
bool HasGlobalCooldown(SpellInfo const *spellInfo) const
bool HasAttribute(SpellAttr0 attribute) const
SpellCastResult prepare(SpellCastTargets const &targets, AuraEffect const *triggeredByAura=nullptr)
SpellCastResult CheckPetCast(Unit *target)
bool CanAutoCast(Unit *target)
void AttackStartCaster(Unit *victim, float dist)
void DoMeleeAttackIfReady()
virtual bool CanAIAttack(Unit const *) const
virtual ObjectGuid GetGUID(int32=0) const
virtual void OnCharmed(bool isNew)
virtual void AttackStart(Unit *)
void CastStop(uint32 except_spellid=0)
bool IsWithinMeleeRange(Unit const *obj) const
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
void KillSelf(bool durabilityLoss=true)
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
bool HasBreakableByDamageCrowdControlAura(Unit *excludeCasterChannel=nullptr) const
Unit * GetCharmer() const
MotionMaster * GetMotionMaster()
Powers GetPowerType() const
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
bool HasAuraState(AuraStateType flag, SpellInfo const *spellProto=nullptr, Unit const *Caster=nullptr) const
AuraApplication * GetAuraApplicationOfRankedSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraApplication *except=nullptr) const
bool HasUnitState(const uint32 f) const
void SetFacingTo(float ori, bool force=true, uint32 movementId=EVENT_FACE)
uint8 GetComboPoints(Unit const *who=nullptr) const
--------—Combo point system----------------—
SpellHistory * GetSpellHistory()
ObjectGuid GetCharmerGUID() const
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
bool IsValidAttackTarget(WorldObject const *target, SpellInfo const *bySpell=nullptr) const
bool IsWithinLOSInMap(WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API uint8 GetPlayerSpecialization(Player const *who)
bool IsPlayerRangedAttacker(Player const *who)
TC_GAME_API bool IsPlayerHealer(Player const *who)
float GetOrientation() const
float GetAbsoluteAngle(float x, float y) const
void GetPosition(float &x, float &y) const
ValidTargetSelectPredicate(UnitAI const *ai)
bool operator()(Unit const *target) const