From 817257c85b644433f61e47ce3f917a47af4a0b74 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Thu, 9 Nov 2017 10:41:05 +0000 Subject: Implemented OnUpdateArea hook it's more accurate than UpdateZone --- src/game/Scripting/ScriptMgr.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/game/Scripting/ScriptMgr.cpp') diff --git a/src/game/Scripting/ScriptMgr.cpp b/src/game/Scripting/ScriptMgr.cpp index 55d4e65395..bb2f05f3b3 100644 --- a/src/game/Scripting/ScriptMgr.cpp +++ b/src/game/Scripting/ScriptMgr.cpp @@ -1303,6 +1303,11 @@ void ScriptMgr::OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newAre FOREACH_SCRIPT(PlayerScript)->OnUpdateZone(player, newZone, newArea); } +void ScriptMgr::OnPlayerUpdateArea(Player* player, uint32 oldArea, uint32 newArea) +{ + FOREACH_SCRIPT(PlayerScript)->OnUpdateArea(player, oldArea, newArea); +} + void ScriptMgr::OnPlayerUpdateFaction(Player* player) { FOREACH_SCRIPT(PlayerScript)->OnUpdateFaction(player); @@ -1494,14 +1499,18 @@ void ScriptMgr::OnBeforeUpdateArenaPoints(ArenaTeam* at, std::mapOnBeforeUpdateArenaPoints(at,ap); } -void ScriptMgr::OnAfterRefCount(LootStoreItem* LootStoreItem, uint32 &maxcount) +void ScriptMgr::OnAfterRefCount(Player const* player, Loot& loot, bool canRate, uint16 lootMode, LootStoreItem* LootStoreItem, uint32 &maxcount) { - FOREACH_SCRIPT(GlobalScript)->OnAfterRefCount(LootStoreItem, maxcount); + FOREACH_SCRIPT(GlobalScript)->OnAfterRefCount(player, LootStoreItem, loot, canRate, lootMode, maxcount); } -void ScriptMgr::OnBeforeDropAddItem(Player const* player, Loot& loot, LootStoreItem* LootStoreItem) +void ScriptMgr::OnBeforeDropAddItem(Player const* player, Loot& loot, bool canRate, uint16 lootMode, LootStoreItem* LootStoreItem) { - FOREACH_SCRIPT(GlobalScript)->OnBeforeDropAddItem(player, loot, LootStoreItem); + FOREACH_SCRIPT(GlobalScript)->OnBeforeDropAddItem(player, loot, canRate, lootMode, LootStoreItem); +} + +void ScriptMgr::OnBeforeItemRoll(Player const* player, Loot& loot, bool canRate, uint16 lootMode, LootStoreItem* LootStoreItem) { + FOREACH_SCRIPT(GlobalScript)->OnBeforeItemRoll(player, loot, canRate, lootMode, LootStoreItem); } void ScriptMgr::OnInitializeLockedDungeons(Player* player, uint8& level, uint32& lockData) -- cgit v1.2.3