mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 16:28:28 +00:00
Bot Rework
This commit is contained in:
@@ -131,6 +131,8 @@ static std::map<uint8, std::string> class_names = {
|
||||
#define ARMOR_TYPE_LAST ARMOR_TYPE_PLATE
|
||||
#define ARMOR_TYPE_COUNT 5
|
||||
|
||||
#define BOT_CLASS_BASE_ID_PREFIX 3000
|
||||
|
||||
|
||||
const char* GetClassIDName(uint8 class_id, uint8 level = 0);
|
||||
|
||||
|
||||
@@ -161,6 +161,346 @@ ADD COLUMN `extra_haste` mediumint(8) NOT NULL DEFAULT 0 AFTER `wis`;
|
||||
.sql = R"(
|
||||
ALTER TABLE `bot_spells_entries`
|
||||
CHANGE COLUMN `spellid` `spell_id` smallint(5) UNSIGNED NOT NULL DEFAULT 0 AFTER `npc_spells_id`;
|
||||
)"
|
||||
},
|
||||
ManifestEntry{
|
||||
.version = 9046,
|
||||
.description = "2024_05_18_bot_settings.sql",
|
||||
.check = "SHOW TABLES LIKE 'bot_settings'",
|
||||
.condition = "empty",
|
||||
.match = "",
|
||||
.sql = R"(
|
||||
CREATE TABLE `bot_settings` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`char_id` INT UNSIGNED NOT NULL,
|
||||
`bot_id` INT UNSIGNED NOT NULL,
|
||||
`setting_id` INT UNSIGNED NOT NULL,
|
||||
`setting_type` INT UNSIGNED NOT NULL,
|
||||
`value` INT UNSIGNED NOT NULL,
|
||||
`category_name` VARCHAR(64) NULL DEFAULT '',
|
||||
`setting_name` VARCHAR(64) NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
)
|
||||
COLLATE='utf8mb4_general_ci';
|
||||
|
||||
INSERT INTO bot_settings SELECT NULL, 0, bd.`bot_id`, 0, 0, bd.`expansion_bitmask`, 'BaseSetting', 'ExpansionBitmask' FROM bot_data bd
|
||||
JOIN rule_values rv
|
||||
WHERE rv.rule_name LIKE 'Bots:BotExpansionSettings'
|
||||
AND bd.expansion_bitmask != rv.rule_value;
|
||||
|
||||
INSERT INTO bot_settings SELECT NULL, 0, `bot_id`, 1, 0, `show_helm`, 'BaseSetting', 'ShowHelm' FROM bot_data WHERE `show_helm` != 1;
|
||||
INSERT INTO bot_settings SELECT NULL, 0, `bot_id`, 2, 0, `follow_distance`, 'BaseSetting', 'FollowDistance' FROM bot_data WHERE `follow_distance` != 184;
|
||||
|
||||
INSERT INTO bot_settings
|
||||
SELECT NULL, 0, `bot_id`, 3, 0, `stop_melee_level`, 'BaseSetting', 'StopMeleeLevel'
|
||||
FROM (
|
||||
SELECT `bot_id`,
|
||||
(CASE
|
||||
WHEN (`class` IN (2, 6, 10, 11, 12, 13, 14)) THEN 13
|
||||
ELSE 255
|
||||
END) AS `sml`,
|
||||
`stop_melee_level`
|
||||
FROM bot_data
|
||||
) AS `subquery`
|
||||
WHERE `sml` != `stop_melee_level`;
|
||||
|
||||
INSERT INTO bot_settings SELECT NULL, 0, `bot_id`, 4, 0, `enforce_spell_settings`, 'BaseSetting', 'EnforceSpellSettings' FROM bot_data WHERE `enforce_spell_settings` != 0;
|
||||
INSERT INTO bot_settings SELECT NULL, 0, `bot_id`, 5, 0, `archery_setting`, 'BaseSetting', 'RangedSetting' FROM bot_data WHERE `archery_setting` != 0;
|
||||
|
||||
INSERT INTO bot_settings
|
||||
SELECT NULL, 0, `bot_id`, 8, 0, `caster_range`, 'BaseSetting', 'CasterRange'
|
||||
FROM (
|
||||
SELECT `bot_id`,
|
||||
(CASE
|
||||
WHEN (`class` IN (1, 7, 19, 16)) THEN 0
|
||||
WHEN `class` = 8 THEN 0
|
||||
ELSE 90
|
||||
END) AS `casterRange`,
|
||||
`caster_range`
|
||||
FROM bot_data
|
||||
) AS `subquery`
|
||||
WHERE `casterRange` != `caster_range`;
|
||||
|
||||
ALTER TABLE `bot_data`
|
||||
DROP COLUMN `show_helm`;
|
||||
ALTER TABLE `bot_data`
|
||||
DROP COLUMN `follow_distance`;
|
||||
ALTER TABLE `bot_data`
|
||||
DROP COLUMN `stop_melee_level`;
|
||||
ALTER TABLE `bot_data`
|
||||
DROP COLUMN `expansion_bitmask`;
|
||||
ALTER TABLE `bot_data`
|
||||
DROP COLUMN `enforce_spell_settings`;
|
||||
ALTER TABLE `bot_data`
|
||||
DROP COLUMN `archery_setting`;
|
||||
ALTER TABLE `bot_data`
|
||||
DROP COLUMN `caster_range`;
|
||||
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'bh' WHERE `bot_command`='behindmob';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'bs|settings' WHERE `bot_command`='botsettings';
|
||||
UPDATE `bot_command_settings` SET `aliases`= CASE WHEN LENGTH(`aliases`) > 0 THEN CONCAT(`aliases`, '|ranged|toggleranged|btr') ELSE 'ranged|toggleranged|btr' END WHERE `bot_command`='bottoggleranged' AND `aliases` NOT LIKE '%ranged|toggleranged|btr%';
|
||||
UPDATE `bot_command_settings` SET `aliases`= CASE WHEN LENGTH(`aliases`) > 0 THEN CONCAT(`aliases`, '|cr') ELSE 'cr' END WHERE `bot_command`='casterrange' AND `aliases` NOT LIKE '%cr%';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'copy' WHERE `bot_command`='copysettings';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'default' WHERE `bot_command`='defaultsettings';
|
||||
UPDATE `bot_command_settings` SET `aliases`= CASE WHEN LENGTH(`aliases`) > 0 THEN CONCAT(`aliases`, '|enforce') ELSE 'enforce' END WHERE `bot_command`='enforcespellsettings' AND `aliases` NOT LIKE '%enforce%';
|
||||
UPDATE `bot_command_settings` SET `aliases`= CASE WHEN LENGTH(`aliases`) > 0 THEN CONCAT(`aliases`, '|ib') ELSE 'ib' END WHERE `bot_command`='illusionblock' AND `aliases` NOT LIKE '%ib%';
|
||||
UPDATE `bot_command_settings` SET `aliases`= CASE WHEN LENGTH(`aliases`) > 0 THEN CONCAT(`aliases`, '|ig') ELSE 'invgive|ig' END WHERE `bot_command`='inventorygive' AND `aliases` NOT LIKE '%ig%';
|
||||
UPDATE `bot_command_settings` SET `aliases`= CASE WHEN LENGTH(`aliases`) > 0 THEN CONCAT(`aliases`, '|il') ELSE 'invlist|il' END WHERE `bot_command`='inventorylist' AND `aliases` NOT LIKE '%il%';
|
||||
UPDATE `bot_command_settings` SET `aliases`= CASE WHEN LENGTH(`aliases`) > 0 THEN CONCAT(`aliases`, '|ir') ELSE 'invremove|ir' END WHERE `bot_command`='inventoryremove' AND `aliases` NOT LIKE '%ir%';
|
||||
UPDATE `bot_command_settings` SET `aliases`= CASE WHEN LENGTH(`aliases`) > 0 THEN CONCAT(`aliases`, '|iw') ELSE 'invwindow|iw' END WHERE `bot_command`='inventorywindow' AND `aliases` NOT LIKE '%iw%';
|
||||
UPDATE `bot_command_settings` SET `aliases`= CASE WHEN LENGTH(`aliases`) > 0 THEN CONCAT(`aliases`, '|iu') ELSE 'iu' END WHERE `bot_command`='itemuse' AND `aliases` NOT LIKE '%iu%';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'mmr' WHERE `bot_command`='maxmeleerange';
|
||||
UPDATE `bot_command_settings` SET `aliases`= CASE WHEN LENGTH(`aliases`) > 0 THEN CONCAT(`aliases`, '|pp') ELSE 'pp' END WHERE `bot_command`='pickpocket' AND `aliases` NOT LIKE '%pp%';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'sithp' WHERE `bot_command`='sithppercent';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'sitcombat' WHERE `bot_command`='sitincombat';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'sitmana' WHERE `bot_command`='sitmanapercent';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'aggrochecks' WHERE `bot_command`='spellaggrochecks';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'delays' WHERE `bot_command`='spelldelays';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'engagedpriority' WHERE `bot_command`='spellengagedpriority';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'holds' WHERE `bot_command`='spellholds';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'idlepriority' WHERE `bot_command`='spellidlepriority';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'maxhp' WHERE `bot_command`='spellmaxhppct';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'maxmana' WHERE `bot_command`='spellmaxmanapct';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'maxthresholds' WHERE `bot_command`='spellmaxthresholds';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'minhp' WHERE `bot_command`='spellminhppct';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'minmana' WHERE `bot_command`='spellminmanapct';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'minthresholds' WHERE `bot_command`='spellminthresholds';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'pursuepriority' WHERE `bot_command`='spellpursuepriority';
|
||||
UPDATE `bot_command_settings` SET `aliases`= 'targetcount' WHERE `bot_command`='spelltargetcount';
|
||||
UPDATE `bot_command_settings` SET `aliases`= CASE WHEN LENGTH(`aliases`) > 0 THEN CONCAT(`aliases`, '|vc') ELSE 'vc' END WHERE `bot_command`='viewcombos' AND `aliases` NOT LIKE '%vc%';
|
||||
)"
|
||||
},
|
||||
ManifestEntry{
|
||||
.version = 9047,
|
||||
.description = "2024_05_18_bot_update_spell_types.sql",
|
||||
.check = "SELECT * FROM `bot_spells_entries` WHERE `type` > 21",
|
||||
.condition = "not_empty",
|
||||
.match = "",
|
||||
.sql = R"(
|
||||
UPDATE `bot_spells_entries` SET `type` = 0 WHERE `type` = 1;
|
||||
UPDATE `bot_spells_entries` SET `type` = 1 WHERE `type` = 2;
|
||||
UPDATE `bot_spells_entries` SET `type` = 2 WHERE `type` = 4;
|
||||
UPDATE `bot_spells_entries` SET `type` = 3 WHERE `type` = 8;
|
||||
UPDATE `bot_spells_entries` SET `type` = 4 WHERE `type` = 16;
|
||||
UPDATE `bot_spells_entries` SET `type` = 5 WHERE `type` = 32;
|
||||
UPDATE `bot_spells_entries` SET `type` = 6 WHERE `type` = 64;
|
||||
UPDATE `bot_spells_entries` SET `type` = 7 WHERE `type` = 128;
|
||||
UPDATE `bot_spells_entries` SET `type` = 8 WHERE `type` = 256;
|
||||
UPDATE `bot_spells_entries` SET `type` = 9 WHERE `type` = 512;
|
||||
UPDATE `bot_spells_entries` SET `type` = 10 WHERE `type` = 1024;
|
||||
UPDATE `bot_spells_entries` SET `type` = 11 WHERE `type` = 2048;
|
||||
UPDATE `bot_spells_entries` SET `type` = 12 WHERE `type` = 4096;
|
||||
UPDATE `bot_spells_entries` SET `type` = 13 WHERE `type` = 8192;
|
||||
UPDATE `bot_spells_entries` SET `type` = 14 WHERE `type` = 16384;
|
||||
UPDATE `bot_spells_entries` SET `type` = 15 WHERE `type` = 32768;
|
||||
UPDATE `bot_spells_entries` SET `type` = 16 WHERE `type` = 65536;
|
||||
UPDATE `bot_spells_entries` SET `type` = 17 WHERE `type` = 131072;
|
||||
UPDATE `bot_spells_entries` SET `type` = 18 WHERE `type` = 262144;
|
||||
UPDATE `bot_spells_entries` SET `type` = 19 WHERE `type` = 524288;
|
||||
UPDATE `bot_spells_entries` SET `type` = 20 WHERE `type` = 1048576;
|
||||
UPDATE `bot_spells_entries` SET `type` = 21 WHERE `type` = 2097152;
|
||||
)"
|
||||
},
|
||||
ManifestEntry{
|
||||
.version = 9048,
|
||||
.description = "2024_05_18_bot_fear_spell_type.sql",
|
||||
.check = "SELECT * FROM `bot_spells_entries` where `type` = 22",
|
||||
.condition = "empty",
|
||||
.match = "",
|
||||
.sql = R"(
|
||||
UPDATE bot_spells_entries b, spells_new s
|
||||
SET b.`type` = 22
|
||||
WHERE b.spellid = s.id
|
||||
AND (
|
||||
s.`effectid1` = 23 OR
|
||||
s.`effectid2` = 23 OR
|
||||
s.`effectid3` = 23 OR
|
||||
s.`effectid4` = 23 OR
|
||||
s.`effectid5` = 23 OR
|
||||
s.`effectid6` = 23 OR
|
||||
s.`effectid7` = 23 OR
|
||||
s.`effectid8` = 23 OR
|
||||
s.`effectid9` = 23 OR
|
||||
s.`effectid10` = 23 OR
|
||||
s.`effectid11` = 23 OR
|
||||
s.`effectid12` = 23
|
||||
);
|
||||
)"
|
||||
},
|
||||
ManifestEntry{
|
||||
.version = 9049,
|
||||
.description = "2024_05_18_correct_bot_spell_entries_types.sql",
|
||||
.check = "SELECT * FROM `bot_spells_entries` where `npc_spells_id` = 3002 AND `spellid` = 14312",
|
||||
.condition = "empty",
|
||||
.match = "",
|
||||
.sql = R"(
|
||||
-- Class fixes
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3002 WHERE b.`spellid` = 14312;
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3002 WHERE b.`spellid` = 14313;
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3002 WHERE b.`spellid` = 14314;
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3005 WHERE b.`spellid` = 15186;
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3005 WHERE b.`spellid` = 15187;
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3005 WHERE b.`spellid` = 15188;
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3006 WHERE b.`spellid` = 14446;
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3006 WHERE b.`spellid` = 14447;
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3006 WHERE b.`spellid` = 14467;
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3006 WHERE b.`spellid` = 14468;
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3006 WHERE b.`spellid` = 14469;
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3003 WHERE b.`spellid` = 14955;
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3003 WHERE b.`spellid` = 14956;
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3006 WHERE b.`spellid` = 14387;
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3006 WHERE b.`spellid` = 14388;
|
||||
UPDATE bot_spells_entries b SET b.`npc_spells_id` = 3006 WHERE b.`spellid` = 14389;
|
||||
|
||||
-- Minlevel fixes
|
||||
UPDATE bot_spells_entries SET `minlevel` = 34 WHERE `spellid` = 1445 AND `npc_spells_id` = 3002;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 2 WHERE `spellid` = 229 AND `npc_spells_id` = 3011;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 13 WHERE `spellid` = 333 AND `npc_spells_id` = 3013;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 29 WHERE `spellid` = 106 AND `npc_spells_id` = 3013;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 38 WHERE `spellid` = 754 AND `npc_spells_id` = 3010;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 58 WHERE `spellid` = 2589 AND `npc_spells_id` = 3003;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 67 WHERE `spellid` = 5305 AND `npc_spells_id` = 3004;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 79 WHERE `spellid` = 14267 AND `npc_spells_id` = 3002;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 79 WHERE `spellid` = 14268 AND `npc_spells_id` = 3002;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 79 WHERE `spellid` = 14269 AND `npc_spells_id` = 3002;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 23 WHERE `spellid` = 738 AND `npc_spells_id` = 3008;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 51 WHERE `spellid` = 1751 AND `npc_spells_id` = 3008;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 7 WHERE `spellid` = 734 AND `npc_spells_id` = 3008;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 5 WHERE `spellid` = 717 AND `npc_spells_id` = 3008;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 79 WHERE `spellid` = 15186 AND `npc_spells_id` = 3005;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 79 WHERE `spellid` = 15187 AND `npc_spells_id` = 3005;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 79 WHERE `spellid` = 15188 AND `npc_spells_id` = 3005;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 80 WHERE `spellid` = 14446 AND `npc_spells_id` = 3006;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 80 WHERE `spellid` = 14447 AND `npc_spells_id` = 3006;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 79 WHERE `spellid` = 14467 AND `npc_spells_id` = 3006;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 79 WHERE `spellid` = 14468 AND `npc_spells_id` = 3006;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 79 WHERE `spellid` = 14469 AND `npc_spells_id` = 3006;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 77 WHERE `spellid` = 14955 AND `npc_spells_id` = 3003;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 77 WHERE `spellid` = 14956 AND `npc_spells_id` = 3003;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 78 WHERE `spellid` = 14387 AND `npc_spells_id` = 3006;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 77 WHERE `spellid` = 14388 AND `npc_spells_id` = 3006;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 77 WHERE `spellid` = 14389 AND `npc_spells_id` = 3006;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 77 WHERE `spellid` = 14312 AND `npc_spells_id` = 3002;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 77 WHERE `spellid` = 14313 AND `npc_spells_id` = 3002;
|
||||
UPDATE bot_spells_entries SET `minlevel` = 77 WHERE `spellid` = 14314 AND `npc_spells_id` = 3002;
|
||||
|
||||
-- Maxlevel fixes
|
||||
UPDATE bot_spells_entries SET `maxlevel` = 83 WHERE `spellid` = 14267 AND `npc_spells_id` = 3002;
|
||||
UPDATE bot_spells_entries SET `maxlevel` = 83 WHERE `spellid` = 14268 AND `npc_spells_id` = 3002;
|
||||
UPDATE bot_spells_entries SET `maxlevel` = 83 WHERE `spellid` = 14269 AND `npc_spells_id` = 3002;
|
||||
UPDATE bot_spells_entries SET `maxlevel` = 84 WHERE `spellid` = 14446 AND `npc_spells_id` = 3006;
|
||||
UPDATE bot_spells_entries SET `maxlevel` = 84 WHERE `spellid` = 14447 AND `npc_spells_id` = 3006;
|
||||
UPDATE bot_spells_entries SET `maxlevel` = 84 WHERE `spellid` = 14467 AND `npc_spells_id` = 3006;
|
||||
UPDATE bot_spells_entries SET `maxlevel` = 84 WHERE `spellid` = 14468 AND `npc_spells_id` = 3006;
|
||||
UPDATE bot_spells_entries SET `maxlevel` = 84 WHERE `spellid` = 14469 AND `npc_spells_id` = 3006;
|
||||
UPDATE bot_spells_entries SET `maxlevel` = 81 WHERE `spellid` = 14312 AND `npc_spells_id` = 3002;
|
||||
UPDATE bot_spells_entries SET `maxlevel` = 81 WHERE `spellid` = 14313 AND `npc_spells_id` = 3002;
|
||||
UPDATE bot_spells_entries SET `maxlevel` = 81 WHERE `spellid` = 14314 AND `npc_spells_id` = 3002;
|
||||
|
||||
-- Type fixes
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 201;
|
||||
UPDATE bot_spells_entries SET `type` = 17 WHERE `spellid` = 752;
|
||||
UPDATE bot_spells_entries SET `type` = 17 WHERE `spellid` = 2117;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 2542;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 2544;
|
||||
UPDATE bot_spells_entries SET `type` = 6 WHERE `spellid` = 2115;
|
||||
UPDATE bot_spells_entries SET `type` = 8 WHERE `spellid` = 1403;
|
||||
UPDATE bot_spells_entries SET `type` = 8 WHERE `spellid` = 1405;
|
||||
UPDATE bot_spells_entries SET `type` = 9 WHERE `spellid` = 289;
|
||||
UPDATE bot_spells_entries SET `type` = 8 WHERE `spellid` = 294;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 302;
|
||||
UPDATE bot_spells_entries SET `type` = 8 WHERE `spellid` = 521;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 185;
|
||||
UPDATE bot_spells_entries SET `type` = 8 WHERE `spellid` = 450;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 186;
|
||||
UPDATE bot_spells_entries SET `type` = 3 WHERE `spellid` = 4074;
|
||||
UPDATE bot_spells_entries SET `type` = 8 WHERE `spellid` = 195;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 1712;
|
||||
UPDATE bot_spells_entries SET `type` = 8 WHERE `spellid` = 1703;
|
||||
UPDATE bot_spells_entries SET `type` = 17 WHERE `spellid` = 3229;
|
||||
UPDATE bot_spells_entries SET `type` = 8 WHERE `spellid` = 3345;
|
||||
UPDATE bot_spells_entries SET `type` = 8 WHERE `spellid` = 5509;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 6826;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 270;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 281;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 505;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 526;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 110;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 506;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 162;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 111;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 507;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 527;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 163;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 112;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 1588;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 1573;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 1592;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 1577;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 1578;
|
||||
UPDATE bot_spells_entries SET `type` = 1 WHERE `spellid` = 1576;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 3386;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 3387;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 4900;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 3395;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 5394;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 5392;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 6827;
|
||||
UPDATE bot_spells_entries SET `type` = 1 WHERE `spellid` = 5416;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 1437;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 1436;
|
||||
UPDATE bot_spells_entries SET `type` = 8 WHERE `spellid` = 5348;
|
||||
UPDATE bot_spells_entries SET `type` = 3 WHERE `spellid` = 8008;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 2571;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 370;
|
||||
UPDATE bot_spells_entries SET `type` = 17 WHERE `spellid` = 1741;
|
||||
UPDATE bot_spells_entries SET `type` = 17 WHERE `spellid` = 1296;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 270;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 2634;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 2942;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 3462;
|
||||
UPDATE bot_spells_entries SET `type` = 13 WHERE `spellid` = 6828;
|
||||
UPDATE bot_spells_entries SET `type` = 4 WHERE `spellid` = 14312;
|
||||
UPDATE bot_spells_entries SET `type` = 4 WHERE `spellid` = 14313;
|
||||
UPDATE bot_spells_entries SET `type` = 4 WHERE `spellid` = 14314;
|
||||
UPDATE bot_spells_entries SET `type` = 8 WHERE `spellid` = 18392;
|
||||
UPDATE bot_spells_entries SET `type` = 8 WHERE `spellid` = 18393;
|
||||
UPDATE bot_spells_entries SET `type` = 8 WHERE `spellid` = 18394;
|
||||
UPDATE bot_spells_entries SET `type` = 10 WHERE `spellid` = 15186;
|
||||
UPDATE bot_spells_entries SET `type` = 3 WHERE `spellid` = 15187;
|
||||
UPDATE bot_spells_entries SET `type` = 3 WHERE `spellid` = 15188;
|
||||
UPDATE bot_spells_entries SET `type` = 1 WHERE `spellid` = 14446;
|
||||
UPDATE bot_spells_entries SET `type` = 1 WHERE `spellid` = 14447;
|
||||
UPDATE bot_spells_entries SET `type` = 3 WHERE `spellid` = 14467;
|
||||
UPDATE bot_spells_entries SET `type` = 3 WHERE `spellid` = 14468;
|
||||
UPDATE bot_spells_entries SET `type` = 3 WHERE `spellid` = 14469;
|
||||
UPDATE bot_spells_entries SET `type` = 0 WHERE `spellid` = 14267;
|
||||
UPDATE bot_spells_entries SET `type` = 0 WHERE `spellid` = 14268;
|
||||
UPDATE bot_spells_entries SET `type` = 0 WHERE `spellid` = 14269;
|
||||
UPDATE bot_spells_entries SET `type` = 10 WHERE `spellid` = 14955;
|
||||
UPDATE bot_spells_entries SET `type` = 10 WHERE `spellid` = 14956;
|
||||
UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 14387;
|
||||
UPDATE bot_spells_entries SET `type` = 3 WHERE `spellid` = 14388;
|
||||
UPDATE bot_spells_entries SET `type` = 3 WHERE `spellid` = 14389;
|
||||
UPDATE bot_spells_entries SET `type` = 4 WHERE `spellid` = 10436;
|
||||
|
||||
-- UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 3440; -- Ro's Illumination [#3440] from DoT [#8] to Debuff [#14] [Should be 0]
|
||||
-- UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 303; -- Whirl till you hurl [#303] from Nuke [#0] to Debuff [#14] [Should be 0]
|
||||
-- UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 619; -- Dyn's Dizzying Draught [#619] from Nuke [#0] to Debuff [#14] [Should be 0]
|
||||
|
||||
-- UPDATE bot_spells_entries SET `type` = 14 WHERE `spellid` = 74; -- Mana Sieve [#74] from Nuke [#0] to Debuff [#14]
|
||||
-- UPDATE bot_spells_entries SET `type` = 6 WHERE `spellid` = 1686; -- Theft of Thought [#1686] from Nuke [#0] to Lifetap [#6]
|
||||
|
||||
-- UPDATE bot_spells_entries SET `type` = 1 WHERE `spellid` = 3694; -- Stoicism [#3694] from In-Combat Buff [#10] to Regular Heal [#1]
|
||||
-- UPDATE bot_spells_entries SET `type` = 1 WHERE `spellid` = 4899; -- Breath of Trushar [#4899] from In-Combat Buff [#10] to Regular Heal [#1]
|
||||
|
||||
-- UPDATE bot_spells_entries SET `type` = 7 WHERE `spellid` = 738; -- Selo's Consonant Chain [#738] from Slow [#13] to Snare [#7]
|
||||
-- UPDATE bot_spells_entries SET `type` = 7 WHERE `spellid` = 1751; -- Largo's Assonant Binding [#1751] from Slow [#13] to Snare [#7]
|
||||
-- UPDATE bot_spells_entries SET `type` = 8 WHERE `spellid` = 1748; -- Angstlich's Assonance [#1748] from Slow [#13] to DoT [#8]
|
||||
-- UPDATE bot_spells_entries SET `type` = 7 WHERE `spellid` = 738; -- Selo's Consonant Chain [#738] from Slow [#13] to Snare [#7]
|
||||
-- UPDATE bot_spells_entries SET `type` = 7 WHERE `spellid` = 1751; -- Largo's Assonant Binding [#1751] from Slow [#13] to Snare [#7]
|
||||
-- UPDATE bot_spells_entries SET `type` = 7 WHERE `spellid` = 738; -- Selo's Consonant Chain [#738] from Slow [#13] to Snare [#7]
|
||||
|
||||
)"
|
||||
}
|
||||
// -- template; copy/paste this when you need to create a new entry
|
||||
|
||||
@@ -415,6 +415,7 @@ namespace DatabaseSchema {
|
||||
"bot_pet_buffs",
|
||||
"bot_pet_inventories",
|
||||
"bot_pets",
|
||||
"bot_settings",
|
||||
"bot_spell_casting_chances",
|
||||
"bot_spell_settings",
|
||||
"bot_spells_entries",
|
||||
|
||||
+15
-1
@@ -142,6 +142,13 @@ namespace Logs {
|
||||
EqTime,
|
||||
Corpses,
|
||||
XTargets,
|
||||
BotSettings,
|
||||
BotPreChecks,
|
||||
BotHoldChecks,
|
||||
BotDelayChecks,
|
||||
BotThresholdChecks,
|
||||
BotSpellTypeChecks,
|
||||
TestDebug,
|
||||
MaxCategoryID /* Don't Remove this */
|
||||
};
|
||||
|
||||
@@ -242,7 +249,14 @@ namespace Logs {
|
||||
"Zoning",
|
||||
"EqTime",
|
||||
"Corpses",
|
||||
"XTargets"
|
||||
"XTargets",
|
||||
"Bot Settings",
|
||||
"Bot Pre Checks",
|
||||
"Bot Hold Checks",
|
||||
"Bot Delay Checks",
|
||||
"Bot Threshold Checks",
|
||||
"Bot Spell Type Checks",
|
||||
"Test Debug"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -844,6 +844,76 @@
|
||||
OutF(LogSys, Logs::Detail, Logs::XTargets, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogBotSettings(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::General, Logs::BotSettings))\
|
||||
OutF(LogSys, Logs::General, Logs::BotSettings, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogBotSettingsDetail(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::Detail, Logs::BotSettings))\
|
||||
OutF(LogSys, Logs::Detail, Logs::BotSettings, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogBotPreChecks(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::General, Logs::BotPreChecks))\
|
||||
OutF(LogSys, Logs::General, Logs::BotPreChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogBotPreChecksDetail(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::Detail, Logs::BotPreChecks))\
|
||||
OutF(LogSys, Logs::Detail, Logs::BotPreChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogBotHoldChecks(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::General, Logs::BotHoldChecks))\
|
||||
OutF(LogSys, Logs::General, Logs::BotHoldChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogBotHoldChecksDetail(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::Detail, Logs::BotHoldChecks))\
|
||||
OutF(LogSys, Logs::Detail, Logs::BotHoldChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogBotDelayChecks(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::General, Logs::BotDelayChecks))\
|
||||
OutF(LogSys, Logs::General, Logs::BotDelayChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogBotDelayChecksDetail(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::Detail, Logs::BotDelayChecks))\
|
||||
OutF(LogSys, Logs::Detail, Logs::BotDelayChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogBotThresholdChecks(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::General, Logs::BotThresholdChecks))\
|
||||
OutF(LogSys, Logs::General, Logs::BotThresholdChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogBotThresholdChecksDetail(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::Detail, Logs::BotThresholdChecks))\
|
||||
OutF(LogSys, Logs::Detail, Logs::BotThresholdChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogBotSpellTypeChecks(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::General, Logs::BotSpellTypeChecks))\
|
||||
OutF(LogSys, Logs::General, Logs::BotSpellTypeChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogBotSpellTypeChecksDetail(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::Detail, Logs::BotSpellTypeChecks))\
|
||||
OutF(LogSys, Logs::Detail, Logs::BotSpellTypeChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogTestDebug(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::General, Logs::TestDebug))\
|
||||
OutF(LogSys, Logs::General, Logs::TestDebug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogTestDebugDetail(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::Detail, Logs::TestDebug))\
|
||||
OutF(LogSys, Logs::Detail, Logs::TestDebug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define Log(debug_level, log_category, message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(debug_level, log_category))\
|
||||
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
|
||||
@@ -64,13 +64,6 @@ public:
|
||||
int16_t poison;
|
||||
int16_t disease;
|
||||
int16_t corruption;
|
||||
uint32_t show_helm;
|
||||
uint32_t follow_distance;
|
||||
uint8_t stop_melee_level;
|
||||
int32_t expansion_bitmask;
|
||||
uint8_t enforce_spell_settings;
|
||||
uint8_t archery_setting;
|
||||
uint32_t caster_range;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
@@ -126,13 +119,6 @@ public:
|
||||
"poison",
|
||||
"disease",
|
||||
"corruption",
|
||||
"show_helm",
|
||||
"follow_distance",
|
||||
"stop_melee_level",
|
||||
"expansion_bitmask",
|
||||
"enforce_spell_settings",
|
||||
"archery_setting",
|
||||
"caster_range",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -184,13 +170,6 @@ public:
|
||||
"poison",
|
||||
"disease",
|
||||
"corruption",
|
||||
"show_helm",
|
||||
"follow_distance",
|
||||
"stop_melee_level",
|
||||
"expansion_bitmask",
|
||||
"enforce_spell_settings",
|
||||
"archery_setting",
|
||||
"caster_range",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -276,13 +255,7 @@ public:
|
||||
e.poison = 0;
|
||||
e.disease = 0;
|
||||
e.corruption = 0;
|
||||
e.show_helm = 0;
|
||||
e.follow_distance = 200;
|
||||
e.stop_melee_level = 255;
|
||||
e.expansion_bitmask = -1;
|
||||
e.enforce_spell_settings = 0;
|
||||
e.archery_setting = 0;
|
||||
e.caster_range = 300;
|
||||
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -364,13 +337,6 @@ public:
|
||||
e.poison = row[42] ? static_cast<int16_t>(atoi(row[42])) : 0;
|
||||
e.disease = row[43] ? static_cast<int16_t>(atoi(row[43])) : 0;
|
||||
e.corruption = row[44] ? static_cast<int16_t>(atoi(row[44])) : 0;
|
||||
e.show_helm = row[45] ? static_cast<uint32_t>(strtoul(row[45], nullptr, 10)) : 0;
|
||||
e.follow_distance = row[46] ? static_cast<uint32_t>(strtoul(row[46], nullptr, 10)) : 200;
|
||||
e.stop_melee_level = row[47] ? static_cast<uint8_t>(strtoul(row[47], nullptr, 10)) : 255;
|
||||
e.expansion_bitmask = row[48] ? static_cast<int32_t>(atoi(row[48])) : -1;
|
||||
e.enforce_spell_settings = row[49] ? static_cast<uint8_t>(strtoul(row[49], nullptr, 10)) : 0;
|
||||
e.archery_setting = row[50] ? static_cast<uint8_t>(strtoul(row[50], nullptr, 10)) : 0;
|
||||
e.caster_range = row[51] ? static_cast<uint32_t>(strtoul(row[51], nullptr, 10)) : 300;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -448,13 +414,6 @@ public:
|
||||
v.push_back(columns[42] + " = " + std::to_string(e.poison));
|
||||
v.push_back(columns[43] + " = " + std::to_string(e.disease));
|
||||
v.push_back(columns[44] + " = " + std::to_string(e.corruption));
|
||||
v.push_back(columns[45] + " = " + std::to_string(e.show_helm));
|
||||
v.push_back(columns[46] + " = " + std::to_string(e.follow_distance));
|
||||
v.push_back(columns[47] + " = " + std::to_string(e.stop_melee_level));
|
||||
v.push_back(columns[48] + " = " + std::to_string(e.expansion_bitmask));
|
||||
v.push_back(columns[49] + " = " + std::to_string(e.enforce_spell_settings));
|
||||
v.push_back(columns[50] + " = " + std::to_string(e.archery_setting));
|
||||
v.push_back(columns[51] + " = " + std::to_string(e.caster_range));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -521,13 +480,6 @@ public:
|
||||
v.push_back(std::to_string(e.poison));
|
||||
v.push_back(std::to_string(e.disease));
|
||||
v.push_back(std::to_string(e.corruption));
|
||||
v.push_back(std::to_string(e.show_helm));
|
||||
v.push_back(std::to_string(e.follow_distance));
|
||||
v.push_back(std::to_string(e.stop_melee_level));
|
||||
v.push_back(std::to_string(e.expansion_bitmask));
|
||||
v.push_back(std::to_string(e.enforce_spell_settings));
|
||||
v.push_back(std::to_string(e.archery_setting));
|
||||
v.push_back(std::to_string(e.caster_range));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -602,13 +554,6 @@ public:
|
||||
v.push_back(std::to_string(e.poison));
|
||||
v.push_back(std::to_string(e.disease));
|
||||
v.push_back(std::to_string(e.corruption));
|
||||
v.push_back(std::to_string(e.show_helm));
|
||||
v.push_back(std::to_string(e.follow_distance));
|
||||
v.push_back(std::to_string(e.stop_melee_level));
|
||||
v.push_back(std::to_string(e.expansion_bitmask));
|
||||
v.push_back(std::to_string(e.enforce_spell_settings));
|
||||
v.push_back(std::to_string(e.archery_setting));
|
||||
v.push_back(std::to_string(e.caster_range));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
@@ -687,13 +632,6 @@ public:
|
||||
e.poison = row[42] ? static_cast<int16_t>(atoi(row[42])) : 0;
|
||||
e.disease = row[43] ? static_cast<int16_t>(atoi(row[43])) : 0;
|
||||
e.corruption = row[44] ? static_cast<int16_t>(atoi(row[44])) : 0;
|
||||
e.show_helm = row[45] ? static_cast<uint32_t>(strtoul(row[45], nullptr, 10)) : 0;
|
||||
e.follow_distance = row[46] ? static_cast<uint32_t>(strtoul(row[46], nullptr, 10)) : 200;
|
||||
e.stop_melee_level = row[47] ? static_cast<uint8_t>(strtoul(row[47], nullptr, 10)) : 255;
|
||||
e.expansion_bitmask = row[48] ? static_cast<int32_t>(atoi(row[48])) : -1;
|
||||
e.enforce_spell_settings = row[49] ? static_cast<uint8_t>(strtoul(row[49], nullptr, 10)) : 0;
|
||||
e.archery_setting = row[50] ? static_cast<uint8_t>(strtoul(row[50], nullptr, 10)) : 0;
|
||||
e.caster_range = row[51] ? static_cast<uint32_t>(strtoul(row[51], nullptr, 10)) : 300;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -763,13 +701,6 @@ public:
|
||||
e.poison = row[42] ? static_cast<int16_t>(atoi(row[42])) : 0;
|
||||
e.disease = row[43] ? static_cast<int16_t>(atoi(row[43])) : 0;
|
||||
e.corruption = row[44] ? static_cast<int16_t>(atoi(row[44])) : 0;
|
||||
e.show_helm = row[45] ? static_cast<uint32_t>(strtoul(row[45], nullptr, 10)) : 0;
|
||||
e.follow_distance = row[46] ? static_cast<uint32_t>(strtoul(row[46], nullptr, 10)) : 200;
|
||||
e.stop_melee_level = row[47] ? static_cast<uint8_t>(strtoul(row[47], nullptr, 10)) : 255;
|
||||
e.expansion_bitmask = row[48] ? static_cast<int32_t>(atoi(row[48])) : -1;
|
||||
e.enforce_spell_settings = row[49] ? static_cast<uint8_t>(strtoul(row[49], nullptr, 10)) : 0;
|
||||
e.archery_setting = row[50] ? static_cast<uint8_t>(strtoul(row[50], nullptr, 10)) : 0;
|
||||
e.caster_range = row[51] ? static_cast<uint32_t>(strtoul(row[51], nullptr, 10)) : 300;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -889,13 +820,6 @@ public:
|
||||
v.push_back(std::to_string(e.poison));
|
||||
v.push_back(std::to_string(e.disease));
|
||||
v.push_back(std::to_string(e.corruption));
|
||||
v.push_back(std::to_string(e.show_helm));
|
||||
v.push_back(std::to_string(e.follow_distance));
|
||||
v.push_back(std::to_string(e.stop_melee_level));
|
||||
v.push_back(std::to_string(e.expansion_bitmask));
|
||||
v.push_back(std::to_string(e.enforce_spell_settings));
|
||||
v.push_back(std::to_string(e.archery_setting));
|
||||
v.push_back(std::to_string(e.caster_range));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -963,13 +887,6 @@ public:
|
||||
v.push_back(std::to_string(e.poison));
|
||||
v.push_back(std::to_string(e.disease));
|
||||
v.push_back(std::to_string(e.corruption));
|
||||
v.push_back(std::to_string(e.show_helm));
|
||||
v.push_back(std::to_string(e.follow_distance));
|
||||
v.push_back(std::to_string(e.stop_melee_level));
|
||||
v.push_back(std::to_string(e.expansion_bitmask));
|
||||
v.push_back(std::to_string(e.enforce_spell_settings));
|
||||
v.push_back(std::to_string(e.archery_setting));
|
||||
v.push_back(std::to_string(e.caster_range));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,464 @@
|
||||
/**
|
||||
* DO NOT MODIFY THIS FILE
|
||||
*
|
||||
* This repository was automatically generated and is NOT to be modified directly.
|
||||
* Any repository modifications are meant to be made to the repository extending the base.
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_SETTINGS_REPOSITORY_H
|
||||
#define EQEMU_BASE_BOT_SETTINGS_REPOSITORY_H
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../strings.h"
|
||||
#include <ctime>
|
||||
|
||||
class BaseBotSettingsRepository {
|
||||
public:
|
||||
struct BotSettings {
|
||||
uint32_t id;
|
||||
uint32_t char_id;
|
||||
uint32_t bot_id;
|
||||
uint16_t setting_id;
|
||||
uint8_t setting_type;
|
||||
int32_t value;
|
||||
std::string category_name;
|
||||
std::string setting_name;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
{
|
||||
return std::string("id");
|
||||
}
|
||||
|
||||
static std::vector<std::string> Columns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"char_id",
|
||||
"bot_id",
|
||||
"setting_id",
|
||||
"setting_type",
|
||||
"value",
|
||||
"category_name",
|
||||
"setting_name",
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"char_id",
|
||||
"bot_id",
|
||||
"setting_id",
|
||||
"setting_type",
|
||||
"value",
|
||||
"category_name",
|
||||
"setting_name",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(Strings::Implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(Strings::Implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("bot_settings");
|
||||
}
|
||||
|
||||
static std::string BaseSelect()
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
static std::string BaseInsert()
|
||||
{
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static BotSettings NewEntity()
|
||||
{
|
||||
BotSettings e{};
|
||||
|
||||
e.id = 0;
|
||||
e.char_id = 0;
|
||||
e.bot_id = 0;
|
||||
e.setting_id = 0;
|
||||
e.setting_type = 0;
|
||||
e.value = 0;
|
||||
e.category_name = "";
|
||||
e.setting_name = "";
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
static BotSettings GetBotSettings(
|
||||
const std::vector<BotSettings> &bot_settingss,
|
||||
int bot_settings_id
|
||||
)
|
||||
{
|
||||
for (auto &bot_settings : bot_settingss) {
|
||||
if (bot_settings.id == bot_settings_id) {
|
||||
return bot_settings;
|
||||
}
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static BotSettings FindOne(
|
||||
Database& db,
|
||||
int bot_settings_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_settings_id
|
||||
)
|
||||
);
|
||||
|
||||
auto row = results.begin();
|
||||
if (results.RowCount() == 1) {
|
||||
BotSettings e{};
|
||||
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.char_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.bot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.setting_id = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.setting_type = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.value = row[5] ? static_cast<int32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.category_name = row[6] ? row[6] : "";
|
||||
e.setting_name = row[7] ? row[7] : "";
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int bot_settings_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
PrimaryKey(),
|
||||
bot_settings_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
const BotSettings &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
v.push_back(columns[0] + " = " + std::to_string(e.id));
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.char_id));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.bot_id));
|
||||
v.push_back(columns[3] + " = " + std::to_string(e.setting_id));
|
||||
v.push_back(columns[4] + " = " + std::to_string(e.setting_type));
|
||||
v.push_back(columns[5] + " = " + std::to_string(e.value));
|
||||
v.push_back(columns[6] + " = '" + Strings::Escape(e.category_name) + "'");
|
||||
v.push_back(columns[7] + " = '" + Strings::Escape(e.setting_name) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
Strings::Implode(", ", v),
|
||||
PrimaryKey(),
|
||||
e.bot_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static BotSettings InsertOne(
|
||||
Database& db,
|
||||
BotSettings e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.char_id));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.setting_id));
|
||||
v.push_back(std::to_string(e.setting_type));
|
||||
v.push_back(std::to_string(e.value));
|
||||
v.push_back("'" + Strings::Escape(e.category_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.setting_name) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
if (results.Success()) {
|
||||
e.id = results.LastInsertedID();
|
||||
return e;
|
||||
}
|
||||
|
||||
e = NewEntity();
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
const std::vector<BotSettings> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.char_id));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.setting_id));
|
||||
v.push_back(std::to_string(e.setting_type));
|
||||
v.push_back(std::to_string(e.value));
|
||||
v.push_back("'" + Strings::Escape(e.category_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.setting_name) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<BotSettings> All(Database& db)
|
||||
{
|
||||
std::vector<BotSettings> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotSettings e{};
|
||||
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.char_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.bot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.setting_id = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.setting_type = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.value = row[5] ? static_cast<int32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.category_name = row[6] ? row[6] : "";
|
||||
e.setting_name = row[7] ? row[7] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<BotSettings> GetWhere(Database& db, const std::string &where_filter)
|
||||
{
|
||||
std::vector<BotSettings> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotSettings e{};
|
||||
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.char_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.bot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.setting_id = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.setting_type = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.value = row[5] ? static_cast<int32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.category_name = row[6] ? row[6] : "";
|
||||
e.setting_name = row[7] ? row[7] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(Database& db, const std::string &where_filter)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int64 GetMaxId(Database& db)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"SELECT COALESCE(MAX({}), 0) FROM {}",
|
||||
PrimaryKey(),
|
||||
TableName()
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static int64 Count(Database& db, const std::string &where_filter = "")
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"SELECT COUNT(*) FROM {} {}",
|
||||
TableName(),
|
||||
(where_filter.empty() ? "" : "WHERE " + where_filter)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotSettings &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.char_id));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.setting_id));
|
||||
v.push_back(std::to_string(e.setting_type));
|
||||
v.push_back(std::to_string(e.value));
|
||||
v.push_back("'" + Strings::Escape(e.category_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.setting_name) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotSettings> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.char_id));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.setting_id));
|
||||
v.push_back(std::to_string(e.setting_type));
|
||||
v.push_back(std::to_string(e.value));
|
||||
v.push_back("'" + Strings::Escape(e.category_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.setting_name) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_SETTINGS_REPOSITORY_H
|
||||
@@ -44,46 +44,6 @@ public:
|
||||
*/
|
||||
|
||||
// Custom extended repository methods here
|
||||
static bool SaveAllHelmAppearances(Database& db, const uint32 owner_id, const bool show_flag)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE `{}` SET `show_helm` = {} WHERE `owner_id` = {}",
|
||||
TableName(),
|
||||
show_flag ? 1 : 0,
|
||||
owner_id
|
||||
)
|
||||
);
|
||||
|
||||
return results.Success();
|
||||
}
|
||||
|
||||
static bool ToggleAllHelmAppearances(Database& db, const uint32 owner_id)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE `{}` SET `show_helm` = (`show_helm` XOR '1') WHERE `owner_id` = {}",
|
||||
TableName(),
|
||||
owner_id
|
||||
)
|
||||
);
|
||||
|
||||
return results.Success();
|
||||
}
|
||||
|
||||
static bool SaveAllFollowDistances(Database& db, const uint32 owner_id, const uint32 follow_distance)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE `{}` SET `follow_distance` = {} WHERE `owner_id` = {}",
|
||||
TableName(),
|
||||
follow_distance,
|
||||
owner_id
|
||||
)
|
||||
);
|
||||
|
||||
return results.Success();
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BOT_DATA_REPOSITORY_H
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
#ifndef EQEMU_BOT_SETTINGS_REPOSITORY_H
|
||||
#define EQEMU_BOT_SETTINGS_REPOSITORY_H
|
||||
|
||||
#include "../database.h"
|
||||
#include "../strings.h"
|
||||
#include "base/base_bot_settings_repository.h"
|
||||
|
||||
class BotSettingsRepository: public BaseBotSettingsRepository {
|
||||
public:
|
||||
|
||||
/**
|
||||
* This file was auto generated and can be modified and extended upon
|
||||
*
|
||||
* Base repository methods are automatically
|
||||
* generated in the "base" version of this repository. The base repository
|
||||
* is immutable and to be left untouched, while methods in this class
|
||||
* are used as extension methods for more specific persistence-layer
|
||||
* accessors or mutators.
|
||||
*
|
||||
* Base Methods (Subject to be expanded upon in time)
|
||||
*
|
||||
* Note: Not all tables are designed appropriately to fit functionality with all base methods
|
||||
*
|
||||
* InsertOne
|
||||
* UpdateOne
|
||||
* DeleteOne
|
||||
* FindOne
|
||||
* GetWhere(std::string where_filter)
|
||||
* DeleteWhere(std::string where_filter)
|
||||
* InsertMany
|
||||
* All
|
||||
*
|
||||
* Example custom methods in a repository
|
||||
*
|
||||
* BotSettingsRepository::GetByZoneAndVersion(int zone_id, int zone_version)
|
||||
* BotSettingsRepository::GetWhereNeverExpires()
|
||||
* BotSettingsRepository::GetWhereXAndY()
|
||||
* BotSettingsRepository::DeleteWhereXAndY()
|
||||
*
|
||||
* Most of the above could be covered by base methods, but if you as a developer
|
||||
* find yourself re-using logic for other parts of the code, its best to just make a
|
||||
* method that can be re-used easily elsewhere especially if it can use a base repository
|
||||
* method and encapsulate filters there
|
||||
*/
|
||||
|
||||
// Custom extended repository methods here
|
||||
|
||||
};
|
||||
|
||||
#endif //EQEMU_BOT_SETTINGS_REPOSITORY_H
|
||||
@@ -381,6 +381,9 @@ RULE_BOOL(Map, MobZVisualDebug, false, "Displays spell effects determining wheth
|
||||
RULE_BOOL(Map, MobPathingVisualDebug, false, "Displays nodes in pathing points in realtime to help with visual debugging")
|
||||
RULE_REAL(Map, FixPathingZMaxDeltaSendTo, 20, "At runtime in SendTo: maximum change in Z to allow the BestZ code to apply")
|
||||
RULE_INT(Map, FindBestZHeightAdjust, 1, "Adds this to the current Z before seeking the best Z position")
|
||||
RULE_BOOL(Map, CheckForLoSCheat, false, "Runs predefined zone checks to check for LoS cheating through doors and such.")
|
||||
RULE_BOOL(Map, EnableLoSCheatExemptions, false, "Enables exemptions for the LoS Cheat check.")
|
||||
RULE_REAL(Map, RangeCheckForLoSCheat, 20.0, "Default 20.0. Range to check if one is within range of a door.")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Pathing)
|
||||
@@ -753,6 +756,7 @@ RULE_INT(Bots, CommandSpellRank, 1, "Filters bot command spells by rank. 1, 2 an
|
||||
RULE_INT(Bots, CreationLimit, 150, "Number of bots that each account can create")
|
||||
RULE_BOOL(Bots, FinishBuffing, false, "Allow for buffs to complete even if the bot caster is out of mana. Only affects buffing out of combat")
|
||||
RULE_BOOL(Bots, GroupBuffing, false, "Bots will cast single target buffs as group buffs, default is false for single. Does not make single target buffs work for MGB")
|
||||
RULE_BOOL(Bots, RaidBuffing, false, "Bots will cast single target buffs as raid buffs, default is false for single. Does not make single target buffs work for MGB")
|
||||
RULE_INT(Bots, HealRotationMaxMembers, 24, "Maximum number of heal rotation members")
|
||||
RULE_INT(Bots, HealRotationMaxTargets, 12, "Maximum number of heal rotation targets")
|
||||
RULE_REAL(Bots, ManaRegen, 2.0, "Adjust mana regen. Acts as a final multiplier, stacks with Rule Character:ManaRegenMultiplier.")
|
||||
@@ -782,6 +786,91 @@ RULE_BOOL(Bots, CanClickMageEpicV1, true, "Whether or not bots are allowed to cl
|
||||
RULE_BOOL(Bots, BotsIgnoreLevelBasedHasteCaps, false, "Ignores hard coded level based haste caps.")
|
||||
RULE_INT(Bots, BotsHasteCap, 100, "Haste cap for non-v3(over haste) haste")
|
||||
RULE_INT(Bots, BotsHastev3Cap, 25, "Haste cap for v3(over haste) haste")
|
||||
RULE_BOOL(Bots, CrossRaidBuffingAndHealing, true, "If True, bots will be able to cast on all raid members rather than just their raid group members. Default true.")
|
||||
RULE_BOOL(Bots, CanCastIllusionsOnPets, false, "If True, bots will be able to cast spells that have an illusion effect on pets. Default false.")
|
||||
RULE_BOOL(Bots, CanCastPetOnlyOnOthersPets, false, "If True, bots will be able to cast pet only spells on other's pets. Default false.")
|
||||
RULE_BOOL(Bots, RequirePetAffinity, true, "If True, bots will be need to have the Pet Affinity AA to allow their pets to be hit with group spells.")
|
||||
RULE_INT(Bots, SpellResistLimit, 150, "150 Default. This is the resist cap where bots will refuse to cast spells on enemies due to a high resist chance.")
|
||||
RULE_INT(Bots, StunCastChanceIfCasting, 50, "50 Default. Chance for non-Paladins to cast a stun spell if the target is casting.")
|
||||
RULE_INT(Bots, StunCastChanceNormal, 15, "15 Default. Chance for non-Paladins to cast a stun spell on the target.")
|
||||
RULE_INT(Bots, StunCastChancePaladins, 75, "75 Default. Chance for Paladins to cast a stun spell if the target is casting.")
|
||||
RULE_INT(Bots, PercentChanceToCastNuke, 75, "The chance for a bot to attempt to cast the given spell type in combat. Default 75%.")
|
||||
RULE_INT(Bots, PercentChanceToCastHeal, 90, "The chance for a bot to attempt to cast the given spell type in combat. Default 90%.")
|
||||
RULE_INT(Bots, PercentChanceToCastRoot, 75, "The chance for a bot to attempt to cast the given spell type in combat. Default 75%.")
|
||||
RULE_INT(Bots, PercentChanceToCastBuff, 90, "The chance for a bot to attempt to cast the given spell type in combat. Default 90%.")
|
||||
RULE_INT(Bots, PercentChanceToCastEscape, 75, "The chance for a bot to attempt to cast the given spell type in combat. Default 75%.")
|
||||
RULE_INT(Bots, PercentChanceToCastLifetap, 75, "The chance for a bot to attempt to cast the given spell type in combat. Default 75%.")
|
||||
RULE_INT(Bots, PercentChanceToCastSnare, 75, "The chance for a bot to attempt to cast the given spell type in combat. Default 75%.")
|
||||
RULE_INT(Bots, PercentChanceToCastDOT, 75, "The chance for a bot to attempt to cast the given spell type in combat. Default 75%.")
|
||||
RULE_INT(Bots, PercentChanceToCastDispel, 75, "The chance for a bot to attempt to cast the given spell type in combat. Default 75%.")
|
||||
RULE_INT(Bots, PercentChanceToCastInCombatBuff, 75, "The chance for a bot to attempt to cast the given spell type in combat. Default 75%.")
|
||||
RULE_INT(Bots, PercentChanceToCastMez, 75, "The chance for a bot to attempt to cast the given spell type in combat. Default 75%.")
|
||||
RULE_INT(Bots, PercentChanceToCastSlow, 75, "The chance for a bot to attempt to cast the given spell type in combat. Default 75%.")
|
||||
RULE_INT(Bots, PercentChanceToCastDebuff, 75, "The chance for a bot to attempt to cast the given spell type in combat. Default 75%.")
|
||||
RULE_INT(Bots, PercentChanceToCastCure, 75, "The chance for a bot to attempt to cast the given spell type in combat. Default 75%.")
|
||||
RULE_INT(Bots, PercentChanceToCastHateRedux, 75, "The chance for a bot to attempt to cast the given spell type in combat. Default 75%.")
|
||||
RULE_INT(Bots, PercentChanceToCastFear, 75, "The chance for a bot to attempt to cast the given spell type in combat. Default 75%.")
|
||||
RULE_INT(Bots, PercentChanceToCastOtherType, 90, "The chance for a bot to attempt to cast the remaining spell types in combat. Default 0-%.")
|
||||
RULE_INT(Bots, MinDelayBetweenInCombatCastAttempts, 250, "The minimum delay in milliseconds between cast attempts while in-combat. This is rolled between the min and max. Default 500ms.")
|
||||
RULE_INT(Bots, MaxDelayBetweenInCombatCastAttempts, 2000, "The maximum delay in milliseconds between cast attempts while in-combat. This is rolled between the min and max. Default 2000ms.")
|
||||
RULE_INT(Bots, MinDelayBetweenOutCombatCastAttempts, 125, "The minimum delay in milliseconds between cast attempts while out-of-combat. This is rolled between the min and max. Default 200ms.")
|
||||
RULE_INT(Bots, MaxDelayBetweenOutCombatCastAttempts, 500, "The maximum delay in milliseconds between cast attempts while out-of-combat. This is rolled between the min and max. Default 500ms.")
|
||||
RULE_INT(Bots, MezChance, 35, "35 Default. Chance for a bot to attempt to Mez a target after validating it is eligible.")
|
||||
RULE_INT(Bots, AEMezChance, 35, "35 Default. Chance for a bot to attempt to AE Mez targets after validating they are eligible.")
|
||||
RULE_INT(Bots, MezSuccessDelay, 3500, "3500 (3.5 sec) Default. Delay between successful Mez attempts.")
|
||||
RULE_INT(Bots, AEMezSuccessDelay, 5000, "5000 (5 sec) Default. Delay between successful AEMez attempts.")
|
||||
RULE_INT(Bots, MezFailDelay, 2000, "2000 (2 sec) Default. Delay between failed Mez attempts.")
|
||||
RULE_INT(Bots, MezAEFailDelay, 4000, "4000 (4 sec) Default. Delay between failed AEMez attempts.")
|
||||
RULE_INT(Bots, MinGroupHealTargets, 3, "Minimum number of targets in valid range that are required for a group heal to cast. Default 3.")
|
||||
RULE_INT(Bots, MinGroupCureTargets, 3, "Minimum number of targets in valid range that are required for a cure heal to cast. Default 3.")
|
||||
RULE_INT(Bots, MinTargetsForAESpell, 3, "Minimum number of targets in valid range that are required for an AE spell to cast. Default 3.")
|
||||
RULE_INT(Bots, MinTargetsForGroupSpell, 3, "Minimum number of targets in valid range that are required for an group spell to cast. Default 3.")
|
||||
RULE_BOOL(Bots, AllowBuffingHealingFamiliars, false, "Determines if bots are allowed to buff and heal familiars. Default false.")
|
||||
RULE_BOOL(Bots, RunSpellTypeChecksOnSpawn, false, "This will run a serious of checks on spell types and output errors to LogBotSpellTypeChecks")
|
||||
RULE_BOOL(Bots, AllowMagicianEpicPet, false, "If enabled, magician bots can summon their epic pets following the rules AllowMagicianEpicPetLevel")
|
||||
RULE_INT(Bots, AllowMagicianEpicPetLevel, 50, "If AllowMagicianEpicPet is enabled, bots can start using their epic pets at this level")
|
||||
RULE_INT(Bots, RequiredMagicianEpicPetItemID, 28034, "If AllowMagicianEpicPet is enabled and this is set, bots will be required to have this item ID equipped to cast their epic. Takes in to account AllowMagicianEpicPetLevel as well. Set to 0 to disable requirement")
|
||||
RULE_STRING(Bots, EpicPetSpellName, "", "'teleport_zone' in the spell to be cast for epic pets. This must be in their spell list to cast.")
|
||||
RULE_BOOL(Bots, AllowSpellPulling, true, "If enabled bots will use a spell to pull when within range. Uses PullSpellID.")
|
||||
RULE_INT(Bots, PullSpellID, 5225, "Default 5225 - Throw Stone. Spell that will be cast to pull by bots")
|
||||
RULE_BOOL(Bots, AllowBotEquipAnyClassGear, false, "Allows Bots to wear Equipment even if their class is not valid")
|
||||
RULE_BOOL(Bots, BotArcheryConsumesAmmo, true, "Set to false to disable Archery Ammo Consumption")
|
||||
RULE_BOOL(Bots, BotThrowingConsumesAmmo, true, "Set to false to disable Throwing Ammo Consumption")
|
||||
RULE_INT(Bots, StackSizeMin, 100, "100 Default. -1 to disable and use default max stack size. Minimum stack size to give a bot (Arrows/Throwing).")
|
||||
RULE_INT(Bots, HasOrMayGetAggroThreshold, 90, "90 Default. Percent threshold of total hate where bots will stop casting spells that generate hate if they are set to try to not pull aggro via spells.")
|
||||
RULE_BOOL(Bots, UseFlatNormalMeleeRange, false, "False Default. If true, bots melee distance will be a flat distance set by Bots:NormalMeleeRangeDistance.")
|
||||
RULE_REAL(Bots, NormalMeleeRangeDistance, 0.75, "Multiplier of the max melee range at which a bot will stand in melee combat. 0.75 Recommended, max melee for all abilities to land.")
|
||||
RULE_REAL(Bots, PercentMinMeleeDistance, 0.60, "Multiplier of the max melee range - Minimum distance from target a bot will stand while in melee combat before trying to adjust. 0.60 Recommended.")
|
||||
RULE_REAL(Bots, MaxDistanceForMelee, 20, "Maximum distance bots will stand for melee. Default 20 to allow all special attacks to land.")
|
||||
RULE_REAL(Bots, TauntNormalMeleeRangeDistance, 0.50, "Multiplier of the max melee range at which a taunting bot will stand in melee combat. 0.50 Recommended, closer than others .")
|
||||
RULE_REAL(Bots, PercentTauntMinMeleeDistance, 0.25, "Multiplier of max melee range - Minimum distance from target a taunting bot will stand while in melee combat before trying to adjust. 0.25 Recommended.")
|
||||
RULE_REAL(Bots, PercentMaxMeleeRangeDistance, 0.95, "Multiplier of the max melee range at which a bot will stand in melee combat. 0.95 Recommended, max melee while disabling special attacks/taunt.")
|
||||
RULE_REAL(Bots, PercentMinMaxMeleeRangeDistance, 0.75, "Multiplier of the closest max melee range at which a bot will stand in melee combat before trying to adjust. 0.75 Recommended, max melee while disabling special attacks/taunt.")
|
||||
RULE_BOOL(Bots, CastersStayJustOutOfMeleeRange, true, "True Default. If true, caster bots will stay just out of melee range. Otherwise they use Bots:PercentMinCasterRangeDistance.")
|
||||
RULE_REAL(Bots, PercentMinCasterRangeDistance, 0.60, "Multiplier of the closest caster range at which a bot will stand while casting before trying to adjust. 0.60 Recommended.")
|
||||
RULE_BOOL(Bots, TauntingBotsFollowTopHate, true, "True Default. If true, bots that are taunting will attempt to stick with whoever currently is top hate.")
|
||||
RULE_REAL(Bots, DistanceTauntingBotsStickMainHate, 25.00, "If TauntingBotsFollowTopHate is enabled, this is the distance bots will try to stick to whoever currently is Top Hate.")
|
||||
RULE_BOOL(Bots, DisableSpecialAbilitiesAtMaxMelee, false, "False Default. If true, when bots are at max melee distance, special abilities including taunt will be disabled.")
|
||||
RULE_INT(Bots, MinJitterTimer, 500, "Minimum ms between bot movement jitter checks.")
|
||||
RULE_INT(Bots, MaxJitterTimer, 2500, "Maximum ms between bot movement jitter checks. Set to 0 to disable timer checks.")
|
||||
RULE_BOOL(Bots, PreventBotCampOnFD, true, "True Default. If true, players will not be able to camp bots while feign death.")
|
||||
RULE_BOOL(Bots, PreventBotSpawnOnFD, true, "True Default. If true, players will not be able to spawn bots while feign death.")
|
||||
RULE_BOOL(Bots, PreventBotSpawnOnEngaged, true, "True Default. If true, players will not be able to spawn bots while you, your group or raid are engaged.")
|
||||
RULE_BOOL(Bots, PreventBotCampOnEngaged, true, "True Default. If true, players will not be able to camp bots while you, your group or raid are engaged.")
|
||||
RULE_BOOL(Bots, CopySettingsOwnBotsOnly, true, "Determines whether a bot you are copying settings from must be a bot you own or not, default true.")
|
||||
RULE_BOOL(Bots, AllowCopySettingsAnon, true, "If player's are allowed to copy settings of bots owned by anonymous players.")
|
||||
RULE_BOOL(Bots, AllowCharmedPetBuffs, true, "Whether or not bots are allowed to cast buff charmed pets, default true.")
|
||||
RULE_BOOL(Bots, AllowCharmedPetHeals, true, "Whether or not bots are allowed to cast heal charmed pets, default true.")
|
||||
RULE_BOOL(Bots, AllowCharmedPetCures, true, "Whether or not bots are allowed to cast cure charmed pets, default true.")
|
||||
RULE_BOOL(Bots, ShowResistMessagesToOwner, true, "Default True. If enabled, when a bot's spell is resisted it will send a spell failure to their owner.")
|
||||
RULE_BOOL(Bots, BotBuffLevelRestrictions, true, "Buffs will not land on low level bots like live players")
|
||||
RULE_BOOL(Bots, BotsUseLiveBlockedMessage, false, "Setting whether detailed spell block messages should be used for bots as players do on the live servers")
|
||||
RULE_BOOL(Bots, BotSoftDeletes, true, "When bots are deleted, they are only soft deleted")
|
||||
RULE_INT(Bots, MinStatusToBypassSpawnLimit, 100, "Minimum status to bypass the anti-spam system")
|
||||
RULE_INT(Bots, StatusSpawnLimit, 120, "Minimum status to bypass spawn limit. Default 120.")
|
||||
RULE_INT(Bots, MinStatusToBypassCreateLimit, 100, "Minimum status to bypass the anti-spam system")
|
||||
RULE_INT(Bots, StatusCreateLimit, 120, "Minimum status to bypass spawn limit. Default 120.")
|
||||
RULE_BOOL(Bots, BardsAnnounceCasts, false, "This determines whether or not Bard bots will announce that they're casting songs (Buffs, Heals, Nukes, Slows, etc.) they will always announce Mez.")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Chat)
|
||||
@@ -1007,6 +1096,30 @@ RULE_CATEGORY_END()
|
||||
RULE_CATEGORY(Command)
|
||||
RULE_BOOL(Command, DyeCommandRequiresDyes, false, "Enable this to require a Prismatic Dye (32557) each time someone uses #dye.")
|
||||
RULE_BOOL(Command, HideMeCommandDisablesTells, true, "Disable this to allow tells to be received when using #hideme.")
|
||||
RULE_INT(Command, MaxHelpLineLength, 53, "Maximum length of a line before splitting it in to new lines for DiaWind. Default 53.")
|
||||
RULE_STRING(Command, DescriptionColor, "light_grey", "Color for command help windows")
|
||||
RULE_STRING(Command, DescriptionHeaderColor, "indian_red", "Color for command help windows")
|
||||
RULE_STRING(Command, AltDescriptionColor, "light_grey", "Color for command help windows")
|
||||
RULE_STRING(Command, NoteColor, "dark_orange", "Color for command help windows")
|
||||
RULE_STRING(Command, NoteHeaderColor, "indian_red", "Color for command help windows")
|
||||
RULE_STRING(Command, AltNoteColor, "dark_orange", "Color for command help windows")
|
||||
RULE_STRING(Command, ExampleColor, "goldenrod", "Color for command help windows")
|
||||
RULE_STRING(Command, ExampleHeaderColor, "indian_red", "Color for command help windows")
|
||||
RULE_STRING(Command, SubExampleColor, "slate_blue", "Color for command help windows")
|
||||
RULE_STRING(Command, AltExampleColor, "goldenrod", "Color for command help windows")
|
||||
RULE_STRING(Command, SubAltExampleColor, "goldenrod", "Color for command help windows")
|
||||
RULE_STRING(Command, OptionColor, "light_grey", "Color for command help windows")
|
||||
RULE_STRING(Command, OptionHeaderColor, "indian_red", "Color for command help windows")
|
||||
RULE_STRING(Command, SubOptionColor, "light_grey", "Color for command help windows")
|
||||
RULE_STRING(Command, AltOptionColor, "light_grey", "Color for command help windows")
|
||||
RULE_STRING(Command, SubAltOptionColor, "light_grey", "Color for command help windows")
|
||||
RULE_STRING(Command, ActionableColor, "light_grey", "Color for command help windows")
|
||||
RULE_STRING(Command, ActionableHeaderColor, "indian_red", "Color for command help windows")
|
||||
RULE_STRING(Command, AltActionableColor, "light_grey", "Color for command help windows")
|
||||
RULE_STRING(Command, HeaderColor, "indian_red", "Color for command help windows")
|
||||
RULE_STRING(Command, SecondaryHeaderColor, "slate_blue", "Color for command help windows")
|
||||
RULE_STRING(Command, AltHeaderColor, "indian_red", "Color for command help windows")
|
||||
RULE_STRING(Command, FillerLineColor, "dark_grey", "Color for command help windows")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Doors)
|
||||
|
||||
+770
-25
@@ -125,9 +125,26 @@ bool IsMesmerizeSpell(uint16 spell_id)
|
||||
return IsEffectInSpell(spell_id, SE_Mez);
|
||||
}
|
||||
|
||||
bool SpellBreaksMez(uint16 spell_id)
|
||||
{
|
||||
if (IsDetrimentalSpell(spell_id) && IsAnyDamageSpell(spell_id)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsStunSpell(uint16 spell_id)
|
||||
{
|
||||
return IsEffectInSpell(spell_id, SE_Stun);
|
||||
if (IsEffectInSpell(spell_id, SE_Stun)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (IsEffectInSpell(spell_id, SE_SpinTarget)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsSummonSpell(uint16 spell_id)
|
||||
@@ -164,13 +181,7 @@ bool IsDamageSpell(uint16 spell_id)
|
||||
const auto effect_id = spell.effect_id[i];
|
||||
if (
|
||||
spell.base_value[i] < 0 &&
|
||||
(
|
||||
effect_id == SE_CurrentHPOnce ||
|
||||
(
|
||||
effect_id == SE_CurrentHP &&
|
||||
spell.buff_duration < 1
|
||||
)
|
||||
)
|
||||
(effect_id == SE_CurrentHPOnce || effect_id == SE_CurrentHP)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
@@ -179,6 +190,62 @@ bool IsDamageSpell(uint16 spell_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsAnyDamageSpell(uint16 spell_id)
|
||||
{
|
||||
if (IsLifetapSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto& spell = spells[spell_id];
|
||||
|
||||
for (int i = 0; i < EFFECT_COUNT; i++) {
|
||||
const auto effect_id = spell.effect_id[i];
|
||||
if (
|
||||
spell.base_value[i] < 0 &&
|
||||
(
|
||||
effect_id == SE_CurrentHPOnce ||
|
||||
(
|
||||
effect_id == SE_CurrentHP &&
|
||||
spell.buff_duration < 1
|
||||
)
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsDamageOverTimeSpell(uint16 spell_id)
|
||||
{
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (IsLifetapSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto& spell = spells[spell_id];
|
||||
|
||||
if (spell.good_effect || !spell.buff_duration_formula) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < EFFECT_COUNT; i++) {
|
||||
const auto effect_id = spell.effect_id[i];
|
||||
if (
|
||||
spell.base_value[i] < 0 &&
|
||||
effect_id == SE_CurrentHP &&
|
||||
spell.buff_duration > 1
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsFearSpell(uint16 spell_id)
|
||||
{
|
||||
@@ -409,7 +476,8 @@ bool IsSummonPetSpell(uint16 spell_id)
|
||||
return (
|
||||
IsEffectInSpell(spell_id, SE_SummonPet) ||
|
||||
IsEffectInSpell(spell_id, SE_SummonBSTPet) ||
|
||||
IsEffectInSpell(spell_id, SE_Familiar)
|
||||
IsEffectInSpell(spell_id, SE_Familiar) ||
|
||||
IsEffectInSpell(spell_id, SE_NecPet)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -560,12 +628,11 @@ bool IsPBAENukeSpell(uint16 spell_id)
|
||||
|
||||
if (
|
||||
IsPureNukeSpell(spell_id) &&
|
||||
spell.aoe_range > 0 &&
|
||||
spell.target_type == ST_AECaster
|
||||
!IsTargetRequiredForSpell(spell_id)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -588,6 +655,137 @@ bool IsAERainNukeSpell(uint16 spell_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsAnyNukeOrStunSpell(uint16 spell_id) {
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (IsSelfConversionSpell(spell_id) || IsEscapeSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
IsPBAENukeSpell(spell_id) ||
|
||||
IsAERainNukeSpell(spell_id) ||
|
||||
IsPureNukeSpell(spell_id) ||
|
||||
IsStunSpell(spell_id) ||
|
||||
(IsDamageSpell(spell_id) && !IsDamageOverTimeSpell(spell_id))
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsAnyAESpell(uint16 spell_id) {
|
||||
//if (
|
||||
// spells[spell_id].target_type == ST_Target ||
|
||||
// spells[spell_id].target_type == ST_Self ||
|
||||
// spells[spell_id].target_type == ST_Animal ||
|
||||
// spells[spell_id].target_type == ST_Undead ||
|
||||
// spells[spell_id].target_type == ST_Summoned ||
|
||||
// spells[spell_id].target_type == ST_Tap ||
|
||||
// spells[spell_id].target_type == ST_Pet ||
|
||||
// spells[spell_id].target_type == ST_Corpse ||
|
||||
// spells[spell_id].target_type == ST_Plant ||
|
||||
// spells[spell_id].target_type == ST_Giant ||
|
||||
// spells[spell_id].target_type == ST_Dragon ||
|
||||
// spells[spell_id].target_type == ST_HateList ||
|
||||
// spells[spell_id].target_type == ST_LDoNChest_Cursed ||
|
||||
// spells[spell_id].target_type == ST_Muramite ||
|
||||
// spells[spell_id].target_type == ST_SummonedPet ||
|
||||
// spells[spell_id].target_type == ST_TargetsTarget ||
|
||||
// spells[spell_id].target_type == ST_PetMaster //||
|
||||
// //spells[spell_id].target_type == ST_AEBard //TODO needed?
|
||||
//) {
|
||||
// return false;
|
||||
//}
|
||||
|
||||
if (IsAESpell(spell_id) || IsPBAENukeSpell(spell_id) || IsPBAESpell(spell_id) || IsAERainSpell(spell_id) || IsAERainNukeSpell(spell_id) || IsAEDurationSpell(spell_id)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsAESpell(uint16 spell_id)
|
||||
{
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (spells[spell_id].target_type) {
|
||||
case ST_TargetOptional:
|
||||
case ST_GroupTeleport :
|
||||
case ST_Target:
|
||||
case ST_Self:
|
||||
case ST_Animal:
|
||||
case ST_Undead:
|
||||
case ST_Summoned:
|
||||
case ST_Tap:
|
||||
case ST_Pet:
|
||||
case ST_Corpse:
|
||||
case ST_Plant:
|
||||
case ST_Giant:
|
||||
case ST_Dragon:
|
||||
case ST_LDoNChest_Cursed:
|
||||
case ST_Muramite:
|
||||
case ST_SummonedPet:
|
||||
case ST_GroupNoPets:
|
||||
case ST_Group:
|
||||
case ST_GroupClientAndPet:
|
||||
case ST_TargetsTarget:
|
||||
case ST_PetMaster:
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (
|
||||
spells[spell_id].aoe_range > 0
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsPBAESpell(uint16 spell_id)
|
||||
{
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto& spell = spells[spell_id];
|
||||
|
||||
if (
|
||||
spell.aoe_range > 0 &&
|
||||
spell.target_type == ST_AECaster
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsAERainSpell(uint16 spell_id)
|
||||
{
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto& spell = spells[spell_id];
|
||||
|
||||
if (
|
||||
spell.aoe_range > 0 &&
|
||||
spell.aoe_duration > 1000
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsPartialResistableSpell(uint16 spell_id)
|
||||
{
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
@@ -644,7 +842,9 @@ bool IsGroupSpell(uint16 spell_id)
|
||||
return (
|
||||
spell.target_type == ST_AEBard ||
|
||||
spell.target_type == ST_Group ||
|
||||
spell.target_type == ST_GroupTeleport
|
||||
spell.target_type == ST_GroupTeleport ||
|
||||
spell.target_type == ST_GroupNoPets ||
|
||||
spell.target_type == ST_GroupClientAndPet
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1265,6 +1465,7 @@ bool IsCompleteHealSpell(uint16 spell_id)
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bool IsFastHealSpell(uint16 spell_id)
|
||||
@@ -1386,20 +1587,61 @@ bool IsRegularSingleTargetHealSpell(uint16 spell_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsRegularGroupHealSpell(uint16 spell_id)
|
||||
bool IsRegularPetHealSpell(uint16 spell_id)
|
||||
{
|
||||
spell_id = (
|
||||
IsEffectInSpell(spell_id, SE_CurrentHP) ?
|
||||
spell_id :
|
||||
GetSpellTriggerSpellID(spell_id, SE_CurrentHP)
|
||||
);
|
||||
);
|
||||
|
||||
if (!spell_id) {
|
||||
spell_id = (
|
||||
IsEffectInSpell(spell_id, SE_CurrentHPOnce) ?
|
||||
spell_id :
|
||||
GetSpellTriggerSpellID(spell_id, SE_CurrentHPOnce)
|
||||
);
|
||||
}
|
||||
|
||||
if (spell_id) {
|
||||
if (
|
||||
spells[spell_id].target_type == ST_Pet &&
|
||||
!IsCompleteHealSpell(spell_id) &&
|
||||
!IsHealOverTimeSpell(spell_id) &&
|
||||
!IsGroupSpell(spell_id)
|
||||
) {
|
||||
for (int i = 0; i < EFFECT_COUNT; i++) {
|
||||
if (
|
||||
spells[spell_id].base_value[i] > 0 &&
|
||||
spells[spell_id].buff_duration == 0 &&
|
||||
(
|
||||
spells[spell_id].effect_id[i] == SE_CurrentHP ||
|
||||
spells[spell_id].effect_id[i] == SE_CurrentHPOnce
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsRegularGroupHealSpell(uint16 spell_id)
|
||||
{
|
||||
spell_id = (
|
||||
IsEffectInSpell(spell_id, SE_CurrentHP) ?
|
||||
spell_id :
|
||||
GetSpellTriggerSpellID(spell_id, SE_CurrentHP)
|
||||
);
|
||||
|
||||
if (!spell_id) {
|
||||
spell_id = (
|
||||
IsEffectInSpell(spell_id, SE_CurrentHPOnce) ?
|
||||
spell_id :
|
||||
GetSpellTriggerSpellID(spell_id, SE_CurrentHPOnce)
|
||||
);
|
||||
}
|
||||
|
||||
if (spell_id) {
|
||||
@@ -1415,8 +1657,8 @@ bool IsRegularGroupHealSpell(uint16 spell_id)
|
||||
(
|
||||
spells[spell_id].effect_id[i] == SE_CurrentHP ||
|
||||
spells[spell_id].effect_id[i] == SE_CurrentHPOnce
|
||||
)
|
||||
) {
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1429,9 +1671,14 @@ bool IsRegularGroupHealSpell(uint16 spell_id)
|
||||
bool IsGroupCompleteHealSpell(uint16 spell_id)
|
||||
{
|
||||
if (
|
||||
IsGroupSpell(spell_id) &&
|
||||
IsCompleteHealSpell(spell_id)
|
||||
) {
|
||||
(
|
||||
spell_id == SPELL_COMPLETE_HEAL ||
|
||||
IsEffectInSpell(spell_id, SE_CompleteHeal) ||
|
||||
IsPercentalHealSpell(spell_id) ||
|
||||
GetSpellTriggerSpellID(spell_id, SE_CompleteHeal)
|
||||
) &&
|
||||
IsGroupSpell(spell_id)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1441,9 +1688,92 @@ bool IsGroupCompleteHealSpell(uint16 spell_id)
|
||||
bool IsGroupHealOverTimeSpell(uint16 spell_id)
|
||||
{
|
||||
if (
|
||||
IsGroupSpell(spell_id) &&
|
||||
IsHealOverTimeSpell(spell_id) &&
|
||||
spells[spell_id].buff_duration < 10
|
||||
(
|
||||
IsEffectInSpell(spell_id, SE_HealOverTime) ||
|
||||
GetSpellTriggerSpellID(spell_id, SE_HealOverTime)
|
||||
) &&
|
||||
IsGroupSpell(spell_id)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsAnyHealSpell(uint16 spell_id) {
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (spell_id == SPELL_NATURES_RECOVERY) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//spell_id != SPELL_ADRENALINE_SWELL &&
|
||||
//spell_id != SPELL_ADRENALINE_SWELL_RK2 &&
|
||||
//spell_id != SPELL_ADRENALINE_SWELL_RK3 &&
|
||||
if (
|
||||
IsHealOverTimeSpell(spell_id) ||
|
||||
IsGroupHealOverTimeSpell(spell_id) ||
|
||||
IsFastHealSpell(spell_id) ||
|
||||
IsVeryFastHealSpell(spell_id) ||
|
||||
IsRegularSingleTargetHealSpell(spell_id) ||
|
||||
IsRegularGroupHealSpell(spell_id) ||
|
||||
IsCompleteHealSpell(spell_id) ||
|
||||
IsGroupCompleteHealSpell(spell_id) ||
|
||||
IsRegularPetHealSpell(spell_id)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsAnyBuffSpell(uint16 spell_id) {
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
spell_id == SPELL_NATURES_RECOVERY ||
|
||||
IsBuffSpell(spell_id) &&
|
||||
IsBeneficialSpell(spell_id) &&
|
||||
!IsBardSong(spell_id) &&
|
||||
!IsEscapeSpell(spell_id) &&
|
||||
(!IsSummonPetSpell(spell_id) && !IsEffectInSpell(spell_id, SE_TemporaryPets))
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
bool IsDispelSpell(uint16 spell_id) {
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
IsEffectInSpell(spell_id, SE_CancelMagic) ||
|
||||
IsEffectInSpell(spell_id, SE_DispelBeneficial) ||
|
||||
IsEffectInSpell(spell_id, SE_DispelBeneficial)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsEscapeSpell(uint16 spell_id) {
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
IsInvulnerabilitySpell(spell_id) ||
|
||||
IsEffectInSpell(spell_id, SE_FeignDeath) ||
|
||||
IsEffectInSpell(spell_id, SE_DeathSave) ||
|
||||
IsEffectInSpell(spell_id, SE_Destroy) ||
|
||||
(IsEffectInSpell(spell_id, SE_WipeHateList) && spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_WipeHateList)] > 0)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
@@ -1464,7 +1794,8 @@ bool IsDebuffSpell(uint16 spell_id)
|
||||
IsEffectInSpell(spell_id, SE_CancelMagic) ||
|
||||
IsEffectInSpell(spell_id, SE_MovementSpeed) ||
|
||||
IsFearSpell(spell_id) ||
|
||||
IsEffectInSpell(spell_id, SE_InstantHate)
|
||||
IsEffectInSpell(spell_id, SE_InstantHate) ||
|
||||
IsEffectInSpell(spell_id, SE_TossUp)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
@@ -1472,6 +1803,22 @@ bool IsDebuffSpell(uint16 spell_id)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IsHateReduxSpell(uint16 spell_id) {
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
(IsEffectInSpell(spell_id, SE_InstantHate) && spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_InstantHate)] < 0) ||
|
||||
(IsEffectInSpell(spell_id, SE_Hate) && spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_Hate)] < 0) ||
|
||||
(IsEffectInSpell(spell_id, SE_ReduceHate) && spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_ReduceHate)] < 0)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsResistDebuffSpell(uint16 spell_id)
|
||||
{
|
||||
if (
|
||||
@@ -2383,7 +2730,7 @@ bool AegolismStackingIsSymbolSpell(uint16 spell_id) {
|
||||
|
||||
if ((i < 2 && spells[spell_id].effect_id[i] != SE_CHA) ||
|
||||
i > 3 && spells[spell_id].effect_id[i] != SE_Blank) {
|
||||
return 0;;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (i == 2 && spells[spell_id].effect_id[i] == SE_TotalHP) {
|
||||
@@ -2430,3 +2777,401 @@ bool AegolismStackingIsArmorClassSpell(uint16 spell_id) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int8 SpellEffectsCount(uint16 spell_id) {
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
int8 i = 0;
|
||||
|
||||
for (int i = 0; i < EFFECT_COUNT; i++) {
|
||||
if (!IsBlankSpellEffect(spell_id, i)) {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
bool IsLichSpell(uint16 spell_id)
|
||||
{
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
GetSpellTargetType(spell_id) == ST_Self &&
|
||||
IsEffectInSpell(spell_id, SE_CurrentMana) &&
|
||||
IsEffectInSpell(spell_id, SE_CurrentHP) &&
|
||||
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_CurrentMana)] > 0 &&
|
||||
spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_CurrentHP)] < 0 &&
|
||||
spells[spell_id].buff_duration > 0
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BOT_SPELL_TYPES_DETRIMENTAL(uint16 spellType, uint8 cls) {
|
||||
switch (spellType) {
|
||||
case BotSpellTypes::Nuke:
|
||||
case BotSpellTypes::Root:
|
||||
case BotSpellTypes::Lifetap:
|
||||
case BotSpellTypes::Snare:
|
||||
case BotSpellTypes::DOT:
|
||||
case BotSpellTypes::Dispel:
|
||||
case BotSpellTypes::Mez:
|
||||
case BotSpellTypes::Charm:
|
||||
case BotSpellTypes::Slow:
|
||||
case BotSpellTypes::Debuff:
|
||||
case BotSpellTypes::HateRedux:
|
||||
case BotSpellTypes::Fear:
|
||||
case BotSpellTypes::Stun:
|
||||
case BotSpellTypes::AENukes:
|
||||
case BotSpellTypes::AERains:
|
||||
case BotSpellTypes::AEMez:
|
||||
case BotSpellTypes::AEStun:
|
||||
case BotSpellTypes::AEDebuff:
|
||||
case BotSpellTypes::AESlow:
|
||||
case BotSpellTypes::AESnare:
|
||||
case BotSpellTypes::AEFear:
|
||||
case BotSpellTypes::AEDispel:
|
||||
case BotSpellTypes::AERoot:
|
||||
case BotSpellTypes::AEDoT:
|
||||
case BotSpellTypes::AELifetap:
|
||||
case BotSpellTypes::PBAENuke:
|
||||
return true;
|
||||
case BotSpellTypes::InCombatBuff:
|
||||
if (cls == Class::ShadowKnight) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BOT_SPELL_TYPES_BENEFICIAL(uint16 spellType, uint8 cls) {
|
||||
switch (spellType) {
|
||||
case BotSpellTypes::RegularHeal:
|
||||
case BotSpellTypes::CompleteHeal:
|
||||
case BotSpellTypes::GroupCompleteHeals:
|
||||
case BotSpellTypes::FastHeals:
|
||||
case BotSpellTypes::VeryFastHeals:
|
||||
case BotSpellTypes::GroupHeals:
|
||||
case BotSpellTypes::GroupHoTHeals:
|
||||
case BotSpellTypes::HoTHeals:
|
||||
case BotSpellTypes::PetRegularHeals:
|
||||
case BotSpellTypes::PetCompleteHeals:
|
||||
case BotSpellTypes::PetFastHeals:
|
||||
case BotSpellTypes::PetVeryFastHeals:
|
||||
case BotSpellTypes::PetHoTHeals:
|
||||
case BotSpellTypes::Buff:
|
||||
case BotSpellTypes::Cure:
|
||||
case BotSpellTypes::GroupCures:
|
||||
case BotSpellTypes::DamageShields:
|
||||
case BotSpellTypes::InCombatBuffSong:
|
||||
case BotSpellTypes::OutOfCombatBuffSong:
|
||||
case BotSpellTypes::Pet:
|
||||
case BotSpellTypes::PetBuffs:
|
||||
case BotSpellTypes::PreCombatBuff:
|
||||
case BotSpellTypes::PreCombatBuffSong:
|
||||
case BotSpellTypes::ResistBuffs:
|
||||
case BotSpellTypes::Resurrect:
|
||||
return true;
|
||||
case BotSpellTypes::InCombatBuff:
|
||||
if (cls == Class::ShadowKnight) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BOT_SPELL_TYPES_OTHER_BENEFICIAL(uint16 spellType) {
|
||||
switch (spellType) {
|
||||
case BotSpellTypes::RegularHeal:
|
||||
case BotSpellTypes::CompleteHeal:
|
||||
case BotSpellTypes::GroupCompleteHeals:
|
||||
case BotSpellTypes::FastHeals:
|
||||
case BotSpellTypes::VeryFastHeals:
|
||||
case BotSpellTypes::GroupHeals:
|
||||
case BotSpellTypes::GroupHoTHeals:
|
||||
case BotSpellTypes::HoTHeals:
|
||||
case BotSpellTypes::PetRegularHeals:
|
||||
case BotSpellTypes::PetCompleteHeals:
|
||||
case BotSpellTypes::PetFastHeals:
|
||||
case BotSpellTypes::PetVeryFastHeals:
|
||||
case BotSpellTypes::PetHoTHeals:
|
||||
case BotSpellTypes::Buff:
|
||||
case BotSpellTypes::Cure:
|
||||
case BotSpellTypes::GroupCures:
|
||||
case BotSpellTypes::DamageShields:
|
||||
case BotSpellTypes::PetBuffs:
|
||||
case BotSpellTypes::ResistBuffs:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BOT_SPELL_TYPES_INNATE(uint16 spellType) {
|
||||
switch (spellType) {
|
||||
case BotSpellTypes::AENukes:
|
||||
case BotSpellTypes::AERains:
|
||||
case BotSpellTypes::PBAENuke:
|
||||
case BotSpellTypes::Nuke:
|
||||
case BotSpellTypes::AEDispel:
|
||||
case BotSpellTypes::Dispel:
|
||||
case BotSpellTypes::AERoot:
|
||||
case BotSpellTypes::Root:
|
||||
case BotSpellTypes::AESlow:
|
||||
case BotSpellTypes::Slow:
|
||||
case BotSpellTypes::Charm:
|
||||
case BotSpellTypes::AEDebuff:
|
||||
case BotSpellTypes::Debuff:
|
||||
case BotSpellTypes::AEDoT:
|
||||
case BotSpellTypes::DOT:
|
||||
case BotSpellTypes::AELifetap:
|
||||
case BotSpellTypes::Lifetap:
|
||||
case BotSpellTypes::AEStun:
|
||||
case BotSpellTypes::Stun:
|
||||
case BotSpellTypes::AEMez:
|
||||
case BotSpellTypes::Mez:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsBotSpellType(uint16 spellType) {
|
||||
if (BOT_SPELL_TYPES_DETRIMENTAL(spellType) && BOT_SPELL_TYPES_BENEFICIAL(spellType) && BOT_SPELL_TYPES_INNATE(spellType)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsAEBotSpellType(uint16 spellType) {
|
||||
switch (spellType) {
|
||||
case BotSpellTypes::AEDebuff:
|
||||
case BotSpellTypes::AEFear:
|
||||
case BotSpellTypes::AEMez:
|
||||
case BotSpellTypes::AENukes:
|
||||
case BotSpellTypes::AERains:
|
||||
case BotSpellTypes::AESlow:
|
||||
case BotSpellTypes::AESnare:
|
||||
case BotSpellTypes::AEStun:
|
||||
case BotSpellTypes::AEDispel:
|
||||
case BotSpellTypes::AEDoT:
|
||||
case BotSpellTypes::PBAENuke:
|
||||
case BotSpellTypes::AELifetap:
|
||||
case BotSpellTypes::AERoot:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsGroupBotSpellType(uint16 spellType) {
|
||||
switch (spellType) {
|
||||
case BotSpellTypes::GroupCures:
|
||||
case BotSpellTypes::GroupCompleteHeals:
|
||||
case BotSpellTypes::GroupHeals:
|
||||
case BotSpellTypes::GroupHoTHeals:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsGroupTargetOnlyBotSpellType(uint16 spellType) {
|
||||
switch (spellType) {
|
||||
case BotSpellTypes::GroupCures:
|
||||
case BotSpellTypes::GroupCompleteHeals:
|
||||
case BotSpellTypes::GroupHeals:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsPetBotSpellType(uint16 spellType) {
|
||||
switch (spellType) {
|
||||
case BotSpellTypes::PetBuffs:
|
||||
case BotSpellTypes::PetRegularHeals:
|
||||
case BotSpellTypes::PetCompleteHeals:
|
||||
case BotSpellTypes::PetFastHeals:
|
||||
case BotSpellTypes::PetVeryFastHeals:
|
||||
case BotSpellTypes::PetHoTHeals:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsClientBotSpellType(uint16 spellType) {
|
||||
switch (spellType) {
|
||||
case BotSpellTypes::RegularHeal:
|
||||
case BotSpellTypes::CompleteHeal:
|
||||
case BotSpellTypes::GroupCompleteHeals:
|
||||
case BotSpellTypes::FastHeals:
|
||||
case BotSpellTypes::VeryFastHeals:
|
||||
case BotSpellTypes::GroupHeals:
|
||||
case BotSpellTypes::GroupHoTHeals:
|
||||
case BotSpellTypes::HoTHeals:
|
||||
case BotSpellTypes::PetRegularHeals:
|
||||
case BotSpellTypes::PetCompleteHeals:
|
||||
case BotSpellTypes::PetFastHeals:
|
||||
case BotSpellTypes::PetVeryFastHeals:
|
||||
case BotSpellTypes::PetHoTHeals:
|
||||
case BotSpellTypes::Buff:
|
||||
case BotSpellTypes::Cure:
|
||||
case BotSpellTypes::GroupCures:
|
||||
case BotSpellTypes::DamageShields:
|
||||
case BotSpellTypes::PetBuffs:
|
||||
case BotSpellTypes::ResistBuffs:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsHealBotSpellType(uint16 spellType) {
|
||||
switch (spellType) {
|
||||
case BotSpellTypes::VeryFastHeals:
|
||||
case BotSpellTypes::FastHeals:
|
||||
case BotSpellTypes::RegularHeal:
|
||||
case BotSpellTypes::GroupHeals:
|
||||
case BotSpellTypes::CompleteHeal:
|
||||
case BotSpellTypes::GroupCompleteHeals:
|
||||
case BotSpellTypes::HoTHeals:
|
||||
case BotSpellTypes::GroupHoTHeals:
|
||||
case BotSpellTypes::PetRegularHeals:
|
||||
case BotSpellTypes::PetCompleteHeals:
|
||||
case BotSpellTypes::PetFastHeals:
|
||||
case BotSpellTypes::PetVeryFastHeals:
|
||||
case BotSpellTypes::PetHoTHeals:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SpellTypeRequiresLoS(uint16 spellType, uint16 cls) {
|
||||
if (IsAEBotSpellType(spellType)) { // These gather their own targets later
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (spellType) {
|
||||
case BotSpellTypes::RegularHeal:
|
||||
case BotSpellTypes::GroupCompleteHeals:
|
||||
case BotSpellTypes::CompleteHeal:
|
||||
case BotSpellTypes::FastHeals:
|
||||
case BotSpellTypes::VeryFastHeals:
|
||||
case BotSpellTypes::GroupHeals:
|
||||
case BotSpellTypes::GroupHoTHeals:
|
||||
case BotSpellTypes::HoTHeals:
|
||||
case BotSpellTypes::PetRegularHeals:
|
||||
case BotSpellTypes::PetCompleteHeals:
|
||||
case BotSpellTypes::PetFastHeals:
|
||||
case BotSpellTypes::PetVeryFastHeals:
|
||||
case BotSpellTypes::PetHoTHeals:
|
||||
return false;
|
||||
case BotSpellTypes::InCombatBuff:
|
||||
if (cls && cls == Class::ShadowKnight) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SpellTypeRequiresTarget(uint16 spellType, uint16 cls) {
|
||||
switch (spellType) {
|
||||
case BotSpellTypes::Escape:
|
||||
if (cls == Class::ShadowKnight) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
case BotSpellTypes::Pet:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IsValidSpellAndLoS(uint32 spell_id, bool hasLoS) {
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!hasLoS && IsTargetRequiredForSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IsInstantHealSpell(uint32 spell_id) {
|
||||
if (IsRegularSingleTargetHealSpell(spell_id) || IsRegularGroupHealSpell(spell_id) || IsRegularPetHealSpell(spell_id) || IsRegularGroupHealSpell(spell_id) || spell_id == SPELL_COMPLETE_HEAL) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsResurrectSpell(uint16 spell_id)
|
||||
{
|
||||
return IsEffectInSpell(spell_id, SE_Revive);
|
||||
}
|
||||
|
||||
bool RequiresStackCheck(uint16 spellType) {
|
||||
switch (spellType) {
|
||||
case BotSpellTypes::VeryFastHeals:
|
||||
case BotSpellTypes::PetVeryFastHeals:
|
||||
case BotSpellTypes::FastHeals:
|
||||
case BotSpellTypes::PetFastHeals:
|
||||
case BotSpellTypes::RegularHeal:
|
||||
case BotSpellTypes::PetRegularHeals:
|
||||
case BotSpellTypes::CompleteHeal:
|
||||
case BotSpellTypes::PetCompleteHeals:
|
||||
case BotSpellTypes::GroupCompleteHeals:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+97
-3
@@ -213,6 +213,10 @@
|
||||
#define SPELL_BLOODTHIRST 8476
|
||||
#define SPELL_AMPLIFICATION 2603
|
||||
#define SPELL_DIVINE_REZ 2738
|
||||
#define SPELL_NATURES_RECOVERY 2520
|
||||
#define SPELL_ADRENALINE_SWELL 14445
|
||||
#define SPELL_ADRENALINE_SWELL_RK2 14446
|
||||
#define SPELL_ADRENALINE_SWELL_RK3 14447
|
||||
|
||||
// discipline IDs.
|
||||
#define DISC_UNHOLY_AURA 4520
|
||||
@@ -647,14 +651,84 @@ enum SpellTypes : uint32
|
||||
SpellType_PreCombatBuffSong = (1 << 21)
|
||||
};
|
||||
|
||||
const uint32 SPELL_TYPE_MIN = (SpellType_Nuke << 1) - 1;
|
||||
const uint32 SPELL_TYPE_MAX = (SpellType_PreCombatBuffSong << 1) - 1;
|
||||
const uint32 SPELL_TYPE_ANY = 0xFFFFFFFF;
|
||||
namespace BotSpellTypes
|
||||
{
|
||||
constexpr uint16 Nuke = 0;
|
||||
constexpr uint16 RegularHeal = 1;
|
||||
constexpr uint16 Root = 2;
|
||||
constexpr uint16 Buff = 3;
|
||||
constexpr uint16 Escape = 4;
|
||||
constexpr uint16 Pet = 5;
|
||||
constexpr uint16 Lifetap = 6;
|
||||
constexpr uint16 Snare = 7;
|
||||
constexpr uint16 DOT = 8;
|
||||
constexpr uint16 Dispel = 9;
|
||||
constexpr uint16 InCombatBuff = 10;
|
||||
constexpr uint16 Mez = 11;
|
||||
constexpr uint16 Charm = 12;
|
||||
constexpr uint16 Slow = 13;
|
||||
constexpr uint16 Debuff = 14;
|
||||
constexpr uint16 Cure = 15;
|
||||
constexpr uint16 Resurrect = 16;
|
||||
constexpr uint16 HateRedux = 17;
|
||||
constexpr uint16 InCombatBuffSong = 18;
|
||||
constexpr uint16 OutOfCombatBuffSong = 19;
|
||||
constexpr uint16 PreCombatBuff = 20;
|
||||
constexpr uint16 PreCombatBuffSong = 21;
|
||||
constexpr uint16 Fear = 22;
|
||||
constexpr uint16 Stun = 23;
|
||||
constexpr uint16 GroupCures = 24;
|
||||
constexpr uint16 CompleteHeal = 25;
|
||||
constexpr uint16 FastHeals = 26;
|
||||
constexpr uint16 VeryFastHeals = 27;
|
||||
constexpr uint16 GroupHeals = 28;
|
||||
constexpr uint16 GroupCompleteHeals = 29;
|
||||
constexpr uint16 GroupHoTHeals = 30;
|
||||
constexpr uint16 HoTHeals = 31;
|
||||
constexpr uint16 AENukes = 32;
|
||||
constexpr uint16 AERains = 33;
|
||||
constexpr uint16 AEMez = 34;
|
||||
constexpr uint16 AEStun = 35;
|
||||
constexpr uint16 AEDebuff = 36;
|
||||
constexpr uint16 AESlow = 37;
|
||||
constexpr uint16 AESnare = 38;
|
||||
constexpr uint16 AEFear = 39;
|
||||
constexpr uint16 AEDispel = 40;
|
||||
constexpr uint16 AERoot = 41;
|
||||
constexpr uint16 AEDoT = 42;
|
||||
constexpr uint16 AELifetap = 43;
|
||||
constexpr uint16 PBAENuke = 44;
|
||||
constexpr uint16 PetBuffs = 45;
|
||||
constexpr uint16 PetRegularHeals = 46;
|
||||
constexpr uint16 PetCompleteHeals = 47;
|
||||
constexpr uint16 PetFastHeals = 48;
|
||||
constexpr uint16 PetVeryFastHeals = 49;
|
||||
constexpr uint16 PetHoTHeals = 50;
|
||||
constexpr uint16 DamageShields = 51;
|
||||
constexpr uint16 ResistBuffs = 52;
|
||||
|
||||
constexpr uint16 START = BotSpellTypes::Nuke; // Do not remove or change this
|
||||
constexpr uint16 END = BotSpellTypes::ResistBuffs; // Do not remove this, increment as needed
|
||||
}
|
||||
|
||||
const uint32 SPELL_TYPES_DETRIMENTAL = (SpellType_Nuke | SpellType_Root | SpellType_Lifetap | SpellType_Snare | SpellType_DOT | SpellType_Dispel | SpellType_Mez | SpellType_Charm | SpellType_Debuff | SpellType_Slow);
|
||||
const uint32 SPELL_TYPES_BENEFICIAL = (SpellType_Heal | SpellType_Buff | SpellType_Escape | SpellType_Pet | SpellType_InCombatBuff | SpellType_Cure | SpellType_HateRedux | SpellType_InCombatBuffSong | SpellType_OutOfCombatBuffSong | SpellType_PreCombatBuff | SpellType_PreCombatBuffSong);
|
||||
const uint32 SPELL_TYPES_INNATE = (SpellType_Nuke | SpellType_Lifetap | SpellType_DOT | SpellType_Dispel | SpellType_Mez | SpellType_Slow | SpellType_Debuff | SpellType_Charm | SpellType_Root);
|
||||
|
||||
bool BOT_SPELL_TYPES_DETRIMENTAL (uint16 spellType, uint8 cls = 0);
|
||||
bool BOT_SPELL_TYPES_BENEFICIAL (uint16 spellType, uint8 cls = 0);
|
||||
bool BOT_SPELL_TYPES_OTHER_BENEFICIAL(uint16 spellType);
|
||||
bool BOT_SPELL_TYPES_INNATE (uint16 spellType);
|
||||
bool IsBotSpellType (uint16 spellType);
|
||||
bool IsAEBotSpellType(uint16 spellType);
|
||||
bool IsGroupBotSpellType(uint16 spellType);
|
||||
bool IsGroupTargetOnlyBotSpellType(uint16 spellType);
|
||||
bool IsPetBotSpellType(uint16 spellType);
|
||||
bool IsClientBotSpellType(uint16 spellType);
|
||||
bool IsHealBotSpellType(uint16 spellType);
|
||||
bool SpellTypeRequiresLoS(uint16 spellType, uint16 cls = 0);
|
||||
bool SpellTypeRequiresTarget(uint16 spellType, uint16 cls = 0);
|
||||
|
||||
// These should not be used to determine spell category..
|
||||
// They are a graphical affects (effects?) index only
|
||||
// TODO: import sai list
|
||||
@@ -1503,6 +1577,7 @@ bool IsTargetableAESpell(uint16 spell_id);
|
||||
bool IsSacrificeSpell(uint16 spell_id);
|
||||
bool IsLifetapSpell(uint16 spell_id);
|
||||
bool IsMesmerizeSpell(uint16 spell_id);
|
||||
bool SpellBreaksMez(uint16 spell_id);
|
||||
bool IsStunSpell(uint16 spell_id);
|
||||
bool IsSlowSpell(uint16 spell_id);
|
||||
bool IsHasteSpell(uint16 spell_id);
|
||||
@@ -1536,6 +1611,11 @@ bool IsPureNukeSpell(uint16 spell_id);
|
||||
bool IsAENukeSpell(uint16 spell_id);
|
||||
bool IsPBAENukeSpell(uint16 spell_id);
|
||||
bool IsAERainNukeSpell(uint16 spell_id);
|
||||
bool IsAnyNukeOrStunSpell(uint16 spell_id);
|
||||
bool IsAnyAESpell(uint16 spell_id);
|
||||
bool IsAESpell(uint16 spell_id);
|
||||
bool IsPBAESpell(uint16 spell_id);
|
||||
bool IsAERainSpell(uint16 spell_id);
|
||||
bool IsPartialResistableSpell(uint16 spell_id);
|
||||
bool IsResistableSpell(uint16 spell_id);
|
||||
bool IsGroupSpell(uint16 spell_id);
|
||||
@@ -1545,8 +1625,11 @@ bool IsEffectInSpell(uint16 spell_id, int effect_id);
|
||||
uint16 GetSpellTriggerSpellID(uint16 spell_id, int effect_id);
|
||||
bool IsBlankSpellEffect(uint16 spell_id, int effect_index);
|
||||
bool IsValidSpell(uint32 spell_id);
|
||||
bool IsValidSpellAndLoS(uint32 spell_id, bool hasLoS = true);
|
||||
bool IsSummonSpell(uint16 spell_id);
|
||||
bool IsDamageSpell(uint16 spell_id);
|
||||
bool IsAnyDamageSpell(uint16 spell_id);
|
||||
bool IsDamageOverTimeSpell(uint16 spell_i);
|
||||
bool IsFearSpell(uint16 spell_id);
|
||||
bool IsCureSpell(uint16 spell_id);
|
||||
bool IsHarmTouchSpell(uint16 spell_id);
|
||||
@@ -1585,10 +1668,16 @@ bool IsCompleteHealSpell(uint16 spell_id);
|
||||
bool IsFastHealSpell(uint16 spell_id);
|
||||
bool IsVeryFastHealSpell(uint16 spell_id);
|
||||
bool IsRegularSingleTargetHealSpell(uint16 spell_id);
|
||||
bool IsRegularPetHealSpell(uint16 spell_id);
|
||||
bool IsRegularGroupHealSpell(uint16 spell_id);
|
||||
bool IsGroupCompleteHealSpell(uint16 spell_id);
|
||||
bool IsGroupHealOverTimeSpell(uint16 spell_id);
|
||||
bool IsAnyHealSpell(uint16 spell_id);
|
||||
bool IsAnyBuffSpell(uint16 spell_id);
|
||||
bool IsDispelSpell(uint16 spell_id);
|
||||
bool IsEscapeSpell(uint16 spell_id);
|
||||
bool IsDebuffSpell(uint16 spell_id);
|
||||
bool IsHateReduxSpell(uint16 spell_id);
|
||||
bool IsResistDebuffSpell(uint16 spell_id);
|
||||
bool IsSelfConversionSpell(uint16 spell_id);
|
||||
bool IsBuffSpell(uint16 spell_id);
|
||||
@@ -1628,5 +1717,10 @@ bool IsCastRestrictedSpell(uint16 spell_id);
|
||||
bool IsAegolismSpell(uint16 spell_id);
|
||||
bool AegolismStackingIsSymbolSpell(uint16 spell_id);
|
||||
bool AegolismStackingIsArmorClassSpell(uint16 spell_id);
|
||||
int8 SpellEffectsCount(uint16 spell_id);
|
||||
bool IsLichSpell(uint16 spell_id);
|
||||
bool IsInstantHealSpell(uint32 spell_id);
|
||||
bool IsResurrectSpell(uint16 spell_id);
|
||||
bool RequiresStackCheck(uint16 spellType);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user