AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_battle_at_valhalas Class Reference
Inheritance diagram for npc_battle_at_valhalas:
CreatureScript ScriptObject UpdatableScript< Creature >

Classes

struct  npc_battle_at_valhalasAI
 

Public Member Functions

 npc_battle_at_valhalas ()
 
bool OnQuestAccept (Player *player, Creature *creature, Quest const *quest) override
 
CreatureAIGetAI (Creature *creature) const override
 
- Public Member Functions inherited from CreatureScript
bool IsDatabaseBound () const override
 
virtual bool OnGossipHello (Player *, Creature *)
 
virtual bool OnGossipSelect (Player *, Creature *, uint32, uint32)
 
virtual bool OnGossipSelectCode (Player *, Creature *, uint32, uint32, const char *)
 
virtual bool OnQuestAccept (Player *, Creature *, Quest const *)
 
virtual bool OnQuestSelect (Player *, Creature *, Quest const *)
 
virtual bool OnQuestComplete (Player *, Creature *, Quest const *)
 
virtual bool OnQuestReward (Player *, Creature *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, Creature *)
 
virtual CreatureAIGetAI (Creature *) const
 
virtual void OnFfaPvpStateUpdate (Creature *, bool)
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 
- Public Member Functions inherited from UpdatableScript< Creature >
virtual void OnUpdate (Creature *, uint32)
 

Additional Inherited Members

- Protected Member Functions inherited from CreatureScript
 CreatureScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_battle_at_valhalas()

npc_battle_at_valhalas::npc_battle_at_valhalas ( )
inline
103: CreatureScript("npc_battle_at_valhalas") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

CreatureAI * npc_battle_at_valhalas::GetAI ( Creature creature) const
inlineoverridevirtual

Reimplemented from CreatureScript.

363 {
364 return new npc_battle_at_valhalasAI(creature);
365 }

◆ OnQuestAccept()

bool npc_battle_at_valhalas::OnQuestAccept ( Player player,
Creature creature,
Quest const *  quest 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

329 {
330 npc_battle_at_valhalasAI* vAI = CAST_AI(npc_battle_at_valhalas::npc_battle_at_valhalasAI, creature->AI());
331 vAI->ResetData();
332
334 if (vAI)
335 vAI->StartBattle(player->GetGUID(), quest->GetQuestId());
336
337 switch (quest->GetQuestId())
338 {
340 creature->Say("Valhalas is yours to win or die in, $N. But whatever you do, stay within the bounds of the arena. To flee is to lose and be dishonored.", LANG_UNIVERSAL, player);
341 break;
343 creature->Say("Prepare yourself. Khit'rix will be entering Valhalas from the southeast. Remember, do not leave the ring or you will lose the battle.", LANG_UNIVERSAL, player);
344 break;
345 case QUEST_BFV_SIGRID:
346 creature->Yell("Sigrid Iceborn has returned to the heights of Jotunheim to prove herself against $N. When last they met, $N bester her in personal combat. Let us see the outcome of this match.", LANG_UNIVERSAL, player);
347 break;
349 creature->Say("Carnage is coming! Remember, no matter what you do, do NOT leave the battle ring or I will disqualify you and your group.", LANG_UNIVERSAL);
350 break;
351 case QUEST_BFV_THANE:
352 creature->Say("Look to the southeast and you will see the thane upon the platform near Gjonner the Merciless when he shows himself. Let him come down. Stay within the ring of Valhalas.", LANG_UNIVERSAL);
353 break;
354 case QUEST_BFV_FINAL:
355 creature->Say("It's too late to run now. Do not leave the ring. Die bravely, $N!", LANG_UNIVERSAL);
356 break;
357 }
358
359 return true;
360 }
@ 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
@ QUEST_BFV_THANE
Definition: zone_icecrown.cpp:77
@ LANG_UNIVERSAL
Definition: SharedDefines.h:735
#define CAST_AI(a, b)
Definition: UnitAI.h:26
@ UNIT_NPC_FLAG_QUESTGIVER
Definition: UnitDefines.h:295
CreatureAI * AI() const
Definition: Creature.h:140
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
virtual void Say(std::string_view text, Language language, WorldObject const *target=nullptr)
Definition: Unit.cpp:21139
virtual void Yell(std::string_view text, Language language, WorldObject const *target=nullptr)
Definition: Unit.cpp:21144
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:727
Definition: zone_icecrown.cpp:106

References Creature::AI(), CAST_AI, Object::GetGUID(), Quest::GetQuestId(), LANG_UNIVERSAL, QUEST_BFV_CARNAGE, QUEST_BFV_DARK_MASTER, QUEST_BFV_FALLEN_HEROES, QUEST_BFV_FINAL, QUEST_BFV_SIGRID, QUEST_BFV_THANE, Unit::RemoveNpcFlag(), npc_battle_at_valhalas::npc_battle_at_valhalasAI::ResetData(), Unit::Say(), npc_battle_at_valhalas::npc_battle_at_valhalasAI::StartBattle(), UNIT_NPC_FLAG_QUESTGIVER, and Unit::Yell().