Core/Players: - Fixed auto learning class abilities that are rewarded from quests if starting Exile's Reach in case player chose not to start there
Port From (https://github.com/TrinityCore/TrinityCore/commit/b4bdc4eea678628ffdfda9bf2c1f8c9f02b7b7f1)
This commit is contained in:
@@ -46,6 +46,11 @@ namespace Framework.Constants
|
|||||||
RewardedFromQuest = 4 // Learned as quest reward, also re-learned if missing
|
RewardedFromQuest = 4 // Learned as quest reward, also re-learned if missing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum SkillLineAbilityFlags
|
||||||
|
{
|
||||||
|
CanFallbackToLearnedOnSkillLearn = 0x80, // The skill is rewarded from a quest if player started on exile's reach
|
||||||
|
}
|
||||||
|
|
||||||
public enum Anim
|
public enum Anim
|
||||||
{
|
{
|
||||||
Stand = 0,
|
Stand = 0,
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ namespace Game.DataStorage
|
|||||||
public AbilityLearnType AcquireMethod;
|
public AbilityLearnType AcquireMethod;
|
||||||
public ushort TrivialSkillLineRankHigh;
|
public ushort TrivialSkillLineRankHigh;
|
||||||
public ushort TrivialSkillLineRankLow;
|
public ushort TrivialSkillLineRankLow;
|
||||||
public int Flags;
|
public SkillLineAbilityFlags Flags;
|
||||||
public byte NumSkillUps;
|
public byte NumSkillUps;
|
||||||
public short UniqueBit;
|
public short UniqueBit;
|
||||||
public short TradeSkillCategoryID;
|
public short TradeSkillCategoryID;
|
||||||
|
|||||||
@@ -1580,8 +1580,19 @@ namespace Game.Entities
|
|||||||
if (spellInfo == null)
|
if (spellInfo == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (ability.AcquireMethod != AbilityLearnType.OnSkillValue && ability.AcquireMethod != AbilityLearnType.OnSkillLearn)
|
switch (ability.AcquireMethod)
|
||||||
continue;
|
{
|
||||||
|
case AbilityLearnType.OnSkillValue:
|
||||||
|
case AbilityLearnType.OnSkillLearn:
|
||||||
|
break;
|
||||||
|
case AbilityLearnType.RewardedFromQuest:
|
||||||
|
if (!ability.Flags.HasAnyFlag(SkillLineAbilityFlags.CanFallbackToLearnedOnSkillLearn) ||
|
||||||
|
!spellInfo.MeetsFutureSpellPlayerCondition(this))
|
||||||
|
continue;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// AcquireMethod == 2 && NumSkillUps == 1 -. automatically learn riding skill spell, else we skip it (client shows riding in spellbook as trainable).
|
// 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 != AbilityLearnType.OnSkillLearn || ability.NumSkillUps != 1))
|
if (skillId == (uint)SkillType.Riding && (ability.AcquireMethod != AbilityLearnType.OnSkillLearn || ability.NumSkillUps != 1))
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ namespace Game.Spells
|
|||||||
IconFileDataId = _misc.SpellIconFileDataID;
|
IconFileDataId = _misc.SpellIconFileDataID;
|
||||||
ActiveIconFileDataId = _misc.ActiveIconFileDataID;
|
ActiveIconFileDataId = _misc.ActiveIconFileDataID;
|
||||||
ContentTuningId = _misc.ContentTuningID;
|
ContentTuningId = _misc.ContentTuningID;
|
||||||
|
ShowFutureSpellPlayerConditionID = (uint)_misc.ShowFutureSpellPlayerConditionID;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (visuals != null)
|
if (visuals != null)
|
||||||
@@ -3458,6 +3459,15 @@ namespace Game.Spells
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool MeetsFutureSpellPlayerCondition(Player player)
|
||||||
|
{
|
||||||
|
if (ShowFutureSpellPlayerConditionID == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
var playerCondition = CliDB.PlayerConditionStorage.LookupByKey(ShowFutureSpellPlayerConditionID);
|
||||||
|
return playerCondition == null || ConditionManager.IsPlayerMeetingCondition(player, playerCondition);
|
||||||
|
}
|
||||||
|
|
||||||
public static SpellCastTargetFlags GetTargetFlagMask(SpellTargetObjectTypes objType)
|
public static SpellCastTargetFlags GetTargetFlagMask(SpellTargetObjectTypes objType)
|
||||||
{
|
{
|
||||||
switch (objType)
|
switch (objType)
|
||||||
@@ -3600,6 +3610,7 @@ namespace Game.Spells
|
|||||||
public uint IconFileDataId { get; set; }
|
public uint IconFileDataId { get; set; }
|
||||||
public uint ActiveIconFileDataId { get; set; }
|
public uint ActiveIconFileDataId { get; set; }
|
||||||
public uint ContentTuningId { get; set; }
|
public uint ContentTuningId { get; set; }
|
||||||
|
public uint ShowFutureSpellPlayerConditionID { get; set; }
|
||||||
public LocalizedString SpellName { get; set; }
|
public LocalizedString SpellName { get; set; }
|
||||||
public float ConeAngle { get; set; }
|
public float ConeAngle { get; set; }
|
||||||
public float Width { get; set; }
|
public float Width { get; set; }
|
||||||
|
|||||||
Reference in New Issue
Block a user