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

Public Member Functions

 npc_slim ()
 
bool OnGossipSelect (Player *player, Creature *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
 
- 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)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_slim()

npc_slim::npc_slim ( )
inline
836: CreatureScript("npc_slim") { }
Definition: ScriptMgr.h:718

Member Function Documentation

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

848 {
849 if (creature->IsVendor() && player->GetReputationRank(FACTION_CONSORTIUM) >= REP_FRIENDLY)
850 {
852 SendGossipMenuFor(player, 9896, creature->GetGUID());
853 }
854 else
855 SendGossipMenuFor(player, 9895, creature->GetGUID());
856
857 return true;
858 }
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
#define GOSSIP_TEXT_BROWSE_GOODS
Definition: ScriptedGossip.h:25
@ GOSSIP_SENDER_MAIN
Definition: ScriptedGossip.h:70
@ GOSSIP_ACTION_TRADE
Definition: ScriptedGossip.h:56
@ GOSSIP_ICON_VENDOR
Definition: GossipDef.h:61
@ FACTION_CONSORTIUM
Definition: zone_terokkar_forest.cpp:830
@ REP_FRIENDLY
Definition: SharedDefines.h:156
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
ReputationRank GetReputationRank(uint32 faction_id) const
Definition: Player.cpp:5749
bool IsVendor() const
Definition: Unit.h:1687

References AddGossipItemFor(), FACTION_CONSORTIUM, Object::GetGUID(), Player::GetReputationRank(), GOSSIP_ACTION_TRADE, GOSSIP_ICON_VENDOR, GOSSIP_SENDER_MAIN, GOSSIP_TEXT_BROWSE_GOODS, Unit::IsVendor(), REP_FRIENDLY, and SendGossipMenuFor().

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

839 {
840 ClearGossipMenuFor(player);
841 if (action == GOSSIP_ACTION_TRADE)
842 player->GetSession()->SendListInventory(creature->GetGUID());
843
844 return true;
845 }
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
WorldSession * GetSession() const
Definition: Player.h:1947
void SendListInventory(ObjectGuid guid, uint32 vendorEntry=0)
Definition: ItemHandler.cpp:992

References ClearGossipMenuFor(), Object::GetGUID(), Player::GetSession(), GOSSIP_ACTION_TRADE, and WorldSession::SendListInventory().