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

Public Member Functions

 npc_simoneAI (Creature *creature)
 
void SetPreciousGUID ()
 
CreaturePrecious ()
 
npc_precious::npc_preciousAIPreciousAI ()
 
void RespawnPet ()
 
void HandlePetRespawn ()
 
void JustRespawned () override
 
void JustDied (Unit *killer) override
 
void CorpseRemoved (uint32 &) override
 == Triggered Actions Requested ================== More...
 
void Reset () override
 
void JustEngagedWith (Unit *who) override
 Called for reaction when initially engaged. More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void SpellHit (Unit *, SpellInfo const *Spell) override
 
void ScheduleEncounterStart (ObjectGuid playerGUID)
 
- Public Member Functions inherited from NPCStaveQuestAI
 NPCStaveQuestAI (Creature *creature)
 
uint32 GetFormEntry (std::string)
 
bool InNormalForm ()
 
void RevealForm ()
 
void StorePlayerGUID ()
 
PlayerGetGossipPlayer ()
 
bool IsAllowedEntry (uint32)
 
bool UnitIsUnfair (Unit *unit)
 
bool IsFairFight ()
 
bool ValidThreatlist ()
 
void SetHomePosition ()
 
void PrepareForEncounter ()
 
void ClearLootIfUnfair (Unit *killer)
 
bool PlayerEligibleForReward (Unit *killer)
 
void StoreAttackerGuidValue (Unit *attacker)
 
bool QuestIncomplete (Unit *unit, uint32 questItem)
 
void ResetState (uint32)
 
void EvadeOnFeignDeath ()
 
virtual void AttackStart (Unit *)
 
virtual void AttackedBy (Unit *)
 
virtual void JustDied (Unit *)
 
- 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
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () 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)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon. More...
 
 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
 

Public Attributes

EventMap events
 
ObjectGuid preciousGUID
 
- Public Attributes inherited from NPCStaveQuestAI
ObjectGuid gossipPlayerGUID
 
ObjectGuid playerGUID
 
bool encounterStarted
 
ThreatContainer::StorageType const & threatList = me->GetThreatMgr().GetThreatList()
 
std::map< int, int > entryKeys
 
std::map< int, std::map< std::string, int > > entryList
 
std::vector< uint64attackerGuids
 
- Public Attributes inherited from ScriptedAI
Creatureme
 

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 ()
 
- 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_simoneAI()

npc_simone::npc_simoneAI::npc_simoneAI ( Creature creature)
inline
529: NPCStaveQuestAI(creature) { }
Definition: npc_stave_of_ancients.h:134

Member Function Documentation

◆ CorpseRemoved()

void npc_simone::npc_simoneAI::CorpseRemoved ( uint32 )
inlineoverridevirtual

== Triggered Actions Requested ==================

== State checks =================================

Reimplemented from CreatureAI.

629 {
630 if (!Precious())
631 {
632 return;
633 }
634
635 if (Precious()->IsInCombat())
636 {
637 // If Simone corpse is removed but pet is InCombat, EnterEvadeMode and auto despawn on pet reaching home
640 }
641 else
642 {
644 }
645 }
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:208
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2178
void FlagForDespawn()
Definition: npc_stave_of_ancients.cpp:510
npc_precious::npc_preciousAI * PreciousAI()
Definition: npc_stave_of_ancients.cpp:564
Creature * Precious()
Definition: npc_stave_of_ancients.cpp:549

References Creature::DespawnOrUnsummon(), CreatureAI::EnterEvadeMode(), npc_precious::npc_preciousAI::FlagForDespawn(), Precious(), and PreciousAI().

◆ HandlePetRespawn()

void npc_simone::npc_simoneAI::HandlePetRespawn ( )
inline
585 {
586 if (Precious() && Precious()->isDead())
587 {
588 RespawnPet();
589 }
590 }
void RespawnPet()
Definition: npc_stave_of_ancients.cpp:574

References Precious(), and RespawnPet().

Referenced by UpdateAI().

◆ JustDied()

void npc_simone::npc_simoneAI::JustDied ( Unit killer)
inlineoverridevirtual

Reimplemented from NPCStaveQuestAI.

604 {
606
607 if (!Precious())
608 {
609 return;
610 }
611
612 if (Precious()->isDead())
613 {
614 // Make it so that Precious respawns after Simone
615 uint32 respawnTime = me->GetRespawnTime() - GameTime::GetGameTime().count();
616 Precious()->SetRespawnTime(respawnTime);
617 return;
618 }
619
620 Position petResetPos = me->GetNearPosition(-5.0f, 0.0f);
621
622 if (petResetPos.IsPositionValid())
623 {
624 Precious()->SetHomePosition(petResetPos);
625 }
626 }
std::uint32_t uint32
Definition: Define.h:107
Seconds GetGameTime()
Definition: GameTime.cpp:38
Creature * me
Definition: ScriptedCreature.h:280
time_t const & GetRespawnTime() const
Definition: Creature.h:285
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:336
void SetRespawnTime(uint32 respawn)
Definition: Creature.cpp:3775
Position GetNearPosition(float dist, float angle, bool disableWarning=false)
Definition: Object.cpp:2739
Definition: Position.h:27
bool IsPositionValid() const
Definition: Position.cpp:176
virtual void JustDied(Unit *)
Definition: npc_stave_of_ancients.cpp:266

References GameTime::GetGameTime(), WorldObject::GetNearPosition(), Creature::GetRespawnTime(), Position::IsPositionValid(), NPCStaveQuestAI::JustDied(), ScriptedAI::me, Precious(), Creature::SetHomePosition(), and Creature::SetRespawnTime().

◆ JustEngagedWith()

void npc_simone::npc_simoneAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

656 {
657 RevealForm();
659
660 if (!InNormalForm())
661 {
662 if (who && (UnitIsUnfair(who) || !QuestIncomplete(who, SIMONE_HEAD)))
663 {
664 me->CastSpell(who, SPELL_FOOLS_PLIGHT, true);
665 }
666
667 events.ScheduleEvent(EVENT_RANGE_CHECK, 1000);
668 events.ScheduleEvent(EVENT_UNFAIR_FIGHT, 1000);
669 events.ScheduleEvent(SIMONE_EVENT_CHAIN_LIGHTNING, 3000);
670 events.ScheduleEvent(SIMONE_EVENT_TEMPTRESS_KISS, 1000);
671 }
672
673 events.ScheduleEvent(EVENT_FOOLS_PLIGHT, urand(2000, 3000));
674 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
events
Definition: boss_sartura.cpp:43
@ EVENT_UNFAIR_FIGHT
Definition: npc_stave_of_ancients.h:33
@ EVENT_FOOLS_PLIGHT
Definition: npc_stave_of_ancients.h:31
@ EVENT_RANGE_CHECK
Definition: npc_stave_of_ancients.h:32
@ SPELL_FOOLS_PLIGHT
Definition: npc_stave_of_ancients.h:42
@ SIMONE_EVENT_CHAIN_LIGHTNING
Definition: npc_stave_of_ancients.h:66
@ SIMONE_HEAD
Definition: npc_stave_of_ancients.h:76
@ SIMONE_EVENT_TEMPTRESS_KISS
Definition: npc_stave_of_ancients.h:67
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:294
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:727
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:1167
bool QuestIncomplete(Unit *unit, uint32 questItem)
Definition: npc_stave_of_ancients.cpp:213
bool InNormalForm()
Definition: npc_stave_of_ancients.cpp:34
void RevealForm()
Definition: npc_stave_of_ancients.cpp:39
bool UnitIsUnfair(Unit *unit)
Definition: npc_stave_of_ancients.cpp:77

References Unit::CastSpell(), EVENT_FOOLS_PLIGHT, EVENT_RANGE_CHECK, EVENT_UNFAIR_FIGHT, NPCStaveQuestAI::InNormalForm(), ScriptedAI::me, NPCStaveQuestAI::QuestIncomplete(), Unit::RemoveNpcFlag(), NPCStaveQuestAI::RevealForm(), SIMONE_EVENT_CHAIN_LIGHTNING, SIMONE_EVENT_TEMPTRESS_KISS, SIMONE_HEAD, SPELL_FOOLS_PLIGHT, UNIT_NPC_FLAG_GOSSIP, NPCStaveQuestAI::UnitIsUnfair(), and urand().

◆ JustRespawned()

void npc_simone::npc_simoneAI::JustRespawned ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

593 {
594 // Using Respawn() instead of HandlePetRespawn because we want to respawn pet in
595 // normal entry form
596 if (Precious())
597 {
598 Precious()->Respawn();
599 }
600 Reset();
601 }
void Respawn(bool force=false)
Definition: Creature.cpp:2035
void Reset() override
Definition: npc_stave_of_ancients.cpp:647

References Precious(), Reset(), and Creature::Respawn().

◆ Precious()

Creature * npc_simone::npc_simoneAI::Precious ( )
inline
550 {
551 if (preciousGUID.IsEmpty())
552 {
554 }
555
556 if (!preciousGUID.IsEmpty())
557 {
559 }
560
561 return nullptr;
562 }
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
bool IsEmpty() const
Definition: ObjectGuid.h:161
void SetPreciousGUID()
Definition: npc_stave_of_ancients.cpp:534
ObjectGuid preciousGUID
Definition: npc_stave_of_ancients.cpp:532

References ObjectAccessor::GetCreature(), ObjectGuid::IsEmpty(), ScriptedAI::me, preciousGUID, and SetPreciousGUID().

Referenced by CorpseRemoved(), HandlePetRespawn(), JustDied(), JustRespawned(), PreciousAI(), RespawnPet(), and UpdateAI().

◆ PreciousAI()

npc_precious::npc_preciousAI * npc_simone::npc_simoneAI::PreciousAI ( )
inline
565 {
566 if (Precious())
567 {
569 }
570
571 return nullptr;
572 }
#define CAST_AI(a, b)
Definition: UnitAI.h:26
Definition: npc_stave_of_ancients.cpp:464

References CAST_AI, and Precious().

Referenced by CorpseRemoved(), ScheduleEncounterStart(), and UpdateAI().

◆ Reset()

void npc_simone::npc_simoneAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

648 {
650 events.Reset();
651
652 events.ScheduleEvent(SIMONE_EVENT_CHECK_PET_STATE, 2000);
653 }
@ SIMONE_SPELL_SILENCE
Definition: npc_stave_of_ancients.h:82
@ SIMONE_EVENT_CHECK_PET_STATE
Definition: npc_stave_of_ancients.h:65
void ResetState(uint32)
Definition: npc_stave_of_ancients.cpp:227

References NPCStaveQuestAI::ResetState(), SIMONE_EVENT_CHECK_PET_STATE, and SIMONE_SPELL_SILENCE.

Referenced by JustRespawned().

◆ RespawnPet()

void npc_simone::npc_simoneAI::RespawnPet ( )
inline
575 {
576 Position current = me->GetNearPosition(-5.0f, 0.0f);
577 Precious()->RemoveCorpse(false, false);
578 Precious()->SetPosition(current);
579 Precious()->SetHomePosition(current);
580 Precious()->setDeathState(DeathState::JustRespawned);
582 }
void setDeathState(DeathState s, bool despawn=false) override
A creature can be in 4 different states: Alive, JustDied, Corpse, and JustRespawned....
Definition: Creature.cpp:1965
void RemoveCorpse(bool setSpawnTime=true, bool skipVisibility=false)
Definition: Creature.cpp:400
void SetPosition(float x, float y, float z, float o)
Definition: Creature.cpp:3154
void UpdateObjectVisibility(bool forced=true, bool fromUpdate=false) override
Definition: Unit.cpp:19130

References WorldObject::GetNearPosition(), ScriptedAI::me, Precious(), Creature::RemoveCorpse(), Creature::setDeathState(), Creature::SetHomePosition(), Creature::SetPosition(), and Unit::UpdateObjectVisibility().

Referenced by HandlePetRespawn().

◆ ScheduleEncounterStart()

void npc_simone::npc_simoneAI::ScheduleEncounterStart ( ObjectGuid  playerGUID)
inline
801 {
803 if (PreciousAI())
804 {
806 }
808 events.ScheduleEvent(EVENT_ENCOUNTER_START, 1000);
809 }
@ EVENT_ENCOUNTER_START
Definition: npc_stave_of_ancients.h:29
ObjectGuid gossipPlayerGUID
Definition: npc_stave_of_ancients.h:137
void PrepareForEncounter()
Definition: npc_stave_of_ancients.cpp:152
ObjectGuid playerGUID
Definition: npc_stave_of_ancients.h:138

References EVENT_ENCOUNTER_START, NPCStaveQuestAI::gossipPlayerGUID, NPCStaveQuestAI::playerGUID, PreciousAI(), and NPCStaveQuestAI::PrepareForEncounter().

◆ SetPreciousGUID()

void npc_simone::npc_simoneAI::SetPreciousGUID ( )
inline
535 {
536 if (CreatureGroup* formation = me->GetFormation())
537 {
538 const CreatureGroup::CreatureGroupMemberType& members = formation->GetMembers();
539 for (CreatureGroup::CreatureGroupMemberType::const_iterator itr = members.begin(); itr != members.end(); ++itr)
540 {
541 if (itr->first && itr->first->GetOriginalEntry() == PRECIOUS_NORMAL_ENTRY)
542 {
543 preciousGUID = itr->first->GetGUID();
544 }
545 }
546 }
547 }
@ PRECIOUS_NORMAL_ENTRY
Definition: npc_stave_of_ancients.h:87
CreatureGroup const * GetFormation() const
Definition: Creature.h:353
Definition: CreatureGroups.h:90
std::map< Creature *, FormationInfo > CreatureGroupMemberType
Definition: CreatureGroups.h:93

References Creature::GetFormation(), ScriptedAI::me, PRECIOUS_NORMAL_ENTRY, and preciousGUID.

Referenced by Precious().

◆ SpellHit()

void npc_simone::npc_simoneAI::SpellHit ( Unit ,
SpellInfo const *  Spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

789 {
790 if (!InNormalForm())
791 {
793 {
796 }
797 }
798 }
@ SIMONE_WEAKNESS_EMOTE
Definition: npc_stave_of_ancients.h:71
@ SIMONE_SPELL_WEAKNESS_VIPER_STING
Definition: npc_stave_of_ancients.h:78
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:18863
virtual void TextEmote(std::string_view text, WorldObject const *target=nullptr, bool isBossEmote=false)
Definition: Unit.cpp:21149
Definition: Spell.h:287

References Unit::AddAura(), NPCStaveQuestAI::InNormalForm(), ScriptedAI::me, SIMONE_SPELL_SILENCE, SIMONE_SPELL_WEAKNESS_VIPER_STING, SIMONE_WEAKNESS_EMOTE, and Unit::TextEmote().

◆ UpdateAI()

void npc_simone::npc_simoneAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

677 {
678 events.Update(diff);
679 uint32 eventId = events.ExecuteEvent();
680
681 // Out of combat events
682 switch (eventId)
683 {
688 events.ScheduleEvent(SIMONE_EVENT_TALK, 4000);
689 break;
694 if (Precious())
695 {
697 }
698 events.ScheduleEvent(EVENT_REVEAL, 5000);
699 break;
700 case EVENT_REVEAL:
701 RevealForm();
702 if (PreciousAI())
703 {
705 }
706 break;
707 // Prevent hunters from figthing Simone alone
709 if (!me->IsInCombat() && !me->IsInEvadeMode())
710 {
711 if (Precious() && Precious()->isDead())
712 {
714 }
715
716 events.ScheduleEvent(SIMONE_EVENT_CHECK_PET_STATE, 1000);
717 }
718 break;
719 }
720
721 if (UpdateVictim())
722 {
723 // This should prevent hunters from staying in combat when feign death is used and there is a bystander with 0 threat
725 }
726 else
727 {
728 return;
729 }
730
732 {
733 events.RepeatEvent(1000);
734 return;
735 }
736
737 // In combat events
738 switch (eventId)
739 {
742 {
744 }
745 events.RepeatEvent(urand(3000, 6000));
746 break;
748 if (!me->GetVictim()->IsWithinDist2d(me, 60.0f))
749 {
751 }
752 else
753 {
754 events.RepeatEvent(2000);
755 }
756 break;
759 {
762
764 Precious()->SetImmuneToAll(true);
766 me->SetImmuneToAll(true);
767
769
770 me->DespawnOrUnsummon(5000);
771 break;
772 }
773 events.RepeatEvent(2000);
774 break;
777 events.RepeatEvent(7000);
778 break;
781 events.RepeatEvent(45000);
782 break;
783 }
784
786 }
@ EVENT_REVEAL
Definition: npc_stave_of_ancients.h:30
@ SIMONE_SAY
Definition: npc_stave_of_ancients.h:70
@ SIMONE_EMOTE
Definition: npc_stave_of_ancients.h:69
@ SIMONE_EVENT_TALK
Definition: npc_stave_of_ancients.h:64
@ SIMONE_SPELL_CHAIN_LIGHTNING
Definition: npc_stave_of_ancients.h:80
@ SIMONE_SPELL_TEMPTRESS_KISS
Definition: npc_stave_of_ancients.h:79
@ EMOTE_ONESHOT_LAUGH
Definition: SharedDefines.h:1903
@ EMOTE_ONESHOT_NONE
Definition: SharedDefines.h:1894
@ EMOTE_ONESHOT_TALK
Definition: SharedDefines.h:1895
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
@ UNIT_FLAG_DISABLE_MOVE
Definition: UnitDefines.h:231
@ UNIT_FLAG_NOT_ATTACKABLE_1
Definition: UnitDefines.h:236
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
bool UpdateVictim()
Definition: CreatureAI.cpp:280
bool IsInEvadeMode() const
Definition: Creature.h:134
bool IsWithinDist2d(float x, float y, float dist) const
Definition: Object.cpp:1316
virtual void Say(std::string_view text, Language language, WorldObject const *target=nullptr)
Definition: Unit.cpp:21139
Unit * GetVictim() const
Definition: Unit.h:853
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:713
void HandleEmoteCommand(uint32 emoteId)
Definition: Unit.cpp:2000
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:874
bool IsInCombat() const
Definition: Unit.h:884
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:714
void HandlePetRespawn()
Definition: npc_stave_of_ancients.cpp:584
void EvadeOnFeignDeath()
Definition: npc_stave_of_ancients.cpp:242
bool ValidThreatlist()
Definition: npc_stave_of_ancients.cpp:130
Player * GetGossipPlayer()
Definition: npc_stave_of_ancients.cpp:65
void SetHomePosition()
Definition: npc_stave_of_ancients.cpp:142

References Unit::CastSpell(), Creature::DespawnOrUnsummon(), UnitAI::DoMeleeAttackIfReady(), EMOTE_ONESHOT_LAUGH, EMOTE_ONESHOT_NONE, EMOTE_ONESHOT_TALK, CreatureAI::EnterEvadeMode(), NPCStaveQuestAI::EvadeOnFeignDeath(), EVENT_ENCOUNTER_START, EVENT_FOOLS_PLIGHT, EVENT_RANGE_CHECK, EVENT_REVEAL, EVENT_UNFAIR_FIGHT, NPCStaveQuestAI::GetGossipPlayer(), Unit::GetVictim(), Unit::HandleEmoteCommand(), HandlePetRespawn(), Unit::HasUnitState(), NPCStaveQuestAI::InNormalForm(), Unit::IsInCombat(), Creature::IsInEvadeMode(), WorldObject::IsWithinDist2d(), ScriptedAI::me, Precious(), PreciousAI(), NPCStaveQuestAI::QuestIncomplete(), Unit::RemoveUnitFlag(), NPCStaveQuestAI::RevealForm(), Unit::Say(), NPCStaveQuestAI::SetHomePosition(), Unit::SetImmuneToAll(), Unit::SetUnitFlag(), SIMONE_EMOTE, SIMONE_EVENT_CHAIN_LIGHTNING, SIMONE_EVENT_CHECK_PET_STATE, SIMONE_EVENT_TALK, SIMONE_EVENT_TEMPTRESS_KISS, SIMONE_HEAD, SIMONE_SAY, SIMONE_SPELL_CHAIN_LIGHTNING, SIMONE_SPELL_TEMPTRESS_KISS, SPELL_FOOLS_PLIGHT, Unit::TextEmote(), UNIT_FLAG_DISABLE_MOVE, UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_ATTACKABLE_1, UNIT_STATE_CASTING, NPCStaveQuestAI::UnitIsUnfair(), CreatureAI::UpdateVictim(), urand(), and NPCStaveQuestAI::ValidThreatlist().

Member Data Documentation

◆ events

EventMap npc_simone::npc_simoneAI::events

◆ preciousGUID

ObjectGuid npc_simone::npc_simoneAI::preciousGUID

Referenced by Precious(), and SetPreciousGUID().