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 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)
 
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 OnPowerUpdate (Powers, int32, int32, uint32)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 
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
 
TaskScheduler scheduler
 
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
107 : ScriptedAI(creature), summons(me)
108 {
109 }
Definition: ScriptedCreature.h:192
Creature * me
Definition: ScriptedCreature.h:282
SummonList summons
Definition: zone_icecrown.cpp:112

Member Function Documentation

◆ CheckSummons()

void npc_battle_at_valhalas::npc_battle_at_valhalasAI::CheckSummons ( )
inline
178 {
179 bool allow = true;
180 for (ObjectGuid const& guid : summons)
181 if (Creature* cr = ObjectAccessor::GetCreature(*me, guid))
182 if (cr->IsAlive())
183 allow = false;
184
185 if (allow)
186 {
187 uint32 quest = currentQuest;
189 {
190 switch (quest)
191 {
193 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));
194 break;
196 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));
197 break;
198 case QUEST_BFV_SIGRID:
199 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));
200 break;
202 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));
203 break;
204 case QUEST_BFV_THANE:
205 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));
206 break;
207 case QUEST_BFV_FINAL:
208 me->Yell("The unthinkable has happened... $N has slain Prince Sandoval!", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID));
209 break;
210 }
211 player->GroupEventHappens(quest, player);
212 }
215 if (quest == QUEST_BFV_FINAL)
216 events.ScheduleEvent(EVENT_VALHALAS_THIRD, 7s);
217 }
218 else
219 {
220 uint32 quest = currentQuest;
222 {
223 if (!player->HasQuest(quest))
224 {
225 ResetData();
226 return;
227 }
228 }
229 }
230 }
std::uint32_t uint32
Definition: Define.h:108
events
Definition: boss_sartura.cpp:43
@ QUEST_BFV_FINAL
Definition: zone_icecrown.cpp:78
@ QUEST_BFV_CARNAGE
Definition: zone_icecrown.cpp:76
@ QUEST_BFV_DARK_MASTER
Definition: zone_icecrown.cpp:74
@ QUEST_BFV_FALLEN_HEROES
Definition: zone_icecrown.cpp:73
@ QUEST_BFV_SIGRID
Definition: zone_icecrown.cpp:75
@ EVENT_VALHALAS_THIRD
Definition: zone_icecrown.cpp:82
@ QUEST_BFV_THANE
Definition: zone_icecrown.cpp:77
@ LANG_UNIVERSAL
Definition: SharedDefines.h:735
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:223
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:196
Definition: Creature.h:46
Definition: ObjectGuid.h:120
Definition: Player.h:1056
virtual void Yell(std::string_view text, Language language, WorldObject const *target=nullptr)
Definition: Unit.cpp:21425
void ResetData()
Definition: zone_icecrown.cpp:122
uint32 currentQuest
Definition: zone_icecrown.cpp:115
ObjectGuid playerGUID
Definition: zone_icecrown.cpp:113
ObjectGuid playerGUID2
Definition: zone_icecrown.cpp:114

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.

132 {
133 summons.Summon(creature);
134 if (creature->GetEntry() != NPC_PRINCE)
136 creature->AI()->AttackStart(player);
137 }
@ NPC_PRINCE
Definition: zone_icecrown.cpp:97
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:27
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:90
CreatureAI * AI() const
Definition: Creature.h:136
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
140 {
141 switch(currentQuest)
142 {
144 me->SummonCreature(NPC_ELDRETH, 8245.5f, 3522.7f, 627.67f, 3.11f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
145 me->SummonCreature(NPC_GENESS, 8217.45f, 3546.0f, 628.20f, 4.41f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
146 me->SummonCreature(NPC_JHADRAS, 8179.99f, 3523.72f, 628.1f, 5.95f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
147 me->SummonCreature(NPC_MASUD, 8184.97f, 3491.2f, 625.33f, 0.6f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
148 me->SummonCreature(NPC_RITH, 8213.5f, 3478.5f, 626.79f, 1.56f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
149 me->SummonCreature(NPC_TALLA, 8238.30f, 3485.5f, 628.5f, 2.157f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
150 break;
152 me->SummonCreature(NPC_DARK_MASTER, 8184.97f, 3491.2f, 625.33f, 0.6f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
153 break;
154 case QUEST_BFV_SIGRID:
155 me->SummonCreature(NPC_SIGRID, 8238.30f, 3485.5f, 628.5f, 2.157f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
156 break;
158 me->SummonCreature(NPC_CARNAGE, 8179.99f, 3523.72f, 628.1f, 5.95f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
159 break;
160 case QUEST_BFV_THANE:
161 me->SummonCreature(NPC_THANE, 8217.45f, 3546.0f, 628.20f, 4.41f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
162 break;
163 case QUEST_BFV_FINAL:
164 me->SummonCreature(NPC_PRINCE, 8245.5f, 3522.7f, 627.67f, 3.11f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
165 break;
166 }
167 }
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:49
@ NPC_GENESS
Definition: zone_icecrown.cpp:87
@ NPC_JHADRAS
Definition: zone_icecrown.cpp:88
@ NPC_DARK_MASTER
Definition: zone_icecrown.cpp:93
@ NPC_TALLA
Definition: zone_icecrown.cpp:91
@ NPC_RITH
Definition: zone_icecrown.cpp:90
@ NPC_MASUD
Definition: zone_icecrown.cpp:89
@ NPC_THANE
Definition: zone_icecrown.cpp:96
@ NPC_SIGRID
Definition: zone_icecrown.cpp:94
@ NPC_ELDRETH
Definition: zone_icecrown.cpp:86
@ NPC_CARNAGE
Definition: zone_icecrown.cpp:95
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:2343

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.

118 {
119 ResetData();
120 }

References ResetData().

◆ ResetData()

void npc_battle_at_valhalas::npc_battle_at_valhalasAI::ResetData ( )
inline
123 {
124 events.Reset();
127 currentQuest = 0;
129 }
@ UNIT_NPC_FLAG_QUESTGIVER
Definition: Unit.h:517
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
void Clear()
Definition: ObjectGuid.h:140
void SetNpcFlag(NPCFlags flags)
Definition: Unit.h:1661

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
170 {
171 events.ScheduleEvent(EVENT_VALHALAS_FIRST, 6s);
172 events.ScheduleEvent(EVENT_VALHALAS_CHECK_PLAYER, 30s);
173 currentQuest = questId;
174 playerGUID = guid;
175 }
@ EVENT_VALHALAS_FIRST
Definition: zone_icecrown.cpp:80
@ EVENT_VALHALAS_CHECK_PLAYER
Definition: zone_icecrown.cpp:83

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.

233 {
234 events.Update(diff);
235 switch (events.ExecuteEvent())
236 {
238 {
239 switch (currentQuest)
240 {
242 events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8s);
243 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));
244 break;
246 events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8s);
247 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));
248 break;
249 case QUEST_BFV_SIGRID:
251 me->TextEmote("Circling Valhalas, Sigrid Iceborn approaches to seek her revenge!", nullptr, true);
252 break;
254 events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8s);
255 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));
256 break;
257 case QUEST_BFV_THANE:
258 events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8s);
259 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));
260 break;
261 case QUEST_BFV_FINAL:
262 events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8s);
263 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));
264 break;
265 }
266
269 break;
270 }
272 {
273 switch (currentQuest)
274 {
276 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));
277 me->TextEmote("The fallen heroes of Valhalas emerge from the ground to do battle once more!", nullptr, true);
278 break;
280 me->TextEmote("Khit'rix the Dark Master skitters into Valhalas from the southeast!", nullptr, true);
281 break;
283 me->TextEmote("Lumbering in from the south, the smell of Carnage precedes him!", nullptr, true);
284 break;
285 case QUEST_BFV_THANE:
286 me->TextEmote("Thane Banahogg appears upon the overlook to the southeast!", nullptr, true);
287 break;
288 case QUEST_BFV_FINAL:
289 me->Yell("Warriors of Jotunheim, I present to you, Blood Prince Sandoval!", LANG_UNIVERSAL);
290 me->TextEmote("Without warning, Prince Sandoval magically appears within Valhalas!", nullptr, true);
291 break;
292 }
293
295 break;
296 }
298 {
299 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));
300 events.ScheduleEvent(EVENT_VALHALAS_THIRD + 2, 7s);
301 break;
302 }
304 {
305 me->Yell("ALL HAIL $N, CHAMPION OF VALHALAS! ", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID2));
306 break;
307 }
309 {
310 bool fail = true;
312 if (me->GetDistance(player) < 100.0f)
313 {
314 fail = false;
315 CheckSummons();
316 }
317
318 if (fail)
320
321 events.Repeat(5s);
322 break;
323 }
324 }
325 }
@ EVENT_VALHALAS_SECOND
Definition: zone_icecrown.cpp:81
void SetPosition(float x, float y, float z, float o)
Definition: Creature.cpp:3072
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:2276
virtual void TextEmote(std::string_view text, WorldObject const *target=nullptr, bool isBossEmote=false)
Definition: Unit.cpp:21430
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:211
void CheckSummons()
Definition: zone_icecrown.cpp:177
void PrepareSummons()
Definition: zone_icecrown.cpp:139

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