public static void SendPing(ZoneClient character) { using (var packet = new Packet(SH2Type.Ping)) { character.SendPacket(packet); } }
public static void SendError(ZoneClient client, ServerError error) { using (Packet pack = new Packet(SH3Type.Error)) { pack.WriteShort((byte)error); client.SendPacket(pack); } }
public static void UseSPStoneHandler(ZoneClient client, Packet packet) { if (client.Character.StonesSP == 0) { using (var p = new Packet(SH20Type.ErrorUseStone)) { client.SendPacket(p); } } else { client.Character.HealSP((uint)client.Character.BaseStats.SoulSP); using (var p = new Packet(SH20Type.StartSPStoneCooldown)) { client.SendPacket(p); } } }
public static void MasterRequestCoper(ZoneClient client, Packet pPacket) { byte unk; if (!pPacket.TryReadByte(out unk)) return; using (var packet = new Packet(SH37Type.SendRecivveCopper)) { packet.WriteUShort(7264);//unk packet.WriteLong(client.Character.Character.ReviveCoper); client.SendPacket(packet); } }
public static void MasterRequestAcceptCoper(ZoneClient client, Packet pPacket) { client.Character.Character.ReviveCoper = 0; InterServer.InterHandler.SendReciveCoper(client.Character.Character.Name, client.Character.Character.ReviveCoper,true); using(var packet = new Packet(37,65)) { packet.WriteUShort(7272);//unk packet.WriteLong(client.Character.RecviveCoper); client.SendPacket(packet); } }
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 SendRevive(ZoneClient client, ushort mapid, int x, int y) { using (var packet = new Packet(SH4Type.Revive)) { packet.WriteUShort(mapid); packet.WriteInt(x); packet.WriteInt(y); client.SendPacket(packet); } }
private void SendTradeLock(ZoneClient pClient) { using (var packet = new Packet(SH19Type.SendTradeLock)) { pClient.SendPacket(packet); } }
private void SendTradeAddItemTo(ZoneClient pClient,Item pItem,byte TradepSlot) { using (var packet = new Packet(SH19Type.SendAddItem)) { packet.WriteByte(TradepSlot); if (pItem.ItemInfo.Slot == ItemSlot.None) pItem.WriteStats(packet); else pItem.WriteEquipStats(packet); pClient.SendPacket(packet); } }
private void SendItemRemovFromHandel(ZoneClient pClient, byte Slot) { using (var packet = new Packet(SH19Type.SendRemoveItemFromHandel)) { packet.WriteByte(Slot); pClient.SendPacket(packet); } }
private void SendChangeMoney(ZoneClient pClient, long money) { using (var packet = new Packet(SH19Type.SendChangeMoney)) { packet.WriteLong(money); pClient.SendPacket(packet); } }
public static void SendAdminNotice(ZoneClient client, string text) { using (var packet = new Packet(SH8Type.GmNotice)) { packet.WriteByte((byte)text.Length); packet.WriteString(text, text.Length); client.SendPacket(packet); } }
public static void SendStatsUpdate(MapObject pObject, ZoneClient to, bool selectedby) { using (var packet = new Packet(SH9Type.StatUpdate)) { packet.WriteBool(selectedby); packet.WriteUShort(pObject.MapObjectID); if (pObject is ZoneCharacter) { ((ZoneCharacter)pObject).WriteUpdateStats(packet); } else { ((Mob)pObject).WriteUpdateStats(packet); } to.SendPacket(packet); } }
public static void SendUsablePoints(ZoneClient client) { using (var packet = new Packet(SH4Type.CharacterPoints)) { packet.WriteByte(client.Character.Character.UsablePoints); client.SendPacket(packet); } }
public static void SendSetUsablePoint(ZoneClient client, byte stat) { using (var packet = new Packet(SH4Type.SetPointOnStat)) { packet.WriteByte(stat); // amount client.SendPacket(packet); } }
public static void SendReviveWindow(ZoneClient client, byte minutesTillExpire) { using (var packet = new Packet(SH4Type.ReviveWindow)) { packet.WriteByte(minutesTillExpire); // It's not a short, the byte after it is buffershit client.SendPacket(packet); } }
public static void UseTeleporter(ZoneClient client, Packet packet) { byte anwser; if (packet.TryReadByte(out anwser)) { using (Packet Packet = new Packet(SH6Type.TelePorter)) { Packet.WriteShort(6593);//code for normal teleport client.SendPacket(Packet); } switch (anwser) { case 0: client.Character.ChangeMap(0, 4199, 4769);//Roumen break; case 1: client.Character.ChangeMap(9, 11802, 10466);//Eldrine break; case 2: client.Character.ChangeMap(75, 9069, 9312);//EldGbl02 break; case 3: client.Character.ChangeMap(5,13658,7812);//RouVal01 break; default: Log.WriteLine(LogLevel.Warn,"Unkown Teleport Answer {1}",anwser); break; } } }
public static void SendBeginRestResponse(ZoneClient client, ushort value) { /* 0x0A81 - OK to rest 0x0A82 - Can't rest on mount 0x0A83 - Too close to NPC*/ using (var packet = new Packet(SH8Type.BeginRest)) { packet.WriteUShort(value); client.SendPacket(packet); } }
private void SendItemRemoveMe(ZoneClient pClient,byte pTradeSlot) { using (var packet = new Packet(SH19Type.SendItemRemove)) { packet.WriteByte(pTradeSlot); pClient.SendPacket(packet); } }
public static void SendEndRestResponse(ZoneClient client) { using (var packet = new Packet(SH8Type.EndRest)) { packet.WriteUShort(0x0a81); client.SendPacket(packet); } }
private void SendTradeAddItemMe(ZoneClient pClient,byte pSlot,byte TradeSlot) { using (var packet = new Packet(SH19Type.SendAddItemSuccefull)) { packet.WriteByte(pSlot); packet.WriteByte(TradeSlot); pClient.SendPacket(packet); } }
public static void SendNpcInteraction(ZoneClient client, Npc npc) { switch (npc.Point.RoleArg0) { case "Guild": if (npc.Point.Role == "NPCMenu") { using (var packet = new Packet(SH15Type.GuildNpcReqest)) { client.SendPacket(packet); } } else { using (var packet = new Packet(SH8Type.Interaction)) { packet.WriteUShort(npc.ID); client.SendPacket(packet); } } break; case "Quest": //:TODO Quest Proggresion using (var packet = new Packet(SH8Type.Interaction)) { packet.WriteUShort(npc.ID); client.SendPacket(packet); } Console.WriteLine(npc.Point.RoleArg0); break; default: using (var packet = new Packet(SH8Type.Interaction)) { packet.WriteUShort(npc.ID); client.SendPacket(packet); } break; } }
private void SendTradeAgreepTo(ZoneClient pClient) { using (var packet = new Packet(SH19Type.SendTradeAgreeTo)) { pClient.SendPacket(packet); } }
public static void SendMoveIteminContaInComplet(ZoneClient pClient) { using (var packet = new Packet(SH12Type.MoveIteminContaInComplet)) { packet.WriteUShort(577); pClient.SendPacket(packet); } }
public static void GuildExtraRequest(ZoneClient client, Packet packet) { if (client.Character.Guild == null && client.Character.GuildAcademy == null) return; byte response; ushort ResponseCode; if (!packet.TryReadByte(out response)) return; switch (response) { case 0: if (client.Character.Guild == null) { //todo Response for is not in Guild end academymember return; } ResponseCode = 6104; break; case 1: break; case 2: break; } if (!client.Character.IsInaAcademy) { using (var pack = new Packet(SH38Type.GuildItemList)) { pack.WriteUShort(6104);//Responsecode // pack.WriteLong(client.Character.Guild.GuildMoney);//guildmoney pack.WriteByte((byte)client.Character.Guild.GuildStore.GuildStorageItems.Count);//ItemCount foreach (var pItem in client.Character.Guild.GuildStore.GuildStorageItems.Values) { if (pItem.ItemInfo.Slot == ItemSlot.None) { pItem.WriteInfo(pack); pack.WriteByte((byte)pItem.Ammount);//amount } else { pItem.WriteInfo(pack); } } client.SendPacket(pack); } } else { using (var pack = new Packet(SH38Type.GuildItemList)) { pack.WriteUShort(6104);//Responsecode // pack.WriteLong(client.Character.Guild.GuildMoney);//guildmoney pack.WriteByte((byte)client.Character.GuildAcademy.Guild.GuildStore.GuildStorageItems.Count);//ItemCount foreach (var pItem in client.Character.GuildAcademy.Guild.GuildStore.GuildStorageItems.Values) { if (pItem.ItemInfo.Slot == ItemSlot.None) { pItem.WriteInfo(pack); pack.WriteByte((byte)pItem.Ammount);//amount } else { pItem.WriteInfo(pack); } } client.SendPacket(pack); } } }
public static void SendConnectError(ZoneClient client, ConnectErrors error) { using (var packet = new Packet(SH4Type.ConnectError)) { packet.WriteUShort((ushort)error); client.SendPacket(packet); } }