leifus
Glorious
Hello, today i want to realease routin i made a while ago to create level stats.
This easily editable routin you can use to create level stats for your server and here is a example for "pet_levelstats". So this adds 175 levels from the current max level, so if the max level is 83 it will add level stats up to 258(83+175 =258), but you can change that by editing the 175 number.
The percentage you can change where it says @percent = 1.10 and you can change how you want(1.05 = 5%, 1.75 = 75%) and so on.
Table can be changed by editing @tableh = pet_levelstats
When it comes to changing the table, you have to change the table colums so they are in tact with the table you change i to. As an example if you want to change to "player_levelstats" you have to change the Insert command to this
and the select command to this
and make sure they are in the right order. You can also use this to create xp_for_level and other things you need to scale if you are creating a hige level server.
This could probebly done easyer and better, but i did it this way and if you see something i could have possible done better, please let me know
Hope you like it
This easily editable routin you can use to create level stats for your server and here is a example for "pet_levelstats". So this adds 175 levels from the current max level, so if the max level is 83 it will add level stats up to 258(83+175 =258), but you can change that by editing the 175 number.
The percentage you can change where it says @percent = 1.10 and you can change how you want(1.05 = 5%, 1.75 = 75%) and so on.
Table can be changed by editing @tableh = pet_levelstats
Code:
BEGIN
SET
@percent = 1.10, /* increase 10% from last level */
@tableh = pet_levelstats; /* Table you are going to use */
DECLARE v1 INT DEFAULT 175; /* How many times you want it to run*/
WHILE v1 > 0
DO
INSERT INTO @tableh (`creature_entry`, `level`, `hp`, `mana`, `armor`, `str`, `agi`, `sta`, `inte`, `spi`)
SELECT
`creature_entry`
,`level` + 1 `level`
,CAST(`hp` * @percent AS UNSIGNED) `hp`
,CAST(`mana` * @percent AS UNSIGNED) `mana`
,CAST(`armor` * @percent AS UNSIGNED) `armor`
,CAST(`str` * @percent AS UNSIGNED) `str`
,CAST(`agi` * @percent AS UNSIGNED) `agi`
,CAST(`sta` * @percent AS UNSIGNED) `sta`
,CAST(`inte` * @percent AS UNSIGNED) `inte`
,CAST(`spi` * @percent AS UNSIGNED) `spi`
FROM @tableh
WHERE `level` = (SELECT MAX(`level`) FROM @tableh);
SET v1 = v1 - 1;
END WHILE;
END
When it comes to changing the table, you have to change the table colums so they are in tact with the table you change i to. As an example if you want to change to "player_levelstats" you have to change the Insert command to this
Code:
[COLOR="#FF0000"]- INSERT INTO @tableh (`creature_entry`, `level`, `hp`, `mana`, `armor`, `str`, `agi`, `sta`, `inte`, `spi`)[/COLOR]
[COLOR="#008000"]+ INSERT INTO @tableh (`race`, `class`, `level`, `str`, `agi`, `sta`, `inte`, `spi`)[/COLOR]
Code:
[COLOR="#FF0000"]- SELECT
- `creature_entry`
- ,`level` + 1 `level`
- ,CAST(`hp` * @percent AS UNSIGNED) `hp`
- ,CAST(`mana` * @percent AS UNSIGNED) `mana`
- ,CAST(`armor` * @percent AS UNSIGNED) `armor`
- ,CAST(`str` * @percent AS UNSIGNED) `str`
- ,CAST(`agi` * @percent AS UNSIGNED) `agi`
- ,CAST(`sta` * @percent AS UNSIGNED) `sta`
- ,CAST(`inte` * @percent AS UNSIGNED) `inte`
- ,CAST(`spi` * @percent AS UNSIGNED) `spi`
- FROM @tableh
- WHERE `level` = (SELECT MAX(`level`) FROM @tableh);[/COLOR]
[COLOR="#008000"]+ SELECT
+ `race`
+ ,`class`
+ ,`level` + 1 `level`
+ ,CAST(`str` * @percent AS UNSIGNED) `str`
+ ,CAST(`agi` * @percent AS UNSIGNED) `agi`
+ ,CAST(`sta` * @percent AS UNSIGNED) `sta`
+ ,CAST(`inte` * @percent AS UNSIGNED) `inte`
+ ,CAST(`spi` * @percent AS UNSIGNED) `spi`
+ FROM @tableh
+ WHERE `level` = (SELECT MAX(`level`) FROM @tableh);[/COLOR]
and make sure they are in the right order. You can also use this to create xp_for_level and other things you need to scale if you are creating a hige level server.
This could probebly done easyer and better, but i did it this way and if you see something i could have possible done better, please let me know
Hope you like it