yes because you never thought of writing your own base and adding check to them
lemme try to think about it with some logic
does the client even bother sending to the server saying "someone trying to socket an item" ? yes indeed it does so the server send back saying "take the dragonballs" (visual take off inventory) then server does take them from database and updated the socketed item , right ?
so lets assume what i said was right or close to what really happen
so your problem is when someone try to put an item at the socketing npc the client do a check if this item is valid item to be socketed , if it's not it doesn't agree to put it inside else it put it and send this request/packet to the server , then server check if you got dbs and take them and update the item , right ?
the exploit is : they change the item id at the pointer or what fucking ever , right ?
so what you should be doing is adding a check at the server at this npc to make sure it's valid item else you ban/disconnect/botjail this mothafuckers , right ?
so simply when you get the packet of this npc trying to socket handle it by disconnect and ban
or to make it easier for you , add a check beside the dbs amount check saying the following
if itemtype is crop , steed , gourd , garment
user disconnect
user ban
else proceed to check how many dbs/stardrills he got if sucess update the item in the system
and don't worry about other players who will try to socket a non valid item because the client already do a check but if they fake it with the cheat engine then they worth trying the ban hammer
this was my logic and i believe it's close enough or actually what happens and what you should be doing
but if you want the truth ? what you should be doing is shutting down your mother fucking server and go to learn and write your own source and make sure it's free to exploits or atleast got none of the well knowen exploits
please any expert confirm if what i said was right or wrong cuz im curious to know if i was right or close enough
-----
edit : WDF
Code:
#region BlacksmithLee
case 1550:
{
switch (npcRequest.OptionID)
{
case 0:
client.Send(new Data(true) { UID = client.Entity.UID, ID = Data.OpenWindow, dwParam = Data.WindowCommands.OpenSockets, wParam1 = client.Entity.X, wParam2 = client.Entity.Y });
break;
}
break;
}
#endregion
i can't find where it handle this at the source you are using , all i found in dialogs is when you send packet clicking the npc it update the client to open the socketing window you are on , so yeah try to get packets to actually understand what's going on and see how the server handle them and edit/add to it or even handle them on your own , will try this when i wake up
umm i like that subject so im working right now :D
well here is the packet of requesting the dialog and what the server reply with (opening dialog)
Code:
Packet Nr 5696. Client -> Server, Length : 24, PacketType: 2031
10 00 EF 07 0E 06 00 00 00 00 00 00 00 00 00 00 ; ï
54 51 43 6C 69 65 6E 74 ;TQClient
Packet Nr 5697. Server -> Client, Length : 45, PacketType: 10010
25 00 1A 27 31 51 0F 00 A9 01 00 00 00 00 00 00 ;% '1Q ©
00 00 00 00 7E 00 00 00 CB 00 CA 00 00 00 00 00 ; ~ Ë Ê
00 00 00 00 00 54 51 53 65 72 76 65 72 ; TQServer
and here comes the important part
when i add the item it doesn't send a packet for server about the item information
but the good part is
once u click socket button it server does send this
Code:
Packet Nr 8369. Server -> Client, Length : 92, PacketType: 1008
54 00 F0 03 18 AA 1F 00 37 71 02 00 1B 0C 1B 0C ;T ðª 7q
03 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 00 ; ÿ
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ;
07 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 ;
00 00 00 00 54 51 53 65 72 76 65 72 ; TQServer
that doesn't really make sense for me as how the fuck the server knew that you want updated this item and how it take the dbs if the client didn't send to it , prolly i blocked some packets from packet logging but atleast i can go now to search for packet 1008 at server and figure out what's going on
well yup i was blocking 1009 1033 , lemme try again now
yeah 1009 was the deal over here
Code:
Packet Nr 21420. Client -> Server, Length : 144, PacketType: 1009
88 00 F1 03 3B AB 1F 00 00 00 00 00 2B 00 00 00 ;ˆ ñ;« +
E8 20 88 00 0C 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 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 00 59 AC 1F 00 5A AC 1F 00 5B AC 1F 00 ; Y¬ Z¬ [¬
5C AC 1F 00 5D AC 1F 00 5E AC 1F 00 5F AC 1F 00 ;\¬ ]¬ ^¬ _¬
60 AC 1F 00 61 AC 1F 00 62 AC 1F 00 63 AC 1F 00 ;`¬ a¬ b¬ c¬
64 AC 1F 00 00 00 00 00 54 51 43 6C 69 65 6E 74 ;d¬ TQClient
Packet Nr 21421. Server -> Client, Length : 84, PacketType: 1009
4C 00 F1 03 59 AC 1F 00 00 00 00 00 03 00 00 00 ;L ñY¬
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 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 54 51 53 65 ; TQSe
72 76 65 72 ;rver
Packet Nr 21422. Server -> Client, Length : 84, PacketType: 1009
4C 00 F1 03 5A AC 1F 00 00 00 00 00 03 00 00 00 ;L ñZ¬
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 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 54 51 53 65 ; TQSe
72 76 65 72 ;rver
Packet Nr 21423. Server -> Client, Length : 84, PacketType: 1009
4C 00 F1 03 5B AC 1F 00 00 00 00 00 03 00 00 00 ;L ñ[¬
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 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 54 51 53 65 ; TQSe
72 76 65 72 ;rver
Packet Nr 21424. Server -> Client, Length : 84, PacketType: 1009
4C 00 F1 03 5C AC 1F 00 00 00 00 00 03 00 00 00 ;L ñ\¬
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 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 54 51 53 65 ; TQSe
72 76 65 72 ;rver
Packet Nr 21425. Server -> Client, Length : 84, PacketType: 1009
4C 00 F1 03 5D AC 1F 00 00 00 00 00 03 00 00 00 ;L ñ]¬
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 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 54 51 53 65 ; TQSe
72 76 65 72 ;rver
Packet Nr 21426. Server -> Client, Length : 84, PacketType: 1009
4C 00 F1 03 5E AC 1F 00 00 00 00 00 03 00 00 00 ;L ñ^¬
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 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 54 51 53 65 ; TQSe
72 76 65 72 ;rver
Packet Nr 21427. Server -> Client, Length : 84, PacketType: 1009
4C 00 F1 03 5F AC 1F 00 00 00 00 00 03 00 00 00 ;L ñ_¬
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 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 54 51 53 65 ; TQSe
72 76 65 72 ;rver
Packet Nr 21428. Server -> Client, Length : 84, PacketType: 1009
4C 00 F1 03 60 AC 1F 00 00 00 00 00 03 00 00 00 ;L ñ`¬
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 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 54 51 53 65 ; TQSe
72 76 65 72 ;rver
Packet Nr 21429. Server -> Client, Length : 84, PacketType: 1009
4C 00 F1 03 61 AC 1F 00 00 00 00 00 03 00 00 00 ;L ña¬
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 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 54 51 53 65 ; TQSe
72 76 65 72 ;rver
Packet Nr 21430. Server -> Client, Length : 84, PacketType: 1009
4C 00 F1 03 62 AC 1F 00 00 00 00 00 03 00 00 00 ;L ñb¬
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 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 54 51 53 65 ; TQSe
72 76 65 72 ;rver
Packet Nr 21431. Server -> Client, Length : 84, PacketType: 1009
4C 00 F1 03 63 AC 1F 00 00 00 00 00 03 00 00 00 ;L ñc¬
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 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 54 51 53 65 ; TQSe
72 76 65 72 ;rver
Packet Nr 21432. Server -> Client, Length : 84, PacketType: 1009
4C 00 F1 03 64 AC 1F 00 00 00 00 00 03 00 00 00 ;L ñd¬
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 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 54 51 53 65 ; TQSe
72 76 65 72 ;rver
Packet Nr 21433. Server -> Client, Length : 92, PacketType: 1008
54 00 F0 03 3B AB 1F 00 37 71 02 00 1B 0C 1B 0C ;T ð;« 7q
03 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 00 ; ÿ
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ;
07 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 ;
00 00 00 00 54 51 53 65 72 76 65 72 ; TQServer
Packet Nr 21434. Server -> Client, Length : 144, PacketType: 1009
88 00 F1 03 3B AB 1F 00 01 00 00 00 2B 00 00 00 ;ˆ ñ;« +
E8 20 88 00 0C 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 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 00 59 AC 1F 00 5A AC 1F 00 5B AC 1F 00 ; Y¬ Z¬ [¬
5C AC 1F 00 5D AC 1F 00 5E AC 1F 00 5F AC 1F 00 ;\¬ ]¬ ^¬ _¬
60 AC 1F 00 61 AC 1F 00 62 AC 1F 00 63 AC 1F 00 ;`¬ a¬ b¬ c¬
64 AC 1F 00 00 00 00 00 54 51 53 65 72 76 65 72 ;d¬ TQServer
now lemme have a look at the source
client send 1009 packet , ill search the entire solution for it while looking to the packet structure at korvacs packet structure
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
the packet structure pretty the same since 5295 till 5500
well again what was the packet length ? 144 ?
oh i didn't find it with a check on the length but there is a check also on the type inside the packet , oh you didn't look at the packet structure , did you ?
well doesn't really matter because you must do it now to understand what's going on up here
Code:
#region Item/Ping (1009)
case 1009:
{
if (client.Action != 2)
return;
ItemUsage usage = new ItemUsage(false);
usage.Deserialize(packet);
if (!client.Entity.Dead || usage.ID == ItemUsage.Ping)
{
switch (usage.ID)
{
case 52:
{
var item = Database.ConquerItemTable.LoadItem(usage.UID);
item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.ChatItem;
item.Send(client);
break;
}
case 41:
{
var item = Database.ConquerItemTable.LoadItem(usage.UID);
usage.dwParam = 5;
client.Send(usage);
break;
}
case ItemUsage.ArrowReload:
{
ReloadArrows(client.Equipment.TryGetItem(ConquerItem.LeftWeapon), client);
break;
}
case ItemUsage.ShowBoothItems:
{
ShowBoothItems(usage, client);
break;
}
case ItemUsage.AddItemOnBoothForSilvers:
case ItemUsage.AddItemOnBoothForConquerPoints:
{
AddItemOnBooth(usage, client);
break;
}
case ItemUsage.BuyFromBooth:
{
BuyFromBooth(usage, client);
break;
}
case ItemUsage.RemoveItemFromBooth:
{
RemoveItemFromBooth(usage, client);
break;
}
case ItemUsage.EquipItem:
{
EquipItem(usage, client);
break;
}
case ItemUsage.UnequipItem:
{
UnequipItem(usage, client);
break;
}
case ItemUsage.BuyFromNPC:
{
HandleBuyFromNPC(usage, client);
break;
}
case ItemUsage.SellToNPC:
{
HandleSellToNPC(usage, client);
break;
}
case ItemUsage.Repair:
{
HandleRepair(usage, client);
break;
}
case ItemUsage.MeteorUpgrade:
case ItemUsage.DragonBallUpgrade:
{
UpgradeItem(usage, client);
break;
}
case ItemUsage.Ping:
{
if (Time32.Now < client.LastPing.AddSeconds(2))
{
client.PingCount++;
if (client.PingCount == 40)
{
client.Send(new Message("Speed hack detected!", System.Drawing.Color.BlanchedAlmond, Message.TopLeft));
client.Disconnect();
return;
}
}
if (client.Entity != null)
{
if (client.Entity.UID != 0)
{
if (!ServerBase.Kernel.GamePool.ContainsKey(client.Entity.UID))
{
ServerBase.Kernel.GamePool.Add(client.Entity.UID, client);
}
}
}
client.LastPingT = client.LastPing;
client.LastPing = Time32.Now;
if (client.LastPing > client.LastPingT.AddSeconds(2))
client.PingCount = 0;
usage.TimeStamp += 120;
// client.Send(ReturnFinal(packet));
//Network.PacketHandler.HandleBuffer(packet, client);
client.Send(usage);
if (!ServerBase.Kernel.GamePool.ContainsKey(client.Entity.UID))
if (client.Socket.Connected)
{
ServerBase.Kernel.GamePool.Add(client.Entity.UID, client);
client.Screen.FullWipe();
client.Screen.Reload(null);
}
break;
}
case ItemUsage.ViewWarehouse:
{
usage.dwParam = client.MoneySave;
client.Send(usage);
break;
}
case ItemUsage.WarehouseDeposit:
{
if (client.Entity.Money >= usage.dwParam)
{
client.Entity.Money -= usage.dwParam;
client.MoneySave += usage.dwParam;
}
break;
}
case ItemUsage.WarehouseWithdraw:
{
if (client.MoneySave >= usage.dwParam)
{
client.Entity.Money += usage.dwParam;
client.MoneySave -= usage.dwParam;
}
break;
}
case ItemUsage.DropItem:
{
DropItem(usage, client);
break;
}
case ItemUsage.DropMoney:
{
DropMoney(usage, client);
break;
}
case ItemUsage.Enchant:
{
EnchantItem(usage, client);
break;
}
case ItemUsage.SocketTalismanWithItem:
{
SocketTalismanWithItem(usage, client);
break;
}
case ItemUsage.SocketTalismanWithCPs:
{
SocketTalismanWithCPs(usage, client);
break;
}
case 40:
{
uint ItemAdd = (uint)((packet[4] & 0xFF) | ((packet[5] & 0xFF) << 8) | ((packet[6] & 0xFF) << 16) | ((packet[7] & 0xFF) << 24));
//PrintPacket(packet);
Interfaces.IConquerItem item_new = null;
if (client.Inventory.TryGetItem(ItemAdd, out item_new))
{
if (item_new.Bless == 7)
return;
Queue<uint> amount = new Queue<uint>(packet[20]);
for (ushort i = 84; i < 84 + 4 * packet[20]; i += 4)
{
if (client.Inventory.ContainsUID((uint)((packet[i] & 0xFF) | ((packet[(byte)(i + 1)] & 0xFF) << 8) | ((packet[(byte)(i + 2)] & 0xFF) << 16) | ((packet[(byte)(i + 3)] & 0xFF) << 24))))
amount.Enqueue((uint)((packet[i] & 0xFF) | ((packet[(byte)(i + 1)] & 0xFF) << 8) | ((packet[(byte)(i + 2)] & 0xFF) << 16) | ((packet[(byte)(i + 3)] & 0xFF) << 24)));
else
return;
}
byte oldbless = item_new.Bless;
if (item_new.Bless == 0 && amount.Count == 5)
item_new.Bless = 1;
else if (item_new.Bless == 1 && amount.Count == 1)
item_new.Bless = 3;
else if (item_new.Bless == 3 && amount.Count == 3)
item_new.Bless = 5;
else if (item_new.Bless == 5 && amount.Count == 5)
item_new.Bless = 7;
if (oldbless == item_new.Bless)
return;
while (amount.Count != 0)
client.Inventory.Remove(amount.Dequeue(), Conquer_Online_Server.Game.Enums.ItemUse.Remove, true);
item_new.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
item_new.Send(client);
Database.ConquerItemTable.UpdateItem(item_new, client);
}
//client.Send(packet);
break;
}
case 53:
{
uint ItemAdd = BitConverter.ToUInt32(packet, 8);
//Interfaces.IConquerItem item_new = null;
//if (client.Inventory.TryGetItem(ItemAdd, out item_new))
{
uint obtined_points = 0;
Database.ConquerItemInformation iteminfo = new Conquer_Online_Server.Database.ConquerItemInformation(ItemAdd, 0);
Dictionary<uint, uint> amount = new Dictionary<uint, uint>();//packet[20]);
for (ushort i = 80; i < 84 + 4 * packet[20]; i += 4)
{
uint item_swap = BitConverter.ToUInt32(packet, i);
if (client.Inventory.ContainsUID(item_swap))
{
Interfaces.IConquerItem item = null;
if (client.Inventory.TryGetItem(item_swap, out item))
{
amount.Add(item_swap, i);
}
switch (item.ID)
{
case 191505:
case 191605:
case 191705:
case 191805:
case 191905:
case 191405:
case 183325:
case 183315:
case 183375:
case 183305:
{
obtined_points += 300;
break;
}
default:
obtined_points += 50;
break;
}
}
}
if (iteminfo.BaseInformation.ConquerPointsWorth > obtined_points)
{
uint add_cps = 0;
add_cps = (uint)(iteminfo.BaseInformation.ConquerPointsWorth - obtined_points);
if (add_cps < client.Entity.ConquerPoints)
{
client.Entity.ConquerPoints -= add_cps;
foreach (uint key in amount.Keys)
{
if (client.Inventory.ContainsUID(key))
client.Inventory.Remove(key, Conquer_Online_Server.Game.Enums.ItemUse.Remove, true);
}
client.Inventory.Add(ItemAdd, 0, 1);
}
}
else
{
foreach (uint key in amount.Keys)
{
if (client.Inventory.ContainsUID(key))
client.Inventory.Remove(key, Conquer_Online_Server.Game.Enums.ItemUse.Remove, true);
}
client.Inventory.Add(ItemAdd, 0, 1);
}
}
break;
}
case ItemUsage.SocketerMan:
{
#region Socketing
UInt32 Count = usage.dwExtraInfo, ItemUID = usage.UID;
Byte Type = 0;
Interfaces.IConquerItem Item = null;
if (client.Inventory.TryGetItem(ItemUID, out Item))
{
#region Removing Used Items
for (int i = 1; i <= Count; i++)
{
uint It = BitConverter.ToUInt32(packet, (int)(80 + (4 * i)));
Interfaces.IConquerItem Rem = null;
if (client.Inventory.TryGetItem(It, out Rem))
{
if (Rem.ID == 1088000 && Count == 12)
Type = 1;
if (Rem.ID == 1088000 && Count == 1)
Type = 2;
if (Rem.ID == 1088000 && Count == 5)
Type = 3;
if (Rem.ID == 1200005 && Count == 1)
Type = 4;
if (Rem.ID == 1200006 && Count == 7)
Type = 5;
client.Inventory.Remove(Rem, Game.Enums.ItemUse.Remove);
}
}
#endregion
#region Type Switch
switch (Type)
{
#region Open First Socket
case 1:
case 2:
{
usage.dwParam = 1;
Item.Mode = Game.Enums.ItemMode.Update;
Item.SocketOne = (Game.Enums.Gem)255;
Item.Send(client);
Item.Mode = Game.Enums.ItemMode.Default;
Conquer_Online_Server.Database.ConquerItemTable.UpdateSockets(Item, client);
break;
}
#endregion
#region Open Second Socket
case 3:
case 5:
{
usage.dwParam = 1;
Item.Mode = Game.Enums.ItemMode.Update;
Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has oppened the second socket into his/her item!", System.Drawing.Color.Yellow, 2011), Kernel.GamePool.Values, client.Entity.UID);
Item.SocketTwo = (Game.Enums.Gem)255;
Item.Send(client);
Item.Mode = Game.Enums.ItemMode.Default;
Conquer_Online_Server.Database.ConquerItemTable.UpdateSockets(Item, client);
break;
}
#endregion
#region Using Tough Drill
case 4:
{
if (ServerBase.Kernel.Rate(10))
{
usage.dwParam = 1;
Item.Mode = Game.Enums.ItemMode.Update;
Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has oppened the second socket into his/her item!", System.Drawing.Color.Yellow, 2011), Kernel.GamePool.Values, client.Entity.UID);
Item.SocketTwo = (Game.Enums.Gem)255;
Item.Send(client);
Item.Mode = Game.Enums.ItemMode.Default;
Conquer_Online_Server.Database.ConquerItemTable.UpdateSockets(Item, client);
}
else
{
usage.dwParam = 0;
client.Send(new Message("The ToughDrill has failed. Try your lucky next time!", System.Drawing.Color.Red, Message.TopLeft));
client.Inventory.Add(1200006, 0, 1);
}
break;
}
#endregion
}
#endregion
}
//dWParam Values, = 0 = Failed, 1 = Suceed, 2 = Nothing
client.Send(usage);
#endregion
break;
}
case ItemUsage.RedeemGear:
{
var item = client.DeatinedItem[usage.UID];
if (item != null)
{
if (DateTime.Now > item.Date.AddDays(7))
{
client.Send(new Message("This item is expired!", System.Drawing.Color.Red, Message.TopLeft));
return;
}
if (client.Entity.ConquerPoints >= item.ConquerPointsCost)
{
client.Entity.ConquerPoints -= item.ConquerPointsCost;
usage.dwParam = client.Entity.UID;
usage.dwExtraInfo3 = item.ConquerPointsCost;
client.Send(usage);
client.Inventory.Add(item.Item, Conquer_Online_Server.Game.Enums.ItemUse.Add);
Database.DetainedItemTable.Redeem(item, client);
client.DeatinedItem.Remove(item.UID);
if (ServerBase.Kernel.GamePool.ContainsKey(item.GainerUID))
{
var pClient = ServerBase.Kernel.GamePool[item.GainerUID];
pClient.ClaimableItem[item.UID].OwnerUID = 500;
pClient.ClaimableItem[item.UID].MakeItReadyToClaim();
usage.dwParam = pClient.Entity.UID;
usage.ID = ItemUsage.ClaimGear;
pClient.Send(usage);
pClient.ClaimableItem[item.UID].Send(pClient);
}
Message message = new Message("Thank you for arresting " + item.OwnerName + ", " + item.GainerName + ". The arrested one has redeemed his items and you have received a great deal of ConquerPoints as reward. Congratulations!", System.Drawing.Color.Wheat, Message.Talk);
ServerBase.Kernel.SendWorldMessage(message, ServerBase.Kernel.GamePool.Values);
}
}
else
{
client.Send(new Message("The item you want to redeem has already been redeemed.", System.Drawing.Color.Red, Message.TopLeft));
}
break;
}
case ItemUsage.ClaimGear:
{
var item = client.ClaimableItem[usage.UID];
if (item != null)
{
if (item.Bound)
{
client.Send(new Message("Unnclaimable item!", System.Drawing.Color.Red, Message.TopLeft));
return;
}
if (DateTime.Now < item.Date.AddDays(7) && item.OwnerUID != 500)
{
client.Send(new Message("This item is not expired. You cannot claim it yet!", System.Drawing.Color.Red, Message.TopLeft));
return;
}
if (item.OwnerUID == 500)
client.Entity.ConquerPoints += item.ConquerPointsCost;
else
{
client.Inventory.Add(item.Item, Conquer_Online_Server.Game.Enums.ItemUse.Move);
Message message = new Message("Thank you for arresting " + item.OwnerName + ", " + item.GainerName + ". The arrested one has redeemed his items and you have received a great deal of ConquerPoints as reward. Congratulations!", System.Drawing.Color.Wheat, Message.Talk);
ServerBase.Kernel.SendWorldMessage(message, ServerBase.Kernel.GamePool.Values);
}
Database.DetainedItemTable.Claim(item, client);
client.ClaimableItem.Remove(item.UID);
usage.dwParam = client.Entity.UID;
usage.dwExtraInfo3 = item.ConquerPointsCost;
client.Send(usage);
}
else
{
client.Send(new Message("The item you want to claim has already been claimed.", System.Drawing.Color.Red, Message.TopLeft));
}
break;
}
case 34:
{
break;
}
case 45:
{
client.Entity.Teleport(1002, 429, 378);
break;
}
default:
{
Console.WriteLine("Unhandled item usage type : " + usage.ID);
break;
}
}
}
break;
}
#endregion
oh really big code , well you MUST understand it fully because using item is on of the most important packets out there but ummm i don't damn have energy to explain them on by one so lets hit straight to the point
Code:
at
case ItemUsage.SocketerMan:
at
if (client.Inventory.TryGetItem(It, out Rem))
{
if (Rem.ID == 1088000 && Count == 12)
Type = 1;
if (Rem.ID == 1088000 && Count == 1)
Type = 2;
if (Rem.ID == 1088000 && Count == 5)
Type = 3;
if (Rem.ID == 1200005 && Count == 1)
Type = 4;
if (Rem.ID == 1200006 && Count == 7)
Type = 5;
client.Inventory.Remove(Rem, Game.Enums.ItemUse.Remove);
}
this is actually check if you socketing with 12 dbs or 1 db or 5 or 1 tough or 7 star drills
to
Code:
switch (Type)
{
case 1:
case 2:
{
usage.dwParam = 1;
Item.Mode = Game.Enums.ItemMode.Update;
Item.SocketOne = (Game.Enums.Gem)255;
Item.Send(client);
Item.Mode = Game.Enums.ItemMode.Default;
Conquer_Online_Server.Database.ConquerItemTable.UpdateSockets(Item, client);
break;
}
what this shit actually do ?
it add one socket to the item in the database and update it on your client
so what actually you need to do ?
add the check i was talking about
how ? (if u did just ask how please kill youself)
well in the next piece of code im using the item id which is FIXED id aka id of dragonball is 1088000 and it's a FIXED id and not the id of item on player (for example and forgive my bad english , andrew got orange and andrew got it in his pocket lets call it 1 , poula got orange and got it in his ass lets call it 2 , so poula and andrew both for oranges but in different places with different ids)
so back to the subject
we will change it to
Code:
case 1:
case 2:
{
if (Item.ID == cropid || Item.ID == steedid || Item.ID == gourd.id || Item.ID == garmentid)
{
client.Account.State = Database.AccountTable.AccountState.Banned;
break;
}
else
{
usage.dwParam = 1;
Item.Mode = Game.Enums.ItemMode.Update;
Item.SocketOne = (Game.Enums.Gem)255;
Item.Send(client);
Item.Mode = Game.Enums.ItemMode.Default;
Conquer_Online_Server.Database.ConquerItemTable.UpdateSockets(Item, client);
break;
}
}
steeds ids is not the same , so do gourds and stuff
so to avoid do || for 10 lines put them in a nice list and do a foreach loop
i did not use spoilers and code surrounding this last part cuz i so badly want to sleep as much as you want to watch porn