public static void BySPStoneHandler(ZoneClient client, Packet packet) { short Amount; if (packet.TryReadShort(out Amount)) { client.Character.ChangeMoney(client.Character.Character.Money -= client.Character.BaseStats.PriceSPStone); short Am = Amount += client.Character.StonesSP; client.Character.StonesHP = Am; using (var p = new Packet(SH20Type.ChangeSPStones)) { p.WriteShort(Am); client.SendPacket(p); } } }
public static void BuySPStonesFromNPC(ZoneClient client, Packet packet) { short amount; ZoneCharacter character = client.Character; if (!packet.TryReadShort(out amount)) { Log.WriteLine(LogLevel.Debug, "BuySPStones :: Got unknown amount from {0}", character.Name); } using (var ppacket = new Packet(SH20Type.ChangeSPStones)) { using (var pppacket = new Packet(SH4Type.MoneyChange)) { character.BuySPStones(ppacket, pppacket, amount); client.SendPacket(ppacket); client.SendPacket(pppacket); } } }