Exemplo n.º 1
0
        public static void SendPartyInformation(ZoneClient client)
        {
            if (Program.Entity.Parties.Where(c => c.CharNo == client.Character.ID).Count() == 1)
            {
                Party PartyNo = Program.Entity.Parties.First(c => c.CharNo == client.Character.ID);
                foreach (Party party in Program.Entity.Parties.Where(c => c.PartyNo == PartyNo.PartyNo))
                {
                    Character  Pcharacter    = Program.Entity.Characters.First(c => c.ID == party.CharNo);
                    ZoneClient otherLiveInfo = ClientManager.Instance.GetClientByName(Pcharacter.Name);
                    if (otherLiveInfo != null)
                    {
                        if (otherLiveInfo.Character.MapID == client.Character.MapID)
                        {
                            using (var ppacket = new Packet(SH14Type.PartyInformationShort))
                            {
                                ppacket.WriteByte(1);
                                ppacket.WriteString(otherLiveInfo.Character.Name, 16);
                                ppacket.WriteUInt(otherLiveInfo.Character.HP);
                                ppacket.WriteUInt(otherLiveInfo.Character.SP);
                                ppacket.WriteUInt(otherLiveInfo.Character.LP);
                                client.SendPacket(ppacket);
                            }

                            using (var ppacket = new Packet(SH14Type.PartyInformation))
                            {
                                ppacket.WriteByte(1); //unk
                                ppacket.WriteString(otherLiveInfo.Character.Name, 16);
                                ppacket.WriteByte((byte)otherLiveInfo.Character.Job);
                                ppacket.WriteByte(otherLiveInfo.Character.Level);
                                ppacket.WriteUInt(otherLiveInfo.Character.HP);
                                ppacket.WriteUInt(otherLiveInfo.Character.SP);
                                ppacket.WriteUInt(otherLiveInfo.Character.LP);
                                ppacket.WriteByte(1); //unk
                                client.SendPacket(ppacket);
                            }

                            using (var ppacket = new Packet(SH14Type.PartyLoginCord))
                            {
                                ppacket.WriteByte(1); //unk
                                ppacket.WriteString(otherLiveInfo.Character.Name, 16);
                                ppacket.WriteInt(otherLiveInfo.Character.Position.X);
                                ppacket.WriteInt(otherLiveInfo.Character.Position.Y);
                                client.SendPacket(ppacket);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
 public static void SendPartyMemberHPSPLP(ZoneCharacter character)
 {
     if (Program.Entity.Parties.Where(c => c.CharNo == character.Client.Character.ID).Count() == 1)
     {
         Party PartyNo = Program.Entity.Parties.First(c => c.CharNo == character.Client.Character.ID);
         foreach (Party party in Program.Entity.Parties.Where(c => c.PartyNo == PartyNo.PartyNo))
         {
             Character  Pcharacter    = Program.Entity.Characters.First(c => c.ID == party.CharNo);
             ZoneClient otherLiveInfo = ClientManager.Instance.GetClientByName(Pcharacter.Name);
             if (otherLiveInfo != null)
             {
                 if (otherLiveInfo.Character.MapID == character.Client.Character.MapID)
                 {
                     using (var ppacket = new Packet(SH14Type.PartyInformationShort))
                     {
                         ppacket.WriteByte(1);
                         ppacket.WriteString(character.Client.Character.Name, 16);
                         ppacket.WriteUInt(character.Client.Character.HP);
                         ppacket.WriteUInt(character.Client.Character.SP);
                         ppacket.WriteUInt(character.Client.Character.LP);
                         otherLiveInfo.SendPacket(ppacket);
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 private void SendTradeBreak(ZoneClient pClient)
 {
     using (var packet = new Packet(SH19Type.SendTradeBreak))
     {
         pClient.SendPacket(packet);
     }
 }
Exemplo n.º 4
0
 public static void SendPing(ZoneClient character)
 {
     using (var packet = new Packet(SH2Type.Ping))
     {
         character.SendPacket(packet);
     }
 }
Exemplo n.º 5
0
 private void SendTradeAgreepTo(ZoneClient pClient)
 {
     using (var packet = new Packet(SH19Type.SendTradeAgreeTo))
     {
         pClient.SendPacket(packet);
     }
 }
Exemplo n.º 6
0
 public static void SendSetUsablePoint(ZoneClient client, byte stat)
 {
     using (var packet = new Packet(SH4Type.SetPointOnStat))
     {
         packet.WriteByte(stat); // amount
         client.SendPacket(packet);
     }
 }
Exemplo n.º 7
0
 public static void SendUsablePoints(ZoneClient client)
 {
     using (var packet = new Packet(SH4Type.CharacterPoints))
     {
         packet.WriteByte(client.Character.character.UsablePoints);
         client.SendPacket(packet);
     }
 }
Exemplo n.º 8
0
 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);
     }
 }
Exemplo n.º 9
0
 public static void SendConnectError(ZoneClient client, ConnectErrors error)
 {
     using (var packet = new Packet(SH4Type.ConnectError))
     {
         packet.WriteUShort((ushort)error);
         client.SendPacket(packet);
     }
 }
Exemplo n.º 10
0
 public static void SendNPCInteraction(ZoneClient client, ushort ID)
 {
     using (var packet = new Packet(SH8Type.Interaction))
     {
         packet.WriteUShort(ID);
         client.SendPacket(packet);
     }
 }
Exemplo n.º 11
0
 public static void SendMoveIteminContaInComplet(ZoneClient pClient)
 {
     using (var packet = new Packet(SH12Type.MoveIteminContaInComplet))
     {
         packet.WriteUShort(577);
         pClient.SendPacket(packet);
     }
 }
Exemplo n.º 12
0
 private void SendItemRemoveMe(ZoneClient pClient, byte pTradeSlot)
 {
     using (var packet = new Packet(SH19Type.SendItemRemove))
     {
         packet.WriteByte(pTradeSlot);
         pClient.SendPacket(packet);
     }
 }
Exemplo n.º 13
0
 private void SendItemRemovFromHandel(ZoneClient pClient, byte Slot)
 {
     using (var packet = new Packet(SH19Type.SendRemoveItemFromHandel))
     {
         packet.WriteByte(Slot);
         pClient.SendPacket(packet);
     }
 }
Exemplo n.º 14
0
 public static void SendError(ZoneClient client, ServerError error)
 {
     using (var pack = new Packet(SH3Type.Error))
     {
         pack.WriteShort((byte)error);
         client.SendPacket(pack);
     }
 }
Exemplo n.º 15
0
 public static void SendEndRestResponse(ZoneClient client)
 {
     using (var packet = new Packet(SH8Type.EndRest))
     {
         packet.WriteUShort(0x0a81);
         client.SendPacket(packet);
     }
 }
Exemplo n.º 16
0
 private void SendChangeMoney(ZoneClient pClient, long money)
 {
     using (var packet = new Packet(SH19Type.SendChangeMoney))
     {
         packet.WriteLong(money);
         pClient.SendPacket(packet);
     }
 }
Exemplo n.º 17
0
 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);
     }
 }
Exemplo n.º 18
0
 public static void SendTradeRequest(ZoneClient client, ushort ObjID)
 {
     using (var packet = new Packet(SH19Type.TradeRequest))
     {
         ZoneClient otherclient = ClientManager.Instance.GetClientByObj(ObjID);
         packet.WriteUShort(client.Character.MapObjectID);
         otherclient.SendPacket(packet);
     }
 }
Exemplo n.º 19
0
 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);
     }
 }
Exemplo n.º 20
0
        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;
            }
        }
Exemplo n.º 21
0
 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);
     }
 }
Exemplo n.º 22
0
        public static void UseHPStoneHandler(ZoneClient client, Packet packet)
        {
            if (client.Character.StonesHP == 0)
            {
                using (var p = new Packet(SH20Type.ErrorUseStone))
                {
                    client.SendPacket(p);
                }
            }
            else
            {
                client.Character.HealHP((uint)client.Character.BaseStats.SoulHP);

                using (var p = new Packet(SH20Type.StartHPStoneCooldown))
                {
                    client.SendPacket(p);
                }
            }
        }
Exemplo n.º 23
0
 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);
     }
 }
Exemplo n.º 24
0
        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);
                }
            }
        }
Exemplo n.º 25
0
 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);
     }
 }
Exemplo n.º 26
0
        public static void HandleTrade(ZoneClient client, Packet packet)
        {
            ushort PlayerObjID;

            if (!packet.TryReadUShort(out PlayerObjID))
            {
                Packet ppacket = new Packet(SH19Type.TradeNotAccepted);
                ppacket.WriteUShort(client.Character.MapObjectID);
                client.SendPacket(ppacket);
                Log.WriteLine(LogLevel.Error, "TradeRequest :: Invalid Obj ID from {0}", client.Character.Name);
            }

            SendTradeRequest(client, PlayerObjID);
        }
Exemplo n.º 27
0
        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);
            }
        }
Exemplo n.º 28
0
        public static void ByHPStoneHandler(ZoneClient client, Packet packet)
        {
            short Amount;

            if (packet.TryReadShort(out Amount))
            {
                client.Character.ChangeMoney(client.Character.Character.Money -= client.Character.BaseStats.PriceHPStone);
                short am = Amount += client.Character.StonesSP;
                client.Character.StonesSP = am;
                using (var p = new Packet(SH20Type.ChangeHPStones))
                {
                    p.WriteShort(am);
                    client.SendPacket(p);
                }
            }
        }
Exemplo n.º 29
0
 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);
     }
 }
Exemplo n.º 30
0
        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);
            }
        }