AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_pet_gen_argent_pony_bridle Struct Reference
Inheritance diagram for npc_pet_gen_argent_pony_bridle:
ScriptedAI CreatureAI UnitAI

Public Member Functions

 npc_pet_gen_argent_pony_bridle (Creature *c)
 
void EnterEvadeMode (EvadeReason) override
 
void Reset () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
uint32 GetData (uint32 param) const override
 
void DoAction (int32 param) override
 
bool OnGossipHello (Player *player, Creature *creature)
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action)
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table. More...
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed. More...
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- 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)=0
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following: More...
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast. More...
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true)
 Cast the spell on a random unit from the threat list. More...
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim. More...
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished. More...
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Private Attributes

bool _init
 
uint8 _state
 
int32 _mountTimer
 
bool _banners [MAX_RACES]
 
uint32 _lastAura
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_pet_gen_argent_pony_bridle()

npc_pet_gen_argent_pony_bridle::npc_pet_gen_argent_pony_bridle ( Creature c)
inline
149 : ScriptedAI(c)
150 {
152 _init = false;
153 _mountTimer = 4000;
154 _lastAura = 0;
155 memset(_banners, 0, sizeof(_banners));
156 }
@ ARGENT_PONY_STATE_NONE
Definition: pet_generic.cpp:92
Definition: ScriptedCreature.h:190
int32 _mountTimer
Definition: pet_generic.cpp:338
uint32 _lastAura
Definition: pet_generic.cpp:340
bool _init
Definition: pet_generic.cpp:336
uint8 _state
Definition: pet_generic.cpp:337
bool _banners[MAX_RACES]
Definition: pet_generic.cpp:339

References _banners, _init, _lastAura, _mountTimer, _state, and ARGENT_PONY_STATE_NONE.

Member Function Documentation

◆ DoAction()

void npc_pet_gen_argent_pony_bridle::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

254 {
255 if (param > 60000)
256 {
257 if (_lastAura)
259 _lastAura = param;
260 return;
261 }
262
263 _state = param;
264 }
Creature * me
Definition: ScriptedCreature.h:280
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4891

References _lastAura, _state, ScriptedAI::me, and Unit::RemoveAurasDueToSpell().

◆ EnterEvadeMode()

void npc_pet_gen_argent_pony_bridle::EnterEvadeMode ( EvadeReason  )
inlineoverridevirtual

Reimplemented from CreatureAI.

159 {
160 if (Unit* owner = me->GetCharmerOrOwner())
161 {
162 me->GetMotionMaster()->Clear(false);
164 }
165 }
@ MOTION_SLOT_ACTIVE
Definition: MotionMaster.h:62
#define PET_FOLLOW_DIST
Definition: PetDefines.h:198
Definition: Unit.h:630
MotionMaster * GetMotionMaster()
Definition: Unit.h:1601
Unit * GetCharmerOrOwner() const
Definition: Unit.h:1243
virtual float GetFollowAngle() const
Definition: Unit.h:1708
void MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE, bool inheritWalkState=true)
The unit will follow this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:409
void Clear(bool reset=true)
Definition: MotionMaster.h:165

References MotionMaster::Clear(), Unit::GetCharmerOrOwner(), Unit::GetFollowAngle(), Unit::GetMotionMaster(), ScriptedAI::me, MOTION_SLOT_ACTIVE, MotionMaster::MoveFollow(), and PET_FOLLOW_DIST.

◆ GetData()

uint32 npc_pet_gen_argent_pony_bridle::GetData ( uint32  param) const
inlineoverridevirtual

Reimplemented from UnitAI.

246 {
247 if (param == 0)
248 return _state;
249
250 return _banners[param];
251 }

References _banners, and _state.

◆ OnGossipHello()

