fix(Core): Correct Post 3.1 Fishing Skill Leveling (#12996)
This commit is contained in:
@@ -1744,11 +1744,13 @@ 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))
|
||||||
|
{
|
||||||
|
player->UpdateFishingSkill();
|
||||||
|
}
|
||||||
// but you will likely cause junk in areas that require a high fishing skill (not yet implemented)
|
// but you will likely cause junk in areas that require a high fishing skill (not yet implemented)
|
||||||
if (chance >= roll)
|
if (chance >= roll)
|
||||||
{
|
{
|
||||||
player->UpdateFishingSkill();
|
|
||||||
|
|
||||||
//TODO: I do not understand this hack. Need some explanation.
|
//TODO: I do not understand this hack. Need some explanation.
|
||||||
// prevent removing GO at spell cancel
|
// prevent removing GO at spell cancel
|
||||||
RemoveFromOwner();
|
RemoveFromOwner();
|
||||||
|
|||||||
@@ -928,6 +928,21 @@ void ScriptMgr::OnGetMaxSkillValue(Player* player, uint32 skill, int32& result,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ScriptMgr::OnUpdateFishingSkill(Player* player, int32 skill, int32 zone_skill, int32 chance, int32 roll)
|
||||||
|
{
|
||||||
|
auto ret = IsValidBoolScript<PlayerScript>([&](PlayerScript* script)
|
||||||
|
{
|
||||||
|
return !script->OnUpdateFishingSkill(player, skill, zone_skill, chance, roll);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (ret && *ret)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool ScriptMgr::CanAreaExploreAndOutdoor(Player* player)
|
bool ScriptMgr::CanAreaExploreAndOutdoor(Player* player)
|
||||||
{
|
{
|
||||||
auto ret = IsValidBoolScript<PlayerScript>([&](PlayerScript* script)
|
auto ret = IsValidBoolScript<PlayerScript>([&](PlayerScript* script)
|
||||||
|
|||||||
@@ -1249,6 +1249,8 @@ public:
|
|||||||
|
|
||||||
virtual void OnGetMaxSkillValue(Player* /*player*/, uint32 /*skill*/, int32& /*result*/, bool /*IsPure*/) { }
|
virtual void OnGetMaxSkillValue(Player* /*player*/, uint32 /*skill*/, int32& /*result*/, bool /*IsPure*/) { }
|
||||||
|
|
||||||
|
[[nodiscard]] virtual bool OnUpdateFishingSkill(Player* /*player*/, int32 /*skill*/, int32 /*zone_skill*/, int32 /*chance*/, int32 /*roll*/) { return true; }
|
||||||
|
|
||||||
[[nodiscard]] virtual bool CanAreaExploreAndOutdoor(Player* /*player*/) { return true; }
|
[[nodiscard]] virtual bool CanAreaExploreAndOutdoor(Player* /*player*/) { return true; }
|
||||||
|
|
||||||
virtual void OnVictimRewardBefore(Player* /*player*/, Player* /*victim*/, uint32& /*killer_title*/, uint32& /*victim_title*/) { }
|
virtual void OnVictimRewardBefore(Player* /*player*/, Player* /*victim*/, uint32& /*killer_title*/, uint32& /*victim_title*/) { }
|
||||||
@@ -2289,6 +2291,7 @@ public: /* PlayerScript */
|
|||||||
void OnDeleteFromDB(CharacterDatabaseTransaction trans, uint32 guid);
|
void OnDeleteFromDB(CharacterDatabaseTransaction trans, uint32 guid);
|
||||||
bool CanRepopAtGraveyard(Player* player);
|
bool CanRepopAtGraveyard(Player* player);
|
||||||
void OnGetMaxSkillValue(Player* player, uint32 skill, int32& result, bool IsPure);
|
void OnGetMaxSkillValue(Player* player, uint32 skill, int32& result, bool IsPure);
|
||||||
|
bool OnUpdateFishingSkill(Player* player, int32 skill, int32 zone_skill, int32 chance, int32 roll);
|
||||||
bool CanAreaExploreAndOutdoor(Player* player);
|
bool CanAreaExploreAndOutdoor(Player* player);
|
||||||
void OnVictimRewardBefore(Player* player, Player* victim, uint32& killer_title, uint32& victim_title);
|
void OnVictimRewardBefore(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 OnVictimRewardAfter(Player* player, Player* victim, uint32& killer_title, uint32& victim_rank, float& honor_f);
|
||||||
|
|||||||
Reference in New Issue
Block a user