Exemple #1
0
        public void SendXpTable()
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_EXPERIENCE_TABLE);

            Out.WritePacketString(@"|1C 00 00 00 0A 96 00 00 00 18 C4 00 00 |................|
|00 28 F0 00 00 00 39 EE 00 00 00 4F B0 00 00 00 |.(....9....O....|
|65 FE 00 00 00 82 32 00 00 00 9E C0 00 00 00 BE |e.....2.........|
|96 00 00 00 E2 04 03 00 00 00 00 00 00 01 05 0E |................|
|00 00 01 30 24 03 00 00 00 00 00 00 01 5A CC 00 |...0$........Z..|
|00 01 89 84 03 00 00 00 00 00 00 01 BC 88 00 00 |................|
|01 EE 74 03 00 00 00 00 00 00 02 29 CA 00 00 02 |..t........)....|
|63 90 03 00 00 00 00 00 00 02 A0 BC 04 00 00 00 |c...............|
|00 00 00 02 D2 6C 03 00 00 00 00 00 00 03 09 62 |.....l.........b|
|03 00 00 00 00 00 00 03 51 2E 03 00 00 00 00 00 |........Q.......|
|00 03 9F 80 03 00 00 00 00 00 00 03 EC 38 03 00 |.............8..|
|00 00 00 00 00 04 3E 04 03 00 00 00 00 00 00 04 |......>.........|
|88 64 03 00 00 00 00 00 00 04 FA 1A 03 00 00 00 |.d..............|
|00 00 00 05 9A 24 03 00 00 00 00 00 00 06 44 24 |.....$........D$|
|03 00 00 00 00 04 00 00 00 00 00 00 06 FC 2A 03 |..............*.|
|00 00 00 00 00 00 07 CE C0 03 00 00 00 00 00 00 |................|
|08 A1 9C 03 00 00 00 00 00 00 09 7F E0 03 00 00 |................|
|00 00 00 00 0A B3 42 03 00 00 00 00 00 00 0B 6E |......B........n|
|A4 03 00 00 00 00 00 00 0C 2E 02 03 00 00 00 00 |................|
|00 00 0D 00 FC 03 00 00 00 00 00 00 0D CC 8A 03 |................|
|00 00 00 00 00 00 0E A1 96 03 00 00 00 00 04 00 |................|
|00 00 00 05 00 00 00 0A 06 00 00 00 00 05 00 00 |................|
|00 50 06 00 00 00 00 05 00 00 00 E6 06 00 00 00 |.P..............|
|00 05 00 00 01 B8 06 00 00 00 00 05 00 00 02 DA |................|
|06 00 00 00 00 05 00 00 04 38 06 00 00 00 00 05 |.........8......|
|00 00 05 DC 06 00 00 00 00 05 00 00 07 D0 06 00 |................|
|00 00 00 05 00 00 0A 00 06 00 00 00 00 05 00 00 |................|
|0C 76 06 00 00 00 00 04 00 00 00 00 05 00 00 0F |.v..............|
|32 06 00 00 00 00 05 00 00 12 2A 06 00 00 00 00 |2.........*.....|
|05 00 00 15 72 06 00 00 00 00 05 00 00 18 F6 06 |....r...........|
|00 00 00 00 05 00 00 1C B6 06 00 00 00 00 05 00 |................|
|00 20 BC 06 00 00 00 00 05 00 00 25 08 06 00 00 |. .........%....|
|00 00 05 00 00 29 90 06 00 00 00 00 05 00 00 2E |.....)..........|
|54 06 00 00 00 00 05 00 00 33 5E 06 00 00 00 00 |T........3^.....|
|04 00 00 00 00 05 00 00 38 A4 06 00 00 00 00 05 |........8.......|
|00 00 3E 30 06 00 00 00 00 05 00 00 43 EE 06 00 |..>0........C...|
|00 00 00 05 00 00 49 F2 06 00 00 00 00 05 00 00 |......I.........|
|50 32 06 00 00 00 00 05 00 00 56 AE 06 00 00 00 |P2........V.....|
|00 05 00 00 5D 66 06 00 00 00 00 05 00 00 64 64 |....]f........dd|
|06 00 00 00 00 05 00 00 6B 94 06 00 00 00 00 05 |........k.......|
|00 00 73 00 06 00 00 00 00 04 00 00 00 00 05 00 |..s.............|
|00 7A A8 06 00 00 00 00 05 00 00 82 8C 06 00 00 |.z..............|
|00 00 05 00 00 8A A2 06 00 00 00 00 05 00 00 92 |................|
|FE 06 00 00 00 00 05 00 00 9B 8C 06 00 00 00 00 |................|
|05 00 00 A4 4C 06 00 00 00 00 05 00 00 AD 52 06 |....L.........R.|
|00 00 00 00 05 00 00 B6 8A 06 00 00 00 00 05 00 |................|
|00 BF F4 06 00 00 00 00 05 00 00 C9 9A 06 00 00 |................|
|00 00 03 00 00 00 00 05 00 00 D3 72 06 00 00 00 |...........r....|
|00 05 00 00 DD 86 06 00 00 00 00 05 00 00 E7 CC |................|
|06 00 00 00 00 05 00 00 F2 44 06 00 00 00 00 05 |.........D......|
|00 00 FC F8 06 00 00 00 00 04 00 00 00 00 05 00 |................|
|01 07 D4 06 00 00 00 00 05 00 01 12 EC 06 00 00 |................|
|00 00 05 00 01 1E 36 06 00 00 00 00 05 00 01 29 |......6........)|
|BC 06 00 00 00 00 05 00 01 35 6A 06 00 00 00 00 |.........5j.....|
|03 00 00 00 00 05 00 01 41 4A 06 00 00 00 00 05 |........AJ......|
|00 01 4E CE 06 00 00 00 00 05 00 01 5E 1E 06 00 |..N.........^...|
|00 00 00 05 00 01 6F 4E 06 00 00 00 00 05 00 01 |......oN........|
|82 90 06 00 00 00 00 05 00 01 98 16 06 00 00 00 |................|
|00 05 00 01 B0 12 06 00 00 00 00 05 00 01 CA AC |................|
|06 00 00 00 00 05 00 01 E8 20 06 00 00 00 00 05 |......... ......|
|00 02 08 A0 06 00 00 00 00 03 00 00 00 00 05 00 |................|
|02 2C 68 06 00 00 00 00 05 00 02 53 A0 06 00 00 |.,h........S....|
|00 00 05 00 02 7E 84 06 00 00 00 00 05 00 02 AD |.....~..........|
|5A 06 00 00 00 00 05 00 02 E0 54 06 00 00 00 00 |Z.........T.....|
|04 00 00 00 00 05 00 03 17 C2 06 00 00 00 00 05 |................|
|00 03 53 CC 06 00 00 00 00 05 00 03 94 B8 06 00 |..S.............|
|00 00 00 05 00 03 DA D6 06 00 00 00 00 05 00 04 |................|
|26 62 06 00 00 00 00 03 00 00 00 00 05 00 04 77 |&b.............w|
|A2 06 00 00 00 00 05 00 04 CE DC 06 00 00 00 00 |................|
|05 00 05 2C 56 06 00 00 00 00 05 00 05 90 6A 06 |...,V.........j.|
|00 00 00 00 05 00 05 FB 54 06 00 00 00 00 04 00 |........T.......|
|00 00 00 05 00 06 6D 6E 06 00 00 00 00 05 00 06 |......mn........|
|E6 FE 06 00 00 00 00 05 00 07 68 54 06 00 00 00 |..........hT....|
|00 05 00 07 F1 CA 06 00 00 00 00 05 00 08 83 BA |................|
|06 00 00 00 00 04 00 00 00 00 05 00 0A 47 3D 06 |.............G=.|
|00 00 00 00 05 00 0A D4 41 06 00 00 00 00 05 00 |........A.......|
|0B 61 43 06 00 00 00 00 05 00 0B EE 46 06 00 00 |.aC.........F...|
|00 00 04 00 00 00 00 05 00 0C 7B 48 06 00 00 00 |..........{H....|
|00 05 00 0D 08 4A 06 00 00 00 00 05 00 0D 95 4C |.....J.........L|
|06 00 00 00 00 05 00 0E 22 4F 06 00 00 00 00 04 |........O......|
|00 00 00 00 05 00 0E AF 51 06 00 00 00 00 05 00 |........Q.......|
|0F 3C 53 06 00 00 00 00 05 00 0F C9 55 06 00 00 |.<S.........U...|
|00 00 05 00 10 56 58 06 00 00 00 00 04 00 00 00 |.....VX.........|
|00 05 00 10 E3 5A 06 00 00 00 00 05 00 11 70 5C |.....Z........p\|
|06 00 00 00 00 05 00 11 FD 5F 06 00 00 00 00 05 |........._......|
|00 12 8A 61 06 00 00 00 00 04 00 00 00 00 05 00 |...a............|
|13 17 63 06 00 00 00 00 05 00 13 A4 65 06 00 00 |..c.........e...|
|00 00 05 00 14 31 68 06 00 00 00 00 05 00 14 BE |.....1h.........|
|6A 06 00 00 00 00 04 00 00 00 00 00 00 00 00 00 |j...............|
|00                                              |.               |");
            SendPacket(Out);
        }
Exemple #2
0
        public override void SendInteract(Player Plr, InteractMenu Menu)
        {
            Plr.QtsInterface.HandleEvent(Objective_Type.QUEST_SPEACK_TO, Spawn.Entry, 1);

            if (!IsDead)
            {
                switch (InteractType)
                {
                case GameData.InteractType.INTERACTTYPE_DYEMERCHANT:
                {
                    string Text = WorldMgr.GetCreatureText(Spawn.Entry);

                    if (Menu.Menu == 9)         // List des objets a vendre
                    {
                        WorldMgr.SendVendor(Plr, Spawn.Entry);
                    }
                    else if (Menu.Menu == 11)         // Achat d'un item
                    {
                        WorldMgr.BuyItemVendor(Plr, Menu, Spawn.Entry);
                    }
                    else if (Menu.Menu == 14)         // Vend un Item
                    {
                        Plr.ItmInterface.SellItem(Menu);
                    }
                    else if (Menu.Menu == 36)         // Rachette un item
                    {
                        Plr.ItmInterface.BuyBackItem(Menu);
                    }
                    else
                    {
                        PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                        Out.WriteByte(0);
                        Out.WriteUInt16(Oid);
                        Out.WriteUInt16(0);
                        Out.WriteByte(0x40);         // Dye
                        Out.WriteByte(0x22);         // Vendors
                        Out.WriteByte(0);
                        Out.WritePascalString(Text);
                        Out.WriteByte(0);
                        Plr.SendPacket(Out);
                    }
                } break;

                case GameData.InteractType.INTERACTTYPE_FLIGHT_MASTER:
                {
                    byte[] data = new byte[62]
                    {
                        0x01, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x42, 0x39, 0x00, 0x00, 0x00, 0xC0, 0xE3,
                        0x03, 0x39, 0xA0, 0xD1, 0x6F, 0x00, 0xC8, 0xA8, 0x1D, 0x37, 0x28, 0x94, 0x79, 0x33, 0xB2, 0x24,
                        0x32, 0x44, 0xDB, 0xD7, 0x1C, 0x5D, 0x18, 0x5D, 0xDD, 0x1C, 0xA4, 0x0D, 0x00, 0x00, 0xA8, 0x6B,
                        0x21, 0x36, 0x11, 0x00, 0x00, 0x00, 0xC8, 0xD0, 0xAF, 0x3A, 0x78, 0xD1, 0x6F, 0x00
                    };

                    UInt16 Counts = 1;

                    PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                    Out.WriteUInt16(0x0A12);
                    foreach (Zone_Taxi Taxi in WorldMgr.GetTaxis(Plr))
                    {
                        Out.WriteUInt16(Counts);
                        Out.WriteByte(2);
                        Out.WriteUInt16(Taxi.Info.Price);
                        Out.WriteUInt16(Taxi.Info.ZoneId);
                        Out.WriteByte(1);
                        ++Counts;
                    }
                    Out.Write(data);
                    Plr.SendPacket(Out);
                } break;

                case GameData.InteractType.INTERACTTYPE_TRAINER:
                {
                    if (Menu.Menu == 7)
                    {
                        PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                        Out.WriteByte(5);
                        Out.WriteByte(0x0F);
                        Out.WriteByte(6);
                        Out.WriteUInt16(0);
                        Plr.SendPacket(Out);
                    }
                    else
                    {
                        PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                        Out.WriteByte(0);
                        Out.WriteUInt16(Oid);

                        if (Plr.Realm == GameData.Realms.REALMS_REALM_ORDER)
                        {
                            Out.WritePacketString(@"|00 00 00 21 00 94 48 61 69 6C |.........!..Hail|
|20 64 65 66 65 6E 64 65 72 20 6F 66 20 74 68 65 | defender of the|
|20 45 6D 70 69 72 65 21 20 20 59 6F 75 72 20 70 | Empire!  Your p|
|65 72 66 6F 72 6D 61 6E 63 65 20 69 6E 20 62 61 |erformance in ba|
|74 74 6C 65 20 69 73 20 74 68 65 20 6F 6E 6C 79 |ttle is the only|
|20 74 68 69 6E 67 20 74 68 61 74 20 6B 65 65 70 | thing that keep|
|73 20 74 68 65 20 68 6F 72 64 65 73 20 6F 66 20 |s the hordes of |
|43 68 61 6F 73 20 61 74 20 62 61 79 2E 20 4C 65 |Chaos at bay. Le|
|74 27 73 20 62 65 67 69 6E 20 79 6F 75 72 20 74 |t's begin your t|
|72 61 69 6E 69 6E 67 20 61 74 20 6F 6E 63 65 21 |raining at once!|
|00                                              |.               |");
                        }
                        else
                        {
                            Out.WritePacketString(@"|00 00 00 21 00 AA 4C 65 61 72 |.........!..Lear|
|6E 20 74 68 65 73 65 20 6C 65 73 73 6F 6E 73 20 |n these lessons |
|77 65 6C 6C 2C 20 66 6F 72 20 67 61 69 6E 69 6E |well, for gainin|
|67 20 74 68 65 20 66 61 76 6F 72 20 6F 66 20 74 |g the favor of t|
|68 65 20 52 61 76 65 6E 20 67 6F 64 20 73 68 6F |he Raven god sho|
|75 6C 64 20 62 65 20 6F 66 20 75 74 6D 6F 73 74 |uld be of utmost|
|20 69 6D 70 6F 72 74 61 6E 63 65 20 74 6F 20 79 | importance to y|
|6F 75 2E 20 4F 74 68 65 72 77 69 73 65 2E 2E 2E |ou. Otherwise...|
|20 54 68 65 72 65 20 69 73 20 61 6C 77 61 79 73 | There is always|
|20 72 6F 6F 6D 20 66 6F 72 20 6D 6F 72 65 20 53 | room for more S|
|70 61 77 6E 20 77 69 74 68 69 6E 20 6F 75 72 20 |pawn within our |
|72 61 6E 6B 73 2E 00                            |.......         |");
                        }
                        Plr.SendPacket(Out);
                    }
                } break;

                case GameData.InteractType.INTERACTTYPE_BANKER:
                {
                    PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                    Out.WriteByte(0x1D);
                    Out.WriteByte(0);
                    Plr.SendPacket(Out);
                } break;

                default:
                    QtsInterface.HandleInteract(Plr, this, Menu);
                    break;
                }
                ;
            }

            base.SendInteract(Plr, Menu);
        }
Exemple #3
0
        public override void SendInteract(Player Plr, InteractMenu Menu)
        {
            Log.Success("SendInteract", "" + Name + " -> " + Plr.Name + ",Type=" + InteractType);



            Plr.QtsInterface.HandleEvent(Objective_Type.QUEST_SPEACK_TO, Spawn.Entry, 1);

            if (!IsDead)
            {
                // perhaps do some checks?
                if (Menu.Menu == 7) // Trainer Spells
                {
                    PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                    Out.WriteByte(5);
                    Out.WriteByte(0x0F);
                    Out.WriteByte(6);
                    Out.WriteUInt16(0);
                    Plr.SendPacket(Out);
                }
                else if (Menu.Menu == 9) // List items for sale
                {
                    WorldMgr.SendVendor(Plr, Spawn.Entry);
                }
                else if (Menu.Menu == 11) // Buy an item
                {
                    WorldMgr.BuyItemVendor(Plr, Menu, Spawn.Entry);
                }
                else if (Menu.Menu == 14) // Sells an Item
                {
                    Plr.ItmInterface.SellItem(Menu);
                }
                else if (Menu.Menu == 25) // Set rally point
                {
                    RallyPoint Rally = WorldMgr.GetRallyPointFromNPC(Entry);
                    if (Rally != null)
                    {
                        Plr._Value.RallyPoint = Rally.Id;

                        PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                        Out.WriteByte(0x12);
                        Out.WriteUInt16(Menu.Oid);
                        Out.WriteUInt16(Plr._Value.RallyPoint);
                        Plr.SendPacket(Out);
                    }
                    else
                    {
                        Plr.SendLocalizeString("ERROR: Unknown Rally Point NPC (" + Entry + ").", GameData.Localized_text.CHAT_TAG_DEFAULT);
                    }
                }
                else if (Menu.Menu == 36) // Buy back item
                {
                    Plr.ItmInterface.BuyBackItem(Menu);
                }
                else if (Menu.Menu == 37) // Dye menu
                {
                    byte MAX_DYES = 30;

                    PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                    Out.WriteByte(0x1B);

                    List <Dye_Info> Dyes  = WorldMgr.GetDyes();
                    byte            count = (byte)Math.Min(Dyes.Count, MAX_DYES);

                    Out.WriteByte(count);
                    for (byte i = 0; i < count; i++)
                    {
                        Out.WriteByte(i);
                        Out.WriteUInt16(Dyes[i].Entry);
                        Out.WriteUInt32(Dyes[i].Price);
                    }

                    Plr.SendPacket(Out);
                }
                else if (Menu.Menu == 38) // Dye one item
                {
                    Item item = Plr.ItmInterface.GetItemInSlot(Menu.Num);

                    if (item == null)
                    {
                        return;
                    }

                    byte   PrimaryDye     = Menu.Packet.GetUint8();
                    byte   SecondaryDye   = Menu.Packet.GetUint8();
                    ushort PrimaryDyeId   = 0;
                    ushort SecondaryDyeId = 0;

                    uint cost = 0;
                    // 255 = no dye selected
                    if (PrimaryDye != 255)
                    {
                        cost += WorldMgr.GetDyes()[PrimaryDye].Price;
                    }

                    // 255 = no dye selected
                    if (SecondaryDye != 255)
                    {
                        cost += WorldMgr.GetDyes()[SecondaryDye].Price;
                    }

                    if (!Plr.RemoveMoney(cost))
                    {
                        Plr.SendLocalizeString("", GameData.Localized_text.TEXT_AUCTION_NOT_ENOUGH_MONEY);
                        return;
                    }

                    // 255 = no dye selected
                    if (PrimaryDye != 255)
                    {
                        PrimaryDyeId = WorldMgr.GetDyes()[PrimaryDye].Entry;
                    }

                    // 255 = no dye selected
                    if (SecondaryDye != 255)
                    {
                        SecondaryDyeId = WorldMgr.GetDyes()[SecondaryDye].Entry;
                    }

                    Plr.ItmInterface.DyeItem(item, PrimaryDyeId, SecondaryDyeId);

                    if (Plr._IsActive && Plr.IsInWorld() && Plr._Loaded)
                    {
                        foreach (Player P in _PlayerRanged)
                        {
                            if (P.HasInRange(Plr))
                            {
                                Plr.ItmInterface.SendEquiped(P);
                            }
                        }
                    }
                }
                else if (Menu.Menu == 39) // Dye all items
                {
                    byte Count = 0;
                    for (UInt16 i = 0; i < ItemsInterface.MAX_EQUIPED_SLOT; ++i)
                    {
                        if (Plr.ItmInterface.Items[i] != null) // && is dyable
                        {
                            ++Count;
                        }
                    }

                    byte   PrimaryDye     = Menu.Packet.GetUint8();
                    byte   SecondaryDye   = Menu.Packet.GetUint8();
                    ushort PrimaryDyeId   = 0;
                    ushort SecondaryDyeId = 0;

                    uint cost = 0;
                    // 255 = no dye selected
                    if (PrimaryDye != 255)
                    {
                        cost += WorldMgr.GetDyes()[PrimaryDye].Price * Count;
                    }

                    // 255 = no dye selected
                    if (SecondaryDye != 255)
                    {
                        cost += WorldMgr.GetDyes()[SecondaryDye].Price * Count;
                    }

                    if (!Plr.RemoveMoney(cost))
                    {
                        Plr.SendLocalizeString("", GameData.Localized_text.TEXT_AUCTION_NOT_ENOUGH_MONEY);
                        return;
                    }

                    // 255 = no dye selected
                    if (PrimaryDye != 255)
                    {
                        PrimaryDyeId = WorldMgr.GetDyes()[PrimaryDye].Entry;
                    }

                    // 255 = no dye selected
                    if (SecondaryDye != 255)
                    {
                        SecondaryDyeId = WorldMgr.GetDyes()[SecondaryDye].Entry;
                    }

                    for (UInt16 i = 0; i < ItemsInterface.MAX_EQUIPED_SLOT; ++i)
                    {
                        if (Plr.ItmInterface.Items[i] != null) // && is dyable
                        {
                            Plr.ItmInterface.DyeItem(Plr.ItmInterface.Items[i], PrimaryDyeId, SecondaryDyeId);
                        }
                    }

                    if (Plr._IsActive && Plr.IsInWorld() && Plr._Loaded)
                    {
                        foreach (Player P in _PlayerRanged)
                        {
                            if (P.HasInRange(Plr))
                            {
                                Plr.ItmInterface.SendEquiped(P);
                            }
                        }
                    }
                }
                else
                {
                    switch (InteractType)
                    {
                    case GameData.InteractType.INTERACTTYPE_FLIGHT_MASTER:
                    {
                        byte[] data = new byte[62]
                        {
                            0x01, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x42, 0x39, 0x00, 0x00, 0x00, 0xC0, 0xE3,
                            0x03, 0x39, 0xA0, 0xD1, 0x6F, 0x00, 0xC8, 0xA8, 0x1D, 0x37, 0x28, 0x94, 0x79, 0x33, 0xB2, 0x24,
                            0x32, 0x44, 0xDB, 0xD7, 0x1C, 0x5D, 0x18, 0x5D, 0xDD, 0x1C, 0xA4, 0x0D, 0x00, 0x00, 0xA8, 0x6B,
                            0x21, 0x36, 0x11, 0x00, 0x00, 0x00, 0xC8, 0xD0, 0xAF, 0x3A, 0x78, 0xD1, 0x6F, 0x00
                        };

                        UInt16 Counts = 1;

                        PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                        Out.WriteByte(0x0A);
                        List <Zone_Taxi> Taxis = WorldMgr.GetTaxis(Plr);
                        Out.WriteByte((byte)Taxis.Count);
                        foreach (Zone_Taxi Taxi in Taxis)
                        {
                            Out.WriteUInt16(Counts);
                            Out.WriteByte((byte)Taxi.Info.Pairing);
                            Out.WriteUInt16(Taxi.Info.Price);
                            Out.WriteUInt16(Taxi.Info.ZoneId);
                            Out.WriteByte(1);
                            ++Counts;
                        }
                        Out.Write(data);
                        Plr.SendPacket(Out);
                    } break;

                    case GameData.InteractType.INTERACTTYPE_BANKER:
                    {
                        PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                        Out.WriteByte(0x1D);
                        Out.WriteByte(0);        // need to find bank buy box



                        /*
                         * Out = new PacketOut((byte)Opcodes.F_BAG_INFO);
                         * Out.WriteByte(0x0F);
                         * Out.WriteByte(ItmInterface.GetTotalSlot()); // Number of available slots  // GetTotalSlot
                         * Out.WriteUInt16((UInt16)ItemsInterface.INVENTORY_SLOT_COUNT);
                         * Out.WriteByte(0);
                         * Out.WriteUInt32R(ItmInterface.GetBagPrice());//GetBagPrice
                         *
                         * Out.WriteUInt16(2);// was 2
                         * Out.WriteByte(0x50);// was 0x50
                         * Out.WriteUInt16(0x08);// 0x08
                         * Out.WriteUInt16(0x60);// 0x60
                         * Out.WriteByte(0xEA);// 0xEA
                         * Out.WriteUInt16(0);
                         */



                        Plr.SendPacket(Out);
                    } break;


                    case GameData.InteractType.INTERACTTYPE_SIEGEWEAP:
                    {
                        //     /*
                        PacketOut Out = new PacketOut((byte)Opcodes.F_UPDATE_STATE);

                        Out.WriteUInt16(Oid);
                        Out.WriteByte(0x1D);
                        Out.WriteByte(1);
                        Out.WriteByte(1);
                        Out.WriteByte(2);
                        Out.WriteUInt16(0);
                        Out.WriteByte(0x02);
                        Out.WriteByte(0x4A);
                        Out.WriteUInt16(0);
                        Plr.SendPacket(Out);
                        //21 D9 1D 01 01 02 00 00 02 4A 00 00



                        Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                        Out.WriteByte(0x18);
                        Out.WriteByte(1);
                        Out.WriteUInt16(0x005C);
                        Out.WritePascalString(Name);
                        Out.WriteByte(1);
                        Out.WriteByte(0x3F);
                        Out.WriteUInt16(0);
                        Out.WriteByte(0x0E);
                        //Out.WriteByte(0xA6);//(byte)Zone.ZoneId);//zone
                        Out.WriteHexStringBytes("A6103C000400011E0000000002");
                        Out.WriteByte(0);        // reload?
                        Out.WriteUInt16(0x0B);
                        Out.WriteByte(0);


                        //  Out.WriteHexStringBytes("1801005C0D456D706972652043616E6E6F6E013F00000EA6103C000400011E000000000200000B00");

                        Plr.SendPacket(Out);



                        Out = new PacketOut((byte)Opcodes.F_UPDATE_STATE);
                        Out.WriteUInt16(Oid);
                        Out.WriteByte(0x21);
                        Out.WriteByte(0x3C);        // 3c=60 seconds 6000 14=20 seconds=2000
                        Out.Fill(0, 6);
                        Plr.SendPacket(Out);



                        Out = new PacketOut((byte)Opcodes.F_UPDATE_STATE);
                        Out.WriteUInt16(Oid);
                        Out.WriteByte(0x1C);
                        Out.WriteByte(0x3);        //14=20 seconds=2000
                        //Out.Fill(0, 6);
                        Plr.SendPacket(Out);


                        // 1D 01 01 02 00 00 8A DF 00 00

                        Out = new PacketOut((byte)Opcodes.F_UPDATE_STATE);
                        Out.WriteUInt16(Oid);
                        Out.WriteByte(0x1D);
                        Out.WriteByte(1);
                        Out.WriteByte(1);
                        Out.WriteByte(2);
                        Out.WriteUInt16(0);
                        Out.WriteByte(0x8A);
                        Out.WriteByte(0xDF);
                        Out.WriteUInt16(0);
                        Plr.SendPacket(Out);


                        //                          */



                        /*
                         *
                         *  // controll timer // size 13
                         *   Out = new PacketOut((byte)Opcodes.F_UPDATE_STATE);
                         *   Out.WriteUInt16(Oid);
                         *   Out.WriteByte(0x21);
                         *   Out.WriteByte(0x3C);// 3c=60 seconds 6000 14=20 seconds=2000
                         *   Out.Fill(0, 6);
                         *  Plr.SendPacket(Out);
                         *
                         *  // size 7
                         *  Out = new PacketOut((byte)Opcodes.F_UPDATE_STATE);
                         *  Out.WriteUInt16(Oid);
                         *  Out.WriteByte(0x1C);
                         *  Out.WriteByte(0x3);//14=20 seconds=2000
                         *  //Out.Fill(0, 6);
                         *  Plr.SendPacket(Out);
                         *
                         *
                         *
                         */



                        /*
                         * //size 15
                         * Out = new PacketOut((byte)Opcodes.F_UPDATE_STATE);
                         * Out.WriteUInt16(Oid);
                         * Out.WriteByte(0x1D);
                         * Out.WriteByte(1);
                         * Out.WriteByte(1);
                         * Out.WriteByte(2);
                         * Out.WriteUInt16(0);
                         * Out.WriteByte(2);
                         * Out.WriteByte(0x4A);
                         * Out.WriteUInt16(0);
                         *
                         * //  Out.WriteByte(0x3);//14=20 seconds=2000
                         * //Out.Fill(0, 6);
                         * Plr.SendPacket(Out);
                         */



                        /*
                         * // target icon
                         * Out = new PacketOut((byte)Opcodes.F_UPDATE_STATE);
                         * Out.WriteUInt16(Oid);
                         * Out.WriteByte(0x1C);
                         * Out.WriteByte(0x3);//14=20 seconds=2000
                         * Out.Fill(0, 6);
                         * Plr.SendPacket(Out);
                         * // */
                    } break;



                    case GameData.InteractType.INTERACTTYPE_GUILD_VAULT:
                    {
                        //Size = 43
                        // opens guild vault 5 slots
                        PacketOut Out = new PacketOut((byte)Opcodes.F_GUILD_DATA);
                        Out.WriteByte(0x18);     // ??
                        //Out.WriteByte(0x1);// this shows a buy box
                        Out.WriteByte(5);        // number of vault boxs  0 to 5
                        Out.Fill(0, 8);

                        // VAULT BOX 1
                        Out.WriteUInt16(0x003C);
                        //Out.WriteByte(0x3C);
                        Out.Fill(0, 4);

                        // VAULT BOX 2
                        Out.WriteUInt16(0x003C);
                        //Out.WriteByte(0x3C);
                        Out.Fill(0, 4);

                        // VAULT BOX 3
                        Out.WriteUInt16(0x003C);
                        //Out.WriteByte(0x3C);
                        Out.Fill(0, 4);

                        // VAULT BOX 4
                        Out.WriteUInt16(0x003C);
                        //Out.WriteByte(0x3C);
                        Out.Fill(0, 4);

                        // VAULT BOX 5
                        Out.WriteUInt16(0x003C);
                        //Out.WriteByte(0x3C);
                        Out.Fill(0, 4);

                        Plr.SendPacket(Out);
                    } break;



                    //Heal Penalties structure i added
                    case GameData.InteractType.INTERACTTYPE_HEALER:
                    {          // packet size 9  -3=6
                        PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                        Out.WriteByte(0x13);
                        Out.WriteByte(1);        // this the penalty points u have
                        Out.WriteUInt16(0);
                        // Out.WriteByte(0);// gold ?
                        //Out.WriteByte(0);// gold
                        Out.WriteByte(1);        //1 silver
                        Out.WriteByte(0);        // 90??// brass
                        Plr.SendPacket(Out);

                        // this packet heals size 6 -3 =3 size
                        Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                        Out.WriteByte(0x14);
                        Out.WriteByte(1);        // this the penalty points u have
                        Out.WriteByte(90);       // 90??// brass
                        Plr.SendPacket(Out);
                    } break;

                    //10 00 03 2E 49 01 00 00 00 00
                    case GameData.InteractType.INTERACTTYPE_BARBERSHOP:
                    {          // packet size 13 -3=10
                        PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                        Out.WriteByte(0x10);
                        Out.WriteByte(0);
                        Out.WriteByte(3);        // 3
                        Out.WriteByte(0x2E);     //2E
                        Out.WriteByte(0x49);     //49
                        Out.WriteByte(1);        // 1 // this is tokens that is required if set to 5 it says=(you dont have enough tokens in your inventory 5 token are required
                        Out.WriteUInt32(0);
                        Plr.SendPacket(Out);
                    } break;

                    //0E 01 01 00
                    case GameData.InteractType.INTERACTTYPE_GUILD_REGISTRAR:
                    {
                        // packet size 13 -3=10
                        PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                        Out.WriteByte(0x0E);
                        Out.WriteByte(1);        //0= sucess full /1=
                        Out.WriteByte(1);        //0= sucess full /1=
                        Out.WriteByte(0);        //
                        Plr.SendPacket(Out);
                    } break;


                    case GameData.InteractType.INTERACTTYPE_AUCTIONEER:    //INTERACTTYPE_AUCTIONEER = 13,
                    {
                        PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                        Out.WriteByte(0x1A);
                        Out.WriteByte(0);
                        Plr.SendPacket(Out);


                        Out = new PacketOut((byte)Opcodes.F_AUCTION_SEARCH_RESULT);
                        Out.WritePacketString(@"|00 00 9E 22 00 01 01 00 00 00 00 00 71 |..............q|
|67 F1 00 01 82 52 00 00 00 00 00 00 27 10 03 43 |g....R......'..C|
|68 6F 73 73 65 74 74 65 5E 4D 00 00 00 00 00 00 |hossette^M......|
|00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
|00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF |................|
|5F 39 00 00 01 4B B6 0F 30 00 00 00 00 00 00 00 |_9...K..0.......|
|00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 |................|
|00 00 00 00 00 00 06 00 14 00 14 00 00 00 00 00 |................|
|00 00 00 00 00 00 00 10 57 69 6C 74 65 64 20 57 |........Wilted W|
|69 6C 64 20 57 65 65 64 00 00 00 06 08 00 05 07 |ild Weed........|
|00 04 01 00 00 02 00 00 04 00 00 0F 00 01 00 00 |................|
|00 00 01 00 00 03 02 00 08 00 00 00 00 00 00 00 |................|
|00 00 00 00 00 00 00 00 00 00 00 00 00          |.............   |");
                        Plr.DispatchPacket(Out, true);


                        //  Out = new PacketOut((byte)Opcodes.F_AUCTION_BID_STATUS);
                    } break;

                    /////////added////////////////////////////////////////////////////////////////////////////////////////
                    // case GameData.InteractType.INTERACTTYPE_SIEGEWEAP:
                    //  {
                    //   PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                    //  Out.WriteByte(0x1A);
                    //  Out.WriteByte(0);
                    //  Plr.SendPacket(Out);
                    //  } break;
                    default:
                    {
                        ushort MenuItems = 0;
                        string Text      = WorldMgr.GetCreatureText(Spawn.Entry);

                        if (InteractType == GameData.InteractType.INTERACTTYPE_DYEMERCHANT)
                        {
                            MenuItems += 2;         // Shop // 2
                            MenuItems += 16384;     // Dyes

                            // You need Text to see the 'dyes' option
                            if (Text == String.Empty)
                            {
                                Text = "Selling a bit of everything here, come on have a look see!";
                            }


                            //Text = "Forget about the drut he's selling; take a look at these beauties!"; ORIGNAL IN DB


                            //Text = "Come and see what I have.";
                        }

                        bool HasQuests = QtsInterface.HasQuestInteract(Plr, this);
                        if (HasQuests)
                        {
                            MenuItems += 64;         // Quests
                        }
                        if (InteractType == GameData.InteractType.INTERACTTYPE_GUILD_REGISTRAR)
                        {
                            MenuItems += 128;         // Guild Register =128
                            // Guild Regiser needs text
                            if (Text == String.Empty)
                            {
                                Text = "Let's get started. To form a guild, you'll need to have a full group of six adventurers with you. None of you can belong to another guild. For a modest fee of only fifty silver I can create your guild.";
                            }
                        }


                        if (InteractType == GameData.InteractType.INTERACTTYPE_TRAINER)
                        {
                            MenuItems += 1;         // Trainer =1
                            // Theese were previously in there, nice to keep them unless theres info in creature_texts
                            if (Text == String.Empty)
                            {
                                if (Plr.Realm == GameData.Realms.REALMS_REALM_ORDER)
                                {
                                    Text = "Hail defender of the Empire!  Your performance in battle is the only thing that keeps the hordes of Chaos at bay. Let's begin your training at once!";
                                }


                                else
                                {
                                    Text = "Learn these lessons well, for gaining the favor of the Raven god should be of utmost importance to you. Otherwise... There is always room for more Spawn within our ranks.";
                                }
                            }
                        }

                        if (InteractType == GameData.InteractType.INTERACTTYPE_BINDER)
                        {
                            MenuItems += 228;         // Rally Point =256/ 228 is rally quest+influnce
                        }
                        if (Text.Length > 0)
                        {
                            MenuItems += 32;         // Text
                        }
                        // VENDORS INVENTERY BOX PACKET
                        PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);

                        Log.Info("Creature", "npc = " + Name + "  Oid = " + Oid + " MenuItems = " + MenuItems + "  X= " + Spawn.WorldX + "  Y= " + Spawn.WorldY + "  Z= " + Spawn.WorldZ);
                        Out.WriteByte(0);
                        Out.WriteUInt16(Menu.Oid);
                        Out.WriteUInt16(0);
                        Out.WriteUInt16(MenuItems);
                        if (HasQuests)
                        {
                            QtsInterface.BuildInteract(Plr, this, Out);
                        }
                        if (Text.Length > 0)
                        {
                            Out.WriteByte(0);       // added and fixed the dye screen error, was missing this byte now working whoohooo
                        }
                        Out.WriteShortString(Text); // need to fix this ??
                        //Out.WritePascalString(Text);// added this because above gives error
                        Out.WriteByte(0);           // added this is on live server mite not need this byte
                        Plr.SendPacket(Out);
                    } break;
                    }
                }
            }
            base.SendInteract(Plr, Menu);
        }
Exemple #4
0
        public static void BuildRepairableItem(ref PacketOut Out, Item itm, Item_Info info, MailItem mail, ushort SlotId, ushort Count, Player Plr = null)
        {
            Out.WriteByte(1);    // repairable item
            Out.WritePascalString(info.Name);


            string[]  items       = info.Craftresult.Split(';');
            Item_Info RepItemInfo = null;

            uint itemlvl = 0;
            byte rarety  = 0;

            foreach (string ritem in items)
            {
                Item_Info RitemInfo = ItemService.GetItem_Info(uint.Parse(ritem));
                rarety  = RitemInfo.Rarity;
                itemlvl = RitemInfo.MinRank;

                if (ItemsInterface.CanUse(RitemInfo, Plr, false, false))
                {
                    RepItemInfo = RitemInfo;
                    break;
                }
            }
            if (rarety < 1)
            {
                rarety = 1;
            }
            if (itemlvl < 1)
            {
                itemlvl = 1;
            }

            if (RepItemInfo != null)
            {
                Out.WritePacketString(@"|00 00 0F 67|......b.L...]...|"); //Icon

                Out.WriteUInt32(20 * itemlvl * 6 * rarety * 2);           // repair costs
                Out.WritePacketString(@"|00 00 07 62|......b.L...]...|"); //?? 00 00 07 62

                BuildItem(ref Out, null, RepItemInfo, null, 0, 1, Plr, true);
            }
            else
            {
                Out.WritePacketString(@" | 00 00 0F 67 |........|");
                Out.WriteUInt32(20 * itemlvl * 6 * rarety * 2);  // repair costs

                Out.WritePacketString(@"|00 00 07 62 | apon...g.......b |
                                        | 00 4C B0 A5 0F 67 00 00 00 00 00 00 00 00 00 00 |.L...g..........|
                                        | 00 24 00 00 00 02 00 00 00 00 00 00 00 00 00 00 |.$..............|
                                        | 00 00 02 1C 00 01 00 01 00 00 00 00 00 00 00 00 |................|
                                        | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
                                        | 03 42 00 00|........|");
                if (info.Bind == 1)
                {
                    Out.WriteByte(4);    // bind on pickup, if set to true for one item, all items with have this flag active client side
                }
                else if (info.Bind == 2) //
                {
                    Out.WriteByte(8);    // bind on equip, if set to true for one item, all items with have this flag active client side
                }
                else
                {
                    Out.WriteByte(0);
                }
                Out.WritePacketString(@" | 00 00 00 00 00 00 00 00 00 00 00 |.B..............|
                                        | 00 00 00 00 00 00 00|.B..............|");
            }
        }
Exemple #5
0
        /// <summary>
        /// Opens door inside instance (uniqueID, instanceID, open=1/close=0)
        /// </summary>
        /// <param name="plr">Player that initiated the command</param>
        /// <param name="values">List of command arguments (after command name)</param>
        /// <returns>True if command was correctly handled, false if operation was canceled</returns>
        public static bool InstanceOpenDoor(Player plr, ref List <string> values)
        {
            int uniqueID   = 0;
            int instanceId = 0;
            int open       = 1;

            if (values.Count >= 2)
            {
                int.TryParse(values[0], out uniqueID);
                int.TryParse(values[1], out instanceId);

                if (values.Count >= 3)
                {
                    int.TryParse(values[2], out open);
                }

                var Out = new PacketOut((byte)Opcodes.F_CREATE_STATIC);

                if (open == 0)
                {
                    WarZoneLib.RegionData.HideDoor(false, plr.Zone.ZoneId, (uint)uniqueID, (uint)instanceId);
                    Out.WritePacketString(@"|17 55 00 00 08 00 38 49 00 16 09 4B 00 |.<q.U....8I...K.|
                                        |0C B7 6C FF FF 1E 02 00 01 67 2E 00 00 06 00 00 |..l......g......|
                                        |00 00 52 BF 67 55 BB 00 00 00 00 0E 47 61 74 65 |..R.gU......Gate|
                                        |68 6F 75 73 65 20 44 6F 6F 72 04   |............... |");
                }
                else
                {
                    WarZoneLib.RegionData.HideDoor(true, plr.Zone.ZoneId, (uint)uniqueID, (uint)instanceId);
                    Out.WritePacketString(@"|17 55 00 01 08 00 38 49 00 16 09 4B 00 |.<q.U....8I...K.|
                                        |0C B7 6C FF FF 1E 02 00 01 67 2E 00 00 06 00 00 |..l......g......|
                                        |00 00 52 BF 67 55 BB 00 00 00 00 0E 47 61 74 65 |..R.gU......Gate|
                                        |68 6F 75 73 65 20 44 6F 6F 72 04   |............... |");
                }



                uint result = (uint)
                              (
                    (int)((uniqueID & 0xC000) << 16) |
                    (int)((plr.Zone.ZoneId & 0x3FF) << 20) |
                    (int)((uniqueID & 0x3FFF) << 6) |
                    (int)(0x28 + instanceId)
                              );

                Out.WriteUInt32(result);

                plr.DispatchPacket(Out, true);

                plr.SendClientMessage("DoorID=" + result);

                return(true);
            }
            return(false);
            //this does not correct, wont work for uniqueId above 16k, 2 high orrder bits neeed to go before zoneId

            //InstanceDoor door = null;

            //var objID = GetInt(ref values);
            //if (objID != 0 && plr.Region.GetObject((ushort)objID) is InstanceDoor)
            //{
            //    door = plr.Region.GetObject((ushort)objID) as InstanceDoor;
            //}
            //else
            //door = plr.GetInRange<InstanceDoor>(100).FirstOrDefault();

            //var t = plr.GetInRange<InstanceObject>(100);

            //if (door != null)
            //{
            //    door.IsOpen = !door.IsOpen;
            //}
            //return true;
        }