Core/GameObjects: remove incorrect gathering experience implementation

This commit is contained in:
Ovahlord committed 2023-01-17 19:56:25 +01:00
1 parent acaf42798a
commit f18a592a7e
4 files changed
+3 -49

No files matched your search

@@ -221,16 +221,8 @@ class TC_GAME_API GameObject : public WorldObject, public GridObject<GameObject>
void SetLootGenerationTime();
uint32 GetLootGenerationTime() const { return m_lootGenerationTime; }
void AddToSkillupList(ObjectGuid::LowType PlayerGuidLow) { m_SkillupList.push_back(PlayerGuidLow); }
bool IsInSkillupList(ObjectGuid::LowType PlayerGuidLow) const
{
for (std::list<ObjectGuid::LowType>::const_iterator i = m_SkillupList.begin(); i != m_SkillupList.end(); ++i)
if (*i == PlayerGuidLow)
return true;
return false;
}
void ClearSkillupList() { m_SkillupList.clear(); }
void AddToSkillupList(ObjectGuid::LowType playerLowGUID) { m_SkillupList.push_back(playerLowGUID); }
bool IsInSkillupList(ObjectGuid::LowType playerLowGUID) const { return std::find(m_SkillupList.begin(), m_SkillupList.end(), playerLowGUID) != m_SkillupList.end(); }
void AddUniqueUse(Player* player);
void AddUse() { ++m_usetimes; }
@@ -5343,39 +5343,6 @@ bool Player::UpdateFishingSkill()
return false;
}
void Player::GiveXpForGather(uint32 const& skillId)
{
// Skip if the profession is no gather profession
if (skillId != SKILL_HERBALISM && skillId != SKILL_MINING && skillId != SKILL_ARCHAEOLOGY)
return;
uint32 zoneId = GetZoneId();
WorldMapAreaEntry const* areaEntry = sWorldMapAreaStore.LookupEntry(zoneId);
if (!areaEntry)
return;
uint8 levelDiff = std::abs(int32(areaEntry->LevelRangeMax - getLevel()));
uint8 level = 0;
if (levelDiff >= 10 && levelDiff < 20)
level = Trinity::XP::GetGrayLevel(getLevel()) + 1;
else if (levelDiff >= 20)
level = Trinity::XP::GetGrayLevel(getLevel());
else
level = getLevel() + 3;
uint32 xp = Trinity::XP::BaseGain(level, areaEntry->LevelRangeMax, sDBCManager.GetContentLevelsForMapAndZone(GetMapId(), zoneId)) * 2;
if (!xp || levelDiff >= 20)
return;
else if (levelDiff >= 15)
xp = uint32(xp * (1 - (levelDiff / 24)));
xp *= sWorld->getRate(RATE_XP_KILL);
GiveXP(xp, nullptr);
}
void Player::SurveyDigSite()
{
_archaeology->UseSite();
-1
View File
@@ -1754,7 +1754,6 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
bool UpdateCraftSkill(SpellInfo const* spellInfo);
bool UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLevel, uint32 Multiplicator = 1);
bool UpdateFishingSkill();
void GiveXpForGather(uint32 const& skillId);
void SurveyDigSite();
void NotifyRequestResearchHistory();
+1 -5
View File
@@ -1742,12 +1742,8 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex)
if (gameObjTarget)
{
// Allow one skill-up until respawned
if (!gameObjTarget->IsInSkillupList(player->GetGUID().GetCounter()) &&
player->UpdateGatherSkill(skillId, pureSkillValue, reqSkillValue))
{
if (!gameObjTarget->IsInSkillupList(player->GetGUID().GetCounter()) && player->UpdateGatherSkill(skillId, pureSkillValue, reqSkillValue))
gameObjTarget->AddToSkillupList(player->GetGUID().GetCounter());
player->GiveXpForGather(skillId);
}
}
else if (itemTarget)
{