bool npc_pet_gen_argent_pony_bridle::OnGossipHello ( Player player,
Creature creature 
)
inline
267 {
268 if (player->GetGUID() != creature->GetOwnerGUID())
269 return true;
270
271 if (!creature->HasAura(player->GetTeamId(true) ? SPELL_AURA_TIRED_G : SPELL_AURA_TIRED_S))
272 {
273 uint8 _state = creature->AI()->GetData(0 /*GET_DATA_STATE*/);
280 }
281
282 for (uint8 i = RACE_HUMAN; i < MAX_RACES; ++i)
283 if (creature->AI()->GetData(i) == uint32(true))
285
286 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
287 return true;
288 }
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const guid)
Definition: ScriptedGossip.cpp:45
void AddGossipItemFor(Player *player, uint32 icon, std::string const &text, uint32 sender, uint32 action)
Definition: ScriptedGossip.cpp:28
@ GOSSIP_SENDER_MAIN
Definition: ScriptedGossip.h:70
@ GOSSIP_ACTION_BANK
Definition: ScriptedGossip.h:61
@ GOSSIP_ACTION_TRADE
Definition: ScriptedGossip.h:56
@ GOSSIP_ICON_CHAT
Definition: GossipDef.h:60
@ GOSSIP_ICON_INTERACT_1
Definition: GossipDef.h:64
@ GOSSIP_ICON_VENDOR
Definition: GossipDef.h:61
static argentPonyBanner argentBanners[MAX_RACES]
Definition: pet_generic.cpp:131
@ ARGENT_PONY_STATE_MAILBOX
Definition: pet_generic.cpp:96
@ ARGENT_PONY_STATE_BANK
Definition: pet_generic.cpp:95
@ ARGENT_PONY_STATE_VENDOR
Definition: pet_generic.cpp:94
@ SPELL_AURA_TIRED_G
Definition: pet_generic.cpp:108
@ ARGENT_PONY_STATE_ENCH
Definition: pet_generic.cpp:93
@ SPELL_AURA_TIRED_S
Definition: pet_generic.cpp:103
@ GOSSIP_ACTION_MAILBOX
Definition: pet_generic.cpp:112
#define MAX_RACES
Definition: SharedDefines.h:95
@ RACE_HUMAN
Definition: SharedDefines.h:71
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:213
CreatureAI * AI() const
Definition: Creature.h:143
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
TeamId GetTeamId(bool original=false) const
Definition: Player.h:2088
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:404
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5669
ObjectGuid GetOwnerGUID() const
Definition: Unit.h:1210

References _state, AddGossipItemFor(), Creature::AI(), ARGENT_PONY_STATE_BANK, ARGENT_PONY_STATE_ENCH, ARGENT_PONY_STATE_MAILBOX, ARGENT_PONY_STATE_VENDOR, argentBanners, UnitAI::GetData(), Player::GetGossipTextId(), Object::GetGUID(), Unit::GetOwnerGUID(), Player::GetTeamId(), GOSSIP_ACTION_BANK, GOSSIP_ACTION_MAILBOX, GOSSIP_ACTION_TRADE, GOSSIP_ICON_CHAT, GOSSIP_ICON_INTERACT_1, GOSSIP_ICON_VENDOR, GOSSIP_SENDER_MAIN, Unit::HasAura(), MAX_RACES, RACE_HUMAN, SendGossipMenuFor(), SPELL_AURA_TIRED_G, and SPELL_AURA_TIRED_S.

◆ OnGossipSelect()

