mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
Updated both load and drop sqls for bots..added a 'deprecated' load for pre-pp blob conversion databases..the auto-conversion code will catch this if the server
is updated to a newer version. (Had a really nice load script coded..but, the supported version of MySQL doesn't support 'TEMPORARY' procedures, nor commit commands from 'PREPARE(d)' statements... :( )
This commit is contained in:
parent
6c5b569c29
commit
69c0405004
@ -1,5 +1,11 @@
|
|||||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
== 10/15/2014 ==
|
||||||
|
Uleat: Cleaned up load/drop bots sqls, added '../utils/sql/git/bots/deprecated' and '../deprecated/load_bots_old.sql' (use this file on pre-player blob conversion databases.)
|
||||||
|
Notes: I modifed the behavior of both load and drop bots to fail on the first operation if their modifications have been performed already.
|
||||||
|
'load_bots.sql' will explicitly add bot schema, while 'drop_bots.sql' will explicitly drop it. I also added a few lines to change
|
||||||
|
a few altered tables back to their original state - as of the date in the file.
|
||||||
|
|
||||||
== 10/11/2014 ==
|
== 10/11/2014 ==
|
||||||
demonstar55: Implement Raid MOTD for UF
|
demonstar55: Implement Raid MOTD for UF
|
||||||
Don't forget 2014_10_11_RaidMOTD.sql!
|
Don't forget 2014_10_11_RaidMOTD.sql!
|
||||||
|
|||||||
@ -1933,6 +1933,8 @@ bool Database::CheckDatabaseConversions() {
|
|||||||
printf("----------------------------------------------------------\n\n");
|
printf("----------------------------------------------------------\n\n");
|
||||||
printf(" Database currently has bot view/function linkage to obselete \n");
|
printf(" Database currently has bot view/function linkage to obselete \n");
|
||||||
printf(" table references and will now be converted...\n\n");
|
printf(" table references and will now be converted...\n\n");
|
||||||
|
printf(" It is recommended that you backup your database \n");
|
||||||
|
printf(" before continuing the automatic conversion process...\n\n");
|
||||||
printf("----------------------------------------------------------\n\n");
|
printf("----------------------------------------------------------\n\n");
|
||||||
std::cout << "Press ENTER to continue....." << std::endl << std::endl;
|
std::cout << "Press ENTER to continue....." << std::endl << std::endl;
|
||||||
std::cin.ignore(1);
|
std::cin.ignore(1);
|
||||||
@ -1943,6 +1945,7 @@ bool Database::CheckDatabaseConversions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (runbotsconvert == 1){
|
if (runbotsconvert == 1){
|
||||||
|
printf("Running bot views/function database conversion... \n");
|
||||||
|
|
||||||
/* Update view `vwbotcharactermobs` */
|
/* Update view `vwbotcharactermobs` */
|
||||||
rquery = StringFormat("DROP VIEW `vwbotcharactermobs`;");
|
rquery = StringFormat("DROP VIEW `vwbotcharactermobs`;");
|
||||||
|
|||||||
280
utils/sql/git/bots/deprecated/load_bots_old.sql
Normal file
280
utils/sql/git/bots/deprecated/load_bots_old.sql
Normal file
@ -0,0 +1,280 @@
|
|||||||
|
-- 'load_bots_old' sql script file
|
||||||
|
-- current as of 10/15/2014
|
||||||
|
--
|
||||||
|
-- Use this file on databases where the player profile blob has not been converted
|
||||||
|
--
|
||||||
|
-- Note: This file assumes a database free of bot remnants. If you have a prior
|
||||||
|
-- bot installation and wish to reload the default schema and entries, then
|
||||||
|
-- source 'drop_bots.sql' before sourcing this file.
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE `guild_members` DROP PRIMARY KEY;
|
||||||
|
ALTER TABLE `group_id` DROP PRIMARY KEY, ADD PRIMARY KEY USING BTREE(`groupid`, `charid`, `name`, `ismerc`);
|
||||||
|
|
||||||
|
UPDATE `spawn2` SET `enabled` = 1 WHERE `id` IN (59297,59298);
|
||||||
|
|
||||||
|
-- old command kept for reference (`commands` now only has 2 columns - `command` and `access`)
|
||||||
|
-- INSERT INTO `commands` VALUES ('bot', '0', 'Type \"#bot help\" to the see the list of available commands for bots.');
|
||||||
|
INSERT INTO `commands` VALUES ('bot', '0');
|
||||||
|
|
||||||
|
INSERT INTO `rule_values` VALUES
|
||||||
|
('1', 'Bots:BotAAExpansion', '8', 'The expansion through which bots will obtain AAs'),
|
||||||
|
('1', 'Bots:BotFinishBuffing', 'false', 'Allow for buffs to complete even if the bot caster is out of mana. Only affects buffing out of combat.'),
|
||||||
|
('1', 'Bots:BotGroupBuffing', 'false', 'Bots will cast single target buffs as group buffs, default is false for single. Does not make single target buffs work for MGB.'),
|
||||||
|
('1', 'Bots:BotManaRegen', '3.0', 'Adjust mana regen for bots, 1 is fast and higher numbers slow it down 3 is about the same as players.'),
|
||||||
|
('1', 'Bots:BotQuest', 'false', 'Optional quest method to manage bot spawn limits using the quest_globals name bot_spawn_limit, see: /bazaar/Aediles_Thrall.pl'),
|
||||||
|
('1', 'Bots:BotSpellQuest', 'false', 'Anita Thrall\'s (Anita_Thrall.pl) Bot Spell Scriber quests.'),
|
||||||
|
('1', 'Bots:CreateBotCount', '150', 'Number of bots that each account can create'),
|
||||||
|
('1', 'Bots:SpawnBotCount', '71', 'Number of bots a character can have spawned at one time, You + 71 bots is a 12 group raid');
|
||||||
|
|
||||||
|
CREATE TABLE `bots` (
|
||||||
|
`BotID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`BotOwnerCharacterID` INT(10) UNSIGNED NOT NULL,
|
||||||
|
`BotSpellsID` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`Name` VARCHAR(64) NOT NULL,
|
||||||
|
`LastName` VARCHAR(32) DEFAULT NULL,
|
||||||
|
`BotLevel` TINYINT(2) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`Race` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
|
`Class` TINYINT(2) NOT NULL DEFAULT '0',
|
||||||
|
`Gender` TINYINT(2) NOT NULL DEFAULT '0',
|
||||||
|
`Size` FLOAT NOT NULL DEFAULT '0',
|
||||||
|
`Face` INT(10) NOT NULL DEFAULT '1',
|
||||||
|
`LuclinHairStyle` INT(10) NOT NULL DEFAULT '1',
|
||||||
|
`LuclinHairColor` INT(10) NOT NULL DEFAULT '1',
|
||||||
|
`LuclinEyeColor` INT(10) NOT NULL DEFAULT '1',
|
||||||
|
`LuclinEyeColor2` INT(10) NOT NULL DEFAULT '1',
|
||||||
|
`LuclinBeardColor` INT(10) NOT NULL DEFAULT '1',
|
||||||
|
`LuclinBeard` INT(10) NOT NULL DEFAULT '0',
|
||||||
|
`DrakkinHeritage` INT(10) NOT NULL DEFAULT '0',
|
||||||
|
`DrakkinTattoo` INT(10) NOT NULL DEFAULT '0',
|
||||||
|
`DrakkinDetails` INT(10) NOT NULL DEFAULT '0',
|
||||||
|
`HP` INTEGER NOT NULL DEFAULT '0',
|
||||||
|
`Mana` INTEGER NOT NULL DEFAULT '0',
|
||||||
|
`MR` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
|
`CR` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
|
`DR` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
|
`FR` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
|
`PR` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
|
`Corrup` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
|
`AC` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
|
`STR` MEDIUMINT(8) NOT NULL DEFAULT '75',
|
||||||
|
`STA` MEDIUMINT(8) NOT NULL DEFAULT '75',
|
||||||
|
`DEX` MEDIUMINT(8) NOT NULL DEFAULT '75',
|
||||||
|
`AGI` MEDIUMINT(8) NOT NULL DEFAULT '75',
|
||||||
|
`_INT` MEDIUMINT(8) NOT NULL DEFAULT '80',
|
||||||
|
`WIS` MEDIUMINT(8) NOT NULL DEFAULT '75',
|
||||||
|
`CHA` MEDIUMINT(8) NOT NULL DEFAULT '75',
|
||||||
|
`ATK` MEDIUMINT(9) NOT NULL DEFAULT '0',
|
||||||
|
`BotCreateDate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`LastSpawnDate` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||||
|
`TotalPlayTime` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`LastZoneId` SMALLINT(6) NOT NULL DEFAULT '0',
|
||||||
|
`BotInspectMessage` VARCHAR(256) NOT NULL DEFAULT '',
|
||||||
|
PRIMARY KEY (`BotID`)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
CREATE TABLE `botstances` (
|
||||||
|
`BotID` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`StanceID` TINYINT UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`BotID`),
|
||||||
|
CONSTRAINT `FK_botstances_1` FOREIGN KEY (`BotID`) REFERENCES `bots` (`BotID`)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `bottimers` (
|
||||||
|
`BotID` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`TimerID` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`Value` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`BotID`),
|
||||||
|
CONSTRAINT `FK_bottimers_1` FOREIGN KEY (`BotID`) REFERENCES `bots` (`BotID`)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `botbuffs` (
|
||||||
|
`BotBuffId` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`BotId` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`SpellId` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`CasterLevel` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`DurationFormula` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`TicsRemaining` INT(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`PoisonCounters` INT(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`DiseaseCounters` INT(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`CurseCounters` INT(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`CorruptionCounters` INT(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`HitCount` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`MeleeRune` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`MagicRune` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`DeathSaveSuccessChance` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`CasterAARank` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`Persistent` TINYINT(1) NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`BotBuffId`),
|
||||||
|
KEY `FK_botbuff_1` (`BotId`),
|
||||||
|
CONSTRAINT `FK_botbuff_1` FOREIGN KEY (`BotId`) REFERENCES `bots` (`BotID`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
CREATE TABLE `botinventory` (
|
||||||
|
`BotInventoryID` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`BotID` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`SlotID` INTEGER SIGNED NOT NULL DEFAULT '0',
|
||||||
|
`ItemID` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`charges` TINYINT(3) UNSIGNED DEFAULT 0,
|
||||||
|
`color` INTEGER UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
`augslot1` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
`augslot2` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
`augslot3` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
`augslot4` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
`augslot5` MEDIUMINT(7) UNSIGNED DEFAULT 0,
|
||||||
|
`instnodrop` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
PRIMARY KEY (`BotInventoryID`),
|
||||||
|
KEY `FK_botinventory_1` (`BotID`),
|
||||||
|
CONSTRAINT `FK_botinventory_1` FOREIGN KEY (`BotID`) REFERENCES `bots` (`BotID`)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
CREATE TABLE `botpets` (
|
||||||
|
`BotPetsId` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`PetId` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`BotId` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`Name` VARCHAR(64) NULL,
|
||||||
|
`Mana` INTEGER NOT NULL DEFAULT '0',
|
||||||
|
`HitPoints` INTEGER NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`BotPetsId`),
|
||||||
|
KEY `FK_botpets_1` (`BotId`),
|
||||||
|
CONSTRAINT `FK_botpets_1` FOREIGN KEY (`BotId`) REFERENCES `bots` (`BotID`),
|
||||||
|
CONSTRAINT `U_botpets_1` UNIQUE (`BotId`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
CREATE TABLE `botpetbuffs` (
|
||||||
|
`BotPetBuffId` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`BotPetsId` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`SpellId` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`CasterLevel` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`Duration` INT(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`BotPetBuffId`),
|
||||||
|
KEY `FK_botpetbuffs_1` (`BotPetsId`),
|
||||||
|
CONSTRAINT `FK_botpetbuffs_1` FOREIGN KEY (`BotPetsId`) REFERENCES `botpets` (`BotPetsID`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
CREATE TABLE `botpetinventory` (
|
||||||
|
`BotPetInventoryId` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`BotPetsId` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`ItemId` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`BotPetInventoryId`),
|
||||||
|
KEY `FK_botpetinventory_1` (`BotPetsId`),
|
||||||
|
CONSTRAINT `FK_botpetinventory_1` FOREIGN KEY (`BotPetsId`) REFERENCES `botpets` (`BotPetsID`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
CREATE TABLE `botgroup` (
|
||||||
|
`BotGroupId` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`BotGroupLeaderBotId` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`BotGroupName` VARCHAR(64) NOT NULL,
|
||||||
|
PRIMARY KEY (`BotGroupId`),
|
||||||
|
KEY `FK_botgroup_1` (`BotGroupLeaderBotId`),
|
||||||
|
CONSTRAINT `FK_botgroup_1` FOREIGN KEY (`BotGroupLeaderBotId`) REFERENCES `bots` (`BotID`)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
CREATE TABLE `botgroupmembers` (
|
||||||
|
`BotGroupMemberId` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`BotGroupId` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`BotId` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`BotGroupMemberId`),
|
||||||
|
KEY `FK_botgroupmembers_1` (`BotGroupId`),
|
||||||
|
CONSTRAINT `FK_botgroupmembers_1` FOREIGN KEY (`BotGroupId`) REFERENCES `botgroup` (`BotGroupId`),
|
||||||
|
KEY `FK_botgroupmembers_2` (`BotId`),
|
||||||
|
CONSTRAINT `FK_botgroupmembers_2` FOREIGN KEY (`BotId`) REFERENCES `bots` (`BotID`)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
CREATE TABLE `botguildmembers` (
|
||||||
|
`char_id` INT(11) NOT NULL DEFAULT '0',
|
||||||
|
`guild_id` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`rank` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`tribute_enable` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`total_tribute` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`last_tribute` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`banker` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`public_note` TEXT NULL,
|
||||||
|
`alt` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`char_id`)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
DELIMITER //
|
||||||
|
|
||||||
|
CREATE FUNCTION `GetMobType` (mobname VARCHAR(64)) RETURNS CHAR(1)
|
||||||
|
BEGIN
|
||||||
|
DECLARE Result CHAR(1);
|
||||||
|
|
||||||
|
SET Result = NULL;
|
||||||
|
|
||||||
|
IF (SELECT COUNT(*) FROM `character_` WHERE `name` = mobname) > 0 THEN
|
||||||
|
SET Result = 'C';
|
||||||
|
ELSEIF (SELECT COUNT(*) FROM `bots` WHERE `Name` = mobname) > 0 THEN
|
||||||
|
SET Result = 'B';
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
RETURN Result;
|
||||||
|
END//
|
||||||
|
|
||||||
|
DELIMITER ;
|
||||||
|
|
||||||
|
CREATE VIEW `vwbotcharactermobs` AS
|
||||||
|
SELECT _utf8'C' AS mobtype,
|
||||||
|
c.`id`,
|
||||||
|
c.`name`,
|
||||||
|
c.`class`,
|
||||||
|
c.`level`,
|
||||||
|
c.`timelaston`,
|
||||||
|
c.`zoneid`
|
||||||
|
FROM `character_` AS c
|
||||||
|
UNION ALL
|
||||||
|
SELECT _utf8'B' AS mobtype,
|
||||||
|
b.`BotID` AS id,
|
||||||
|
b.`Name` AS name,
|
||||||
|
b.`Class` AS class,
|
||||||
|
b.`BotLevel` AS level,
|
||||||
|
0 AS timelaston,
|
||||||
|
0 AS zoneid
|
||||||
|
FROM bots AS b;
|
||||||
|
|
||||||
|
CREATE VIEW `vwgroups` AS
|
||||||
|
SELECT g.`groupid` AS groupid,
|
||||||
|
GetMobType(g.`name`) AS mobtype,
|
||||||
|
g.`name` AS name,
|
||||||
|
g.`charid` AS mobid,
|
||||||
|
IFNULL(c.`level`, b.`BotLevel`) AS level
|
||||||
|
FROM `group_id` AS g
|
||||||
|
LEFT JOIN `character_` AS c ON g.`name` = c.`name`
|
||||||
|
LEFT JOIN `bots` AS b ON g.`name` = b.`Name`;
|
||||||
|
|
||||||
|
CREATE VIEW `vwbotgroups` AS
|
||||||
|
SELECT g.`BotGroupId`,
|
||||||
|
g.`BotGroupName`,
|
||||||
|
g.`BotGroupLeaderBotId`,
|
||||||
|
b.`Name` AS BotGroupLeaderName,
|
||||||
|
b.`BotOwnerCharacterId`,
|
||||||
|
c.`name` AS BotOwnerCharacterName
|
||||||
|
FROM `botgroup` AS g
|
||||||
|
JOIN `bots` AS b ON g.`BotGroupLeaderBotId` = b.`BotID`
|
||||||
|
JOIN `character_` AS c ON b.`BotOwnerCharacterID` = c.`id`
|
||||||
|
ORDER BY b.`BotOwnerCharacterId`, g.`BotGroupName`;
|
||||||
|
|
||||||
|
CREATE VIEW `vwguildmembers` AS
|
||||||
|
SELECT 'C' AS mobtype,
|
||||||
|
cm.`char_id`,
|
||||||
|
cm.`guild_id`,
|
||||||
|
cm.`rank`,
|
||||||
|
cm.`tribute_enable`,
|
||||||
|
cm.`total_tribute`,
|
||||||
|
cm.`last_tribute`,
|
||||||
|
cm.`banker`,
|
||||||
|
cm.`public_note`,
|
||||||
|
cm.`alt`
|
||||||
|
FROM `guild_members` AS cm
|
||||||
|
UNION ALL
|
||||||
|
SELECT 'B' AS mobtype,
|
||||||
|
bm.`char_id`,
|
||||||
|
bm.`guild_id`,
|
||||||
|
bm.`rank`,
|
||||||
|
bm.`tribute_enable`,
|
||||||
|
bm.`total_tribute`,
|
||||||
|
bm.`last_tribute`,
|
||||||
|
bm.`banker`,
|
||||||
|
bm.`public_note`,
|
||||||
|
bm.`alt`
|
||||||
|
FROM `botguildmembers` AS bm;
|
||||||
@ -1,21 +1,37 @@
|
|||||||
DROP TABLE IF EXISTS `botbuffs`;
|
-- 'drop_bots' sql script file
|
||||||
|
-- current as of 10/15/2014
|
||||||
|
--
|
||||||
|
-- Note: This file will revert all changes made by either 'load_bots' sql file.
|
||||||
|
-- There may still be remnants of bot activity in tables `guild_members` and
|
||||||
|
-- `group_id`. If these entries are causing issues, you may need to manually
|
||||||
|
-- remove them.
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE `guild_members` ADD PRIMARY KEY (`char_id`);
|
||||||
|
ALTER TABLE `group_id` DROP PRIMARY KEY, ADD PRIMARY KEY (`groupid`, `charid`, `ismerc`);
|
||||||
|
|
||||||
|
UPDATE `spawn2` SET `enabled` = 0 WHERE `id` IN (59297,59298);
|
||||||
|
|
||||||
|
DELETE FROM `commands` WHERE `command` = 'bot';
|
||||||
|
DELETE FROM `rule_values` WHERE `rule_name` LIKE 'Bots%';
|
||||||
|
|
||||||
|
DROP VIEW IF EXISTS `vwbotcharactermobs`;
|
||||||
|
DROP VIEW IF EXISTS `vwbotgroups`;
|
||||||
|
DROP VIEW IF EXISTS `vwgroups`;
|
||||||
|
DROP VIEW IF EXISTS `vwguildmembers`;
|
||||||
|
|
||||||
|
DROP FUNCTION IF EXISTS `GetMobType`;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `botguildmembers`;
|
||||||
|
DROP TABLE IF EXISTS `botgroupmembers`;
|
||||||
|
-- this table is not a part of 'load_bots.sql'
|
||||||
|
DROP TABLE IF EXISTS `botgroups`;
|
||||||
|
DROP TABLE IF EXISTS `botgroup`;
|
||||||
DROP TABLE IF EXISTS `botpetinventory`;
|
DROP TABLE IF EXISTS `botpetinventory`;
|
||||||
DROP TABLE IF EXISTS `botpetbuffs`;
|
DROP TABLE IF EXISTS `botpetbuffs`;
|
||||||
DROP TABLE IF EXISTS `botpets`;
|
DROP TABLE IF EXISTS `botpets`;
|
||||||
DROP TABLE IF EXISTS `botgroupmembers`;
|
|
||||||
DROP TABLE IF EXISTS `botgroup`;
|
|
||||||
DROP TABLE IF EXISTS `botgroups`;
|
|
||||||
DROP TABLE IF EXISTS `botinventory`;
|
DROP TABLE IF EXISTS `botinventory`;
|
||||||
DROP TABLE IF EXISTS `botguildmembers`;
|
DROP TABLE IF EXISTS `botbuffs`;
|
||||||
DROP TABLE IF EXISTS `botstances`;
|
|
||||||
DROP TABLE IF EXISTS `bottimers`;
|
DROP TABLE IF EXISTS `bottimers`;
|
||||||
|
DROP TABLE IF EXISTS `botstances`;
|
||||||
DROP TABLE IF EXISTS `bots`;
|
DROP TABLE IF EXISTS `bots`;
|
||||||
DROP VIEW IF EXISTS `vwGuildMembers`;
|
|
||||||
DROP VIEW IF EXISTS `vwBotCharacterMobs`;
|
|
||||||
DROP VIEW IF EXISTS `vwBotGroups`;
|
|
||||||
|
|
||||||
delete from rule_values where rule_name like 'Bots%' and ruleset_id = 1;
|
|
||||||
|
|
||||||
delete from commands where command = 'bot';
|
|
||||||
|
|
||||||
update spawn2 set enabled = 0 where id in (59297,59298);
|
|
||||||
@ -1,307 +1,280 @@
|
|||||||
-- This is pretty much a straight copy of the original files with fixes applied.
|
-- 'load_bots' sql script file
|
||||||
-- HeidiSQL does not like sub-directory references, so this should now run from there.
|
-- current as of 10/15/2014
|
||||||
-- The 'headers' are left in place for reference only.
|
--
|
||||||
|
-- Use this file on databases where the player profile blob has been converted.
|
||||||
|
--
|
||||||
|
-- Note: This file assumes a database free of bot remnants. If you have a prior
|
||||||
|
-- bot installation and wish to reload the default schema and entries, then
|
||||||
|
-- source 'drop_bots.sql' before sourcing this file.
|
||||||
|
|
||||||
-- FILE:
|
|
||||||
-- source player_tables/botguildmembers.sql;
|
|
||||||
CREATE TABLE IF NOT EXISTS `botguildmembers` (
|
|
||||||
`char_id` int(11) NOT NULL default '0',
|
|
||||||
`guild_id` mediumint(8) unsigned NOT NULL default '0',
|
|
||||||
`rank` tinyint(3) unsigned NOT NULL default '0',
|
|
||||||
`tribute_enable` tinyint(3) unsigned NOT NULL default '0',
|
|
||||||
`total_tribute` int(10) unsigned NOT NULL default '0',
|
|
||||||
`last_tribute` int(10) unsigned NOT NULL default '0',
|
|
||||||
`banker` tinyint(3) unsigned NOT NULL default '0',
|
|
||||||
`public_note` text NULL,
|
|
||||||
`alt` tinyint(3) unsigned NOT NULL default '0',
|
|
||||||
PRIMARY KEY (`char_id`)
|
|
||||||
) ENGINE=InnoDB;
|
|
||||||
|
|
||||||
-- FILE:
|
ALTER TABLE `guild_members` DROP PRIMARY KEY;
|
||||||
-- source player_tables/bots.sql;
|
ALTER TABLE `group_id` DROP PRIMARY KEY, ADD PRIMARY KEY USING BTREE(`groupid`, `charid`, `name`, `ismerc`);
|
||||||
update spawn2 set enabled = 1 where id in (59297,59298);
|
|
||||||
|
|
||||||
INSERT INTO rule_values VALUES ('1', 'Bots:BotManaRegen', '3.0', 'Adjust mana regen for bots, 1 is fast and higher numbers slow it down 3 is about the same as players.');
|
UPDATE `spawn2` SET `enabled` = 1 WHERE `id` IN (59297,59298);
|
||||||
INSERT INTO rule_values VALUES ('1', 'Bots:BotFinishBuffing', 'false', 'Allow for buffs to complete even if the bot caster is out of mana. Only affects buffing out of combat.');
|
|
||||||
INSERT INTO rule_values VALUES ('1', 'Bots:CreateBotCount', '150', 'Number of bots that each account can create');
|
|
||||||
INSERT INTO rule_values VALUES ('1', 'Bots:SpawnBotCount', '71', 'Number of bots a character can have spawned at one time, You + 71 bots is a 12 group raid');
|
|
||||||
INSERT INTO rule_values VALUES ('1', 'Bots:BotQuest', 'false', 'Optional quest method to manage bot spawn limits using the quest_globals name bot_spawn_limit, see: /bazaar/Aediles_Thrall.pl');
|
|
||||||
INSERT INTO rule_values VALUES ('1', 'Bots:BotGroupBuffing', 'false', 'Bots will cast single target buffs as group buffs, default is false for single. Does not make single target buffs work for MGB.');
|
|
||||||
INSERT INTO rule_values VALUES ('1', 'Bots:BotSpellQuest', 'false', 'Anita Thrall\'s (Anita_Thrall.pl) Bot Spell Scriber quests.');
|
|
||||||
|
|
||||||
-- this is a hack fix to maintain the original file process
|
-- old command kept for reference (`commands` now only has 2 columns - `command` and `access`)
|
||||||
delete from rule_values where rule_name like 'Bots%' and ruleset_id = 1;
|
|
||||||
INSERT INTO rule_values VALUES ('1', 'Bots:BotAAExpansion', '8', 'The expansion through which bots will obtain AAs');
|
|
||||||
|
|
||||||
-- field count has changed
|
|
||||||
-- INSERT INTO `commands` VALUES ('bot', '0', 'Type \"#bot help\" to the see the list of available commands for bots.');
|
-- INSERT INTO `commands` VALUES ('bot', '0', 'Type \"#bot help\" to the see the list of available commands for bots.');
|
||||||
INSERT INTO `commands` VALUES ('bot', '0');
|
INSERT INTO `commands` VALUES ('bot', '0');
|
||||||
|
|
||||||
CREATE TABLE bots (
|
INSERT INTO `rule_values` VALUES
|
||||||
`BotID` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
('1', 'Bots:BotAAExpansion', '8', 'The expansion through which bots will obtain AAs'),
|
||||||
`BotOwnerCharacterID` int(10) unsigned NOT NULL,
|
('1', 'Bots:BotFinishBuffing', 'false', 'Allow for buffs to complete even if the bot caster is out of mana. Only affects buffing out of combat.'),
|
||||||
`BotSpellsID` int(10) unsigned NOT NULL DEFAULT '0',
|
('1', 'Bots:BotGroupBuffing', 'false', 'Bots will cast single target buffs as group buffs, default is false for single. Does not make single target buffs work for MGB.'),
|
||||||
`Name` varchar(64) NOT NULL,
|
('1', 'Bots:BotManaRegen', '3.0', 'Adjust mana regen for bots, 1 is fast and higher numbers slow it down 3 is about the same as players.'),
|
||||||
`LastName` varchar(32) DEFAULT NULL,
|
('1', 'Bots:BotQuest', 'false', 'Optional quest method to manage bot spawn limits using the quest_globals name bot_spawn_limit, see: /bazaar/Aediles_Thrall.pl'),
|
||||||
`BotLevel` tinyint(2) unsigned NOT NULL DEFAULT '0',
|
('1', 'Bots:BotSpellQuest', 'false', 'Anita Thrall\'s (Anita_Thrall.pl) Bot Spell Scriber quests.'),
|
||||||
`Race` smallint(5) NOT NULL DEFAULT '0',
|
('1', 'Bots:CreateBotCount', '150', 'Number of bots that each account can create'),
|
||||||
`Class` tinyint(2) NOT NULL DEFAULT '0',
|
('1', 'Bots:SpawnBotCount', '71', 'Number of bots a character can have spawned at one time, You + 71 bots is a 12 group raid');
|
||||||
`Gender` tinyint(2) NOT NULL DEFAULT '0',
|
|
||||||
`Size` float NOT NULL DEFAULT '0',
|
CREATE TABLE `bots` (
|
||||||
`Face` int(10) NOT NULL DEFAULT '1',
|
`BotID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
`LuclinHairStyle` int(10) NOT NULL DEFAULT '1',
|
`BotOwnerCharacterID` INT(10) UNSIGNED NOT NULL,
|
||||||
`LuclinHairColor` int(10) NOT NULL DEFAULT '1',
|
`BotSpellsID` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
`LuclinEyeColor` int(10) NOT NULL DEFAULT '1',
|
`Name` VARCHAR(64) NOT NULL,
|
||||||
`LuclinEyeColor2` int(10) NOT NULL DEFAULT '1',
|
`LastName` VARCHAR(32) DEFAULT NULL,
|
||||||
`LuclinBeardColor` int(10) NOT NULL DEFAULT '1',
|
`BotLevel` TINYINT(2) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
`LuclinBeard` int(10) NOT NULL DEFAULT '0',
|
`Race` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
`DrakkinHeritage` int(10) NOT NULL DEFAULT '0',
|
`Class` TINYINT(2) NOT NULL DEFAULT '0',
|
||||||
`DrakkinTattoo` int(10) NOT NULL DEFAULT '0',
|
`Gender` TINYINT(2) NOT NULL DEFAULT '0',
|
||||||
`DrakkinDetails` int(10) NOT NULL DEFAULT '0',
|
`Size` FLOAT NOT NULL DEFAULT '0',
|
||||||
`HP` INTEGER NOT NULL DEFAULT '0',
|
`Face` INT(10) NOT NULL DEFAULT '1',
|
||||||
`Mana` INTEGER NOT NULL DEFAULT '0',
|
`LuclinHairStyle` INT(10) NOT NULL DEFAULT '1',
|
||||||
`MR` smallint(5) NOT NULL DEFAULT '0',
|
`LuclinHairColor` INT(10) NOT NULL DEFAULT '1',
|
||||||
`CR` smallint(5) NOT NULL DEFAULT '0',
|
`LuclinEyeColor` INT(10) NOT NULL DEFAULT '1',
|
||||||
`DR` smallint(5) NOT NULL DEFAULT '0',
|
`LuclinEyeColor2` INT(10) NOT NULL DEFAULT '1',
|
||||||
`FR` smallint(5) NOT NULL DEFAULT '0',
|
`LuclinBeardColor` INT(10) NOT NULL DEFAULT '1',
|
||||||
`PR` smallint(5) NOT NULL DEFAULT '0',
|
`LuclinBeard` INT(10) NOT NULL DEFAULT '0',
|
||||||
`Corrup` SMALLINT(5) NOT NULL DEFAULT '0',
|
`DrakkinHeritage` INT(10) NOT NULL DEFAULT '0',
|
||||||
`AC` smallint(5) NOT NULL DEFAULT '0',
|
`DrakkinTattoo` INT(10) NOT NULL DEFAULT '0',
|
||||||
`STR` mediumint(8) NOT NULL DEFAULT '75',
|
`DrakkinDetails` INT(10) NOT NULL DEFAULT '0',
|
||||||
`STA` mediumint(8) NOT NULL DEFAULT '75',
|
`HP` INTEGER NOT NULL DEFAULT '0',
|
||||||
`DEX` mediumint(8) NOT NULL DEFAULT '75',
|
`Mana` INTEGER NOT NULL DEFAULT '0',
|
||||||
`AGI` mediumint(8) NOT NULL DEFAULT '75',
|
`MR` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
`_INT` mediumint(8) NOT NULL DEFAULT '80',
|
`CR` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
`WIS` mediumint(8) NOT NULL DEFAULT '75',
|
`DR` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
`CHA` mediumint(8) NOT NULL DEFAULT '75',
|
`FR` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
`ATK` mediumint(9) NOT NULL DEFAULT '0',
|
`PR` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
`BotCreateDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
`Corrup` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
`LastSpawnDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
`AC` SMALLINT(5) NOT NULL DEFAULT '0',
|
||||||
`TotalPlayTime` int(10) unsigned NOT NULL DEFAULT '0',
|
`STR` MEDIUMINT(8) NOT NULL DEFAULT '75',
|
||||||
`LastZoneId` smallint(6) NOT NULL DEFAULT '0',
|
`STA` MEDIUMINT(8) NOT NULL DEFAULT '75',
|
||||||
`BotInspectMessage` VARCHAR(256) NOT NULL DEFAULT '',
|
`DEX` MEDIUMINT(8) NOT NULL DEFAULT '75',
|
||||||
PRIMARY KEY (`BotID`)
|
`AGI` MEDIUMINT(8) NOT NULL DEFAULT '75',
|
||||||
|
`_INT` MEDIUMINT(8) NOT NULL DEFAULT '80',
|
||||||
|
`WIS` MEDIUMINT(8) NOT NULL DEFAULT '75',
|
||||||
|
`CHA` MEDIUMINT(8) NOT NULL DEFAULT '75',
|
||||||
|
`ATK` MEDIUMINT(9) NOT NULL DEFAULT '0',
|
||||||
|
`BotCreateDate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`LastSpawnDate` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||||
|
`TotalPlayTime` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`LastZoneId` SMALLINT(6) NOT NULL DEFAULT '0',
|
||||||
|
`BotInspectMessage` VARCHAR(256) NOT NULL DEFAULT '',
|
||||||
|
PRIMARY KEY (`BotID`)
|
||||||
) ENGINE=InnoDB;
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
ALTER TABLE `group_id` DROP PRIMARY KEY, ADD PRIMARY KEY USING BTREE(`groupid`, `charid`, `name`);
|
CREATE TABLE `botstances` (
|
||||||
ALTER TABLE `guild_members` DROP PRIMARY KEY;
|
`BotID` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`StanceID` TINYINT UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`BotID`),
|
||||||
|
CONSTRAINT `FK_botstances_1` FOREIGN KEY (`BotID`) REFERENCES `bots` (`BotID`)
|
||||||
|
);
|
||||||
|
|
||||||
DROP VIEW IF EXISTS `vwGuildMembers`;
|
CREATE TABLE `bottimers` (
|
||||||
CREATE VIEW `vwGuildMembers` AS
|
`BotID` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
select 'C' as mobtype,
|
`TimerID` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
cm.char_id,
|
`Value` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
cm.guild_id,
|
PRIMARY KEY (`BotID`),
|
||||||
cm.rank,
|
CONSTRAINT `FK_bottimers_1` FOREIGN KEY (`BotID`) REFERENCES `bots` (`BotID`)
|
||||||
cm.tribute_enable,
|
);
|
||||||
cm.total_tribute,
|
|
||||||
cm.last_tribute,
|
|
||||||
cm.banker,
|
|
||||||
cm.public_note,
|
|
||||||
cm.alt
|
|
||||||
from guild_members as cm
|
|
||||||
union all
|
|
||||||
select 'B' as mobtype,
|
|
||||||
bm.char_id,
|
|
||||||
bm.guild_id,
|
|
||||||
bm.rank,
|
|
||||||
bm.tribute_enable,
|
|
||||||
bm.total_tribute,
|
|
||||||
bm.last_tribute,
|
|
||||||
bm.banker,
|
|
||||||
bm.public_note,
|
|
||||||
bm.alt
|
|
||||||
from botguildmembers as bm;
|
|
||||||
|
|
||||||
DROP VIEW IF EXISTS `vwBotCharacterMobs`;
|
CREATE TABLE `botbuffs` (
|
||||||
CREATE VIEW `vwBotCharacterMobs` AS
|
`BotBuffId` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
select 'C' as mobtype,
|
`BotId` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
c.id,
|
`SpellId` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
c.name,
|
`CasterLevel` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
c.class,
|
`DurationFormula` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
c.level,
|
`TicsRemaining` INT(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
c.timelaston,
|
`PoisonCounters` INT(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
c.zoneid
|
`DiseaseCounters` INT(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
from character_ as c
|
`CurseCounters` INT(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
union all
|
`CorruptionCounters` INT(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
select 'B' as mobtype,
|
`HitCount` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
b.BotID as id,
|
`MeleeRune` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
b.Name as name,
|
`MagicRune` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
b.Class as class,
|
`DeathSaveSuccessChance` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
b.BotLevel as level,
|
`CasterAARank` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
0 as timelaston,
|
`Persistent` TINYINT(1) NOT NULL DEFAULT '0',
|
||||||
0 as zoneid
|
PRIMARY KEY (`BotBuffId`),
|
||||||
from bots as b;
|
KEY `FK_botbuff_1` (`BotId`),
|
||||||
|
CONSTRAINT `FK_botbuff_1` FOREIGN KEY (`BotId`) REFERENCES `bots` (`BotID`)
|
||||||
-- FILE:
|
|
||||||
-- source player_tables/botpetstatepersists.sql;
|
|
||||||
DROP TABLE IF EXISTS `botpetinventory`;
|
|
||||||
DROP TABLE IF EXISTS `botpetbuffs`;
|
|
||||||
DROP TABLE IF EXISTS `botpets`;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `botpets` (
|
|
||||||
`BotPetsId` integer unsigned NOT NULL AUTO_INCREMENT,
|
|
||||||
`PetId` integer unsigned NOT NULL DEFAULT '0',
|
|
||||||
`BotId` integer unsigned NOT NULL DEFAULT '0',
|
|
||||||
`Name` varchar(64) NULL,
|
|
||||||
`Mana` integer NOT NULL DEFAULT '0',
|
|
||||||
`HitPoints` integer NOT NULL DEFAULT '0',
|
|
||||||
PRIMARY KEY (`BotPetsId`),
|
|
||||||
KEY `FK_botpets_1` (`BotId`),
|
|
||||||
CONSTRAINT `FK_botpets_1` FOREIGN KEY (`BotId`) REFERENCES `bots` (`BotID`),
|
|
||||||
CONSTRAINT `U_botpets_1` UNIQUE (`BotId`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
|
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `botpetbuffs` (
|
CREATE TABLE `botinventory` (
|
||||||
`BotPetBuffId` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`BotInventoryID` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
`BotPetsId` int(10) unsigned NOT NULL DEFAULT '0',
|
`BotID` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
`SpellId` int(10) unsigned NOT NULL DEFAULT '0',
|
`SlotID` INTEGER SIGNED NOT NULL DEFAULT '0',
|
||||||
`CasterLevel` int(10) unsigned NOT NULL DEFAULT '0',
|
`ItemID` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
`Duration` int(11) unsigned NOT NULL DEFAULT '0',
|
`charges` TINYINT(3) UNSIGNED DEFAULT 0,
|
||||||
PRIMARY KEY (`BotPetBuffId`),
|
`color` INTEGER UNSIGNED NOT NULL DEFAULT 0,
|
||||||
KEY `FK_botpetbuffs_1` (`BotPetsId`),
|
`augslot1` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
CONSTRAINT `FK_botpetbuffs_1` FOREIGN KEY (`BotPetsId`) REFERENCES `botpets` (`BotPetsID`)
|
`augslot2` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
|
`augslot3` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
`augslot4` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
CREATE TABLE IF NOT EXISTS `botpetinventory` (
|
`augslot5` MEDIUMINT(7) UNSIGNED DEFAULT 0,
|
||||||
`BotPetInventoryId` integer unsigned NOT NULL AUTO_INCREMENT,
|
`instnodrop` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
`BotPetsId` integer unsigned NOT NULL DEFAULT '0',
|
PRIMARY KEY (`BotInventoryID`),
|
||||||
`ItemId` integer unsigned NOT NULL DEFAULT '0',
|
KEY `FK_botinventory_1` (`BotID`),
|
||||||
PRIMARY KEY (`BotPetInventoryId`),
|
CONSTRAINT `FK_botinventory_1` FOREIGN KEY (`BotID`) REFERENCES `bots` (`BotID`)
|
||||||
KEY `FK_botpetinventory_1` (`BotPetsId`),
|
|
||||||
CONSTRAINT `FK_botpetinventory_1` FOREIGN KEY (`BotPetsId`) REFERENCES `botpets` (`BotPetsID`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
|
|
||||||
|
|
||||||
-- FILE:
|
|
||||||
-- source player_tables/botinventory.sql;
|
|
||||||
CREATE TABLE IF NOT EXISTS botinventory (
|
|
||||||
BotInventoryID integer unsigned NOT NULL auto_increment,
|
|
||||||
BotID integer unsigned NOT NULL DEFAULT '0',
|
|
||||||
SlotID integer signed NOT NULL DEFAULT '0',
|
|
||||||
ItemID integer unsigned NOT NULL DEFAULT '0',
|
|
||||||
charges tinyint(3) unsigned DEFAULT 0,
|
|
||||||
color integer unsigned NOT NULL DEFAULT 0,
|
|
||||||
augslot1 mediumint(7) unsigned NOT NULL DEFAULT 0,
|
|
||||||
augslot2 mediumint(7) unsigned NOT NULL DEFAULT 0,
|
|
||||||
augslot3 mediumint(7) unsigned NOT NULL DEFAULT 0,
|
|
||||||
augslot4 mediumint(7) unsigned NOT NULL DEFAULT 0,
|
|
||||||
augslot5 mediumint(7) unsigned DEFAULT 0,
|
|
||||||
instnodrop tinyint(1) unsigned NOT NULL DEFAULT 0,
|
|
||||||
PRIMARY KEY (BotInventoryID),
|
|
||||||
KEY FK_botinventory_1 (BotID),
|
|
||||||
CONSTRAINT FK_botinventory_1 FOREIGN KEY (BotID) REFERENCES bots (BotID)
|
|
||||||
) ENGINE=InnoDB;
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
-- FILE:
|
CREATE TABLE `botpets` (
|
||||||
-- source player_tables/botbuffs.sql;
|
`BotPetsId` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
DROP TABLE IF EXISTS `botbuffs`;
|
`PetId` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
CREATE TABLE `botbuffs` (
|
`BotId` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
`BotBuffId` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`Name` VARCHAR(64) NULL,
|
||||||
`BotId` int(10) unsigned NOT NULL DEFAULT '0',
|
`Mana` INTEGER NOT NULL DEFAULT '0',
|
||||||
`SpellId` int(10) unsigned NOT NULL DEFAULT '0',
|
`HitPoints` INTEGER NOT NULL DEFAULT '0',
|
||||||
`CasterLevel` int(10) unsigned NOT NULL DEFAULT '0',
|
PRIMARY KEY (`BotPetsId`),
|
||||||
`DurationFormula` int(10) unsigned NOT NULL DEFAULT '0',
|
KEY `FK_botpets_1` (`BotId`),
|
||||||
`TicsRemaining` int(11) unsigned NOT NULL DEFAULT '0',
|
CONSTRAINT `FK_botpets_1` FOREIGN KEY (`BotId`) REFERENCES `bots` (`BotID`),
|
||||||
`PoisonCounters` int(11) unsigned NOT NULL DEFAULT '0',
|
CONSTRAINT `U_botpets_1` UNIQUE (`BotId`)
|
||||||
`DiseaseCounters` int(11) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`CurseCounters` int(11) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`CorruptionCounters` INT(11) UNSIGNED NOT NULL DEFAULT '0',
|
|
||||||
`HitCount` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`MeleeRune` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`MagicRune` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`DeathSaveSuccessChance` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`CasterAARank` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`Persistent` tinyint(1) NOT NULL DEFAULT '0',
|
|
||||||
PRIMARY KEY (`BotBuffId`),
|
|
||||||
KEY `FK_botbuff_1` (`BotId`),
|
|
||||||
CONSTRAINT `FK_botbuff_1` FOREIGN KEY (`BotId`) REFERENCES `bots` (`BotID`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
|
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
-- FILE:
|
CREATE TABLE `botpetbuffs` (
|
||||||
-- source player_tables/botadventuring.sql;
|
`BotPetBuffId` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
DELIMITER $$
|
`BotPetsId` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`SpellId` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`CasterLevel` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`Duration` INT(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`BotPetBuffId`),
|
||||||
|
KEY `FK_botpetbuffs_1` (`BotPetsId`),
|
||||||
|
CONSTRAINT `FK_botpetbuffs_1` FOREIGN KEY (`BotPetsId`) REFERENCES `botpets` (`BotPetsID`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
CREATE TABLE `botpetinventory` (
|
||||||
|
`BotPetInventoryId` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`BotPetsId` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`ItemId` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`BotPetInventoryId`),
|
||||||
|
KEY `FK_botpetinventory_1` (`BotPetsId`),
|
||||||
|
CONSTRAINT `FK_botpetinventory_1` FOREIGN KEY (`BotPetsId`) REFERENCES `botpets` (`BotPetsID`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
CREATE TABLE `botgroup` (
|
||||||
|
`BotGroupId` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`BotGroupLeaderBotId` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`BotGroupName` VARCHAR(64) NOT NULL,
|
||||||
|
PRIMARY KEY (`BotGroupId`),
|
||||||
|
KEY `FK_botgroup_1` (`BotGroupLeaderBotId`),
|
||||||
|
CONSTRAINT `FK_botgroup_1` FOREIGN KEY (`BotGroupLeaderBotId`) REFERENCES `bots` (`BotID`)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
CREATE TABLE `botgroupmembers` (
|
||||||
|
`BotGroupMemberId` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`BotGroupId` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`BotId` INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`BotGroupMemberId`),
|
||||||
|
KEY `FK_botgroupmembers_1` (`BotGroupId`),
|
||||||
|
CONSTRAINT `FK_botgroupmembers_1` FOREIGN KEY (`BotGroupId`) REFERENCES `botgroup` (`BotGroupId`),
|
||||||
|
KEY `FK_botgroupmembers_2` (`BotId`),
|
||||||
|
CONSTRAINT `FK_botgroupmembers_2` FOREIGN KEY (`BotId`) REFERENCES `bots` (`BotID`)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
CREATE TABLE `botguildmembers` (
|
||||||
|
`char_id` INT(11) NOT NULL DEFAULT '0',
|
||||||
|
`guild_id` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`rank` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`tribute_enable` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`total_tribute` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`last_tribute` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`banker` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`public_note` TEXT NULL,
|
||||||
|
`alt` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`char_id`)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
DELIMITER \\
|
||||||
|
|
||||||
DROP FUNCTION IF EXISTS `GetMobType` $$
|
|
||||||
CREATE FUNCTION `GetMobType` (mobname VARCHAR(64)) RETURNS CHAR(1)
|
CREATE FUNCTION `GetMobType` (mobname VARCHAR(64)) RETURNS CHAR(1)
|
||||||
BEGIN
|
BEGIN
|
||||||
DECLARE Result CHAR(1);
|
DECLARE Result CHAR(1);
|
||||||
|
|
||||||
SET Result = NULL;
|
SET Result = NULL;
|
||||||
|
|
||||||
IF (select count(*) from character_ where name = mobname) > 0 THEN
|
IF (SELECT COUNT(*) FROM `character_data` WHERE `name` = mobname) > 0 THEN
|
||||||
SET Result = 'C';
|
SET Result = 'C';
|
||||||
ELSEIF (select count(*) from bots where Name = mobname) > 0 THEN
|
ELSEIF (SELECT COUNT(*) FROM `bots` WHERE `Name` = mobname) > 0 THEN
|
||||||
SET Result = 'B';
|
SET Result = 'B';
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
RETURN Result;
|
RETURN Result;
|
||||||
END $$
|
END\\
|
||||||
|
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
||||||
DROP VIEW IF EXISTS `vwGroups`;
|
CREATE VIEW `vwbotcharactermobs` AS
|
||||||
CREATE VIEW `vwGroups` AS
|
SELECT _utf8'C' AS mobtype,
|
||||||
select g.groupid as groupid,
|
c.`id`,
|
||||||
GetMobType(g.name) as mobtype,
|
c.`name`,
|
||||||
g.name as name,
|
c.`class`,
|
||||||
g.charid as mobid,
|
c.`level`,
|
||||||
ifnull(c.level, b.BotLevel) as level
|
c.`last_login`,
|
||||||
from group_id as g
|
c.`zone_id`
|
||||||
left join character_ as c on g.name = c.name
|
FROM `character_data` AS c
|
||||||
left join bots as b on g.name = b.Name;
|
UNION ALL
|
||||||
|
SELECT _utf8'B' AS mobtype,
|
||||||
|
b.`BotID` AS id,
|
||||||
|
b.`Name` AS name,
|
||||||
|
b.`Class` AS class,
|
||||||
|
b.`BotLevel` AS level,
|
||||||
|
0 AS timelaston,
|
||||||
|
0 AS zoneid
|
||||||
|
FROM bots AS b;
|
||||||
|
|
||||||
-- FILE:
|
CREATE VIEW `vwgroups` AS
|
||||||
-- source player_tables/botgroups.sql;
|
SELECT g.`groupid` AS groupid,
|
||||||
DROP TABLE IF EXISTS `botgroupmembers`;
|
GetMobType(g.`name`) AS mobtype,
|
||||||
DROP TABLE IF EXISTS `botgroup`;
|
g.`name` AS name,
|
||||||
|
g.`charid` AS mobid,
|
||||||
|
IFNULL(c.`level`, b.`BotLevel`) AS level
|
||||||
|
FROM `group_id` AS g
|
||||||
|
LEFT JOIN `character_data` AS c ON g.`name` = c.`name`
|
||||||
|
LEFT JOIN `bots` AS b ON g.`name` = b.`Name`;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `botgroup` (
|
CREATE VIEW `vwbotgroups` AS
|
||||||
`BotGroupId` integer unsigned NOT NULL AUTO_INCREMENT,
|
SELECT g.`BotGroupId`,
|
||||||
`BotGroupLeaderBotId` integer unsigned NOT NULL DEFAULT '0',
|
g.`BotGroupName`,
|
||||||
`BotGroupName` varchar(64) NOT NULL,
|
g.`BotGroupLeaderBotId`,
|
||||||
PRIMARY KEY (`BotGroupId`),
|
b.`Name` AS BotGroupLeaderName,
|
||||||
KEY FK_botgroup_1 (BotGroupLeaderBotId),
|
b.`BotOwnerCharacterId`,
|
||||||
CONSTRAINT FK_botgroup_1 FOREIGN KEY (BotGroupLeaderBotId) REFERENCES bots (BotID)
|
c.`name` AS BotOwnerCharacterName
|
||||||
) ENGINE=InnoDB;
|
FROM `botgroup` AS g
|
||||||
|
JOIN `bots` AS b ON g.`BotGroupLeaderBotId` = b.`BotID`
|
||||||
|
JOIN `character_data` AS c ON b.`BotOwnerCharacterID` = c.`id`
|
||||||
|
ORDER BY b.`BotOwnerCharacterId`, g.`BotGroupName`;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `botgroupmembers` (
|
CREATE VIEW `vwguildmembers` AS
|
||||||
`BotGroupMemberId` integer unsigned NOT NULL AUTO_INCREMENT,
|
SELECT 'C' AS mobtype,
|
||||||
`BotGroupId` integer unsigned NOT NULL DEFAULT '0',
|
cm.`char_id`,
|
||||||
`BotId` integer unsigned NOT NULL DEFAULT '0',
|
cm.`guild_id`,
|
||||||
PRIMARY KEY (`BotGroupMemberId`),
|
cm.`rank`,
|
||||||
KEY FK_botgroupmembers_1 (BotGroupId),
|
cm.`tribute_enable`,
|
||||||
CONSTRAINT FK_botgroupmembers_1 FOREIGN KEY (BotGroupId) REFERENCES botgroup (BotGroupId),
|
cm.`total_tribute`,
|
||||||
KEY FK_botgroupmembers_2 (BotId),
|
cm.`last_tribute`,
|
||||||
CONSTRAINT FK_botgroupmembers_2 FOREIGN KEY (BotId) REFERENCES bots (BotID)
|
cm.`banker`,
|
||||||
) ENGINE=InnoDB;
|
cm.`public_note`,
|
||||||
|
cm.`alt`
|
||||||
DROP VIEW IF EXISTS `vwBotGroups`;
|
FROM `guild_members` AS cm
|
||||||
CREATE VIEW `vwBotGroups` AS
|
UNION ALL
|
||||||
select g.BotGroupId,
|
SELECT 'B' AS mobtype,
|
||||||
g.BotGroupName,
|
bm.`char_id`,
|
||||||
g.BotGroupLeaderBotId,
|
bm.`guild_id`,
|
||||||
b.Name as BotGroupLeaderName,
|
bm.`rank`,
|
||||||
b.BotOwnerCharacterId,
|
bm.`tribute_enable`,
|
||||||
c.name as BotOwnerCharacterName
|
bm.`total_tribute`,
|
||||||
from botgroup as g
|
bm.`last_tribute`,
|
||||||
join bots as b on g.BotGroupLeaderBotId = b.BotID
|
bm.`banker`,
|
||||||
join character_ as c on b.BotOwnerCharacterID = c.id
|
bm.`public_note`,
|
||||||
order by b.BotOwnerCharacterId, g.BotGroupName;
|
bm.`alt`
|
||||||
|
FROM `botguildmembers` AS bm;
|
||||||
-- FILE:
|
|
||||||
-- source player_tables/botstances.sql;
|
|
||||||
CREATE TABLE botstances (
|
|
||||||
BotID int(10) unsigned NOT NULL default '0',
|
|
||||||
StanceID tinyint unsigned NOT NULL default '0',
|
|
||||||
PRIMARY KEY (BotID),
|
|
||||||
CONSTRAINT FK_botstances_1 FOREIGN KEY (BotID) REFERENCES bots (BotID)
|
|
||||||
);
|
|
||||||
|
|
||||||
-- FILE:
|
|
||||||
-- source player_tables/bottimers.sql;
|
|
||||||
CREATE TABLE bottimers (
|
|
||||||
BotID int(10) unsigned NOT NULL default '0',
|
|
||||||
TimerID int(10) unsigned NOT NULL default '0',
|
|
||||||
Value int(10) unsigned NOT NULL default '0',
|
|
||||||
PRIMARY KEY (BotID),
|
|
||||||
CONSTRAINT FK_bottimers_1 FOREIGN KEY (BotID) REFERENCES bots (BotID)
|
|
||||||
)
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user