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:
@@ -117,7 +117,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.HeraldVolazj
|
||||
// phase the player
|
||||
target.CastSpell(target, SpellIds.InsanityTarget + insanityHandled, true);
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.InsanityTarget + insanityHandled);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.InsanityTarget + insanityHandled, GetDifficulty());
|
||||
if (spellInfo == null)
|
||||
return;
|
||||
|
||||
|
||||
@@ -1719,7 +1719,7 @@ Fall Time: 824
|
||||
|
||||
void HandleRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
SpellInfo damageInfo = Global.SpellMgr.GetSpellInfo(GunshipSpells.RocketPackDamage);
|
||||
SpellInfo damageInfo = Global.SpellMgr.GetSpellInfo(GunshipSpells.RocketPackDamage, GetCastDifficulty());
|
||||
GetTarget().CastCustomSpell(GunshipSpells.RocketPackDamage, SpellValueMod.BasePoint0, (int)(2 * (damageInfo.GetEffect(0).CalcValue() + aurEff.GetTickNumber() * aurEff.GetPeriod())), null, TriggerCastFlags.FullMask);
|
||||
GetTarget().CastSpell(null, GunshipSpells.RocketBurst, TriggerCastFlags.FullMask);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
|
||||
player.PlayerTalkClass.ClearMenus();
|
||||
player.CLOSE_GOSSIP_MENU();
|
||||
SpellInfo spell = Global.SpellMgr.GetSpellInfo(TeleportSpells[gossipListId]);
|
||||
SpellInfo spell = Global.SpellMgr.GetSpellInfo(TeleportSpells[gossipListId], Difficulty.None);
|
||||
if (spell == null)
|
||||
return false;
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
{
|
||||
if (player.IsInCombat())
|
||||
{
|
||||
SpellInfo spell = Global.SpellMgr.GetSpellInfo(TeleporterSpells.FROZEN_THRONE_TELEPORT);
|
||||
SpellInfo spell = Global.SpellMgr.GetSpellInfo(TeleporterSpells.FROZEN_THRONE_TELEPORT, Difficulty.None);
|
||||
if (spell != null)
|
||||
{
|
||||
ObjectGuid castId = ObjectGuid.Create(HighGuid.Cast, SpellCastSource.Normal, player.GetMapId(), spell.Id, player.GetMap().GenerateLowGuid(HighGuid.Cast));
|
||||
|
||||
@@ -519,7 +519,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
if (target.HasAura(Spells.Impaled))
|
||||
return false;
|
||||
|
||||
SpellEffectInfo effect = GetSpellInfo().GetEffect(target.GetMap().GetDifficultyID(), 0);
|
||||
SpellEffectInfo effect = GetSpellInfo().GetEffect(0);
|
||||
if (effect != null)
|
||||
if (target.GetExactDist2d(GetOwner()) > effect.CalcRadius())
|
||||
return false;
|
||||
|
||||
@@ -263,7 +263,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
return;
|
||||
|
||||
int amount = (int)(damageInfo.GetDamage() / 2);
|
||||
SpellNonMeleeDamage log = new SpellNonMeleeDamage(drw, drw.GetVictim(), spellInfo.Id, spellInfo.GetSpellXSpellVisualId(drw), spellInfo.GetSchoolMask());
|
||||
SpellNonMeleeDamage log = new SpellNonMeleeDamage(drw, drw.GetVictim(), spellInfo, spellInfo.GetSpellXSpellVisualId(drw), spellInfo.GetSchoolMask());
|
||||
log.damage = (uint)amount;
|
||||
drw.DealDamage(drw.GetVictim(), (uint)amount, null, DamageEffectType.Direct, spellInfo.GetSchoolMask(), spellInfo, true);
|
||||
drw.SendSpellNonMeleeDamageLog(log);
|
||||
|
||||
@@ -701,7 +701,7 @@ namespace Scripts.Spells.Druid
|
||||
if (player.GetSkillValue(SkillType.Riding) < 75)
|
||||
return SpellCastResult.ApprenticeRidingRequirement;
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(player.IsInWater() ? SpellIds.FormAquatic : SpellIds.FormStag);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(player.IsInWater() ? SpellIds.FormAquatic : SpellIds.FormStag, GetCastDifficulty());
|
||||
return spellInfo.CheckLocation(player.GetMapId(), player.GetZoneId(), player.GetAreaId(), player);
|
||||
}
|
||||
|
||||
@@ -758,7 +758,7 @@ namespace Scripts.Spells.Druid
|
||||
SpellCastResult CheckLocationForForm(uint spell)
|
||||
{
|
||||
Player player = GetTarget().ToPlayer();
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spell);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spell, GetCastDifficulty());
|
||||
return spellInfo.CheckLocation(player.GetMapId(), player.GetZoneId(), player.GetAreaId(), player);
|
||||
}
|
||||
}
|
||||
@@ -821,7 +821,7 @@ namespace Scripts.Spells.Druid
|
||||
SpellCastResult CheckLocationForForm(uint spell_id)
|
||||
{
|
||||
Player player = GetTarget().ToPlayer();
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spell_id);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spell_id, GetCastDifficulty());
|
||||
|
||||
if (!player.GetMap().IsOutdoors(player.GetPhaseShift(), player.GetPositionX(), player.GetPositionY(), player.GetPositionZ()))
|
||||
return SpellCastResult.OnlyOutdoors;
|
||||
@@ -900,9 +900,9 @@ namespace Scripts.Spells.Druid
|
||||
Unit caster = eventInfo.GetActor();
|
||||
Unit target = eventInfo.GetProcTarget();
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.Languish);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.Languish, GetCastDifficulty());
|
||||
int amount = (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount());
|
||||
amount /= (int)spellInfo.GetMaxTicks(Difficulty.None);
|
||||
amount /= (int)spellInfo.GetMaxTicks();
|
||||
// Add remaining ticks to damage done
|
||||
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.Languish, AuraType.PeriodicDamage);
|
||||
|
||||
|
||||
@@ -1628,7 +1628,7 @@ namespace Scripts.Spells.Generic
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
SpellInfo spell = Global.SpellMgr.GetSpellInfo(m_scriptSpellId);
|
||||
SpellInfo spell = Global.SpellMgr.GetSpellInfo(m_scriptSpellId, Difficulty.None);
|
||||
|
||||
if (spell.HasEffect(SpellEffectName.ScriptEffect))
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleScriptEffect, SpellConst.EffectFirstFound, SpellEffectName.ScriptEffect));
|
||||
|
||||
@@ -434,7 +434,7 @@ namespace Scripts.Spells.Hunter
|
||||
// immediately finishes the cooldown on your other Hunter abilities except Bestial Wrath
|
||||
GetCaster().GetSpellHistory().ResetCooldowns(p =>
|
||||
{
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(p.Key);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(p.Key, GetCastDifficulty());
|
||||
|
||||
//! If spellId in cooldown map isn't valid, the above will return a null pointer.
|
||||
if (spellInfo.SpellFamilyName == SpellFamilyNames.Hunter &&
|
||||
|
||||
@@ -555,9 +555,9 @@ namespace Scripts.Spells.Items
|
||||
uint spellId = 0;
|
||||
int amount = (int)(eventInfo.GetDamageInfo().GetDamage() * 0.4f);
|
||||
|
||||
if (eventInfo.GetDamageInfo().GetSpellInfo().HasEffect(Difficulty.None, SpellEffectName.Heal))
|
||||
if (eventInfo.GetDamageInfo().GetSpellInfo().HasEffect(SpellEffectName.Heal))
|
||||
spellId = SpellIds.AlchemistStoneExtraHeal;
|
||||
else if (eventInfo.GetDamageInfo().GetSpellInfo().HasEffect(Difficulty.None, SpellEffectName.Energize))
|
||||
else if (eventInfo.GetDamageInfo().GetSpellInfo().HasEffect(SpellEffectName.Energize))
|
||||
spellId = SpellIds.AlchemistStoneExtraMana;
|
||||
|
||||
if (spellId == 0)
|
||||
@@ -779,7 +779,7 @@ namespace Scripts.Spells.Items
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.DeadlyPrecision);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.DeadlyPrecision, GetCastDifficulty());
|
||||
GetCaster().CastCustomSpell(spellInfo.Id, SpellValueMod.AuraStack, (int)spellInfo.StackAmount, GetCaster(), true);
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace Scripts.Spells.Mage
|
||||
}
|
||||
|
||||
GetTarget().SetHealth(GetTarget().CountPctFromMaxHealth(effect1.GetAmount()));
|
||||
GetTarget().CastSpell(GetTarget(), GetAura().GetSpellEffectInfo(2).TriggerSpell, TriggerCastFlags.FullMask);
|
||||
GetTarget().CastSpell(GetTarget(), GetSpellInfo().GetEffect(2).TriggerSpell, TriggerCastFlags.FullMask);
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.CauterizeDot, TriggerCastFlags.FullMask);
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.Cauterized, TriggerCastFlags.FullMask);
|
||||
}
|
||||
@@ -288,10 +288,10 @@ namespace Scripts.Spells.Mage
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
SpellInfo igniteDot = Global.SpellMgr.GetSpellInfo(SpellIds.Ignite);
|
||||
SpellInfo igniteDot = Global.SpellMgr.GetSpellInfo(SpellIds.Ignite, GetCastDifficulty());
|
||||
int pct = aurEff.GetAmount();
|
||||
|
||||
int amount = (int)(MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), pct) / igniteDot.GetMaxTicks(Difficulty.None));
|
||||
int amount = (int)(MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), pct) / igniteDot.GetMaxTicks());
|
||||
amount += (int)eventInfo.GetProcTarget().GetRemainingPeriodicAmount(eventInfo.GetActor().GetGUID(), SpellIds.Ignite, AuraType.PeriodicDamage);
|
||||
GetTarget().CastCustomSpell(SpellIds.Ignite, SpellValueMod.BasePoint0, amount, eventInfo.GetProcTarget(), true, null, aurEff);
|
||||
}
|
||||
@@ -464,7 +464,7 @@ namespace Scripts.Spells.Mage
|
||||
void Apply(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
List<TempSummon> minions = new List<TempSummon>();
|
||||
GetTarget().GetAllMinionsByEntry(minions, (uint)Global.SpellMgr.GetSpellInfo(SpellIds.RingOfFrostSummon).GetEffect(0).MiscValue);
|
||||
GetTarget().GetAllMinionsByEntry(minions, (uint)Global.SpellMgr.GetSpellInfo(SpellIds.RingOfFrostSummon, GetCastDifficulty()).GetEffect(0).MiscValue);
|
||||
|
||||
// Get the last summoned RoF, save it and despawn older ones
|
||||
foreach (var summon in minions)
|
||||
@@ -513,7 +513,7 @@ namespace Scripts.Spells.Mage
|
||||
void FilterTargets(List<WorldObject> targets)
|
||||
{
|
||||
WorldLocation dest = GetExplTargetDest();
|
||||
float outRadius = Global.SpellMgr.GetSpellInfo(SpellIds.RingOfFrostSummon).GetEffect(0).CalcRadius();
|
||||
float outRadius = Global.SpellMgr.GetSpellInfo(SpellIds.RingOfFrostSummon, GetCastDifficulty()).GetEffect(0).CalcRadius();
|
||||
float inRadius = 6.5f;
|
||||
|
||||
targets.RemoveAll(target =>
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace Scripts.Spells.Monk
|
||||
{
|
||||
if (GetExplTargetUnit().GetEntry() != BlackOxStatusEntry)
|
||||
{
|
||||
SpellInfo singleTarget = Global.SpellMgr.GetSpellInfo(SpellIds.ProvokeSingleTarget);
|
||||
SpellInfo singleTarget = Global.SpellMgr.GetSpellInfo(SpellIds.ProvokeSingleTarget, GetCastDifficulty());
|
||||
SpellCastResult singleTargetExplicitResult = singleTarget.CheckExplicitTarget(GetCaster(), GetExplTargetUnit());
|
||||
if (singleTargetExplicitResult != SpellCastResult.SpellCastOk)
|
||||
return singleTargetExplicitResult;
|
||||
|
||||
@@ -456,7 +456,7 @@ namespace Scripts.Spells.Paladin
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
SpellInfo firstRankSpellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.HolyShockR1);
|
||||
SpellInfo firstRankSpellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.HolyShockR1, Difficulty.None);
|
||||
if (firstRankSpellInfo == null)
|
||||
return false;
|
||||
|
||||
@@ -596,7 +596,7 @@ namespace Scripts.Spells.Paladin
|
||||
{
|
||||
if (eff.GetSpellInfo().GetSpellSpecific() == SpellSpecificType.Seal && eff.GetEffIndex() == 2)
|
||||
{
|
||||
if (Global.SpellMgr.HasSpellInfo((uint)eff.GetAmount()))
|
||||
if (Global.SpellMgr.HasSpellInfo((uint)eff.GetAmount(), GetCastDifficulty()))
|
||||
{
|
||||
spellId = (uint)eff.GetAmount();
|
||||
break;
|
||||
@@ -923,9 +923,9 @@ namespace Scripts.Spells.Paladin
|
||||
Unit caster = eventInfo.GetActor();
|
||||
Unit target = eventInfo.GetProcTarget();
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.HolyMending);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.HolyMending, GetCastDifficulty());
|
||||
int amount = (int)MathFunctions.CalculatePct(healInfo.GetHeal(), aurEff.GetAmount());
|
||||
amount /= (int)spellInfo.GetMaxTicks(Difficulty.None);
|
||||
amount /= (int)spellInfo.GetMaxTicks();
|
||||
// Add remaining ticks to damage done
|
||||
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.HolyMending, AuraType.PeriodicHeal);
|
||||
|
||||
|
||||
@@ -409,8 +409,8 @@ namespace Scripts.Spells.Priest
|
||||
if (healInfo == null || healInfo.GetHeal() == 0)
|
||||
return;
|
||||
|
||||
SpellInfo triggeredSpellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.GlyphOfPrayerOfHealingHeal);
|
||||
int heal = (int)(MathFunctions.CalculatePct(healInfo.GetHeal(), aurEff.GetAmount()) / triggeredSpellInfo.GetMaxTicks(Difficulty.None));
|
||||
SpellInfo triggeredSpellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.GlyphOfPrayerOfHealingHeal, GetCastDifficulty());
|
||||
int heal = (int)(MathFunctions.CalculatePct(healInfo.GetHeal(), aurEff.GetAmount()) / triggeredSpellInfo.GetMaxTicks());
|
||||
GetTarget().CastCustomSpell(SpellIds.GlyphOfPrayerOfHealingHeal, SpellValueMod.BasePoint0, heal, eventInfo.GetProcTarget(), true, null, aurEff);
|
||||
}
|
||||
|
||||
@@ -566,7 +566,7 @@ namespace Scripts.Spells.Priest
|
||||
SpellCastTargets targets = new SpellCastTargets();
|
||||
targets.SetDst(destPos);
|
||||
targets.SetUnitTarget(GetCaster());
|
||||
GetHitUnit().CastSpell(targets, Global.SpellMgr.GetSpellInfo((uint)GetEffectValue()), null);
|
||||
GetHitUnit().CastSpell(targets, Global.SpellMgr.GetSpellInfo((uint)GetEffectValue(), GetCastDifficulty()), null);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
@@ -702,7 +702,7 @@ namespace Scripts.Spells.Priest
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
SpellInfo firstRankSpellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.PenanceR1);
|
||||
SpellInfo firstRankSpellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.PenanceR1, Difficulty.None);
|
||||
if (firstRankSpellInfo == null)
|
||||
return false;
|
||||
|
||||
@@ -997,9 +997,9 @@ namespace Scripts.Spells.Priest
|
||||
if (healInfo == null || healInfo.GetHeal() == 0)
|
||||
return;
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.BlessedHealing);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.BlessedHealing, GetCastDifficulty());
|
||||
int amount = (int)MathFunctions.CalculatePct(healInfo.GetHeal(), aurEff.GetAmount());
|
||||
amount /= (int)spellInfo.GetMaxTicks(Difficulty.None);
|
||||
amount /= (int)spellInfo.GetMaxTicks();
|
||||
|
||||
// Add remaining ticks to healing done
|
||||
Unit caster = eventInfo.GetActor();
|
||||
@@ -1134,7 +1134,7 @@ namespace Scripts.Spells.Priest
|
||||
{
|
||||
SpellCastTargets targets = new SpellCastTargets();
|
||||
targets.SetDst(destPos);
|
||||
GetCaster().CastSpell(targets, Global.SpellMgr.GetSpellInfo(SpellIds.AngelicFeatherAreatrigger), null);
|
||||
GetCaster().CastSpell(targets, Global.SpellMgr.GetSpellInfo(SpellIds.AngelicFeatherAreatrigger, GetCastDifficulty()), null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -612,7 +612,7 @@ namespace Scripts.Spells.Shaman
|
||||
|
||||
void ResetCooldown()
|
||||
{
|
||||
GetCaster().GetSpellHistory().RestoreCharge(Global.SpellMgr.GetSpellInfo(SpellIds.LavaBurst).ChargeCategoryId);
|
||||
GetCaster().GetSpellHistory().RestoreCharge(Global.SpellMgr.GetSpellInfo(SpellIds.LavaBurst, GetCastDifficulty()).ChargeCategoryId);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
@@ -747,9 +747,9 @@ namespace Scripts.Spells.Shaman
|
||||
if (damageInfo == null || damageInfo.GetDamage() == 0)
|
||||
return;
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.Electrified);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.Electrified, GetCastDifficulty());
|
||||
int amount = (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount());
|
||||
amount /= (int)spellInfo.GetMaxTicks(Difficulty.None);
|
||||
amount /= (int)spellInfo.GetMaxTicks();
|
||||
|
||||
// Add remaining ticks to damage done
|
||||
Unit caster = eventInfo.GetActor();
|
||||
@@ -781,9 +781,9 @@ namespace Scripts.Spells.Shaman
|
||||
if (damageInfo == null || damageInfo.GetDamage() == 0)
|
||||
return;
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.LavaBurstBonusDamage);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.LavaBurstBonusDamage, GetCastDifficulty());
|
||||
int amount = (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount());
|
||||
amount /= (int)spellInfo.GetMaxTicks(Difficulty.None);
|
||||
amount /= (int)spellInfo.GetMaxTicks();
|
||||
|
||||
// Add remaining ticks to damage done
|
||||
Unit caster = eventInfo.GetActor();
|
||||
@@ -847,9 +847,9 @@ namespace Scripts.Spells.Shaman
|
||||
if (healInfo == null || healInfo.GetHeal() == 0)
|
||||
return;
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.ChainedHeal);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.ChainedHeal, GetCastDifficulty());
|
||||
int amount = (int)MathFunctions.CalculatePct(healInfo.GetHeal(), aurEff.GetAmount());
|
||||
amount /= (int)spellInfo.GetMaxTicks(Difficulty.None);
|
||||
amount /= (int)spellInfo.GetMaxTicks();
|
||||
|
||||
// Add remaining ticks to healing done
|
||||
Unit caster = eventInfo.GetActor();
|
||||
|
||||
@@ -226,7 +226,7 @@ namespace Scripts.Spells.Warlock
|
||||
// WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST; allowing him to cast the WARLOCK_DEMONIC_CIRCLE_TELEPORT.
|
||||
// If not in range remove the WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST.
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.DemonicCircleTeleport);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.DemonicCircleTeleport, GetCastDifficulty());
|
||||
|
||||
if (GetTarget().IsWithinDist(circle, spellInfo.GetMaxRange(true)))
|
||||
{
|
||||
@@ -338,7 +338,7 @@ namespace Scripts.Spells.Warlock
|
||||
break;
|
||||
case CreatureFamily.Voidwalker:
|
||||
{
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.DemonicEmpowermentVoidwalker);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.DemonicEmpowermentVoidwalker, GetCastDifficulty());
|
||||
int hp = (int)targetCreature.CountPctFromMaxHealth(GetCaster().CalculateSpellDamage(targetCreature, spellInfo, 0));
|
||||
targetCreature.CastCustomSpell(targetCreature, SpellIds.DemonicEmpowermentVoidwalker, hp, 0, 0, true);
|
||||
break;
|
||||
@@ -556,7 +556,7 @@ namespace Scripts.Spells.Warlock
|
||||
if (modOwner)
|
||||
modOwner.ApplySpellMod(GetId(), SpellModOp.Cost, ref damage);
|
||||
|
||||
SpellNonMeleeDamage damageInfo = new SpellNonMeleeDamage(caster, caster, GetSpellInfo().Id, GetAura().GetSpellXSpellVisualId(), GetSpellInfo().SchoolMask, GetAura().GetCastGUID());
|
||||
SpellNonMeleeDamage damageInfo = new SpellNonMeleeDamage(caster, caster, GetSpellInfo(), GetAura().GetSpellXSpellVisualId(), GetSpellInfo().SchoolMask, GetAura().GetCastGUID());
|
||||
damageInfo.periodicLog = true;
|
||||
damageInfo.damage = damage;
|
||||
caster.DealSpellDamage(damageInfo, false);
|
||||
|
||||
@@ -823,7 +823,7 @@ namespace Scripts.Spells.Warrior
|
||||
//Get the Remaining Damage from the aura (if exist)
|
||||
int remainingDamage = (int)target.GetRemainingPeriodicAmount(target.GetGUID(), SpellIds.TraumaEffect, AuraType.PeriodicDamage);
|
||||
//Get 25% of damage from the spell casted (Slam & Whirlwind) plus Remaining Damage from Aura
|
||||
int damage = (int)(MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), aurEff.GetAmount()) / Global.SpellMgr.GetSpellInfo(SpellIds.TraumaEffect).GetMaxTicks(Difficulty.None)) + remainingDamage;
|
||||
int damage = (int)(MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), aurEff.GetAmount()) / Global.SpellMgr.GetSpellInfo(SpellIds.TraumaEffect, GetCastDifficulty()).GetMaxTicks()) + remainingDamage;
|
||||
GetCaster().CastCustomSpell(SpellIds.TraumaEffect, SpellValueMod.BasePoint0, damage, target, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace Scripts.World
|
||||
{
|
||||
DateTime now = GameTime.GetGameTimeSystemPoint();
|
||||
uint cooldownDuration = pair.Value.CooldownEnd > now ? (uint)(pair.Value.CooldownEnd - now).TotalMilliseconds : 0;
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(pair.Key);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(pair.Key, Difficulty.None);
|
||||
return spellInfo.RecoveryTime < 10 * Time.Minute * Time.InMilliseconds
|
||||
&& spellInfo.CategoryRecoveryTime < 10 * Time.Minute * Time.InMilliseconds
|
||||
&& !pair.Value.OnHold
|
||||
@@ -113,7 +113,7 @@ namespace Scripts.World
|
||||
// remove cooldowns on spells that have < 10 min CD and has no onHold
|
||||
player.GetSpellHistory().ResetCooldowns(pair =>
|
||||
{
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(pair.Key);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(pair.Key, Difficulty.None);
|
||||
return spellInfo.RecoveryTime < 10 * Time.Minute * Time.InMilliseconds
|
||||
&& spellInfo.CategoryRecoveryTime < 10 * Time.Minute * Time.InMilliseconds
|
||||
&& !pair.Value.OnHold;
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace Scripts.World
|
||||
disabled = true;
|
||||
break;
|
||||
case 34475:
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(ItemScriptConst.SpellArcaneCharges);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(ItemScriptConst.SpellArcaneCharges, player.GetMap().GetDifficultyID());
|
||||
if (spellInfo != null)
|
||||
Spell.SendCastResult(player, spellInfo, 0, castId, SpellCastResult.NotOnGround);
|
||||
break;
|
||||
@@ -275,7 +275,7 @@ namespace Scripts.World
|
||||
|
||||
if (!player.GetTransport() || player.GetAreaId() != ItemScriptConst.AreaIdShatteredStraits)
|
||||
{
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(ItemScriptConst.SpellPetrovBomb);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(ItemScriptConst.SpellPetrovBomb, Difficulty.None);
|
||||
if (spellInfo != null)
|
||||
Spell.SendCastResult(player, spellInfo, 0, castId, SpellCastResult.NotHere);
|
||||
|
||||
|
||||
@@ -1907,7 +1907,7 @@ namespace Scripts.World.NpcSpecial
|
||||
break;
|
||||
}
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellId);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellId, Difficulty.None);
|
||||
if (spellInfo != null && spellInfo.GetEffect(0).Effect == SpellEffectName.SummonObjectWild)
|
||||
return (uint)spellInfo.GetEffect(0).MiscValue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user