fix(Core/PlayerScript) Align player script function names (#21020)

Co-authored-by: sudlud <sudlud@users.noreply.github.com>
This commit is contained in:
Exitare
2025-02-16 05:59:41 -08:00
committed by GitHub
parent df7c23d763
commit 98ceb1c067
45 changed files with 749 additions and 749 deletions

View File

@@ -55,7 +55,7 @@ void Player::Update(uint32 p_time)
if (!IsInWorld())
return;
sScriptMgr->OnBeforePlayerUpdate(this, p_time);
sScriptMgr->OnPlayerBeforeUpdate(this, p_time);
// undelivered mail
if (m_nextMailDelivereTime && m_nextMailDelivereTime <= GameTime::GetGameTime().count())
@@ -708,7 +708,7 @@ void Player::UpdateAllRatings()
// skill+step, checking for max value
bool Player::UpdateSkill(uint32 skill_id, uint32 step)
{
if (!skill_id || !sScriptMgr->CanPlayerUpdateSkill(this, skill_id))
if (!skill_id || !sScriptMgr->OnPlayerCanUpdateSkill(this, skill_id))
return false;
SkillStatusMap::iterator itr = mSkillStatus.find(skill_id);
@@ -720,7 +720,7 @@ bool Player::UpdateSkill(uint32 skill_id, uint32 step)
uint32 value = SKILL_VALUE(data);
uint32 max = SKILL_MAX(data);
sScriptMgr->OnBeforePlayerUpdateSkill(this, skill_id, value, max, step);
sScriptMgr->OnPlayerBeforeUpdateSkill(this, skill_id, value, max, step);
if ((!max) || (!value) || (value >= max))
return false;
@@ -768,7 +768,7 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue,
uint32 gathering_skill_gain =
sWorld->getIntConfig(CONFIG_SKILL_GAIN_GATHERING);
sScriptMgr->OnUpdateGatheringSkill(this, SkillId, SkillValue, RedLevel + 100, RedLevel + 50, RedLevel + 25, gathering_skill_gain);
sScriptMgr->OnPlayerUpdateGatheringSkill(this, SkillId, SkillValue, RedLevel + 100, RedLevel + 50, RedLevel + 25, gathering_skill_gain);
// For skinning and Mining chance decrease with level. 1-74 - no decrease,
// 75-149 - 2 times, 225-299 - 8 times
@@ -846,7 +846,7 @@ bool Player::UpdateCraftSkill(uint32 spellid)
uint32 craft_skill_gain =
sWorld->getIntConfig(CONFIG_SKILL_GAIN_CRAFTING);
sScriptMgr->OnUpdateCraftingSkill(this, _spell_idx->second, SkillValue, craft_skill_gain);
sScriptMgr->OnPlayerUpdateCraftingSkill(this, _spell_idx->second, SkillValue, craft_skill_gain);
return UpdateSkillPro(
_spell_idx->second->SkillLine,
@@ -915,7 +915,7 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step)
LOG_DEBUG("entities.player.skills",
"UpdateSkillPro(SkillId {}, Chance {:3.1f}%)", SkillId,
Chance / 10.0f);
if (!SkillId || !sScriptMgr->CanPlayerUpdateSkill(this, SkillId))
if (!SkillId || !sScriptMgr->OnPlayerCanUpdateSkill(this, SkillId))
return false;
if (Chance <= 0) // speedup in 0 chance case
@@ -936,7 +936,7 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step)
uint32 SkillValue = SKILL_VALUE(data);
uint32 MaxValue = SKILL_MAX(data);
sScriptMgr->OnBeforePlayerUpdateSkill(this, SkillId, SkillValue, MaxValue, step);
sScriptMgr->OnPlayerBeforeUpdateSkill(this, SkillId, SkillValue, MaxValue, step);
if (!MaxValue || !SkillValue || SkillValue >= MaxValue)
return false;
@@ -1383,7 +1383,7 @@ void Player::UpdateEquipSpellsAtFormChange()
ApplyEquipSpell(spellInfo, nullptr, false,
true); // remove spells that not fit to form
if (!sScriptMgr->CanApplyEquipSpellsItemSet(this, eff))
if (!sScriptMgr->OnPlayerCanApplyEquipSpellsItemSet(this, eff))
break;
ApplyEquipSpell(spellInfo, nullptr, true,
true); // add spells that fit form but not active
@@ -1461,7 +1461,7 @@ void Player::UpdateFFAPvPState(bool reset /*= true*/)
{
if (!IsFFAPvP())
{
sScriptMgr->OnFfaPvpStateUpdate(this, true);
sScriptMgr->OnPlayerFfaPvpStateUpdate(this, true);
SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
for (ControlSet::iterator itr = m_Controlled.begin();
itr != m_Controlled.end(); ++itr)
@@ -1483,7 +1483,7 @@ void Player::UpdateFFAPvPState(bool reset /*= true*/)
if (HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
{
RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
sScriptMgr->OnFfaPvpStateUpdate(this, false);
sScriptMgr->OnPlayerFfaPvpStateUpdate(this, false);
}
for (ControlSet::iterator itr = m_Controlled.begin();
itr != m_Controlled.end(); ++itr)