Revert "Updates Packets & Randomizer (#43)" (#61)

This reverts commit 179cb50557.
This commit is contained in:
Kamron Batman 2019-11-11 08:46:11 -08:00 • committed by GitHub
parent 179cb50557
commit c2ecc76457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
588 changed files with 16260 additions and 10926 deletions

View file

@ -49,7 +49,9 @@ namespace Server.Commands
pm.SendMessage("#{0}: {1}", i + 1, list[i].Name);
}
else
{
pm.SendMessage("Your visibility list is empty.");
}
}
}
@ -69,7 +71,7 @@ namespace Server.Commands
Mobile m = list[i];
if (!m.CanSee(pm) && Utility.InUpdateRange(m, pm))
Packets.SendRemoveEntity(m.NetState, pm.Serial);
m.Send(pm.RemovePacket);
}
}
}
@ -82,54 +84,58 @@ namespace Server.Commands
protected override void OnTarget(Mobile from, object targeted)
{
if (!(from is PlayerMobile pm) || !(targeted is Mobile targ))
if (from is PlayerMobile pm && targeted is Mobile targ)
{
from.SendMessage("Add only mobiles to your visibility list.");
return;
}
if (targ.AccessLevel <= pm.AccessLevel)
{
List<Mobile> list = pm.VisibilityList;
if (targ.AccessLevel > pm.AccessLevel)
{
pm.SendMessage("They can already see you!");
return;
}
if (list.Contains(targ))
{
list.Remove(targ);
pm.SendMessage("{0} has been removed from your visibility list.", targ.Name);
}
else
{
list.Add(targ);
pm.SendMessage("{0} has been added to your visibility list.", targ.Name);
}
List<Mobile> list = pm.VisibilityList;
if (Utility.InUpdateRange(targ, from))
{
NetState ns = targ.NetState;
if (list.Contains(targ))
{
list.Remove(targ);
pm.SendMessage("{0} has been removed from your visibility list.", targ.Name);
if (ns != null)
{
if (targ.CanSee(pm))
{
ns.Send(MobileIncoming.Create(ns, targ, pm));
if (ObjectPropertyList.Enabled)
{
ns.Send(pm.OPLPacket);
foreach (Item item in pm.Items)
ns.Send(item.OPLPacket);
}
}
else
{
ns.Send(pm.RemovePacket);
}
}
}
}
else
{
pm.SendMessage("They can already see you!");
}
}
else
{
list.Add(targ);
pm.SendMessage("{0} has been added to your visibility list.", targ.Name);
}
if (Utility.InUpdateRange(targ, from))
{
NetState ns = targ.NetState;
if (ns != null)
{
if (targ.CanSee(pm))
{
Packets.SendMobileIncoming(ns, targ, pm);
if (ObjectPropertyList.Enabled)
{
pm.PropertyList.Send(ns);
foreach (Item item in pm.Items)
item.PropertyList.SendOPLInfo(ns);
}
}
else
Packets.SendRemoveEntity(ns, pm.Serial);
}
from.SendMessage("Add only mobiles to your visibility list.");
}
}
}
}
}
}