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
[Only registered and activated users can see links. Click Here To Register...]
OK... let me code it ....
Open PacketHandler.cs and find case 2031
that's finish first step
and create a Handers/Items/OpenSoc.cs file
paste that's code
that's finish The second step
and open PacketHandler.cs again
add case in case 1009:
ok ,,,, that's finish
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
[Only registered and activated users can see links. Click Here To Register...]
OK... let me code it ....
Open PacketHandler.cs and find case 2031
PHP Code:
Client.DialogNPC = BitConverter.ToUInt32(Data, 4);
switch (Client.DialogNPC)
{
case [you can write your opensoc npc id here]:
Client.Send(Packets.GeneralData(Client.UID, 425, Client.X, Client.Y, 126));
break;
}
and create a Handers/Items/OpenSoc.cs file
paste that's code
PHP Code:
public class OpenSoc
{
public static void Handle(Client Client, byte[] Data, byte Type)
{
switch (Type)
{
case 43:
{
uint EquipUID = BitConverter.ToUInt32(Data, 4);
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 = 0; i < count; i++)
{
//OpenSocItemUID[i] = BitConverter.ToUInt32(Data, (int)(79 + i * 4));
Client.RemoveItemByUID(BitConverter.ToUInt32(Data, (int)(76 + i * 4)));
}
Client.Send(Packets.ItemInfo(Equip, 3));
Client.Inventory.ThreadSafeAdd(Equip.UID, Equip);
Database.UpdateItem(Equip.UID, (int)Equip.Soc1, "Soc1");
Database.UpdateItem(Equip.UID, (int)Equip.Soc2, "Soc2");
Client.Send(Packets.GeneralData(Client.UID, 426, Client.X, Client.Y, 126));
Client.Send(Packets.GeneralData(Client.UID, 425, Client.X, Client.Y, 126));
break;
}
default:
break;
}
}
}
and open PacketHandler.cs again
add case in case 1009:
PHP Code:
case 43:
OpenSoc.Handle(Client,Data,43);
break;
ok ,,,, that's finish