Fixes brace style (#248)
This commit is contained in:
parent
a236617ad9
commit
8149620b0c
1503 changed files with 28575 additions and 1717 deletions
|
|
@ -28,7 +28,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (version == 0 && Core.ML)
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (version == 0 && Core.ML)
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (version == 0 && Core.ML)
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,18 +45,26 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.Player)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (from.InRange(GetWorldLocation(), 1))
|
||||
CheckGate(from, 1);
|
||||
{
|
||||
CheckGate(@from, 1);
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
{
|
||||
@from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
if (m.Player)
|
||||
{
|
||||
CheckGate(m, 0);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -64,7 +72,9 @@ namespace Server.Items
|
|||
public virtual void CheckGate(Mobile m, int range)
|
||||
{
|
||||
if (m.Hidden && m.AccessLevel == AccessLevel.Player && Core.ML)
|
||||
{
|
||||
m.RevealingAction();
|
||||
}
|
||||
|
||||
new DelayTimer(m, this, range).Start();
|
||||
}
|
||||
|
|
@ -103,7 +113,9 @@ namespace Server.Items
|
|||
m.MoveToWorld(Target, TargetMap);
|
||||
|
||||
if (m.AccessLevel == AccessLevel.Player || !m.Hidden)
|
||||
{
|
||||
m.PlaySound(0x1FE);
|
||||
}
|
||||
|
||||
OnGateUsed(m);
|
||||
}
|
||||
|
|
@ -136,18 +148,24 @@ namespace Server.Items
|
|||
TargetMap = reader.ReadMap();
|
||||
|
||||
if (version >= 1)
|
||||
{
|
||||
Dispellable = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool ValidateUse(Mobile from, bool message)
|
||||
{
|
||||
if (from.Deleted || Deleted)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (from.Map != Map || !from.InRange(this, 1))
|
||||
{
|
||||
if (message)
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
{
|
||||
@from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -161,7 +179,10 @@ namespace Server.Items
|
|||
from.Map != Map.Felucca && TargetMap == Map.Felucca && ShowFeluccaWarning)
|
||||
{
|
||||
if (from.AccessLevel == AccessLevel.Player || !from.Hidden)
|
||||
from.Send(new PlaySound(0x20E, from.Location));
|
||||
{
|
||||
@from.Send(new PlaySound(0x20E, @from.Location));
|
||||
}
|
||||
|
||||
from.CloseGump<MoongateConfirmGump>();
|
||||
from.SendGump(new MoongateConfirmGump(from, this));
|
||||
}
|
||||
|
|
@ -174,7 +195,9 @@ namespace Server.Items
|
|||
public virtual void EndConfirmation(Mobile from)
|
||||
{
|
||||
if (!ValidateUse(from, true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UseGate(from);
|
||||
}
|
||||
|
|
@ -182,12 +205,18 @@ namespace Server.Items
|
|||
public virtual void DelayCallback(Mobile from, int range)
|
||||
{
|
||||
if (!ValidateUse(from, false) || !from.InRange(this, range))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (TargetMap != null)
|
||||
BeginConfirmation(from);
|
||||
{
|
||||
BeginConfirmation(@from);
|
||||
}
|
||||
else
|
||||
from.SendMessage("This moongate does not seem to go anywhere.");
|
||||
{
|
||||
@from.SendMessage("This moongate does not seem to go anywhere.");
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsInTown(Point3D p, Map map) =>
|
||||
|
|
@ -253,7 +282,9 @@ namespace Server.Items
|
|||
public virtual void Warning_Callback(Mobile from, bool okay)
|
||||
{
|
||||
if (okay)
|
||||
EndConfirmation(from);
|
||||
{
|
||||
EndConfirmation(@from);
|
||||
}
|
||||
}
|
||||
|
||||
public override void BeginConfirmation(Mobile from)
|
||||
|
|
@ -351,6 +382,7 @@ namespace Server.Items
|
|||
AddAlphaRegion(10, 40, 400, 200);
|
||||
|
||||
if (from.Map != Map.Felucca && gate.TargetMap == Map.Felucca && gate.ShowFeluccaWarning)
|
||||
{
|
||||
AddHtmlLocalized(
|
||||
10,
|
||||
40,
|
||||
|
|
@ -361,7 +393,9 @@ namespace Server.Items
|
|||
false,
|
||||
true
|
||||
); // This Gate goes to Felucca... Continue to enter the gate, Cancel to stay here
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtmlLocalized(
|
||||
10,
|
||||
40,
|
||||
|
|
@ -372,6 +406,7 @@ namespace Server.Items
|
|||
false,
|
||||
true
|
||||
); // Dost thou wish to step into the moongate? Continue to enter the gate, Cancel to stay here
|
||||
}
|
||||
|
||||
AddImageTiled(10, 250, 400, 20, 2624);
|
||||
AddAlphaRegion(10, 250, 400, 20);
|
||||
|
|
@ -408,7 +443,9 @@ namespace Server.Items
|
|||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 1)
|
||||
{
|
||||
m_Gate.EndConfirmation(m_From);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,9 @@ namespace Server.Items
|
|||
get
|
||||
{
|
||||
if (m_Held > 0 && (int)m_Type >= (int)PotionEffect.Conflagration)
|
||||
{
|
||||
return 1072658 + (int)m_Type - (int)PotionEffect.Conflagration;
|
||||
}
|
||||
|
||||
return m_Held > 0 ? 1041620 + (int)m_Type : 1041641;
|
||||
}
|
||||
|
|
@ -91,7 +93,9 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (version < 1)
|
||||
{
|
||||
Timer.DelayCall(UpdateWeight);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
|
|
@ -101,29 +105,53 @@ namespace Server.Items
|
|||
int number;
|
||||
|
||||
if (m_Held <= 0)
|
||||
{
|
||||
number = 502246; // The keg is empty.
|
||||
}
|
||||
else if (m_Held < 5)
|
||||
{
|
||||
number = 502248; // The keg is nearly empty.
|
||||
}
|
||||
else if (m_Held < 20)
|
||||
{
|
||||
number = 502249; // The keg is not very full.
|
||||
}
|
||||
else if (m_Held < 30)
|
||||
{
|
||||
number = 502250; // The keg is about one quarter full.
|
||||
}
|
||||
else if (m_Held < 40)
|
||||
{
|
||||
number = 502251; // The keg is about one third full.
|
||||
}
|
||||
else if (m_Held < 47)
|
||||
{
|
||||
number = 502252; // The keg is almost half full.
|
||||
}
|
||||
else if (m_Held < 54)
|
||||
{
|
||||
number = 502254; // The keg is approximately half full.
|
||||
}
|
||||
else if (m_Held < 70)
|
||||
{
|
||||
number = 502253; // The keg is more than half full.
|
||||
}
|
||||
else if (m_Held < 80)
|
||||
{
|
||||
number = 502255; // The keg is about three quarters full.
|
||||
}
|
||||
else if (m_Held < 96)
|
||||
{
|
||||
number = 502256; // The keg is very full.
|
||||
}
|
||||
else if (m_Held < 100)
|
||||
{
|
||||
number = 502257; // The liquid is almost to the top of the keg.
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 502258; // The keg is completely full.
|
||||
}
|
||||
|
||||
list.Add(number);
|
||||
}
|
||||
|
|
@ -135,29 +163,53 @@ namespace Server.Items
|
|||
int number;
|
||||
|
||||
if (m_Held <= 0)
|
||||
{
|
||||
number = 502246; // The keg is empty.
|
||||
}
|
||||
else if (m_Held < 5)
|
||||
{
|
||||
number = 502248; // The keg is nearly empty.
|
||||
}
|
||||
else if (m_Held < 20)
|
||||
{
|
||||
number = 502249; // The keg is not very full.
|
||||
}
|
||||
else if (m_Held < 30)
|
||||
{
|
||||
number = 502250; // The keg is about one quarter full.
|
||||
}
|
||||
else if (m_Held < 40)
|
||||
{
|
||||
number = 502251; // The keg is about one third full.
|
||||
}
|
||||
else if (m_Held < 47)
|
||||
{
|
||||
number = 502252; // The keg is almost half full.
|
||||
}
|
||||
else if (m_Held < 54)
|
||||
{
|
||||
number = 502254; // The keg is approximately half full.
|
||||
}
|
||||
else if (m_Held < 70)
|
||||
{
|
||||
number = 502253; // The keg is more than half full.
|
||||
}
|
||||
else if (m_Held < 80)
|
||||
{
|
||||
number = 502255; // The keg is about three quarters full.
|
||||
}
|
||||
else if (m_Held < 96)
|
||||
{
|
||||
number = 502256; // The keg is very full.
|
||||
}
|
||||
else if (m_Held < 100)
|
||||
{
|
||||
number = 502257; // The liquid is almost to the top of the keg.
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 502258; // The keg is completely full.
|
||||
}
|
||||
|
||||
LabelTo(from, number);
|
||||
}
|
||||
|
|
@ -182,7 +234,9 @@ namespace Server.Items
|
|||
from.PlaySound(0x240);
|
||||
|
||||
if (--Held == 0)
|
||||
from.SendLocalizedMessage(502245); // The keg is now empty.
|
||||
{
|
||||
@from.SendLocalizedMessage(502245); // The keg is now empty.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -238,7 +292,9 @@ namespace Server.Items
|
|||
pot.Consume(toHold);
|
||||
|
||||
if (!pot.Deleted)
|
||||
pot.Bounce(from);
|
||||
{
|
||||
pot.Bounce(@from);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -266,7 +322,9 @@ namespace Server.Items
|
|||
pot.Consume(toHold);
|
||||
|
||||
if (!pot.Deleted)
|
||||
pot.Bounce(from);
|
||||
{
|
||||
pot.Bounce(@from);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,9 @@ namespace Server.Items
|
|||
get
|
||||
{
|
||||
if (m_House?.Deleted == true)
|
||||
{
|
||||
House = null;
|
||||
}
|
||||
|
||||
return m_House;
|
||||
}
|
||||
|
|
@ -137,17 +139,29 @@ namespace Server.Items
|
|||
private void CalculateHue()
|
||||
{
|
||||
if (!m_Marked)
|
||||
{
|
||||
Hue = 0;
|
||||
}
|
||||
else if (m_TargetMap == Map.Trammel)
|
||||
{
|
||||
Hue = House != null ? 0x47F : 50;
|
||||
}
|
||||
else if (m_TargetMap == Map.Felucca)
|
||||
{
|
||||
Hue = House != null ? 0x66D : 0;
|
||||
}
|
||||
else if (m_TargetMap == Map.Ilshenar)
|
||||
{
|
||||
Hue = House != null ? 0x55F : 1102;
|
||||
}
|
||||
else if (m_TargetMap == Map.Malas)
|
||||
{
|
||||
Hue = House != null ? 0x55F : 1102;
|
||||
}
|
||||
else if (m_TargetMap == Map.Tokuno)
|
||||
{
|
||||
Hue = House != null ? 0x47F : 1154;
|
||||
}
|
||||
}
|
||||
|
||||
public void Mark(Mobile m)
|
||||
|
|
@ -179,7 +193,9 @@ namespace Server.Items
|
|||
var map = m_House.Map;
|
||||
|
||||
if (map?.CanFit(x, y, z, 16, false, false) == false)
|
||||
{
|
||||
z = map.GetAverageZ(x, y);
|
||||
}
|
||||
|
||||
Target = new Point3D(x, y, z);
|
||||
m_TargetMap = map;
|
||||
|
|
@ -193,7 +209,9 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (!setDesc)
|
||||
{
|
||||
m_Description = BaseRegion.GetRuneNameFor(Region.Find(Target, m_TargetMap));
|
||||
}
|
||||
|
||||
CalculateHue();
|
||||
InvalidateProperties();
|
||||
|
|
@ -208,18 +226,30 @@ namespace Server.Items
|
|||
string desc;
|
||||
|
||||
if ((desc = m_Description) == null || (desc = desc.Trim()).Length == 0)
|
||||
{
|
||||
desc = "an unknown location";
|
||||
}
|
||||
|
||||
if (m_TargetMap == Map.Tokuno)
|
||||
{
|
||||
list.Add(House != null ? 1063260 : 1063259, RuneFormat, desc); // ~1_val~ (Tokuno Islands)[(House)]
|
||||
}
|
||||
else if (m_TargetMap == Map.Malas)
|
||||
{
|
||||
list.Add(House != null ? 1062454 : 1060804, RuneFormat, desc); // ~1_val~ (Malas)[(House)]
|
||||
}
|
||||
else if (m_TargetMap == Map.Felucca)
|
||||
{
|
||||
list.Add(House != null ? 1062452 : 1060805, RuneFormat, desc); // ~1_val~ (Felucca)[(House)]
|
||||
}
|
||||
else if (m_TargetMap == Map.Trammel)
|
||||
{
|
||||
list.Add(House != null ? 1062453 : 1060806, RuneFormat, desc); // ~1_val~ (Trammel)[(House)]
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(House != null ? "{0} ({1})(House)" : "{0} ({1})", string.Format(RuneFormat, desc), m_TargetMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -230,36 +260,46 @@ namespace Server.Items
|
|||
var desc = m_Description?.Trim().IsNullOrDefault("an unknown location");
|
||||
|
||||
if (m_TargetMap == Map.Tokuno)
|
||||
{
|
||||
LabelTo(
|
||||
from,
|
||||
@from,
|
||||
House != null ? 1063260 : 1063259,
|
||||
string.Format(RuneFormat, desc)
|
||||
); // ~1_val~ (Tokuno Islands)[(House)]
|
||||
}
|
||||
else if (m_TargetMap == Map.Malas)
|
||||
{
|
||||
LabelTo(
|
||||
from,
|
||||
@from,
|
||||
House != null ? 1062454 : 1060804,
|
||||
string.Format(RuneFormat, desc)
|
||||
); // ~1_val~ (Malas)[(House)]
|
||||
}
|
||||
else if (m_TargetMap == Map.Felucca)
|
||||
{
|
||||
LabelTo(
|
||||
from,
|
||||
@from,
|
||||
House != null ? 1062452 : 1060805,
|
||||
string.Format(RuneFormat, desc)
|
||||
); // ~1_val~ (Felucca)[(House)]
|
||||
}
|
||||
else if (m_TargetMap == Map.Trammel)
|
||||
{
|
||||
LabelTo(
|
||||
from,
|
||||
@from,
|
||||
House != null ? 1062453 : 1060806,
|
||||
string.Format(RuneFormat, desc)
|
||||
); // ~1_val~ (Trammel)[(House)]
|
||||
}
|
||||
else
|
||||
{
|
||||
LabelTo(
|
||||
from,
|
||||
@from,
|
||||
House != null ? "{0} ({1})(House)" : "{0} ({1})",
|
||||
string.Format(RuneFormat, desc),
|
||||
m_TargetMap
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (version == 0 && Core.ML)
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ namespace Server.Items
|
|||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,9 @@ namespace Server.Items
|
|||
if (pack != null)
|
||||
{
|
||||
if ((int)PotionEffect >= (int)PotionEffect.Invisibility)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
var kegs = pack.FindItemsByType<PotionKeg>();
|
||||
|
||||
|
|
@ -96,10 +98,14 @@ namespace Server.Items
|
|||
// continue;
|
||||
|
||||
if (keg.Held <= 0 || keg.Held >= 100)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (keg.Type != PotionEffect)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
++keg.Held;
|
||||
|
||||
|
|
@ -120,10 +126,14 @@ namespace Server.Items
|
|||
var handTwo = m.FindItemOnLayer(Layer.TwoHanded);
|
||||
|
||||
if (handTwo is BaseWeapon)
|
||||
{
|
||||
handOne = handTwo;
|
||||
}
|
||||
|
||||
if (handTwo is BaseRanged ranged && ranged.Balanced)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return handOne == null || handTwo == null;
|
||||
}
|
||||
|
|
@ -131,7 +141,9 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!Movable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (from.InRange(GetWorldLocation(), 1))
|
||||
{
|
||||
|
|
@ -144,9 +156,14 @@ namespace Server.Items
|
|||
Amount--;
|
||||
|
||||
if (from.Backpack?.Deleted != false)
|
||||
from.Backpack.DropItem(pot);
|
||||
{
|
||||
@from.Backpack.DropItem(pot);
|
||||
}
|
||||
else
|
||||
pot.MoveToWorld(from.Location, from.Map);
|
||||
{
|
||||
pot.MoveToWorld(@from.Location, @from.Map);
|
||||
}
|
||||
|
||||
pot.Drink(from);
|
||||
}
|
||||
else
|
||||
|
|
@ -191,7 +208,9 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (version == 0)
|
||||
{
|
||||
Stackable = Core.ML;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void Drink(Mobile from);
|
||||
|
|
@ -203,10 +222,14 @@ namespace Server.Items
|
|||
m.PlaySound(0x2D6);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(m))
|
||||
{
|
||||
m.AddToBackpack(new Bottle());
|
||||
}
|
||||
|
||||
if (m.Body.IsHuman && !m.Mounted)
|
||||
{
|
||||
m.Animate(34, 5, 1, true, false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public static int EnhancePotions(Mobile m)
|
||||
|
|
@ -215,7 +238,9 @@ namespace Server.Items
|
|||
var skillBonus = m.Skills.Alchemy.Fixed / 330 * 10;
|
||||
|
||||
if (Core.ML && EP > 50 && m.AccessLevel <= AccessLevel.Player)
|
||||
{
|
||||
EP = 50;
|
||||
}
|
||||
|
||||
return EP + skillBonus;
|
||||
}
|
||||
|
|
@ -223,7 +248,9 @@ namespace Server.Items
|
|||
public static TimeSpan Scale(Mobile m, TimeSpan v)
|
||||
{
|
||||
if (!Core.AOS)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
var scalar = 1.0 + 0.01 * EnhancePotions(m);
|
||||
|
||||
|
|
@ -233,7 +260,9 @@ namespace Server.Items
|
|||
public static double Scale(Mobile m, double v)
|
||||
{
|
||||
if (!Core.AOS)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
var scalar = 1.0 + 0.01 * EnhancePotions(m);
|
||||
|
||||
|
|
@ -243,7 +272,9 @@ namespace Server.Items
|
|||
public static int Scale(Mobile m, int v)
|
||||
{
|
||||
if (!Core.AOS)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
return AOS.Scale(v, 100 + EnhancePotions(m));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,12 +41,16 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (from.Target is ThrowTarget targ && targ.Potion == this)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
if (!m_Users.Contains(from))
|
||||
m_Users.Add(from);
|
||||
{
|
||||
m_Users.Add(@from);
|
||||
}
|
||||
|
||||
from.Target = new ThrowTarget(this);
|
||||
}
|
||||
|
|
@ -68,26 +72,36 @@ namespace Server.Items
|
|||
public virtual void Explode(Mobile from, Point3D loc, Map map)
|
||||
{
|
||||
if (Deleted || map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Consume();
|
||||
|
||||
// Check if any other players are using this potion
|
||||
for (var i = 0; i < m_Users.Count; i++)
|
||||
{
|
||||
if (m_Users[i].Target is ThrowTarget targ && targ.Potion == this)
|
||||
Target.Cancel(from);
|
||||
{
|
||||
Target.Cancel(@from);
|
||||
}
|
||||
}
|
||||
|
||||
// Effects
|
||||
Effects.PlaySound(loc, map, 0x20C);
|
||||
|
||||
for (var i = -2; i <= 2; i++)
|
||||
{
|
||||
for (var j = -2; j <= 2; j++)
|
||||
{
|
||||
var p = new Point3D(loc.X + i, loc.Y + j, loc.Z);
|
||||
|
||||
if (map.CanFit(p, 12, true, false) && from.InLOS(p))
|
||||
new InternalItem(from, p, map, MinDamage, MaxDamage);
|
||||
if (map.CanFit(p, 12, true, false) && @from.InLOS(p))
|
||||
{
|
||||
new InternalItem(@from, p, map, MinDamage, MaxDamage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddDelay(Mobile m)
|
||||
|
|
@ -100,7 +114,9 @@ namespace Server.Items
|
|||
public static int GetDelay(Mobile m)
|
||||
{
|
||||
if (m_Delay.TryGetValue(m, out var timer) && timer.Next > DateTime.UtcNow)
|
||||
{
|
||||
return (int)(timer.Next - DateTime.UtcNow).TotalSeconds;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -122,10 +138,14 @@ namespace Server.Items
|
|||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (Potion.Deleted || Potion.Map == Map.Internal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(targeted is IPoint3D p) || from.Map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Add delay
|
||||
AddDelay(from);
|
||||
|
|
@ -137,9 +157,13 @@ namespace Server.Items
|
|||
IEntity to;
|
||||
|
||||
if (p is Mobile mobile)
|
||||
{
|
||||
to = mobile;
|
||||
}
|
||||
else
|
||||
to = new Entity(Serial.Zero, new Point3D(p), from.Map);
|
||||
{
|
||||
to = new Entity(Serial.Zero, new Point3D(p), @from.Map);
|
||||
}
|
||||
|
||||
Effects.SendMovingEffect(from, to, 0xF0D, 7, 0, false, false, Potion.Hue);
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.5), Potion.Explode, from, new Point3D(p), from.Map);
|
||||
|
|
@ -196,7 +220,9 @@ namespace Server.Items
|
|||
m_MaxDamage = max;
|
||||
|
||||
if (From == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var alchemySkill = From.Skills.Alchemy.Fixed;
|
||||
var alchemyBonus = alchemySkill / 125 + alchemySkill / 250;
|
||||
|
|
@ -262,7 +288,9 @@ namespace Server.Items
|
|||
protected override void OnTick()
|
||||
{
|
||||
if (m_Item.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (DateTime.UtcNow > m_End)
|
||||
{
|
||||
|
|
@ -274,17 +302,21 @@ namespace Server.Items
|
|||
var from = m_Item.From;
|
||||
|
||||
if (m_Item.Map == null || from == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var m in m_Item.GetMobilesInRange(0))
|
||||
if (m.Z + 16 > m_Item.Z && m_Item.Z + 12 > m.Z && (!Core.AOS || m != from) &&
|
||||
SpellHelper.ValidIndirectTarget(from, m) && from.CanBeHarmful(m, false))
|
||||
{
|
||||
if (m.Z + 16 > m_Item.Z && m_Item.Z + 12 > m.Z && (!Core.AOS || m != @from) &&
|
||||
SpellHelper.ValidIndirectTarget(@from, m) && @from.CanBeHarmful(m, false))
|
||||
{
|
||||
from.DoHarmful(m);
|
||||
@from.DoHarmful(m);
|
||||
|
||||
AOS.Damage(m, from, m_Item.GetDamage(), 0, 100, 0, 0, 0);
|
||||
AOS.Damage(m, @from, m_Item.GetDamage(), 0, 100, 0, 0, 0);
|
||||
m.PlaySound(0x208);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,12 +42,16 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (from.Target is ThrowTarget targ && targ.Potion == this)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
if (!m_Users.Contains(from))
|
||||
m_Users.Add(from);
|
||||
{
|
||||
m_Users.Add(@from);
|
||||
}
|
||||
|
||||
from.Target = new ThrowTarget(this);
|
||||
}
|
||||
|
|
@ -69,14 +73,20 @@ namespace Server.Items
|
|||
public virtual void Explode(Mobile from, Point3D loc, Map map)
|
||||
{
|
||||
if (Deleted || map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Consume();
|
||||
|
||||
// Check if any other players are using this potion
|
||||
for (var i = 0; i < m_Users.Count; i++)
|
||||
{
|
||||
if (m_Users[i].Target is ThrowTarget targ && targ.Potion == this)
|
||||
Target.Cancel(from);
|
||||
{
|
||||
Target.Cancel(@from);
|
||||
}
|
||||
}
|
||||
|
||||
// Effects
|
||||
Effects.PlaySound(loc, map, 0x207);
|
||||
|
|
@ -86,19 +96,25 @@ namespace Server.Items
|
|||
Timer.DelayCall(TimeSpan.FromSeconds(0.3), CircleEffect2, loc, map);
|
||||
|
||||
foreach (var mobile in map.GetMobilesInRange(loc, Radius))
|
||||
{
|
||||
if (mobile is BaseCreature mon)
|
||||
{
|
||||
if (mon.Controlled || mon.Summoned)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
mon.Pacify(from, DateTime.UtcNow + TimeSpan.FromSeconds(5.0)); // TODO check
|
||||
mon.Pacify(@from, DateTime.UtcNow + TimeSpan.FromSeconds(5.0)); // TODO check
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void BlastEffect(Point3D p, Map map)
|
||||
{
|
||||
if (map.CanFit(p, 12, true, false))
|
||||
{
|
||||
Effects.SendLocationEffect(p, map, 0x376A, 4, 9);
|
||||
}
|
||||
}
|
||||
|
||||
public void CircleEffect2(Point3D p, Map m)
|
||||
|
|
@ -116,7 +132,9 @@ namespace Server.Items
|
|||
public static int GetDelay(Mobile m)
|
||||
{
|
||||
if (m_Delay.TryGetValue(m, out var timer) && timer.Next > DateTime.UtcNow)
|
||||
{
|
||||
return (int)(timer.Next - DateTime.UtcNow).TotalSeconds;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -138,10 +156,14 @@ namespace Server.Items
|
|||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (Potion.Deleted || Potion.Map == Map.Internal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(targeted is IPoint3D p) || from.Map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Add delay
|
||||
AddDelay(from);
|
||||
|
|
@ -153,9 +175,13 @@ namespace Server.Items
|
|||
IEntity to;
|
||||
|
||||
if (p is Mobile mobile)
|
||||
{
|
||||
to = mobile;
|
||||
}
|
||||
else
|
||||
to = new Entity(Serial.Zero, new Point3D(p), from.Map);
|
||||
{
|
||||
to = new Entity(Serial.Zero, new Point3D(p), @from.Map);
|
||||
}
|
||||
|
||||
Effects.SendMovingEffect(from, to, 0xF0D, 7, 0, false, false, Potion.Hue);
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.0), Potion.Explode, from, new Point3D(p), from.Map);
|
||||
|
|
|
|||
|
|
@ -89,7 +89,9 @@ namespace Server.Items
|
|||
from.PlaySound(0x1E0);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -49,13 +49,19 @@ namespace Server.Items
|
|||
public virtual IEntity FindParent(Mobile from)
|
||||
{
|
||||
if (HeldBy?.Holding == this)
|
||||
{
|
||||
return HeldBy;
|
||||
}
|
||||
|
||||
if (RootParent != null)
|
||||
{
|
||||
return RootParent;
|
||||
}
|
||||
|
||||
if (Map == Map.Internal)
|
||||
return from;
|
||||
{
|
||||
return @from;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
|
@ -72,14 +78,18 @@ namespace Server.Items
|
|||
Stackable = false; // Scavenged explosion potions won't stack with those ones in backpack, and still will explode.
|
||||
|
||||
if (targ?.Potion == this)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
Users ??= new List<Mobile>();
|
||||
|
||||
if (!Users.Contains(from))
|
||||
Users.Add(from);
|
||||
{
|
||||
Users.Add(@from);
|
||||
}
|
||||
|
||||
from.Target = new ThrowTarget(this);
|
||||
|
||||
|
|
@ -90,26 +100,32 @@ namespace Server.Items
|
|||
var timer = 3;
|
||||
|
||||
if (Core.ML)
|
||||
{
|
||||
m_Timer = Timer.DelayCall(
|
||||
TimeSpan.FromSeconds(1.0),
|
||||
TimeSpan.FromSeconds(1.25),
|
||||
5,
|
||||
() => Detonate_OnTick(from, timer--)
|
||||
() => Detonate_OnTick(@from, timer--)
|
||||
); // 3.6 seconds explosion delay
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Timer = Timer.DelayCall(
|
||||
TimeSpan.FromSeconds(0.75),
|
||||
TimeSpan.FromSeconds(1.0),
|
||||
4,
|
||||
() => Detonate_OnTick(from, timer--)
|
||||
() => Detonate_OnTick(@from, timer--)
|
||||
); // 2.6 seconds explosion delay
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Detonate_OnTick(Mobile from, int timer)
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var parent = FindParent(from);
|
||||
|
||||
|
|
@ -139,27 +155,39 @@ namespace Server.Items
|
|||
else
|
||||
{
|
||||
if (parent is Item item)
|
||||
{
|
||||
item.PublicOverheadMessage(MessageType.Regular, 0x22, false, timer.ToString());
|
||||
}
|
||||
else if (parent is Mobile mobile)
|
||||
{
|
||||
mobile.PublicOverheadMessage(MessageType.Regular, 0x22, false, timer.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Reposition_OnTick(Mobile from, Point3D loc, Map map)
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (InstantExplosion)
|
||||
Explode(from, true, loc, map);
|
||||
{
|
||||
Explode(@from, true, loc, map);
|
||||
}
|
||||
else
|
||||
{
|
||||
MoveToWorld(loc, map);
|
||||
}
|
||||
}
|
||||
|
||||
public void Explode(Mobile from, bool direct, Point3D loc, Map map)
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Consume();
|
||||
|
||||
|
|
@ -168,11 +196,15 @@ namespace Server.Items
|
|||
var m = Users[i];
|
||||
|
||||
if (m.Target is ThrowTarget targ && targ.Potion == this)
|
||||
{
|
||||
Target.Cancel(m);
|
||||
}
|
||||
}
|
||||
|
||||
if (map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Effects.PlaySound(loc, map, 0x307);
|
||||
|
||||
|
|
@ -180,7 +212,9 @@ namespace Server.Items
|
|||
var alchemyBonus = 0;
|
||||
|
||||
if (direct)
|
||||
alchemyBonus = (int)(from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));
|
||||
{
|
||||
alchemyBonus = (int)(@from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));
|
||||
}
|
||||
|
||||
var eable = map.GetObjectsInRange(loc, ExplosionRange, LeveledExplosion);
|
||||
var toDamage = 0;
|
||||
|
|
@ -190,7 +224,9 @@ namespace Server.Items
|
|||
{
|
||||
if (!(o is Mobile mobile) || from != null &&
|
||||
(!SpellHelper.ValidIndirectTarget(from, mobile) || !from.CanBeHarmful(mobile, false)))
|
||||
{
|
||||
return o is BaseExplosionPotion && o != this;
|
||||
}
|
||||
|
||||
++toDamage;
|
||||
return true;
|
||||
|
|
@ -216,9 +252,13 @@ namespace Server.Items
|
|||
damage += alchemyBonus;
|
||||
|
||||
if (!Core.AOS && damage > 40)
|
||||
{
|
||||
damage = 40;
|
||||
}
|
||||
else if (Core.AOS && toDamage > 2)
|
||||
{
|
||||
damage /= toDamage - 1;
|
||||
}
|
||||
|
||||
AOS.Damage(m, from, damage, 0, 100, 0, 0, 0);
|
||||
}
|
||||
|
|
@ -238,15 +278,21 @@ namespace Server.Items
|
|||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (Potion.Deleted || Potion.Map == Map.Internal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(targeted is IPoint3D p))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var map = from.Map;
|
||||
|
||||
if (map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
|
|
@ -257,14 +303,21 @@ namespace Server.Items
|
|||
if (p is Mobile m)
|
||||
{
|
||||
if (!RelativeLocation) // explosion location = current mob location.
|
||||
{
|
||||
p = m.Location;
|
||||
}
|
||||
else
|
||||
{
|
||||
to = m;
|
||||
}
|
||||
}
|
||||
|
||||
Effects.SendMovingEffect(from, to, Potion.ItemID, 7, 0, false, false, Potion.Hue);
|
||||
|
||||
if (Potion.Amount > 1) Mobile.LiftItemDupe(Potion, 1);
|
||||
if (Potion.Amount > 1)
|
||||
{
|
||||
Mobile.LiftItemDupe(Potion, 1);
|
||||
}
|
||||
|
||||
Potion.Internalize();
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.0), Potion.Reposition_OnTick, from, new Point3D(p), map);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,9 @@ namespace Server.Items
|
|||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(Delay), from.EndAction<BaseHealPotion>);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@ namespace Server.Items
|
|||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,7 +43,9 @@ namespace Server.Items
|
|||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,9 @@ namespace Server.Items
|
|||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ namespace Server.Items
|
|||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,16 +99,22 @@ namespace Server.Items
|
|||
get
|
||||
{
|
||||
if (m_DefaultIndex >= 0 && m_DefaultIndex < Entries.Count)
|
||||
{
|
||||
return Entries[m_DefaultIndex];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
m_DefaultIndex = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_DefaultIndex = Entries.IndexOf(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -122,12 +128,16 @@ namespace Server.Items
|
|||
var charges = 5 + quality + (int)(from.Skills.Inscribe.Value / 30);
|
||||
|
||||
if (charges > 10)
|
||||
{
|
||||
charges = 10;
|
||||
}
|
||||
|
||||
MaxCharges = Core.SE ? charges * 2 : charges;
|
||||
|
||||
if (makersMark)
|
||||
Crafter = from;
|
||||
{
|
||||
Crafter = @from;
|
||||
}
|
||||
|
||||
m_Quality = (BookQuality)(quality - 1);
|
||||
|
||||
|
|
@ -160,7 +170,9 @@ namespace Server.Items
|
|||
writer.Write(Entries.Count);
|
||||
|
||||
for (var i = 0; i < Entries.Count; ++i)
|
||||
{
|
||||
Entries[i].Serialize(writer);
|
||||
}
|
||||
|
||||
writer.Write(m_Description);
|
||||
writer.Write(CurCharges);
|
||||
|
|
@ -175,7 +187,9 @@ namespace Server.Items
|
|||
LootType = LootType.Blessed;
|
||||
|
||||
if (Core.SE && Weight == 3.0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
|
|
@ -203,7 +217,9 @@ namespace Server.Items
|
|||
Entries = new List<RunebookEntry>(count);
|
||||
|
||||
for (var i = 0; i < count; ++i)
|
||||
{
|
||||
Entries.Add(new RunebookEntry(reader));
|
||||
}
|
||||
|
||||
m_Description = reader.ReadString();
|
||||
CurCharges = reader.ReadInt();
|
||||
|
|
@ -218,9 +234,13 @@ namespace Server.Items
|
|||
public void DropRune(Mobile from, RunebookEntry e, int index)
|
||||
{
|
||||
if (m_DefaultIndex > index)
|
||||
{
|
||||
m_DefaultIndex -= 1;
|
||||
}
|
||||
else if (m_DefaultIndex == index)
|
||||
{
|
||||
m_DefaultIndex = -1;
|
||||
}
|
||||
|
||||
Entries.RemoveAt(index);
|
||||
|
||||
|
|
@ -242,11 +262,17 @@ namespace Server.Items
|
|||
var ns = toCheck.NetState;
|
||||
|
||||
if (ns == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (var gump in ns.Gumps)
|
||||
{
|
||||
if (gump is RunebookGump bookGump && bookGump.Book == this)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -256,13 +282,19 @@ namespace Server.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (m_Quality == BookQuality.Exceptional)
|
||||
{
|
||||
list.Add(1063341); // exceptional
|
||||
}
|
||||
|
||||
if (m_Crafter != null)
|
||||
{
|
||||
list.Add(1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(m_Description))
|
||||
{
|
||||
list.Add(m_Description);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnDragLift(Mobile from)
|
||||
|
|
@ -274,8 +306,12 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
foreach (var m in Openers)
|
||||
{
|
||||
if (IsOpen(m))
|
||||
{
|
||||
m.CloseGump<RunebookGump>();
|
||||
}
|
||||
}
|
||||
|
||||
Openers.Clear();
|
||||
|
||||
|
|
@ -285,12 +321,16 @@ namespace Server.Items
|
|||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
if (m_Description?.Length > 0)
|
||||
LabelTo(from, m_Description);
|
||||
{
|
||||
LabelTo(@from, m_Description);
|
||||
}
|
||||
|
||||
base.OnSingleClick(from);
|
||||
|
||||
if (m_Crafter != null)
|
||||
LabelTo(from, 1050043, m_Crafter.Name);
|
||||
{
|
||||
LabelTo(@from, 1050043, m_Crafter.Name);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
|
|
@ -319,13 +359,17 @@ namespace Server.Items
|
|||
public virtual void OnTravel()
|
||||
{
|
||||
if (!Core.SA)
|
||||
{
|
||||
NextUse = DateTime.UtcNow + UseDelay;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDuped(Item newItem)
|
||||
{
|
||||
if (!(newItem is Runebook book))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
book.Entries = new List<RunebookEntry>();
|
||||
|
||||
|
|
@ -340,7 +384,9 @@ namespace Server.Items
|
|||
public bool CheckAccess(Mobile m)
|
||||
{
|
||||
if (!IsLockedDown || m.AccessLevel >= AccessLevel.GameMaster)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
var house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
|
|
|
|||
|
|
@ -57,13 +57,17 @@ namespace Server.Items
|
|||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (from.Alive && Movable)
|
||||
{
|
||||
list.Add(new AddToSpellbookEntry());
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!DesignContext.Check(from))
|
||||
{
|
||||
return; // They are customizing
|
||||
}
|
||||
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
|
|
@ -74,9 +78,13 @@ namespace Server.Items
|
|||
var spell = SpellRegistry.NewSpell(SpellID, from, this);
|
||||
|
||||
if (spell != null)
|
||||
{
|
||||
spell.Cast();
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(502345); // This spell has been temporarily disabled.
|
||||
{
|
||||
@from.SendLocalizedMessage(502345); // This spell has been temporarily disabled.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,11 +184,17 @@ namespace Server.Items
|
|||
if (magery >= 1000)
|
||||
{
|
||||
if (magery >= 1200)
|
||||
{
|
||||
propertyCounts = m_LegendPropertyCounts;
|
||||
}
|
||||
else if (magery >= 1100)
|
||||
{
|
||||
propertyCounts = m_ElderPropertyCounts;
|
||||
}
|
||||
else
|
||||
{
|
||||
propertyCounts = m_GrandPropertyCounts;
|
||||
}
|
||||
|
||||
minIntensity = 55;
|
||||
maxIntensity = 75;
|
||||
|
|
@ -212,7 +218,9 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (makersMark)
|
||||
Crafter = from;
|
||||
{
|
||||
Crafter = @from;
|
||||
}
|
||||
|
||||
m_Quality = (BookQuality)(quality - 1);
|
||||
|
||||
|
|
@ -264,9 +272,13 @@ namespace Server.Items
|
|||
if (obj is Spellbook book)
|
||||
{
|
||||
if (book.BookCount == 64)
|
||||
{
|
||||
book.Content = ulong.MaxValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
book.Content = (1ul << book.BookCount) - 1;
|
||||
}
|
||||
|
||||
from.SendMessage("The spellbook has been filled.");
|
||||
|
||||
|
|
@ -288,7 +300,9 @@ namespace Server.Items
|
|||
private static void EventSink_OpenSpellbookRequest(Mobile from, int typeID)
|
||||
{
|
||||
if (!DesignContext.Check(from))
|
||||
{
|
||||
return; // They are customizing
|
||||
}
|
||||
|
||||
var type = typeID switch
|
||||
{
|
||||
|
|
@ -309,7 +323,10 @@ namespace Server.Items
|
|||
|
||||
private static void EventSink_TargetedSpell(Mobile from, IEntity target, int spellId)
|
||||
{
|
||||
if (!DesignContext.Check(from)) return; // They are customizing
|
||||
if (!DesignContext.Check(from))
|
||||
{
|
||||
return; // They are customizing
|
||||
}
|
||||
|
||||
var book = Find(from, spellId);
|
||||
|
||||
|
|
@ -322,20 +339,28 @@ namespace Server.Items
|
|||
var move = SpellRegistry.GetSpecialMove(spellId);
|
||||
|
||||
if (move != null)
|
||||
SpecialMove.SetCurrentMove(from, move);
|
||||
{
|
||||
SpecialMove.SetCurrentMove(@from, move);
|
||||
}
|
||||
else
|
||||
SpellRegistry.NewSpell(spellId, from, null)?.Cast();
|
||||
{
|
||||
SpellRegistry.NewSpell(spellId, @from, null)?.Cast();
|
||||
}
|
||||
}
|
||||
|
||||
private static void EventSink_CastSpellRequest(Mobile from, int spellID, Item item)
|
||||
{
|
||||
if (!DesignContext.Check(from))
|
||||
{
|
||||
return; // They are customizing
|
||||
}
|
||||
|
||||
var book = item as Spellbook;
|
||||
|
||||
if (book?.HasSpell(spellID) != true)
|
||||
book = Find(from, spellID);
|
||||
{
|
||||
book = Find(@from, spellID);
|
||||
}
|
||||
|
||||
if (book?.HasSpell(spellID) == true)
|
||||
{
|
||||
|
|
@ -350,9 +375,13 @@ namespace Server.Items
|
|||
var spell = SpellRegistry.NewSpell(spellID, from, null);
|
||||
|
||||
if (spell != null)
|
||||
{
|
||||
spell.Cast();
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(502345); // This spell has been temporarily disabled.
|
||||
{
|
||||
@from.SendLocalizedMessage(502345); // This spell has been temporarily disabled.
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -364,19 +393,39 @@ namespace Server.Items
|
|||
public static SpellbookType GetTypeForSpell(int spellID)
|
||||
{
|
||||
if (spellID >= 0 && spellID < 64)
|
||||
{
|
||||
return SpellbookType.Regular;
|
||||
}
|
||||
|
||||
if (spellID >= 100 && spellID < 117)
|
||||
{
|
||||
return SpellbookType.Necromancer;
|
||||
}
|
||||
|
||||
if (spellID >= 200 && spellID < 210)
|
||||
{
|
||||
return SpellbookType.Paladin;
|
||||
}
|
||||
|
||||
if (spellID >= 400 && spellID < 406)
|
||||
{
|
||||
return SpellbookType.Samurai;
|
||||
}
|
||||
|
||||
if (spellID >= 500 && spellID < 508)
|
||||
{
|
||||
return SpellbookType.Ninja;
|
||||
}
|
||||
|
||||
if (spellID >= 600 && spellID < 617)
|
||||
{
|
||||
return SpellbookType.Arcanist;
|
||||
}
|
||||
|
||||
if (spellID >= 677 && spellID < 693)
|
||||
{
|
||||
return SpellbookType.Mystic;
|
||||
}
|
||||
|
||||
return SpellbookType.Invalid;
|
||||
}
|
||||
|
|
@ -400,7 +449,9 @@ namespace Server.Items
|
|||
public static Spellbook Find(Mobile from, int spellID, SpellbookType type)
|
||||
{
|
||||
if (from == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (from.Deleted)
|
||||
{
|
||||
|
|
@ -411,9 +462,13 @@ namespace Server.Items
|
|||
var searchAgain = false;
|
||||
|
||||
if (!m_Table.TryGetValue(from, out var list))
|
||||
m_Table[from] = list = FindAllSpellbooks(from);
|
||||
{
|
||||
m_Table[@from] = list = FindAllSpellbooks(@from);
|
||||
}
|
||||
else
|
||||
{
|
||||
searchAgain = true;
|
||||
}
|
||||
|
||||
var book = FindSpellbookInList(list, from, spellID, type);
|
||||
|
||||
|
|
@ -434,13 +489,17 @@ namespace Server.Items
|
|||
for (var i = list.Count - 1; i >= 0; --i)
|
||||
{
|
||||
if (i >= list.Count)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var book = list[i];
|
||||
|
||||
if (!book.Deleted && (book.Parent == from || pack != null && book.Parent == pack) &&
|
||||
ValidateSpellbook(book, spellID, type))
|
||||
{
|
||||
return book;
|
||||
}
|
||||
|
||||
list.RemoveAt(i);
|
||||
}
|
||||
|
|
@ -455,13 +514,19 @@ namespace Server.Items
|
|||
var spellbook = FindEquippedSpellbook(from);
|
||||
|
||||
if (spellbook != null)
|
||||
{
|
||||
list.Add(spellbook);
|
||||
}
|
||||
|
||||
var pack = from.Backpack;
|
||||
|
||||
for (var i = 0; i < pack?.Items.Count; ++i)
|
||||
{
|
||||
if (pack.Items[i] is Spellbook sp)
|
||||
{
|
||||
list.Add(sp);
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
|
@ -474,16 +539,24 @@ namespace Server.Items
|
|||
public override bool AllowSecureTrade(Mobile from, Mobile to, Mobile newOwner, bool accepted)
|
||||
{
|
||||
if (!Ethic.CheckTrade(from, to, newOwner, this))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.AllowSecureTrade(from, to, newOwner, accepted);
|
||||
}
|
||||
|
||||
public override bool CanEquip(Mobile from)
|
||||
{
|
||||
if (!Ethic.CheckEquip(from, this)) return false;
|
||||
if (!Ethic.CheckEquip(from, this))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!from.CanBeginAction<BaseWeapon>()) return false;
|
||||
if (!from.CanBeginAction<BaseWeapon>())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CanEquip(from);
|
||||
}
|
||||
|
|
@ -496,7 +569,10 @@ namespace Server.Items
|
|||
{
|
||||
var type = GetTypeForSpell(scroll.SpellID);
|
||||
|
||||
if (type != SpellbookType) return false;
|
||||
if (type != SpellbookType)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (HasSpell(scroll.SpellID))
|
||||
{
|
||||
|
|
@ -526,7 +602,9 @@ namespace Server.Items
|
|||
public override void OnAfterDuped(Item newItem)
|
||||
{
|
||||
if (!(newItem is Spellbook book))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
book.Attributes = new AosAttributes(newItem, Attributes);
|
||||
book.SkillBonuses = new AosSkillBonuses(newItem, SkillBonuses);
|
||||
|
|
@ -547,13 +625,19 @@ namespace Server.Items
|
|||
var modName = Serial.ToString();
|
||||
|
||||
if (strBonus != 0)
|
||||
from.AddStatMod(new StatMod(StatType.Str, $"{modName}Str", strBonus, TimeSpan.Zero));
|
||||
{
|
||||
@from.AddStatMod(new StatMod(StatType.Str, $"{modName}Str", strBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
if (dexBonus != 0)
|
||||
from.AddStatMod(new StatMod(StatType.Dex, $"{modName}Dex", dexBonus, TimeSpan.Zero));
|
||||
{
|
||||
@from.AddStatMod(new StatMod(StatType.Dex, $"{modName}Dex", dexBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
if (intBonus != 0)
|
||||
from.AddStatMod(new StatMod(StatType.Int, $"{modName}Int", intBonus, TimeSpan.Zero));
|
||||
{
|
||||
@from.AddStatMod(new StatMod(StatType.Int, $"{modName}Int", intBonus, TimeSpan.Zero));
|
||||
}
|
||||
}
|
||||
|
||||
from.CheckStatTimers();
|
||||
|
|
@ -590,7 +674,9 @@ namespace Server.Items
|
|||
var ns = to.NetState;
|
||||
|
||||
if (ns == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Parent == null)
|
||||
{
|
||||
|
|
@ -600,9 +686,13 @@ namespace Server.Items
|
|||
{
|
||||
// What will happen if the client doesn't know about our parent?
|
||||
if (ns.ContainerGridLines)
|
||||
{
|
||||
to.Send(new ContainerContentUpdate6017(this));
|
||||
}
|
||||
else
|
||||
{
|
||||
to.Send(new ContainerContentUpdate(this));
|
||||
}
|
||||
}
|
||||
else if (Parent is Mobile)
|
||||
{
|
||||
|
|
@ -611,9 +701,13 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (ns.HighSeas)
|
||||
{
|
||||
to.Send(new DisplaySpellbookHS(Serial));
|
||||
}
|
||||
else
|
||||
{
|
||||
to.Send(new DisplaySpellbook(Serial));
|
||||
}
|
||||
|
||||
if (ObjectPropertyList.Enabled)
|
||||
{
|
||||
|
|
@ -624,17 +718,25 @@ namespace Server.Items
|
|||
else
|
||||
{
|
||||
if (ns.ContainerGridLines)
|
||||
{
|
||||
to.Send(new SpellbookContent6017(Serial, BookOffset + 1, m_Content));
|
||||
}
|
||||
else
|
||||
{
|
||||
to.Send(new SpellbookContent(Serial, BookOffset + 1, m_Content));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ns.ContainerGridLines)
|
||||
{
|
||||
to.Send(new SpellbookContent6017(Serial, BookOffset + 1, m_Content));
|
||||
}
|
||||
else
|
||||
{
|
||||
to.Send(new SpellbookContent(Serial, BookOffset + 1, m_Content));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -643,13 +745,19 @@ namespace Server.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (m_Quality == BookQuality.Exceptional)
|
||||
{
|
||||
list.Add(1063341); // exceptional
|
||||
}
|
||||
|
||||
if (m_EngravedText != null)
|
||||
{
|
||||
list.Add(1072305, m_EngravedText); // Engraved: ~1_INSCRIPTION~
|
||||
}
|
||||
|
||||
if (m_Crafter != null)
|
||||
{
|
||||
list.Add(1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
}
|
||||
|
||||
SkillBonuses.GetProperties(list);
|
||||
|
||||
|
|
@ -657,89 +765,141 @@ namespace Server.Items
|
|||
{
|
||||
var entry = SlayerGroup.GetEntryByName(m_Slayer);
|
||||
if (entry != null)
|
||||
{
|
||||
list.Add(entry.Title);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_Slayer2 != SlayerName.None)
|
||||
{
|
||||
var entry = SlayerGroup.GetEntryByName(m_Slayer2);
|
||||
if (entry != null)
|
||||
{
|
||||
list.Add(entry.Title);
|
||||
}
|
||||
}
|
||||
|
||||
int prop;
|
||||
|
||||
if ((prop = Attributes.WeaponDamage) != 0)
|
||||
{
|
||||
list.Add(1060401, prop.ToString()); // damage increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.DefendChance) != 0)
|
||||
{
|
||||
list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusDex) != 0)
|
||||
{
|
||||
list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.EnhancePotions) != 0)
|
||||
{
|
||||
list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.CastRecovery) != 0)
|
||||
{
|
||||
list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.CastSpeed) != 0)
|
||||
{
|
||||
list.Add(1060413, prop.ToString()); // faster casting ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.AttackChance) != 0)
|
||||
{
|
||||
list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusHits) != 0)
|
||||
{
|
||||
list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusInt) != 0)
|
||||
{
|
||||
list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.LowerManaCost) != 0)
|
||||
{
|
||||
list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.LowerRegCost) != 0)
|
||||
{
|
||||
list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.Luck) != 0)
|
||||
{
|
||||
list.Add(1060436, prop.ToString()); // luck ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusMana) != 0)
|
||||
{
|
||||
list.Add(1060439, prop.ToString()); // mana increase ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.RegenMana) != 0)
|
||||
{
|
||||
list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~
|
||||
}
|
||||
|
||||
if (Attributes.NightSight != 0)
|
||||
{
|
||||
list.Add(1060441); // night sight
|
||||
}
|
||||
|
||||
if ((prop = Attributes.ReflectPhysical) != 0)
|
||||
{
|
||||
list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.RegenStam) != 0)
|
||||
{
|
||||
list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.RegenHits) != 0)
|
||||
{
|
||||
list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
|
||||
}
|
||||
|
||||
if (Attributes.SpellChanneling != 0)
|
||||
{
|
||||
list.Add(1060482); // spell channeling
|
||||
}
|
||||
|
||||
if ((prop = Attributes.SpellDamage) != 0)
|
||||
{
|
||||
list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusStam) != 0)
|
||||
{
|
||||
list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusStr) != 0)
|
||||
{
|
||||
list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.WeaponSpeed) != 0)
|
||||
{
|
||||
list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~%
|
||||
}
|
||||
|
||||
if (Core.ML && (prop = Attributes.IncreasedKarmaLoss) != 0)
|
||||
{
|
||||
list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~%
|
||||
}
|
||||
|
||||
list.Add(1042886, SpellCount.ToString()); // ~1_NUMBERS_OF_SPELLS~ Spells
|
||||
}
|
||||
|
|
@ -749,7 +909,9 @@ namespace Server.Items
|
|||
base.OnSingleClick(from);
|
||||
|
||||
if (m_Crafter != null)
|
||||
LabelTo(from, 1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
{
|
||||
LabelTo(@from, 1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
}
|
||||
|
||||
LabelTo(from, 1042886, SpellCount.ToString());
|
||||
}
|
||||
|
|
@ -759,11 +921,15 @@ namespace Server.Items
|
|||
var pack = from.Backpack;
|
||||
|
||||
if (Parent == from || pack != null && Parent == pack)
|
||||
DisplayTo(from);
|
||||
{
|
||||
DisplayTo(@from);
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(
|
||||
{
|
||||
@from.SendLocalizedMessage(
|
||||
500207
|
||||
); // The spellbook must be in your backpack (and not in a container within) to open.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
|
|
@ -839,7 +1005,9 @@ namespace Server.Items
|
|||
SkillBonuses ??= new AosSkillBonuses(this);
|
||||
|
||||
if (Core.AOS && Parent is Mobile mobile)
|
||||
{
|
||||
SkillBonuses.AddTo(mobile);
|
||||
}
|
||||
|
||||
var strBonus = Attributes.BonusStr;
|
||||
var dexBonus = Attributes.BonusDex;
|
||||
|
|
@ -852,13 +1020,19 @@ namespace Server.Items
|
|||
var modName = Serial.ToString();
|
||||
|
||||
if (strBonus != 0)
|
||||
{
|
||||
m.AddStatMod(new StatMod(StatType.Str, $"{modName}Str", strBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
if (dexBonus != 0)
|
||||
{
|
||||
m.AddStatMod(new StatMod(StatType.Dex, $"{modName}Dex", dexBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
if (intBonus != 0)
|
||||
{
|
||||
m.AddStatMod(new StatMod(StatType.Int, $"{modName}Int", intBonus, TimeSpan.Zero));
|
||||
}
|
||||
}
|
||||
|
||||
m.CheckStatTimers();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue