Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 00:44

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

Advertisement



[5017] Item Information Packet - Color Offset

Discussion on [5017] Item Information Packet - Color Offset within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old 10/04/2013, 21:29   #16
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 15
Quote:
Originally Posted by Mr_PoP View Post
I don't know why you guys using strings with numbers(integers) , if it's int there is no need to convert it to string then select what you want , basically if it's an int you have to do Math(calculation)....

here how to change the color :-

Code:
uint newItemColor = TypeId-((TypeId/100)%10)*100+newColor*100;
thanks bro i`ll try it
abdeen is offline  
Old 10/04/2013, 22:02   #17
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
If you want to replace the 3rd digit with a known number then I'd do something like...

var itemType = originalID / 1000 * 1000;
///139399 /1000 * 1000 = 139000 (clear last 3 digits out)
var itemQualityLevel = originalID % 100;
//139399 % 100 = 99 (get last 2 digits)
var newID = itemType + newColor * 100 + itemQualityLevel;
//Get the full ID by using the itemID, ItemColor (in 3rd digit) and itemQualityLevel to create a properly formatted item ID



That's of course a massively broken down version of the calculation and it could be simplified. This is just to give you the thought process behind what it is you're trying to do so that you can code it yourself.


You also then need to verify that the item ID does in fact exist and is the same item type as it originally was.

Alternative (and much simpler) calculation would be...

itemID += newColor - (itemID % 1000 / 100) * 100

Fully broken down example calculation (Note: make sure it's processing as an int. You need it supporting negative numbers to work obviously)

139399 += 4 - (139399 % 1000 / 100) * 100
139399 += 4 - 3 * 100
139399 += 100
Result: 139499
pro4never is offline  
Reply


Similar Threads Similar Threads
Warehouse Packet, Offset 9
11/19/2011 - CO2 Programming - 5 Replies
Within packets related to warehouse activities sent from both the server and client there is this seemingly constant value of 10 at offset 9. What does it represent? I'm particularly curious because while testing I was actually botjailed for putting a value other than 10. Also, in the "open warehouse packet", which is sent by the client the first time you try to open a warehouse, offset 10 has a value of 1. Subsequent packets of this packet are sent with a value of 0 at offset 10 (whenever...
[5017] Looking for packet enums...
11/03/2011 - CO2 Private Server - 13 Replies
Hello all, I want to know how to get enums, and I`d like to know if someone knows it, whats the status enum for disguise/transformations? EDIT: Yes I already checked the wiki... Thanks in advanced, Jobdvh!
[5017] Item Packet Subtype for Special Effects
05/09/2011 - CO2 Private Server - 10 Replies
Heya, I would need both Enum and Packet for Reborn Effects like: Shield AddHP ... Thanks for reading
Get DC'd by packet offset.
10/05/2010 - CO2 Private Server - 1 Replies
So, (Impulses source) I am trying to workout an offset. For guild info but the offset is clearly over 50 but if I do 50+ for the offset I get dc'd with no error? the packet is public static byte GuildInfo(Client.GameState client) { byte LeaLen = (byte)(client.Entity.MyGuild.GLeader.Length + 21); PacketBuilder Packet = new PacketBuilder(1106, 40); Packet.Long(client.Entity.GuildId);
[Release]Twelve Sky AutoPot/Offset Information
01/03/2010 - General Gaming Discussion - 10 Replies
UPDATED. This is for Client 1.10 and works as of July 25, 2008. Here is an Auto HP/MP Pill or Meditation program I've been working on. Place HP Pills in the 1st or 2nd Pill slots and MP Pills in the 3rd and 4th Pill slots. You can also choose to enable auto meditation instead to restore your MP. You will need to set the Key to your meditation key(F1-F8). The default setting is F5 for the MedKey and Meditation is on by default. You can also set the HP/MP percent, the percent of...



All times are GMT +1. The time now is 00:47.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.