diff options
author | Yehonal <yehonal.azeroth@gmail.com> | 2017-12-21 11:26:43 +0100 |
---|---|---|
committer | Yehonal <yehonal.azeroth@gmail.com> | 2017-12-21 11:26:43 +0100 |
commit | 403ed2600f39c1105b6641086808a6cdafbca1c5 (patch) | |
tree | 0422298438422af22f3f0723dfa62f66e10510f1 /src/server/game/Scripting/ScriptMgr.h | |
parent | acd60005e833efee3a10a2f1a4aee7ecced4cc97 (diff) | |
parent | a0d17509a2c0b06d9e74c01d3fe7dc4df2c5c9a7 (diff) |
Merge branch 'master' of https://github.com/azerothcore/azerothcore-wotlk into dir-restructure
Diffstat (limited to 'src/server/game/Scripting/ScriptMgr.h')
-rw-r--r-- | src/server/game/Scripting/ScriptMgr.h | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 260d8d666c..c71c45dbff 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -747,7 +747,11 @@ class AchievementCriteriaScript : public ScriptObject bool IsDatabaseBound() const { return true; } // Called when an additional criteria is checked. - virtual bool OnCheck(Player* source, Unit* target) = 0; + virtual bool OnCheck(Player* source, Unit* target, uint32 /*criteria_id*/) { + return OnCheck(source, target); + } + // deprecated/legacy + virtual bool OnCheck(Player* /*source*/, Unit* /*target*/) { return true; }; }; class PlayerScript : public ScriptObject @@ -838,9 +842,15 @@ 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*/) { } + // Called before a player is being teleported to new coords + virtual bool OnBeforeTeleport(Player* /*player*/, uint32 /*mapid*/, float /*x*/, float /*y*/, float /*z*/, float /*orientation*/, uint32 /*options*/, Unit* /*target*/) { return true; } + // Called when team/faction is set on player virtual void OnUpdateFaction(Player* /*player*/) { } @@ -994,8 +1004,11 @@ class GlobalScript : public ScriptObject // items virtual void OnItemDelFromDB(SQLTransaction& /*trans*/, uint32 /*itemGuid*/) { } virtual void OnMirrorImageDisplayItem(const Item* /*item*/, uint32& /*display*/) { } - virtual void OnAfterRefCount(LootStoreItem* /*LootStoreItem*/, uint32& /*maxcount*/) { } - virtual void OnBeforeDropAddItem(Player const* /*player*/, Loot& /*loot*/, LootStoreItem* /*LootStoreItem*/) { } + + // loot + virtual void OnAfterRefCount(Player const* /*player*/, LootStoreItem* /*LootStoreItem*/, Loot& /*loot*/, bool /*canRate*/, uint16 /*lootMode*/, uint32& /*maxcount*/, LootStore const& /*store*/) { } + virtual void OnBeforeDropAddItem(Player const* /*player*/, Loot& /*loot*/, bool /*canRate*/, uint16 /*lootMode*/, LootStoreItem* /*LootStoreItem*/, LootStore const& /*store*/) { } + virtual void OnItemRoll(Player const* /*player*/, LootStoreItem const* /*LootStoreItem*/, float& /*chance*/, Loot& /*loot*/, LootStore const& /*store*/) { }; virtual void OnInitializeLockedDungeons(Player* /*player*/, uint8& /*level*/, uint32& /*lockData*/) { } virtual void OnAfterInitializeLockedDungeons(Player* /*player*/) { } @@ -1176,7 +1189,7 @@ class ScriptMgr public: /* AchievementCriteriaScript */ - bool OnCriteriaCheck(uint32 scriptId, Player* source, Unit* target); + bool OnCriteriaCheck(uint32 scriptId, Player* source, Unit* target, uint32 criteria_id); public: /* PlayerScript */ @@ -1210,6 +1223,8 @@ class ScriptMgr void OnPlayerDelete(uint64 guid); void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent); void OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea); + void OnPlayerUpdateArea(Player* player, uint32 oldArea, uint32 newArea); + bool OnBeforePlayerTeleport(Player* player, uint32 mapid, float x, float y, float z, float orientation, uint32 options, Unit *target); void OnPlayerUpdateFaction(Player* player); void OnPlayerAddToBattleground(Player* player, Battleground* bg); void OnPlayerRemoveFromBattleground(Player* player, Battleground* bg); @@ -1264,8 +1279,9 @@ class ScriptMgr void OnGlobalItemDelFromDB(SQLTransaction& trans, uint32 itemGuid); void OnGlobalMirrorImageDisplayItem(const Item *item, uint32 &display); void OnBeforeUpdateArenaPoints(ArenaTeam* at, std::map<uint32, uint32> &ap); - void OnAfterRefCount(LootStoreItem* LootStoreItem, uint32 &maxcount); - void OnBeforeDropAddItem(Player const* player, Loot& loot, LootStoreItem* LootStoreItem); + void OnAfterRefCount(Player const* player, Loot& loot, bool canRate, uint16 lootMode, LootStoreItem* LootStoreItem, uint32 &maxcount, LootStore const& store); + void OnBeforeDropAddItem(Player const* player, Loot& loot, bool canRate, uint16 lootMode, LootStoreItem* LootStoreItem, LootStore const& store); + void OnItemRoll(Player const* player, LootStoreItem const* LootStoreItem, float &chance, Loot& loot, LootStore const& store); void OnInitializeLockedDungeons(Player* player, uint8& level, uint32& lockData); void OnAfterInitializeLockedDungeons(Player* player); |