Jump to content

Making a top ten of honorable kills


Guest peluche

Recommended Posts

I am trying to create a php with a top ten, for that I need to use substr() in mysql query, I know where the value is located checking https://mangos.svn.sourceforge.net/svnroot/mangos/trunk/src/game/UpdateFields.h,

PLAYER_FIELD_LIFETIME_HONORBALE_KILLS = UNIT_END + 0x0503, // Size: 1, Type: INT, Flags: PRIVATE

Ok, I know that the location is at position 1283, but size 1 ? if it is an int, size 1 is from 0 to 9 or I am wrong ?

Link to comment
Share on other sites

I think this will help you a step further.

I added "level" to give an second example for how the comand works. Maybe you want to restrict the search to Chars above a certain Level.

SELECT
   guid,name,
   SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) as level,
   CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 1518), ' ', -1) AS UNSIGNED) as killslifetime
FROM characters
ORDER BY killslifetime DESC
LIMIT 10

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use