Jump to content

Making a top ten of honorable kills


Recommended Posts

Posted

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 ?

Posted

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

Posted

Damn Funky, that was fantastic.

I was doing this atm to test

SELECT CAST(SUBSTRING(data FROM 1518 FOR 1) AS UNSIGNED) AS hk FROM characters ORDER BY HK LIMIT 10 DESC;

But I am still downloading the DB for local test ^^

Thanks for your help, nice query !

Posted

Funky, but 0x0503 isnt integer 1283 ?? I know 1283 is wrong since i get value 0 in all players

Why you use 1518 ? How do you get that number ?

Since I want to show other values like honor etc...

×
×
  • 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