Core/Skinning: Update correct skinning skill according to creature expansion

Port From (https://github.com/TrinityCore/TrinityCore/commit/229a7ac79d38b9db76387f92e846c04c151ad3aa)
This commit is contained in:
hondacrx
2023-04-05 08:22:24 -04:00
parent 6361e60c8b
commit d3297b96a2
4 changed files with 45 additions and 63 deletions
-8
View File
@@ -5180,14 +5180,6 @@ namespace Game.Spells
if (loot != null && (!loot.IsLooted() || loot.loot_type == LootType.Skinning))
return SpellCastResult.TargetNotLooted;
SkillType skill = creature.GetCreatureTemplate().GetRequiredLootSkill();
ushort skillValue = m_caster.ToPlayer().GetSkillValue(skill);
uint TargetLevel = m_targets.GetUnitTarget().GetLevelForTarget(m_caster);
int ReqValue = (int)(skillValue < 100 ? (TargetLevel - 10) * 10 : TargetLevel * 5);
if (ReqValue > skillValue)
return SpellCastResult.LowCastlevel;
break;
}
case SpellEffectName.OpenLock:
+14 -5
View File
@@ -3450,6 +3450,7 @@ namespace Game.Spells
loot.FillLoot(creature.GetCreatureTemplate().SkinLootId, LootStorage.Skinning, player, true);
player.SendLoot(loot);
// This formula is still used (10.0.5.48526)
if (skill == SkillType.Skinning)
{
int reqValue;
@@ -3478,12 +3479,20 @@ namespace Game.Spells
else
reqValue = 900;
// TODO: Specialize skillid for each expansion
// new db field?
// tied to one of existing expansion fields in creature_template?
ContentTuningRecord contentTuning = CliDB.ContentTuningStorage.LookupByKey(creature.GetContentTuning());
if (contentTuning == null)
return;
// Double chances for elites
m_caster.ToPlayer().UpdateGatherSkill(skill, (uint)damage, (uint)reqValue, (uint)(creature.IsElite() ? 2 : 1));
uint skinningSkill = player.GetProfessionSkillForExp(skill, contentTuning.ExpansionID);
if (skinningSkill == 0)
return;
uint pureSkillValue = player.GetPureSkillValue(skinningSkill);
if (pureSkillValue != 0)
{
// Double chances for elites
player.UpdateGatherSkill(skinningSkill, pureSkillValue, (uint)reqValue, creature.IsElite() ? 2 : 1u);
}
}
}