[HellmouthSource]Full Gem Socket System

04/02/2011 14:23 Just2Me#1
Hello
This is my 1st code i post
adding Socket Gem System

go to PacketHandler.cs
find
Quote:
case 2220:
above it put
Quote:
#region 1027 Put Gems
case 1027:
{
string P = ""; string Phex = "";
for (byte bit = 0; bit < Data.Length - 8; bit++)
{
int Pi = Data[bit];
P += Data[bit] + " ";
Phex += Pi.ToString("X") + " ";
}

uint MainUID = BitConverter.ToUInt32(Data, 8);
uint GemUID = BitConverter.ToUInt32(Data, 12);
Struct.ItemInfo MainItem = Client.InventoryItem(MainUID);//Retrieves iteminfo from Client of MainUID
Struct.ItemInfo Gem = Client.InventoryItem(GemUID);//Retrieves iteminfo from Client of MinorUID
byte mode = Data[18];
byte slot = Data[16];

if (mode == 0)
{
if (slot == 1)
{

MainItem.Soc1 = Convert.ToByte(Gem.ID - 700000);
Client.RemoveItems(Gem.ID, 1); Client.Inventory[MainItem.UID] = MainItem; Database.UpdateItem(MainItem.UID, (int)MainItem.Soc1, "Soc1"); Database.UpdateItem(MainItem.UID, (int)MainItem.Soc2, "Soc2"); Client.Send(Packets.ItemInfo(MainItem, 3));
}
if (slot == 2)
{
MainItem.Soc2 = Convert.ToByte(Gem.ID - 700000);
Client.RemoveItems(Gem.ID, 1); Client.Inventory[MainItem.UID] = MainItem; Database.UpdateItem(MainItem.UID, (int)MainItem.Soc1, "Soc1"); Database.UpdateItem(MainItem.UID, (int)MainItem.Soc2, "Soc2"); Client.Send(Packets.ItemInfo(MainItem, 3));
}


}
else
{
if (slot == 1)
{
MainItem.Soc1 = 255;
Client.Send(Packets.ItemInfo(MainItem, 3));
Client.Inventory[MainItem.UID] = MainItem;
Database.UpdateItem(MainItem.UID, (int)MainItem.Soc1, "Soc1");
Database.UpdateItem(MainItem.UID, (int)MainItem.Soc2, "Soc2");
}
if (slot == 2)
{
MainItem.Soc2 = 255;
Client.Send(Packets.ItemInfo(MainItem, 3));
Client.Inventory[MainItem.UID] = MainItem;
Database.UpdateItem(MainItem.UID, (int)MainItem.Soc1, "Soc1");
Database.UpdateItem(MainItem.UID, (int)MainItem.Soc2, "Soc2");
}

}
break;
}
#endregion
04/02/2011 14:24 Syst3m_W1z4rd#2
Where did you leech it?
04/02/2011 14:28 Just2Me#3
what you mean with that?
04/02/2011 16:10 koko425#4
may be from newscoserver
04/02/2011 16:12 Just2Me#5
You right it is from newestcoserver
there is problem?
04/02/2011 16:43 AndreaCo#6
hey i have a 2 questions :)

1. What does this section do

Quote:
string P = ""; string Phex = "";
for (byte bit = 0; bit < Data.Length - 8; bit++)
{
int Pi = Data[bit];
P += Data[bit] + " ";
Phex += Pi.ToString("X") + " ";
}
since i already coded the system in myself and i dont have this in their so i just wanna learn what it does :)

and my 2nd questions is. How would i get the actual GUI to open, caus i already coded in the system but im confused on how to open the GUI
04/02/2011 16:51 Just2Me#7
this code for slot1 and slot2
and you can open GUI with this npc

Quote:
#region Soc System
case 1200:
{
switch (LinkBack)
{
case 0:
{
Client.Send(Packets.GeneralData(Client.UID, 7, Client.X, Client.Y, 126));
}
return;
}
}
return;
#endregion
04/02/2011 17:09 Syst3m_W1z4rd#8
Quote:
Originally Posted by AndreaCo View Post
hey i have a 2 questions :)

1. What does this section do



since i already coded the system in myself and i dont have this in their so i just wanna learn what it does :)

and my 2nd questions is. How would i get the actual GUI to open, caus i already coded in the system but im confused on how to open the GUI
Hex.
04/02/2011 17:13 AndreaCo#9
the npc doesnt seem to work :/