Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2022-09-21 09:42:10 -06:00
committed by GitHub
27 changed files with 327 additions and 72 deletions

View File

@@ -82,11 +82,11 @@ void ScriptMgr::OnFailedPasswordChange(uint32 accountId)
});
}
bool ScriptMgr::CanAccountCreateCharacter(std::shared_ptr<CharacterCreateInfo> createInfo, uint32 accountId)
bool ScriptMgr::CanAccountCreateCharacter(uint32 accountId, uint8 charRace, uint8 charClass)
{
auto ret = IsValidBoolScript<AccountScript>([&](AccountScript* script)
{
return !script->CanAccountCreateCharacter(createInfo, accountId);
return !script->CanAccountCreateCharacter(accountId, charRace, charClass);
});
if (ret && *ret)

View File

@@ -170,6 +170,15 @@ CreatureAI* ScriptMgr::GetCreatureAI(Creature* creature)
return tempScript ? tempScript->GetAI(creature) : nullptr;
}
//Fires whenever the UNIT_BYTE2_FLAG_FFA_PVP bit is Changed on the player
void ScriptMgr::OnFfaPvpStateUpdate(Creature* creature, bool InPvp)
{
ExecuteScript<AllCreatureScript>([&](AllCreatureScript* script)
{
script->OnFfaPvpStateUpdate(creature, InPvp);
});
}
void ScriptMgr::OnCreatureUpdate(Creature* creature, uint32 diff)
{
ASSERT(creature);

View File

@@ -146,6 +146,14 @@ void ScriptMgr::OnPlayerMoneyChanged(Player* player, int32& amount)
});
}
void ScriptMgr::OnBeforeLootMoney(Player* player, Loot* loot)
{
ExecuteScript<PlayerScript>([&](PlayerScript* script)
{
script->OnBeforeLootMoney(player, loot);
});
}
void ScriptMgr::OnGivePlayerXP(Player* player, uint32& amount, Unit* victim)
{
ExecuteScript<PlayerScript>([&](PlayerScript* script)
@@ -1263,6 +1271,7 @@ void ScriptMgr::OnGetArenaTeamId(Player* player, uint8 slot, uint32& result)
});
}
//Signifies that IsFfaPvp has been called.
void ScriptMgr::OnIsFFAPvP(Player* player, bool& result)
{
ExecuteScript<PlayerScript>([&](PlayerScript* script)
@@ -1270,6 +1279,14 @@ void ScriptMgr::OnIsFFAPvP(Player* player, bool& result)
script->OnIsFFAPvP(player, result);
});
}
//Fires whenever the UNIT_BYTE2_FLAG_FFA_PVP bit is Changed
void ScriptMgr::OnFfaPvpStateUpdate(Player* player, bool result)
{
ExecuteScript<PlayerScript>([&](PlayerScript* script)
{
script->OnFfaPvpStateUpdate(player, result);
});
}
void ScriptMgr::OnIsPvP(Player* player, bool& result)
{