Core/Spells: implement SPELLVALUE_CRIT_CHANCE
Port From (https://github.com/TrinityCore/TrinityCore/commit/13be704cb4619ef585ae0043580e2534f62e64aa)
This commit is contained in:
@@ -395,6 +395,7 @@ namespace Framework.Constants
|
|||||||
RadiusMod,
|
RadiusMod,
|
||||||
MaxTargets,
|
MaxTargets,
|
||||||
AuraStack,
|
AuraStack,
|
||||||
|
CritChance,
|
||||||
DurationPct
|
DurationPct
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6872,7 +6872,9 @@ namespace Game.Spells
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float critChance = m_caster.SpellCritChanceDone(this, null, m_spellSchoolMask, m_attackType);
|
float critChance = m_spellValue.CriticalChance;
|
||||||
|
if (critChance == 0.0f)
|
||||||
|
critChance = m_caster.SpellCritChanceDone(this, null, m_spellSchoolMask, m_attackType);
|
||||||
targetInfo.crit = RandomHelper.randChance(unit.SpellCritChanceTaken(m_caster, this, null, m_spellSchoolMask, critChance, m_attackType));
|
targetInfo.crit = RandomHelper.randChance(unit.SpellCritChanceTaken(m_caster, this, null, m_spellSchoolMask, critChance, m_attackType));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6965,6 +6967,9 @@ namespace Game.Spells
|
|||||||
case SpellValueMod.AuraStack:
|
case SpellValueMod.AuraStack:
|
||||||
m_spellValue.AuraStackAmount = value;
|
m_spellValue.AuraStackAmount = value;
|
||||||
break;
|
break;
|
||||||
|
case SpellValueMod.CritChance:
|
||||||
|
m_spellValue.CriticalChance = value / 100.0f; // @todo ugly /100 remove when basepoints are double
|
||||||
|
break;
|
||||||
case SpellValueMod.DurationPct:
|
case SpellValueMod.DurationPct:
|
||||||
m_spellValue.DurationMul = (float)value / 100.0f;
|
m_spellValue.DurationMul = (float)value / 100.0f;
|
||||||
break;
|
break;
|
||||||
@@ -7771,6 +7776,7 @@ namespace Game.Spells
|
|||||||
MaxAffectedTargets = proto.MaxAffectedTargets;
|
MaxAffectedTargets = proto.MaxAffectedTargets;
|
||||||
RadiusMod = 1.0f;
|
RadiusMod = 1.0f;
|
||||||
AuraStackAmount = 1;
|
AuraStackAmount = 1;
|
||||||
|
CriticalChance = 0.0f;
|
||||||
DurationMul = 1;
|
DurationMul = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7780,6 +7786,7 @@ namespace Game.Spells
|
|||||||
public float RadiusMod;
|
public float RadiusMod;
|
||||||
public int AuraStackAmount;
|
public int AuraStackAmount;
|
||||||
public float DurationMul;
|
public float DurationMul;
|
||||||
|
public float CriticalChance;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spell modifier (used for modify other spells)
|
// Spell modifier (used for modify other spells)
|
||||||
|
|||||||
@@ -2860,7 +2860,7 @@ namespace Game.Entities
|
|||||||
spellInfo._InitializeExplicitTargetMask();
|
spellInfo._InitializeExplicitTargetMask();
|
||||||
}
|
}
|
||||||
|
|
||||||
// addition for binary spells, ommit spells triggering other spells
|
// addition for binary spells, omit spells triggering other spells
|
||||||
foreach (var spellInfo in mSpellInfoMap.Values)
|
foreach (var spellInfo in mSpellInfoMap.Values)
|
||||||
{
|
{
|
||||||
if (!spellInfo.HasAttribute(SpellCustomAttributes.BinarySpell))
|
if (!spellInfo.HasAttribute(SpellCustomAttributes.BinarySpell))
|
||||||
|
|||||||
Reference in New Issue
Block a user