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
 
- 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, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
 
void SetRun (bool on=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.
 
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.
 
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
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void AttackedBy (Unit *)
 
virtual void PathEndReached (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 *)
 
virtual void OwnerAttacked (Unit *)
 
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)
 
- 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, 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 JustEnteredCombat (Unit *)
 Called when the unit enters combat.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
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
 
- 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
303 : npc_escortAI(creature),
305 {
306 Reset();
307 }
Definition zone_winterspring.cpp:141
Definition ScriptedEscortAI.h:53
void Reset() override
Definition zone_winterspring.cpp:317
const DialogueEntry introDialogue[]
Definition zone_winterspring.cpp:227

References Reset().

Member Function Documentation

◆ DoChannelTorchSpell()

void npc_ranshalla::npc_ranshallaAI::DoChannelTorchSpell ( bool  isAltarWaypoint = false)
inline
337 {
338 // Check if we are using the fire or the altar and remove the no_interact flag
339 if (isAltarWaypoint)
340 {
342 {
343 go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
345 _altarGUID = go->GetGUID();
346 }
347 }
349 go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
350
351 // Yell and set escort to pause
354 SetEscortPaused(true);
356 }
GameObject * GetClosestGameObjectWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool onlySpawned)
Definition ScriptedCreature.cpp:870
@ GO_FLAG_NOT_SELECTABLE
Definition SharedDefines.h:1607
Definition GameObject.h:120
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:177
void SetFacingToObject(WorldObject *object)
Definition Unit.cpp:20337
Talk
Definition hyjal.cpp:82
Creature * me
Definition ScriptedCreature.h:280
void SetEscortPaused(bool on)
Definition ScriptedEscortAI.cpp:516
ObjectGuid _altarGUID
Definition zone_winterspring.cpp:315
@ GO_ELUNE_ALTAR
Definition zone_winterspring.cpp:110
@ GO_ELUNE_FIRE
Definition zone_winterspring.cpp:111
@ SAY_REACH_TORCH
Definition zone_winterspring.cpp:62
@ EMOTE_CHANT_SPELL
Definition zone_winterspring.cpp:92
@ SPELL_LIGHT_TORCH
Definition zone_winterspring.cpp:97

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
324 {
326
327 if (isAltarWaypoint)
329 else
331
332 _delayTimer = 2000;
333 }
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4162
uint32 _delayTimer
Definition zone_winterspring.cpp:309
@ SAY_RANSHALLA_ALTAR_1
Definition zone_winterspring.cpp:68
@ SAY_AFTER_TORCH
Definition zone_winterspring.cpp:63

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

◆ DoSummonPriestess()

void npc_ranshalla::npc_ranshallaAI::DoSummonPriestess ( )
inline
359 {
360 // Summon 2 Elune priestess and make each of them move to a different spot
362 {
363 priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[3].m_positionX, wingThicketLocations[3].m_positionY, wingThicketLocations[3].m_positionZ);
364 _firstPriestessGUID = priestess->GetGUID();
365 }
367 {
368 // Left priestess should have a distinct move point because she is the one who starts the dialogue at point reach
369 priestess->GetMotionMaster()->MovePoint(1, wingThicketLocations[4].m_positionX, wingThicketLocations[4].m_positionY, wingThicketLocations[4].m_positionZ);
370 _secondPriestessGUID = priestess->GetGUID();
371 }
372 }
@ TEMPSUMMON_CORPSE_DESPAWN
Definition Object.h:51
Definition Creature.h:43
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:2368
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:312
ObjectGuid _firstPriestessGUID
Definition zone_winterspring.cpp:311
@ NPC_PRIESTESS_ELUNE
Definition zone_winterspring.cpp:103
static Position wingThicketLocations[]
Definition zone_winterspring.cpp:261

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.

535 {
536 switch (entry)
537 {
538 case NPC_RANSHALLA:
539 return me;
540 case NPC_VOICE_ELUNE:
546 default:
547 return nullptr;
548 }
549 }
Creature * GetCreature(ObjectGuid const guid)
Definition Map.cpp:2498
Map * GetMap() const
Definition Object.h:537
ObjectGuid _voiceEluneGUID
Definition zone_winterspring.cpp:314
@ NPC_PRIESTESS_DATA_1
Definition zone_winterspring.cpp:123
@ NPC_PRIESTESS_DATA_2
Definition zone_winterspring.cpp:124
@ NPC_RANSHALLA
Definition zone_winterspring.cpp:102
@ NPC_VOICE_ELUNE
Definition zone_winterspring.cpp:104

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.

436 {
437 switch (entry)
438 {
439 case NPC_RANSHALLA:
440 // Start the altar channeling
442 break;
444 SetEscortPaused(false);
445 break;
447 // make the gem respawn
449 {
450 if (gem->isSpawned())
451 break;
452
453 gem->SetRespawnTime(90);
454 gem->Refresh();
455 }
456 break;
458 // move near the escort npc
459 if (Creature* priestess = me->GetMap()->GetCreature(_firstPriestessGUID))
460 priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[6].m_positionX, wingThicketLocations[6].m_positionY, wingThicketLocations[6].m_positionZ);
461 break;
463 // summon the Guardian of Elune
465 {
466 guard->GetMotionMaster()->MovePoint(0, wingThicketLocations[5].m_positionX, wingThicketLocations[5].m_positionY, wingThicketLocations[5].m_positionZ);
467 _guardEluneGUID = guard->GetGUID();
468 }
469 // summon the Voice of Elune
470 if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
471 {
472 if (Creature* voice = me->SummonCreature(NPC_VOICE_ELUNE, altar->GetPositionX(), altar->GetPositionY(), altar->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000))
473 _voiceEluneGUID = voice->GetGUID();
474 }
475 break;
477 // move near the escort npc and continue dialogue
478 if (Creature* priestess = me->GetMap()->GetCreature(_secondPriestessGUID))
479 {
480 priestess->AI()->Talk(SAY_PRIESTESS_ALTAR_14);
481 priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[7].m_positionX, wingThicketLocations[7].m_positionY, wingThicketLocations[7].m_positionZ);
482 }
483 break;
485 // make the voice of elune leave
486 if (Creature* guard = me->GetMap()->GetCreature(_guardEluneGUID))
487 {
488 guard->GetMotionMaster()->MovePoint(0, wingThicketLocations[2].m_positionX, wingThicketLocations[2].m_positionY, wingThicketLocations[2].m_positionZ);
489 guard->DespawnOrUnsummon(4000);
490 }
491 break;
493 // make the first priestess leave
494 if (Creature* priestess = me->GetMap()->GetCreature(_firstPriestessGUID))
495 {
496 priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[0].m_positionX, wingThicketLocations[0].m_positionY, wingThicketLocations[0].m_positionZ);
497 priestess->DespawnOrUnsummon(4000);
498 }
499 break;
501 // make the second priestess leave
502 if (Creature* priestess = me->GetMap()->GetCreature(_secondPriestessGUID))
503 {
504 priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[1].m_positionX, wingThicketLocations[1].m_positionY, wingThicketLocations[1].m_positionZ);
505 priestess->DespawnOrUnsummon(4000);
506 }
507 break;
508 case DATA_EVENT_END:
509 // Turn towards the player
510 if (Player* player = GetPlayerForEscort())
511 {
512 me->SetFacingToObject(player);
513 Talk(SAY_RANSHALLA_END_1, player);
514 }
515 break;
517 // Turn towards the altar and kneel - quest complete
518 if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
519 {
520 me->SetFacingToObject(altar);
521 altar->ResetDoorOrButton();
522 }
524 if (Player* player = GetPlayerForEscort())
525 {
526 player->GroupEventHappens(QUEST_GUARDIANS_ALTAR, me);
527 Talk(SAY_RANSHALLA_END_2, player);
528 }
529 me->DespawnOrUnsummon(4000);
530 break;
531 }
532 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:49
@ UNIT_STAND_STATE_KNEEL
Definition UnitDefines.h:40
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition Creature.cpp:2177
GameObject * GetGameObject(ObjectGuid const guid)
Definition Map.cpp:2503
Definition Player.h:1082
void SetStandState(uint8 state)
Definition Unit.cpp:16759
Player * GetPlayerForEscort()
Definition ScriptedEscortAI.h:114
ObjectGuid _guardEluneGUID
Definition zone_winterspring.cpp:313
void DoChannelTorchSpell(bool isAltarWaypoint=false)
Definition zone_winterspring.cpp:336
@ GO_ELUNE_GEM
Definition zone_winterspring.cpp:112
@ SAY_RANSHALLA_END_2
Definition zone_winterspring.cpp:90
@ SAY_PRIESTESS_ALTAR_20
Definition zone_winterspring.cpp:87
@ SAY_PRIESTESS_ALTAR_14
Definition zone_winterspring.cpp:81
@ SAY_RANSHALLA_ALTAR_6
Definition zone_winterspring.cpp:73
@ SAY_VOICE_ALTAR_15
Definition zone_winterspring.cpp:82
@ SAY_RANSHALLA_END_1
Definition zone_winterspring.cpp:89
@ SAY_PRIESTESS_ALTAR_13
Definition zone_winterspring.cpp:80
@ SAY_PRIESTESS_ALTAR_8
Definition zone_winterspring.cpp:75
@ SAY_PRIESTESS_ALTAR_19
Definition zone_winterspring.cpp:86
@ SAY_PRIESTESS_ALTAR_21
Definition zone_winterspring.cpp:88
@ SAY_PRIESTESS_ALTAR_9
Definition zone_winterspring.cpp:76
@ DATA_EVENT_END
Definition zone_winterspring.cpp:126
@ QUEST_GUARDIANS_ALTAR
Definition zone_winterspring.cpp:118
@ NPC_GUARDIAN_ELUNE
Definition zone_winterspring.cpp:105

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.

