Core/Spells: Implement using different difficulty data from all spell related db2s, not just SpellEffect and SpellPower

Port From (https://github.com/TrinityCore/TrinityCore/commit/c7306439e7004288fb85890d6a5f730cf1761d71)
This commit is contained in:
hondacrx
2020-06-18 12:39:39 -04:00
parent f0942a257e
commit d7954f4fc7
89 changed files with 1738 additions and 1893 deletions
+9 -3
View File
@@ -48,7 +48,7 @@ namespace Game.Scripting
bool allValid = true;
foreach (uint spellId in spellIds)
{
if (!Global.SpellMgr.HasSpellInfo(spellId))
if (!Global.SpellMgr.HasSpellInfo(spellId, Difficulty.None))
{
Log.outError(LogFilter.Scripts, "BaseSpellScript.ValidateSpellInfo: Spell {0} does not exist.", spellId);
allValid = false;
@@ -494,11 +494,12 @@ namespace Game.Scripting
public Unit GetCaster() { return m_spell.GetCaster(); }
public Unit GetOriginalCaster() { return m_spell.GetOriginalCaster(); }
public SpellInfo GetSpellInfo() { return m_spell.GetSpellInfo(); }
public Difficulty GetCastDifficulty() { return m_spell.GetCastDifficulty(); }
public SpellValue GetSpellValue() { return m_spell.m_spellValue; }
public SpellEffectInfo GetEffectInfo(uint effIndex)
{
return m_spell.GetEffect(effIndex);
return GetSpellInfo().GetEffect(effIndex);
}
// methods useable after spell is prepared
@@ -773,7 +774,7 @@ namespace Game.Scripting
public delegate void AuraEffectAbsorbDelegate(AuraEffect aura, DamageInfo damageInfo, ref uint absorbAmount);
public delegate void AuraEffectSplitDelegate(AuraEffect aura, DamageInfo damageInfo, uint splitAmount);
public delegate bool AuraCheckProcDelegate(ProcEventInfo info);
public delegate bool AuraCheckEffectProcDelegate(AuraEffect aura , ProcEventInfo info);
public delegate bool AuraCheckEffectProcDelegate(AuraEffect aura, ProcEventInfo info);
public delegate void AuraProcDelegate(ProcEventInfo info);
public delegate void AuraEffectProcDelegate(AuraEffect aura, ProcEventInfo info);
@@ -1422,5 +1423,10 @@ namespace Game.Scripting
}
// returns AuraApplication object of currently processed target
public AuraApplication GetTargetApplication() { return m_auraApplication; }
public Difficulty GetCastDifficulty()
{
return GetAura().GetCastDifficulty();
}
}
}