Skip to content

Commit

Permalink
Change creature template column order.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Nov 13, 2023
1 parent d0adcf3 commit 18f9fc4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
28 changes: 28 additions & 0 deletions sql/migrations/20231113010252_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
DROP PROCEDURE IF EXISTS add_migration;
delimiter ??
CREATE PROCEDURE `add_migration`()
BEGIN
DECLARE v INT DEFAULT 1;
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20231113010252');
IF v=0 THEN
INSERT INTO `migrations` VALUES ('20231113010252');
-- Add your query below.


-- Change order of creature template columns, so we don't have to scroll to see name.
ALTER TABLE `creature_template`
CHANGE COLUMN `name` `name` CHAR(100) NOT NULL DEFAULT '0' AFTER `patch`,
CHANGE COLUMN `subname` `subname` CHAR(100) NULL DEFAULT NULL AFTER `name`,
CHANGE COLUMN `level_min` `level_min` TINYINT(3) UNSIGNED NOT NULL DEFAULT '1' AFTER `subname`,
CHANGE COLUMN `level_max` `level_max` TINYINT(3) UNSIGNED NOT NULL DEFAULT '1' AFTER `level_min`,
CHANGE COLUMN `faction` `faction` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `level_max`,
CHANGE COLUMN `npc_flags` `npc_flags` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `faction`,
CHANGE COLUMN `gossip_menu_id` `gossip_menu_id` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `npc_flags`;


-- End of migration.
END IF;
END??
delimiter ;
CALL add_migration();
DROP PROCEDURE IF EXISTS add_migration;
4 changes: 2 additions & 2 deletions src/game/Database/SQLStorages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include "Database/SQLStorageImpl.h"
#include "Database/DatabaseEnv.h"

char const CreatureInfosrcfmt[] = "iiiiiffffiiiiiissiiiiifffffiffffffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiissiiiliiiiiiis";
char const CreatureInfodstfmt[] = "iiiiiffffiiiiiissiiiiifffffiffffffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiissiiiliiiiiiii";
char const CreatureInfosrcfmt[] = "issiiiiiiiiiffffiiiiiifffffiffffffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiissiiiliiiiiiis";
char const CreatureInfodstfmt[] = "issiiiiiiiiiffffiiiiiifffffiffffffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiissiiiliiiiiiii";
char const CreatureDataAddonInfofmt[] = "iiiibbis";
char const CreatureDisplayInfoAddonfmt[] = "iffffbi";
char const GameObjectDisplayInfoAddonfmt[] = "iffffff";
Expand Down
12 changes: 6 additions & 6 deletions src/game/Objects/CreatureDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,18 @@ typedef std::vector<CreatureSpellsEntry> CreatureSpellsList;
struct CreatureInfo
{
uint32 entry;
uint32 display_id[MAX_DISPLAY_IDS_PER_CREATURE];
float display_scale[MAX_DISPLAY_IDS_PER_CREATURE];
uint32 display_probability[MAX_DISPLAY_IDS_PER_CREATURE];
uint32 display_total_probability;
uint32 mount_display_id;
char* name;
char* subname;
uint32 gossip_menu_id;
uint32 level_min;
uint32 level_max;
uint32 faction;
uint32 npc_flags;
uint32 gossip_menu_id;
uint32 display_id[MAX_DISPLAY_IDS_PER_CREATURE];
float display_scale[MAX_DISPLAY_IDS_PER_CREATURE];
uint32 display_probability[MAX_DISPLAY_IDS_PER_CREATURE];
uint32 display_total_probability;
uint32 mount_display_id;
float speed_walk;
float speed_run;
float detection_range; // Detection Range for Line of Sight aggro
Expand Down

0 comments on commit 18f9fc4

Please sign in to comment.