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

Classes

struct  npc_varian_wrynnAI
 

Public Member Functions

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

npc_varian_wrynn::npc_varian_wrynn ( )
inline
943: CreatureScript("npc_varian_wrynn") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

2076 {
2077 return new npc_varian_wrynnAI(creature);
2078 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

972 {
973 if (creature->IsQuestGiver())
974 player->PrepareQuestMenu(creature->GetGUID());
975
978
979 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
980
981 return true;
982 }
@ QUEST_BATTLE_A
Definition: zone_undercity.cpp:707
#define GOSSIP_WRYNN
Definition: zone_undercity.cpp:929
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
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:103
@ GOSSIP_ICON_CHAT
Definition: GossipDef.h:61
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
void PrepareQuestMenu(ObjectGuid guid)
Definition: PlayerQuest.cpp:39
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1429
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:404
bool IsQuestGiver() const
Definition: Unit.h:762

References AddGossipItemFor(), Player::GetGossipTextId(), Object::GetGUID(), Player::GetQuestStatus(), GOSSIP_ACTION_INFO_DEF, GOSSIP_ICON_CHAT, GOSSIP_SENDER_MAIN, GOSSIP_WRYNN, Unit::IsQuestGiver(), Player::PrepareQuestMenu(), QUEST_BATTLE_A, QUEST_STATUS_INCOMPLETE, and SendGossipMenuFor().

◆ OnGossipSelect()

bool npc_varian_wrynn::OnGossipSelect ( Player player,
Creature creature,
uint32  ,
uint32  action 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

946 {
947 ClearGossipMenuFor(player);
948
949 switch (action)
950 {
951 case GOSSIP_ACTION_INFO_DEF + 1:
952 CloseGossipMenuFor(player);
953
954 if (auto ai = CAST_AI(npc_varian_wrynn::npc_varian_wrynnAI, creature->AI()))
955 {
956 ai->Start(true, true, player->GetGUID());
957 if (Creature* jaina = GetClosestCreatureWithEntry(creature, NPC_JAINA, 50.0f))
958 ai->jainaGUID = jaina->GetGUID();
959 else
960 ai->jainaGUID.Clear();
961 ai->SetDespawnAtEnd(false);
962 ai->SetDespawnAtFar(false);
963 }
964
965 break;
966 }
967
968 return true;
969 }
@ NPC_JAINA
Definition: zone_undercity.cpp:418
#define CAST_AI(a, b)
Definition: UnitAI.h:26
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive)
Definition: ScriptedCreature.cpp:850
Definition: Creature.h:43
CreatureAI * AI() const
Definition: Creature.h:140
Definition: zone_undercity.cpp:985

References Creature::AI(), CAST_AI, ClearGossipMenuFor(), CloseGossipMenuFor(), GetClosestCreatureWithEntry(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, and NPC_JAINA.