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

Public Member Functions

 npc_battle_at_valhalasAI (Creature *creature)
 
void Reset () override
 
void ResetData ()
 
void JustSummoned (Creature *creature) override
 
void PrepareSummons ()
 
void StartBattle (ObjectGuid guid, uint32 questId)
 
void CheckSummons ()
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 
void UpdateAI (uint32 diff) override
 
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 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 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)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
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.
 
void Talk (uint8 id, Milliseconds delay)
 
 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 EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged.
 
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 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
 
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 ()
 
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 *)
 
- 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
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
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)
 
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 (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
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)
 
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)
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the max threat target, which may not always 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)
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

EventMap events
 
SummonList summons
 
ObjectGuid playerGUID
 
ObjectGuid playerGUID2
 
uint32 currentQuest
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
bool IsFleeing
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ npc_battle_at_valhalasAI()

npc_battle_at_valhalas::npc_battle_at_valhalasAI::npc_battle_at_valhalasAI ( Creature creature)
inline
106 : ScriptedAI(creature), summons(me)
107 {
108 }
Definition: ScriptedCreature.h:192
Creature * me
Definition: ScriptedCreature.h:282
SummonList summons
Definition: zone_icecrown.cpp:111

Member Function Documentation

◆ CheckSummons()

void npc_battle_at_valhalas::npc_battle_at_valhalasAI::CheckSummons ( )
inline
177 {
178 bool allow = true;
179 for (ObjectGuid const& guid : summons)
180 if (Creature* cr = ObjectAccessor::GetCreature(*me, guid))
181 if (cr->IsAlive())
182 allow = false;
183
184 if (allow)
185 {
186 uint32 quest = currentQuest;
188 {
189 switch (quest)
190 {
192 me->Yell("$N has defeated the fallen heroes of Valhalas battles past. This is only a beginning, but it will suffice.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID));
193 break;
195 me->Yell("Khit'rix the Dark Master has been defeated by $N and his band of companions. Let the next challenge be issued!", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID));
196 break;
197 case QUEST_BFV_SIGRID:
198 me->Yell("$N has defeated Sigrid Iceborn for a second time. Well, this time he did it with the help of his friends, but a win is a win!", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID));
199 break;
201 me->Yell("The horror known as Carnage is no more. Could it be that $N is truly worthy of battle in Valhalas? We shall see.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID));
202 break;
203 case QUEST_BFV_THANE:
204 me->Yell("Thane Banahogg the Deathblow has fallen to $N and his fighting companions. He has but one challenge ahead of him. Who will it be?", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID));
205 break;
206 case QUEST_BFV_FINAL:
207 me->Yell("The unthinkable has happened... $N has slain Prince Sandoval!", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID));
208 break;
209 }
210 player->GroupEventHappens(quest, player);
211 }
214 if (quest == QUEST_BFV_FINAL)
215 events.ScheduleEvent(EVENT_VALHALAS_THIRD, 7s);
216 }
217 else
218 {
219 uint32 quest = currentQuest;
221 {
222 if (!player->HasQuest(quest))
223 {
224 ResetData();
225 return;
226 }
227 }
228 }
229 }
std::uint32_t uint32
Definition: Define.h:108
events
Definition: boss_sartura.cpp:43
@ QUEST_BFV_FINAL
Definition: zone_icecrown.cpp:77
@ QUEST_BFV_CARNAGE
Definition: zone_icecrown.cpp:75
@ QUEST_BFV_DARK_MASTER
Definition: zone_icecrown.cpp:73
@ QUEST_BFV_FALLEN_HEROES
Definition: zone_icecrown.cpp:72
@ QUEST_BFV_SIGRID
Definition: zone_icecrown.cpp:74
@ EVENT_VALHALAS_THIRD
Definition: zone_icecrown.cpp:81
@ QUEST_BFV_THANE
Definition: zone_icecrown.cpp:76
@ LANG_UNIVERSAL
Definition: SharedDefines.h:707
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:215
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:225
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:197
Definition: Creature.h:46
Definition: ObjectGuid.h:120
Definition: Player.h:1046
virtual void Yell(std::string_view text, Language language, WorldObject const *target=nullptr)
Definition: Unit.cpp:21311
void ResetData()
Definition: zone_icecrown.cpp:121
uint32 currentQuest
Definition: zone_icecrown.cpp:114
ObjectGuid playerGUID
Definition: zone_icecrown.cpp:112
ObjectGuid playerGUID2
Definition: zone_icecrown.cpp:113

References currentQuest, CreatureAI::EnterEvadeMode(), EVENT_VALHALAS_THIRD, ObjectAccessor::GetCreature(), ObjectAccessor::GetPlayer(), LANG_UNIVERSAL, ScriptedAI::me, playerGUID, playerGUID2, QUEST_BFV_CARNAGE, QUEST_BFV_DARK_MASTER, QUEST_BFV_FALLEN_HEROES, QUEST_BFV_FINAL, QUEST_BFV_SIGRID, QUEST_BFV_THANE, ResetData(), summons, and Unit::Yell().

Referenced by UpdateAI().

◆ JustSummoned()

void npc_battle_at_valhalas::npc_battle_at_valhalasAI::JustSummoned ( Creature creature)
inlineoverridevirtual

Reimplemented from ScriptedAI.

131 {
132 summons.Summon(creature);
133 if (creature->GetEntry() != NPC_PRINCE)
135 creature->AI()->AttackStart(player);
136 }
@ NPC_PRINCE
Definition: zone_icecrown.cpp:96
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:28
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:90
CreatureAI * AI() const
Definition: Creature.h:135
uint32 GetEntry() const
Definition: Object.h:109

References Creature::AI(), UnitAI::AttackStart(), Object::GetEntry(), ObjectAccessor::GetPlayer(), ScriptedAI::me, NPC_PRINCE, playerGUID, SummonList::Summon(), and summons.

◆ PrepareSummons()

