fix: Fixes spell durations for older expansions (#1119)
This commit is contained in:
parent
d6d02de296
commit
56c97ca84a
8 changed files with 68 additions and 59 deletions
|
|
@ -353,9 +353,8 @@ namespace Server.Spells
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TimeSpan GetDuration(Mobile caster, Mobile target) =>
|
public static TimeSpan GetDuration(Mobile caster, Mobile target) =>
|
||||||
Core.AOS
|
// TODO: Is this accurate for Curse? Sources say it is magery. Should confirm at least for newest era.
|
||||||
? TimeSpan.FromSeconds(6 * caster.Skills.EvalInt.Fixed / 50 + 1)
|
TimeSpan.FromSeconds(6 * (Core.AOS ? caster.Skills.EvalInt.Value : caster.Skills.Magery.Value) / 5.0);
|
||||||
: TimeSpan.FromSeconds(caster.Skills.Magery.Value * 1.2);
|
|
||||||
|
|
||||||
public static double GetOffsetScalar(Mobile caster, Mobile target, bool curse)
|
public static double GetOffsetScalar(Mobile caster, Mobile target, bool curse)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -108,13 +108,12 @@ namespace Server.Spells.Fifth
|
||||||
|
|
||||||
StopTimer(Caster);
|
StopTimer(Caster);
|
||||||
|
|
||||||
var timeVal = Math.Min(6 * Caster.Skills.Magery.Fixed / 50 + 1, 144);
|
var duration = TimeSpan.FromSeconds(Math.Min(6 * Caster.Skills.Magery.Value / 5.0, 144));
|
||||||
|
|
||||||
var length = TimeSpan.FromSeconds(timeVal);
|
Timer.StartTimer(duration, () => EndIncognito(Caster), out var timerToken);
|
||||||
Timer.StartTimer(length, () => EndIncognito(Caster), out var timerToken);
|
|
||||||
_table[Caster] = timerToken;
|
_table[Caster] = timerToken;
|
||||||
|
|
||||||
BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.Incognito, 1075819, length, Caster));
|
BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.Incognito, 1075819, duration, Caster));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,12 @@ namespace Server.Spells.Fifth
|
||||||
Effects.PlaySound(loc, Caster.Map, 0x20B);
|
Effects.PlaySound(loc, Caster.Map, 0x20B);
|
||||||
|
|
||||||
var itemID = eastToWest ? 0x3915 : 0x3922;
|
var itemID = eastToWest ? 0x3915 : 0x3922;
|
||||||
var duration = TimeSpan.FromSeconds(3 + Caster.Skills.Magery.Fixed / 25);
|
var duration = Core.Expansion switch
|
||||||
|
{
|
||||||
|
Expansion.None => TimeSpan.FromSeconds(20),
|
||||||
|
< Expansion.LBR => TimeSpan.FromSeconds(15 + Caster.Skills.Magery.Value * 0.4),
|
||||||
|
_ => TimeSpan.FromSeconds(3 + Caster.Skills.Magery.Fixed * 0.4)
|
||||||
|
};
|
||||||
|
|
||||||
for (var i = -2; i <= 2; ++i)
|
for (var i = -2; i <= 2; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -72,16 +72,11 @@ namespace Server.Spells.Fifth
|
||||||
|
|
||||||
// creature.ControlSlots = 2;
|
// creature.ControlSlots = 2;
|
||||||
|
|
||||||
TimeSpan duration;
|
var duration = Core.Expansion switch
|
||||||
|
|
||||||
if (Core.AOS)
|
|
||||||
{
|
{
|
||||||
duration = TimeSpan.FromSeconds(2 * Caster.Skills.Magery.Fixed / 5.0);
|
Expansion.None => TimeSpan.FromSeconds(Caster.Skills.Magery.Value),
|
||||||
}
|
_ => TimeSpan.FromSeconds(2 * Caster.Skills.Magery.Fixed / 5.0)
|
||||||
else
|
};
|
||||||
{
|
|
||||||
duration = TimeSpan.FromSeconds(4.0 * Caster.Skills.Magery.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
SpellHelper.Summon(creature, Caster, 0x215, duration, false, false);
|
SpellHelper.Summon(creature, Caster, 0x215, duration, false, false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,12 @@ namespace Server.Spells.Fourth
|
||||||
|
|
||||||
var itemID = eastToWest ? 0x398C : 0x3996;
|
var itemID = eastToWest ? 0x398C : 0x3996;
|
||||||
|
|
||||||
var duration = Core.AOS
|
var duration = Core.Expansion switch
|
||||||
? TimeSpan.FromSeconds((15 + Caster.Skills.Magery.Fixed / 5.0) / 4.0)
|
{
|
||||||
: TimeSpan.FromSeconds(4.0 + Caster.Skills.Magery.Value * 0.5);
|
Expansion.None => TimeSpan.FromSeconds(20),
|
||||||
|
< Expansion.LBR => TimeSpan.FromSeconds(Caster.Skills.Magery.Value),
|
||||||
|
_ => TimeSpan.FromSeconds(4.0 + Caster.Skills.Magery.Value * 0.5)
|
||||||
|
};
|
||||||
|
|
||||||
for (var i = -2; i <= 2; ++i)
|
for (var i = -2; i <= 2; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -69,8 +69,8 @@ namespace Server.Spells.Seventh
|
||||||
{
|
{
|
||||||
Caster.SendLocalizedMessage(501942); // That location is blocked.
|
Caster.SendLocalizedMessage(501942); // That location is blocked.
|
||||||
}
|
}
|
||||||
else if (Core.SE && (GateExistsAt(map, loc) || GateExistsAt(Caster.Map, Caster.Location))
|
// SE restricted stacking gates
|
||||||
) // SE restricted stacking gates
|
else if (Core.SE && (GateExistsAt(map, loc) || GateExistsAt(Caster.Map, Caster.Location)))
|
||||||
{
|
{
|
||||||
Caster.SendLocalizedMessage(1071242); // There is already a gate there.
|
Caster.SendLocalizedMessage(1071242); // There is already a gate there.
|
||||||
}
|
}
|
||||||
|
|
@ -127,7 +127,7 @@ namespace Server.Spells.Seventh
|
||||||
return SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom);
|
return SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool GateExistsAt(Map map, Point3D loc)
|
private static bool GateExistsAt(Map map, Point3D loc)
|
||||||
{
|
{
|
||||||
var eable = map.GetItemsInRange(loc, 0);
|
var eable = map.GetItemsInRange(loc, 0);
|
||||||
|
|
||||||
|
|
@ -182,7 +182,7 @@ namespace Server.Spells.Seventh
|
||||||
{
|
{
|
||||||
private readonly Item m_Item;
|
private readonly Item m_Item;
|
||||||
|
|
||||||
public InternalTimer(Item item) : base(TimeSpan.FromSeconds(30.0))
|
public InternalTimer(Item item) : base(TimeSpan.FromSeconds(Core.T2A ? 30.0 : 10.0))
|
||||||
{
|
{
|
||||||
m_Item = item;
|
m_Item = item;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -142,41 +142,44 @@ namespace Server.Spells.Seventh
|
||||||
|
|
||||||
if (CheckSequence())
|
if (CheckSequence())
|
||||||
{
|
{
|
||||||
if (caster.BeginAction<PolymorphSpell>())
|
if (!caster.BeginAction<PolymorphSpell>())
|
||||||
{
|
|
||||||
if (m_NewBody != 0)
|
|
||||||
{
|
|
||||||
if (!((Body)m_NewBody).IsHuman)
|
|
||||||
{
|
|
||||||
var mt = caster.Mount;
|
|
||||||
|
|
||||||
if (mt != null)
|
|
||||||
{
|
|
||||||
mt.Rider = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
caster.BodyMod = m_NewBody;
|
|
||||||
|
|
||||||
caster.HueMod = m_NewBody is 400 or 401 ? caster.Race.RandomSkinHue() : 0;
|
|
||||||
|
|
||||||
BaseArmor.ValidateMobile(caster);
|
|
||||||
BaseClothing.ValidateMobile(caster);
|
|
||||||
|
|
||||||
if (!Core.ML)
|
|
||||||
{
|
|
||||||
StopTimer(caster);
|
|
||||||
|
|
||||||
var duration = Math.Max((int)caster.Skills.Magery.Value, 120);
|
|
||||||
|
|
||||||
Timer.StartTimer(TimeSpan.FromSeconds(duration), () => EndPolymorph(caster), out var timerToken);
|
|
||||||
_table[caster] = timerToken;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
caster.SendLocalizedMessage(1005559); // This spell is already in effect.
|
caster.SendLocalizedMessage(1005559); // This spell is already in effect.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_NewBody != 0)
|
||||||
|
{
|
||||||
|
if (!((Body)m_NewBody).IsHuman)
|
||||||
|
{
|
||||||
|
var mt = caster.Mount;
|
||||||
|
|
||||||
|
if (mt != null)
|
||||||
|
{
|
||||||
|
mt.Rider = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
caster.BodyMod = m_NewBody;
|
||||||
|
|
||||||
|
caster.HueMod = m_NewBody is 400 or 401 ? caster.Race.RandomSkinHue() : 0;
|
||||||
|
|
||||||
|
BaseArmor.ValidateMobile(caster);
|
||||||
|
BaseClothing.ValidateMobile(caster);
|
||||||
|
|
||||||
|
if (!Core.ML)
|
||||||
|
{
|
||||||
|
StopTimer(caster);
|
||||||
|
|
||||||
|
var duration = Core.Expansion switch
|
||||||
|
{
|
||||||
|
Expansion.None => TimeSpan.FromSeconds(6 * caster.Skills.Magery.Value / 5.0),
|
||||||
|
_ => TimeSpan.FromSeconds(Math.Max(caster.Skills.Magery.Value, 120))
|
||||||
|
};
|
||||||
|
|
||||||
|
Timer.StartTimer(duration, () => EndPolymorph(caster), out var timerToken);
|
||||||
|
_table[caster] = timerToken;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,12 @@ namespace Server.Spells.Sixth
|
||||||
|
|
||||||
var itemID = eastToWest ? 0x3967 : 0x3979;
|
var itemID = eastToWest ? 0x3967 : 0x3979;
|
||||||
|
|
||||||
var duration = TimeSpan.FromSeconds(3.0 + Caster.Skills.Magery.Value / 3.0);
|
var duration = Core.Expansion switch
|
||||||
|
{
|
||||||
|
Expansion.None => TimeSpan.FromSeconds(20),
|
||||||
|
< Expansion.LBR => TimeSpan.FromSeconds(15.0 + Caster.Skills.Magery.Value / 3.0),
|
||||||
|
_ => TimeSpan.FromSeconds(3.0 + Caster.Skills.Magery.Value / 3.0)
|
||||||
|
};
|
||||||
|
|
||||||
for (var i = -2; i <= 2; ++i)
|
for (var i = -2; i <= 2; ++i)
|
||||||
{
|
{
|
||||||
|
|
@ -179,7 +184,7 @@ namespace Server.Spells.Sixth
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
duration = 7.0 + m_Caster.Skills.Magery.Value * 0.2;
|
duration = 7.0 + m_Caster.Skills.Magery.Value / 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
m.Paralyze(TimeSpan.FromSeconds(duration));
|
m.Paralyze(TimeSpan.FromSeconds(duration));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue