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

Public Member Functions

 npc_ranshallaAI (Creature *creature)
 
void Reset () override
 
void DoContinueEscort (bool isAltarWaypoint=false)
 
void DoChannelTorchSpell (bool isAltarWaypoint=false)
 
void DoSummonPriestess ()
 
void SummonedMovementInform (Creature *summoned, uint32 type, uint32 pointId)
 
void WaypointReached (uint32 pointId) override
 
void JustDidDialogueStep (int32 entry) override
 Will be called when a dialogue step was done.
 
CreatureGetSpeakerByEntry (int32 entry) override
 Will be called to get a speaker, MUST be implemented if not used in instances.
 
void UpdateEscortAI (uint32 diff) override
 
virtual void WaypointReached (uint32, uint32)
 
- Public Member Functions inherited from npc_escortAI
 npc_escortAI (Creature *creature)
 
 ~npc_escortAI () override
 
void AttackStart (Unit *who) override
 
void MoveInLineOfSight (Unit *who) override
 
void JustDied (Unit *) override
 
void JustRespawned () override
 
void ReturnToLastPoint ()
 
void EnterEvadeMode (EvadeReason=EVADE_REASON_OTHER) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void MovementInform (uint32, uint32) override
 
void AddWaypoint (uint32 id, float x, float y, float z, uint32 waitTime=0)
 
bool SetNextWaypoint (uint32 pointId, float x, float y, float z, float orientation)
 
bool SetNextWaypoint (uint32 pointId, bool setPosition=true)
 
bool GetWaypointPosition (uint32 pointId, float &x, float &y, float &z)
 
void GenerateWaypointArray (Movement::PointsArray *points)
 
virtual void WaypointStart (uint32)
 
void Start (bool isActiveAttacker=true, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
 
void SetEscortPaused (bool on)
 
bool HasEscortState (uint32 escortState)
 
bool IsEscorted () override
 
void SetMaxPlayerDistance (float newMax)
 
float GetMaxPlayerDistance ()
 
void SetDespawnAtEnd (bool despawn)
 
void SetDespawnAtFar (bool despawn)
 
bool GetAttack ()
 
void SetCanAttack (bool attack)
 
ObjectGuid GetEventStarterGUID ()
 
void AddEscortState (uint32 escortState)
 
void RemoveEscortState (uint32 escortState)
 
- 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)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
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 - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
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=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, 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=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void OnSpellCast (SpellInfo const *)
 
virtual void OnSpellFailed (SpellInfo const *)
 
virtual void OnChannelFinished (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
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 ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
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)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
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
 
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:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
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.
 
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.
 
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.
 
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.
 
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

uint32 _delayTimer
 
ObjectGuid _firstPriestessGUID
 
ObjectGuid _secondPriestessGUID
 
ObjectGuid _guardEluneGUID
 
ObjectGuid _voiceEluneGUID
 
ObjectGuid _altarGUID
 
- Public Attributes inherited from ScriptedAI
Creatureme
 

Private Attributes

EventMap events
 

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 npc_escortAI
PlayerGetPlayerForEscort ()
 
- 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)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 
- Private Member Functions inherited from DialogueHelper
 DialogueHelper (DialogueEntry const *dialogueArray)
 
void StartNextDialogueText (int32 textEntry)
 
void DialogueUpdate (uint32 diff)
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_ranshallaAI()

npc_ranshalla::npc_ranshallaAI::npc_ranshallaAI ( Creature creature)
inline
272 : npc_escortAI(creature),
274 {
275 Reset();
276 }
Definition zone_winterspring.cpp:107
Definition ScriptedEscortAI.h:53
void Reset() override
Definition zone_winterspring.cpp:286
const DialogueEntry introDialogue[]
Definition zone_winterspring.cpp:193

References Reset().

Member Function Documentation

◆ DoChannelTorchSpell()

void npc_ranshalla::npc_ranshallaAI::DoChannelTorchSpell ( bool  isAltarWaypoint = false)
inline
306 {
307 // Check if we are using the fire or the altar and remove the no_interact flag
308 if (isAltarWaypoint)
309 {
311 {
312 go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
314 _altarGUID = go->GetGUID();
315 }
316 }
318 go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
319
320 // Yell and set escort to pause
323 SetEscortPaused(true);
325 }
GameObject * GetClosestGameObjectWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool onlySpawned)
Definition ScriptedCreature.cpp:938
@ GO_FLAG_NOT_SELECTABLE
Definition SharedDefines.h:1613
Definition GameObject.h:120
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:178
void SetFacingToObject(WorldObject *object, Milliseconds timed=0ms)
Definition Unit.cpp:16421
Talk
Definition hyjal.cpp:82
Creature * me
Definition ScriptedCreature.h:281
void SetEscortPaused(bool on)
Definition ScriptedEscortAI.cpp:486
ObjectGuid _altarGUID
Definition zone_winterspring.cpp:284
@ GO_ELUNE_ALTAR
Definition zone_winterspring.cpp:76
@ GO_ELUNE_FIRE
Definition zone_winterspring.cpp:77
@ SAY_REACH_TORCH
Definition zone_winterspring.cpp:28
@ EMOTE_CHANT_SPELL
Definition zone_winterspring.cpp:58
@ SPELL_LIGHT_TORCH
Definition zone_winterspring.cpp:63

References _altarGUID, UnitAI::DoCast(), EMOTE_CHANT_SPELL, GetClosestGameObjectWithEntry(), GO_ELUNE_ALTAR, GO_ELUNE_FIRE, GO_FLAG_NOT_SELECTABLE, ScriptedAI::me, SAY_REACH_TORCH, npc_escortAI::SetEscortPaused(), Unit::SetFacingToObject(), and SPELL_LIGHT_TORCH.

Referenced by JustDidDialogueStep(), and WaypointReached().

◆ DoContinueEscort()

void npc_ranshalla::npc_ranshallaAI::DoContinueEscort ( bool  isAltarWaypoint = false)
inline
293 {
295
296 if (isAltarWaypoint)
298 else
300
301 _delayTimer = 2000;
302 }
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4302
uint32 _delayTimer
Definition zone_winterspring.cpp:278
@ SAY_RANSHALLA_ALTAR_1
Definition zone_winterspring.cpp:34
@ SAY_AFTER_TORCH
Definition zone_winterspring.cpp:29

References _delayTimer, Unit::InterruptNonMeleeSpells(), ScriptedAI::me, SAY_AFTER_TORCH, and SAY_RANSHALLA_ALTAR_1.

◆ DoSummonPriestess()

void npc_ranshalla::npc_ranshallaAI::DoSummonPriestess ( )
inline
328 {
329 // Summon 2 Elune priestess and make each of them move to a different spot
331 {
332 priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[3].m_positionX, wingThicketLocations[3].m_positionY, wingThicketLocations[3].m_positionZ);
333 _firstPriestessGUID = priestess->GetGUID();
334 }
336 {
337 // Left priestess should have a distinct move point because she is the one who starts the dialogue at point reach
338 priestess->GetMotionMaster()->MovePoint(1, wingThicketLocations[4].m_positionX, wingThicketLocations[4].m_positionY, wingThicketLocations[4].m_positionZ);
339 _secondPriestessGUID = priestess->GetGUID();
340 }
341 }
@ TEMPSUMMON_CORPSE_DESPAWN
Definition Object.h:53
Definition Creature.h:47
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2394
float m_positionZ
Definition Position.h:57
float m_positionX
Definition Position.h:55
float m_positionY
Definition Position.h:56
float GetOrientation() const
Definition Position.h:124
ObjectGuid _secondPriestessGUID
Definition zone_winterspring.cpp:281
ObjectGuid _firstPriestessGUID
Definition zone_winterspring.cpp:280
@ NPC_PRIESTESS_ELUNE
Definition zone_winterspring.cpp:69
static Position wingThicketLocations[]
Definition zone_winterspring.cpp:227

References _firstPriestessGUID, _secondPriestessGUID, Position::GetOrientation(), Position::m_positionX, Position::m_positionY, Position::m_positionZ, ScriptedAI::me, NPC_PRIESTESS_ELUNE, WorldObject::SummonCreature(), TEMPSUMMON_CORPSE_DESPAWN, and wingThicketLocations.

Referenced by WaypointReached().

◆ GetSpeakerByEntry()

Creature * npc_ranshalla::npc_ranshallaAI::GetSpeakerByEntry ( int32  )
inlineoverridevirtual

Will be called to get a speaker, MUST be implemented if not used in instances.

Reimplemented from DialogueHelper.

505 {
506 switch (entry)
507 {
508 case NPC_RANSHALLA:
509 return me;
510 case NPC_VOICE_ELUNE:
516 default:
517 return nullptr;
518 }
519 }
Creature * GetCreature(ObjectGuid const &guid)
Definition Map.cpp:2336
Map * GetMap() const
Definition Object.h:625
ObjectGuid _voiceEluneGUID
Definition zone_winterspring.cpp:283
@ NPC_PRIESTESS_DATA_1
Definition zone_winterspring.cpp:89
@ NPC_PRIESTESS_DATA_2
Definition zone_winterspring.cpp:90
@ NPC_RANSHALLA
Definition zone_winterspring.cpp:68
@ NPC_VOICE_ELUNE
Definition zone_winterspring.cpp:70

References _firstPriestessGUID, _secondPriestessGUID, _voiceEluneGUID, Map::GetCreature(), WorldObject::GetMap(), ScriptedAI::me, NPC_PRIESTESS_DATA_1, NPC_PRIESTESS_DATA_2, NPC_RANSHALLA, and NPC_VOICE_ELUNE.

◆ JustDidDialogueStep()

void npc_ranshalla::npc_ranshallaAI::JustDidDialogueStep ( int32  )
inlineoverridevirtual

Will be called when a dialogue step was done.

Reimplemented from DialogueHelper.

406 {
407 switch (entry)
408 {
409 case NPC_RANSHALLA:
410 // Start the altar channeling
412 break;
414 SetEscortPaused(false);
415 break;
417 // make the gem respawn
419 {
420 if (gem->isSpawned())
421 break;
422
423 gem->SetRespawnTime(90);
424 gem->Refresh();
425 }
426 break;
428 // move near the escort npc
429 if (Creature* priestess = me->GetMap()->GetCreature(_firstPriestessGUID))
430 priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[6].m_positionX, wingThicketLocations[6].m_positionY, wingThicketLocations[6].m_positionZ);
431 break;
433 // summon the Guardian of Elune
435 {
436 guard->GetMotionMaster()->MovePoint(0, wingThicketLocations[5].m_positionX, wingThicketLocations[5].m_positionY, wingThicketLocations[5].m_positionZ);
437 _guardEluneGUID = guard->GetGUID();
438 }
439 // summon the Voice of Elune
440 if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
441 {
442 if (Creature* voice = me->SummonCreature(NPC_VOICE_ELUNE, altar->GetPositionX(), altar->GetPositionY(), altar->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000))
443 _voiceEluneGUID = voice->GetGUID();
444 }
445 break;
447 // move near the escort npc and continue dialogue
448 if (Creature* priestess = me->GetMap()->GetCreature(_secondPriestessGUID))
449 {
450 priestess->AI()->Talk(SAY_PRIESTESS_ALTAR_14);
451 priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[7].m_positionX, wingThicketLocations[7].m_positionY, wingThicketLocations[7].m_positionZ);
452 }
453 break;
455 // make the voice of elune leave
456 if (Creature* guard = me->GetMap()->GetCreature(_guardEluneGUID))
457 {
458 guard->GetMotionMaster()->MovePoint(0, wingThicketLocations[2].m_positionX, wingThicketLocations[2].m_positionY, wingThicketLocations[2].m_positionZ);
459 guard->DespawnOrUnsummon(4s);
460 }
461 break;
463 // make the first priestess leave
464 if (Creature* priestess = me->GetMap()->GetCreature(_firstPriestessGUID))
465 {
466 priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[0].m_positionX, wingThicketLocations[0].m_positionY, wingThicketLocations[0].m_positionZ);
467 priestess->DespawnOrUnsummon(4s);
468 }
469 break;
471 // make the second priestess leave
472 if (Creature* priestess = me->GetMap()->GetCreature(_secondPriestessGUID))
473 {
474 priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[1].m_positionX, wingThicketLocations[1].m_positionY, wingThicketLocations[1].m_positionZ);
475 priestess->DespawnOrUnsummon(4s);
476 }
477 break;
478 case DATA_EVENT_END:
479 // Turn towards the player
480 if (Player* player = GetPlayerForEscort())
481 {
482 me->SetFacingToObject(player);
483 Talk(SAY_RANSHALLA_END_1, player);
484 }
485 break;
487 // Turn towards the altar and kneel - quest complete
488 if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
489 {
490 me->SetFacingToObject(altar);
491 altar->ResetDoorOrButton();
492 }
494 if (Player* player = GetPlayerForEscort())
495 {
496 player->GroupEventHappens(QUEST_GUARDIANS_ALTAR, me);
497 Talk(SAY_RANSHALLA_END_2, player);
498 }
500 break;
501 }
502 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:51
@ UNIT_STAND_STATE_KNEEL
Definition UnitDefines.h:43
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2126
GameObject * GetGameObject(ObjectGuid const &guid)
Definition Map.cpp:2341
Definition Player.h:1084
void SetStandState(uint8 state)
Definition Unit.cpp:13089
Player * GetPlayerForEscort()
Definition ScriptedEscortAI.h:114
ObjectGuid _guardEluneGUID
Definition zone_winterspring.cpp:282
void DoChannelTorchSpell(bool isAltarWaypoint=false)
Definition zone_winterspring.cpp:305
@ GO_ELUNE_GEM
Definition zone_winterspring.cpp:78
@ SAY_RANSHALLA_END_2
Definition zone_winterspring.cpp:56
@ SAY_PRIESTESS_ALTAR_20
Definition zone_winterspring.cpp:53
@ SAY_PRIESTESS_ALTAR_14
Definition zone_winterspring.cpp:47
@ SAY_RANSHALLA_ALTAR_6
Definition zone_winterspring.cpp:39
@ SAY_VOICE_ALTAR_15
Definition zone_winterspring.cpp:48
@ SAY_RANSHALLA_END_1
Definition zone_winterspring.cpp:55
@ SAY_PRIESTESS_ALTAR_13
Definition zone_winterspring.cpp:46
@ SAY_PRIESTESS_ALTAR_8
Definition zone_winterspring.cpp:41
@ SAY_PRIESTESS_ALTAR_19
Definition zone_winterspring.cpp:52
@ SAY_PRIESTESS_ALTAR_21
Definition zone_winterspring.cpp:54
@ SAY_PRIESTESS_ALTAR_9
Definition zone_winterspring.cpp:42
@ DATA_EVENT_END
Definition zone_winterspring.cpp:92
@ QUEST_GUARDIANS_ALTAR
Definition zone_winterspring.cpp:84
@ NPC_GUARDIAN_ELUNE
Definition zone_winterspring.cpp:71

References _altarGUID, _firstPriestessGUID, _guardEluneGUID, _secondPriestessGUID, _voiceEluneGUID, DATA_EVENT_END, Creature::DespawnOrUnsummon(), DoChannelTorchSpell(), GetClosestGameObjectWithEntry(), Map::GetCreature(), Map::GetGameObject(), WorldObject::GetMap(), Position::GetOrientation(), npc_escortAI::GetPlayerForEscort(), GO_ELUNE_GEM, Position::m_positionX, Position::m_positionY, Position::m_positionZ, ScriptedAI::me, NPC_GUARDIAN_ELUNE, NPC_RANSHALLA, NPC_VOICE_ELUNE, QUEST_GUARDIANS_ALTAR, SAY_PRIESTESS_ALTAR_13, SAY_PRIESTESS_ALTAR_14, SAY_PRIESTESS_ALTAR_19, SAY_PRIESTESS_ALTAR_20, SAY_PRIESTESS_ALTAR_21, SAY_PRIESTESS_ALTAR_8, SAY_PRIESTESS_ALTAR_9, SAY_RANSHALLA_ALTAR_6, SAY_RANSHALLA_END_1, SAY_RANSHALLA_END_2, SAY_VOICE_ALTAR_15, npc_escortAI::SetEscortPaused(), Unit::SetFacingToObject(), Unit::SetStandState(), WorldObject::SummonCreature(), TEMPSUMMON_CORPSE_DESPAWN, TEMPSUMMON_TIMED_DESPAWN, UNIT_STAND_STATE_KNEEL, and wingThicketLocations.

◆ Reset()

void npc_ranshalla::npc_ranshallaAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

287 {
288 _delayTimer = 0;
289 }

References _delayTimer.

Referenced by npc_ranshallaAI().

◆ SummonedMovementInform()