bool npc_pet_gen_argent_pony_bridle::OnGossipSelect ( Player player,
Creature creature,
uint32  ,
uint32  action 
)
inline
291 {
292 CloseGossipMenuFor(player);
293 uint32 spellId = 0;
294 switch (action)
295 {
298 player->GetSession()->SendListInventory(creature->GetGUID());
299 spellId = player->GetTeamId(true) ? SPELL_AURA_SHOP_G : SPELL_AURA_SHOP_S;
301 break;
304 player->GetSession()->SendShowBank(player->GetGUID());
305 spellId = player->GetTeamId(true) ? SPELL_AURA_BANK_G : SPELL_AURA_BANK_S;
306 creature->AI()->DoAction(ARGENT_PONY_STATE_BANK);
307 break;
309 {
311 player->GetSession()->SendShowMailBox(creature->GetGUID());
312 spellId = player->GetTeamId(true) ? SPELL_AURA_POSTMAN_G : SPELL_AURA_POSTMAN_S;
314 break;
315 }
316 default:
317 if (action > 60000)
318 {
319 creature->AI()->DoAction(action);
320 creature->CastSpell(creature, action, true);
321 }
322 return true;
323 }
324
325 if (spellId && !creature->HasAura(spellId))
326 {
327 creature->CastSpell(creature, spellId, true);
328 player->AddSpellCooldown(spellId, 0, 3 * MINUTE * IN_MILLISECONDS);
331 }
332 return true;
333 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:53
constexpr auto HOUR
Definition: Common.h:48
constexpr auto MINUTE
Definition: Common.h:47
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
@ UNIT_NPC_FLAG_BANKER
Definition: UnitDefines.h:311
@ UNIT_NPC_FLAG_VENDOR
Definition: UnitDefines.h:301
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:294
@ UNIT_NPC_FLAG_MAILBOX
Definition: UnitDefines.h:320
@ SPELL_AURA_BANK_G
Definition: pet_generic.cpp:105
@ SPELL_AURA_POSTMAN_S
Definition: pet_generic.cpp:100
@ SPELL_AURA_SHOP_S
Definition: pet_generic.cpp:101
@ SPELL_AURA_BANK_S
Definition: pet_generic.cpp:102
@ SPELL_AURA_SHOP_G
Definition: pet_generic.cpp:107
@ SPELL_AURA_POSTMAN_G
Definition: pet_generic.cpp:106
virtual void DoAction(int32)
Definition: UnitAI.h:212
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2173
WorldSession * GetSession() const
Definition: Player.h:1978
void AddSpellCooldown(uint32 spell_id, uint32 itemid, uint32 end_time, bool needSendToClient=false, bool forceSendToSpectator=false) override
Definition: Player.cpp:11085
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1168
void ReplaceAllNpcFlags(NPCFlags flags)
Definition: Unit.h:697
void SendListInventory(ObjectGuid guid, uint32 vendorEntry=0)
Definition: ItemHandler.cpp:1036
void SendShowMailBox(ObjectGuid guid)
Definition: NPCHandler.cpp:73
void SendShowBank(ObjectGuid guid)
Definition: BankHandler.cpp:189

References Player::AddSpellCooldown(), Creature::AI(), ARGENT_PONY_STATE_BANK, ARGENT_PONY_STATE_MAILBOX, ARGENT_PONY_STATE_VENDOR, Unit::CastSpell(), CloseGossipMenuFor(), Creature::DespawnOrUnsummon(), UnitAI::DoAction(), Object::GetGUID(), Player::GetSession(), Player::GetTeamId(), GOSSIP_ACTION_BANK, GOSSIP_ACTION_MAILBOX, GOSSIP_ACTION_TRADE, Unit::HasAura(), HOUR, IN_MILLISECONDS, MINUTE, Unit::ReplaceAllNpcFlags(), WorldSession::SendListInventory(), WorldSession::SendShowBank(), WorldSession::SendShowMailBox(), SPELL_AURA_BANK_G, SPELL_AURA_BANK_S, SPELL_AURA_POSTMAN_G, SPELL_AURA_POSTMAN_S, SPELL_AURA_SHOP_G, SPELL_AURA_SHOP_S, SPELL_AURA_TIRED_G, SPELL_AURA_TIRED_S, UNIT_NPC_FLAG_BANKER, UNIT_NPC_FLAG_GOSSIP, UNIT_NPC_FLAG_MAILBOX, and UNIT_NPC_FLAG_VENDOR.

◆ Reset()

void npc_pet_gen_argent_pony_bridle::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

168 {
169 if (_init)
170 return;
171
172 _init = true;
173 uint32 duration = 0;
174 uint32 aura = 0;
176
177 if (Unit* owner = me->GetCharmerOrOwner())
178 if (Player* player = owner->ToPlayer())
179 if (player->HasAchieved(ACHIEVEMENT_PONY_UP))
180 {
182
183 aura = (player->GetTeamId(true) == TEAM_ALLIANCE ? SPELL_AURA_TIRED_S : SPELL_AURA_TIRED_G);
184 duration = player->GetSpellCooldownDelay(aura);
186
187 for (uint8 i = 0; i < 3; ++i)
188 {
189 if (player->GetTeamId(true) == TEAM_ALLIANCE)
190 {
191 if (uint32 cooldown = player->GetSpellCooldownDelay(SPELL_AURA_POSTMAN_S + i))
192 {
193 duration = cooldown;
194 aura = SPELL_AURA_POSTMAN_S + i;
196 me->ToTempSummon()->UnSummon(duration);
197 break;
198 }
199 }
200 else
201 {
202 if (uint32 cooldown = player->GetSpellCooldownDelay(SPELL_AURA_BANK_G + i))
203 {
204 duration = cooldown * IN_MILLISECONDS;
205 aura = SPELL_AURA_BANK_G + i;
207 me->ToTempSummon()->UnSummon(duration);
208 break;
209 }
210 }
211 }
212
213 // Generate Banners
214 uint32 mask = player->GetTeamId(true) ? RACEMASK_HORDE : RACEMASK_ALLIANCE;
215 for (uint8 i = 1; i < MAX_RACES; ++i)
216 if (mask & (1 << (i - 1)) && player->HasAchieved(argentBanners[i].achievement))
217 _banners[i] = true;
218 }
219
220 if (duration && aura)
221 {
222 if (Aura* aur = me->AddAura(aura, me))
223 aur->SetDuration(duration);
224 }
225 }
@ UNIT_NPC_FLAG_NONE
Definition: UnitDefines.h:293
static uint32 argentPonyService[2][3]
Definition: pet_generic.cpp:118
@ ACHIEVEMENT_PONY_UP
Definition: pet_generic.cpp:110
#define RACEMASK_HORDE
Definition: SharedDefines.h:107
@ TEAM_ALLIANCE
Definition: SharedDefines.h:760
@ TEAM_HORDE
Definition: SharedDefines.h:761
#define RACEMASK_ALLIANCE
Definition: SharedDefines.h:103
virtual void UnSummon(uint32 msTime=0)
Definition: TemporarySummon.cpp:282
Player * ToPlayer()
Definition: Object.h:198
Definition: Player.h:1064
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:18819
TempSummon * ToTempSummon()
Definition: Unit.h:1716
Definition: SpellAuras.h:87

References _banners, _init, _state, ACHIEVEMENT_PONY_UP, Unit::AddAura(), ARGENT_PONY_STATE_ENCH, argentBanners, argentPonyService, Unit::GetCharmerOrOwner(), IN_MILLISECONDS, MAX_RACES, ScriptedAI::me, RACEMASK_ALLIANCE, RACEMASK_HORDE, Unit::ReplaceAllNpcFlags(), SPELL_AURA_BANK_G, SPELL_AURA_POSTMAN_S, SPELL_AURA_TIRED_G, SPELL_AURA_TIRED_S, TEAM_ALLIANCE, TEAM_HORDE, Object::ToPlayer(), Unit::ToTempSummon(), UNIT_NPC_FLAG_GOSSIP, UNIT_NPC_FLAG_NONE, and TempSummon::UnSummon().

◆ UpdateAI()

void npc_pet_gen_argent_pony_bridle::UpdateAI ( uint32  )
inlineoverridevirtual

Use to start attacking a target. Called just before JustEngagedWith()

Reimplemented from ScriptedAI.

228 {
229 _mountTimer += diff;
230 if (_mountTimer > 5000)
231 {
232 _mountTimer = 0;
235 else if (Unit* owner = me->GetCharmerOrOwner())
236 {
237 if (owner->IsMounted() && !me->IsMounted())
239 else if (!owner->IsMounted() && me->IsMounted())
241 }
242 }
243 }
@ SPELL_PONY_MOUNT
Definition: pet_generic.cpp:98
bool IsMounted() const
Definition: Unit.h:990

References _mountTimer, _state, ARGENT_PONY_STATE_NONE, Unit::CastSpell(), Unit::GetCharmerOrOwner(), Unit::IsMounted(), ScriptedAI::me, Unit::RemoveAurasDueToSpell(), Unit::ReplaceAllNpcFlags(), SPELL_PONY_MOUNT, and UNIT_NPC_FLAG_NONE.

Member Data Documentation

◆ _banners

bool npc_pet_gen_argent_pony_bridle::_banners[MAX_RACES]
private

◆ _init

bool npc_pet_gen_argent_pony_bridle::_init
private

◆ _lastAura

uint32 npc_pet_gen_argent_pony_bridle::_lastAura
private

◆ _mountTimer

int32 npc_pet_gen_argent_pony_bridle::_mountTimer
private

◆ _state

uint8 npc_pet_gen_argent_pony_bridle::_state
private