Advertisement
Rochet2

Untitled

Jan 29th, 2015
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 2.12 KB | None | 0 0
  1.  
  2. -- Set these from the data you use in the insert of creature
  3. SET
  4. @NPC_CLASS := `unit_class`,
  5. @NPC_LEVEL := ROUND((minlevel+maxlevel)/2, 0),
  6. @EXP := `exp`;
  7.  
  8. -- Gets the base hp according to level, class and exp
  9. SET
  10. @GET_HP_COL :=
  11. (SELECT CASE @EXP
  12.     WHEN 0 THEN (SELECT basehp0 FROM creature_classlevelstats WHERE `level` = @NPC_LEVEL AND `class` = @NPC_CLASS)
  13.     WHEN 1 THEN (SELECT basehp1 FROM creature_classlevelstats WHERE `level` = @NPC_LEVEL AND `class` = @NPC_CLASS)
  14.     WHEN 2 THEN (SELECT basehp2 FROM creature_classlevelstats WHERE `level` = @NPC_LEVEL AND `class` = @NPC_CLASS)
  15. END);
  16.  
  17. -- The generated NPC sql
  18. INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `dmgschool`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `DamageModifier`, `ExperienceModifier`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`)
  19. VALUES (50000, 0, 0, 0, 0, 0, 169, 11686, 0, 0, 'Orb Rotation Focus (3)', '', '', 0, 80, 80, 0, 14, 0, 2.2, 0.785714, 1, 0, 0, 2000, 2000, 1, 1, 1, 33554688, 2048, 0, 0, 0, 0, 0, 0, 10, 1048576, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 1, (@NPC_HEALTH/@GET_HP_COL), 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 118, 1, 0, 128, '', 12340);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement