Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core/AreaTrigger : Basic areaTrigger entities system #17997

Closed
wants to merge 11 commits into from
7 changes: 7 additions & 0 deletions sql/updates/auth/6.x/9999_99_99_99_auth.sql
@@ -0,0 +1,7 @@
DELETE FROM `rbac_permissions` WHERE `id` = 845;
INSERT INTO `rbac_permissions` (`id`, `name`) VALUES
( 845, 'Command : reload areatrigger templates' );

DELETE FROM `rbac_linked_permissions` WHERE `id` = 192 AND `linkedId` = 845;
INSERT INTO `rbac_linked_permissions` (`id`, `linkedId`) VALUES
( 192, 845 );
41 changes: 41 additions & 0 deletions sql/updates/world/6.x/9999_99_99_17997_world.sql
@@ -0,0 +1,41 @@
CREATE TABLE `areatrigger_template` (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop the table before creating it please (same in the create statement below)

`Id` int(10) unsigned NOT NULL,
`Flags` int(10) unsigned NOT NULL DEFAULT '0',
`MoveCurveId` int(10) unsigned NOT NULL DEFAULT '0',
`ScaleCurveId` int(10) unsigned NOT NULL DEFAULT '0',
`MorphCurveId` int(10) unsigned NOT NULL DEFAULT '0',
`FacingCurveId` int(10) unsigned NOT NULL DEFAULT '0',
`Data0` float NOT NULL DEFAULT '0',
`Data1` float NOT NULL DEFAULT '0',
`Data2` float NOT NULL DEFAULT '0',
`Data3` float NOT NULL DEFAULT '0',
`Data4` float NOT NULL DEFAULT '0',
`Data5` float NOT NULL DEFAULT '0',
`ScriptName` char(64) NOT NULL DEFAULT '',
`VerifiedBuild` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#17976 (comment) applies here as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't the comment about using MyISAM ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, i cant read, ignore it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UpperCamelCase style for columns since all new fields are named so
default uint32 type is int(10) unsigned
add a VerifiedBuild field for tables that have sniffable content


CREATE TABLE `areatrigger_template_polygon_vertices` (
`AreaTriggerId` int(10) unsigned NOT NULL,
`Idx` int(10) unsigned NOT NULL,
`VerticeX` float NOT NULL DEFAULT '0',
`VerticeY` float NOT NULL DEFAULT '0',
`VerticeTargetX` float NOT NULL DEFAULT '0',
`VerticeTargetY` float NOT NULL DEFAULT '0',
`VerifiedBuild` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`areatriggerId`,`index`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DELETE FROM `areatrigger_template` WHERE `id` IN (2472, 4424);
INSERT INTO `areatrigger_template`(`id`,`flags`,`moveCurveId`,`scaleCurveId`,`morphCurveId`,`facingCurveId`,`data0`,`data1`,`data2`,`data3`,`data4`,`data5`,`scriptName`) VALUES
(2472,65536,0,0,0,0,0,0,0,0,0,0,''),
(4424,131072,0,0,0,0,3,3,4,4,1,1,'');

DELETE FROM `areatrigger_template_polygon_vertices` WHERE `areatriggerId` = 2472;
INSERT INTO `areatrigger_template_polygon_vertices`(`areatriggerId`,`index`,`verticeX`,`verticeY`,`verticeTargetX`,`verticeTargetY`) VALUEs
(2472,0,-1,0.75,0,0),
(2472,1,-1,-0.75,0,0),
(2472,2,4,-0.75,0,0),
(2472,3,4,0.75,0,0);

2 changes: 2 additions & 0 deletions src/server/database/Database/Implementation/WorldDatabase.cpp
Expand Up @@ -91,4 +91,6 @@ void WorldDatabaseConnection::DoPrepareStatements()
PrepareStatement(WORLD_UPD_CREATURE_ZONE_AREA_DATA, "UPDATE creature SET zoneId = ?, areaId = ? WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(WORLD_UPD_GAMEOBJECT_ZONE_AREA_DATA, "UPDATE gameobject SET zoneId = ?, areaId = ? WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(WORLD_SEL_GUILD_REWARDS_REQ_ACHIEVEMENTS, "SELECT AchievementRequired FROM guild_rewards_req_achievements WHERE ItemID = ?", CONNECTION_SYNCH);
PrepareStatement(WORLD_SEL_AREATRIGGER_TEMPLATES, "SELECT Id, Flags, MoveCurveId, ScaleCurveId, MorphCurveId, FacingCurveId, Data0, Data1, Data2, Data3, Data4, Data5, ScriptName FROM `areatrigger_template`", CONNECTION_SYNCH);
PrepareStatement(WORLD_SEL_AREATRIGGER_POLYGON_VERTICES, "SELECT VerticeX, VerticeY, VerticeTargetX, VerticeTargetY FROM `areatrigger_template_polygon_vertices` WHERE `AreaTriggerId` = ? ORDER BY `Idx`", CONNECTION_SYNCH);
}
2 changes: 2 additions & 0 deletions src/server/database/Database/Implementation/WorldDatabase.h
Expand Up @@ -99,6 +99,8 @@ enum WorldDatabaseStatements
WORLD_UPD_CREATURE_ZONE_AREA_DATA,
WORLD_UPD_GAMEOBJECT_ZONE_AREA_DATA,
WORLD_SEL_GUILD_REWARDS_REQ_ACHIEVEMENTS,
WORLD_SEL_AREATRIGGER_TEMPLATES,
WORLD_SEL_AREATRIGGER_POLYGON_VERTICES,

MAX_WORLDDATABASE_STATEMENTS
};
Expand Down
1 change: 1 addition & 0 deletions src/server/game/Accounts/RBAC.h
Expand Up @@ -749,6 +749,7 @@ enum RBACPermissions
RBAC_PERM_COMMAND_RELOAD_CHARACTER_TEMPLATE = 842,
RBAC_PERM_COMMAND_RELOAD_QUEST_GREETING = 843,
RBAC_PERM_COMMAND_DEBUG_SEND_PLAYSCENE = 844,
RBAC_PERM_COMMAND_RELOAD_AREATRIGGER_TEMPLATE = 845,

// custom permissions 1000+
RBAC_PERM_MAX
Expand Down