hook before a player buys something
This commit is contained in:
parent
384ff412bf
commit
a870e5fae4
3 changed files with 16 additions and 0 deletions
|
|
@ -1530,6 +1530,11 @@ void ScriptMgr::OnPlayerMove(Player* player, MovementInfo movementInfo, uint32 o
|
|||
FOREACH_SCRIPT(MovementHandlerScript)->OnPlayerMove(player, movementInfo, opcode);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnBeforeBuyItemFromVendor(Player* player, uint64 vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnBeforeBuyItemFromVendor(player, vendorguid, vendorslot, item, count, bag, slot);;
|
||||
}
|
||||
|
||||
AllMapScript::AllMapScript(const char* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -882,6 +882,9 @@ class PlayerScript : public ScriptObject
|
|||
//After receiving item as a quest reward
|
||||
virtual void OnQuestRewardItem(Player* player, Item* item, uint32 count) { }
|
||||
|
||||
//Before buying something from any vendor
|
||||
virtual void OnBeforeBuyItemFromVendor(Player* player, uint64 vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot);
|
||||
|
||||
};
|
||||
|
||||
class GuildScript : public ScriptObject
|
||||
|
|
@ -1191,6 +1194,7 @@ class ScriptMgr
|
|||
void OnLootItem(Player* player, Item* item, uint32 count, uint64 lootguid);
|
||||
void OnCreateItem(Player* player, Item* item, uint32 count);
|
||||
void OnQuestRewardItem(Player* player, Item* item, uint32 count);
|
||||
void OnBeforeBuyItemFromVendor(Player* player, uint64 vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot);
|
||||
|
||||
public: /* GuildScript */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue