Effects packets (#308)

- [X] Changes effect packets
- [X] Updates playing sounds
- [X] Updates Effects class to have more options so there are less direct calls to building the packets
- [X] Changes bonding status packet
This commit is contained in:
Kamron Batman 2020-11-12 00:52:38 -08:00 • committed by GitHub
parent 1c9439e4fd
commit 361ec4dba4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 958 additions and 833 deletions

View file

@ -394,7 +394,7 @@ namespace Server.Commands.Generic
index,
CommandLogging.Format(mob)
);
mob.Send(new PlaySound(index, mob.Location));
mob.SendSound(index);
}
else
{

View file

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using Server.Commands.Generic;
@ -420,19 +421,16 @@ namespace Server.Commands
toAll
);
Packet p = new PlaySound(index, m.Location);
p.Acquire();
Span<byte> buffer = stackalloc byte[OutgoingEffectPackets.SoundPacketLength];
OutgoingEffectPackets.CreateSoundEffect(ref buffer, index, m);
foreach (var state in m.GetClientsInRange(12))
{
if (toAll || state.Mobile.CanSee(m))
{
state.Send(p);
state.Send(buffer);
}
}
p.Release();
}
[Usage("Echo <text>")]