void npc_ranshalla::npc_ranshallaAI::SummonedMovementInform ( Creature summoned,
uint32  type,
uint32  pointId 
)
inline
344 {
345 if (type != POINT_MOTION_TYPE || summoned->GetEntry() != NPC_PRIESTESS_ELUNE || pointId != 1)
346 return;
347
348 // Start the dialogue when the priestess reach the altar (they should both reach the point in the same time)
350 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
void StartNextDialogueText(int32 textEntry)
Definition zone_winterspring.cpp:120
uint32 GetEntry() const
Definition Object.h:117
@ SAY_PRIESTESS_ALTAR_3
Definition zone_winterspring.cpp:36

References Object::GetEntry(), NPC_PRIESTESS_ELUNE, POINT_MOTION_TYPE, SAY_PRIESTESS_ALTAR_3, and DialogueHelper::StartNextDialogueText().

◆ UpdateEscortAI()

void npc_ranshalla::npc_ranshallaAI::UpdateEscortAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from npc_escortAI.

522 {
523 DialogueUpdate(diff);
524
525 if (_delayTimer)
526 {
527 if (_delayTimer <= diff)
528 {
529 SetEscortPaused(false);
530 _delayTimer = 0;
531 }
532 else
533 _delayTimer -= diff;
534 }
535 events.Update(diff);
536 if (events.ExecuteEvent() == EVENT_RESUME)
538
540 }
events
Definition boss_sartura.cpp:43
void DialogueUpdate(uint32 diff)
Definition zone_winterspring.cpp:141
virtual void UpdateEscortAI(uint32 diff)
Definition ScriptedEscortAI.cpp:309
@ EVENT_RESUME
Definition zone_winterspring.cpp:94

References _delayTimer, DialogueHelper::DialogueUpdate(), EVENT_RESUME, SAY_PRIESTESS_ALTAR_3, npc_escortAI::SetEscortPaused(), DialogueHelper::StartNextDialogueText(), and npc_escortAI::UpdateEscortAI().

◆ WaypointReached() [1/2]

void npc_ranshalla::npc_ranshallaAI::WaypointReached ( uint32  pointId)
inlineoverridevirtual

Implements npc_escortAI.

354 {
355 switch (pointId)
356 {
357 case 3:
359 break;
360 case 10: // Cavern 1
361 case 15: // Cavern 2
362 case 20: // Cavern 3
363 case 25: // Cavern 4
364 case 36: // Cavern 5
366 break;
367 case 39:
369 SetEscortPaused(true);
370 break;
371 case 41:
372 {
373 // Search for all nearest lights and respawn them
374 std::list<GameObject*> eluneLights;
376 for (std::list<GameObject*>::const_iterator itr = eluneLights.begin(); itr != eluneLights.end(); ++itr)
377 {
378 if ((*itr)->isSpawned())
379 continue;
380
381 (*itr)->SetRespawnTime(115);
382 (*itr)->Refresh();
383 }
384
385 if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
386 me->SetFacingToObject(altar);
387 break;
388 }
389 case 42:
390 // Summon the 2 priestess
391 SetEscortPaused(true);
394 events.ScheduleEvent(EVENT_RESUME, 2s);
395 break;
396 case 44:
397 // Stop the escort and turn towards the altar
398 SetEscortPaused(true);
399 if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
400 me->SetFacingToObject(altar);
401 break;
402 }
403 }
void GetGameObjectListWithEntryInGrid(std::list< GameObject * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
Definition ScriptedCreature.cpp:948
void DoSummonPriestess()
Definition zone_winterspring.cpp:327
@ GO_ELUNE_LIGHT
Definition zone_winterspring.cpp:79
@ SAY_REACH_ALTAR_1
Definition zone_winterspring.cpp:30
@ SAY_RANSHALLA_ALTAR_2
Definition zone_winterspring.cpp:35
@ SAY_ENTER_OWL_THICKET
Definition zone_winterspring.cpp:27

References _altarGUID, DoChannelTorchSpell(), DoSummonPriestess(), EVENT_RESUME, Map::GetGameObject(), GetGameObjectListWithEntryInGrid(), WorldObject::GetMap(), GO_ELUNE_LIGHT, ScriptedAI::me, SAY_ENTER_OWL_THICKET, SAY_RANSHALLA_ALTAR_2, SAY_REACH_ALTAR_1, npc_escortAI::SetEscortPaused(), Unit::SetFacingToObject(), and DialogueHelper::StartNextDialogueText().

◆ WaypointReached() [2/2]

virtual void CreatureAI::WaypointReached ( uint32  ,
uint32   
)
inlinevirtual

Reimplemented from npc_escortAI.

193{ }

Member Data Documentation

◆ _altarGUID

ObjectGuid npc_ranshalla::npc_ranshallaAI::_altarGUID

◆ _delayTimer

uint32 npc_ranshalla::npc_ranshallaAI::_delayTimer

◆ _firstPriestessGUID

ObjectGuid npc_ranshalla::npc_ranshallaAI::_firstPriestessGUID

◆ _guardEluneGUID

ObjectGuid npc_ranshalla::npc_ranshallaAI::_guardEluneGUID

Referenced by JustDidDialogueStep().

◆ _secondPriestessGUID

ObjectGuid npc_ranshalla::npc_ranshallaAI::_secondPriestessGUID

◆ _voiceEluneGUID

ObjectGuid npc_ranshalla::npc_ranshallaAI::_voiceEluneGUID

◆ events

EventMap npc_ranshalla::npc_ranshallaAI::events
private

The documentation for this struct was generated from the following file: