This reverts commit 179cb50557.
This commit is contained in:
parent
179cb50557
commit
c2ecc76457
588 changed files with 16260 additions and 10926 deletions
|
|
@ -135,9 +135,9 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
if (info.ButtonID == 1 || info.ButtonID == 2)
|
||||
{
|
||||
|
|
@ -147,10 +147,9 @@ namespace Server.Items
|
|||
return;
|
||||
}
|
||||
|
||||
if (from is PlayerMobile mobile)
|
||||
mobile.AnkhNextUse = DateTime.UtcNow + TimeSpan.FromHours(1);
|
||||
if (from is PlayerMobile mobile) mobile.AnkhNextUse = DateTime.UtcNow + TimeSpan.FromHours(1);
|
||||
|
||||
base.OnResponse(sender, info);
|
||||
base.OnResponse(state, info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,8 @@ namespace Server.Items
|
|||
|
||||
public void TurnOn()
|
||||
{
|
||||
m_Fire ??= new Item();
|
||||
if (m_Fire == null)
|
||||
m_Fire = new Item();
|
||||
|
||||
m_Fire.ItemID = 0x19AB;
|
||||
m_Fire.Movable = false;
|
||||
|
|
|
|||
|
|
@ -63,37 +63,37 @@ namespace Server.Items
|
|||
switch (direction)
|
||||
{
|
||||
case CannonDirection.North:
|
||||
{
|
||||
AddComponent(new CannonAddonComponent(0xE8D), 0, 0, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE8C), 0, 1, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE8B), 0, 2, 0);
|
||||
{
|
||||
AddComponent(new CannonAddonComponent(0xE8D), 0, 0, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE8C), 0, 1, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE8B), 0, 2, 0);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CannonDirection.East:
|
||||
{
|
||||
AddComponent(new CannonAddonComponent(0xE96), 0, 0, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE95), -1, 0, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE94), -2, 0, 0);
|
||||
{
|
||||
AddComponent(new CannonAddonComponent(0xE96), 0, 0, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE95), -1, 0, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE94), -2, 0, 0);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CannonDirection.South:
|
||||
{
|
||||
AddComponent(new CannonAddonComponent(0xE91), 0, 0, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE92), 0, -1, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE93), 0, -2, 0);
|
||||
{
|
||||
AddComponent(new CannonAddonComponent(0xE91), 0, 0, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE92), 0, -1, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE93), 0, -2, 0);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
AddComponent(new CannonAddonComponent(0xE8E), 0, 0, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE8F), 1, 0, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE90), 2, 0, 0);
|
||||
{
|
||||
AddComponent(new CannonAddonComponent(0xE8E), 0, 0, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE8F), 1, 0, 0);
|
||||
AddComponent(new CannonAddonComponent(0xE90), 2, 0, 0);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CannonDirection CannonDirection { get; private set; }
|
||||
public CannonDirection CannonDirection{ get; private set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Charges
|
||||
|
|
@ -261,19 +261,34 @@ namespace Server.Items
|
|||
{
|
||||
if (!Utility.InRange(new Point3D(p), m_Cannon.Location, 2))
|
||||
{
|
||||
bool allow = false;
|
||||
|
||||
int x = p.X - m_Cannon.X;
|
||||
int y = p.Y - m_Cannon.Y;
|
||||
|
||||
bool allow = m_Cannon.CannonDirection switch
|
||||
switch (m_Cannon.CannonDirection)
|
||||
{
|
||||
case CannonDirection.North:
|
||||
if (y < 0 && Math.Abs(x) <= -y / 3)
|
||||
allow = true;
|
||||
|
||||
CannonDirection.North => y < 0 && Math.Abs(x) <= -y / 3,
|
||||
CannonDirection.East => x > 0 && Math.Abs(y) <= x / 3,
|
||||
CannonDirection.South => y > 0 && Math.Abs(x) <= y / 3,
|
||||
CannonDirection.West => x < 0 && Math.Abs(y) <= -x / 3,
|
||||
_ => false,
|
||||
};
|
||||
break;
|
||||
case CannonDirection.East:
|
||||
if (x > 0 && Math.Abs(y) <= x / 3)
|
||||
allow = true;
|
||||
|
||||
break;
|
||||
case CannonDirection.South:
|
||||
if (y > 0 && Math.Abs(x) <= y / 3)
|
||||
allow = true;
|
||||
|
||||
break;
|
||||
case CannonDirection.West:
|
||||
if (x < 0 && Math.Abs(y) <= -x / 3)
|
||||
allow = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (allow && Utility.InRange(new Point3D(p), m_Cannon.Location, 14))
|
||||
m_Cannon.DoFireEffect(p);
|
||||
|
|
@ -286,7 +301,9 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1049630); // You cannot see that target!
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnTargetOutOfRange(Mobile from, object targeted)
|
||||
|
|
@ -324,10 +341,10 @@ namespace Server.Items
|
|||
AddHtmlLocalized(195, 109, 120, 20, 1076197, 0x7FFF); // Recharge
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
if (m_Cannon?.Deleted == false && info.ButtonID == (int)Buttons.Recharge)
|
||||
m_Cannon.Fill(sender.Mobile, m_Keg);
|
||||
m_Cannon.Fill(state.Mobile, m_Keg);
|
||||
}
|
||||
|
||||
private enum Buttons
|
||||
|
|
@ -356,8 +373,7 @@ namespace Server.Items
|
|||
|
||||
public override BaseAddon Addon => new CannonAddon(m_Direction)
|
||||
{
|
||||
Charges = m_Charges,
|
||||
IsRewardItem = m_IsRewardItem
|
||||
Charges = m_Charges, IsRewardItem = m_IsRewardItem
|
||||
};
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ namespace Server.Items
|
|||
AddTextEntry(75, 245, 350, 40, 0x0, (int)Buttons.Text, "");
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
if (m_Tool?.Deleted != false || m_Target?.Deleted != false)
|
||||
return;
|
||||
|
|
@ -319,12 +319,12 @@ namespace Server.Items
|
|||
AddHtmlLocalized(40, 109, 100, 20, 1060051, 0x7FFF); // CANCEL
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
if (m_Engraver?.Deleted != false || info.ButtonID != (int)Buttons.Confirm)
|
||||
return;
|
||||
|
||||
m_Engraver.Recharge(sender.Mobile, m_Guildmaster);
|
||||
m_Engraver.Recharge(state.Mobile, m_Guildmaster);
|
||||
}
|
||||
|
||||
private enum Buttons
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue