Merge branch 'master' into Playerbot

# Conflicts:
#	src/server/game/World/World.h
This commit is contained in:
郑佩茹
2023-02-09 12:40:25 -07:00
1253 changed files with 114535 additions and 40950 deletions

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "InstanceScript.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "ScriptMgrMacros.h"
@@ -176,3 +177,33 @@ bool ScriptMgr::OnAllowedForPlayerLootCheck(Player const* player, ObjectGuid sou
return true;
}
/**
* @brief Called when an instance Id is deleted, usually because it expired or no players are bound to it anymore.
*
* @param instanceId The unique id of the instance
*/
void ScriptMgr::OnInstanceIdRemoved(uint32 instanceId)
{
ExecuteScript<GlobalScript>([&](GlobalScript* script)
{
script->OnInstanceIdRemoved(instanceId);
});
}
/**
* @brief Called when any raid boss has their state updated (e.g. pull, reset, kill).
* @details Careful checks for old- and newState are required, since it can fire multiple times and not only when combat starts/ends.
*
* @param id The id of the boss in the [instance]
* @param newState The new boss state to be applied to this boss
* @param oldState The previously assigned state of this boss
* @param instance A pointer to the [map] object of the instance
*/
void ScriptMgr::OnBeforeSetBossState(uint32 id, EncounterState newState, EncounterState oldState, Map* instance)
{
ExecuteScript<GlobalScript>([&](GlobalScript* script)
{
script->OnBeforeSetBossState(id, newState, oldState, instance);
});
}

View File

@@ -645,6 +645,14 @@ void ScriptMgr::OnFirstLogin(Player* player)
});
}
void ScriptMgr::OnSetMaxLevel(Player* player, uint32& maxPlayerLevel)
{
ExecuteScript<PlayerScript>([&](PlayerScript* script)
{
script->OnSetMaxLevel(player, maxPlayerLevel);
});
}
bool ScriptMgr::CanJoinInBattlegroundQueue(Player* player, ObjectGuid BattlemasterGuid, BattlegroundTypeId BGTypeID, uint8 joinAsGroup, GroupJoinBattlegroundResult& err)
{
auto ret = IsValidBoolScript<PlayerScript>([&](PlayerScript* script)

View File

@@ -53,11 +53,11 @@ void ScriptMgr::OnDamage(Unit* attacker, Unit* victim, uint32& damage)
});
}
void ScriptMgr::ModifyPeriodicDamageAurasTick(Unit* target, Unit* attacker, uint32& damage)
void ScriptMgr::ModifyPeriodicDamageAurasTick(Unit* target, Unit* attacker, uint32& damage, SpellInfo const* spellInfo)
{
ExecuteScript<UnitScript>([&](UnitScript* script)
{
script->ModifyPeriodicDamageAurasTick(target, attacker, damage);
script->ModifyPeriodicDamageAurasTick(target, attacker, damage, spellInfo);
});
}