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

Classes

struct  npc_wg_queueAI
 

Public Member Functions

 npc_wg_queue ()
 
bool OnGossipHello (Player *player, Creature *creature) override
 
bool OnGossipSelect (Player *player, Creature *, uint32, uint32) 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_wg_queue()

npc_wg_queue::npc_wg_queue ( )
inline
288: CreatureScript("npc_wg_queue") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

399 {
400 return new npc_wg_queueAI(creature);
401 }

◆ OnGossipHello()

bool npc_wg_queue::OnGossipHello ( Player player,
Creature creature 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

291 {
292 if (!sWorld->getBoolConfig(CONFIG_MINIGOB_MANABONK))
293 return false;
294
295 if (creature->IsQuestGiver())
296 player->PrepareQuestMenu(creature->GetGUID());
297
298 Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
299 if (!wintergrasp)
300 return true;
301
302 if (wintergrasp->IsWarTime())
303 {
306 }
307 else
308 {
309 uint32 timer = wintergrasp->GetTimer() / 1000;
310 player->SendUpdateWorldState(4354, GameTime::GetGameTime().count() + timer);
311 if (timer < 15 * MINUTE)
312 {
315 }
316 else
318 }
319 return true;
320 }
constexpr auto MINUTE
Definition: Common.h:47
std::uint32_t uint32
Definition: Define.h:107
@ WG_NPCQUEUE_TEXT_H_WAR
Definition: zone_wintergrasp.cpp:43
@ WG_NPCQUEUE_TEXT_H_NOWAR
Definition: zone_wintergrasp.cpp:41
@ WG_NPCQUEUE_TEXT_A_WAR
Definition: zone_wintergrasp.cpp:46
@ WG_GOSSIP_MENU_QUEUE
Definition: zone_wintergrasp.cpp:49
@ WG_NPCQUEUE_TEXT_A_QUEUE
Definition: zone_wintergrasp.cpp:45
@ WG_NPCQUEUE_TEXT_H_QUEUE
Definition: zone_wintergrasp.cpp:42
@ WG_NPCQUEUE_TEXT_A_NOWAR
Definition: zone_wintergrasp.cpp:44
@ BATTLEFIELD_BATTLEID_WG
Definition: Battlefield.h:35
#define sBattlefieldMgr
Definition: BattlefieldMgr.h:77
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const guid)
Definition: ScriptedGossip.cpp:45
void AddGossipItemFor(Player *player, uint32 icon, std::string const &text, uint32 sender, uint32 action)
Definition: ScriptedGossip.cpp:28
@ GOSSIP_SENDER_MAIN
Definition: ScriptedGossip.h:70
@ GOSSIP_ACTION_INFO_DEF
Definition: ScriptedGossip.h:68
@ CONFIG_MINIGOB_MANABONK
Definition: IWorld.h:151
#define sWorld
Definition: World.h:443
Seconds GetGameTime()
Definition: GameTime.cpp:38
Definition: Battlefield.h:204
TeamId GetDefenderTeam()
Definition: Battlefield.h:275
uint32 GetTimer()
Definition: Battlefield.h:352
bool IsWarTime()
Return true if battle is start, false if battle is not started.
Definition: Battlefield.h:247
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
void SendUpdateWorldState(uint32 variable, uint32 value) const
Definition: PlayerUpdates.cpp:2197
void PrepareQuestMenu(ObjectGuid guid)
Definition: PlayerQuest.cpp:39
bool IsQuestGiver() const
Definition: Unit.h:762

References AddGossipItemFor(), BATTLEFIELD_BATTLEID_WG, CONFIG_MINIGOB_MANABONK, Battlefield::GetDefenderTeam(), GameTime::GetGameTime(), Object::GetGUID(), Battlefield::GetTimer(), GOSSIP_ACTION_INFO_DEF, GOSSIP_SENDER_MAIN, Unit::IsQuestGiver(), Battlefield::IsWarTime(), MINUTE, Player::PrepareQuestMenu(), sBattlefieldMgr, SendGossipMenuFor(), Player::SendUpdateWorldState(), sWorld, WG_GOSSIP_MENU_QUEUE, WG_NPCQUEUE_TEXT_A_NOWAR, WG_NPCQUEUE_TEXT_A_QUEUE, WG_NPCQUEUE_TEXT_A_WAR, WG_NPCQUEUE_TEXT_H_NOWAR, WG_NPCQUEUE_TEXT_H_QUEUE, and WG_NPCQUEUE_TEXT_H_WAR.

◆ OnGossipSelect()

bool npc_wg_queue::OnGossipSelect ( Player player,
Creature ,
uint32  ,
uint32   
)
inlineoverridevirtual

Reimplemented from CreatureScript.

323 {
324 CloseGossipMenuFor(player);
325
326 Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
327 if (!wintergrasp)
328 return true;
329
330 if (wintergrasp->IsWarTime())
331 wintergrasp->InvitePlayerToWar(player);
332 else
333 {
334 uint32 timer = wintergrasp->GetTimer() / 1000;
335 if (timer < 15 * MINUTE)
336 wintergrasp->InvitePlayerToQueue(player);
337 }
338 return true;
339 }
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
void InvitePlayerToQueue(Player *player)
Definition: Battlefield.cpp:229
void InvitePlayerToWar(Player *player)
Definition: Battlefield.cpp:276

References BATTLEFIELD_BATTLEID_WG, CloseGossipMenuFor(), Battlefield::GetTimer(), Battlefield::InvitePlayerToQueue(), Battlefield::InvitePlayerToWar(), Battlefield::IsWarTime(), MINUTE, and sBattlefieldMgr.