Core/Player: Automatically learn riding spells for certain race/class combinations
This commit is contained in:
@@ -1575,11 +1575,6 @@ namespace Game.Entities
|
|||||||
|
|
||||||
void LearnSkillRewardedSpells(uint skillId, uint skillValue)
|
void LearnSkillRewardedSpells(uint skillId, uint skillValue)
|
||||||
{
|
{
|
||||||
// bad hack to work around data being suited only for the client - AcquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN for riding
|
|
||||||
// client uses it to show riding in spellbook as trainable
|
|
||||||
if (skillId == (uint)SkillType.Riding)
|
|
||||||
return;
|
|
||||||
|
|
||||||
uint raceMask = getRaceMask();
|
uint raceMask = getRaceMask();
|
||||||
uint classMask = getClassMask();
|
uint classMask = getClassMask();
|
||||||
foreach (var ability in CliDB.SkillLineAbilityStorage.Values)
|
foreach (var ability in CliDB.SkillLineAbilityStorage.Values)
|
||||||
@@ -1594,6 +1589,10 @@ namespace Game.Entities
|
|||||||
if (ability.AcquireMethod != AbilytyLearnType.OnSkillValue && ability.AcquireMethod != AbilytyLearnType.OnSkillLearn)
|
if (ability.AcquireMethod != AbilytyLearnType.OnSkillValue && ability.AcquireMethod != AbilytyLearnType.OnSkillLearn)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// AcquireMethod == 2 && NumSkillUps == 1 --> automatically learn riding skill spell, else we skip it (client shows riding in spellbook as trainable).
|
||||||
|
if (skillId == (uint)SkillType.Riding && (ability.AcquireMethod != AbilytyLearnType.OnSkillLearn || ability.NumSkillUps != 1))
|
||||||
|
continue;
|
||||||
|
|
||||||
// Check race if set
|
// Check race if set
|
||||||
if (ability.RaceMask != 0 && !Convert.ToBoolean(ability.RaceMask & raceMask))
|
if (ability.RaceMask != 0 && !Convert.ToBoolean(ability.RaceMask & raceMask))
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user