318 {
319 _delayTimer = 0;
320 }

References _delayTimer.

Referenced by npc_ranshallaAI().

◆ SummonedMovementInform()

void npc_ranshalla::npc_ranshallaAI::SummonedMovementInform ( Creature summoned,
uint32  type,
uint32  pointId 
)
inline
375 {
376 if (type != POINT_MOTION_TYPE || summoned->GetEntry() != NPC_PRIESTESS_ELUNE || pointId != 1)
377 return;
378
379 // Start the dialogue when the priestess reach the altar (they should both reach the point in the same time)
381 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
void StartNextDialogueText(int32 textEntry)
Definition zone_winterspring.cpp:154
uint32 GetEntry() const
Definition Object.h:116
@ SAY_PRIESTESS_ALTAR_3
Definition zone_winterspring.cpp:70

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.

552 {
553 DialogueUpdate(diff);
554
555 if (_delayTimer)
556 {
557 if (_delayTimer <= diff)
558 {
559 SetEscortPaused(false);
560 _delayTimer = 0;
561 }
562 else
563 _delayTimer -= diff;
564 }
565 events.Update(diff);
566 if (events.ExecuteEvent() == EVENT_RESUME)
568
570 }
events
Definition boss_sartura.cpp:43
void DialogueUpdate(uint32 diff)
Definition zone_winterspring.cpp:175
virtual void UpdateEscortAI(uint32 diff)
Definition ScriptedEscortAI.cpp:311
@ EVENT_RESUME
Definition zone_winterspring.cpp:128

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

◆ WaypointReached()

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

Implements npc_escortAI.

384 {
385 switch (pointId)
386 {
387 case 3:
389 break;
390 case 10: // Cavern 1
391 case 15: // Cavern 2
392 case 20: // Cavern 3
393 case 25: // Cavern 4
394 case 36: // Cavern 5
396 break;
397 case 39:
399 SetEscortPaused(true);
400 break;
401 case 41:
402 {
403 // Search for all nearest lights and respawn them
404 std::list<GameObject*> eluneLights;
406 for (std::list<GameObject*>::const_iterator itr = eluneLights.begin(); itr != eluneLights.end(); ++itr)
407 {
408 if ((*itr)->isSpawned())
409 continue;
410
411 (*itr)->SetRespawnTime(115);
412 (*itr)->Refresh();
413 }
414
415 if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
416 me->SetFacingToObject(altar);
417 break;
418 }
419 case 42:
420 // Summon the 2 priestess
421 SetEscortPaused(true);
424 events.ScheduleEvent(EVENT_RESUME, 2s);
425 break;
426 case 44:
427 // Stop the escort and turn towards the altar
428 SetEscortPaused(true);
429 if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
430 me->SetFacingToObject(altar);
431 break;
432 }
433 }
void GetGameObjectListWithEntryInGrid(std::list< GameObject * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
Definition ScriptedCreature.cpp:880
void DoSummonPriestess()
Definition zone_winterspring.cpp:358
@ GO_ELUNE_LIGHT
Definition zone_winterspring.cpp:113
@ SAY_REACH_ALTAR_1
Definition zone_winterspring.cpp:64
@ SAY_RANSHALLA_ALTAR_2
Definition zone_winterspring.cpp:69
@ SAY_ENTER_OWL_THICKET
Definition zone_winterspring.cpp:61

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

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: