Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Trinity HP calculation SQL. By Rochet2
- -- Instructions:
- -- Set the NPC Entry and Health you want it to have below.
- SET
- @NPC_ENTRY := 190010, -- This is your NPC's Entry
- @NPC_HEALTH := 20000; -- This is the health value you want your NPC to have.
- -- DO NOT CHANGE ANYTHING BELOW, UNLESS YOU KNOW WHAT YOU ARE DOING.
- -- Trinity HP calculation SQL. By Rochet2
- -- Getting NPC datas:
- SET
- @NPC_CLASS := (SELECT `unit_class` FROM creature_template WHERE Entry = @NPC_ENTRY),
- @NPC_LEVEL := ROUND(((SELECT `minlevel` FROM creature_template WHERE Entry = @NPC_ENTRY)+(SELECT `maxlevel` FROM creature_template WHERE Entry = @NPC_ENTRY))/2, 0),
- @EXP := (SELECT `exp` FROM creature_template WHERE Entry = @NPC_ENTRY);
- -- Getting base HP from a HP column defined by exp.
- SET
- @GET_HP_COL :=
- (SELECT CASE @EXP
- WHEN 0 THEN (SELECT basehp0 FROM creature_classlevelstats WHERE `level` = @NPC_LEVEL AND `class` = @NPC_CLASS)
- WHEN 1 THEN (SELECT basehp1 FROM creature_classlevelstats WHERE `level` = @NPC_LEVEL AND `class` = @NPC_CLASS)
- WHEN 2 THEN (SELECT basehp2 FROM creature_classlevelstats WHERE `level` = @NPC_LEVEL AND `class` = @NPC_CLASS)
- END);
- -- Running the update with all the data collected:
- UPDATE creature_template SET HealthModifier = (@NPC_HEALTH/@GET_HP_COL) WHERE Entry = @NPC_ENTRY;
- -- Trinity HP calculation SQL. By Rochet2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement