Hello , I need litlle help with PetBug find code :
Credit to LikeReally
But this code getting just started Value for Vit/Str/Int...
if you lvl pet or someone use PetBug hack they are not found in Pettab_sg, bcz code getting start value from pet info.
If anyone can little help with this.
Thank you
Code:
CREATE DEFINER=`root`@`localhost` FUNCTION `getpetinteger`(PET_GET_ID BIGINT UNSIGNED, PET_GET_TYPE INT) RETURNS int(11)
READS SQL DATA
DETERMINISTIC
BEGIN
DECLARE PET_VIT INTEGER UNSIGNED;
DECLARE PET_INT INTEGER UNSIGNED;
DECLARE PET_STR INTEGER UNSIGNED;
DECLARE PET_SPR INTEGER UNSIGNED;
DECLARE PET_DEX INTEGER UNSIGNED;
SET PET_VIT = 0;
SET PET_INT = 0;
SET PET_STR = 0;
SET PET_SPR = 0;
SET PET_DEX = 0;
SELECT CONV(CONCAT(SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+10,2),SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+8,2),SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+6,2),SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+4,2)),16,10) INTO PET_VIT FROM pettab_sg WHERE PetID = PET_GET_ID;
RETURN PET_VIT;
ELSEIF PET_GET_TYPE = 2 THEN
SELECT CONV(CONCAT(SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+50,2),SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+48,2),SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+46,2),SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+44,2)),16,10) INTO PET_INT FROM pettab_sg WHERE PetID = PET_GET_ID;
RETURN PET_INT;
ELSEIF PET_GET_TYPE = 3 THEN
SELECT CONV(CONCAT(SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+90,2),SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+88,2),SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+86,2),SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+84,2)),16,10) INTO PET_STR FROM pettab_sg WHERE PetID = PET_GET_ID;
RETURN PET_STR;
ELSEIF PET_GET_TYPE = 4 THEN
SELECT CONV(CONCAT(SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+130,2),SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+128,2),SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+126,2),SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+124,2)),16,10) INTO PET_SPR FROM pettab_sg WHERE PetID = PET_GET_ID;
RETURN PET_SPR;
ELSEIF PET_GET_TYPE = 5 THEN
SELECT CONV(CONCAT(SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+170,2),SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+168,2),SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+166,2),SUBSTR(hex(PetInfo),INSTR(SUBSTR(hex(PetInfo),43), "3F00")+164,2)),16,10) INTO PET_DEX FROM pettab_sg WHERE PetID = PET_GET_ID;
RETURN PET_DEX;
END IF;
END
CREATE DEFINER=`root`@`localhost` FUNCTION `getpetfloat`(PET_INTEGER INTEGER UNSIGNED ) RETURNS int(11)
READS SQL DATA
DETERMINISTIC
BEGIN
RETURN SIGN(PET_INTEGER) * (1.0 + (PET_INTEGER & 0x007FFFFF) * POWER(2.0, -23)) * POWER(2.0, (PET_INTEGER & 0x7f800000) / 0x00800000 - 127);
END
SELECT RoleID, getpetfloat(getpetinteger(PetID,1)) AS 'VIT', getpetfloat(getpetinteger(PetID,2)) AS 'INT', getpetfloat(getpetinteger(PetID,3)) AS 'STR', getpetfloat(getpetinteger(PetID,4)) AS 'SPR', getpetfloat(getpetinteger(PetID,5)) AS 'DEX' FROM pettab_sg;
But this code getting just started Value for Vit/Str/Int...
if you lvl pet or someone use PetBug hack they are not found in Pettab_sg, bcz code getting start value from pet info.
If anyone can little help with this.
Thank you