Beispiel #1
0
        public static void GetAcademyGoldRewardList(WorldClient client, Packet packet)
        {
            using (var pack = new Packet(SH38Type.SendAcademyGoldRewardList))
            {
                pack.WriteHexAsBytes("80 18");//responsecode
                pack.WriteByte(1);//stat count
                pack.WriteHexAsBytes("0A 0A CA 9A 3B 00 00 00 00");//unk

                pack.WriteByte(10);//levelbreich
                pack.WriteLong(1000);
                pack.WriteByte(15);//level bereich
                pack.WriteLong(1000);
                pack.WriteByte(26);//level bereich
                pack.WriteLong(1000);
                pack.WriteByte(31);//level bereich
                pack.WriteLong(1000);
                pack.WriteByte(36);//levelbereich
                pack.WriteLong(1000);
                pack.WriteByte(41);//level bereich
                pack.WriteLong(9000);
                pack.WriteByte(46);//level bereich
                pack.WriteLong(1000);
                pack.WriteByte(51);//level bereich
                pack.WriteLong(1000);
                pack.WriteByte(56);//level bereich
                pack.WriteLong(1000);
                client.SendPacket(pack);
            }
        }
Beispiel #2
0
 public void SendAddGuildStore(GuildStoreAddFlags Flags,string Charname,long Value,long NewGuildMoney = 0,ushort ItemID = 0xFFFF)
 {
     using (var packet = new Packet(SH38Type.AddToGuildStore))
     {
         packet.WriteByte(0);//unk
         packet.WriteByte((byte)Flags);
         packet.WriteString(Charname, 16);
         packet.WriteUShort(ItemID);
         packet.WriteByte(0);
         packet.WriteLong(Value);
         packet.WriteLong(NewGuildMoney);//new GuildMoney
         Guild.Broadcast(packet);
     }
 }
Beispiel #3
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);
     }
 }
Beispiel #4
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);
             }
        }
Beispiel #5
0
        public static void On_GameClient_UpdateGuildMessage(WorldClient Client, Packet Packet)
        {
            ushort length;
            string message;
            if (Client.Character.Guild == null
                || !Packet.TryReadUShort(out length)
                || !Packet.TryReadString(out message, length))
            {
                return;
            }

            //response packets
            using (var packet = new Packet(SH29Type.UnkMessageChange))
            {
                packet.WriteHexAsBytes("68 1B 00 92 AD F8 4F 2E 00 00 00 2B 00 00 00 17 00 00 00 07 00 00 00 06 00 00 00 70 00 00 00 06 00 00 00 BC 00 00 00 01 00 00 00 00 00");

                Client.SendPacket(packet);
            }
            using (var packet = new Packet(SH29Type.ClearGuildDetailsMessage))
            {
                packet.WriteUShort(3137);
                packet.WriteLong(0);

                Client.SendPacket(packet);
            }
            using (var packet = new Packet(SH29Type.UpdateGuildMessageResponse))
            {
                packet.WriteUShort(3137);
                Client.SendPacket(packet);
            }

            //update guild
            lock (Client.Character.Guild.ThreadLocker)
            {
                Client.Character.Guild.Message = message;
                Client.Character.Guild.MessageCreater = Client.Character;
                Client.Character.Guild.MessageCreateTime = Program.CurrentTime;

                Client.Character.Guild.Save();

                //broadcast packet to all guild members
                using (var packet = new Packet(SH29Type.SendUpdateGuildDetails))
                {
                    packet.Fill(4, 0x00);
                    packet.WriteInt(Client.Character.Guild.MessageCreateTime.Second);
                    packet.WriteInt(Client.Character.Guild.MessageCreateTime.Minute);
                    packet.WriteInt(Client.Character.Guild.MessageCreateTime.Hour);
                    packet.WriteInt(Client.Character.Guild.MessageCreateTime.Day);
                    packet.WriteInt(Client.Character.Guild.MessageCreateTime.Month - 1);
                    packet.WriteInt(Client.Character.Guild.MessageCreateTime.Year - 1900);
                    packet.WriteInt(0);
                    packet.WriteLong(0);
                    packet.WriteString(Client.Character.Character.Name, 16);
                    packet.WriteUShort(length);
                    packet.WriteString(message, length);

                    Client.Character.Guild.Broadcast(packet);
                }

                //send packet to zone that guild message changed
                using (var packet = new InterPacket(InterHeader.ZONE_GuildMessageUpdate))
                {
                    packet.WriteInt(Client.Character.Guild.ID);
                    packet.WriteInt(Client.Character.ID);
                    packet.WriteDateTime(Client.Character.Guild.MessageCreateTime);

                    packet.WriteUShort(length);
                    packet.WriteString(message, length);
                    ZoneManager.Instance.Broadcast(packet);
                }
            }
        }
Beispiel #6
0
 public void ChangeMoney(long newMoney)
 {
     this.Character.Money = newMoney;
     InterHandler.UpdateMoneyWorld(newMoney, this.Name);//update in world
     using (var packet = new Packet(SH4Type.Money))
     {
         packet.WriteLong(this.Character.Money);// money
         this.Client.SendPacket(packet);
     }
 }
