diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Entities/Player/Player.cpp | 2 | ||||
-rw-r--r-- | src/game/Scripting/ScriptMgr.cpp | 17 | ||||
-rw-r--r-- | src/game/Scripting/ScriptMgr.h | 3 |
3 files changed, 18 insertions, 4 deletions
diff --git a/src/game/Entities/Player/Player.cpp b/src/game/Entities/Player/Player.cpp index 58ec9ee6e9..d0cba859c1 100644 --- a/src/game/Entities/Player/Player.cpp +++ b/src/game/Entities/Player/Player.cpp @@ -7531,6 +7531,8 @@ void Player::UpdateArea(uint32 newArea) // pussywizard: inform instance, needed for Icecrown Citadel if (InstanceScript* instance = GetInstanceScript()) instance->OnPlayerAreaUpdate(this, m_areaUpdateId, newArea); + + sScriptMgr->OnPlayerUpdateArea(this, m_areaUpdateId, newArea); // FFA_PVP flags are area and not zone id dependent // so apply them accordingly 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::map<uint32, uint32 FOREACH_SCRIPT(GlobalScript)->OnBeforeUpdateArenaPoints(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) diff --git a/src/game/Scripting/ScriptMgr.h b/src/game/Scripting/ScriptMgr.h index 888fde265f..2e84a488e6 100644 --- a/src/game/Scripting/ScriptMgr.h +++ b/src/game/Scripting/ScriptMgr.h @@ -842,6 +842,9 @@ class PlayerScript : public ScriptObject // Called when a player switches to a new zone virtual void OnUpdateZone(Player* /*player*/, uint32 /*newZone*/, uint32 /*newArea*/) { } + // Called when a player switches to a new area (more accurate than UpdateZone) + virtual void OnUpdateArea(Player* /*player*/, uint32 /*oldArea*/, uint32 /*newArea*/) { } + // Called when a player changes to a new map (after moving to new map) virtual void OnMapChanged(Player* /*player*/) { } |