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. More...
 
CreatureGetSpeakerByEntry (int32 entry) override
 Will be called to get a speaker, MUST be implemented if not used in instances. More...
 
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() More...
 
virtual void UpdateEscortAI (uint32 diff)
 
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 WaypointReached (uint32 pointId)=0
 
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) 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
 

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)
 
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
 
- Private Member Functions inherited from DialogueHelper
 DialogueHelper (DialogueEntry const *dialogueArray)
 
void StartNextDialogueText (int32 textEntry)
 
void DialogueUpdate (uint32 diff)
 
virtual void JustDidDialogueStep (int32)
 Will be called when a dialogue step was done. More...
 
virtual CreatureGetSpeakerByEntry (int32)
 Will be called to get a speaker, MUST be implemented if not used in instances. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_ranshallaAI()

npc_ranshalla::npc_ranshallaAI::npc_ranshallaAI ( Creature creature)
inline
317 : npc_escortAI(creature),
319 {
320 Reset();
321 }
const DialogueEntry introDialogue[]
Definition: zone_winterspring.cpp:241
Definition: ScriptedEscortAI.h:53
Definition: zone_winterspring.cpp:155
void Reset() override
Definition: zone_winterspring.cpp:331

References Reset().

Member Function Documentation

◆ DoChannelTorchSpell()

void npc_ranshalla::npc_ranshallaAI::DoChannelTorchSpell ( bool  isAltarWaypoint = false)
inline
351 {
352 // Check if we are using the fire or the altar and remove the no_interact flag
353 if (isAltarWaypoint)
354 {
356 {
357 go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
359 _altarGUID = go->GetGUID();
360 }
361 }
363 go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
364
365 // Yell and set escort to pause
368 SetEscortPaused(true);
370 }
GameObject * GetClosestGameObjectWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool onlySpawned)
Definition: ScriptedCreature.cpp:822
Talk
Definition: hyjal.cpp:82
@ GO_ELUNE_ALTAR
Definition: zone_winterspring.cpp:124
@ GO_ELUNE_FIRE
Definition: zone_winterspring.cpp:125
@ SAY_REACH_TORCH
Definition: zone_winterspring.cpp:76
@ EMOTE_CHANT_SPELL
Definition: zone_winterspring.cpp:106
@ SPELL_LIGHT_TORCH
Definition: zone_winterspring.cpp:111
@ GO_FLAG_NOT_SELECTABLE
Definition: SharedDefines.h:1607
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:177
Creature * me
Definition: ScriptedCreature.h:280
void SetEscortPaused(bool on)
Definition: ScriptedEscortAI.cpp:523
Definition: GameObject.h:121
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20493
ObjectGuid _altarGUID
Definition: zone_winterspring.cpp:329

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
338 {
340
341 if (isAltarWaypoint)
343 else
345
346 _delayTimer = 2000;
347 }
@ SAY_RANSHALLA_ALTAR_1
Definition: zone_winterspring.cpp:82
@ SAY_AFTER_TORCH
Definition: zone_winterspring.cpp:77
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4111
uint32 _delayTimer
Definition: zone_winterspring.cpp:323

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

◆ DoSummonPriestess()

void npc_ranshalla::npc_ranshallaAI::DoSummonPriestess ( )
inline
373 {
374 // Summon 2 Elune priestess and make each of them move to a different spot
376 {
377 priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[3].m_positionX, wingThicketLocations[3].m_positionY, wingThicketLocations[3].m_positionZ);
378 _firstPriestessGUID = priestess->GetGUID();
379 }
381 {
382 // Left priestess should have a distinct move point because she is the one who starts the dialogue at point reach
383 priestess->GetMotionMaster()->MovePoint(1, wingThicketLocations[4].m_positionX, wingThicketLocations[4].m_positionY, wingThicketLocations[4].m_positionZ);
384 _secondPriestessGUID = priestess->GetGUID();
385 }
386 }
@ TEMPSUMMON_CORPSE_DESPAWN
Definition: Object.h:49
@ NPC_PRIESTESS_ELUNE
Definition: zone_winterspring.cpp:117
static Position wingThicketLocations[]
Definition: zone_winterspring.cpp:275
Definition: Creature.h:46
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:2355
float m_positionZ
Definition: Position.h:58
float m_positionX
Definition: Position.h:56
float m_positionY
Definition: Position.h:57
float GetOrientation() const
Definition: Position.h:120
ObjectGuid _secondPriestessGUID
Definition: zone_winterspring.cpp:326
ObjectGuid _firstPriestessGUID
Definition: zone_winterspring.cpp:325

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.

549 {
550 switch (entry)
551 {
552 case NPC_RANSHALLA:
553 return me;
554 case NPC_VOICE_ELUNE:
560 default:
561 return nullptr;
562 }
563 }
@ NPC_PRIESTESS_DATA_1
Definition: zone_winterspring.cpp:137
@ NPC_PRIESTESS_DATA_2
Definition: zone_winterspring.cpp:138
@ NPC_RANSHALLA
Definition: zone_winterspring.cpp:116
@ NPC_VOICE_ELUNE
Definition: zone_winterspring.cpp:118
Map * GetMap() const
Definition: Object.h:531
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3314
ObjectGuid _voiceEluneGUID
Definition: zone_winterspring.cpp:328

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.

450 {
451 switch (entry)
452 {
453 case NPC_RANSHALLA:
454 // Start the altar channeling
456 break;
458 SetEscortPaused(false);
459 break;
461 // make the gem respawn
463 {
464 if (gem->isSpawned())
465 break;
466
467 gem->SetRespawnTime(90);
468 gem->Refresh();
469 }
470 break;
472 // move near the escort npc
473 if (Creature* priestess = me->GetMap()->GetCreature(_firstPriestessGUID))
474 priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[6].m_positionX, wingThicketLocations[6].m_positionY, wingThicketLocations[6].m_positionZ);
475 break;
477 // summon the Guardian of Elune
479 {
480 guard->GetMotionMaster()->MovePoint(0, wingThicketLocations[5].m_positionX, wingThicketLocations[5].m_positionY, wingThicketLocations[5].m_positionZ);
481 _guardEluneGUID = guard->GetGUID();
482 }
483 // summon the Voice of Elune
484 if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
485 {
486 if (Creature* voice = me->SummonCreature(NPC_VOICE_ELUNE, altar->GetPositionX(), altar->GetPositionY(), altar->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000))
487 _voiceEluneGUID = voice->GetGUID();
488 }
489 break;
491 // move near the escort npc and continue dialogue
492 if (Creature* priestess = me->GetMap()->GetCreature(_secondPriestessGUID))
493 {
494 priestess->AI()->Talk(SAY_PRIESTESS_ALTAR_14);
495 priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[7].m_positionX, wingThicketLocations[7].m_positionY, wingThicketLocations[7].m_positionZ);
496 }
497 break;
499 // make the voice of elune leave
500 if (Creature* guard = me->GetMap()->GetCreature(_guardEluneGUID))
501 {
502 guard->GetMotionMaster()->MovePoint(0, wingThicketLocations[2].m_positionX, wingThicketLocations[2].m_positionY, wingThicketLocations[2].m_positionZ);
503 guard->DespawnOrUnsummon(4000);
504 }
505 break;
507 // make the first priestess leave
508 if (Creature* priestess = me->GetMap()->GetCreature(_firstPriestessGUID))
509 {
510 priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[0].m_positionX, wingThicketLocations[0].m_positionY, wingThicketLocations[0].m_positionZ);
511 priestess->DespawnOrUnsummon(4000);
512 }
513 break;
515 // make the second priestess leave
516 if (Creature* priestess = me->GetMap()->GetCreature(_secondPriestessGUID))
517 {
518 priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[1].m_positionX, wingThicketLocations[1].m_positionY, wingThicketLocations[1].m_positionZ);
519 priestess->DespawnOrUnsummon(4000);
520 }
521 break;
522 case DATA_EVENT_END:
523 // Turn towards the player
524 if (Player* player = GetPlayerForEscort())
525 {
526 me->SetFacingToObject(player);
527 Talk(SAY_RANSHALLA_END_1, player);
528 }
529 break;
531 // Turn towards the altar and kneel - quest complete
532 if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
533 {
534 me->SetFacingToObject(altar);
535 altar->ResetDoorOrButton();
536 }
538 if (Player* player = GetPlayerForEscort())
539 {
540 player->GroupEventHappens(QUEST_GUARDIANS_ALTAR, me);
541 Talk(SAY_RANSHALLA_END_2, player);
542 }
543 me->DespawnOrUnsummon(4000);
544 break;
545 }
546 }
@ UNIT_STAND_STATE_KNEEL
Definition: UnitDefines.h:40
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:47
@ GO_ELUNE_GEM
Definition: zone_winterspring.cpp:126
@ SAY_RANSHALLA_END_2
Definition: zone_winterspring.cpp:104
@ SAY_PRIESTESS_ALTAR_20
Definition: zone_winterspring.cpp:101
@ SAY_PRIESTESS_ALTAR_14
Definition: zone_winterspring.cpp:95
@ SAY_RANSHALLA_ALTAR_6
Definition: zone_winterspring.cpp:87
@ SAY_VOICE_ALTAR_15
Definition: zone_winterspring.cpp:96
@ SAY_RANSHALLA_END_1
Definition: zone_winterspring.cpp:103
@ SAY_PRIESTESS_ALTAR_13
Definition: zone_winterspring.cpp:94
@ SAY_PRIESTESS_ALTAR_8
Definition: zone_winterspring.cpp:89
@ SAY_PRIESTESS_ALTAR_19
Definition: zone_winterspring.cpp:100
@ SAY_PRIESTESS_ALTAR_21
Definition: zone_winterspring.cpp:102
@ SAY_PRIESTESS_ALTAR_9
Definition: zone_winterspring.cpp:90
@ DATA_EVENT_END
Definition: zone_winterspring.cpp:140
@ QUEST_GUARDIANS_ALTAR
Definition: zone_winterspring.cpp:132
@ NPC_GUARDIAN_ELUNE
Definition: zone_winterspring.cpp:119
Player * GetPlayerForEscort()
Definition: ScriptedEscortAI.h:114
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2173
Definition: Player.h:1064
void SetStandState(uint8 state)
Definition: Unit.cpp:16682
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3319
ObjectGuid _guardEluneGUID
Definition: zone_winterspring.cpp:327
void DoChannelTorchSpell(bool isAltarWaypoint=false)
Definition: zone_winterspring.cpp:350

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 ScriptedAI.

