fix(core): Converts mobile name and animation packets (#366)
- [X] Converts mobile name - [X] Converts animation - [X] Updates some old tests
This commit is contained in:
parent
5b69f1d389
commit
26243a72a7
7 changed files with 209 additions and 173 deletions
|
|
@ -3248,7 +3248,7 @@ namespace Server
|
|||
{
|
||||
if (hitsPacket[0] == 0)
|
||||
{
|
||||
OutgoingMobilePackets.CreateMobileHits(ref hitsPacket, m, true);
|
||||
OutgoingMobilePackets.CreateMobileHits(hitsPacket, m, true);
|
||||
}
|
||||
|
||||
state.Send(hitsPacket);
|
||||
|
|
@ -6867,67 +6867,64 @@ namespace Server
|
|||
|
||||
ProcessDelta();
|
||||
|
||||
Packet p = null;
|
||||
// Packet pNew = null;
|
||||
|
||||
var eable = map.GetClientsInRange(m_Location);
|
||||
|
||||
Span<byte> buffer = stackalloc byte[OutgoingMobilePackets.MobileAnimationPacketLength];
|
||||
buffer.InitializePacket();
|
||||
|
||||
foreach (var state in eable)
|
||||
{
|
||||
if (state.Mobile.CanSee(this))
|
||||
{
|
||||
state.Mobile.ProcessDelta();
|
||||
|
||||
if (p == null)
|
||||
if (Body.IsGargoyle)
|
||||
{
|
||||
if (Body.IsGargoyle)
|
||||
frameCount = 10;
|
||||
|
||||
if (Flying)
|
||||
{
|
||||
frameCount = 10;
|
||||
|
||||
if (Flying)
|
||||
action = action switch
|
||||
{
|
||||
action = action switch
|
||||
{
|
||||
>= 9 and <= 11 => 71,
|
||||
>= 12 and <= 14 => 72,
|
||||
20 => 77,
|
||||
31 => 71,
|
||||
34 => 78,
|
||||
>= 200 and <= 259 => 75,
|
||||
>= 260 and <= 270 => 75,
|
||||
_ => action
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
action = action switch
|
||||
{
|
||||
>= 200 and <= 259 => 17,
|
||||
>= 260 and <= 270 => 16,
|
||||
_ => action
|
||||
};
|
||||
}
|
||||
>= 9 and <= 11 => 71,
|
||||
>= 12 and <= 14 => 72,
|
||||
20 => 77,
|
||||
31 => 71,
|
||||
34 => 78,
|
||||
>= 200 and <= 259 => 75,
|
||||
>= 260 and <= 270 => 75,
|
||||
_ => action
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
action = action switch
|
||||
{
|
||||
>= 200 and <= 259 => 17,
|
||||
>= 260 and <= 270 => 16,
|
||||
_ => action
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
p = Packet.Acquire(
|
||||
new MobileAnimation(
|
||||
Serial,
|
||||
action,
|
||||
frameCount,
|
||||
repeatCount,
|
||||
forward,
|
||||
repeat,
|
||||
delay
|
||||
)
|
||||
if (buffer[0] == 0)
|
||||
{
|
||||
OutgoingMobilePackets.CreateMobileAnimation(
|
||||
buffer,
|
||||
Serial,
|
||||
action,
|
||||
frameCount,
|
||||
repeatCount,
|
||||
forward,
|
||||
repeat,
|
||||
delay
|
||||
);
|
||||
}
|
||||
|
||||
state.Send(p);
|
||||
state.Send(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
Packet.Release(p);
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue