Skip to content

Commit

Permalink
[s2439] Add Formation sql
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberium committed Jan 3, 2022
1 parent 5c5126b commit 803a198
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sql/base/mangos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`;
CREATE TABLE `db_version` (
`version` varchar(120) DEFAULT NULL,
`creature_ai_version` varchar(120) DEFAULT NULL,
`required_s2438_01_mangos_spawn_groups` bit(1) DEFAULT NULL
`required_s2439_01_mangos_groups_formation` bit(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Used DB version notes';

--
Expand Down
30 changes: 30 additions & 0 deletions sql/updates/mangos/s2439_01_mangos_groups_formation.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ALTER TABLE db_version CHANGE COLUMN required_s2438_01_mangos_spawn_groups required_s2439_01_mangos_groups_formation bit;

ALTER TABLE `spawn_group_spawn` ADD COLUMN `SlotId` tinyint(4) NOT NULL DEFAULT -1 COMMENT '0 is the leader, -1 not part of the formation' AFTER `Guid`;

DROP TABLE IF EXISTS `spawn_group_formation`;
CREATE TABLE `spawn_group_formation` (
`SpawnGroupID` int(11) NOT NULL COMMENT 'Spawn group id',
`FormationType` tinyint(11) NOT NULL DEFAULT 0 COMMENT 'Formation shape 0..6',
`FormationSpread` float(11, 0) NOT NULL DEFAULT 0 COMMENT 'Distance between formation members',
`FormationOptions` int(11) NOT NULL DEFAULT 0 COMMENT 'Keep formation compact (bit 1)',
`MovementID` int(11) NOT NULL DEFAULT 0 COMMENT 'Id from waypoint_path path',
`MovementType` tinyint(11) NOT NULL COMMENT 'Same as creature table',
`Comment` varchar(255) NULL DEFAULT NULL,
PRIMARY KEY (`SpawnGroupID`)
);

DROP TABLE IF EXISTS `waypoint_path`;
CREATE TABLE `waypoint_path` (
`entry` mediumint(8) UNSIGNED NOT NULL COMMENT 'Creature entry',
`pathId` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Path ID for entry',
`point` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`position_x` float NOT NULL DEFAULT 0,
`position_y` float NOT NULL DEFAULT 0,
`position_z` float NOT NULL DEFAULT 0,
`orientation` float NOT NULL DEFAULT 0,
`waittime` int(10) UNSIGNED NOT NULL DEFAULT 0,
`script_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`comment` text NULL DEFAULT NULL,
PRIMARY KEY (`entry`, `pathId`, `point`)
);
2 changes: 1 addition & 1 deletion src/shared/revision_sql.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
#define REVISION_DB_REALMD "required_s2433_01_realmd_anticheat"
#define REVISION_DB_LOGS "required_s2433_01_logs_anticheat"
#define REVISION_DB_CHARACTERS "required_s2429_01_characters_raf"
#define REVISION_DB_MANGOS "required_s2438_01_mangos_spawn_groups"
#define REVISION_DB_MANGOS "required_s2439_01_mangos_groups_formation"
#endif // __REVISION_SQL_H__

0 comments on commit 803a198

Please sign in to comment.