void npc_battle_at_valhalas::npc_battle_at_valhalasAI::PrepareSummons ( )
inline
139 {
140 switch(currentQuest)
141 {
143 me->SummonCreature(NPC_ELDRETH, 8245.5f, 3522.7f, 627.67f, 3.11f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
144 me->SummonCreature(NPC_GENESS, 8217.45f, 3546.0f, 628.20f, 4.41f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
145 me->SummonCreature(NPC_JHADRAS, 8179.99f, 3523.72f, 628.1f, 5.95f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
146 me->SummonCreature(NPC_MASUD, 8184.97f, 3491.2f, 625.33f, 0.6f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
147 me->SummonCreature(NPC_RITH, 8213.5f, 3478.5f, 626.79f, 1.56f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
148 me->SummonCreature(NPC_TALLA, 8238.30f, 3485.5f, 628.5f, 2.157f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
149 break;
151 me->SummonCreature(NPC_DARK_MASTER, 8184.97f, 3491.2f, 625.33f, 0.6f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
152 break;
153 case QUEST_BFV_SIGRID:
154 me->SummonCreature(NPC_SIGRID, 8238.30f, 3485.5f, 628.5f, 2.157f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
155 break;
157 me->SummonCreature(NPC_CARNAGE, 8179.99f, 3523.72f, 628.1f, 5.95f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
158 break;
159 case QUEST_BFV_THANE:
160 me->SummonCreature(NPC_THANE, 8217.45f, 3546.0f, 628.20f, 4.41f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
161 break;
162 case QUEST_BFV_FINAL:
163 me->SummonCreature(NPC_PRINCE, 8245.5f, 3522.7f, 627.67f, 3.11f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
164 break;
165 }
166 }
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:49
@ NPC_GENESS
Definition: zone_icecrown.cpp:86
@ NPC_JHADRAS
Definition: zone_icecrown.cpp:87
@ NPC_DARK_MASTER
Definition: zone_icecrown.cpp:92
@ NPC_TALLA
Definition: zone_icecrown.cpp:90
@ NPC_RITH
Definition: zone_icecrown.cpp:89
@ NPC_MASUD
Definition: zone_icecrown.cpp:88
@ NPC_THANE
Definition: zone_icecrown.cpp:95
@ NPC_SIGRID
Definition: zone_icecrown.cpp:93
@ NPC_ELDRETH
Definition: zone_icecrown.cpp:85
@ NPC_CARNAGE
Definition: zone_icecrown.cpp:94
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:2318

References currentQuest, ScriptedAI::me, NPC_CARNAGE, NPC_DARK_MASTER, NPC_ELDRETH, NPC_GENESS, NPC_JHADRAS, NPC_MASUD, NPC_PRINCE, NPC_RITH, NPC_SIGRID, NPC_TALLA, NPC_THANE, QUEST_BFV_CARNAGE, QUEST_BFV_DARK_MASTER, QUEST_BFV_FALLEN_HEROES, QUEST_BFV_FINAL, QUEST_BFV_SIGRID, QUEST_BFV_THANE, WorldObject::SummonCreature(), and TEMPSUMMON_MANUAL_DESPAWN.

Referenced by UpdateAI().

◆ Reset()

void npc_battle_at_valhalas::npc_battle_at_valhalasAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

117 {
118 ResetData();
119 }

References ResetData().

◆ ResetData()

void npc_battle_at_valhalas::npc_battle_at_valhalasAI::ResetData ( )
inline
122 {
123 events.Reset();
126 currentQuest = 0;
128 }
@ UNIT_NPC_FLAG_QUESTGIVER
Definition: Unit.h:517
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:67
void Clear()
Definition: ObjectGuid.h:140
void SetNpcFlag(NPCFlags flags)
Definition: Unit.h:1647

References ObjectGuid::Clear(), currentQuest, SummonList::DespawnAll(), ScriptedAI::me, playerGUID, Unit::SetNpcFlag(), summons, and UNIT_NPC_FLAG_QUESTGIVER.

Referenced by CheckSummons(), npc_battle_at_valhalas::OnQuestAccept(), and Reset().

◆ StartBattle()

void npc_battle_at_valhalas::npc_battle_at_valhalasAI::StartBattle ( ObjectGuid  guid,
uint32  questId 
)
inline
169 {
170 events.ScheduleEvent(EVENT_VALHALAS_FIRST, 6s);
171 events.ScheduleEvent(EVENT_VALHALAS_CHECK_PLAYER, 30s);
172 currentQuest = questId;
173 playerGUID = guid;
174 }
@ EVENT_VALHALAS_FIRST
Definition: zone_icecrown.cpp:79
@ EVENT_VALHALAS_CHECK_PLAYER
Definition: zone_icecrown.cpp:82

References currentQuest, EVENT_VALHALAS_CHECK_PLAYER, EVENT_VALHALAS_FIRST, and playerGUID.

Referenced by npc_battle_at_valhalas::OnQuestAccept().

◆ UpdateAI()

void npc_battle_at_valhalas::npc_battle_at_valhalasAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

232 {
233 events.Update(diff);
234 switch (events.ExecuteEvent())
235 {
237 {
238 switch (currentQuest)
239 {
241 events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8s);
242 me->Yell("$N and comrades in arms have chosen to accept honorable combat within the sacred confines of Valhalas.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID));
243 break;
245 events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8s);
246 me->Yell("$N has accepted the challenge of Khit'rix the Dark Master. May the gods show mercy upon him for Khit'rix surely will not.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID));
247 break;
248 case QUEST_BFV_SIGRID:
250 me->TextEmote("Circling Valhalas, Sigrid Iceborn approaches to seek her revenge!", nullptr, true);
251 break;
253 events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8s);
254 me->Yell("From the bowels of the Underhalls comes Carnage. Brave and foolish $N has accepted the challenge. $N and his group stand ready to face the monstrosity.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID));
255 break;
256 case QUEST_BFV_THANE:
257 events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8s);
258 me->Yell("Thane Banahogg returns to Valhalas for the first time in ages to prove that the vrykul are the only beings worthy to fight within its sacred ring. Will $N prove him wrong?", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID));
259 break;
260 case QUEST_BFV_FINAL:
261 events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8s);
262 me->Yell("From the depths of Icecrown Citadel, one of the Lich King's chosen comes to put an end to the existence of $N and his friends.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID));
263 break;
264 }
265
268 break;
269 }
271 {
272 switch (currentQuest)
273 {
275 me->Yell("There can only be one outcome to such a battle: death for one side or the other. Let $n prove himself upon the bones of these outsiders who have fallen before!", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID));
276 me->TextEmote("The fallen heroes of Valhalas emerge from the ground to do battle once more!", nullptr, true);
277 break;
279 me->TextEmote("Khit'rix the Dark Master skitters into Valhalas from the southeast!", nullptr, true);
280 break;
282 me->TextEmote("Lumbering in from the south, the smell of Carnage precedes him!", nullptr, true);
283 break;
284 case QUEST_BFV_THANE:
285 me->TextEmote("Thane Banahogg appears upon the overlook to the southeast!", nullptr, true);
286 break;
287 case QUEST_BFV_FINAL:
288 me->Yell("Warriors of Jotunheim, I present to you, Blood Prince Sandoval!", LANG_UNIVERSAL);
289 me->TextEmote("Without warning, Prince Sandoval magically appears within Valhalas!", nullptr, true);
290 break;
291 }
292
294 break;
295 }
297 {
298 me->Yell("In defeating him, he and his fighting companions have proven themselves worthy of battle in this most sacred place of vrykul honor.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID));
299 events.ScheduleEvent(EVENT_VALHALAS_THIRD + 2, 7s);
300 break;
301 }
303 {
304 me->Yell("ALL HAIL $N, CHAMPION OF VALHALAS! ", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID2));
305 break;
306 }
308 {
309 bool fail = true;
311 if (me->GetDistance(player) < 100.0f)
312 {
313 fail = false;
314 CheckSummons();
315 }
316
317 if (fail)
319
320 events.Repeat(5s);
321 break;
322 }
323 }
324 }
@ EVENT_VALHALAS_SECOND
Definition: zone_icecrown.cpp:80
void SetPosition(float x, float y, float z, float o)
Definition: Creature.cpp:3055
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1245
float GetPositionZ() const
Definition: Position.h:119
float GetOrientation() const
Definition: Position.h:120
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
MotionMaster * GetMotionMaster()
Definition: Unit.h:2262
virtual void TextEmote(std::string_view text, WorldObject const *target=nullptr, bool isBossEmote=false)
Definition: Unit.cpp:21316
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:210
void CheckSummons()
Definition: zone_icecrown.cpp:176
void PrepareSummons()
Definition: zone_icecrown.cpp:138

References CheckSummons(), currentQuest, CreatureAI::EnterEvadeMode(), EVENT_VALHALAS_CHECK_PLAYER, EVENT_VALHALAS_FIRST, EVENT_VALHALAS_SECOND, EVENT_VALHALAS_THIRD, WorldObject::GetDistance(), Unit::GetMotionMaster(), Position::GetOrientation(), ObjectAccessor::GetPlayer(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), LANG_UNIVERSAL, ScriptedAI::me, MotionMaster::MovePoint(), playerGUID, playerGUID2, PrepareSummons(), QUEST_BFV_CARNAGE, QUEST_BFV_DARK_MASTER, QUEST_BFV_FALLEN_HEROES, QUEST_BFV_FINAL, QUEST_BFV_SIGRID, QUEST_BFV_THANE, Creature::SetPosition(), Unit::TextEmote(), and Unit::Yell().

Member Data Documentation

◆ currentQuest

uint32 npc_battle_at_valhalas::npc_battle_at_valhalasAI::currentQuest

◆ events

EventMap npc_battle_at_valhalas::npc_battle_at_valhalasAI::events

◆ playerGUID

ObjectGuid npc_battle_at_valhalas::npc_battle_at_valhalasAI::playerGUID

◆ playerGUID2

ObjectGuid npc_battle_at_valhalas::npc_battle_at_valhalasAI::playerGUID2

Referenced by CheckSummons(), and UpdateAI().

◆ summons

SummonList npc_battle_at_valhalas::npc_battle_at_valhalasAI::summons