332 {
333 _delayTimer = 0;
334 }

References _delayTimer.

Referenced by npc_ranshallaAI().

◆ SummonedMovementInform()

void npc_ranshalla::npc_ranshallaAI::SummonedMovementInform ( Creature summoned,
uint32  type,
uint32  pointId 
)
inline
389 {
390 if (type != POINT_MOTION_TYPE || summoned->GetEntry() != NPC_PRIESTESS_ELUNE || pointId != 1)
391 return;
392
393 // Start the dialogue when the priestess reach the altar (they should both reach the point in the same time)
395 }
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:46
@ SAY_PRIESTESS_ALTAR_3
Definition: zone_winterspring.cpp:84
uint32 GetEntry() const
Definition: Object.h:112
void StartNextDialogueText(int32 textEntry)
Definition: zone_winterspring.cpp:168

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.

566 {
567 DialogueUpdate(diff);
568
569 if (_delayTimer)
570 {
571 if (_delayTimer <= diff)
572 {
573 SetEscortPaused(false);
574 _delayTimer = 0;
575 }
576 else
577 _delayTimer -= diff;
578 }
579 events.Update(diff);
580 if (events.ExecuteEvent() == EVENT_RESUME)
582
584 }
@ EVENT_RESUME
Definition: zone_winterspring.cpp:142
events
Definition: boss_sartura.cpp:43
virtual void UpdateEscortAI(uint32 diff)
Definition: ScriptedEscortAI.cpp:318
void DialogueUpdate(uint32 diff)
Definition: zone_winterspring.cpp:189

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.

398 {
399 switch (pointId)
400 {
401 case 3:
403 break;
404 case 10: // Cavern 1
405 case 15: // Cavern 2
406 case 20: // Cavern 3
407 case 25: // Cavern 4
408 case 36: // Cavern 5
410 break;
411 case 39:
413 SetEscortPaused(true);
414 break;
415 case 41:
416 {
417 // Search for all nearest lights and respawn them
418 std::list<GameObject*> eluneLights;
420 for (std::list<GameObject*>::const_iterator itr = eluneLights.begin(); itr != eluneLights.end(); ++itr)
421 {
422 if ((*itr)->isSpawned())
423 continue;
424
425 (*itr)->SetRespawnTime(115);
426 (*itr)->Refresh();
427 }
428
429 if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
430 me->SetFacingToObject(altar);
431 break;
432 }
433 case 42:
434 // Summon the 2 priestess
435 SetEscortPaused(true);
438 events.ScheduleEvent(EVENT_RESUME, 2s);
439 break;
440 case 44:
441 // Stop the escort and turn towards the altar
442 SetEscortPaused(true);
443 if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
444 me->SetFacingToObject(altar);
445 break;
446 }
447 }
void GetGameObjectListWithEntryInGrid(std::list< GameObject * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
Definition: ScriptedCreature.cpp:832
@ GO_ELUNE_LIGHT
Definition: zone_winterspring.cpp:127
@ SAY_REACH_ALTAR_1
Definition: zone_winterspring.cpp:78
@ SAY_RANSHALLA_ALTAR_2
Definition: zone_winterspring.cpp:83
@ SAY_ENTER_OWL_THICKET
Definition: zone_winterspring.cpp:75
void DoSummonPriestess()
Definition: zone_winterspring.cpp:372

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