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 JustReachedHome () override
 
void ResetData ()
 
void JustSummoned (Creature *creature) override
 
void PrepareSummons ()
 
void StartBattle (ObjectGuid guid, uint32 questId)
 
void EndBattle ()
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- 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=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
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 IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellCastFinished (SpellInfo const *, SpellFinishReason)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
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)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void 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

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

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
108 : ScriptedAI(creature), summons(me)
109 {
110 }
Definition ScriptedCreature.h:191
Creature * me
Definition ScriptedCreature.h:281
SummonList summons
Definition zone_icecrown.cpp:113

Member Function Documentation

◆ EndBattle()

void npc_battle_at_valhalas::npc_battle_at_valhalasAI::EndBattle ( )
inline
184 {
185 ResetData();
188 }
@ UNIT_NPC_FLAG_GOSSIP
Definition UnitDefines.h:319
@ UNIT_NPC_FLAG_QUESTGIVER
Definition UnitDefines.h:320
void MoveTargetedHome(bool walk=false)
The unit will return this initial position (owner for pets and summoned creatures)....
Definition MotionMaster.cpp:260
MotionMaster * GetMotionMaster()
Definition Unit.h:1738
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:755
void ResetData()
Definition zone_icecrown.cpp:127

References Unit::GetMotionMaster(), ScriptedAI::me, MotionMaster::MoveTargetedHome(), Unit::RemoveNpcFlag(), ResetData(), UNIT_NPC_FLAG_GOSSIP, and UNIT_NPC_FLAG_QUESTGIVER.

Referenced by UpdateAI().

◆ JustReachedHome()

void npc_battle_at_valhalas::npc_battle_at_valhalasAI::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

123 {
125 }
void SetNpcFlag(NPCFlags flags)
Definition Unit.h:754

References ScriptedAI::me, Unit::SetNpcFlag(), UNIT_NPC_FLAG_GOSSIP, and UNIT_NPC_FLAG_QUESTGIVER.

◆ JustSummoned()

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

Reimplemented from CreatureAI.

