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);
|
||||
}
|
||||
|
||||
// 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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -71,6 +71,7 @@ namespace Scripts.Spells.Priest
|
||||
public const uint ShadowformVisualWithoutGlyph = 107903;
|
||||
public const uint ShieldDisciplineEnergize = 47755;
|
||||
public const uint ShieldDisciplinePassive = 197045;
|
||||
public const uint SpiritOfRedemption = 27827;
|
||||
public const uint StrengthOfSoul = 197535;
|
||||
public const uint StrengthOfSoulEffect = 197548;
|
||||
public const uint T9Healing2p = 67201;
|
||||
@@ -897,6 +898,33 @@ namespace Scripts.Spells.Priest
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 20711 - Spirit of Redemption
|
||||
class spell_priest_spirit_of_redemption : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.SpiritOfRedemption);
|
||||
}
|
||||
|
||||
void HandleAbsorb(AuraEffect aurEff, DamageInfo dmgInfo, ref uint absorbAmount)
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
if (dmgInfo.GetDamage() >= target.GetHealth())
|
||||
{
|
||||
target.CastSpell(target, SpellIds.SpiritOfRedemption, TriggerCastFlags.FullMask, null, aurEff);
|
||||
target.SetFullHealth();
|
||||
return;
|
||||
}
|
||||
|
||||
PreventDefaultAction();
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectAbsorb.Add(new EffectAbsorbHandler(HandleAbsorb, 0));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 28809 - Greater Heal
|
||||
class spell_pri_t3_4p_bonus : AuraScript
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user