Beispiel #7
0
        public void WriteDetailedInfoExtra(Packet packet, bool levelUP = false)
        {
            if (!levelUP)
            {
                packet.WriteUShort(this.MapObjectID);
            }

            packet.WriteLong(this.Exp);
            packet.WriteULong(DataProvider.Instance.GetMaxExpForLevel(this.Level));

            packet.WriteInt(BaseStats.Strength);
            packet.WriteInt(BaseStats.Strength + GetExtraStr());
            packet.WriteInt(BaseStats.Endurance);
            packet.WriteInt(BaseStats.Endurance + GetExtraEnd());
            packet.WriteInt(BaseStats.Dexterity);
            packet.WriteInt(BaseStats.Dexterity + GetExtraDex());
            packet.WriteInt(BaseStats.Intelligence);
            packet.WriteInt(BaseStats.Intelligence + GetExtraInt());
            packet.WriteInt(0); // Wizdom. It isn't set in the server so it can contain shit from old buffers... :D
            packet.WriteInt(0); // I once had a name here :P
            packet.WriteInt(BaseStats.Spirit);
            packet.WriteInt(BaseStats.Spirit + GetExtraSpr());

            packet.WriteInt(GetWeaponDamage()); //base damage
            packet.WriteInt(GetWeaponDamage(true)); //increased damage (e.g. buffs)
            packet.WriteInt(GetMagicDamage()); //magic dmg
            packet.WriteInt(GetMagicDamage(true)); //inc magic dmg

            packet.WriteInt(GetWeaponDefense()); //todo equip stats loading (weapondef)
            packet.WriteInt(GetWeaponDefense(true)); //weapondef inc

            packet.WriteInt(GetAim()); //TODO: basestats aim + dex?
            packet.WriteInt(GetAim(true)); //aim inc (calcuate later based on dex)

            packet.WriteInt(GetEvasion()); //evasion
            packet.WriteInt(GetEvasion(true)); //evasion inc

            packet.WriteInt(GetWeaponDamage()); //damage block again
            packet.WriteInt(GetWeaponDamage(true));

            packet.WriteInt(GetMagicDamage()); //magic damage
            packet.WriteInt(GetMagicDamage(true));

            packet.WriteInt(GetMagicDefense()); //magic def
            packet.WriteInt(GetMagicDefense(true)); //magic def inc

            packet.WriteInt(1);
            packet.WriteInt(20);
            packet.WriteInt(2);
            packet.WriteInt(40);

            packet.WriteUInt(BaseStats.MaxHP); //max HP
            packet.WriteUInt(BaseStats.MaxSP); //max SP

            packet.WriteInt(0);                   // UNK
            packet.WriteInt(BaseStats.MaxSoulHP);   // Max HP Stones
            packet.WriteInt(BaseStats.MaxSoulSP);   // Max SP Stones
            packet.Fill(64, 0);
            if (!levelUP)
            {
                packet.WriteInt(this.Position.X);
                packet.WriteInt(this.Position.Y);
            }
        }
Beispiel #8
0
 public void WriteDetailedInfo(Packet pPacket)
 {
     pPacket.WriteInt(ID);
     pPacket.WriteString(this.Name, 16);
     pPacket.WriteByte(this.Slot);
     pPacket.WriteByte(this.Level);
     pPacket.WriteLong(this.Exp);
     pPacket.WriteInt(12345678);                // UNK
     pPacket.WriteShort(this.StonesHP);
     pPacket.WriteShort(this.StonesSP);
     pPacket.WriteUInt(this.HP);
     pPacket.WriteUInt(this.SP);
     pPacket.WriteInt(this.Fame);
     pPacket.WriteLong(this.Inventory.Money);
     pPacket.WriteString(this.Map.MapInfo.ShortName, 12);
     pPacket.WriteInt(this.Position.X);
     pPacket.WriteInt(this.Position.Y);
     pPacket.WriteByte(this.Rotation);
     pPacket.WriteByte(this.Str);//  -.
     pPacket.WriteByte(this.End);//   |
     pPacket.WriteByte(this.Dex);//   |  Boni
     pPacket.WriteByte(this.Int);//   |
     pPacket.WriteByte(this.Spr);//  -'
     pPacket.WriteShort(0);               // UNK
     pPacket.WriteUInt(0);               // Killpoints (TODO)
     pPacket.Fill(7, 0);                 // UNK
 }
Beispiel #9
0
 private void SendChangeMoney(ZoneClient pClient, long money)
 {
     using (var packet = new Packet(SH19Type.SendChangeMoney))
     {
         packet.WriteLong(money);
         pClient.SendPacket(packet);
     }
 }
Beispiel #10
0
        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);
                }
            }
        }
Beispiel #11
0
        public void SendReciveMasterCoper()
        {
            if(this.Character.ReviveCoper > 0)

            using (var packet = new Packet(SH37Type.SendRecivveCopper))
            {
                packet.WriteLong(this.Character.ReviveCoper);
                this.Client.SendPacket(packet);
            }
        }