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
@@ -581,7 +581,7 @@ void AchievementMgr::SaveToDB(CharacterDatabaseTransaction trans)
iter->second.changed = false; iter->second.changed = false;
sScriptMgr->OnAchievementSave(trans, GetPlayer(), iter->first, iter->second); sScriptMgr->OnPlayerAchievementSave(trans, GetPlayer(), iter->first, iter->second);
} }
} }
@@ -610,7 +610,7 @@ void AchievementMgr::SaveToDB(CharacterDatabaseTransaction trans)
iter->second.changed = false; iter->second.changed = false;
sScriptMgr->OnCriteriaSave(trans, GetPlayer(), iter->first, iter->second); sScriptMgr->OnPlayerCriteriaSave(trans, GetPlayer(), iter->first, iter->second);
} }
} }
} }
@@ -2099,7 +2099,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry,
if (entry->timeLimit && timedIter == _timedAchievements.end()) if (entry->timeLimit && timedIter == _timedAchievements.end())
return; return;
if (!sScriptMgr->OnBeforeCriteriaProgress(GetPlayer(), entry)) if (!sScriptMgr->OnPlayerBeforeCriteriaProgress(GetPlayer(), entry))
{ {
return; return;
} }
@@ -2165,7 +2165,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry,
SendCriteriaUpdate(entry, progress, timeElapsed, true); SendCriteriaUpdate(entry, progress, timeElapsed, true);
sScriptMgr->OnCriteriaProgress(GetPlayer(), entry); sScriptMgr->OnPlayerCriteriaProgress(GetPlayer(), entry);
} }
void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntry* entry) void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntry* entry)
@@ -2273,7 +2273,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
return; return;
} }
if (!sScriptMgr->OnBeforeAchievementComplete(GetPlayer(), achievement)) if (!sScriptMgr->OnPlayerBeforeAchievementComplete(GetPlayer(), achievement))
{ {
return; return;
} }
@@ -2288,7 +2288,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
ca.date = GameTime::GetGameTime().count(); ca.date = GameTime::GetGameTime().count();
ca.changed = true; ca.changed = true;
sScriptMgr->OnAchievementComplete(GetPlayer(), achievement); sScriptMgr->OnPlayerAchievementComplete(GetPlayer(), achievement);
// pussywizard: set all progress counters to 0, so progress will be deleted from db during save // pussywizard: set all progress counters to 0, so progress will be deleted from db during save
{ {
@@ -1355,11 +1355,11 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
CharacterDatabase.Execute(stmt); CharacterDatabase.Execute(stmt);
} }
sScriptMgr->OnBattlegroundDesertion(player, BG_DESERTION_TYPE_NO_ENTER_BUTTON); sScriptMgr->OnPlayerBattlegroundDesertion(player, BG_DESERTION_TYPE_NO_ENTER_BUTTON);
} }
if (bg && bg->isArena() && (bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN)) if (bg && bg->isArena() && (bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN))
sScriptMgr->OnBattlegroundDesertion(player, ARENA_DESERTION_TYPE_NO_ENTER_BUTTON); sScriptMgr->OnPlayerBattlegroundDesertion(player, ARENA_DESERTION_TYPE_NO_ENTER_BUTTON);
LOG_DEBUG("bg.battleground", "Battleground: removing player {} from bg queue for instance {} because of not pressing enter battle in time.", player->GetGUID().ToString(), m_BgInstanceGUID); LOG_DEBUG("bg.battleground", "Battleground: removing player {} from bg queue for instance {} because of not pressing enter battle in time.", player->GetGUID().ToString(), m_BgInstanceGUID);
+1 -1
View File
@@ -523,7 +523,7 @@ namespace lfg
if (grp && (grp->isBGGroup() || grp->isBFGroup())) if (grp && (grp->isBGGroup() || grp->isBFGroup()))
return; return;
if (!sScriptMgr->CanJoinLfg(player, roles, dungeons, comment)) if (!sScriptMgr->OnPlayerCanJoinLfg(player, roles, dungeons, comment))
return; return;
// pussywizard: can't join LFG/LFR while using LFR // pussywizard: can't join LFG/LFR while using LFR
@@ -41,7 +41,7 @@ namespace lfg
{ {
} }
void LFGPlayerScript::OnLevelChanged(Player* player, uint8 /*oldLevel*/) void LFGPlayerScript::OnPlayerLevelChanged(Player* player, uint8 /*oldLevel*/)
{ {
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER | LFG_OPTION_ENABLE_SEASONAL_BOSSES)) if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER | LFG_OPTION_ENABLE_SEASONAL_BOSSES))
return; return;
@@ -49,7 +49,7 @@ namespace lfg
sLFGMgr->InitializeLockedDungeons(player, player->GetGroup()); sLFGMgr->InitializeLockedDungeons(player, player->GetGroup());
} }
void LFGPlayerScript::OnLogout(Player* player) void LFGPlayerScript::OnPlayerLogout(Player* player)
{ {
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER | LFG_OPTION_ENABLE_SEASONAL_BOSSES)) if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER | LFG_OPTION_ENABLE_SEASONAL_BOSSES))
return; return;
@@ -69,7 +69,7 @@ namespace lfg
sLFGMgr->LfrSearchRemove(player); sLFGMgr->LfrSearchRemove(player);
} }
void LFGPlayerScript::OnLogin(Player* player) void LFGPlayerScript::OnPlayerLogin(Player* player)
{ {
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER | LFG_OPTION_ENABLE_SEASONAL_BOSSES)) if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER | LFG_OPTION_ENABLE_SEASONAL_BOSSES))
return; return;
@@ -93,14 +93,14 @@ namespace lfg
/// @todo - Restore LfgPlayerData and send proper status to player if it was in a group /// @todo - Restore LfgPlayerData and send proper status to player if it was in a group
} }
void LFGPlayerScript::OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool /*permanent*/) void LFGPlayerScript::OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool /*permanent*/)
{ {
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId); MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
if (mapEntry->IsDungeon() && difficulty > DUNGEON_DIFFICULTY_NORMAL) if (mapEntry->IsDungeon() && difficulty > DUNGEON_DIFFICULTY_NORMAL)
sLFGMgr->InitializeLockedDungeons(player, player->GetGroup()); sLFGMgr->InitializeLockedDungeons(player, player->GetGroup());
} }
void LFGPlayerScript::OnMapChanged(Player* player) void LFGPlayerScript::OnPlayerMapChanged(Player* player)
{ {
Map const* map = player->GetMap(); Map const* map = player->GetMap();
+5 -5
View File
@@ -34,11 +34,11 @@ namespace lfg
LFGPlayerScript(); LFGPlayerScript();
// Player Hooks // Player Hooks
void OnLevelChanged(Player* player, uint8 oldLevel) override; void OnPlayerLevelChanged(Player* player, uint8 oldLevel) override;
void OnLogout(Player* player) override; void OnPlayerLogout(Player* player) override;
void OnLogin(Player* player) override; void OnPlayerLogin(Player* player) override;
void OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool permanent) override; void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool permanent) override;
void OnMapChanged(Player* player) override; void OnPlayerMapChanged(Player* player) override;
}; };
class LFGGroupScript : public GroupScript class LFGGroupScript : public GroupScript
@@ -455,14 +455,14 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGU
uint32 moneyRew = 0; uint32 moneyRew = 0;
Player* player = _session->GetPlayer(); Player* player = _session->GetPlayer();
if (player && (player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player))) if (player && (player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->OnPlayerShouldBeRewardedWithMoneyInsteadOfExp(player)))
{ {
moneyRew = quest->GetRewMoneyMaxLevel(); moneyRew = quest->GetRewMoneyMaxLevel();
} }
moneyRew += quest->GetRewOrReqMoney(player ? player->GetLevel() : 0); // reward money (below max lvl) moneyRew += quest->GetRewOrReqMoney(player ? player->GetLevel() : 0); // reward money (below max lvl)
data << moneyRew; data << moneyRew;
uint32 questXp; uint32 questXp;
if (player && !sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player)) if (player && !sScriptMgr->OnPlayerShouldBeRewardedWithMoneyInsteadOfExp(player))
{ {
questXp = player->CalculateQuestRewardXP(quest); questXp = player->CalculateQuestRewardXP(quest);
} }
@@ -470,7 +470,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGU
{ {
questXp = 0; questXp = 0;
} }
sScriptMgr->OnQuestComputeXP(player, quest, questXp); sScriptMgr->OnPlayerQuestComputeXP(player, quest, questXp);
data << questXp; data << questXp;
} }
@@ -555,7 +555,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
{ {
uint32 moneyRew = 0; uint32 moneyRew = 0;
Player* player = _session->GetPlayer(); Player* player = _session->GetPlayer();
if (player && (player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player))) if (player && (player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->OnPlayerShouldBeRewardedWithMoneyInsteadOfExp(player)))
{ {
moneyRew = quest->GetRewMoneyMaxLevel(); moneyRew = quest->GetRewMoneyMaxLevel();
} }
@@ -707,14 +707,14 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUI
uint32 moneyRew = 0; uint32 moneyRew = 0;
Player* player = _session->GetPlayer(); Player* player = _session->GetPlayer();
if (player && (player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player))) if (player && (player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->OnPlayerShouldBeRewardedWithMoneyInsteadOfExp(player)))
{ {
moneyRew = quest->GetRewMoneyMaxLevel(); moneyRew = quest->GetRewMoneyMaxLevel();
} }
moneyRew += quest->GetRewOrReqMoney(player ? player->GetLevel() : 0); // reward money (below max lvl) moneyRew += quest->GetRewOrReqMoney(player ? player->GetLevel() : 0); // reward money (below max lvl)
data << moneyRew; data << moneyRew;
uint32 questXp; uint32 questXp;
if (player && !sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player)) if (player && !sScriptMgr->OnPlayerShouldBeRewardedWithMoneyInsteadOfExp(player))
{ {
questXp = player->CalculateQuestRewardXP(quest); questXp = player->CalculateQuestRewardXP(quest);
} }
@@ -722,7 +722,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUI
{ {
questXp = 0; questXp = 0;
} }
sScriptMgr->OnQuestComputeXP(player, quest, questXp); sScriptMgr->OnPlayerQuestComputeXP(player, quest, questXp);
data << questXp; data << questXp;
// rewarded honor points. Multiply with 10 to satisfy client // rewarded honor points. Multiply with 10 to satisfy client
@@ -204,7 +204,7 @@ void TempSummon::InitStats(uint32 duration)
Unit* owner = GetSummonerUnit(); Unit* owner = GetSummonerUnit();
if (owner) if (owner)
if (Player* player = owner->ToPlayer()) if (Player* player = owner->ToPlayer())
sScriptMgr->OnBeforeTempSummonInitStats(player, this, duration); sScriptMgr->OnPlayerBeforeTempSummonInitStats(player, this, duration);
m_timer = duration; m_timer = duration;
m_lifetime = duration; m_lifetime = duration;
@@ -1759,7 +1759,7 @@ void GameObject::Use(Unit* user)
LOG_DEBUG("entities.gameobject", "Fishing check (skill: {} zone min skill: {} chance {} roll: {}", skill, zone_skill, chance, roll); LOG_DEBUG("entities.gameobject", "Fishing check (skill: {} zone min skill: {} chance {} roll: {}", skill, zone_skill, chance, roll);
if (sScriptMgr->OnUpdateFishingSkill(player, skill, zone_skill, chance, roll)) if (sScriptMgr->OnPlayerUpdateFishingSkill(player, skill, zone_skill, chance, roll))
{ {
player->UpdateFishingSkill(); player->UpdateFishingSkill();
} }
+3 -3
View File
@@ -237,7 +237,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
return false; return false;
bool forceLoadFromDB = false; bool forceLoadFromDB = false;
sScriptMgr->OnBeforeLoadPetFromDB(owner, petEntry, petnumber, current, forceLoadFromDB); sScriptMgr->OnPlayerBeforeLoadPetFromDB(owner, petEntry, petnumber, current, forceLoadFromDB);
if (!forceLoadFromDB && (owner->IsClass(CLASS_DEATH_KNIGHT, CLASS_CONTEXT_PET) && !owner->CanSeeDKPet())) // DK Pet exception if (!forceLoadFromDB && (owner->IsClass(CLASS_DEATH_KNIGHT, CLASS_CONTEXT_PET) && !owner->CanSeeDKPet())) // DK Pet exception
return false; return false;
@@ -1033,7 +1033,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
PetType petType = MAX_PET_TYPE; PetType petType = MAX_PET_TYPE;
if (owner->IsPlayer()) if (owner->IsPlayer())
{ {
sScriptMgr->OnBeforeGuardianInitStatsForLevel(owner->ToPlayer(), this, cinfo, petType); sScriptMgr->OnPlayerBeforeGuardianInitStatsForLevel(owner->ToPlayer(), this, cinfo, petType);
if (IsPet()) if (IsPet())
{ {
@@ -1427,7 +1427,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
if (owner->IsPlayer()) if (owner->IsPlayer())
sScriptMgr->OnAfterGuardianInitStatsForLevel(owner->ToPlayer(), this); sScriptMgr->OnPlayerAfterGuardianInitStatsForLevel(owner->ToPlayer(), this);
return true; return true;
} }
@@ -167,7 +167,7 @@ void KillRewarder::_RewardXP(Player* player, float rate)
AddPct(xp, (*i)->GetAmount()); AddPct(xp, (*i)->GetAmount());
// 4.2.3. Give XP to player. // 4.2.3. Give XP to player.
sScriptMgr->OnGivePlayerXP(player, xp, _victim, PlayerXPSource::XPSOURCE_KILL); sScriptMgr->OnPlayerGiveXP(player, xp, _victim, PlayerXPSource::XPSOURCE_KILL);
player->GiveXP(xp, _victim, _groupRate); player->GiveXP(xp, _victim, _groupRate);
if (Pet* pet = player->GetPet()) if (Pet* pet = player->GetPet())
// 4.2.4. If player has pet, reward pet with XP (100% for single player, 50% for group case). // 4.2.4. If player has pet, reward pet with XP (100% for single player, 50% for group case).
@@ -210,7 +210,7 @@ void KillRewarder::_RewardPlayer(Player* player, bool isDungeon)
if (!_isPvP || _isBattleGround) if (!_isPvP || _isBattleGround)
{ {
float xpRate = _group ? _groupRate * float(player->GetLevel()) / _aliveSumLevel : /*Personal rate is 100%.*/ 1.0f; // Group rate depends on the sum of levels. float xpRate = _group ? _groupRate * float(player->GetLevel()) / _aliveSumLevel : /*Personal rate is 100%.*/ 1.0f; // Group rate depends on the sum of levels.
sScriptMgr->OnRewardKillRewarder(player, this, isDungeon, xpRate); // Personal rate is 100%. sScriptMgr->OnPlayerRewardKillRewarder(player, this, isDungeon, xpRate); // Personal rate is 100%.
if (_xp) if (_xp)
{ {
+56 -56
View File
@@ -1430,7 +1430,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
if (duel && GetMapId() != mapid && GetMap()->GetGameObject(GetGuidValue(PLAYER_DUEL_ARBITER))) if (duel && GetMapId() != mapid && GetMap()->GetGameObject(GetGuidValue(PLAYER_DUEL_ARBITER)))
DuelComplete(DUEL_FLED); DuelComplete(DUEL_FLED);
if (!sScriptMgr->OnBeforePlayerTeleport(this, mapid, x, y, z, orientation, options, target)) if (!sScriptMgr->OnPlayerBeforeTeleport(this, mapid, x, y, z, orientation, options, target))
return false; return false;
if (GetMapId() == mapid && !newInstance) if (GetMapId() == mapid && !newInstance)
@@ -2247,7 +2247,7 @@ void Player::SetGameMaster(bool on)
if (HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP)) if (HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
{ {
RemoveByteFlag(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);
} }
ResetContestedPvP(); ResetContestedPvP();
@@ -2284,7 +2284,7 @@ void Player::SetGameMaster(bool on)
if (!HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP)) if (!HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
{ {
SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
sScriptMgr->OnFfaPvpStateUpdate(this, true); sScriptMgr->OnPlayerFfaPvpStateUpdate(this, true);
} }
} }
// restore FFA PvP area state, remove not allowed for GM mounts // restore FFA PvP area state, remove not allowed for GM mounts
@@ -2548,7 +2548,7 @@ void Player::GiveLevel(uint8 level)
pet->SynchronizeLevelWithOwner(); pet->SynchronizeLevelWithOwner();
MailLevelReward const* mailReward = sObjectMgr->GetMailLevelReward(level, getRaceMask()); MailLevelReward const* mailReward = sObjectMgr->GetMailLevelReward(level, getRaceMask());
if (mailReward && sScriptMgr->CanGiveMailRewardAtGiveLevel(this, level)) if (mailReward && sScriptMgr->OnPlayerCanGiveMailRewardAtGiveLevel(this, level))
{ {
//- TODO: Poor design of mail system //- TODO: Poor design of mail system
CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction(); CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
@@ -2606,7 +2606,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
sObjectMgr->GetPlayerLevelInfo(getRace(true), getClass(), GetLevel(), &info); sObjectMgr->GetPlayerLevelInfo(getRace(true), getClass(), GetLevel(), &info);
uint32 maxPlayerLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); uint32 maxPlayerLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
sScriptMgr->OnSetMaxLevel(this, maxPlayerLevel); sScriptMgr->OnPlayerSetMaxLevel(this, maxPlayerLevel);
SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, maxPlayerLevel); SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, maxPlayerLevel);
SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr->GetXPForLevel(GetLevel())); SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr->GetXPForLevel(GetLevel()));
@@ -2738,7 +2738,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
if (HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP)) if (HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
{ {
RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP | UNIT_BYTE2_FLAG_SANCTUARY); RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP | UNIT_BYTE2_FLAG_SANCTUARY);
sScriptMgr->OnFfaPvpStateUpdate(this, false); sScriptMgr->OnPlayerFfaPvpStateUpdate(this, false);
} }
// restore if need some important flags // restore if need some important flags
@@ -4302,7 +4302,7 @@ void Player::DeleteFromDB(ObjectGuid::LowType lowGuid, uint32 accountId, bool up
Corpse::DeleteFromDB(playerGuid, trans); Corpse::DeleteFromDB(playerGuid, trans);
sScriptMgr->OnDeleteFromDB(trans, lowGuid); sScriptMgr->OnPlayerDeleteFromDB(trans, lowGuid);
CharacterDatabase.CommitTransaction(trans); CharacterDatabase.CommitTransaction(trans);
break; break;
@@ -4493,7 +4493,7 @@ void Player::BuildPlayerRepop()
void Player::ResurrectPlayer(float restore_percent, bool applySickness) void Player::ResurrectPlayer(float restore_percent, bool applySickness)
{ {
if (!sScriptMgr->CanPlayerResurrect(this)) if (!sScriptMgr->OnPlayerCanResurrect(this))
return; return;
WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4 * 4); // remove spirit healer position WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4 * 4); // remove spirit healer position
@@ -4946,7 +4946,7 @@ void Player::RepopAtGraveyard()
AreaTableEntry const* zone = sAreaTableStore.LookupEntry(GetAreaId()); AreaTableEntry const* zone = sAreaTableStore.LookupEntry(GetAreaId());
if (!sScriptMgr->CanRepopAtGraveyard(this)) if (!sScriptMgr->OnPlayerCanRepopAtGraveyard(this))
return; return;
// Such zones are considered unreachable as a ghost and the player must be automatically revived // Such zones are considered unreachable as a ghost and the player must be automatically revived
@@ -5499,7 +5499,7 @@ uint16 Player::GetMaxSkillValue(uint32 skill) const
uint32 bonus = GetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos)); uint32 bonus = GetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos));
int32 result = int32(SKILL_MAX(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos)))); int32 result = int32(SKILL_MAX(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos))));
sScriptMgr->OnGetMaxSkillValue(const_cast<Player*>(this), skill, result, false); sScriptMgr->OnPlayerGetMaxSkillValue(const_cast<Player*>(this), skill, result, false);
result += SKILL_TEMP_BONUS(bonus); result += SKILL_TEMP_BONUS(bonus);
result += SKILL_PERM_BONUS(bonus); result += SKILL_PERM_BONUS(bonus);
return result < 0 ? 0 : result; return result < 0 ? 0 : result;
@@ -5516,7 +5516,7 @@ uint16 Player::GetPureMaxSkillValue(uint32 skill) const
int32 result = int32(SKILL_MAX(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos)))); int32 result = int32(SKILL_MAX(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos))));
sScriptMgr->OnGetMaxSkillValue(const_cast<Player*>(this), skill, result, true); sScriptMgr->OnPlayerGetMaxSkillValue(const_cast<Player*>(this), skill, result, true);
return result < 0 ? 0 : result; return result < 0 ? 0 : result;
} }
@@ -5795,7 +5795,7 @@ void Player::CheckAreaExploreAndOutdoor()
} }
} }
if (!sScriptMgr->CanAreaExploreAndOutdoor(this)) if (!sScriptMgr->OnPlayerCanAreaExploreAndOutdoor(this))
return; return;
if (!areaId) if (!areaId)
@@ -5854,7 +5854,7 @@ void Player::CheckAreaExploreAndOutdoor()
XP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level) * sWorld->getRate(RATE_XP_EXPLORE)); XP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level) * sWorld->getRate(RATE_XP_EXPLORE));
} }
sScriptMgr->OnGivePlayerXP(this, XP, nullptr, PlayerXPSource::XPSOURCE_EXPLORE); sScriptMgr->OnPlayerGiveXP(this, XP, nullptr, PlayerXPSource::XPSOURCE_EXPLORE);
GiveXP(XP, nullptr); GiveXP(XP, nullptr);
SendExplorationExperience(areaId, XP); SendExplorationExperience(areaId, XP);
} }
@@ -6165,7 +6165,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
// [39+] Nothing // [39+] Nothing
uint32 victim_title = victim->GetUInt32Value(PLAYER_CHOSEN_TITLE); uint32 victim_title = victim->GetUInt32Value(PLAYER_CHOSEN_TITLE);
uint32 killer_title = 0; uint32 killer_title = 0;
sScriptMgr->OnVictimRewardBefore(this, victim, killer_title, victim_title); sScriptMgr->OnPlayerVictimRewardBefore(this, victim, killer_title, victim_title);
// Get Killer titles, CharTitlesEntry::bit_index // Get Killer titles, CharTitlesEntry::bit_index
// Ranks: // Ranks:
// title[1..14] -> rank[5..18] // title[1..14] -> rank[5..18]
@@ -6192,7 +6192,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA, GetAreaId()); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA, GetAreaId());
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, 1, 0, victim); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, 1, 0, victim);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL, 1, 0, victim); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL, 1, 0, victim);
sScriptMgr->OnVictimRewardAfter(this, victim, killer_title, victim_rank, honor_f); sScriptMgr->OnPlayerVictimRewardAfter(this, victim, killer_title, victim_rank, honor_f);
} }
else else
{ {
@@ -6244,7 +6244,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
if (!uVictim) if (!uVictim)
{ {
uint32 xp = uint32(honor * (3 + GetLevel() * 0.30f)); uint32 xp = uint32(honor * (3 + GetLevel() * 0.30f));
sScriptMgr->OnGivePlayerXP(this, xp, nullptr, PlayerXPSource::XPSOURCE_BATTLEGROUND); sScriptMgr->OnPlayerGiveXP(this, xp, nullptr, PlayerXPSource::XPSOURCE_BATTLEGROUND);
GiveXP(xp, nullptr); GiveXP(xp, nullptr);
} }
} }
@@ -6638,7 +6638,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
uint32 ssd_level = GetLevel(); uint32 ssd_level = GetLevel();
uint32 CustomScalingStatValue = 0; uint32 CustomScalingStatValue = 0;
sScriptMgr->OnCustomScalingStatValueBefore(this, proto, slot, apply, CustomScalingStatValue); sScriptMgr->OnPlayerCustomScalingStatValueBefore(this, proto, slot, apply, CustomScalingStatValue);
uint32 ScalingStatValue = proto->ScalingStatValue > 0 ? proto->ScalingStatValue : CustomScalingStatValue; uint32 ScalingStatValue = proto->ScalingStatValue > 0 ? proto->ScalingStatValue : CustomScalingStatValue;
@@ -6670,7 +6670,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
continue; continue;
// OnCustomScalingStatValue(Player* player, ItemTemplate const* proto, uint32& statType, int32& val, uint8 itemProtoStatNumber, uint32 ScalingStatValue, ScalingStatValuesEntry const* ssv) // OnCustomScalingStatValue(Player* player, ItemTemplate const* proto, uint32& statType, int32& val, uint8 itemProtoStatNumber, uint32 ScalingStatValue, ScalingStatValuesEntry const* ssv)
sScriptMgr->OnCustomScalingStatValue(this, proto, statType, val, i, ScalingStatValue, ssv); sScriptMgr->OnPlayerCustomScalingStatValue(this, proto, statType, val, i, ScalingStatValue, ssv);
} }
} }
else else
@@ -6681,7 +6681,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
statType = proto->ItemStat[i].ItemStatType; statType = proto->ItemStat[i].ItemStatType;
val = proto->ItemStat[i].ItemStatValue; val = proto->ItemStat[i].ItemStatValue;
sScriptMgr->OnApplyItemModsBefore(this, slot, apply, i, statType, val); sScriptMgr->OnPlayerApplyItemModsBefore(this, slot, apply, i, statType, val);
} }
if (val == 0) if (val == 0)
@@ -6872,7 +6872,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
} }
// Add armor bonus from ArmorDamageModifier if > 0 // Add armor bonus from ArmorDamageModifier if > 0
if (proto->ArmorDamageModifier > 0 && sScriptMgr->CanArmorDamageModifier(this)) if (proto->ArmorDamageModifier > 0 && sScriptMgr->OnPlayerCanArmorDamageModifier(this))
HandleStatModifier(UNIT_MOD_ARMOR, TOTAL_VALUE, float(proto->ArmorDamageModifier), apply); HandleStatModifier(UNIT_MOD_ARMOR, TOTAL_VALUE, float(proto->ArmorDamageModifier), apply);
if (proto->Block) if (proto->Block)
@@ -6914,7 +6914,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
} }
feral_bonus += proto->getFeralBonus(dpsMod); feral_bonus += proto->getFeralBonus(dpsMod);
sScriptMgr->OnGetFeralApBonus(this, feral_bonus, dpsMod, proto, ssv); sScriptMgr->OnPlayerGetFeralApBonus(this, feral_bonus, dpsMod, proto, ssv);
if (feral_bonus) if (feral_bonus)
ApplyFeralAPBonus(feral_bonus, apply); ApplyFeralAPBonus(feral_bonus, apply);
} }
@@ -6924,7 +6924,7 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt
{ {
uint32 CustomScalingStatValue = 0; uint32 CustomScalingStatValue = 0;
sScriptMgr->OnCustomScalingStatValueBefore(this, proto, slot, apply, CustomScalingStatValue); sScriptMgr->OnPlayerCustomScalingStatValueBefore(this, proto, slot, apply, CustomScalingStatValue);
uint32 ScalingStatValue = proto->ScalingStatValue > 0 ? proto->ScalingStatValue : CustomScalingStatValue; uint32 ScalingStatValue = proto->ScalingStatValue > 0 ? proto->ScalingStatValue : CustomScalingStatValue;
@@ -6970,7 +6970,7 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt
if (apply) if (apply)
{ {
sScriptMgr->OnApplyWeaponDamage(this, slot, proto, minDamage, maxDamage, i); sScriptMgr->OnPlayerApplyWeaponDamage(this, slot, proto, minDamage, maxDamage, i);
if (minDamage > 0.f) if (minDamage > 0.f)
{ {
@@ -7052,7 +7052,7 @@ void Player::_ApplyWeaponDependentAuraCritMod(Item* item, WeaponAttackType attac
if (aura->GetSpellInfo()->EquippedItemClass == -1) if (aura->GetSpellInfo()->EquippedItemClass == -1)
return; return;
if (!sScriptMgr->CanApplyWeaponDependentAuraDamageMod(this, item, attackType, aura, apply)) if (!sScriptMgr->OnPlayerCanApplyWeaponDependentAuraDamageMod(this, item, attackType, aura, apply))
return; return;
BaseModGroup mod = BASEMOD_END; BaseModGroup mod = BASEMOD_END;
@@ -7186,7 +7186,7 @@ void Player::ApplyEquipSpell(SpellInfo const* spellInfo, Item* item, bool apply,
{ {
if (apply) if (apply)
{ {
if (!sScriptMgr->CanApplyEquipSpell(this, spellInfo, item, apply, form_change)) if (!sScriptMgr->OnPlayerCanApplyEquipSpell(this, spellInfo, item, apply, form_change))
return; return;
// Cannot be used in this stance/form // Cannot be used in this stance/form
@@ -7282,7 +7282,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 procVictim, uint32 procEx, Item* item, ItemTemplate const* proto) void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 procVictim, uint32 procEx, Item* item, ItemTemplate const* proto)
{ {
if (!sScriptMgr->CanCastItemCombatSpell(this, target, attType, procVictim, procEx, item, proto)) if (!sScriptMgr->OnPlayerCanCastItemCombatSpell(this, target, attType, procVictim, procEx, item, proto))
return; return;
// Can do effect if any damage done to target // Can do effect if any damage done to target
@@ -7414,7 +7414,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 cast_count, uint32 glyphIndex) void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 cast_count, uint32 glyphIndex)
{ {
if (!sScriptMgr->CanCastItemUseSpell(this, item, targets, cast_count, glyphIndex)) if (!sScriptMgr->OnPlayerCanCastItemUseSpell(this, item, targets, cast_count, glyphIndex))
return; return;
ItemTemplate const* proto = item->GetTemplate(); ItemTemplate const* proto = item->GetTemplate();
@@ -7679,7 +7679,7 @@ void Player::_ApplyAmmoBonuses()
else else
currentAmmoDPS = (ammo_proto->Damage[0].DamageMin + ammo_proto->Damage[0].DamageMax) / 2; currentAmmoDPS = (ammo_proto->Damage[0].DamageMin + ammo_proto->Damage[0].DamageMax) / 2;
sScriptMgr->OnApplyAmmoBonuses(this, ammo_proto, currentAmmoDPS); sScriptMgr->OnPlayerApplyAmmoBonuses(this, ammo_proto, currentAmmoDPS);
if (currentAmmoDPS == GetAmmoDPS()) if (currentAmmoDPS == GetAmmoDPS())
return; return;
@@ -9377,7 +9377,7 @@ void Player::StopCastingCharm(Aura* except /*= nullptr*/)
void Player::Say(std::string_view text, Language language, WorldObject const* /*= nullptr*/) void Player::Say(std::string_view text, Language language, WorldObject const* /*= nullptr*/)
{ {
std::string _text(text); std::string _text(text);
if (!sScriptMgr->CanPlayerUseChat(this, CHAT_MSG_SAY, language, _text)) if (!sScriptMgr->OnPlayerCanUseChat(this, CHAT_MSG_SAY, language, _text))
{ {
return; return;
} }
@@ -9398,7 +9398,7 @@ void Player::Yell(std::string_view text, Language language, WorldObject const* /
{ {
std::string _text(text); std::string _text(text);
if (!sScriptMgr->CanPlayerUseChat(this, CHAT_MSG_YELL, language, _text)) if (!sScriptMgr->OnPlayerCanUseChat(this, CHAT_MSG_YELL, language, _text))
{ {
return; return;
} }
@@ -9419,7 +9419,7 @@ void Player::TextEmote(std::string_view text, WorldObject const* /*= nullptr*/,
{ {
std::string _text(text); std::string _text(text);
if (!sScriptMgr->CanPlayerUseChat(this, CHAT_MSG_EMOTE, LANG_UNIVERSAL, _text)) if (!sScriptMgr->OnPlayerCanUseChat(this, CHAT_MSG_EMOTE, LANG_UNIVERSAL, _text))
{ {
return; return;
} }
@@ -9448,7 +9448,7 @@ void Player::Whisper(std::string_view text, Language language, Player* target, b
std::string _text(text); std::string _text(text);
if (!sScriptMgr->CanPlayerUseChat(this, CHAT_MSG_WHISPER, language, _text, target)) if (!sScriptMgr->OnPlayerCanUseChat(this, CHAT_MSG_WHISPER, language, _text, target))
{ {
return; return;
} }
@@ -10712,7 +10712,7 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c
} }
} }
sScriptMgr->OnBeforeStoreOrEquipNewItem(this, vendorslot, item, count, bag, slot, pProto, pVendor, crItem, bStore); sScriptMgr->OnPlayerBeforeStoreOrEquipNewItem(this, vendorslot, item, count, bag, slot, pProto, pVendor, crItem, bStore);
Item* it = bStore ? StoreNewItem(vDest, item, true) : EquipNewItem(uiDest, item, true); Item* it = bStore ? StoreNewItem(vDest, item, true) : EquipNewItem(uiDest, item, true);
if (it) if (it)
@@ -10741,7 +10741,7 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c
} }
} }
sScriptMgr->OnAfterStoreOrEquipNewItem(this, vendorslot, it, count, bag, slot, pProto, pVendor, crItem, bStore); sScriptMgr->OnPlayerAfterStoreOrEquipNewItem(this, vendorslot, it, count, bag, slot, pProto, pVendor, crItem, bStore);
return true; return true;
} }
@@ -10749,7 +10749,7 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c
// Return true is the bought item has a max count to force refresh of window by caller // Return true is the bought item has a max count to force refresh of window by caller
bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot) bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot)
{ {
sScriptMgr->OnBeforeBuyItemFromVendor(this, vendorguid, vendorslot, item, count, bag, slot); sScriptMgr->OnPlayerBeforeBuyItemFromVendor(this, vendorguid, vendorslot, item, count, bag, slot);
// this check can be used from the hook to implement a custom vendor process // this check can be used from the hook to implement a custom vendor process
if (item == 0) if (item == 0)
@@ -10941,7 +10941,7 @@ uint32 Player::GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot) const
} }
} }
sScriptMgr->OnGetMaxPersonalArenaRatingRequirement(this, minarenaslot, max_personal_rating); sScriptMgr->OnPlayerGetMaxPersonalArenaRatingRequirement(this, minarenaslot, max_personal_rating);
return max_personal_rating; return max_personal_rating;
} }
@@ -11375,11 +11375,11 @@ void Player::LeaveBattleground(Battleground* bg)
stmt->SetData(1, BG_DESERTION_TYPE_LEAVE_BG); stmt->SetData(1, BG_DESERTION_TYPE_LEAVE_BG);
CharacterDatabase.Execute(stmt); CharacterDatabase.Execute(stmt);
} }
sScriptMgr->OnBattlegroundDesertion(this, BG_DESERTION_TYPE_LEAVE_BG); sScriptMgr->OnPlayerBattlegroundDesertion(this, BG_DESERTION_TYPE_LEAVE_BG);
} }
if (bg->isArena() && (bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN)) if (bg->isArena() && (bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN))
sScriptMgr->OnBattlegroundDesertion(this, ARENA_DESERTION_TYPE_LEAVE_BG); sScriptMgr->OnPlayerBattlegroundDesertion(this, ARENA_DESERTION_TYPE_LEAVE_BG);
// xinef: reset corpse reclaim time // xinef: reset corpse reclaim time
m_deathExpireTime = GameTime::GetGameTime().count(); m_deathExpireTime = GameTime::GetGameTime().count();
@@ -11539,7 +11539,7 @@ bool Player::IsVisibleGloballyFor(Player const* u) const
if (!AccountMgr::IsPlayerAccount(u->GetSession()->GetSecurity())) if (!AccountMgr::IsPlayerAccount(u->GetSession()->GetSecurity()))
return GetSession()->GetSecurity() <= u->GetSession()->GetSecurity(); return GetSession()->GetSecurity() <= u->GetSession()->GetSecurity();
if (!sScriptMgr->NotVisibleGloballyFor(const_cast<Player*>(this), u)) if (!sScriptMgr->OnPlayerNotVisibleGloballyFor(const_cast<Player*>(this), u))
return true; return true;
// non faction visibility non-breakable for non-GMs // non faction visibility non-breakable for non-GMs
@@ -11668,7 +11668,7 @@ void Player::SendInitialPacketsBeforeAddToMap()
SetMover(this); SetMover(this);
sScriptMgr->OnSendInitialPacketsBeforeAddToMap(this, data); sScriptMgr->OnPlayerSendInitialPacketsBeforeAddToMap(this, data);
} }
void Player::SendInitialPacketsAfterAddToMap() void Player::SendInitialPacketsAfterAddToMap()
@@ -13560,7 +13560,7 @@ LootItem* Player::StoreLootItem(uint8 lootSlot, Loot* loot, InventoryResult& msg
LootItem* item = loot->LootItemInSlot(lootSlot, this, &qitem, &ffaitem, &conditem); LootItem* item = loot->LootItemInSlot(lootSlot, this, &qitem, &ffaitem, &conditem);
if (!item || item->is_looted) if (!item || item->is_looted)
{ {
if (!sScriptMgr->CanSendErrorAlreadyLooted(this)) if (!sScriptMgr->OnPlayerCanSendErrorAlreadyLooted(this))
{ {
SendEquipError(EQUIP_ERR_ALREADY_LOOTED, nullptr, nullptr); SendEquipError(EQUIP_ERR_ALREADY_LOOTED, nullptr, nullptr);
} }
@@ -13642,7 +13642,7 @@ LootItem* Player::StoreLootItem(uint8 lootSlot, Loot* loot, InventoryResult& msg
if (loot->containerGUID) if (loot->containerGUID)
sLootItemStorage->RemoveStoredLootItem(loot->containerGUID, item->itemid, item->count, loot, item->itemIndex); sLootItemStorage->RemoveStoredLootItem(loot->containerGUID, item->itemid, item->count, loot, item->itemIndex);
sScriptMgr->OnLootItem(this, newitem, item->count, this->GetLootGUID()); sScriptMgr->OnPlayerLootItem(this, newitem, item->count, this->GetLootGUID());
} }
else else
{ {
@@ -13673,13 +13673,13 @@ uint32 Player::CalculateTalentsPoints() const
} }
talentPointsForLevel += m_extraBonusTalentCount; talentPointsForLevel += m_extraBonusTalentCount;
sScriptMgr->OnCalculateTalentsPoints(this, talentPointsForLevel); sScriptMgr->OnPlayerCalculateTalentsPoints(this, talentPointsForLevel);
return uint32(talentPointsForLevel * sWorld->getRate(RATE_TALENT)); return uint32(talentPointsForLevel * sWorld->getRate(RATE_TALENT));
} }
bool Player::canFlyInZone(uint32 mapid, uint32 zone, SpellInfo const* bySpell) bool Player::canFlyInZone(uint32 mapid, uint32 zone, SpellInfo const* bySpell)
{ {
if (!sScriptMgr->OnCanPlayerFlyInZone(this, mapid,zone,bySpell)) if (!sScriptMgr->OnPlayerCanFlyInZone(this, mapid,zone,bySpell))
{ {
return false; return false;
} }
@@ -15300,7 +15300,7 @@ void Player::ActivateSpec(uint8 spec)
++iter; ++iter;
} }
sScriptMgr->OnAfterSpecSlotChanged(this, GetActiveSpec()); sScriptMgr->OnPlayerAfterSpecSlotChanged(this, GetActiveSpec());
} }
void Player::LoadActions(PreparedQueryResult result) void Player::LoadActions(PreparedQueryResult result)
@@ -15397,7 +15397,7 @@ void Player::SetIsSpectator(bool on)
if (HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP)) if (HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
{ {
RemoveByteFlag(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);
} }
ResetContestedPvP(); ResetContestedPvP();
SetDisplayId(23691); SetDisplayId(23691);
@@ -15422,7 +15422,7 @@ void Player::SetIsSpectator(bool on)
if (!HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP)) if (!HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
{ {
SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
sScriptMgr->OnFfaPvpStateUpdate(this, true); sScriptMgr->OnPlayerFfaPvpStateUpdate(this, true);
} }
} }
@@ -16227,7 +16227,7 @@ uint32 Player::DoRandomRoll(uint32 minimum, uint32 maximum)
void Player::SetArenaTeamInfoField(uint8 slot, ArenaTeamInfoType type, uint32 value) void Player::SetArenaTeamInfoField(uint8 slot, ArenaTeamInfoType type, uint32 value)
{ {
if (sScriptMgr->NotSetArenaTeamInfoField(this, slot, type, value)) if (sScriptMgr->OnPlayerNotSetArenaTeamInfoField(this, slot, type, value))
SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + type, value); SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + type, value);
} }
@@ -16235,7 +16235,7 @@ uint32 Player::GetArenaPersonalRating(uint8 slot) const
{ {
uint32 result = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING); uint32 result = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING);
sScriptMgr->OnGetArenaPersonalRating(const_cast<Player*>(this), slot, result); sScriptMgr->OnPlayerGetArenaPersonalRating(const_cast<Player*>(this), slot, result);
return result; return result;
} }
@@ -16244,7 +16244,7 @@ uint32 Player::GetArenaTeamId(uint8 slot) const
{ {
uint32 result = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_ID); uint32 result = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_ID);
sScriptMgr->OnGetArenaTeamId(const_cast<Player*>(this), slot, result); sScriptMgr->OnPlayerGetArenaTeamId(const_cast<Player*>(this), slot, result);
return result; return result;
} }
@@ -16253,7 +16253,7 @@ bool Player::IsFFAPvP()
{ {
bool result = Unit::IsFFAPvP(); bool result = Unit::IsFFAPvP();
sScriptMgr->OnIsFFAPvP(this, result); sScriptMgr->OnPlayerIsFFAPvP(this, result);
return result; return result;
} }
@@ -16262,7 +16262,7 @@ bool Player::IsPvP()
{ {
bool result = Unit::IsPvP(); bool result = Unit::IsPvP();
sScriptMgr->OnIsPvP(this, result); sScriptMgr->OnPlayerIsPvP(this, result);
return result; return result;
} }
@@ -16271,7 +16271,7 @@ uint16 Player::GetMaxSkillValueForLevel() const
{ {
uint16 result = Unit::GetMaxSkillValueForLevel(); uint16 result = Unit::GetMaxSkillValueForLevel();
sScriptMgr->OnGetMaxSkillValueForLevel(const_cast<Player*>(this), result); sScriptMgr->OnPlayerGetMaxSkillValueForLevel(const_cast<Player*>(this), result);
return result; return result;
} }
@@ -16280,21 +16280,21 @@ float Player::GetQuestRate(bool isDFQuest)
{ {
float result = isDFQuest ? sWorld->getRate(RATE_XP_QUEST_DF) : sWorld->getRate(RATE_XP_QUEST); float result = isDFQuest ? sWorld->getRate(RATE_XP_QUEST_DF) : sWorld->getRate(RATE_XP_QUEST);
sScriptMgr->OnGetQuestRate(this, result); sScriptMgr->OnPlayerGetQuestRate(this, result);
return result; return result;
} }
void Player::SetServerSideVisibility(ServerSideVisibilityType type, AccountTypes sec) void Player::SetServerSideVisibility(ServerSideVisibilityType type, AccountTypes sec)
{ {
sScriptMgr->OnSetServerSideVisibility(this, type, sec); sScriptMgr->OnPlayerSetServerSideVisibility(this, type, sec);
m_serverSideVisibility.SetValue(type, sec); m_serverSideVisibility.SetValue(type, sec);
} }
void Player::SetServerSideVisibilityDetect(ServerSideVisibilityType type, AccountTypes sec) void Player::SetServerSideVisibilityDetect(ServerSideVisibilityType type, AccountTypes sec)
{ {
sScriptMgr->OnSetServerSideVisibilityDetect(this, type, sec); sScriptMgr->OnPlayerSetServerSideVisibilityDetect(this, type, sec);
m_serverSideVisibilityDetect.SetValue(type, sec); m_serverSideVisibilityDetect.SetValue(type, sec);
} }
@@ -399,7 +399,7 @@ void Player::UpdateFFAPvPFlag(time_t currTime)
if (HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP)) if (HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
{ {
RemoveByteFlag(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) for (ControlSet::iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
(*itr)->RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); (*itr)->RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
@@ -602,7 +602,7 @@ void Player::CompleteQuest(uint32 quest_id)
return; return;
} }
if (!sScriptMgr->OnBeforePlayerQuestComplete(this, quest_id)) if (!sScriptMgr->OnPlayerBeforeQuestComplete(this, quest_id))
{ {
return; return;
} }
@@ -699,7 +699,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
Item* item = StoreNewItem(dest, itemId, true); Item* item = StoreNewItem(dest, itemId, true);
SendNewItem(item, quest->RewardChoiceItemCount[reward], true, false, false, false); SendNewItem(item, quest->RewardChoiceItemCount[reward], true, false, false, false);
sScriptMgr->OnQuestRewardItem(this, item, quest->RewardChoiceItemCount[reward]); sScriptMgr->OnPlayerQuestRewardItem(this, item, quest->RewardChoiceItemCount[reward]);
} }
else else
{ {
@@ -720,7 +720,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
Item* item = StoreNewItem(dest, itemId, true); Item* item = StoreNewItem(dest, itemId, true);
SendNewItem(item, quest->RewardItemIdCount[i], true, false, false, false); SendNewItem(item, quest->RewardItemIdCount[i], true, false, false, false);
sScriptMgr->OnQuestRewardItem(this, item, quest->RewardItemIdCount[i]); sScriptMgr->OnPlayerQuestRewardItem(this, item, quest->RewardItemIdCount[i]);
} }
else else
problematicItems.emplace_back(itemId, quest->RewardItemIdCount[i]); problematicItems.emplace_back(itemId, quest->RewardItemIdCount[i]);
@@ -745,15 +745,15 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
// Not give XP in case already completed once repeatable quest // Not give XP in case already completed once repeatable quest
uint32 XP = rewarded ? 0 : CalculateQuestRewardXP(quest); uint32 XP = rewarded ? 0 : CalculateQuestRewardXP(quest);
sScriptMgr->OnQuestComputeXP(this, quest, XP); sScriptMgr->OnPlayerQuestComputeXP(this, quest, XP);
int32 moneyRew = 0; int32 moneyRew = 0;
if (GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(this)) if (GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->OnPlayerShouldBeRewardedWithMoneyInsteadOfExp(this))
{ {
moneyRew = quest->GetRewMoneyMaxLevel(); moneyRew = quest->GetRewMoneyMaxLevel();
} }
else else
{ {
sScriptMgr->OnGivePlayerXP(this, XP, nullptr, isLFGReward ? PlayerXPSource::XPSOURCE_QUEST_DF : PlayerXPSource::XPSOURCE_QUEST); sScriptMgr->OnPlayerGiveXP(this, XP, nullptr, isLFGReward ? PlayerXPSource::XPSOURCE_QUEST_DF : PlayerXPSource::XPSOURCE_QUEST);
GiveXP(XP, nullptr, 1.0f, isLFGReward); GiveXP(XP, nullptr, 1.0f, isLFGReward);
} }
@@ -1953,7 +1953,7 @@ void Player::KilledMonsterCredit(uint32 entry, ObjectGuid guid)
if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid(GetMap()->GetDifficulty()) || if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid(GetMap()->GetDifficulty()) ||
(qInfo->IsPVPQuest() && (GetGroup()->isBFGroup() || GetGroup()->isBGGroup())))) (qInfo->IsPVPQuest() && (GetGroup()->isBFGroup() || GetGroup()->isBGGroup()))))
{ {
if (!sScriptMgr->PassedQuestKilledMonsterCredit(this, qInfo, entry, real_entry, guid)) if (!sScriptMgr->OnPlayerPassedQuestKilledMonsterCredit(this, qInfo, entry, real_entry, guid))
continue; continue;
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL) /*&& !qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_CAST)*/) if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL) /*&& !qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_CAST)*/)
@@ -1811,7 +1811,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16& dest, Item* pItem, bool
ItemTemplate const* pProto = pItem->GetTemplate(); ItemTemplate const* pProto = pItem->GetTemplate();
if (pProto) if (pProto)
{ {
if (!sScriptMgr->CanEquipItem(const_cast<Player*>(this), slot, dest, pItem, swap, not_loading)) if (!sScriptMgr->OnPlayerCanEquipItem(const_cast<Player*>(this), slot, dest, pItem, swap, not_loading))
return EQUIP_ERR_CANT_DO_RIGHT_NOW; return EQUIP_ERR_CANT_DO_RIGHT_NOW;
// item used // item used
@@ -1983,7 +1983,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16& dest, Item* pItem, bool
InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const
{ {
if (!sScriptMgr->CanUnequipItem(const_cast<Player*>(this), pos, swap)) if (!sScriptMgr->OnPlayerCanUnequipItem(const_cast<Player*>(this), pos, swap))
return EQUIP_ERR_CANT_DO_RIGHT_NOW; return EQUIP_ERR_CANT_DO_RIGHT_NOW;
// Applied only to equipped items and bank bags // Applied only to equipped items and bank bags
@@ -2326,7 +2326,7 @@ InventoryResult Player::CanUseItem(ItemTemplate const* proto) const
InventoryResult result = EQUIP_ERR_OK; InventoryResult result = EQUIP_ERR_OK;
if (!sScriptMgr->CanUseItem(const_cast<Player*>(this), proto, result)) if (!sScriptMgr->OnPlayerCanUseItem(const_cast<Player*>(this), proto, result))
{ {
return result; return result;
} }
@@ -2566,7 +2566,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update
CharacterDatabase.Execute(stmt); CharacterDatabase.Execute(stmt);
} }
sScriptMgr->OnStoreNewItem(this, pItem, count); sScriptMgr->OnPlayerStoreNewItem(this, pItem, count);
} }
return pItem; return pItem;
} }
@@ -2710,7 +2710,7 @@ Item* Player::EquipNewItem(uint16 pos, uint32 item, bool update)
if (!_item) if (!_item)
return nullptr; return nullptr;
if (!IsEquipmentPos(pos) || sScriptMgr->CanSaveEquipNewItem(this, _item, pos, update)) if (!IsEquipmentPos(pos) || sScriptMgr->OnPlayerCanSaveEquipNewItem(this, _item, pos, update))
{ {
// pussywizard: obtaining blue or better items saves to db // pussywizard: obtaining blue or better items saves to db
if (ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item)) if (ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item))
@@ -2819,7 +2819,7 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update)
pItem2->SetState(ITEM_CHANGED, this); pItem2->SetState(ITEM_CHANGED, this);
ApplyEquipCooldown(pItem2); ApplyEquipCooldown(pItem2);
sScriptMgr->OnEquip(this, pItem2, bag, slot, update); sScriptMgr->OnPlayerEquip(this, pItem2, bag, slot, update);
return pItem2; return pItem2;
} }
@@ -2827,7 +2827,7 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update)
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry()); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot);
sScriptMgr->OnEquip(this, pItem, bag, slot, update); sScriptMgr->OnPlayerEquip(this, pItem, bag, slot, update);
UpdateForQuestWorldObjects(); UpdateForQuestWorldObjects();
return pItem; return pItem;
} }
@@ -2851,7 +2851,7 @@ void Player::QuickEquipItem(uint16 pos, Item* pItem)
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry()); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot);
sScriptMgr->OnEquip(this, pItem, (pos >> 8), slot, true); sScriptMgr->OnPlayerEquip(this, pItem, (pos >> 8), slot, true);
} }
} }
@@ -2869,7 +2869,7 @@ void Player::SetVisibleItemSlot(uint8 slot, Item* pItem)
SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 0); SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 0);
} }
sScriptMgr->OnAfterPlayerSetVisibleItemSlot(this, slot, pItem); sScriptMgr->OnPlayerAfterSetVisibleItemSlot(this, slot, pItem);
} }
void Player::VisualizeItem(uint8 slot, Item* pItem) void Player::VisualizeItem(uint8 slot, Item* pItem)
@@ -2990,7 +2990,7 @@ void Player::MoveItemFromInventory(uint8 bag, uint8 slot, bool update)
it->DestroyForPlayer(this); it->DestroyForPlayer(this);
} }
sScriptMgr->OnAfterPlayerMoveItemFromInventory(this, it, bag, slot, update); sScriptMgr->OnPlayerAfterMoveItemFromInventory(this, it, bag, slot, update);
} }
} }
@@ -4326,7 +4326,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
if (pEnchant->requiredSkill > 0 && pEnchant->requiredSkillValue > GetSkillValue(pEnchant->requiredSkill)) if (pEnchant->requiredSkill > 0 && pEnchant->requiredSkillValue > GetSkillValue(pEnchant->requiredSkill))
return; return;
if (!sScriptMgr->CanApplyEnchantment(this, item, slot, apply, apply_dur, ignore_condition)) if (!sScriptMgr->OnPlayerCanApplyEnchantment(this, item, slot, apply, apply_dur, ignore_condition))
return; return;
// If we're dealing with a gem inside a prismatic socket we need to check the prismatic socket requirements // If we're dealing with a gem inside a prismatic socket we need to check the prismatic socket requirements
@@ -4433,7 +4433,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
} }
} }
sScriptMgr->OnApplyEnchantmentItemModsBefore(this, item, slot, apply, enchant_spell_id, enchant_amount); sScriptMgr->OnPlayerApplyEnchantmentItemModsBefore(this, item, slot, apply, enchant_spell_id, enchant_amount);
LOG_DEBUG("entities.player.items", "Adding {} to stat nb {}", enchant_amount, enchant_spell_id); LOG_DEBUG("entities.player.items", "Adding {} to stat nb {}", enchant_amount, enchant_spell_id);
switch (enchant_spell_id) switch (enchant_spell_id)
@@ -5876,7 +5876,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
else if (IsEquipmentPos(INVENTORY_SLOT_BAG_0, slot)) else if (IsEquipmentPos(INVENTORY_SLOT_BAG_0, slot))
{ {
uint16 dest; uint16 dest;
if (sScriptMgr->CheckItemInSlotAtLoadInventory(this, item, slot, err, dest)) if (sScriptMgr->OnPlayerCheckItemInSlotAtLoadInventory(this, item, slot, err, dest))
err = CanEquipItem(slot, dest, item, false, false); err = CanEquipItem(slot, dest, item, false, false);
if (err == EQUIP_ERR_OK) if (err == EQUIP_ERR_OK)
QuickEquipItem(dest, item); QuickEquipItem(dest, item);
@@ -6826,7 +6826,7 @@ bool Player::Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map
|| missingPlayerItems.size() || missingPlayerQuests.size() || missingPlayerAchievements.size() || missingPlayerItems.size() || missingPlayerQuests.size() || missingPlayerAchievements.size()
|| missingLeaderItems.size() || missingLeaderQuests.size() || missingLeaderAchievements.size()) || missingLeaderItems.size() || missingLeaderQuests.size() || missingLeaderAchievements.size())
{ {
if (!sScriptMgr->NotAvoidSatisfy(partyLeader, ar, target_map, report)) if (!sScriptMgr->OnPlayerNotAvoidSatisfy(partyLeader, ar, target_map, report))
return true; return true;
if (report) if (report)
@@ -55,7 +55,7 @@ void Player::Update(uint32 p_time)
if (!IsInWorld()) if (!IsInWorld())
return; return;
sScriptMgr->OnBeforePlayerUpdate(this, p_time); sScriptMgr->OnPlayerBeforeUpdate(this, p_time);
// undelivered mail // undelivered mail
if (m_nextMailDelivereTime && m_nextMailDelivereTime <= GameTime::GetGameTime().count()) if (m_nextMailDelivereTime && m_nextMailDelivereTime <= GameTime::GetGameTime().count())
@@ -708,7 +708,7 @@ void Player::UpdateAllRatings()
// skill+step, checking for max value // skill+step, checking for max value
bool Player::UpdateSkill(uint32 skill_id, uint32 step) 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; return false;
SkillStatusMap::iterator itr = mSkillStatus.find(skill_id); 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 value = SKILL_VALUE(data);
uint32 max = SKILL_MAX(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)) if ((!max) || (!value) || (value >= max))
return false; return false;
@@ -768,7 +768,7 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue,
uint32 gathering_skill_gain = uint32 gathering_skill_gain =
sWorld->getIntConfig(CONFIG_SKILL_GAIN_GATHERING); 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, // For skinning and Mining chance decrease with level. 1-74 - no decrease,
// 75-149 - 2 times, 225-299 - 8 times // 75-149 - 2 times, 225-299 - 8 times
@@ -846,7 +846,7 @@ bool Player::UpdateCraftSkill(uint32 spellid)
uint32 craft_skill_gain = uint32 craft_skill_gain =
sWorld->getIntConfig(CONFIG_SKILL_GAIN_CRAFTING); 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( return UpdateSkillPro(
_spell_idx->second->SkillLine, _spell_idx->second->SkillLine,
@@ -915,7 +915,7 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step)
LOG_DEBUG("entities.player.skills", LOG_DEBUG("entities.player.skills",
"UpdateSkillPro(SkillId {}, Chance {:3.1f}%)", SkillId, "UpdateSkillPro(SkillId {}, Chance {:3.1f}%)", SkillId,
Chance / 10.0f); Chance / 10.0f);
if (!SkillId || !sScriptMgr->CanPlayerUpdateSkill(this, SkillId)) if (!SkillId || !sScriptMgr->OnPlayerCanUpdateSkill(this, SkillId))
return false; return false;
if (Chance <= 0) // speedup in 0 chance case 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 SkillValue = SKILL_VALUE(data);
uint32 MaxValue = SKILL_MAX(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) if (!MaxValue || !SkillValue || SkillValue >= MaxValue)
return false; return false;
@@ -1383,7 +1383,7 @@ void Player::UpdateEquipSpellsAtFormChange()
ApplyEquipSpell(spellInfo, nullptr, false, ApplyEquipSpell(spellInfo, nullptr, false,
true); // remove spells that not fit to form true); // remove spells that not fit to form
if (!sScriptMgr->CanApplyEquipSpellsItemSet(this, eff)) if (!sScriptMgr->OnPlayerCanApplyEquipSpellsItemSet(this, eff))
break; break;
ApplyEquipSpell(spellInfo, nullptr, true, ApplyEquipSpell(spellInfo, nullptr, true,
true); // add spells that fit form but not active true); // add spells that fit form but not active
@@ -1461,7 +1461,7 @@ void Player::UpdateFFAPvPState(bool reset /*= true*/)
{ {
if (!IsFFAPvP()) if (!IsFFAPvP())
{ {
sScriptMgr->OnFfaPvpStateUpdate(this, true); sScriptMgr->OnPlayerFfaPvpStateUpdate(this, true);
SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
for (ControlSet::iterator itr = m_Controlled.begin(); for (ControlSet::iterator itr = m_Controlled.begin();
itr != m_Controlled.end(); ++itr) 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)) if (HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
{ {
RemoveByteFlag(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(); for (ControlSet::iterator itr = m_Controlled.begin();
itr != m_Controlled.end(); ++itr) itr != m_Controlled.end(); ++itr)
+4 -4
View File
@@ -302,7 +302,7 @@ void Player::UpdateMaxHealth()
value += GetModifierValue(unitMod, TOTAL_VALUE) + GetHealthBonusFromStamina(); value += GetModifierValue(unitMod, TOTAL_VALUE) + GetHealthBonusFromStamina();
value *= GetModifierValue(unitMod, TOTAL_PCT); value *= GetModifierValue(unitMod, TOTAL_PCT);
sScriptMgr->OnAfterUpdateMaxHealth(this, value); sScriptMgr->OnPlayerAfterUpdateMaxHealth(this, value);
SetMaxHealth((uint32)value); SetMaxHealth((uint32)value);
} }
@@ -317,7 +317,7 @@ void Player::UpdateMaxPower(Powers power)
value += GetModifierValue(unitMod, TOTAL_VALUE) + bonusPower; value += GetModifierValue(unitMod, TOTAL_VALUE) + bonusPower;
value *= GetModifierValue(unitMod, TOTAL_PCT); value *= GetModifierValue(unitMod, TOTAL_PCT);
sScriptMgr->OnAfterUpdateMaxPower(this, power, value); sScriptMgr->OnPlayerAfterUpdateMaxPower(this, power, value);
SetMaxPower(power, uint32(value)); SetMaxPower(power, uint32(value));
} }
@@ -332,7 +332,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
float val2 = 0.0f; float val2 = 0.0f;
float level = float(GetLevel()); float level = float(GetLevel());
sScriptMgr->OnBeforeUpdateAttackPowerAndDamage(this, level, val2, ranged); sScriptMgr->OnPlayerBeforeUpdateAttackPowerAndDamage(this, level, val2, ranged);
UnitMods unitMod = ranged ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER; UnitMods unitMod = ranged ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER;
@@ -499,7 +499,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f; float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;
sScriptMgr->OnAfterUpdateAttackPowerAndDamage(this, level, base_attPower, attPowerMod, attPowerMultiplier, ranged); sScriptMgr->OnPlayerAfterUpdateAttackPowerAndDamage(this, level, base_attPower, attPowerMod, attPowerMultiplier, ranged);
SetInt32Value(index, (uint32)base_attPower); //UNIT_FIELD_(RANGED)_ATTACK_POWER field SetInt32Value(index, (uint32)base_attPower); //UNIT_FIELD_(RANGED)_ATTACK_POWER field
SetInt32Value(index_mod, (uint32)attPowerMod); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field SetInt32Value(index_mod, (uint32)attPowerMod); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field
SetFloatValue(index_mult, attPowerMultiplier); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field SetFloatValue(index_mult, attPowerMultiplier); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field
+3 -3
View File
@@ -17880,7 +17880,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
if (Unit* owner = killer->GetOwner()) if (Unit* owner = killer->GetOwner())
{ {
Unit::ProcDamageAndSpell(owner, victim, PROC_FLAG_KILL, PROC_FLAG_NONE, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell); Unit::ProcDamageAndSpell(owner, victim, PROC_FLAG_KILL, PROC_FLAG_NONE, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell);
sScriptMgr->OnCreatureKilledByPet( killer->GetCharmerOrOwnerPlayerOrPlayerItself(), victim->ToCreature()); sScriptMgr->OnPlayerCreatureKilledByPet( killer->GetCharmerOrOwnerPlayerOrPlayerItself(), victim->ToCreature());
} }
if (killer != victim) if (killer != victim)
@@ -18080,9 +18080,9 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
if (Player* killerPlr = killer->ToPlayer()) if (Player* killerPlr = killer->ToPlayer())
{ {
if (Player* killedPlr = victim->ToPlayer()) if (Player* killedPlr = victim->ToPlayer())
sScriptMgr->OnPVPKill(killerPlr, killedPlr); sScriptMgr->OnPlayerPVPKill(killerPlr, killedPlr);
else if (Creature* killedCre = victim->ToCreature()) else if (Creature* killedCre = victim->ToCreature())
sScriptMgr->OnCreatureKill(killerPlr, killedCre); sScriptMgr->OnPlayerCreatureKill(killerPlr, killedCre);
} }
else if (Creature* killerCre = killer->ToCreature()) else if (Creature* killerCre = killer->ToCreature())
{ {
+2 -2
View File
@@ -1478,7 +1478,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
AllowedLooterSet looters = item->GetAllowedLooters(); AllowedLooterSet looters = item->GetAllowedLooters();
Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters); Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
if (_item) if (_item)
sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), NEED, roll); sScriptMgr->OnPlayerGroupRollRewardItem(player, _item, _item->GetCount(), NEED, roll);
player->UpdateLootAchievements(item, roll->getLoot()); player->UpdateLootAchievements(item, roll->getLoot());
} }
else else
@@ -1548,7 +1548,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
AllowedLooterSet looters = item->GetAllowedLooters(); AllowedLooterSet looters = item->GetAllowedLooters();
Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters); Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
if (_item) if (_item)
sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), GREED, roll); sScriptMgr->OnPlayerGroupRollRewardItem(player, _item, _item->GetCount(), GREED, roll);
player->UpdateLootAchievements(item, roll->getLoot()); player->UpdateLootAchievements(item, roll->getLoot());
} }
else else
@@ -417,7 +417,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData)
AuctionEntry* auction = auctionHouse->GetAuction(auctionId); AuctionEntry* auction = auctionHouse->GetAuction(auctionId);
Player* player = GetPlayer(); Player* player = GetPlayer();
if (!sScriptMgr->CanPlaceAuctionBid(player, auction)) if (!sScriptMgr->OnPlayerCanPlaceAuctionBid(player, auction))
{ {
SendAuctionCommandResult(0, AUCTION_PLACE_BID, ERR_AUCTION_RESTRICTED_ACCOUNT); SendAuctionCommandResult(0, AUCTION_PLACE_BID, ERR_AUCTION_RESTRICTED_ACCOUNT);
return; return;
@@ -140,7 +140,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
// queue result (default ok) // queue result (default ok)
GroupJoinBattlegroundResult err = GroupJoinBattlegroundResult(bg->GetBgTypeID()); GroupJoinBattlegroundResult err = GroupJoinBattlegroundResult(bg->GetBgTypeID());
if (!sScriptMgr->CanJoinInBattlegroundQueue(_player, guid, bgTypeId, joinAsGroup, err) && err <= 0) if (!sScriptMgr->OnPlayerCanJoinInBattlegroundQueue(_player, guid, bgTypeId, joinAsGroup, err) && err <= 0)
{ {
WorldPacket data; WorldPacket data;
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err);
@@ -424,7 +424,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket& recvData)
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, arenaType); BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, arenaType);
BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
if (!sScriptMgr->CanBattleFieldPort(_player, arenaType, bgTypeId, action)) if (!sScriptMgr->OnPlayerCanBattleFieldPort(_player, arenaType, bgTypeId, action))
return; return;
// get group info from queue // get group info from queue
@@ -579,11 +579,11 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket& recvData)
CharacterDatabase.Execute(stmt); CharacterDatabase.Execute(stmt);
} }
sScriptMgr->OnBattlegroundDesertion(_player, BG_DESERTION_TYPE_LEAVE_QUEUE); sScriptMgr->OnPlayerBattlegroundDesertion(_player, BG_DESERTION_TYPE_LEAVE_QUEUE);
} }
if (bg->isArena() && (bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN)) if (bg->isArena() && (bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN))
sScriptMgr->OnBattlegroundDesertion(_player, ARENA_DESERTION_TYPE_LEAVE_QUEUE); sScriptMgr->OnPlayerBattlegroundDesertion(_player, ARENA_DESERTION_TYPE_LEAVE_QUEUE);
} }
} }
@@ -748,7 +748,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData)
// queue result (default ok) // queue result (default ok)
GroupJoinBattlegroundResult err = GroupJoinBattlegroundResult(bgt->GetBgTypeID()); GroupJoinBattlegroundResult err = GroupJoinBattlegroundResult(bgt->GetBgTypeID());
if (!sScriptMgr->CanJoinInArenaQueue(_player, guid, arenaslot, bgTypeId, asGroup, isRated, err) && err <= 0) if (!sScriptMgr->OnPlayerCanJoinInArenaQueue(_player, guid, arenaslot, bgTypeId, asGroup, isRated, err) && err <= 0)
{ {
WorldPacket data; WorldPacket data;
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err);
@@ -962,7 +962,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
if (sWorld->IsFFAPvPRealm() && !pCurrChar->IsGameMaster() && !pCurrChar->HasPlayerFlag(PLAYER_FLAGS_RESTING)) if (sWorld->IsFFAPvPRealm() && !pCurrChar->IsGameMaster() && !pCurrChar->HasPlayerFlag(PLAYER_FLAGS_RESTING))
if (!pCurrChar->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP)) if (!pCurrChar->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
{ {
sScriptMgr->OnFfaPvpStateUpdate(pCurrChar,true); sScriptMgr->OnPlayerFfaPvpStateUpdate(pCurrChar,true);
pCurrChar->SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); pCurrChar->SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
} }
@@ -1124,7 +1124,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
if (pCurrChar->HasAtLoginFlag(AT_LOGIN_FIRST)) if (pCurrChar->HasAtLoginFlag(AT_LOGIN_FIRST))
{ {
pCurrChar->RemoveAtLoginFlag(AT_LOGIN_FIRST); pCurrChar->RemoveAtLoginFlag(AT_LOGIN_FIRST);
sScriptMgr->OnFirstLogin(pCurrChar); sScriptMgr->OnPlayerFirstLogin(pCurrChar);
} }
METRIC_EVENT("player_events", "Login", pCurrChar->GetName()); METRIC_EVENT("player_events", "Login", pCurrChar->GetName());
+12 -12
View File
@@ -347,7 +347,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
++_addonMessageReceiveCount; ++_addonMessageReceiveCount;
} }
sScriptMgr->OnBeforeSendChatMessage(_player, type, lang, msg); sScriptMgr->OnPlayerBeforeSendChatMessage(_player, type, lang, msg);
switch (type) switch (type)
{ {
@@ -433,7 +433,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
if (type == CHAT_MSG_PARTY_LEADER && !group->IsLeader(sender->GetGUID())) if (type == CHAT_MSG_PARTY_LEADER && !group->IsLeader(sender->GetGUID()))
return; return;
if (!sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, group)) if (!sScriptMgr->OnPlayerCanUseChat(GetPlayer(), type, lang, msg, group))
{ {
return; return;
} }
@@ -451,7 +451,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
{ {
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId())) if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
{ {
if (!sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, guild)) if (!sScriptMgr->OnPlayerCanUseChat(GetPlayer(), type, lang, msg, guild))
{ {
return; return;
} }
@@ -469,7 +469,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
{ {
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId())) if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
{ {
if (!sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, guild)) if (!sScriptMgr->OnPlayerCanUseChat(GetPlayer(), type, lang, msg, guild))
{ {
return; return;
} }
@@ -492,7 +492,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
return; return;
} }
if (!sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, group)) if (!sScriptMgr->OnPlayerCanUseChat(GetPlayer(), type, lang, msg, group))
{ {
return; return;
} }
@@ -515,7 +515,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
return; return;
} }
if (!sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, group)) if (!sScriptMgr->OnPlayerCanUseChat(GetPlayer(), type, lang, msg, group))
{ {
return; return;
} }
@@ -533,7 +533,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
if (!group || !group->isRaidGroup() || !(group->IsLeader(GetPlayer()->GetGUID()) || group->IsAssistant(GetPlayer()->GetGUID())) || group->isBGGroup()) if (!group || !group->isRaidGroup() || !(group->IsLeader(GetPlayer()->GetGUID()) || group->IsAssistant(GetPlayer()->GetGUID())) || group->isBGGroup())
return; return;
if (!sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, group)) if (!sScriptMgr->OnPlayerCanUseChat(GetPlayer(), type, lang, msg, group))
{ {
return; return;
} }
@@ -553,7 +553,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
if (!group || !group->isBGGroup()) if (!group || !group->isBGGroup())
return; return;
if (!sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, group)) if (!sScriptMgr->OnPlayerCanUseChat(GetPlayer(), type, lang, msg, group))
{ {
return; return;
} }
@@ -572,7 +572,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
if (!group || !group->isBGGroup() || !group->IsLeader(GetPlayer()->GetGUID())) if (!group || !group->isBGGroup() || !group->IsLeader(GetPlayer()->GetGUID()))
return; return;
if (!sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, group)) if (!sScriptMgr->OnPlayerCanUseChat(GetPlayer(), type, lang, msg, group))
{ {
return; return;
} }
@@ -599,7 +599,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
{ {
if (Channel* chn = cMgr->GetChannel(channel, sender)) if (Channel* chn = cMgr->GetChannel(channel, sender))
{ {
if (!sScriptMgr->CanPlayerUseChat(sender, type, lang, msg, chn)) if (!sScriptMgr->OnPlayerCanUseChat(sender, type, lang, msg, chn))
{ {
return; return;
} }
@@ -632,7 +632,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
sender->ToggleAFK(); sender->ToggleAFK();
} }
if (!sScriptMgr->CanPlayerUseChat(sender, type, lang, msg)) if (!sScriptMgr->OnPlayerCanUseChat(sender, type, lang, msg))
{ {
return; return;
} }
@@ -660,7 +660,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
sender->ToggleDND(); sender->ToggleDND();
} }
if (!sScriptMgr->CanPlayerUseChat(sender, type, lang, msg)) if (!sScriptMgr->OnPlayerCanUseChat(sender, type, lang, msg))
{ {
return; return;
} }
+2 -2
View File
@@ -85,7 +85,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData)
return; return;
} }
if (!sScriptMgr->CanGroupInvite(invitingPlayer, membername)) if (!sScriptMgr->OnPlayerCanGroupInvite(invitingPlayer, membername))
return; return;
if (invitingPlayer->IsSpectator() || invitedPlayer->IsSpectator()) if (invitingPlayer->IsSpectator() || invitedPlayer->IsSpectator())
@@ -230,7 +230,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recvData)
return; return;
} }
if (!sScriptMgr->CanGroupAccept(GetPlayer(), group)) if (!sScriptMgr->OnPlayerCanGroupAccept(GetPlayer(), group))
return; return;
if (group->GetLeaderGUID() == GetPlayer()->GetGUID()) if (group->GetLeaderGUID() == GetPlayer()->GetGUID())
+1 -1
View File
@@ -756,7 +756,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket& recvData)
Item* pItem = _player->GetItemByGuid(itemguid); Item* pItem = _player->GetItemByGuid(itemguid);
if (pItem) if (pItem)
{ {
if (!sScriptMgr->CanSellItem(_player, pItem, creature)) if (!sScriptMgr->OnPlayerCanSellItem(_player, pItem, creature))
return; return;
// prevent sell not owner item // prevent sell not owner item
+3 -3
View File
@@ -93,7 +93,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recvData)
loot = &creature->loot; loot = &creature->loot;
} }
sScriptMgr->OnAfterCreatureLoot(player); sScriptMgr->OnPlayerAfterCreatureLoot(player);
InventoryResult msg; InventoryResult msg;
LootItem* lootItem = player->StoreLootItem(lootSlot, loot, msg); LootItem* lootItem = player->StoreLootItem(lootSlot, loot, msg);
@@ -179,7 +179,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
if (loot) if (loot)
{ {
sScriptMgr->OnBeforeLootMoney(player, loot); sScriptMgr->OnPlayerBeforeLootMoney(player, loot);
loot->NotifyMoneyRemoved(); loot->NotifyMoneyRemoved();
if (shareMoney && player->GetGroup()) //item, pickpocket and players can be looted only single player if (shareMoney && player->GetGroup()) //item, pickpocket and players can be looted only single player
{ {
@@ -211,7 +211,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
} }
else else
{ {
sScriptMgr->OnAfterCreatureLootMoney(player); sScriptMgr->OnPlayerAfterCreatureLootMoney(player);
player->ModifyMoney(loot->gold); player->ModifyMoney(loot->gold);
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, loot->gold); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, loot->gold);
+4 -4
View File
@@ -269,7 +269,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
return; return;
} }
if (!sScriptMgr->CanSendMail(player, receiverGuid, mailbox, subject, body, money, COD, item)) if (!sScriptMgr->OnPlayerCanSendMail(player, receiverGuid, mailbox, subject, body, money, COD, item))
{ {
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_INTERNAL_ERROR); player->SendMailResult(0, MAIL_SEND, MAIL_ERR_INTERNAL_ERROR);
return; return;
@@ -278,7 +278,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
items[i] = item; items[i] = item;
} }
if (!items_count && !sScriptMgr->CanSendMail(player, receiverGuid, mailbox, subject, body, money, COD, nullptr)) if (!items_count && !sScriptMgr->OnPlayerCanSendMail(player, receiverGuid, mailbox, subject, body, money, COD, nullptr))
{ {
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_INTERNAL_ERROR); player->SendMailResult(0, MAIL_SEND, MAIL_ERR_INTERNAL_ERROR);
return; return;
@@ -422,14 +422,14 @@ void WorldSession::HandleMailReturnToSender(WorldPacket& recvData)
for (MailItemInfoVec::iterator itr = m->items.begin(); itr != m->items.end(); ++itr) for (MailItemInfoVec::iterator itr = m->items.begin(); itr != m->items.end(); ++itr)
{ {
Item* item = player->GetMItem(itr->item_guid); Item* item = player->GetMItem(itr->item_guid);
if (item && !sScriptMgr->CanSendMail(player, ObjectGuid(HighGuid::Player, m->sender), mailbox, m->subject, m->body, m->money, m->COD, item)) if (item && !sScriptMgr->OnPlayerCanSendMail(player, ObjectGuid(HighGuid::Player, m->sender), mailbox, m->subject, m->body, m->money, m->COD, item))
{ {
player->SendMailResult(mailId, MAIL_RETURNED_TO_SENDER, MAIL_ERR_INTERNAL_ERROR); player->SendMailResult(mailId, MAIL_RETURNED_TO_SENDER, MAIL_ERR_INTERNAL_ERROR);
return; return;
} }
} }
} }
else if (!sScriptMgr->CanSendMail(player, ObjectGuid(HighGuid::Player, m->sender), mailbox, m->subject, m->body, m->money, m->COD, nullptr)) else if (!sScriptMgr->OnPlayerCanSendMail(player, ObjectGuid(HighGuid::Player, m->sender), mailbox, m->subject, m->body, m->money, m->COD, nullptr))
{ {
player->SendMailResult(mailId, MAIL_RETURNED_TO_SENDER, MAIL_ERR_INTERNAL_ERROR); player->SendMailResult(mailId, MAIL_RETURNED_TO_SENDER, MAIL_ERR_INTERNAL_ERROR);
return; return;
+3 -3
View File
@@ -181,7 +181,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recv_data)
} }
else else
{ {
sScriptMgr->OnGossipSelectCode(_player, menuId, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId), code.c_str()); sScriptMgr->OnPlayerGossipSelectCode(_player, menuId, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId), code.c_str());
} }
} }
else else
@@ -204,7 +204,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recv_data)
} }
else else
{ {
sScriptMgr->OnGossipSelect(_player, menuId, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId)); sScriptMgr->OnPlayerGossipSelect(_player, menuId, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId));
} }
} }
} }
@@ -742,7 +742,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data)
if (player->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP)) if (player->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
{ {
player->RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); player->RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
sScriptMgr->OnFfaPvpStateUpdate(player, false); sScriptMgr->OnPlayerFfaPvpStateUpdate(player, false);
} }
} }
+1 -1
View File
@@ -904,7 +904,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket& recvData)
// reputation discount // reputation discount
float discountMod = _player->GetReputationPriceDiscount(unit); float discountMod = _player->GetReputationPriceDiscount(unit);
sScriptMgr->OnBeforePlayerDurabilityRepair(_player, npcGUID, itemGUID, discountMod, guildBank); sScriptMgr->OnPlayerBeforeDurabilityRepair(_player, npcGUID, itemGUID, discountMod, guildBank);
if (itemGUID) if (itemGUID)
{ {
@@ -126,7 +126,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
} }
} }
sScriptMgr->PetitionBuy(_player, creature, charterid, cost, type); sScriptMgr->OnPlayerPetitionBuy(_player, creature, charterid, cost, type);
if (type == GUILD_CHARTER_TYPE) if (type == GUILD_CHARTER_TYPE)
{ {
@@ -840,7 +840,7 @@ void WorldSession::SendPetitionShowList(ObjectGuid guid)
if (creature->IsTabardDesigner()) if (creature->IsTabardDesigner())
{ {
sScriptMgr->PetitionShowList(_player, creature, CharterEntry, CharterDispayID, CharterCost); sScriptMgr->OnPlayerPetitionShowList(_player, creature, CharterEntry, CharterDispayID, CharterCost);
data << uint8(1); // count data << uint8(1); // count
data << uint32(1); // index data << uint32(1); // index
@@ -859,7 +859,7 @@ void WorldSession::SendPetitionShowList(ObjectGuid guid)
// 2v2 // 2v2
data << uint8(3); // count data << uint8(3); // count
sScriptMgr->PetitionShowList(_player, creature, CharterEntry, CharterDispayID, CharterCost); sScriptMgr->OnPlayerPetitionShowList(_player, creature, CharterEntry, CharterDispayID, CharterCost);
data << uint32(1); // index data << uint32(1); // index
data << CharterEntry; // charter entry data << CharterEntry; // charter entry
data << CharterDispayID; // charter display id data << CharterDispayID; // charter display id
@@ -873,7 +873,7 @@ void WorldSession::SendPetitionShowList(ObjectGuid guid)
CharterCost = sWorld->getIntConfig(CONFIG_CHARTER_COST_ARENA_3v3); CharterCost = sWorld->getIntConfig(CONFIG_CHARTER_COST_ARENA_3v3);
// 3v3 // 3v3
sScriptMgr->PetitionShowList(_player, creature, CharterEntry, CharterDispayID, CharterCost); sScriptMgr->OnPlayerPetitionShowList(_player, creature, CharterEntry, CharterDispayID, CharterCost);
data << uint32(2); // index data << uint32(2); // index
data << CharterEntry; // charter entry data << CharterEntry; // charter entry
data << CharterDispayID; // charter display id data << CharterDispayID; // charter display id
@@ -887,7 +887,7 @@ void WorldSession::SendPetitionShowList(ObjectGuid guid)
CharterCost = sWorld->getIntConfig(CONFIG_CHARTER_COST_ARENA_5v5); CharterCost = sWorld->getIntConfig(CONFIG_CHARTER_COST_ARENA_5v5);
// 5v5 // 5v5
sScriptMgr->PetitionShowList(_player, creature, CharterEntry, CharterDispayID, CharterCost); sScriptMgr->OnPlayerPetitionShowList(_player, creature, CharterEntry, CharterDispayID, CharterCost);
data << uint32(3); // index data << uint32(3); // index
data << CharterEntry; // charter entry data << CharterEntry; // charter entry
data << CharterDispayID; // charter display id data << CharterDispayID; // charter display id
+1 -1
View File
@@ -424,7 +424,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData)
_player->RemoveActiveQuest(questId); _player->RemoveActiveQuest(questId);
_player->RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, questId); _player->RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, questId);
sScriptMgr->OnQuestAbandon(_player, questId); sScriptMgr->OnPlayerQuestAbandon(_player, questId);
LOG_DEBUG("network.opcode", "Player {} abandoned quest {}", _player->GetGUID().ToString(), questId); LOG_DEBUG("network.opcode", "Player {} abandoned quest {}", _player->GetGUID().ToString(), questId);
// check if Quest Tracker is enabled // check if Quest Tracker is enabled
+1 -1
View File
@@ -268,7 +268,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
} }
} }
if (sScriptMgr->OnBeforeOpenItem(pUser, item)) if (sScriptMgr->OnPlayerBeforeOpenItem(pUser, item))
{ {
if (item->IsWrapped())// wrapped? if (item->IsWrapped())// wrapped?
{ {
+2 -2
View File
@@ -636,7 +636,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
return; return;
} }
if (!sScriptMgr->CanInitTrade(_player, pOther)) if (!sScriptMgr->OnPlayerCanInitTrade(_player, pOther))
return; return;
// OK start trade // OK start trade
@@ -702,7 +702,7 @@ void WorldSession::HandleSetTradeItemOpcode(WorldPacket& recvPacket)
} }
// PlayerScript Hook for checking traded items if we want to filter them in a custom module // PlayerScript Hook for checking traded items if we want to filter them in a custom module
if (!sScriptMgr->CanSetTradeItem(_player, item, tradeSlot)) if (!sScriptMgr->OnPlayerCanSetTradeItem(_player, item, tradeSlot))
{ {
// Do not send TRADE_STATUS_TRADE_CANCELED because it will cause double display of "Transaction canceled" notification // Do not send TRADE_STATUS_TRADE_CANCELED because it will cause double display of "Transaction canceled" notification
// On the trade initiator screen // On the trade initiator screen
+1 -1
View File
@@ -696,7 +696,7 @@ QuestItemList* Loot::FillQuestLoot(Player* player)
{ {
LootItem& item = quest_items[i]; LootItem& item = quest_items[i];
sScriptMgr->OnBeforeFillQuestLootItem(player, item); sScriptMgr->OnPlayerBeforeFillQuestLootItem(player, item);
// Quest item is not free for all and is already assigned to another player // Quest item is not free for all and is already assigned to another player
// or player doesn't need it // or player doesn't need it
+1 -1
View File
@@ -161,7 +161,7 @@ Map::EnterState MapMgr::PlayerCannotEnter(uint32 mapid, Player* player, bool log
char const* mapName = entry->name[player->GetSession()->GetSessionDbcLocale()]; char const* mapName = entry->name[player->GetSession()->GetSessionDbcLocale()];
if (!sScriptMgr->CanEnterMap(player, entry, instance, mapDiff, loginCheck)) if (!sScriptMgr->OnPlayerCanEnterMap(player, entry, instance, mapDiff, loginCheck))
return Map::CANNOT_ENTER_UNSPECIFIED_REASON; return Map::CANNOT_ENTER_UNSPECIFIED_REASON;
Group* group = player->GetGroup(); Group* group = player->GetGroup();
+1 -1
View File
@@ -97,7 +97,7 @@ GraveyardStruct const* Graveyard::GetDefaultGraveyard(TeamId teamId)
GraveyardStruct const* Graveyard::GetClosestGraveyard(Player* player, TeamId teamId, bool nearCorpse) GraveyardStruct const* Graveyard::GetClosestGraveyard(Player* player, TeamId teamId, bool nearCorpse)
{ {
uint32 graveyardOverride = 0; uint32 graveyardOverride = 0;
sScriptMgr->OnBeforeChooseGraveyard(player, teamId, nearCorpse, graveyardOverride); sScriptMgr->OnPlayerBeforeChooseGraveyard(player, teamId, nearCorpse, graveyardOverride);
if (graveyardOverride) if (graveyardOverride)
{ {
return sGraveyard->GetGraveyard(graveyardOverride); return sGraveyard->GetGraveyard(graveyardOverride);
@@ -190,7 +190,7 @@ void ScriptMgr::OnPlayerEnterMap(Map* map, Player* player)
ExecuteScript<PlayerScript>([=](PlayerScript* script) ExecuteScript<PlayerScript>([=](PlayerScript* script)
{ {
script->OnMapChanged(player); script->OnPlayerMapChanged(player);
}); });
ForeachMaps<WorldMapScript>(map, ForeachMaps<WorldMapScript>(map,
File diff suppressed because it is too large Load Diff
@@ -221,188 +221,188 @@ public:
virtual void OnPlayerJustDied(Player* /*player*/) { } virtual void OnPlayerJustDied(Player* /*player*/) { }
// Called player talent points are calculated // Called player talent points are calculated
virtual void OnCalculateTalentsPoints(Player const* /*player*/, uint32& /*talentPointsForLevel*/) { } virtual void OnPlayerCalculateTalentsPoints(Player const* /*player*/, uint32& /*talentPointsForLevel*/) { }
// Called when clicking the release button // Called when clicking the release button
virtual void OnPlayerReleasedGhost(Player* /*player*/) { } virtual void OnPlayerReleasedGhost(Player* /*player*/) { }
// Called on Send Initial Packets Before Add To Map // Called on Send Initial Packets Before Add To Map
virtual void OnSendInitialPacketsBeforeAddToMap(Player* /*player*/, WorldPacket& /*data*/) {} virtual void OnPlayerSendInitialPacketsBeforeAddToMap(Player* /*player*/, WorldPacket& /*data*/) {}
// Called when a player does a desertion action (see BattlegroundDesertionType) // Called when a player does a desertion action (see BattlegroundDesertionType)
virtual void OnBattlegroundDesertion(Player* /*player*/, BattlegroundDesertionType const /*desertionType*/) { } virtual void OnPlayerBattlegroundDesertion(Player* /*player*/, BattlegroundDesertionType const /*desertionType*/) { }
// Called when a player completes a quest // Called when a player completes a quest
virtual void OnPlayerCompleteQuest(Player* /*player*/, Quest const* /*quest_id*/) { } virtual void OnPlayerCompleteQuest(Player* /*player*/, Quest const* /*quest_id*/) { }
// Called when a player kills another player // Called when a player kills another player
virtual void OnPVPKill(Player* /*killer*/, Player* /*killed*/) { } virtual void OnPlayerPVPKill(Player* /*killer*/, Player* /*killed*/) { }
// Called when a player toggles pvp // Called when a player toggles pvp
virtual void OnPlayerPVPFlagChange(Player* /*player*/, bool /*state*/) { } virtual void OnPlayerPVPFlagChange(Player* /*player*/, bool /*state*/) { }
// Called when a player kills a creature // Called when a player kills a creature
virtual void OnCreatureKill(Player* /*killer*/, Creature* /*killed*/) { } virtual void OnPlayerCreatureKill(Player* /*killer*/, Creature* /*killed*/) { }
// Called when a player's pet kills a creature // Called when a player's pet kills a creature
virtual void OnCreatureKilledByPet(Player* /*PetOwner*/, Creature* /*killed*/) { } virtual void OnPlayerCreatureKilledByPet(Player* /*PetOwner*/, Creature* /*killed*/) { }
// Called when a player is killed by a creature // Called when a player is killed by a creature
virtual void OnPlayerKilledByCreature(Creature* /*killer*/, Player* /*killed*/) { } virtual void OnPlayerKilledByCreature(Creature* /*killer*/, Player* /*killed*/) { }
// Called when a player's level changes (right after the level is applied) // Called when a player's level changes (right after the level is applied)
virtual void OnLevelChanged(Player* /*player*/, uint8 /*oldlevel*/) { } virtual void OnPlayerLevelChanged(Player* /*player*/, uint8 /*oldlevel*/) { }
// Called when a player's free talent points change (right before the change is applied) // Called when a player's free talent points change (right before the change is applied)
virtual void OnFreeTalentPointsChanged(Player* /*player*/, uint32 /*points*/) { } virtual void OnPlayerFreeTalentPointsChanged(Player* /*player*/, uint32 /*points*/) { }
// Called when a player's talent points are reset (right before the reset is done) // Called when a player's talent points are reset (right before the reset is done)
virtual void OnTalentsReset(Player* /*player*/, bool /*noCost*/) { } virtual void OnPlayerTalentsReset(Player* /*player*/, bool /*noCost*/) { }
// Called after a player switches specs using the dual spec system // Called after a player switches specs using the dual spec system
virtual void OnAfterSpecSlotChanged(Player* /*player*/, uint8 /*newSlot*/) { } virtual void OnPlayerAfterSpecSlotChanged(Player* /*player*/, uint8 /*newSlot*/) { }
// Called for player::update // Called for player::update
virtual void OnBeforeUpdate(Player* /*player*/, uint32 /*p_time*/) { } virtual void OnPlayerBeforeUpdate(Player* /*player*/, uint32 /*p_time*/) { }
virtual void OnUpdate(Player* /*player*/, uint32 /*p_time*/) { } virtual void OnPlayerUpdate(Player* /*player*/, uint32 /*p_time*/) { }
// Called when a player's money is modified (before the modification is done) // Called when a player's money is modified (before the modification is done)
virtual void OnMoneyChanged(Player* /*player*/, int32& /*amount*/) { } virtual void OnPlayerMoneyChanged(Player* /*player*/, int32& /*amount*/) { }
// Called before looted money is added to a player // Called before looted money is added to a player
virtual void OnBeforeLootMoney(Player* /*player*/, Loot* /*loot*/) {} virtual void OnPlayerBeforeLootMoney(Player* /*player*/, Loot* /*loot*/) {}
// Called when a player gains XP (before anything is given) // Called when a player gains XP (before anything is given)
virtual void OnGiveXP(Player* /*player*/, uint32& /*amount*/, Unit* /*victim*/, uint8 /*xpSource*/) { } virtual void OnPlayerGiveXP(Player* /*player*/, uint32& /*amount*/, Unit* /*victim*/, uint8 /*xpSource*/) { }
// Called when a player's reputation changes (before it is actually changed) // Called when a player's reputation changes (before it is actually changed)
virtual bool OnReputationChange(Player* /*player*/, uint32 /*factionID*/, int32& /*standing*/, bool /*incremental*/) { return true; } virtual bool OnPlayerReputationChange(Player* /*player*/, uint32 /*factionID*/, int32& /*standing*/, bool /*incremental*/) { return true; }
// Called when a player's reputation rank changes (before it is actually changed) // Called when a player's reputation rank changes (before it is actually changed)
virtual void OnReputationRankChange(Player* /*player*/, uint32 /*factionID*/, ReputationRank /*newRank*/, ReputationRank /*olRank*/, bool /*increased*/) { } virtual void OnPlayerReputationRankChange(Player* /*player*/, uint32 /*factionID*/, ReputationRank /*newRank*/, ReputationRank /*olRank*/, bool /*increased*/) { }
// Called when a player learned new spell // Called when a player learned new spell
virtual void OnLearnSpell(Player* /*player*/, uint32 /*spellID*/) {} virtual void OnPlayerLearnSpell(Player* /*player*/, uint32 /*spellID*/) {}
// Called when a player forgot spell // Called when a player forgot spell
virtual void OnForgotSpell(Player* /*player*/, uint32 /*spellID*/) {} virtual void OnPlayerForgotSpell(Player* /*player*/, uint32 /*spellID*/) {}
// Called when a duel is requested // Called when a duel is requested
virtual void OnDuelRequest(Player* /*target*/, Player* /*challenger*/) { } virtual void OnPlayerDuelRequest(Player* /*target*/, Player* /*challenger*/) { }
// Called when a duel starts (after 3s countdown) // Called when a duel starts (after 3s countdown)
virtual void OnDuelStart(Player* /*player1*/, Player* /*player2*/) { } virtual void OnPlayerDuelStart(Player* /*player1*/, Player* /*player2*/) { }
// Called when a duel ends // Called when a duel ends
virtual void OnDuelEnd(Player* /*winner*/, Player* /*loser*/, DuelCompleteType /*type*/) { } virtual void OnPlayerDuelEnd(Player* /*winner*/, Player* /*loser*/, DuelCompleteType /*type*/) { }
// The following methods are called when a player sends a chat message. // The following methods are called when a player sends a chat message.
virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/) { } virtual void OnPlayerChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/) { }
virtual void OnBeforeSendChatMessage(Player* /*player*/, uint32& /*type*/, uint32& /*lang*/, std::string& /*msg*/) { } virtual void OnPlayerBeforeSendChatMessage(Player* /*player*/, uint32& /*type*/, uint32& /*lang*/, std::string& /*msg*/) { }
virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/, Player* /*receiver*/) { } virtual void OnPlayerChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/, Player* /*receiver*/) { }
virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/, Group* /*group*/) { } virtual void OnPlayerChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/, Group* /*group*/) { }
virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/, Guild* /*guild*/) { } virtual void OnPlayerChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/, Guild* /*guild*/) { }
virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/, Channel* /*channel*/) { } virtual void OnPlayerChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/, Channel* /*channel*/) { }
// Both of the below are called on emote opcodes. // Both of the below are called on emote opcodes.
virtual void OnEmote(Player* /*player*/, uint32 /*emote*/) { } virtual void OnPlayerEmote(Player* /*player*/, uint32 /*emote*/) { }
virtual void OnTextEmote(Player* /*player*/, uint32 /*textEmote*/, uint32 /*emoteNum*/, ObjectGuid /*guid*/) { } virtual void OnPlayerTextEmote(Player* /*player*/, uint32 /*textEmote*/, uint32 /*emoteNum*/, ObjectGuid /*guid*/) { }
// Called in Spell::Cast. // Called in Spell::Cast.
virtual void OnSpellCast(Player* /*player*/, Spell* /*spell*/, bool /*skipCheck*/) { } virtual void OnPlayerSpellCast(Player* /*player*/, Spell* /*spell*/, bool /*skipCheck*/) { }
// Called during data loading // Called during data loading
virtual void OnLoadFromDB(Player* /*player*/) { }; virtual void OnPlayerLoadFromDB(Player* /*player*/) { };
// Called when a player logs in. // Called when a player logs in.
virtual void OnLogin(Player* /*player*/) { } virtual void OnPlayerLogin(Player* /*player*/) { }
// Called before the player is logged out // Called before the player is logged out
virtual void OnBeforeLogout(Player* /*player*/) { } virtual void OnPlayerBeforeLogout(Player* /*player*/) { }
// Called when a player logs out. // Called when a player logs out.
virtual void OnLogout(Player* /*player*/) { } virtual void OnPlayerLogout(Player* /*player*/) { }
// Called when a player is created. // Called when a player is created.
virtual void OnCreate(Player* /*player*/) { } virtual void OnPlayerCreate(Player* /*player*/) { }
// Called when a player is deleted. // Called when a player is deleted.
virtual void OnDelete(ObjectGuid /*guid*/, uint32 /*accountId*/) { } virtual void OnPlayerDelete(ObjectGuid /*guid*/, uint32 /*accountId*/) { }
// Called when a player delete failed. // Called when a player delete failed.
virtual void OnFailedDelete(ObjectGuid /*guid*/, uint32 /*accountId*/) { } virtual void OnPlayerFailedDelete(ObjectGuid /*guid*/, uint32 /*accountId*/) { }
// Called when a player is about to be saved. // Called when a player is about to be saved.
virtual void OnSave(Player* /*player*/) { } virtual void OnPlayerSave(Player* /*player*/) { }
// Called when a player is bound to an instance // Called when a player is bound to an instance
virtual void OnBindToInstance(Player* /*player*/, Difficulty /*difficulty*/, uint32 /*mapId*/, bool /*permanent*/) { } virtual void OnPlayerBindToInstance(Player* /*player*/, Difficulty /*difficulty*/, uint32 /*mapId*/, bool /*permanent*/) { }
// Called when a player switches to a new zone // Called when a player switches to a new zone
virtual void OnUpdateZone(Player* /*player*/, uint32 /*newZone*/, uint32 /*newArea*/) { } virtual void OnPlayerUpdateZone(Player* /*player*/, uint32 /*newZone*/, uint32 /*newArea*/) { }
// Called when a player switches to a new area (more accurate than UpdateZone) // Called when a player switches to a new area (more accurate than UpdateZone)
virtual void OnUpdateArea(Player* /*player*/, uint32 /*oldArea*/, uint32 /*newArea*/) { } virtual void OnPlayerUpdateArea(Player* /*player*/, uint32 /*oldArea*/, uint32 /*newArea*/) { }
// Called when a player changes to a new map (after moving to new map) // Called when a player changes to a new map (after moving to new map)
virtual void OnMapChanged(Player* /*player*/) { } virtual void OnPlayerMapChanged(Player* /*player*/) { }
// Called before a player is being teleported to new coords // Called before a player is being teleported to new coords
[[nodiscard]] virtual bool OnBeforeTeleport(Player* /*player*/, uint32 /*mapid*/, float /*x*/, float /*y*/, float /*z*/, float /*orientation*/, uint32 /*options*/, Unit* /*target*/) { return true; } [[nodiscard]] virtual bool OnPlayerBeforeTeleport(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 // Called when team/faction is set on player
virtual void OnUpdateFaction(Player* /*player*/) { } virtual void OnPlayerUpdateFaction(Player* /*player*/) { }
// Called when a player is added to battleground // Called when a player is added to battleground
virtual void OnAddToBattleground(Player* /*player*/, Battleground* /*bg*/) { } virtual void OnPlayerAddToBattleground(Player* /*player*/, Battleground* /*bg*/) { }
// Called when a player queues a Random Dungeon using the RDF (Random Dungeon Finder) // Called when a player queues a Random Dungeon using the RDF (Random Dungeon Finder)
virtual void OnQueueRandomDungeon(Player* /*player*/, uint32 & /*rDungeonId*/) { } virtual void OnPlayerQueueRandomDungeon(Player* /*player*/, uint32 & /*rDungeonId*/) { }
// Called when a player is removed from battleground // Called when a player is removed from battleground
virtual void OnRemoveFromBattleground(Player* /*player*/, Battleground* /*bg*/) { } virtual void OnPlayerRemoveFromBattleground(Player* /*player*/, Battleground* /*bg*/) { }
// Called when a player complete an achievement // Called when a player complete an achievement
virtual void OnAchiComplete(Player* /*player*/, AchievementEntry const* /*achievement*/) { } virtual void OnPlayerAchievementComplete(Player* /*player*/, AchievementEntry const* /*achievement*/) { }
// Called before player complete an achievement, can be used to disable achievements in certain conditions // Called before player complete an achievement, can be used to disable achievements in certain conditions
virtual bool OnBeforeAchiComplete(Player* /*player*/, AchievementEntry const* /*achievement*/) { return true; } virtual bool OnPlayerBeforeAchievementComplete(Player* /*player*/, AchievementEntry const* /*achievement*/) { return true; }
// Called when a player complete an achievement criteria // Called when a player complete an achievement criteria
virtual void OnCriteriaProgress(Player* /*player*/, AchievementCriteriaEntry const* /*criteria*/) { } virtual void OnPlayerCriteriaProgress(Player* /*player*/, AchievementCriteriaEntry const* /*criteria*/) { }
// Called before player complete an achievement criteria, can be used to disable achievement criteria in certain conditions // Called before player complete an achievement criteria, can be used to disable achievement criteria in certain conditions
virtual bool OnBeforeCriteriaProgress(Player* /*player*/, AchievementCriteriaEntry const* /*criteria*/) { return true; } virtual bool OnPlayerBeforeCriteriaProgress(Player* /*player*/, AchievementCriteriaEntry const* /*criteria*/) { return true; }
// Called when an Achievement is saved to DB // Called when an Achievement is saved to DB
virtual void OnAchiSave(CharacterDatabaseTransaction /*trans*/, Player* /*player*/, uint16 /*achId*/, CompletedAchievementData /*achiData*/) { } virtual void OnPlayerAchievementSave(CharacterDatabaseTransaction /*trans*/, Player* /*player*/, uint16 /*achId*/, CompletedAchievementData /*achiData*/) { }
// Called when an Criteria is saved to DB // Called when an Criteria is saved to DB
virtual void OnCriteriaSave(CharacterDatabaseTransaction /*trans*/, Player* /*player*/, uint16 /*achId*/, CriteriaProgress /*criteriaData*/) { } virtual void OnPlayerCriteriaSave(CharacterDatabaseTransaction /*trans*/, Player* /*player*/, uint16 /*achId*/, CriteriaProgress /*criteriaData*/) { }
// Called when a player selects an option in a player gossip window // Called when a player selects an option in a player gossip window
virtual void OnGossipSelect(Player* /*player*/, uint32 /*menu_id*/, uint32 /*sender*/, uint32 /*action*/) { } virtual void OnPlayerGossipSelect(Player* /*player*/, uint32 /*menu_id*/, uint32 /*sender*/, uint32 /*action*/) { }
// Called when a player selects an option in a player gossip window // Called when a player selects an option in a player gossip window
virtual void OnGossipSelectCode(Player* /*player*/, uint32 /*menu_id*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/) { } virtual void OnPlayerGossipSelectCode(Player* /*player*/, uint32 /*menu_id*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/) { }
// On player getting charmed // On player getting charmed
virtual void OnBeingCharmed(Player* /*player*/, Unit* /*charmer*/, uint32 /*oldFactionId*/, uint32 /*newFactionId*/) { } virtual void OnPlayerBeingCharmed(Player* /*player*/, Unit* /*charmer*/, uint32 /*oldFactionId*/, uint32 /*newFactionId*/) { }
// To change behaviour of set visible item slot // To change behaviour of set visible item slot
virtual void OnAfterSetVisibleItemSlot(Player* /*player*/, uint8 /*slot*/, Item* /*item*/) { } virtual void OnPlayerAfterSetVisibleItemSlot(Player* /*player*/, uint8 /*slot*/, Item* /*item*/) { }
// After an item has been moved from inventory // After an item has been moved from inventory
virtual void OnAfterMoveItemFromInventory(Player* /*player*/, Item* /*it*/, uint8 /*bag*/, uint8 /*slot*/, bool /*update*/) { } virtual void OnPlayerAfterMoveItemFromInventory(Player* /*player*/, Item* /*it*/, uint8 /*bag*/, uint8 /*slot*/, bool /*update*/) { }
// After an item has been equipped // After an item has been equipped
virtual void OnEquip(Player* /*player*/, Item* /*it*/, uint8 /*bag*/, uint8 /*slot*/, bool /*update*/) { } virtual void OnPlayerEquip(Player* /*player*/, Item* /*it*/, uint8 /*bag*/, uint8 /*slot*/, bool /*update*/) { }
// After player enters queue for BG // After player enters queue for BG
virtual void OnPlayerJoinBG(Player* /*player*/) { } virtual void OnPlayerJoinBG(Player* /*player*/) { }
@@ -411,105 +411,105 @@ public:
virtual void OnPlayerJoinArena(Player* /*player*/) { } virtual void OnPlayerJoinArena(Player* /*player*/) { }
//Called after the normal slots (0..2) for arena have been evaluated so that custom arena teams could modify it if nececasry //Called after the normal slots (0..2) for arena have been evaluated so that custom arena teams could modify it if nececasry
virtual void OnGetMaxPersonalArenaRatingRequirement(Player const* /*player*/, uint32 /*minSlot*/, uint32& /*maxArenaRating*/) const {} virtual void OnPlayerGetMaxPersonalArenaRatingRequirement(Player const* /*player*/, uint32 /*minSlot*/, uint32& /*maxArenaRating*/) const {}
//After looting item //After looting item
virtual void OnLootItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/, ObjectGuid /*lootguid*/) { } virtual void OnPlayerLootItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/, ObjectGuid /*lootguid*/) { }
//Before looting item //Before looting item
virtual void OnBeforeFillQuestLootItem(Player* /*player*/, LootItem& /*item*/) { } virtual void OnPlayerBeforeFillQuestLootItem(Player* /*player*/, LootItem& /*item*/) { }
//After looting item (includes master loot). //After looting item (includes master loot).
virtual void OnStoreNewItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/) { } virtual void OnPlayerStoreNewItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/) { }
//After creating item (eg profession item creation) //After creating item (eg profession item creation)
virtual void OnCreateItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/) { } virtual void OnPlayerCreateItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/) { }
// After receiving item as a quest reward // After receiving item as a quest reward
virtual void OnQuestRewardItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/) { } virtual void OnPlayerQuestRewardItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/) { }
// When placing a bid or buying out an auction // When placing a bid or buying out an auction
[[nodiscard]] virtual bool CanPlaceAuctionBid(Player* /*player*/, AuctionEntry* /*auction*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanPlaceAuctionBid(Player* /*player*/, AuctionEntry* /*auction*/) { return true; }
// After receiving item as a group roll reward // After receiving item as a group roll reward
virtual void OnGroupRollRewardItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/, RollVote /*voteType*/, Roll* /*roll*/) { } virtual void OnPlayerGroupRollRewardItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/, RollVote /*voteType*/, Roll* /*roll*/) { }
//Before opening an item //Before opening an item
[[nodiscard]] virtual bool OnBeforeOpenItem(Player* /*player*/, Item* /*item*/) { return true; } [[nodiscard]] virtual bool OnPlayerBeforeOpenItem(Player* /*player*/, Item* /*item*/) { return true; }
// After completed a quest // After completed a quest
[[nodiscard]] virtual bool OnBeforeQuestComplete(Player* /*player*/, uint32 /*quest_id*/) { return true; } [[nodiscard]] virtual bool OnPlayerBeforeQuestComplete(Player* /*player*/, uint32 /*quest_id*/) { return true; }
// Called after computing the XP reward value for a quest // Called after computing the XP reward value for a quest
virtual void OnQuestComputeXP(Player* /*player*/, Quest const* /*quest*/, uint32& /*xpValue*/) { } virtual void OnPlayerQuestComputeXP(Player* /*player*/, Quest const* /*quest*/, uint32& /*xpValue*/) { }
// Before durability repair action, you can even modify the discount value // Before durability repair action, you can even modify the discount value
virtual void OnBeforeDurabilityRepair(Player* /*player*/, ObjectGuid /*npcGUID*/, ObjectGuid /*itemGUID*/, float&/*discountMod*/, uint8 /*guildBank*/) { } virtual void OnPlayerBeforeDurabilityRepair(Player* /*player*/, ObjectGuid /*npcGUID*/, ObjectGuid /*itemGUID*/, float&/*discountMod*/, uint8 /*guildBank*/) { }
//Before buying something from any vendor //Before buying something from any vendor
virtual void OnBeforeBuyItemFromVendor(Player* /*player*/, ObjectGuid /*vendorguid*/, uint32 /*vendorslot*/, uint32& /*item*/, uint8 /*count*/, uint8 /*bag*/, uint8 /*slot*/) { }; virtual void OnPlayerBeforeBuyItemFromVendor(Player* /*player*/, ObjectGuid /*vendorguid*/, uint32 /*vendorslot*/, uint32& /*item*/, uint8 /*count*/, uint8 /*bag*/, uint8 /*slot*/) { };
//Before buying something from any vendor //Before buying something from any vendor
virtual void OnBeforeStoreOrEquipNewItem(Player* /*player*/, uint32 /*vendorslot*/, uint32& /*item*/, uint8 /*count*/, uint8 /*bag*/, uint8 /*slot*/, ItemTemplate const* /*pProto*/, Creature* /*pVendor*/, VendorItem const* /*crItem*/, bool /*bStore*/) { }; virtual void OnPlayerBeforeStoreOrEquipNewItem(Player* /*player*/, uint32 /*vendorslot*/, uint32& /*item*/, uint8 /*count*/, uint8 /*bag*/, uint8 /*slot*/, ItemTemplate const* /*pProto*/, Creature* /*pVendor*/, VendorItem const* /*crItem*/, bool /*bStore*/) { };
//After buying something from any vendor //After buying something from any vendor
virtual void OnAfterStoreOrEquipNewItem(Player* /*player*/, uint32 /*vendorslot*/, Item* /*item*/, uint8 /*count*/, uint8 /*bag*/, uint8 /*slot*/, ItemTemplate const* /*pProto*/, Creature* /*pVendor*/, VendorItem const* /*crItem*/, bool /*bStore*/) { }; virtual void OnPlayerAfterStoreOrEquipNewItem(Player* /*player*/, uint32 /*vendorslot*/, Item* /*item*/, uint8 /*count*/, uint8 /*bag*/, uint8 /*slot*/, ItemTemplate const* /*pProto*/, Creature* /*pVendor*/, VendorItem const* /*crItem*/, bool /*bStore*/) { };
virtual void OnAfterUpdateMaxPower(Player* /*player*/, Powers& /*power*/, float& /*value*/) { } virtual void OnPlayerAfterUpdateMaxPower(Player* /*player*/, Powers& /*power*/, float& /*value*/) { }
virtual void OnAfterUpdateMaxHealth(Player* /*player*/, float& /*value*/) { } virtual void OnPlayerAfterUpdateMaxHealth(Player* /*player*/, float& /*value*/) { }
virtual void OnBeforeUpdateAttackPowerAndDamage(Player* /*player*/, float& /*level*/, float& /*val2*/, bool /*ranged*/) { } virtual void OnPlayerBeforeUpdateAttackPowerAndDamage(Player* /*player*/, float& /*level*/, float& /*val2*/, bool /*ranged*/) { }
virtual void OnAfterUpdateAttackPowerAndDamage(Player* /*player*/, float& /*level*/, float& /*base_attPower*/, float& /*attPowerMod*/, float& /*attPowerMultiplier*/, bool /*ranged*/) { } virtual void OnPlayerAfterUpdateAttackPowerAndDamage(Player* /*player*/, float& /*level*/, float& /*base_attPower*/, float& /*attPowerMod*/, float& /*attPowerMultiplier*/, bool /*ranged*/) { }
virtual void OnBeforeInitTalentForLevel(Player* /*player*/, uint8& /*level*/, uint32& /*talentPointsForLevel*/) { } virtual void OnPlayerBeforeInitTalentForLevel(Player* /*player*/, uint8& /*level*/, uint32& /*talentPointsForLevel*/) { }
virtual void OnFirstLogin(Player* /*player*/) { } virtual void OnPlayerFirstLogin(Player* /*player*/) { }
virtual void OnSetMaxLevel(Player* /*player*/, uint32& /*maxPlayerLevel*/) { } virtual void OnPlayerSetMaxLevel(Player* /*player*/, uint32& /*maxPlayerLevel*/) { }
[[nodiscard]] virtual bool CanJoinInBattlegroundQueue(Player* /*player*/, ObjectGuid /*BattlemasterGuid*/, BattlegroundTypeId /*BGTypeID*/, uint8 /*joinAsGroup*/, GroupJoinBattlegroundResult& /*err*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanJoinInBattlegroundQueue(Player* /*player*/, ObjectGuid /*BattlemasterGuid*/, BattlegroundTypeId /*BGTypeID*/, uint8 /*joinAsGroup*/, GroupJoinBattlegroundResult& /*err*/) { return true; }
virtual bool ShouldBeRewardedWithMoneyInsteadOfExp(Player* /*player*/) { return false; } virtual bool OnPlayerShouldBeRewardedWithMoneyInsteadOfExp(Player* /*player*/) { return false; }
// Called before the player's temporary summoned creature has initialized it's stats // Called before the player's temporary summoned creature has initialized it's stats
virtual void OnBeforeTempSummonInitStats(Player* /*player*/, TempSummon* /*tempSummon*/, uint32& /*duration*/) { } virtual void OnPlayerBeforeTempSummonInitStats(Player* /*player*/, TempSummon* /*tempSummon*/, uint32& /*duration*/) { }
// Called before the player's guardian / pet has initialized it's stats for the player's level // Called before the player's guardian / pet has initialized it's stats for the player's level
virtual void OnBeforeGuardianInitStatsForLevel(Player* /*player*/, Guardian* /*guardian*/, CreatureTemplate const* /*cinfo*/, PetType& /*petType*/) { } virtual void OnPlayerBeforeGuardianInitStatsForLevel(Player* /*player*/, Guardian* /*guardian*/, CreatureTemplate const* /*cinfo*/, PetType& /*petType*/) { }
// Called after the player's guardian / pet has initialized it's stats for the player's level // Called after the player's guardian / pet has initialized it's stats for the player's level
virtual void OnAfterGuardianInitStatsForLevel(Player* /*player*/, Guardian* /*guardian*/) { } virtual void OnPlayerAfterGuardianInitStatsForLevel(Player* /*player*/, Guardian* /*guardian*/) { }
// Called before loading a player's pet from the DB // Called before loading a player's pet from the DB
virtual void OnBeforeLoadPetFromDB(Player* /*player*/, uint32& /*petentry*/, uint32& /*petnumber*/, bool& /*current*/, bool& /*forceLoadFromDB*/) { } virtual void OnPlayerBeforeLoadPetFromDB(Player* /*player*/, uint32& /*petentry*/, uint32& /*petnumber*/, bool& /*current*/, bool& /*forceLoadFromDB*/) { }
[[nodiscard]] virtual bool CanJoinInArenaQueue(Player* /*player*/, ObjectGuid /*BattlemasterGuid*/, uint8 /*arenaslot*/, BattlegroundTypeId /*BGTypeID*/, uint8 /*joinAsGroup*/, uint8 /*IsRated*/, GroupJoinBattlegroundResult& /*err*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanJoinInArenaQueue(Player* /*player*/, ObjectGuid /*BattlemasterGuid*/, uint8 /*arenaslot*/, BattlegroundTypeId /*BGTypeID*/, uint8 /*joinAsGroup*/, uint8 /*IsRated*/, GroupJoinBattlegroundResult& /*err*/) { return true; }
[[nodiscard]] virtual bool CanBattleFieldPort(Player* /*player*/, uint8 /*arenaType*/, BattlegroundTypeId /*BGTypeID*/, uint8 /*action*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanBattleFieldPort(Player* /*player*/, uint8 /*arenaType*/, BattlegroundTypeId /*BGTypeID*/, uint8 /*action*/) { return true; }
[[nodiscard]] virtual bool CanGroupInvite(Player* /*player*/, std::string& /*membername*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanGroupInvite(Player* /*player*/, std::string& /*membername*/) { return true; }
[[nodiscard]] virtual bool CanGroupAccept(Player* /*player*/, Group* /*group*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanGroupAccept(Player* /*player*/, Group* /*group*/) { return true; }
[[nodiscard]] virtual bool CanSellItem(Player* /*player*/, Item* /*item*/, Creature* /*creature*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanSellItem(Player* /*player*/, Item* /*item*/, Creature* /*creature*/) { return true; }
[[nodiscard]] virtual bool CanSendMail(Player* /*player*/, ObjectGuid /*receiverGuid*/, ObjectGuid /*mailbox*/, std::string& /*subject*/, std::string& /*body*/, uint32 /*money*/, uint32 /*COD*/, Item* /*item*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanSendMail(Player* /*player*/, ObjectGuid /*receiverGuid*/, ObjectGuid /*mailbox*/, std::string& /*subject*/, std::string& /*body*/, uint32 /*money*/, uint32 /*COD*/, Item* /*item*/) { return true; }
virtual void PetitionBuy(Player* /*player*/, Creature* /*creature*/, uint32& /*charterid*/, uint32& /*cost*/, uint32& /*type*/) { } virtual void OnPlayerPetitionBuy(Player* /*player*/, Creature* /*creature*/, uint32& /*charterid*/, uint32& /*cost*/, uint32& /*type*/) { }
virtual void PetitionShowList(Player* /*player*/, Creature* /*creature*/, uint32& /*CharterEntry*/, uint32& /*CharterDispayID*/, uint32& /*CharterCost*/) { } virtual void OnPlayerPetitionShowList(Player* /*player*/, Creature* /*creature*/, uint32& /*CharterEntry*/, uint32& /*CharterDispayID*/, uint32& /*CharterCost*/) { }
virtual void OnRewardKillRewarder(Player* /*player*/, KillRewarder* /*rewarder*/, bool /*isDungeon*/, float& /*rate*/) { } virtual void OnPlayerRewardKillRewarder(Player* /*player*/, KillRewarder* /*rewarder*/, bool /*isDungeon*/, float& /*rate*/) { }
[[nodiscard]] virtual bool CanGiveMailRewardAtGiveLevel(Player* /*player*/, uint8 /*level*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanGiveMailRewardAtGiveLevel(Player* /*player*/, uint8 /*level*/) { return true; }
virtual void OnDeleteFromDB(CharacterDatabaseTransaction /*trans*/, uint32 /*guid*/) { } virtual void OnPlayerDeleteFromDB(CharacterDatabaseTransaction /*trans*/, uint32 /*guid*/) { }
[[nodiscard]] virtual bool CanRepopAtGraveyard(Player* /*player*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanRepopAtGraveyard(Player* /*player*/) { return true; }
[[nodiscard]] virtual Optional<bool> OnPlayerIsClass(Player const* /*player*/, Classes /*playerClass*/, ClassContext /*context*/) { return std::nullopt; } [[nodiscard]] virtual Optional<bool> OnPlayerIsClass(Player const* /*player*/, Classes /*playerClass*/, ClassContext /*context*/) { return std::nullopt; }
virtual void OnGetMaxSkillValue(Player* /*player*/, uint32 /*skill*/, int32& /*result*/, bool /*IsPure*/) { } virtual void OnPlayerGetMaxSkillValue(Player* /*player*/, uint32 /*skill*/, int32& /*result*/, bool /*IsPure*/) { }
[[nodiscard]] virtual bool OnPlayerHasActivePowerType(Player const* /*player*/, Powers /*power*/) { return false; } [[nodiscard]] virtual bool OnPlayerHasActivePowerType(Player const* /*player*/, Powers /*power*/) { return false; }
@@ -524,7 +524,7 @@ public:
* @param yellow Contains the yellow skill level for current application * @param yellow Contains the yellow skill level for current application
* @param gain Contains the amount of points that should be added to the Player * @param gain Contains the amount of points that should be added to the Player
*/ */
virtual void OnUpdateGatheringSkill(Player* /*player*/, uint32 /*skill_id*/, uint32 /*current*/, uint32 /*gray*/, uint32 /*green*/, uint32 /*yellow*/, uint32& /*gain*/) { } virtual void OnPlayerUpdateGatheringSkill(Player* /*player*/, uint32 /*skill_id*/, uint32 /*current*/, uint32 /*gray*/, uint32 /*green*/, uint32 /*yellow*/, uint32& /*gain*/) { }
/** /**
* @brief This hook is called before crafting skill gain is applied to the character. * @brief This hook is called before crafting skill gain is applied to the character.
@@ -534,82 +534,82 @@ public:
* @param current_level Contains the current skill level for skill * @param current_level Contains the current skill level for skill
* @param gain Contains the amount of points that should be added to the Player * @param gain Contains the amount of points that should be added to the Player
*/ */
virtual void OnUpdateCraftingSkill(Player* /*player*/, SkillLineAbilityEntry const* /*skill*/, uint32 /*current_level*/, uint32& /*gain*/) { } virtual void OnPlayerUpdateCraftingSkill(Player* /*player*/, SkillLineAbilityEntry const* /*skill*/, uint32 /*current_level*/, uint32& /*gain*/) { }
[[nodiscard]] virtual bool OnUpdateFishingSkill(Player* /*player*/, int32 /*skill*/, int32 /*zone_skill*/, int32 /*chance*/, int32 /*roll*/) { return true; } [[nodiscard]] virtual bool OnPlayerUpdateFishingSkill(Player* /*player*/, int32 /*skill*/, int32 /*zone_skill*/, int32 /*chance*/, int32 /*roll*/) { return true; }
[[nodiscard]] virtual bool CanAreaExploreAndOutdoor(Player* /*player*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanAreaExploreAndOutdoor(Player* /*player*/) { return true; }
virtual void OnVictimRewardBefore(Player* /*player*/, Player* /*victim*/, uint32& /*killer_title*/, uint32& /*victim_title*/) { } virtual void OnPlayerVictimRewardBefore(Player* /*player*/, Player* /*victim*/, uint32& /*killer_title*/, uint32& /*victim_title*/) { }
virtual void OnVictimRewardAfter(Player* /*player*/, Player* /*victim*/, uint32& /*killer_title*/, uint32& /*victim_rank*/, float& /*honor_f*/) { } virtual void OnPlayerVictimRewardAfter(Player* /*player*/, Player* /*victim*/, uint32& /*killer_title*/, uint32& /*victim_rank*/, float& /*honor_f*/) { }
virtual void OnCustomScalingStatValueBefore(Player* /*player*/, ItemTemplate const* /*proto*/, uint8 /*slot*/, bool /*apply*/, uint32& /*CustomScalingStatValue*/) { } virtual void OnPlayerCustomScalingStatValueBefore(Player* /*player*/, ItemTemplate const* /*proto*/, uint8 /*slot*/, bool /*apply*/, uint32& /*CustomScalingStatValue*/) { }
virtual void OnCustomScalingStatValue(Player* /*player*/, ItemTemplate const* /*proto*/, uint32& /*statType*/, int32& /*val*/, uint8 /*itemProtoStatNumber*/, uint32 /*ScalingStatValue*/, ScalingStatValuesEntry const* /*ssv*/) { } virtual void OnPlayerCustomScalingStatValue(Player* /*player*/, ItemTemplate const* /*proto*/, uint32& /*statType*/, int32& /*val*/, uint8 /*itemProtoStatNumber*/, uint32 /*ScalingStatValue*/, ScalingStatValuesEntry const* /*ssv*/) { }
virtual void OnApplyItemModsBefore(Player* /*player*/, uint8 /*slot*/, bool /*apply*/, uint8 /*itemProtoStatNumber*/, uint32 /*statType*/, int32& /*val*/) { } virtual void OnPlayerApplyItemModsBefore(Player* /*player*/, uint8 /*slot*/, bool /*apply*/, uint8 /*itemProtoStatNumber*/, uint32 /*statType*/, int32& /*val*/) { }
virtual void OnApplyEnchantmentItemModsBefore(Player* /*player*/, Item* /*item*/, EnchantmentSlot /*slot*/, bool /*apply*/, uint32 /*enchant_spell_id*/, uint32& /*enchant_amount*/) { } virtual void OnPlayerApplyEnchantmentItemModsBefore(Player* /*player*/, Item* /*item*/, EnchantmentSlot /*slot*/, bool /*apply*/, uint32 /*enchant_spell_id*/, uint32& /*enchant_amount*/) { }
virtual void OnApplyWeaponDamage(Player* /*player*/, uint8 /*slot*/, ItemTemplate const* /*proto*/, float& /*minDamage*/, float& /*maxDamage*/, uint8 /*damageIndex*/) { } virtual void OnPlayerApplyWeaponDamage(Player* /*player*/, uint8 /*slot*/, ItemTemplate const* /*proto*/, float& /*minDamage*/, float& /*maxDamage*/, uint8 /*damageIndex*/) { }
[[nodiscard]] virtual bool CanArmorDamageModifier(Player* /*player*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanArmorDamageModifier(Player* /*player*/) { return true; }
virtual void OnGetFeralApBonus(Player* /*player*/, int32& /*feral_bonus*/, int32 /*dpsMod*/, ItemTemplate const* /*proto*/, ScalingStatValuesEntry const* /*ssv*/) { } virtual void OnPlayerGetFeralApBonus(Player* /*player*/, int32& /*feral_bonus*/, int32 /*dpsMod*/, ItemTemplate const* /*proto*/, ScalingStatValuesEntry const* /*ssv*/) { }
[[nodiscard]] virtual bool CanApplyWeaponDependentAuraDamageMod(Player* /*player*/, Item* /*item*/, WeaponAttackType /*attackType*/, AuraEffect const* /*aura*/, bool /*apply*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanApplyWeaponDependentAuraDamageMod(Player* /*player*/, Item* /*item*/, WeaponAttackType /*attackType*/, AuraEffect const* /*aura*/, bool /*apply*/) { return true; }
[[nodiscard]] virtual bool CanApplyEquipSpell(Player* /*player*/, SpellInfo const* /*spellInfo*/, Item* /*item*/, bool /*apply*/, bool /*form_change*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanApplyEquipSpell(Player* /*player*/, SpellInfo const* /*spellInfo*/, Item* /*item*/, bool /*apply*/, bool /*form_change*/) { return true; }
[[nodiscard]] virtual bool CanApplyEquipSpellsItemSet(Player* /*player*/, ItemSetEffect* /*eff*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanApplyEquipSpellsItemSet(Player* /*player*/, ItemSetEffect* /*eff*/) { return true; }
[[nodiscard]] virtual bool CanCastItemCombatSpell(Player* /*player*/, Unit* /*target*/, WeaponAttackType /*attType*/, uint32 /*procVictim*/, uint32 /*procEx*/, Item* /*item*/, ItemTemplate const* /*proto*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanCastItemCombatSpell(Player* /*player*/, Unit* /*target*/, WeaponAttackType /*attType*/, uint32 /*procVictim*/, uint32 /*procEx*/, Item* /*item*/, ItemTemplate const* /*proto*/) { return true; }
[[nodiscard]] virtual bool CanCastItemUseSpell(Player* /*player*/, Item* /*item*/, SpellCastTargets const& /*targets*/, uint8 /*cast_count*/, uint32 /*glyphIndex*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanCastItemUseSpell(Player* /*player*/, Item* /*item*/, SpellCastTargets const& /*targets*/, uint8 /*cast_count*/, uint32 /*glyphIndex*/) { return true; }
virtual void OnApplyAmmoBonuses(Player* /*player*/, ItemTemplate const* /*proto*/, float& /*currentAmmoDPS*/) { } virtual void OnPlayerApplyAmmoBonuses(Player* /*player*/, ItemTemplate const* /*proto*/, float& /*currentAmmoDPS*/) { }
[[nodiscard]] virtual bool CanEquipItem(Player* /*player*/, uint8 /*slot*/, uint16& /*dest*/, Item* /*pItem*/, bool /*swap*/, bool /*not_loading*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanEquipItem(Player* /*player*/, uint8 /*slot*/, uint16& /*dest*/, Item* /*pItem*/, bool /*swap*/, bool /*not_loading*/) { return true; }
[[nodiscard]] virtual bool CanUnequipItem(Player* /*player*/, uint16 /*pos*/, bool /*swap*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanUnequipItem(Player* /*player*/, uint16 /*pos*/, bool /*swap*/) { return true; }
[[nodiscard]] virtual bool CanUseItem(Player* /*player*/, ItemTemplate const* /*proto*/, InventoryResult& /*result*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanUseItem(Player* /*player*/, ItemTemplate const* /*proto*/, InventoryResult& /*result*/) { return true; }
[[nodiscard]] virtual bool CanSaveEquipNewItem(Player* /*player*/, Item* /*item*/, uint16 /*pos*/, bool /*update*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanSaveEquipNewItem(Player* /*player*/, Item* /*item*/, uint16 /*pos*/, bool /*update*/) { return true; }
[[nodiscard]] virtual bool CanApplyEnchantment(Player* /*player*/, Item* /*item*/, EnchantmentSlot /*slot*/, bool /*apply*/, bool /*apply_dur*/, bool /*ignore_condition*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanApplyEnchantment(Player* /*player*/, Item* /*item*/, EnchantmentSlot /*slot*/, bool /*apply*/, bool /*apply_dur*/, bool /*ignore_condition*/) { return true; }
virtual void OnGetQuestRate(Player* /*player*/, float& /*result*/) { } virtual void OnPlayerGetQuestRate(Player* /*player*/, float& /*result*/) { }
[[nodiscard]] virtual bool PassedQuestKilledMonsterCredit(Player* /*player*/, Quest const* /*qinfo*/, uint32 /*entry*/, uint32 /*real_entry*/, ObjectGuid /*guid*/) { return true; } [[nodiscard]] virtual bool OnPlayerPassedQuestKilledMonsterCredit(Player* /*player*/, Quest const* /*qinfo*/, uint32 /*entry*/, uint32 /*real_entry*/, ObjectGuid /*guid*/) { return true; }
[[nodiscard]] virtual bool CheckItemInSlotAtLoadInventory(Player* /*player*/, Item* /*item*/, uint8 /*slot*/, uint8& /*err*/, uint16& /*dest*/) { return true; } [[nodiscard]] virtual bool OnPlayerCheckItemInSlotAtLoadInventory(Player* /*player*/, Item* /*item*/, uint8 /*slot*/, uint8& /*err*/, uint16& /*dest*/) { return true; }
[[nodiscard]] virtual bool NotAvoidSatisfy(Player* /*player*/, DungeonProgressionRequirements const* /*ar*/, uint32 /*target_map*/, bool /*report*/) { return true; } [[nodiscard]] virtual bool OnPlayerNotAvoidSatisfy(Player* /*player*/, DungeonProgressionRequirements const* /*ar*/, uint32 /*target_map*/, bool /*report*/) { return true; }
[[nodiscard]] virtual bool NotVisibleGloballyFor(Player* /*player*/, Player const* /*u*/) { return true; } [[nodiscard]] virtual bool OnPlayerNotVisibleGloballyFor(Player* /*player*/, Player const* /*u*/) { return true; } // Whats that?
virtual void OnGetArenaPersonalRating(Player* /*player*/, uint8 /*slot*/, uint32& /*result*/) { } virtual void OnPlayerGetArenaPersonalRating(Player* /*player*/, uint8 /*slot*/, uint32& /*result*/) { }
virtual void OnGetArenaTeamId(Player* /*player*/, uint8 /*slot*/, uint32& /*result*/) { } virtual void OnPlayerGetArenaTeamId(Player* /*player*/, uint8 /*slot*/, uint32& /*result*/) { }
virtual void OnIsFFAPvP(Player* /*player*/, bool& /*result*/) { } virtual void OnPlayerIsFFAPvP(Player* /*player*/, bool& /*result*/) { }
//Fires whenever the UNIT_BYTE2_FLAG_FFA_PVP bit is Changed on the player //Fires whenever the UNIT_BYTE2_FLAG_FFA_PVP bit is Changed on the player
virtual void OnFfaPvpStateUpdate(Player* /*player*/, bool /*result*/) { } virtual void OnPlayerFfaPvpStateUpdate(Player* /*player*/, bool /*result*/) { }
virtual void OnIsPvP(Player* /*player*/, bool& /*result*/) { } virtual void OnPlayerIsPvP(Player* /*player*/, bool& /*result*/) { }
virtual void OnGetMaxSkillValueForLevel(Player* /*player*/, uint16& /*result*/) { } virtual void OnPlayerGetMaxSkillValueForLevel(Player* /*player*/, uint16& /*result*/) { }
[[nodiscard]] virtual bool NotSetArenaTeamInfoField(Player* /*player*/, uint8 /*slot*/, ArenaTeamInfoType /*type*/, uint32 /*value*/) { return true; } [[nodiscard]] virtual bool OnPlayerNotSetArenaTeamInfoField(Player* /*player*/, uint8 /*slot*/, ArenaTeamInfoType /*type*/, uint32 /*value*/) { return true; } // Whats that?
[[nodiscard]] virtual bool CanJoinLfg(Player* /*player*/, uint8 /*roles*/, std::set<uint32>& /*dungeons*/, const std::string& /*comment*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanJoinLfg(Player* /*player*/, uint8 /*roles*/, std::set<uint32>& /*dungeons*/, const std::string& /*comment*/) { return true; }
[[nodiscard]] virtual bool CanEnterMap(Player* /*player*/, MapEntry const* /*entry*/, InstanceTemplate const* /*instance*/, MapDifficulty const* /*mapDiff*/, bool /*loginCheck*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanEnterMap(Player* /*player*/, MapEntry const* /*entry*/, InstanceTemplate const* /*instance*/, MapDifficulty const* /*mapDiff*/, bool /*loginCheck*/) { return true; }
[[nodiscard]] virtual bool CanInitTrade(Player* /*player*/, Player* /*target*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanInitTrade(Player* /*player*/, Player* /*target*/) { return true; }
/** /**
* @brief This hook called just before finishing the handling of the action of a player setting an item in a trade slot * @brief This hook called just before finishing the handling of the action of a player setting an item in a trade slot
@@ -619,16 +619,16 @@ public:
* *
* @return True if you want to continue setting the item in the trade slot, false if you want to cancel the trade * @return True if you want to continue setting the item in the trade slot, false if you want to cancel the trade
*/ */
[[nodiscard]] virtual bool CanSetTradeItem(Player* /*player*/, Item* /*tradedItem*/, uint8 /*tradeSlot*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanSetTradeItem(Player* /*player*/, Item* /*tradedItem*/, uint8 /*tradeSlot*/) { return true; }
virtual void OnSetServerSideVisibility(Player* /*player*/, ServerSideVisibilityType& /*type*/, AccountTypes& /*sec*/) { } virtual void OnPlayerSetServerSideVisibility(Player* /*player*/, ServerSideVisibilityType& /*type*/, AccountTypes& /*sec*/) { }
virtual void OnSetServerSideVisibilityDetect(Player* /*player*/, ServerSideVisibilityType& /*type*/, AccountTypes& /*sec*/) { } virtual void OnPlayerSetServerSideVisibilityDetect(Player* /*player*/, ServerSideVisibilityType& /*type*/, AccountTypes& /*sec*/) { }
virtual void OnPlayerResurrect(Player* /*player*/, float /*restore_percent*/, bool /*applySickness*/) { } virtual void OnPlayerResurrect(Player* /*player*/, float /*restore_percent*/, bool /*applySickness*/) { }
// Called before selecting the graveyard when releasing spirit // Called before selecting the graveyard when releasing spirit
virtual void OnBeforeChooseGraveyard(Player* /*player*/, TeamId /*teamId*/, bool /*nearCorpse*/, uint32& /*graveyardOverride*/) { } virtual void OnPlayerBeforeChooseGraveyard(Player* /*player*/, TeamId /*teamId*/, bool /*nearCorpse*/, uint32& /*graveyardOverride*/) { }
/** /**
* @brief This hook called before player sending message in default chat * @brief This hook called before player sending message in default chat
@@ -640,7 +640,7 @@ public:
* *
* @return True if you want to continue sending the message, false if you want to disable sending the message * @return True if you want to continue sending the message, false if you want to disable sending the message
*/ */
[[nodiscard]] virtual bool CanPlayerUseChat(Player* /*player*/, uint32 /*type*/, uint32 /*language*/, std::string& /*msg*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanUseChat(Player* /*player*/, uint32 /*type*/, uint32 /*language*/, std::string& /*msg*/) { return true; }
/** /**
* @brief This hook called before player sending message to other player via private * @brief This hook called before player sending message to other player via private
@@ -653,7 +653,7 @@ public:
* *
* @return True if you want to continue sending the message, false if you want to disable sending the message * @return True if you want to continue sending the message, false if you want to disable sending the message
*/ */
[[nodiscard]] virtual bool CanPlayerUseChat(Player* /*player*/, uint32 /*type*/, uint32 /*language*/, std::string& /*msg*/, Player* /*receiver*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanUseChat(Player* /*player*/, uint32 /*type*/, uint32 /*language*/, std::string& /*msg*/, Player* /*receiver*/) { return true; }
/** /**
* @brief This hook called before player sending message to group * @brief This hook called before player sending message to group
@@ -666,7 +666,7 @@ public:
* *
* @return True if you want to continue sending the message, false if you want to disable sending the message * @return True if you want to continue sending the message, false if you want to disable sending the message
*/ */
[[nodiscard]] virtual bool CanPlayerUseChat(Player* /*player*/, uint32 /*type*/, uint32 /*language*/, std::string& /*msg*/, Group* /*group*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanUseChat(Player* /*player*/, uint32 /*type*/, uint32 /*language*/, std::string& /*msg*/, Group* /*group*/) { return true; }
/** /**
* @brief This hook called before player sending message to guild * @brief This hook called before player sending message to guild
@@ -679,7 +679,7 @@ public:
* *
* @return True if you want to continue sending the message, false if you want to disable sending the message * @return True if you want to continue sending the message, false if you want to disable sending the message
*/ */
[[nodiscard]] virtual bool CanPlayerUseChat(Player* /*player*/, uint32 /*type*/, uint32 /*language*/, std::string& /*msg*/, Guild* /*guild*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanUseChat(Player* /*player*/, uint32 /*type*/, uint32 /*language*/, std::string& /*msg*/, Guild* /*guild*/) { return true; }
/** /**
* @brief This hook called before player sending message to channel * @brief This hook called before player sending message to channel
@@ -692,7 +692,7 @@ public:
* *
* @return True if you want to continue sending the message, false if you want to disable sending the message * @return True if you want to continue sending the message, false if you want to disable sending the message
*/ */
[[nodiscard]] virtual bool CanPlayerUseChat(Player* /*player*/, uint32 /*type*/, uint32 /*language*/, std::string& /*msg*/, Channel* /*channel*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanUseChat(Player* /*player*/, uint32 /*type*/, uint32 /*language*/, std::string& /*msg*/, Channel* /*channel*/) { return true; }
/** /**
* @brief This hook called after player learning talents * @brief This hook called after player learning talents
@@ -725,7 +725,7 @@ public:
* @param player Contains information about the Player * @param player Contains information about the Player
* @param questId Contains information about the quest id * @param questId Contains information about the quest id
*/ */
virtual void OnQuestAbandon(Player* /*player*/, uint32 /*questId*/) { } virtual void OnPlayerQuestAbandon(Player* /*player*/, uint32 /*questId*/) { }
/** /**
* @brief This hook called before other CanFlyChecks are applied * @brief This hook called before other CanFlyChecks are applied
@@ -735,7 +735,7 @@ public:
* @param zoneId Contains information about the current zone * @param zoneId Contains information about the current zone
* @param bySpell Contains information about the spell that invoked the check * @param bySpell Contains information about the spell that invoked the check
*/ */
[[nodiscard]] virtual bool OnCanPlayerFlyInZone(Player* /*player*/, uint32 /*mapId*/, uint32 /*zoneId*/, SpellInfo const* /*bySpell*/) { return true; } [[nodiscard]] virtual bool OnPlayerCanFlyInZone(Player* /*player*/, uint32 /*mapId*/, uint32 /*zoneId*/, SpellInfo const* /*bySpell*/) { return true; }
// Passive Anticheat System // Passive Anticheat System
virtual void AnticheatSetCanFlybyServer(Player* /*player*/, bool /*apply*/) { } virtual void AnticheatSetCanFlybyServer(Player* /*player*/, bool /*apply*/) { }
@@ -753,7 +753,7 @@ public:
* *
* @return true Avoiding displaying the error message that the loot has already been taken. * @return true Avoiding displaying the error message that the loot has already been taken.
*/ */
virtual bool CanSendErrorAlreadyLooted(Player* /*player*/) { return true; } virtual bool OnPlayerCanSendErrorAlreadyLooted(Player* /*player*/) { return true; }
/** /**
* @brief It is used when an item is taken from a creature. * @brief It is used when an item is taken from a creature.
@@ -761,17 +761,17 @@ public:
* @param player Contains information about the Player * @param player Contains information about the Player
* *
*/ */
virtual void OnAfterCreatureLoot(Player* /*player*/) { } virtual void OnPlayerAfterCreatureLoot(Player* /*player*/) { }
/** /**
* @brief After a creature's money is taken * @brief After a creature's money is taken
* *
* @param player Contains information about the Player * @param player Contains information about the Player
*/ */
virtual void OnAfterCreatureLootMoney(Player* /*player*/) { } virtual void OnPlayerAfterCreatureLootMoney(Player* /*player*/) { }
virtual bool CanPlayerUpdateSkill(Player* /*player*/, uint32 /*skillId*/) { return true; } virtual bool OnPlayerCanUpdateSkill(Player* /*player*/, uint32 /*skillId*/) { return true; }
virtual void OnBeforePlayerUpdateSkill(Player* /*player*/, uint32 /*skillId*/, uint32& /*value*/, uint32 /*max*/, uint32 /*step*/) { } virtual void OnPlayerBeforeUpdateSkill(Player* /*player*/, uint32 /*skillId*/, uint32& /*value*/, uint32 /*max*/, uint32 /*step*/) { }
virtual void OnPlayerUpdateSkill(Player* /*player*/, uint32 /*skillId*/, uint32 /*value*/, uint32 /*max*/, uint32 /*step*/, uint32 /*newValue*/) { } virtual void OnPlayerUpdateSkill(Player* /*player*/, uint32 /*skillId*/, uint32 /*value*/, uint32 /*max*/, uint32 /*step*/, uint32 /*newValue*/) { }
/** /**
@@ -781,7 +781,7 @@ public:
* *
* @return true if player is authorized to resurect * @return true if player is authorized to resurect
*/ */
virtual bool CanPlayerResurrect(Player* /*player*/) { return true; } virtual bool OnPlayerCanResurrect(Player* /*player*/) { return true; }
}; };
#endif #endif
+122 -122
View File
@@ -293,24 +293,24 @@ public: /* AchievementCriteriaScript */
bool OnCriteriaCheck(uint32 scriptId, Player* source, Unit* target, uint32 criteria_id); bool OnCriteriaCheck(uint32 scriptId, Player* source, Unit* target, uint32 criteria_id);
public: /* PlayerScript */ public: /* PlayerScript */
void OnBeforePlayerUpdate(Player* player, uint32 p_time);
void OnPlayerUpdate(Player* player, uint32 p_time);
void OnSendInitialPacketsBeforeAddToMap(Player* player, WorldPacket& data);
void OnPlayerJustDied(Player* player); void OnPlayerJustDied(Player* player);
void OnCalculateTalentsPoints(Player const* player, uint32& talentPointsForLevel); void OnPlayerCalculateTalentsPoints(Player const* player, uint32& talentPointsForLevel);
void OnPlayerReleasedGhost(Player* player); void OnPlayerReleasedGhost(Player* player);
void OnPVPKill(Player* killer, Player* killed); void OnPlayerSendInitialPacketsBeforeAddToMap(Player* player, WorldPacket& data);
void OnPlayerBeforeUpdate(Player* player, uint32 p_time);
void OnPlayerUpdate(Player* player, uint32 p_time);
void OnPlayerPVPKill(Player* killer, Player* killed);
void OnPlayerPVPFlagChange(Player* player, bool state); void OnPlayerPVPFlagChange(Player* player, bool state);
void OnCreatureKill(Player* killer, Creature* killed); void OnPlayerCreatureKill(Player* killer, Creature* killed);
void OnCreatureKilledByPet(Player* petOwner, Creature* killed); void OnPlayerCreatureKilledByPet(Player* petOwner, Creature* killed);
void OnPlayerKilledByCreature(Creature* killer, Player* killed); void OnPlayerKilledByCreature(Creature* killer, Player* killed);
void OnPlayerLevelChanged(Player* player, uint8 oldLevel); void OnPlayerLevelChanged(Player* player, uint8 oldLevel);
void OnPlayerFreeTalentPointsChanged(Player* player, uint32 newPoints); void OnPlayerFreeTalentPointsChanged(Player* player, uint32 newPoints);
void OnPlayerTalentsReset(Player* player, bool noCost); void OnPlayerTalentsReset(Player* player, bool noCost);
void OnAfterSpecSlotChanged(Player* player, uint8 newSlot); void OnPlayerAfterSpecSlotChanged(Player* player, uint8 newSlot);
void OnPlayerMoneyChanged(Player* player, int32& amount); void OnPlayerMoneyChanged(Player* player, int32& amount);
void OnBeforeLootMoney(Player* player, Loot* loot); void OnPlayerBeforeLootMoney(Player* player, Loot* loot);
void OnGivePlayerXP(Player* player, uint32& amount, Unit* victim, uint8 xpSource); void OnPlayerGiveXP(Player* player, uint32& amount, Unit* victim, uint8 xpSource);
bool OnPlayerReputationChange(Player* player, uint32 factionID, int32& standing, bool incremental); bool OnPlayerReputationChange(Player* player, uint32 factionID, int32& standing, bool incremental);
void OnPlayerReputationRankChange(Player* player, uint32 factionID, ReputationRank newRank, ReputationRank oldRank, bool increased); void OnPlayerReputationRankChange(Player* player, uint32 factionID, ReputationRank newRank, ReputationRank oldRank, bool increased);
void OnPlayerLearnSpell(Player* player, uint32 spellID); void OnPlayerLearnSpell(Player* player, uint32 spellID);
@@ -319,7 +319,7 @@ public: /* PlayerScript */
void OnPlayerDuelStart(Player* player1, Player* player2); void OnPlayerDuelStart(Player* player1, Player* player2);
void OnPlayerDuelEnd(Player* winner, Player* loser, DuelCompleteType type); void OnPlayerDuelEnd(Player* winner, Player* loser, DuelCompleteType type);
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg); void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg);
void OnBeforeSendChatMessage(Player* player, uint32& type, uint32& lang, std::string& msg); void OnPlayerBeforeSendChatMessage(Player* player, uint32& type, uint32& lang, std::string& msg);
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Player* receiver); void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Player* receiver);
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Group* group); void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Group* group);
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Guild* guild); void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Guild* guild);
@@ -329,7 +329,7 @@ public: /* PlayerScript */
void OnPlayerSpellCast(Player* player, Spell* spell, bool skipCheck); void OnPlayerSpellCast(Player* player, Spell* spell, bool skipCheck);
void OnPlayerLogin(Player* player); void OnPlayerLogin(Player* player);
void OnPlayerLoadFromDB(Player* player); void OnPlayerLoadFromDB(Player* player);
void OnBeforePlayerLogout(Player* player); void OnPlayerBeforeLogout(Player* player);
void OnPlayerLogout(Player* player); void OnPlayerLogout(Player* player);
void OnPlayerCreate(Player* player); void OnPlayerCreate(Player* player);
void OnPlayerSave(Player* player); void OnPlayerSave(Player* player);
@@ -338,131 +338,131 @@ public: /* PlayerScript */
void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent); void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent);
void OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea); void OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea);
void OnPlayerUpdateArea(Player* player, uint32 oldArea, 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); bool OnPlayerBeforeTeleport(Player* player, uint32 mapid, float x, float y, float z, float orientation, uint32 options, Unit* target);
void OnPlayerUpdateFaction(Player* player); void OnPlayerUpdateFaction(Player* player);
void OnPlayerAddToBattleground(Player* player, Battleground* bg); void OnPlayerAddToBattleground(Player* player, Battleground* bg);
void OnPlayerQueueRandomDungeon(Player* player, uint32 & rDungeonId); void OnPlayerQueueRandomDungeon(Player* player, uint32 & rDungeonId);
void OnPlayerRemoveFromBattleground(Player* player, Battleground* bg); void OnPlayerRemoveFromBattleground(Player* player, Battleground* bg);
void OnAchievementComplete(Player* player, AchievementEntry const* achievement); void OnPlayerAchievementComplete(Player* player, AchievementEntry const* achievement);
bool OnBeforeAchievementComplete(Player* player, AchievementEntry const* achievement); bool OnPlayerBeforeAchievementComplete(Player* player, AchievementEntry const* achievement);
void OnCriteriaProgress(Player* player, AchievementCriteriaEntry const* criteria); void OnPlayerCriteriaProgress(Player* player, AchievementCriteriaEntry const* criteria);
bool OnBeforeCriteriaProgress(Player* player, AchievementCriteriaEntry const* criteria); bool OnPlayerBeforeCriteriaProgress(Player* player, AchievementCriteriaEntry const* criteria);
void OnAchievementSave(CharacterDatabaseTransaction trans, Player* player, uint16 achiId, CompletedAchievementData achiData); void OnPlayerAchievementSave(CharacterDatabaseTransaction trans, Player* player, uint16 achiId, CompletedAchievementData achiData);
void OnCriteriaSave(CharacterDatabaseTransaction trans, Player* player, uint16 critId, CriteriaProgress criteriaData); void OnPlayerCriteriaSave(CharacterDatabaseTransaction trans, Player* player, uint16 critId, CriteriaProgress criteriaData);
void OnGossipSelect(Player* player, uint32 menu_id, uint32 sender, uint32 action); void OnPlayerGossipSelect(Player* player, uint32 menu_id, uint32 sender, uint32 action);
void OnGossipSelectCode(Player* player, uint32 menu_id, uint32 sender, uint32 action, const char* code); void OnPlayerGossipSelectCode(Player* player, uint32 menu_id, uint32 sender, uint32 action, const char* code);
void OnPlayerBeingCharmed(Player* player, Unit* charmer, uint32 oldFactionId, uint32 newFactionId); void OnPlayerBeingCharmed(Player* player, Unit* charmer, uint32 oldFactionId, uint32 newFactionId);
void OnAfterPlayerSetVisibleItemSlot(Player* player, uint8 slot, Item* item); void OnPlayerAfterSetVisibleItemSlot(Player* player, uint8 slot, Item* item);
void OnAfterPlayerMoveItemFromInventory(Player* player, Item* it, uint8 bag, uint8 slot, bool update); void OnPlayerAfterMoveItemFromInventory(Player* player, Item* it, uint8 bag, uint8 slot, bool update);
void OnEquip(Player* player, Item* it, uint8 bag, uint8 slot, bool update); void OnPlayerEquip(Player* player, Item* it, uint8 bag, uint8 slot, bool update);
void OnPlayerJoinBG(Player* player); void OnPlayerJoinBG(Player* player);
void OnPlayerJoinArena(Player* player); void OnPlayerJoinArena(Player* player);
void OnGetMaxPersonalArenaRatingRequirement(Player const* player, uint32 minSlot, uint32& maxArenaRating) const; void OnPlayerGetMaxPersonalArenaRatingRequirement(Player const* player, uint32 minSlot, uint32& maxArenaRating) const;
void OnLootItem(Player* player, Item* item, uint32 count, ObjectGuid lootguid); void OnPlayerLootItem(Player* player, Item* item, uint32 count, ObjectGuid lootguid);
void OnBeforeFillQuestLootItem(Player* player, LootItem& item); void OnPlayerBeforeFillQuestLootItem(Player* player, LootItem& item);
void OnStoreNewItem(Player* player, Item* item, uint32 count); void OnPlayerStoreNewItem(Player* player, Item* item, uint32 count);
void OnCreateItem(Player* player, Item* item, uint32 count); void OnPlayerCreateItem(Player* player, Item* item, uint32 count);
void OnQuestRewardItem(Player* player, Item* item, uint32 count); void OnPlayerQuestRewardItem(Player* player, Item* item, uint32 count);
bool CanPlaceAuctionBid(Player* player, AuctionEntry* auction); bool OnPlayerCanPlaceAuctionBid(Player* player, AuctionEntry* auction);
void OnGroupRollRewardItem(Player* player, Item* item, uint32 count, RollVote voteType, Roll* roll); void OnPlayerGroupRollRewardItem(Player* player, Item* item, uint32 count, RollVote voteType, Roll* roll);
bool OnBeforeOpenItem(Player* player, Item* item); bool OnPlayerBeforeOpenItem(Player* player, Item* item);
bool OnBeforePlayerQuestComplete(Player* player, uint32 quest_id); bool OnPlayerBeforeQuestComplete(Player* player, uint32 quest_id);
void OnQuestComputeXP(Player* player, Quest const* quest, uint32& xpValue); void OnPlayerQuestComputeXP(Player* player, Quest const* quest, uint32& xpValue);
void OnBeforePlayerDurabilityRepair(Player* player, ObjectGuid npcGUID, ObjectGuid itemGUID, float& discountMod, uint8 guildBank); void OnPlayerBeforeDurabilityRepair(Player* player, ObjectGuid npcGUID, ObjectGuid itemGUID, float& discountMod, uint8 guildBank);
void OnBeforeBuyItemFromVendor(Player* player, ObjectGuid vendorguid, uint32 vendorslot, uint32& item, uint8 count, uint8 bag, uint8 slot); void OnPlayerBeforeBuyItemFromVendor(Player* player, ObjectGuid vendorguid, uint32 vendorslot, uint32& item, uint8 count, uint8 bag, uint8 slot);
void OnBeforeStoreOrEquipNewItem(Player* player, uint32 vendorslot, uint32& item, uint8 count, uint8 bag, uint8 slot, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore); void OnPlayerBeforeStoreOrEquipNewItem(Player* player, uint32 vendorslot, uint32& item, uint8 count, uint8 bag, uint8 slot, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore);
void OnAfterStoreOrEquipNewItem(Player* player, uint32 vendorslot, Item* item, uint8 count, uint8 bag, uint8 slot, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore); void OnPlayerAfterStoreOrEquipNewItem(Player* player, uint32 vendorslot, Item* item, uint8 count, uint8 bag, uint8 slot, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore);
void OnAfterUpdateMaxPower(Player* player, Powers& power, float& value); void OnPlayerAfterUpdateMaxPower(Player* player, Powers& power, float& value);
void OnAfterUpdateMaxHealth(Player* player, float& value); void OnPlayerAfterUpdateMaxHealth(Player* player, float& value);
void OnBeforeUpdateAttackPowerAndDamage(Player* player, float& level, float& val2, bool ranged); void OnPlayerBeforeUpdateAttackPowerAndDamage(Player* player, float& level, float& val2, bool ranged);
void OnAfterUpdateAttackPowerAndDamage(Player* player, float& level, float& base_attPower, float& attPowerMod, float& attPowerMultiplier, bool ranged); void OnPlayerAfterUpdateAttackPowerAndDamage(Player* player, float& level, float& base_attPower, float& attPowerMod, float& attPowerMultiplier, bool ranged);
void OnBeforeInitTalentForLevel(Player* player, uint8& level, uint32& talentPointsForLevel); void OnPlayerBeforeInitTalentForLevel(Player* player, uint8& level, uint32& talentPointsForLevel);
void OnFirstLogin(Player* player); void OnPlayerFirstLogin(Player* player);
void OnSetMaxLevel(Player* player, uint32& maxPlayerLevel); void OnPlayerSetMaxLevel(Player* player, uint32& maxPlayerLevel);
void OnPlayerCompleteQuest(Player* player, Quest const* quest); void OnPlayerCompleteQuest(Player* player, Quest const* quest);
void OnBattlegroundDesertion(Player* player, BattlegroundDesertionType const desertionType); void OnPlayerBattlegroundDesertion(Player* player, BattlegroundDesertionType const desertionType);
bool CanJoinInBattlegroundQueue(Player* player, ObjectGuid BattlemasterGuid, BattlegroundTypeId BGTypeID, uint8 joinAsGroup, GroupJoinBattlegroundResult& err); bool OnPlayerCanJoinInBattlegroundQueue(Player* player, ObjectGuid BattlemasterGuid, BattlegroundTypeId BGTypeID, uint8 joinAsGroup, GroupJoinBattlegroundResult& err);
bool ShouldBeRewardedWithMoneyInsteadOfExp(Player* player); bool OnPlayerShouldBeRewardedWithMoneyInsteadOfExp(Player* player);
void OnBeforeTempSummonInitStats(Player* player, TempSummon* tempSummon, uint32& duration); void OnPlayerBeforeTempSummonInitStats(Player* player, TempSummon* tempSummon, uint32& duration);
void OnBeforeGuardianInitStatsForLevel(Player* player, Guardian* guardian, CreatureTemplate const* cinfo, PetType& petType); void OnPlayerBeforeGuardianInitStatsForLevel(Player* player, Guardian* guardian, CreatureTemplate const* cinfo, PetType& petType);
void OnAfterGuardianInitStatsForLevel(Player* player, Guardian* guardian); void OnPlayerAfterGuardianInitStatsForLevel(Player* player, Guardian* guardian);
void OnBeforeLoadPetFromDB(Player* player, uint32& petentry, uint32& petnumber, bool& current, bool& forceLoadFromDB); void OnPlayerBeforeLoadPetFromDB(Player* player, uint32& petentry, uint32& petnumber, bool& current, bool& forceLoadFromDB);
bool CanJoinInArenaQueue(Player* player, ObjectGuid BattlemasterGuid, uint8 arenaslot, BattlegroundTypeId BGTypeID, uint8 joinAsGroup, uint8 IsRated, GroupJoinBattlegroundResult& err); bool OnPlayerCanJoinInArenaQueue(Player* player, ObjectGuid BattlemasterGuid, uint8 arenaslot, BattlegroundTypeId BGTypeID, uint8 joinAsGroup, uint8 IsRated, GroupJoinBattlegroundResult& err);
bool CanBattleFieldPort(Player* player, uint8 arenaType, BattlegroundTypeId BGTypeID, uint8 action); bool OnPlayerCanBattleFieldPort(Player* player, uint8 arenaType, BattlegroundTypeId BGTypeID, uint8 action);
bool CanGroupInvite(Player* player, std::string& membername); bool OnPlayerCanGroupInvite(Player* player, std::string& membername);
bool CanGroupAccept(Player* player, Group* group); bool OnPlayerCanGroupAccept(Player* player, Group* group);
bool CanSellItem(Player* player, Item* item, Creature* creature); bool OnPlayerCanSellItem(Player* player, Item* item, Creature* creature);
bool CanSendMail(Player* player, ObjectGuid receiverGuid, ObjectGuid mailbox, std::string& subject, std::string& body, uint32 money, uint32 COD, Item* item); bool OnPlayerCanSendMail(Player* player, ObjectGuid receiverGuid, ObjectGuid mailbox, std::string& subject, std::string& body, uint32 money, uint32 COD, Item* item);
void PetitionBuy(Player* player, Creature* creature, uint32& charterid, uint32& cost, uint32& type); void OnPlayerPetitionBuy(Player* player, Creature* creature, uint32& charterid, uint32& cost, uint32& type);
void PetitionShowList(Player* player, Creature* creature, uint32& CharterEntry, uint32& CharterDispayID, uint32& CharterCost); void OnPlayerPetitionShowList(Player* player, Creature* creature, uint32& CharterEntry, uint32& CharterDispayID, uint32& CharterCost);
void OnRewardKillRewarder(Player* player, KillRewarder* rewarder, bool isDungeon, float& rate); void OnPlayerRewardKillRewarder(Player* player, KillRewarder* rewarder, bool isDungeon, float& rate);
bool CanGiveMailRewardAtGiveLevel(Player* player, uint8 level); bool OnPlayerCanGiveMailRewardAtGiveLevel(Player* player, uint8 level);
void OnDeleteFromDB(CharacterDatabaseTransaction trans, uint32 guid); void OnPlayerDeleteFromDB(CharacterDatabaseTransaction trans, uint32 guid);
bool CanRepopAtGraveyard(Player* player); bool OnPlayerCanRepopAtGraveyard(Player* player);
std::optional<bool> OnPlayerIsClass(Player const* player, Classes playerClass, ClassContext context); std::optional<bool> OnPlayerIsClass(Player const* player, Classes playerClass, ClassContext context);
void OnGetMaxSkillValue(Player* player, uint32 skill, int32& result, bool IsPure); void OnPlayerGetMaxSkillValue(Player* player, uint32 skill, int32& result, bool IsPure);
bool OnPlayerHasActivePowerType(Player const* player, Powers power); bool OnPlayerHasActivePowerType(Player const* player, Powers power);
void OnUpdateGatheringSkill(Player* player, uint32 skillId, uint32 currentLevel, uint32 gray, uint32 green, uint32 yellow, uint32& gain); void OnPlayerUpdateGatheringSkill(Player* player, uint32 skillId, uint32 currentLevel, uint32 gray, uint32 green, uint32 yellow, uint32& gain);
void OnUpdateCraftingSkill(Player* player, SkillLineAbilityEntry const* skill, uint32 currentLevel, uint32& gain); void OnPlayerUpdateCraftingSkill(Player* player, SkillLineAbilityEntry const* skill, uint32 currentLevel, uint32& gain);
bool OnUpdateFishingSkill(Player* player, int32 skill, int32 zone_skill, int32 chance, int32 roll); bool OnPlayerUpdateFishingSkill(Player* player, int32 skill, int32 zone_skill, int32 chance, int32 roll);
bool CanAreaExploreAndOutdoor(Player* player); bool OnPlayerCanAreaExploreAndOutdoor(Player* player);
void OnVictimRewardBefore(Player* player, Player* victim, uint32& killer_title, uint32& victim_title); void OnPlayerVictimRewardBefore(Player* player, Player* victim, uint32& killer_title, uint32& victim_title);
void OnVictimRewardAfter(Player* player, Player* victim, uint32& killer_title, uint32& victim_rank, float& honor_f); void OnPlayerVictimRewardAfter(Player* player, Player* victim, uint32& killer_title, uint32& victim_rank, float& honor_f);
void OnCustomScalingStatValueBefore(Player* player, ItemTemplate const* proto, uint8 slot, bool apply, uint32& CustomScalingStatValue); void OnPlayerCustomScalingStatValueBefore(Player* player, ItemTemplate const* proto, uint8 slot, bool apply, uint32& CustomScalingStatValue);
void OnCustomScalingStatValue(Player* player, ItemTemplate const* proto, uint32& statType, int32& val, uint8 itemProtoStatNumber, uint32 ScalingStatValue, ScalingStatValuesEntry const* ssv); void OnPlayerCustomScalingStatValue(Player* player, ItemTemplate const* proto, uint32& statType, int32& val, uint8 itemProtoStatNumber, uint32 ScalingStatValue, ScalingStatValuesEntry const* ssv);
void OnApplyItemModsBefore(Player* player, uint8 slot, bool apply, uint8 itemProtoStatNumber, uint32 statType, int32& val); void OnPlayerApplyItemModsBefore(Player* player, uint8 slot, bool apply, uint8 itemProtoStatNumber, uint32 statType, int32& val);
void OnApplyEnchantmentItemModsBefore(Player* player, Item* item, EnchantmentSlot slot, bool apply, uint32 enchant_spell_id, uint32& enchant_amount); void OnPlayerApplyEnchantmentItemModsBefore(Player* player, Item* item, EnchantmentSlot slot, bool apply, uint32 enchant_spell_id, uint32& enchant_amount);
void OnApplyWeaponDamage(Player* player, uint8 slot, ItemTemplate const* proto, float& minDamage, float& maxDamage, uint8 damageIndex); void OnPlayerApplyWeaponDamage(Player* player, uint8 slot, ItemTemplate const* proto, float& minDamage, float& maxDamage, uint8 damageIndex);
bool CanArmorDamageModifier(Player* player); bool OnPlayerCanArmorDamageModifier(Player* player);
void OnGetFeralApBonus(Player* player, int32& feral_bonus, int32 dpsMod, ItemTemplate const* proto, ScalingStatValuesEntry const* ssv); void OnPlayerGetFeralApBonus(Player* player, int32& feral_bonus, int32 dpsMod, ItemTemplate const* proto, ScalingStatValuesEntry const* ssv);
bool CanApplyWeaponDependentAuraDamageMod(Player* player, Item* item, WeaponAttackType attackType, AuraEffect const* aura, bool apply); bool OnPlayerCanApplyWeaponDependentAuraDamageMod(Player* player, Item* item, WeaponAttackType attackType, AuraEffect const* aura, bool apply);
bool CanApplyEquipSpell(Player* player, SpellInfo const* spellInfo, Item* item, bool apply, bool form_change); bool OnPlayerCanApplyEquipSpell(Player* player, SpellInfo const* spellInfo, Item* item, bool apply, bool form_change);
bool CanApplyEquipSpellsItemSet(Player* player, ItemSetEffect* eff); bool OnPlayerCanApplyEquipSpellsItemSet(Player* player, ItemSetEffect* eff);
bool CanCastItemCombatSpell(Player* player, Unit* target, WeaponAttackType attType, uint32 procVictim, uint32 procEx, Item* item, ItemTemplate const* proto); bool OnPlayerCanCastItemCombatSpell(Player* player, Unit* target, WeaponAttackType attType, uint32 procVictim, uint32 procEx, Item* item, ItemTemplate const* proto);
bool CanCastItemUseSpell(Player* player, Item* item, SpellCastTargets const& targets, uint8 cast_count, uint32 glyphIndex); bool OnPlayerCanCastItemUseSpell(Player* player, Item* item, SpellCastTargets const& targets, uint8 cast_count, uint32 glyphIndex);
void OnApplyAmmoBonuses(Player* player, ItemTemplate const* proto, float& currentAmmoDPS); void OnPlayerApplyAmmoBonuses(Player* player, ItemTemplate const* proto, float& currentAmmoDPS);
bool CanEquipItem(Player* player, uint8 slot, uint16& dest, Item* pItem, bool swap, bool not_loading); bool OnPlayerCanEquipItem(Player* player, uint8 slot, uint16& dest, Item* pItem, bool swap, bool not_loading);
bool CanUnequipItem(Player* player, uint16 pos, bool swap); bool OnPlayerCanUnequipItem(Player* player, uint16 pos, bool swap);
bool CanUseItem(Player* player, ItemTemplate const* proto, InventoryResult& result); bool OnPlayerCanUseItem(Player* player, ItemTemplate const* proto, InventoryResult& result);
bool CanSaveEquipNewItem(Player* player, Item* item, uint16 pos, bool update); bool OnPlayerCanSaveEquipNewItem(Player* player, Item* item, uint16 pos, bool update);
bool CanApplyEnchantment(Player* player, Item* item, EnchantmentSlot slot, bool apply, bool apply_dur, bool ignore_condition); bool OnPlayerCanApplyEnchantment(Player* player, Item* item, EnchantmentSlot slot, bool apply, bool apply_dur, bool ignore_condition);
void OnGetQuestRate(Player* player, float& result); void OnPlayerGetQuestRate(Player* player, float& result);
bool PassedQuestKilledMonsterCredit(Player* player, Quest const* qinfo, uint32 entry, uint32 real_entry, ObjectGuid guid); bool OnPlayerPassedQuestKilledMonsterCredit(Player* player, Quest const* qinfo, uint32 entry, uint32 real_entry, ObjectGuid guid);
bool CheckItemInSlotAtLoadInventory(Player* player, Item* item, uint8 slot, uint8& err, uint16& dest); bool OnPlayerCheckItemInSlotAtLoadInventory(Player* player, Item* item, uint8 slot, uint8& err, uint16& dest);
bool NotAvoidSatisfy(Player* player, DungeonProgressionRequirements const* ar, uint32 target_map, bool report); bool OnPlayerNotAvoidSatisfy(Player* player, DungeonProgressionRequirements const* ar, uint32 target_map, bool report); // Wahts that?
bool NotVisibleGloballyFor(Player* player, Player const* u); bool OnPlayerNotVisibleGloballyFor(Player* player, Player const* u);
void OnGetArenaPersonalRating(Player* player, uint8 slot, uint32& result); void OnPlayerGetArenaPersonalRating(Player* player, uint8 slot, uint32& result);
void OnFfaPvpStateUpdate(Player* player, bool result); void OnPlayerFfaPvpStateUpdate(Player* player, bool result);
void OnGetArenaTeamId(Player* player, uint8 slot, uint32& result); void OnPlayerGetArenaTeamId(Player* player, uint8 slot, uint32& result);
void OnIsFFAPvP(Player* player, bool& result); void OnPlayerIsFFAPvP(Player* player, bool& result);
void OnIsPvP(Player* player, bool& result); void OnPlayerIsPvP(Player* player, bool& result);
void OnGetMaxSkillValueForLevel(Player* player, uint16& result); void OnPlayerGetMaxSkillValueForLevel(Player* player, uint16& result);
bool NotSetArenaTeamInfoField(Player* player, uint8 slot, ArenaTeamInfoType type, uint32 value); bool OnPlayerNotSetArenaTeamInfoField(Player* player, uint8 slot, ArenaTeamInfoType type, uint32 value);
bool CanJoinLfg(Player* player, uint8 roles, lfg::LfgDungeonSet& dungeons, const std::string& comment); bool OnPlayerCanJoinLfg(Player* player, uint8 roles, lfg::LfgDungeonSet& dungeons, const std::string& comment);
bool CanEnterMap(Player* player, MapEntry const* entry, InstanceTemplate const* instance, MapDifficulty const* mapDiff, bool loginCheck); bool OnPlayerCanEnterMap(Player* player, MapEntry const* entry, InstanceTemplate const* instance, MapDifficulty const* mapDiff, bool loginCheck);
bool CanInitTrade(Player* player, Player* target); bool OnPlayerCanInitTrade(Player* player, Player* target);
bool CanSetTradeItem(Player* player, Item* tradedItem, uint8 tradeSlot); bool OnPlayerCanSetTradeItem(Player* player, Item* tradedItem, uint8 tradeSlot);
void OnSetServerSideVisibility(Player* player, ServerSideVisibilityType& type, AccountTypes& sec); void OnPlayerSetServerSideVisibility(Player* player, ServerSideVisibilityType& type, AccountTypes& sec);
void OnSetServerSideVisibilityDetect(Player* player, ServerSideVisibilityType& type, AccountTypes& sec); void OnPlayerSetServerSideVisibilityDetect(Player* player, ServerSideVisibilityType& type, AccountTypes& sec);
void OnPlayerResurrect(Player* player, float restore_percent, bool applySickness); void OnPlayerResurrect(Player* player, float restore_percent, bool applySickness);
void OnBeforeChooseGraveyard(Player* player, TeamId teamId, bool nearCorpse, uint32& graveyardOverride); void OnPlayerBeforeChooseGraveyard(Player* player, TeamId teamId, bool nearCorpse, uint32& graveyardOverride);
bool CanPlayerUseChat(Player* player, uint32 type, uint32 language, std::string& msg); bool OnPlayerCanUseChat(Player* player, uint32 type, uint32 language, std::string& msg);
bool CanPlayerUseChat(Player* player, uint32 type, uint32 language, std::string& msg, Player* receiver); bool OnPlayerCanUseChat(Player* player, uint32 type, uint32 language, std::string& msg, Player* receiver);
bool CanPlayerUseChat(Player* player, uint32 type, uint32 language, std::string& msg, Group* group); bool OnPlayerCanUseChat(Player* player, uint32 type, uint32 language, std::string& msg, Group* group);
bool CanPlayerUseChat(Player* player, uint32 type, uint32 language, std::string& msg, Guild* guild); bool OnPlayerCanUseChat(Player* player, uint32 type, uint32 language, std::string& msg, Guild* guild);
bool CanPlayerUseChat(Player* player, uint32 type, uint32 language, std::string& msg, Channel* channel); bool OnPlayerCanUseChat(Player* player, uint32 type, uint32 language, std::string& msg, Channel* channel);
void OnPlayerLearnTalents(Player* player, uint32 talentId, uint32 talentRank, uint32 spellid); void OnPlayerLearnTalents(Player* player, uint32 talentId, uint32 talentRank, uint32 spellid);
void OnPlayerEnterCombat(Player* player, Unit* enemy); void OnPlayerEnterCombat(Player* player, Unit* enemy);
void OnPlayerLeaveCombat(Player* player); void OnPlayerLeaveCombat(Player* player);
void OnQuestAbandon(Player* player, uint32 questId); void OnPlayerQuestAbandon(Player* player, uint32 questId);
bool CanSendErrorAlreadyLooted(Player* player); bool OnPlayerCanSendErrorAlreadyLooted(Player* player);
void OnAfterCreatureLoot(Player* player); void OnPlayerAfterCreatureLoot(Player* player);
void OnAfterCreatureLootMoney(Player* player); void OnPlayerAfterCreatureLootMoney(Player* player);
bool OnCanPlayerFlyInZone(Player* player, uint32 mapId, uint32 zoneId, SpellInfo const* bySpell); bool OnPlayerCanFlyInZone(Player* player, uint32 mapId, uint32 zoneId, SpellInfo const* bySpell);
bool CanPlayerUpdateSkill(Player* player, uint32 skillId); bool OnPlayerCanUpdateSkill(Player* player, uint32 skillId);
void OnBeforePlayerUpdateSkill(Player* player, uint32 skill_id, uint32& value, uint32 max, uint32 step); void OnPlayerBeforeUpdateSkill(Player* player, uint32 skill_id, uint32& value, uint32 max, uint32 step);
void OnPlayerUpdateSkill(Player* player, uint32 skillId, uint32 value, uint32 max, uint32 step, uint32 newValue); void OnPlayerUpdateSkill(Player* player, uint32 skillId, uint32 value, uint32 max, uint32 step, uint32 newValue);
bool CanPlayerResurrect(Player* player); bool OnPlayerCanResurrect(Player* player);
// Anti cheat // Anti cheat
void AnticheatSetCanFlybyServer(Player* player, bool apply); void AnticheatSetCanFlybyServer(Player* player, bool apply);
+3 -3
View File
@@ -593,7 +593,7 @@ void WorldSession::LogoutPlayer(bool save)
if (_player) if (_player)
{ {
//! Call script hook before other logout events //! Call script hook before other logout events
sScriptMgr->OnBeforePlayerLogout(_player); sScriptMgr->OnPlayerBeforeLogout(_player);
if (ObjectGuid lguid = _player->GetLootGUID()) if (ObjectGuid lguid = _player->GetLootGUID())
DoLootRelease(lguid); DoLootRelease(lguid);
@@ -646,11 +646,11 @@ void WorldSession::LogoutPlayer(bool save)
CharacterDatabase.Execute(stmt); CharacterDatabase.Execute(stmt);
} }
sScriptMgr->OnBattlegroundDesertion(_player, BG_DESERTION_TYPE_INVITE_LOGOUT); sScriptMgr->OnPlayerBattlegroundDesertion(_player, BG_DESERTION_TYPE_INVITE_LOGOUT);
} }
if (bgQueueTypeId >= BATTLEGROUND_QUEUE_2v2 && bgQueueTypeId < MAX_BATTLEGROUND_QUEUE_TYPES && _player->IsInvitedForBattlegroundQueueType(bgQueueTypeId)) if (bgQueueTypeId >= BATTLEGROUND_QUEUE_2v2 && bgQueueTypeId < MAX_BATTLEGROUND_QUEUE_TYPES && _player->IsInvitedForBattlegroundQueueType(bgQueueTypeId))
sScriptMgr->OnBattlegroundDesertion(_player, ARENA_DESERTION_TYPE_INVITE_LOGOUT); sScriptMgr->OnPlayerBattlegroundDesertion(_player, ARENA_DESERTION_TYPE_INVITE_LOGOUT);
_player->RemoveBattlegroundQueueId(bgQueueTypeId); _player->RemoveBattlegroundQueueId(bgQueueTypeId);
sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId).RemovePlayer(_player->GetGUID(), true); sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId).RemovePlayer(_player->GetGUID(), true);
+1 -1
View File
@@ -1765,7 +1765,7 @@ void Spell::DoCreateItem(uint8 /*effIndex*/, uint32 itemId)
// send info to the client // send info to the client
player->SendNewItem(pItem, addNumber, true, SelfCast); player->SendNewItem(pItem, addNumber, true, SelfCast);
sScriptMgr->OnCreateItem(player, pItem, addNumber); sScriptMgr->OnPlayerCreateItem(player, pItem, addNumber);
// we succeeded in creating at least one item, so a levelup is possible // we succeeded in creating at least one item, so a levelup is possible
if (SelfCast) if (SelfCast)
+1 -1
View File
@@ -157,7 +157,7 @@ public:
{ {
} }
void OnUpdateZone(Player* player, uint32 newZone, uint32 /*newArea*/) override void OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 /*newArea*/) override
{ {
if (!IsHolidayActive(HOLIDAY_FIRE_FESTIVAL)) if (!IsHolidayActive(HOLIDAY_FIRE_FESTIVAL))
return; return;
@@ -179,19 +179,19 @@ public:
} }
// CHARACTER_CREATE = 7 // CHARACTER_CREATE = 7
void OnCreate(Player* player) override void OnPlayerCreate(Player* player) override
{ {
CharacterIPLogAction(player, CHARACTER_CREATE); CharacterIPLogAction(player, CHARACTER_CREATE);
} }
// CHARACTER_LOGIN = 8 // CHARACTER_LOGIN = 8
void OnLogin(Player* player) override void OnPlayerLogin(Player* player) override
{ {
CharacterIPLogAction(player, CHARACTER_LOGIN); CharacterIPLogAction(player, CHARACTER_LOGIN);
} }
// CHARACTER_LOGOUT = 9 // CHARACTER_LOGOUT = 9
void OnLogout(Player* player) override void OnPlayerLogout(Player* player) override
{ {
CharacterIPLogAction(player, CHARACTER_LOGOUT); CharacterIPLogAction(player, CHARACTER_LOGOUT);
} }
@@ -273,13 +273,13 @@ public:
} }
// CHARACTER_DELETE = 10 // CHARACTER_DELETE = 10
void OnDelete(ObjectGuid guid, uint32 accountId) override void OnPlayerDelete(ObjectGuid guid, uint32 accountId) override
{ {
DeleteIPLogAction(guid, accountId, CHARACTER_DELETE); DeleteIPLogAction(guid, accountId, CHARACTER_DELETE);
} }
// CHARACTER_FAILED_DELETE = 11 // CHARACTER_FAILED_DELETE = 11
void OnFailedDelete(ObjectGuid guid, uint32 accountId) override void OnPlayerFailedDelete(ObjectGuid guid, uint32 accountId) override
{ {
DeleteIPLogAction(guid, accountId, CHARACTER_FAILED_DELETE); DeleteIPLogAction(guid, accountId, CHARACTER_FAILED_DELETE);
} }
+5 -5
View File
@@ -36,7 +36,7 @@ public:
{ {
} }
void OnChat(Player* player, uint32 type, uint32 lang, std::string& msg) override void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg) override
{ {
std::string logType = ""; std::string logType = "";
std::string chatType = ""; std::string chatType = "";
@@ -63,7 +63,7 @@ public:
player->GetName(), chatType, lang, msg); player->GetName(), chatType, lang, msg);
} }
void OnChat(Player* player, uint32 /*type*/, uint32 lang, std::string& msg, Player* receiver) override void OnPlayerChat(Player* player, uint32 /*type*/, uint32 lang, std::string& msg, Player* receiver) override
{ {
//! NOTE: //! NOTE:
//! LANG_ADDON can only be sent by client in "PARTY", "RAID", "GUILD", "BATTLEGROUND", "WHISPER" //! LANG_ADDON can only be sent by client in "PARTY", "RAID", "GUILD", "BATTLEGROUND", "WHISPER"
@@ -74,7 +74,7 @@ public:
player->GetName(), msgType, receiver ? receiver->GetName() : "<unknown>", msg); player->GetName(), msgType, receiver ? receiver->GetName() : "<unknown>", msg);
} }
void OnChat(Player* player, uint32 type, uint32 lang, std::string& msg, Group* group) override void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Group* group) override
{ {
//! NOTE: //! NOTE:
//! LANG_ADDON can only be sent by client in "PARTY", "RAID", "GUILD", "BATTLEGROUND", "WHISPER" //! LANG_ADDON can only be sent by client in "PARTY", "RAID", "GUILD", "BATTLEGROUND", "WHISPER"
@@ -108,7 +108,7 @@ public:
role, player->GetName(), action, msgType, targetGroup, msg); role, player->GetName(), action, msgType, targetGroup, msg);
} }
void OnChat(Player* player, uint32 type, uint32 lang, std::string& msg, Guild* guild) override void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Guild* guild) override
{ {
//! NOTE: //! NOTE:
//! LANG_ADDON can only be sent by client in "PARTY", "RAID", "GUILD", "BATTLEGROUND", "WHISPER" //! LANG_ADDON can only be sent by client in "PARTY", "RAID", "GUILD", "BATTLEGROUND", "WHISPER"
@@ -131,7 +131,7 @@ public:
player->GetName(), msgType, guild ? guild->GetName() : "<unknown>", msg); player->GetName(), msgType, guild ? guild->GetName() : "<unknown>", msg);
} }
void OnChat(Player* player, uint32 /*type*/, uint32 /*lang*/, std::string& msg, Channel* channel) override void OnPlayerChat(Player* player, uint32 /*type*/, uint32 /*lang*/, std::string& msg, Channel* channel) override
{ {
bool isSystem = channel && bool isSystem = channel &&
(channel->HasFlag(CHANNEL_FLAG_TRADE) || (channel->HasFlag(CHANNEL_FLAG_TRADE) ||
+1 -1
View File
@@ -27,7 +27,7 @@ public:
ServerMailReward() : PlayerScript("ServerMailReward", {PLAYERHOOK_ON_LOGIN}) { } ServerMailReward() : PlayerScript("ServerMailReward", {PLAYERHOOK_ON_LOGIN}) { }
// CHARACTER_LOGIN = 8 // CHARACTER_LOGIN = 8
void OnLogin(Player* player) override void OnPlayerLogin(Player* player) override
{ {
// Retrieve all server mail records and session only once // Retrieve all server mail records and session only once
auto const& serverMailStore = sObjectMgr->GetAllServerMailStore(); auto const& serverMailStore = sObjectMgr->GetAllServerMailStore();