![]() |
TrinityCore
|
#include <PlayerAI.h>
Inheritance diagram for PlayerAI:Classes | |
| struct | TargetedSpell |
Public Member Functions | |
| PlayerAI (Player *player) | |
| Creature * | GetCharmer () const |
| uint8 | GetSpec (Player const *who=nullptr) const |
| bool | IsHealer (Player const *who=nullptr) const |
| bool | IsRangedAttacker (Player const *who=nullptr) const |
Public Member Functions inherited from UnitAI | |
| UnitAI (Unit *unit) | |
| virtual | ~UnitAI () |
| virtual bool | CanAIAttack (Unit const *) const |
| virtual void | AttackStart (Unit *) |
| virtual void | UpdateAI (uint32 diff)=0 |
| virtual void | InitializeAI () |
| virtual void | Reset () |
| virtual void | OnCharmed (bool isNew) |
| virtual void | DoAction (int32) |
| virtual uint32 | GetData (uint32) const |
| virtual void | SetData (uint32, uint32) |
| virtual void | SetGUID (ObjectGuid const &, int32=0) |
| virtual ObjectGuid | GetGUID (int32=0) const |
| Unit * | SelectTarget (SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0) |
| template<class PREDICATE > | |
| Unit * | SelectTarget (SelectTargetMethod targetType, uint32 offset, PREDICATE const &predicate) |
| void | SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0) |
| template<class PREDICATE > | |
| void | SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 offset, PREDICATE const &predicate) |
| virtual void | JustEnteredCombat (Unit *) |
| virtual void | JustExitedCombat () |
| virtual void | OnDespawn () |
| virtual void | DamageDealt (Unit *, uint32 &, DamageEffectType) |
| virtual void | DamageTaken (Unit *, uint32 &, DamageEffectType, SpellInfo const *) |
| virtual void | HealReceived (Unit *, uint32 &) |
| virtual void | HealDone (Unit *, uint32 &) |
| virtual void | SpellInterrupted (uint32, uint32) |
| void | AttackStartCaster (Unit *victim, float dist) |
| SpellCastResult | DoCast (uint32 spellId) |
| SpellCastResult | DoCast (Unit *victim, uint32 spellId, CastSpellExtraArgs const &args={}) |
| SpellCastResult | DoCastSelf (uint32 spellId, CastSpellExtraArgs const &args={}) |
| SpellCastResult | DoCastVictim (uint32 spellId, CastSpellExtraArgs const &args={}) |
| SpellCastResult | DoCastAOE (uint32 spellId, CastSpellExtraArgs const &args={}) |
| float | DoGetSpellMaxRange (uint32 spellId, bool positive=false) |
| virtual bool | ShouldSparWith (Unit const *) const |
| void | DoMeleeAttackIfReady () |
| bool | DoSpellAttackIfReady (uint32 spellId) |
| virtual void | OnGameEvent (bool, uint16) |
| virtual std::string | GetDebugInfo () const |
Protected Types | |
| enum | SpellTarget { TARGET_NONE , TARGET_VICTIM , TARGET_CHARMER , TARGET_SELF } |
| typedef std::pair< TargetedSpell, uint32 > | PossibleSpell |
| typedef std::vector< PossibleSpell > | PossibleSpellVector |
Protected Member Functions | |
| void | SetIsRangedAttacker (bool state) |
| TargetedSpell | VerifySpellCast (uint32 spellId, Unit *target) |
| TargetedSpell | VerifySpellCast (uint32 spellId, SpellTarget target) |
| template<typename T > | |
| void | VerifyAndPushSpellCast (PossibleSpellVector &spells, uint32 spellId, T target, uint32 weight) |
| TargetedSpell | SelectSpellCast (PossibleSpellVector &spells) |
| void | DoCastAtTarget (TargetedSpell spell) |
| virtual Unit * | SelectAttackTarget () const |
| void | DoRangedAttackIfReady () |
| void | DoAutoAttackIfReady () |
| void | CancelAllShapeshifts () |
Protected Attributes | |
| Player *const | me |
Protected Attributes inherited from UnitAI | |
| Unit *const | me |
Private Attributes | |
| uint8 const | _selfSpec |
| bool const | _isSelfHealer |
| bool | _isSelfRangedAttacker |
Additional Inherited Members | |
Static Public Member Functions inherited from UnitAI | |
| static void | FillAISpellInfo () |
Static Public Attributes inherited from UnitAI | |
| static AISpellInfoType * | AISpellInfo |
Definition at line 29 of file PlayerAI.h.
|
protected |
Definition at line 49 of file PlayerAI.h.
|
protected |
Definition at line 50 of file PlayerAI.h.
|
protected |
| Enumerator | |
|---|---|
| TARGET_NONE | |
| TARGET_VICTIM | |
| TARGET_CHARMER | |
| TARGET_SELF | |
Definition at line 55 of file PlayerAI.h.
|
explicit |
Definition at line 395 of file PlayerAI.cpp.
|
protected |
Definition at line 587 of file PlayerAI.cpp.
References AURA_REMOVE_BY_CANCEL, Unit::GetAuraEffectsByType(), Aura::GetSpellInfo(), SpellInfo::HasAttribute(), SpellInfo::IsPassive(), SpellInfo::IsPositive(), me, Unit::RemoveOwnedAura(), SPELL_ATTR0_CANT_CANCEL, and SPELL_AURA_MOD_SHAPESHIFT.
Referenced by SimpleCharmedPlayerAI::SelectAppropriateCastForSpec().
|
protected |
Definition at line 579 of file PlayerAI.cpp.
References UnitAI::DoMeleeAttackIfReady(), DoRangedAttackIfReady(), and IsRangedAttacker().
Referenced by SimpleCharmedPlayerAI::UpdateAI().
|
protected |
Definition at line 518 of file PlayerAI.cpp.
References SpellCastTargets::SetUnitTarget().
Referenced by SimpleCharmedPlayerAI::UpdateAI().
|
protected |
Definition at line 525 of file PlayerAI.cpp.
References Spell::CheckPetCast(), EQUIPMENT_SLOT_RANGED, Player::GetItemByPos(), Item::GetTemplate(), Unit::GetVictim(), Unit::HasUnitState(), INVENTORY_SLOT_BAG_0, Unit::isAttackReady(), ITEM_SUBCLASS_WEAPON_BOW, ITEM_SUBCLASS_WEAPON_CROSSBOW, ITEM_SUBCLASS_WEAPON_GUN, ITEM_SUBCLASS_WEAPON_THROWN, ITEM_SUBCLASS_WEAPON_WAND, me, Spell::prepare(), RANGED_ATTACK, Unit::resetAttackTimer(), SpellCastTargets::SetUnitTarget(), SPELL_CAST_OK, SPELL_SHOOT, SPELL_SHOOT_WAND, SPELL_THROW, sSpellMgr, TRIGGERED_CAST_DIRECTLY, and UNIT_STATE_CASTING.
Referenced by DoAutoAttackIfReady().
| Creature * PlayerAI::GetCharmer | ( | ) | const |
Definition at line 402 of file PlayerAI.cpp.
References Unit::GetCharmerGUID(), ObjectAccessor::GetCreature(), ObjectGuid::IsCreature(), and me.
Referenced by SimpleCharmedPlayerAI::SelectAppropriateCastForSpec(), KelThuzadCharmedPlayerAI::SelectAttackTarget(), and SimpleCharmedPlayerAI::UpdateAI().
Definition at line 409 of file PlayerAI.cpp.
References _selfSpec, Trinity::Helpers::Entity::GetPlayerSpecialization(), and me.
Referenced by SimpleCharmedPlayerAI::SelectAppropriateCastForSpec().
| bool PlayerAI::IsHealer | ( | Player const * | who = nullptr | ) | const |
Definition at line 414 of file PlayerAI.cpp.
References _isSelfHealer, Trinity::Helpers::Entity::IsPlayerHealer(), and me.
| bool PlayerAI::IsRangedAttacker | ( | Player const * | who = nullptr | ) | const |
Definition at line 419 of file PlayerAI.cpp.
References _isSelfRangedAttacker, Trinity::Helpers::Entity::IsPlayerRangedAttacker(), and me.
Referenced by DoAutoAttackIfReady(), and SimpleCharmedPlayerAI::UpdateAI().
|
protectedvirtual |
Reimplemented in SimpleCharmedPlayerAI, KelThuzadCharmedPlayerAI, and BlackheartCharmedPlayerAI.
Definition at line 610 of file PlayerAI.cpp.
References Unit::GetCharmer(), Unit::GetVictim(), and me.
|
protected |
Definition at line 489 of file PlayerAI.cpp.
References urand().
Referenced by SimpleCharmedPlayerAI::SelectAppropriateCastForSpec().
|
inlineprotected |
Definition at line 53 of file PlayerAI.h.
|
inlineprotected |
Definition at line 70 of file PlayerAI.h.
Referenced by SimpleCharmedPlayerAI::SelectAppropriateCastForSpec().
|
protected |
Definition at line 464 of file PlayerAI.cpp.
References Unit::GetCharmer(), Unit::GetVictim(), me, TARGET_CHARMER, TARGET_NONE, TARGET_SELF, TARGET_VICTIM, and VerifySpellCast().
|
protected |
Definition at line 424 of file PlayerAI.cpp.
References Spell::CanAutoCast(), Unit::GetSpellHistory(), SpellHistory::HasGlobalCooldown(), Player::HasSpell(), me, sSpellMgr, and TRIGGERED_NONE.
Referenced by VerifySpellCast().
|
private |
Definition at line 91 of file PlayerAI.h.
Referenced by IsHealer().
|
private |
Definition at line 92 of file PlayerAI.h.
Referenced by IsRangedAttacker().
|
private |
Definition at line 90 of file PlayerAI.h.
Referenced by GetSpec().
|
protected |
Definition at line 52 of file PlayerAI.h.
Referenced by SimpleCharmedPlayerAI::CanAIAttack(), CancelAllShapeshifts(), player_overlord_brandAI::DamageDealt(), DoRangedAttackIfReady(), GetCharmer(), GetSpec(), player_overlord_brandAI::HealDone(), IsHealer(), IsRangedAttacker(), SimpleCharmedPlayerAI::OnCharmed(), SimpleCharmedPlayerAI::SelectAppropriateCastForSpec(), SelectAttackTarget(), SimpleCharmedPlayerAI::SelectAttackTarget(), BlackheartCharmedPlayerAI::SelectAttackTarget(), SimpleCharmedPlayerAI::UpdateAI(), player_ghoulAI::UpdateAI(), VerifySpellCast(), and VerifySpellCast().