137 {
138 summons.Summon(creature);
139 if (creature->GetEntry() != NPC_PRINCE)
141 creature->AI()->AttackStart(player);
142 }
CreatureAI * AI() const
Definition Creature.h:145
uint32 GetEntry() const
Definition Object.h:116
Definition Player.h:1071
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:27
Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:220
ObjectGuid playerGUID
Definition zone_icecrown.cpp:114
@ NPC_PRINCE
Definition zone_icecrown.cpp:98

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
145 {
146 switch (currentQuest)
147 {
149 me->SummonCreature(NPC_ELDRETH, 8245.5f, 3522.7f, 627.67f, 3.11f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
150 me->SummonCreature(NPC_GENESS, 8217.45f, 3546.0f, 628.20f, 4.41f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
151 me->SummonCreature(NPC_JHADRAS, 8179.99f, 3523.72f, 628.1f, 5.95f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
152 me->SummonCreature(NPC_MASUD, 8184.97f, 3491.2f, 625.33f, 0.6f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
153 me->SummonCreature(NPC_RITH, 8213.5f, 3478.5f, 626.79f, 1.56f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
154 me->SummonCreature(NPC_TALLA, 8238.30f, 3485.5f, 628.5f, 2.157f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
155 break;
157 me->SummonCreature(NPC_DARK_MASTER, 8184.97f, 3491.2f, 625.33f, 0.6f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
158 break;
159 case QUEST_BFV_SIGRID:
160 me->SummonCreature(NPC_SIGRID, 8238.30f, 3485.5f, 628.5f, 2.157f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
161 break;
163 me->SummonCreature(NPC_CARNAGE, 8179.99f, 3523.72f, 628.1f, 5.95f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
164 break;
165 case QUEST_BFV_THANE:
166 me->SummonCreature(NPC_THANE, 8217.45f, 3546.0f, 628.20f, 4.41f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
167 break;
168 case QUEST_BFV_FINAL:
169 me->SummonCreature(NPC_PRINCE, 8245.5f, 3522.7f, 627.67f, 3.11f, TEMPSUMMON_MANUAL_DESPAWN, 30000);
170 break;
171 }
172 }
@ TEMPSUMMON_MANUAL_DESPAWN
Definition Object.h:55
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:2352
uint32 currentQuest
Definition zone_icecrown.cpp:115
@ QUEST_BFV_FINAL
Definition zone_icecrown.cpp:78
@ NPC_GENESS
Definition zone_icecrown.cpp:88
@ NPC_JHADRAS
Definition zone_icecrown.cpp:89
@ QUEST_BFV_CARNAGE
Definition zone_icecrown.cpp:76
@ NPC_DARK_MASTER
Definition zone_icecrown.cpp:94
@ NPC_TALLA
Definition zone_icecrown.cpp:92
@ QUEST_BFV_DARK_MASTER
Definition zone_icecrown.cpp:74
@ QUEST_BFV_FALLEN_HEROES
Definition zone_icecrown.cpp:73
@ NPC_RITH
Definition zone_icecrown.cpp:91
@ QUEST_BFV_SIGRID
Definition zone_icecrown.cpp:75
@ NPC_MASUD
Definition zone_icecrown.cpp:90
@ NPC_THANE
Definition zone_icecrown.cpp:97
@ NPC_SIGRID
Definition zone_icecrown.cpp:95
@ NPC_ELDRETH
Definition zone_icecrown.cpp:87
@ QUEST_BFV_THANE
Definition zone_icecrown.cpp:77
@ NPC_CARNAGE
Definition zone_icecrown.cpp:96

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

118 {
119 ResetData();
120 }

References ResetData().

◆ ResetData()

void npc_battle_at_valhalas::npc_battle_at_valhalasAI::ResetData ( )
inline
128 {
129 events.Reset();
132 currentQuest = 0;
134 }
events
Definition boss_sartura.cpp:43
void Clear()
Definition ObjectGuid.h:138
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72

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

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

◆ StartBattle()

void npc_battle_at_valhalas::npc_battle_at_valhalasAI::StartBattle ( ObjectGuid  guid,
uint32  questId 
)
inline
175 {
176 events.ScheduleEvent(EVENT_VALHALAS_FIRST, 6s);
177 events.ScheduleEvent(EVENT_VALHALAS_CHECK_PLAYER, 30s);
179 currentQuest = questId;
180 playerGUID = guid;
181 }
@ 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, ScriptedAI::me, playerGUID, Unit::RemoveNpcFlag(), UNIT_NPC_FLAG_GOSSIP, and UNIT_NPC_FLAG_QUESTGIVER.

Referenced by npc_battle_at_valhalas::OnQuestAccept().

◆ UpdateAI()

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

Use to start attacking a target. Called just before JustEngagedWith()

Implements UnitAI.

191 {
192 events.Update(diff);
193 switch (events.ExecuteEvent())
194 {
196 {
197 switch (currentQuest)
198 {
200 events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8s);
201 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));
202 break;
204 events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8s);
205 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));
206 break;
207 case QUEST_BFV_SIGRID:
209 me->TextEmote("Circling Valhalas, Sigrid Iceborn approaches to seek her revenge!", nullptr, true);
210 break;
212 events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8s);
213 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));
214 break;
215 case QUEST_BFV_THANE:
216 events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8s);
217 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));
218 break;
219 case QUEST_BFV_FINAL:
220 events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8s);
221 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));
222 break;
223 }
224
227 break;
228 }
230 {
231 switch (currentQuest)
232 {
234 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));
235 me->TextEmote("The fallen heroes of Valhalas emerge from the ground to do battle once more!", nullptr, true);
236 break;
238 me->TextEmote("Khit'rix the Dark Master skitters into Valhalas from the southeast!", nullptr, true);
239 break;
241 me->TextEmote("Lumbering in from the south, the smell of Carnage precedes him!", nullptr, true);
242 break;
243 case QUEST_BFV_THANE:
244 me->TextEmote("Thane Banahogg appears upon the overlook to the southeast!", nullptr, true);
245 break;
246 case QUEST_BFV_FINAL:
247 me->Yell("Warriors of Jotunheim, I present to you, Blood Prince Sandoval!", LANG_UNIVERSAL);
248 me->TextEmote("Without warning, Prince Sandoval magically appears within Valhalas!", nullptr, true);
249 break;
250 }
251
253 break;
254 }
256 {
258 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, player);
259 events.ScheduleEvent(EVENT_VALHALAS_THIRD_2, 7s);
260 break;
261 }
263 {
265 me->Yell("ALL HAIL $N, CHAMPION OF VALHALAS! ", LANG_UNIVERSAL, player);
266 EndBattle();
267 break;
268 }
270 {
272 if (!player || me->GetDistance(player) >= 100.0f)
273 {
274 EndBattle();
275 break;
276 }
277
279 {
280 if (!player->HasQuest(currentQuest))
281 EndBattle();
282 else
283 events.Repeat(5s);
284 }
285 else
286 {
287 switch (currentQuest)
288 {
290 me->Yell("$N has defeated the fallen heroes of Valhalas battles past. This is only a beginning, but it will suffice.", LANG_UNIVERSAL, player);
291 break;
293 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, player);
294 break;
295 case QUEST_BFV_SIGRID:
296 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, player);
297 break;
299 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, player);
300 break;
301 case QUEST_BFV_THANE:
302 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, player);
303 break;
304 case QUEST_BFV_FINAL:
305 me->Yell("The unthinkable has happened... $N has slain Prince Sandoval!", LANG_UNIVERSAL, player);
306 break;
307 }
308
309 player->GroupEventHappens(currentQuest, player);
310
312 events.ScheduleEvent(EVENT_VALHALAS_THIRD, 7s);
313 else
314 EndBattle();
315 }
316 break;
317 }
318 }
319 }
@ LANG_UNIVERSAL
Definition SharedDefines.h:746
void SetPosition(float x, float y, float z, float o)
Definition Creature.cpp:3168
void MovePoint(uint32 id, const Position &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true, std::optional< AnimTier > animTier=std::nullopt)
Definition MotionMaster.h:238
void GroupEventHappens(uint32 questId, WorldObject const *pEventObject)
Definition PlayerQuest.cpp:1816
bool HasQuest(uint32 questId) const
Definition PlayerQuest.cpp:101
bool IsAnyCreatureAlive() const
Definition ScriptedCreature.cpp:162
virtual void Yell(std::string_view text, Language language, WorldObject const *target=nullptr)
Definition Unit.cpp:21236
virtual void TextEmote(std::string_view text, WorldObject const *target=nullptr, bool isBossEmote=false)
Definition Unit.cpp:21241
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1271
float GetPositionZ() const
Definition Position.h:123
float GetOrientation() const
Definition Position.h:124
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
void PrepareSummons()
Definition zone_icecrown.cpp:144
void EndBattle()
Definition zone_icecrown.cpp:183
@ EVENT_VALHALAS_THIRD_2
Definition zone_icecrown.cpp:84
@ EVENT_VALHALAS_THIRD
Definition zone_icecrown.cpp:82
@ EVENT_VALHALAS_SECOND
Definition zone_icecrown.cpp:81

References currentQuest, EndBattle(), EVENT_VALHALAS_CHECK_PLAYER, EVENT_VALHALAS_FIRST, EVENT_VALHALAS_SECOND, EVENT_VALHALAS_THIRD, EVENT_VALHALAS_THIRD_2, WorldObject::GetDistance(), Unit::GetMotionMaster(), Position::GetOrientation(), ObjectAccessor::GetPlayer(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Player::GroupEventHappens(), Player::HasQuest(), SummonList::IsAnyCreatureAlive(), LANG_UNIVERSAL, ScriptedAI::me, MotionMaster::MovePoint(), playerGUID, PrepareSummons(), QUEST_BFV_CARNAGE, QUEST_BFV_DARK_MASTER, QUEST_BFV_FALLEN_HEROES, QUEST_BFV_FINAL, QUEST_BFV_SIGRID, QUEST_BFV_THANE, Creature::SetPosition(), summons, 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

◆ summons

SummonList npc_battle_at_valhalas::npc_battle_at_valhalasAI::summons

Referenced by JustSummoned(), ResetData(), and UpdateAI().


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