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

Public Member Functions

 npc_lokhtos_darkbargainer ()
 
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
 
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_lokhtos_darkbargainer()

npc_lokhtos_darkbargainer::npc_lokhtos_darkbargainer ( )
inline
522: CreatureScript("npc_lokhtos_darkbargainer") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

539 {
540 if (creature->IsQuestGiver())
541 player->PrepareQuestMenu(creature->GetGUID());
542
543 if (creature->IsVendor() && player->GetReputationRank(59) >= REP_FRIENDLY)
545
549 {
551 }
552
553 if (player->GetReputationRank(59) < REP_FRIENDLY)
554 SendGossipMenuFor(player, 3673, creature->GetGUID());
555 else
556 SendGossipMenuFor(player, 3677, creature->GetGUID());
557
558 return true;
559 }
@ ITEM_THRORIUM_BROTHERHOOD_CONTRACT
Definition: blackrock_depths.cpp:505
@ ITEM_SULFURON_INGOT
Definition: blackrock_depths.cpp:506
@ QUEST_A_BINDING_CONTRACT
Definition: blackrock_depths.cpp:511
@ REP_FRIENDLY
Definition: SharedDefines.h:184
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_TRADE
Definition: ScriptedGossip.h:56
@ GOSSIP_ACTION_INFO_DEF
Definition: ScriptedGossip.h:68
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
bool GetQuestRewardStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1414
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
Definition: PlayerStorage.cpp:655
void PrepareQuestMenu(ObjectGuid guid)
Definition: PlayerQuest.cpp:39
ReputationRank GetReputationRank(uint32 faction_id) const
Definition: Player.cpp:5893
bool IsQuestGiver() const
Definition: Unit.h:762
bool IsVendor() const
Definition: Unit.h:760

References AddGossipItemFor(), Object::GetGUID(), Player::GetQuestRewardStatus(), Player::GetReputationRank(), GOSSIP_ACTION_INFO_DEF, GOSSIP_ACTION_TRADE, GOSSIP_SENDER_MAIN, Player::HasItemCount(), Unit::IsQuestGiver(), Unit::IsVendor(), ITEM_SULFURON_INGOT, ITEM_THRORIUM_BROTHERHOOD_CONTRACT, Player::PrepareQuestMenu(), QUEST_A_BINDING_CONTRACT, REP_FRIENDLY, and SendGossipMenuFor().

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

525 {
526 ClearGossipMenuFor(player);
527 if (action == GOSSIP_ACTION_INFO_DEF + 1)
528 {
529 CloseGossipMenuFor(player);
531 }
532 if (action == GOSSIP_ACTION_TRADE)
533 player->GetSession()->SendListInventory(creature->GetGUID());
534
535 return true;
536 }
@ SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND
Definition: blackrock_depths.cpp:516
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
WorldSession * GetSession() const
Definition: Player.h:1998
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1167
void SendListInventory(ObjectGuid guid, uint32 vendorEntry=0)
Definition: ItemHandler.cpp:1035

References Unit::CastSpell(), ClearGossipMenuFor(), CloseGossipMenuFor(), Object::GetGUID(), Player::GetSession(), GOSSIP_ACTION_INFO_DEF, GOSSIP_ACTION_TRADE, WorldSession::SendListInventory(), and SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND.