aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp184
1 files changed, 169 insertions, 15 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 6e9f2b32e11..2668f3fc5c9 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -361,21 +361,175 @@ void ObjectMgr::LoadCreatureTemplates()
{
uint32 oldMSTime = getMSTime();
- // 0 1 2 3 4 5 6 7 8
- QueryResult result = WorldDatabase.Query("SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, "
- // 9 10 11 12 13 14 15 16 17 18 19 20
- "modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction, npcflag, speed_walk, speed_run, "
- // 21 22 23 24 25 26 27 28 29 30
- "scale, `rank`, dmgschool, BaseAttackTime, RangeAttackTime, BaseVariance, RangeVariance, unit_class, unit_flags, unit_flags2, "
- // 31 32 33 34 35 36 37 38 39 40 41 42 43
- "dynamicflags, family, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, "
- // 44 45 46 47 48 49 50 51 52 53 54 55 56 57
- "spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, "
- // 58 59 60 61 62 63 64 65 66 67 68
- "ctm.Ground, ctm.Swim, ctm.Flight, ctm.Rooted, ctm.Chase, ctm.Random, HoverHeight, HealthModifier, ManaModifier, ArmorModifier, DamageModifier, "
- // 69 70 71 72 73 74 75 76
- "ExperienceModifier, RacialLeader, movementId, RegenHealth, mechanic_immune_mask, spell_school_immune_mask, flags_extra, ScriptName "
- "FROM creature_template ct LEFT JOIN creature_template_movement ctm ON ct.entry = ctm.CreatureId");
+ // Steps to update the counter below without doing it 1 by 1 manually
+ // 1. Using Notepad++ copy the query from "SELECT" to last field
+ // 2. Run this regex
+ // a.find "\r\n[ ]+\/\/[ ]+[0-9]+
+ // b.replace "\/\/
+ // 3. Alt + Left Click and vertical select all columns enough on the right of the file to be after // in all lines
+ // 4. Select "Edit" in the menu and then "Column Editor.."
+ // 5. Select "Number to Insert", Initial number 1, Increase by 1
+ // 6. Run this regex
+ // a.find "\/\/[ ]+
+ // b.replace "\r\n\t\t\/\/
+
+ QueryResult result = WorldDatabase.Query(
+ // 0
+ "SELECT entry,"
+ // 1
+ "difficulty_entry_1,"
+ // 2
+ "difficulty_entry_2,"
+ // 3
+ "difficulty_entry_3,"
+ // 4
+ "KillCredit1,"
+ // 5
+ "KillCredit2,"
+ // 6
+ "modelid1,"
+ // 7
+ "modelid2,"
+ // 8
+ "modelid3,"
+ // 9
+ "modelid4,"
+ // 10
+ "name,"
+ // 11
+ "subname,"
+ // 12
+ "IconName,"
+ // 13
+ "gossip_menu_id,"
+ // 14
+ "minlevel,"
+ // 15
+ "maxlevel,"
+ // 16
+ "exp,"
+ // 17
+ "faction,"
+ // 18
+ "npcflag,"
+ // 19
+ "speed_walk,"
+ // 20
+ "speed_run,"
+ // 21
+ "scale,"
+ // 22
+ "`rank`,"
+ // 23
+ "dmgschool,"
+ // 24
+ "BaseAttackTime,"
+ // 25
+ "RangeAttackTime,"
+ // 26
+ "BaseVariance,"
+ // 27
+ "RangeVariance,"
+ // 28
+ "unit_class,"
+ // 29
+ "unit_flags,"
+ // 30
+ "unit_flags2,"
+ // 31
+ "dynamicflags,"
+ // 32
+ "family,"
+ // 33
+ "type,"
+ // 34
+ "type_flags,"
+ // 35
+ "lootid,"
+ // 36
+ "pickpocketloot,"
+ // 37
+ "skinloot,"
+ // 38
+ "resistance1,"
+ // 39
+ "resistance2,"
+ // 40
+ "resistance3,"
+ // 41
+ "resistance4,"
+ // 42
+ "resistance5,"
+ // 43
+ "resistance6,"
+ // 44
+ "spell1,"
+ // 45
+ "spell2,"
+ // 46
+ "spell3,"
+ // 47
+ "spell4,"
+ // 48
+ "spell5,"
+ // 49
+ "spell6,"
+ // 50
+ "spell7,"
+ // 51
+ "spell8,"
+ // 52
+ "PetSpellDataId,"
+ // 53
+ "VehicleId,"
+ // 54
+ "mingold,"
+ // 55
+ "maxgold,"
+ // 56
+ "AIName,"
+ // 57
+ "MovementType,"
+ // 58
+ "ctm.Ground,"
+ // 59
+ "ctm.Swim,"
+ // 60
+ "ctm.Flight,"
+ // 61
+ "ctm.Rooted,"
+ // 62
+ "ctm.Chase,"
+ // 63
+ "ctm.Random,"
+ // 64
+ "HoverHeight,"
+ // 65
+ "HealthModifier,"
+ // 66
+ "ManaModifier,"
+ // 67
+ "ArmorModifier,"
+ // 68
+ "DamageModifier,"
+ // 69
+ "ExperienceModifier,"
+ // 70
+ "RacialLeader,"
+ // 71
+ "movementId,"
+ // 72
+ "RegenHealth,"
+ // 73
+ "mechanic_immune_mask,"
+ // 74
+ "spell_school_immune_mask,"
+ // 75
+ "flags_extra,"
+ // 76
+ "ScriptName"
+ " FROM creature_template ct"
+ " LEFT JOIN creature_template_movement ctm ON ct.entry = ctm.CreatureId");
if (!result)
{