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

Public Member Functions

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

◆ npcs_flanis_swiftwing_and_kagrosh()

npcs_flanis_swiftwing_and_kagrosh::npcs_flanis_swiftwing_and_kagrosh ( )
inline
732: CreatureScript("npcs_flanis_swiftwing_and_kagrosh") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

762 {
767
768 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
769
770 return true;
771 }
@ QUEST_THE_FATE_OF_FLANIS
Definition: zone_shadowmoon_valley.cpp:717
@ ITEM_FLAUNISS_PACK
Definition: zone_shadowmoon_valley.cpp:718
@ GOSSIP_MENU_FLANIS
Definition: zone_shadowmoon_valley.cpp:719
@ QUEST_THE_FATE_OF_KAGROSH
Definition: zone_shadowmoon_valley.cpp:724
@ ITEM_KAGROSHS_PACK
Definition: zone_shadowmoon_valley.cpp:725
@ GOSSIP_MENU_KAGROSH
Definition: zone_shadowmoon_valley.cpp:726
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
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
Definition: PlayerStorage.cpp:655
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1429
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:404

References AddGossipItemFor(), Player::GetGossipTextId(), Object::GetGUID(), Player::GetQuestStatus(), GOSSIP_ACTION_INFO_DEF, GOSSIP_MENU_FLANIS, GOSSIP_MENU_KAGROSH, GOSSIP_SENDER_MAIN, Player::HasItemCount(), ITEM_FLAUNISS_PACK, ITEM_KAGROSHS_PACK, QUEST_STATUS_INCOMPLETE, QUEST_THE_FATE_OF_FLANIS, QUEST_THE_FATE_OF_KAGROSH, and SendGossipMenuFor().

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

735 {
736 ClearGossipMenuFor(player);
737 if (action == GOSSIP_ACTION_INFO_DEF + 1)
738 {
739 ItemPosCountVec dest;
740 uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_FLAUNISS_PACK, 1, nullptr);
741 if (msg == EQUIP_ERR_OK)
742 {
743 player->StoreNewItem(dest, ITEM_FLAUNISS_PACK, true);
744 }
745 }
746 if (action == GOSSIP_ACTION_INFO_DEF + 2)
747 {
748 ItemPosCountVec dest;
749 uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_KAGROSHS_PACK, 1, nullptr);
750 if (msg == EQUIP_ERR_OK)
751 {
752 player->StoreNewItem(dest, ITEM_KAGROSHS_PACK, true);
753 }
754 }
755
756 CloseGossipMenuFor(player);
757
758 return true;
759 }
std::uint8_t uint8
Definition: Define.h:109
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
std::vector< ItemPosCount > ItemPosCountVec
Definition: Player.h:776
@ EQUIP_ERR_OK
Definition: Item.h:47
@ NULL_BAG
Definition: Item.h:40
@ NULL_SLOT
Definition: Item.h:41
Item * StoreNewItem(ItemPosCountVec const &pos, uint32 item, bool update, int32 randomPropertyId=0)
Definition: PlayerStorage.cpp:2524
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 item, uint32 count, uint32 *no_space_count=nullptr) const
Definition: Player.h:1291

References Player::CanStoreNewItem(), ClearGossipMenuFor(), CloseGossipMenuFor(), EQUIP_ERR_OK, GOSSIP_ACTION_INFO_DEF, ITEM_FLAUNISS_PACK, ITEM_KAGROSHS_PACK, NULL_BAG, NULL_SLOT, and Player::StoreNewItem().