Fixed Spirit of Redemption
Removed old Spirit of Redemption code Removed unexplainable duration limit from SpellInfo::GetMaxTicks
This commit is contained in:
@@ -1710,7 +1710,7 @@ namespace Game.BattleGrounds
|
||||
if (pair.Value.Team == Team)
|
||||
{
|
||||
Player player = Global.ObjAccessor.FindPlayer(pair.Key);
|
||||
if (player && player.IsAlive() && player.GetShapeshiftForm() != ShapeShiftForm.SpiritOfRedemption)
|
||||
if (player && player.IsAlive())
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1450,33 +1450,8 @@ namespace Game.Entities
|
||||
if (player != null)
|
||||
player.UpdateCriteria(CriteriaTypes.GetKillingBlows, 1, 0, 0, victim);
|
||||
|
||||
// if talent known but not triggered (check priest class for speedup check)
|
||||
bool spiritOfRedemption = false;
|
||||
if (victim.IsTypeId(TypeId.Player) && victim.GetClass() == Class.Priest)
|
||||
{
|
||||
AuraEffect spiritOfRedemptionEffect = GetAuraEffect(20711, 0);
|
||||
if (spiritOfRedemptionEffect != null)
|
||||
{
|
||||
// save value before aura remove
|
||||
uint ressSpellId = victim.GetUInt32Value(PlayerFields.SelfResSpell);
|
||||
if (ressSpellId == 0)
|
||||
ressSpellId = victim.ToPlayer().GetResurrectionSpellId();
|
||||
// Remove all expected to remove at death auras (most important negative case like DoT or periodic triggers)
|
||||
victim.RemoveAllAurasOnDeath();
|
||||
// restore for use at real death
|
||||
victim.SetUInt32Value(PlayerFields.SelfResSpell, ressSpellId);
|
||||
|
||||
// FORM_SPIRIT_OF_REDEMPTION and related auras
|
||||
victim.CastSpell(victim, 27827, true, null, spiritOfRedemptionEffect);
|
||||
spiritOfRedemption = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!spiritOfRedemption)
|
||||
{
|
||||
Log.outDebug(LogFilter.Unit, "SET JUST_DIED");
|
||||
victim.setDeathState(DeathState.JustDied);
|
||||
}
|
||||
Log.outDebug(LogFilter.Unit, "SET JUST_DIED");
|
||||
victim.setDeathState(DeathState.JustDied);
|
||||
|
||||
// Inform pets (if any) when player kills target)
|
||||
// MUST come after victim.setDeathState(JUST_DIED); or pet next target
|
||||
@@ -2378,7 +2353,7 @@ namespace Game.Entities
|
||||
// We're going to call functions which can modify content of the list during iteration over it's elements
|
||||
// Let's copy the list so we can prevent iterator invalidation
|
||||
var vSchoolAbsorbCopy = victim.GetAuraEffectsByType(AuraType.SchoolAbsorb);
|
||||
vSchoolAbsorbCopy.Sort();//new AbsorbAuraOrderPred());todo fix me
|
||||
vSchoolAbsorbCopy.Sort(new AbsorbAuraOrderPred());
|
||||
|
||||
// absorb without mana cost
|
||||
foreach (var eff in vSchoolAbsorbCopy)
|
||||
|
||||
@@ -666,7 +666,7 @@ namespace Game.Spells
|
||||
case AuraType.MechanicImmunity:
|
||||
case AuraType.ModMechanicResistance:
|
||||
// compare mechanic
|
||||
if (spellInfo == null || !Convert.ToBoolean(spellInfo.GetAllEffectsMechanicMask() & (1 << GetMiscValue())))
|
||||
if (spellInfo == null || !Convert.ToBoolean(spellInfo.GetAllEffectsMechanicMask() & (1 << GetMiscValue())))
|
||||
result = false;
|
||||
break;
|
||||
case AuraType.ModCastingSpeedNotStack:
|
||||
@@ -796,6 +796,7 @@ namespace Game.Spells
|
||||
case ShapeShiftForm.SpiritOfRedemption:
|
||||
spellId = 27792;
|
||||
spellId2 = 27795;
|
||||
spellId3 = 62371;
|
||||
break;
|
||||
case ShapeShiftForm.Shadowform:
|
||||
if (target.HasAura(107906)) // Glyph of Shadow
|
||||
@@ -1225,8 +1226,6 @@ namespace Game.Spells
|
||||
if (!target.IsStandState())
|
||||
target.SetStandState(UnitStandStateType.Stand);
|
||||
}
|
||||
|
||||
target.SetHealth(1);
|
||||
}
|
||||
// die at aura end
|
||||
else if (target.IsAlive())
|
||||
@@ -6235,4 +6234,47 @@ namespace Game.Spells
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
class AbsorbAuraOrderPred : Comparer<AuraEffect>
|
||||
{
|
||||
public AbsorbAuraOrderPred() { }
|
||||
|
||||
public override int Compare(AuraEffect aurEffA, AuraEffect aurEffB)
|
||||
{
|
||||
SpellInfo spellProtoA = aurEffA.GetSpellInfo();
|
||||
SpellInfo spellProtoB = aurEffB.GetSpellInfo();
|
||||
|
||||
// Fel Blossom
|
||||
if (spellProtoA.Id == 28527)
|
||||
return 1;
|
||||
if (spellProtoB.Id == 28527)
|
||||
return 0;
|
||||
|
||||
// Ice Barrier
|
||||
if (spellProtoA.GetCategory() == 471)
|
||||
return 1;
|
||||
if (spellProtoB.GetCategory() == 471)
|
||||
return 0;
|
||||
|
||||
// Sacrifice
|
||||
if (spellProtoA.Id == 7812)
|
||||
return 1;
|
||||
if (spellProtoB.Id == 7812)
|
||||
return 0;
|
||||
|
||||
// Cauterize (must be last)
|
||||
if (spellProtoA.Id == 86949)
|
||||
return 0;
|
||||
if (spellProtoB.Id == 86949)
|
||||
return 1;
|
||||
|
||||
// Spirit of Redemption (must be last)
|
||||
if (spellProtoA.Id == 20711)
|
||||
return 0;
|
||||
if (spellProtoB.Id == 20711)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1636,10 +1636,6 @@ namespace Game.Spells
|
||||
if (DotDuration == 0)
|
||||
return 1;
|
||||
|
||||
// 200% limit
|
||||
if (DotDuration > 30000)
|
||||
DotDuration = 30000;
|
||||
|
||||
foreach (SpellEffectInfo effect in GetEffectsForDifficulty(difficulty))
|
||||
{
|
||||
if (effect != null && effect.Effect == SpellEffectName.ApplyAura)
|
||||
|
||||
Reference in New Issue
Block a user