Register for your free account! | Forgot your password?

You last visited: Today at 08:15

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release]OpenSoc with GUI

Discussion on [Release]OpenSoc with GUI within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2010
Posts: 90
Received Thanks: 17
[Release]OpenSoc with GUI

hello..
it's my first work in my chinese hellmounth source!!

I'm random to get the opensoc GUI
Hope you like it ...
it's a bad code ... hope some one can Optimization



OK... let me code it ....

Open PacketHandler.cs and find case 2031

PHP Code:
 Client.DialogNPC BitConverter.ToUInt32(Data4);
                            switch (
Client.DialogNPC)
{
                                         case [
you can write your opensoc npc id here]:
                                    
Client.Send(Packets.GeneralData(Client.UID425Client.XClient.Y126));
                                    break;

that's finish first step
and create a Handers/Items/OpenSoc.cs file
paste that's code
PHP Code:

    
public class OpenSoc
    
{
        public static 
void Handle(Client Clientbyte[] Databyte Type)
        {
            switch (
Type)
            {
                case 
43:
                    {
                        
uint EquipUID BitConverter.ToUInt32(Data4);
                        
byte count Data[20];
                        
//uint[] OpenSocItemUID = new uint[count];
                        
Struct.ItemInfo Equip Client.Inventory[EquipUID];
                        
Client.Inventory.Remove(Equip.UID);
                        if (
Equip.Soc1 == 0)
                        {
                            
Equip.Soc1 255;
                            
Client.Send(Packets.Chat("恭喜 " Client.Name " 在装备 " Dictionary.ItemData[Equip.ID].Name " 上开出第1个宝石孔!""SYSTEM""ALL"Struct.ChatType.Top));
                        }
                        else
                        {
                            
Equip.Soc2 255;
                            
Client.Send(Packets.Chat("恭喜 " Client.Name " 在装备 " Dictionary.ItemData[Equip.ID].Name " 上开出第2个宝石孔!""SYSTEM""ALL"Struct.ChatType.Top));
                        }
                        for (
uint i 0counti++)
                        {
                            
//OpenSocItemUID[i] = BitConverter.ToUInt32(Data, (int)(79 + i * 4));
                            
Client.RemoveItemByUID(BitConverter.ToUInt32(Data, (int)(76 4)));
                        }
                        
Client.Send(Packets.ItemInfo(Equip3));
                        
Client.Inventory.ThreadSafeAdd(Equip.UIDEquip);
                        
Database.UpdateItem(Equip.UID, (int)Equip.Soc1"Soc1");
                        
Database.UpdateItem(Equip.UID, (int)Equip.Soc2"Soc2");
                        
Client.Send(Packets.GeneralData(Client.UID426Client.XClient.Y126));
                        
Client.Send(Packets.GeneralData(Client.UID425Client.XClient.Y126));
                        break;
                    }
                default:
                    break;
            }
        }
    } 
that's finish The second step

and open PacketHandler.cs again

add case in case 1009:

PHP Code:
                            case 43:
                                
OpenSoc.Handle(Client,Data,43);
                                break; 

ok ,,,, that's finish
262315610 is offline  
Old 03/25/2011, 02:20   #2
 
thesamuraivega's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 125
Received Thanks: 21
"switch (Client.DialogNPC) "

??? DialogNPC???
thesamuraivega is offline  
Old 03/25/2011, 20:03   #3
 
elite*gold: 0
Join Date: Feb 2009
Posts: 262
Received Thanks: 161
npc send

Code:
              case 111815:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello my friend, welcome. I'm BlacksmithLee. I add sockets into anything wearable except gourds/weapons or garments.");
                                    dialog.Text("12 DragonBalls for first socket and 1ThoughDrill for the second one. The success is not allways at second socket");
                                    dialog.Text("and you may receive an StarDrill if I didnt succed. With 7 StarDrill I can 100% add the second socket.");
                                    dialog.Option("Yes, i wana", 122);
                                    dialog.Option("Keep your offers away from me.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 122:
                                {
                                    /*Packet Nr 833. Server -> Client, Length : 45, PacketType: 10010
25 00 1A 27 80 D5 17 00 A9 01 00 00 00 00 00 00      ;% '€Õ ©      
00 00 00 00 7E 00 00 00 CF 00 D0 00 00 00 00 00      ;    ~   Ï Ð     
00 00 00 00 00 54 51 53 65 72 76 65 72               ;     TQServer*/
                                    GeneralData ge = new GeneralData(true);
                                    ge.UID = client.Entity.UID;
                                    ge.ID = 126;
                                    ge.dwParam = 425;
                                    ge.wParam1 = client.Entity.X;
                                    ge.wParam2 = client.Entity.Y;
                                    client.Send(ge.ToArray());
                                    break;
                                }
recivied
Code:
                   case 43:
                       {
                           uint UID = BitConverter.ToUInt32(packet,4);
                           if (packet[20] == 1)
                           {
                               if (client.Inventory.ContainsUID(BitConverter.ToUInt32(packet, 76)))
                               {
                                   Interfaces.IConquerItem item = null;
                                   if (client.Inventory.TryGetItem(UID, out item))
                                   {
                                       if (item.SocketOne != Conquer_Online_Server.Game.Enums.Gem.NoSocket)
                                       {
                                           if (item.SocketTwo == Conquer_Online_Server.Game.Enums.Gem.NoSocket)
                                           {
                                               if (Conquer_Online_Server.ServerBase.Kernel.PercentSuccess(30))
                                               {
                                                   if (item.SocketTwo == Conquer_Online_Server.Game.Enums.Gem.NoSocket)
                                                       item.SocketTwo = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                   client.Inventory.Remove(BitConverter.ToUInt32(packet, 76), Conquer_Online_Server.Game.Enums.ItemUse.Remove);
                                                   item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                   item.Send(client);
                                                   client.LoadItemStats(item);
                                                   Database.ConquerItemTable.UpdateItem(item, client);
                                               }
                                               else
                                               {
                                                   client.Inventory.Add(1200006, 0, 1);
                                                   client.Inventory.Remove(BitConverter.ToUInt32(packet, 76), Conquer_Online_Server.Game.Enums.ItemUse.Remove);
                                               }
                                           }
                                       }
                                   }
                               }
                           }
                           if (packet[20] == 7)
                           {
                               Interfaces.IConquerItem item = null;
                               if (client.Inventory.TryGetItem(UID, out item))
                               {
                                   Dictionary<uint, uint> drill = new Dictionary<uint, uint>();//packet[20]);
                                   for (ushort i = 76; i < 76 + 4 * packet[20]; i += 4)
                                   {
                                       if (client.Inventory.ContainsUID(BitConverter.ToUInt32(packet, i)))
                                       {
                                           drill.Add(BitConverter.ToUInt32(packet, i), i);
                                       }
                                   }

                                   if (client.Inventory.Contains(1200006, 7))
                                   {
                                       if (item.SocketOne == Conquer_Online_Server.Game.Enums.Gem.NoSocket)
                                           return;
                                       if (item.SocketTwo == Conquer_Online_Server.Game.Enums.Gem.NoSocket)
                                           item.SocketTwo = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                       foreach (uint key in drill.Keys)
                                       {
                                           if (client.Inventory.ContainsUID(key))
                                               client.Inventory.Remove(key, Conquer_Online_Server.Game.Enums.ItemUse.Remove);
                                       }
                                       item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                       item.Send(client);
                                       client.LoadItemStats(item);
                                       Database.ConquerItemTable.UpdateItem(item, client);
                                   }
                               }
                           }
                           if (packet[20] == 12)
                           {
                               Interfaces.IConquerItem item = null;
                               if (client.Inventory.TryGetItem(UID, out item))
                               {
                                   Dictionary<uint, uint> dbs = new Dictionary<uint, uint>();//packet[20]);
                                   for (ushort i = 76; i < 76 + 4 * packet[20]; i += 4)
                                   {
                                       if (client.Inventory.ContainsUID(BitConverter.ToUInt32(packet, i)))
                                       {
                                           dbs.Add(BitConverter.ToUInt32(packet, i), i);
                                       }
                                   }

                                   if (client.Inventory.Contains(1088000, 12))
                                   {
                                       if (item.SocketOne != Conquer_Online_Server.Game.Enums.Gem.NoSocket)
                                           return;
                                       if (item.SocketOne == Conquer_Online_Server.Game.Enums.Gem.NoSocket)
                                           item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                       foreach (uint key in dbs.Keys)
                                       {
                                           if (client.Inventory.ContainsUID(key))
                                               client.Inventory.Remove(key, Conquer_Online_Server.Game.Enums.ItemUse.Remove);
                                       }

                                       //client.Inventory.Remove(DragonBall, 12);
                                       item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                       item.Send(client);
                                       client.LoadItemStats(item);
                                       Database.ConquerItemTable.UpdateItem(item, client);
                                   }
                               }

                           }
                           client.Send(packet);
                           break;
                       }
teroareboss1 is offline  
Reply




All times are GMT +1. The time now is 08:16.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.