Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2023-07-04 10:05:31 +08:00
59 changed files with 1562 additions and 845 deletions
@@ -913,6 +913,37 @@ bool ScriptMgr::CanSendMail(Player* player, ObjectGuid receiverGuid, ObjectGuid
return true;
}
bool ScriptMgr::CanSendErrorAlreadyLooted(Player* player)
{
auto ret = IsValidBoolScript<PlayerScript>([&](PlayerScript* script)
{
return !script->CanSendErrorAlreadyLooted(player);
});
if (ret && *ret)
{
return false;
}
return true;
}
void ScriptMgr::OnAfterCreatureLoot(Player* player)
{
ExecuteScript<PlayerScript>([&](PlayerScript* script)
{
script->OnAfterCreatureLoot(player);
});
}
void ScriptMgr::OnAfterCreatureLootMoney(Player* player)
{
ExecuteScript<PlayerScript>([&](PlayerScript* script)
{
script->OnAfterCreatureLootMoney(player);
});
}
void ScriptMgr::PetitionBuy(Player* player, Creature* creature, uint32& charterid, uint32& cost, uint32& type)
{
ExecuteScript<PlayerScript>([&](PlayerScript* script)
@@ -986,7 +1017,7 @@ void ScriptMgr::OnGetMaxSkillValue(Player* player, uint32 skill, int32& result,
void ScriptMgr::OnUpdateGatheringSkill(Player *player, uint32 skillId, uint32 currentLevel, uint32 gray, uint32 green, uint32 yellow, uint32 &gain) {
ExecuteScript<PlayerScript>([&](PlayerScript* script)
{
script->OnUpdateGatheringSkill(player, skillId, gray, green, yellow, currentLevel, gain);
script->OnUpdateGatheringSkill(player, skillId, currentLevel, gray, green, yellow, gain);
});
}
+27
View File
@@ -1483,6 +1483,30 @@ public:
virtual void AnticheatUpdateMovementInfo(Player* /*player*/, MovementInfo const& /*movementInfo*/) { }
[[nodiscard]] virtual bool AnticheatHandleDoubleJump(Player* /*player*/, Unit* /*mover*/) { return true; }
[[nodiscard]] virtual bool AnticheatCheckMovementInfo(Player* /*player*/, MovementInfo const& /*movementInfo*/, Unit* /*mover*/, bool /*jump*/) { return true; }
/**
* @brief This hook is called, to avoid displaying the error message that the body has already been stripped
*
* @param player Contains information about the Player
*
* @return true Avoiding displaying the error message that the loot has already been taken.
*/
virtual bool CanSendErrorAlreadyLooted(Player* /*player*/) { return true; }
/**
* @brief It is used when an item is taken from a creature.
*
* @param player Contains information about the Player
*
*/
virtual void OnAfterCreatureLoot(Player* /*player*/) { }
/**
* @brief After a creature's money is taken
*
* @param player Contains information about the Player
*/
virtual void OnAfterCreatureLootMoney(Player* /*player*/) { }
};
class AccountScript : public ScriptObject
@@ -2447,6 +2471,9 @@ public: /* PlayerScript */
void OnPlayerEnterCombat(Player* player, Unit* enemy);
void OnPlayerLeaveCombat(Player* player);
void OnQuestAbandon(Player* player, uint32 questId);
bool CanSendErrorAlreadyLooted(Player* player);
void OnAfterCreatureLoot(Player* player);
void OnAfterCreatureLootMoney(Player* player);
// Anti cheat
void AnticheatSetSkipOnePacketForASH(Player* player, bool apply);