Implement more commanded types properly, move shadownight hate to hateline type...

Add incapacitated checks to casting logic and checks.
Add candocombat zone check, summon other's corpse for bot, in/out combat spell checks, mute checks, level restriction
This commit is contained in:
nytmyr
2024-11-27 13:51:37 -06:00
parent ee9651b4f1
commit b2590b5056
9 changed files with 587 additions and 247 deletions
@@ -513,7 +513,7 @@ UPDATE bot_spells_entries SET `type` = 4 WHERE `spell_id` = 10436;
.match = "",
.sql = R"(
INSERT INTO `bot_spells_entries` (`npc_spells_id`, `spell_id`, `type`, `minlevel`, `maxlevel`)
VALUES
VALUES
(3006, 9957, 100, 20, 254),
(3006, 9956, 100, 20, 254),
(3006, 552, 100, 25, 254),
@@ -764,31 +764,6 @@ VALUES
(3006, 34863, 101, 96, 254),
(3006, 34864, 101, 96, 254),
(3006, 34862, 101, 96, 254),
(3007, 4614, 101, 35, 49),
(3007, 4683, 101, 50, 56),
(3007, 4684, 101, 57, 63),
(3007, 4698, 101, 64, 64),
(3007, 5019, 101, 65, 254),
(3007, 5020, 101, 65, 254),
(3007, 6175, 101, 69, 70),
(3007, 10949, 101, 71, 75),
(3007, 10947, 101, 71, 75),
(3007, 10948, 101, 71, 75),
(3007, 14800, 101, 76, 80),
(3007, 14801, 101, 76, 80),
(3007, 14799, 101, 76, 80),
(3007, 18905, 101, 81, 85),
(3007, 18906, 101, 81, 85),
(3007, 18904, 101, 81, 85),
(3007, 25912, 101, 86, 90),
(3007, 25913, 101, 86, 90),
(3007, 25911, 101, 86, 90),
(3007, 29006, 101, 91, 95),
(3007, 29007, 101, 91, 95),
(3007, 29008, 101, 91, 95),
(3007, 35047, 101, 96, 254),
(3007, 35048, 101, 96, 254),
(3007, 35049, 101, 96, 254),
(3008, 728, 101, 8, 60),
(3008, 3361, 101, 61, 254),
(3008, 5370, 101, 66, 70),
@@ -1090,6 +1065,104 @@ VALUES
(3011, 25555, 112, 86, 90),
(3011, 28632, 112, 91, 95),
(3011, 34662, 112, 96, 254);
)"
},
ManifestEntry{
.version = 9051,
.description = "2024_11_26_remove_sk_icb.sql",
.check = "SELECT * FROM `bot_spells_entries` where `type` = 55",
.condition = "empty",
.match = "",
.sql = R"(
DELETE
FROM bot_spells_entries
WHERE `npc_spells_id` = 3005
AND `type` = 10;
INSERT INTO `bot_spells_entries` (`npc_spells_id`, `spell_id`, `type`, `minlevel`, `maxlevel`)
VALUES
(3003, 10175, 55, 72, 76),
(3003, 10173, 55, 72, 76),
(3003, 10174, 55, 72, 76),
(3003, 14956, 55, 77, 81),
(3003, 14954, 55, 77, 81),
(3003, 14955, 55, 77, 81),
(3003, 19070, 55, 82, 86),
(3003, 19068, 55, 82, 86),
(3003, 19069, 55, 82, 86),
(3003, 25298, 55, 87, 91),
(3003, 25299, 55, 87, 91),
(3003, 25297, 55, 87, 91),
(3003, 28348, 55, 92, 96),
(3003, 28349, 55, 92, 96),
(3003, 28347, 55, 92, 96),
(3003, 34351, 55, 97, 254),
(3003, 34352, 55, 97, 254),
(3003, 34350, 55, 97, 254),
(3003, 40078, 55, 98, 254),
(3003, 40079, 55, 98, 254),
(3003, 40080, 55, 98, 254),
(3005, 1221, 55, 33, 41),
(3005, 1222, 55, 42, 52),
(3005, 1223, 55, 53, 58),
(3005, 1224, 55, 59, 62),
(3005, 3405, 55, 63, 66),
(3005, 5329, 55, 67, 70),
(3005, 5336, 55, 69, 73),
(3005, 10258, 55, 71, 71),
(3005, 10259, 55, 71, 71),
(3005, 10257, 55, 71, 71),
(3005, 10261, 55, 72, 76),
(3005, 10262, 55, 72, 76),
(3005, 10260, 55, 72, 76),
(3005, 10291, 55, 74, 78),
(3005, 10292, 55, 74, 78),
(3005, 10293, 55, 74, 78),
(3005, 15160, 55, 76, 76),
(3005, 15161, 55, 76, 76),
(3005, 15162, 55, 76, 76),
(3005, 15165, 55, 77, 81),
(3005, 15163, 55, 77, 81),
(3005, 15164, 55, 77, 81),
(3005, 15186, 55, 79, 83),
(3005, 15184, 55, 79, 83),
(3005, 15185, 55, 79, 83),
(3005, 19315, 55, 81, 81),
(3005, 19313, 55, 81, 81),
(3005, 19314, 55, 81, 81),
(3005, 19317, 55, 82, 86),
(3005, 19318, 55, 82, 86),
(3005, 19316, 55, 82, 86),
(3005, 19338, 55, 84, 88),
(3005, 19339, 55, 84, 88),
(3005, 19337, 55, 84, 88),
(3005, 25581, 55, 86, 86),
(3005, 25582, 55, 86, 86),
(3005, 25580, 55, 86, 86),
(3005, 25586, 55, 87, 91),
(3005, 25587, 55, 87, 91),
(3005, 25588, 55, 87, 91),
(3005, 25641, 55, 89, 93),
(3005, 25642, 55, 89, 93),
(3005, 25643, 55, 89, 93),
(3005, 28659, 55, 91, 91),
(3005, 28657, 55, 91, 91),
(3005, 28658, 55, 91, 91),
(3005, 28665, 55, 92, 96),
(3005, 28663, 55, 92, 96),
(3005, 28664, 55, 92, 96),
(3005, 28735, 55, 94, 98),
(3005, 28733, 55, 94, 98),
(3005, 28734, 55, 94, 98),
(3005, 34688, 55, 96, 96),
(3005, 34689, 55, 96, 96),
(3005, 34687, 55, 96, 96),
(3005, 34694, 55, 97, 254),
(3005, 34695, 55, 97, 254),
(3005, 34693, 55, 97, 254),
(3005, 34752, 55, 99, 254),
(3005, 34753, 55, 99, 254),
(3005, 34751, 55, 99, 254);
)"
}
// -- template; copy/paste this when you need to create a new entry
+1
View File
@@ -806,6 +806,7 @@ RULE_INT(Bots, PercentChanceToCastSnare, 75, "The chance for a bot to attempt to
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, PercentChanceToCastHateLine, 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%.")
+42 -25
View File
@@ -2843,13 +2843,8 @@ bool BOT_SPELL_TYPES_DETRIMENTAL(uint16 spellType, uint8 cls) {
case BotSpellTypes::AELifetap:
case BotSpellTypes::PBAENuke:
case BotSpellTypes::Lull:
case BotSpellTypes::HateLine:
return true;
case BotSpellTypes::InCombatBuff:
if (cls == Class::ShadowKnight) {
return true;
}
return false;
default:
return false;
}
@@ -2898,12 +2893,6 @@ bool BOT_SPELL_TYPES_BENEFICIAL(uint16 spellType, uint8 cls) {
case BotSpellTypes::MovementSpeed:
case BotSpellTypes::SendHome:
case BotSpellTypes::SummonCorpse:
return true;
case BotSpellTypes::InCombatBuff:
if (cls == Class::ShadowKnight) {
return false;
}
return true;
default:
return false;
@@ -3134,12 +3123,7 @@ bool SpellTypeRequiresLoS(uint16 spellType, uint16 cls) {
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;
@@ -3150,13 +3134,44 @@ bool SpellTypeRequiresLoS(uint16 spellType, uint16 cls) {
bool SpellTypeRequiresTarget(uint16 spellType, uint16 cls) {
switch (spellType) {
case BotSpellTypes::Escape:
if (cls == Class::ShadowKnight) {
return false;
}
return true;
case BotSpellTypes::Pet:
case BotSpellTypes::Succor:
return false;
default:
return true;
}
return true;
}
bool SpellTypeRequiresCastChecks(uint16 spellType) {
switch (spellType) {
case BotSpellTypes::AEDebuff:
case BotSpellTypes::AEDispel:
case BotSpellTypes::AEDoT:
case BotSpellTypes::AEFear:
case BotSpellTypes::AELifetap:
case BotSpellTypes::AEMez:
case BotSpellTypes::AENukes:
case BotSpellTypes::AERains:
case BotSpellTypes::AERoot:
case BotSpellTypes::AESlow:
case BotSpellTypes::AESnare:
case BotSpellTypes::AEStun:
case BotSpellTypes::PBAENuke:
case BotSpellTypes::Mez:
case BotSpellTypes::SummonCorpse:
return false;
default:
return true;
}
return true;
}
bool SpellTypeRequiresAEChecks(uint16 spellType) {
switch (spellType) {
case BotSpellTypes::AEMez:
return false;
default:
return true;
@@ -3263,6 +3278,10 @@ bool IsDamageShieldOnlySpell(uint16 spell_id) {
bool IsCommandedSpellType(uint16 spellType) {
switch (spellType) {
case BotSpellTypes::Charm:
case BotSpellTypes::AEFear:
case BotSpellTypes::Fear:
case BotSpellTypes::Resurrect:
case BotSpellTypes::Lull:
case BotSpellTypes::Teleport:
case BotSpellTypes::Succor:
@@ -3276,8 +3295,6 @@ bool IsCommandedSpellType(uint16 spellType) {
case BotSpellTypes::MovementSpeed:
case BotSpellTypes::SendHome:
case BotSpellTypes::SummonCorpse:
//case BotSpellTypes::Charm:
//case BotSpellTypes::Resurrect:
//case BotSpellTypes::Cure:
//case BotSpellTypes::GroupCures:
//case BotSpellTypes::DamageShields:
+4 -1
View File
@@ -708,6 +708,7 @@ namespace BotSpellTypes
constexpr uint16 ResistBuffs = 52;
constexpr uint16 PetDamageShields = 53;
constexpr uint16 PetResistBuffs = 54;
constexpr uint16 HateLine = 55;
// Command Spell Types
constexpr uint16 Teleport = 100; // this is handled by ^depart so uses other logic
@@ -725,7 +726,7 @@ namespace BotSpellTypes
constexpr uint16 SummonCorpse = 112;
constexpr uint16 START = BotSpellTypes::Nuke; // Do not remove or change this
constexpr uint16 END = BotSpellTypes::PetResistBuffs; // Do not remove this, increment as needed
constexpr uint16 END = BotSpellTypes::HateLine; // Do not remove this, increment as needed
constexpr uint16 COMMANDED_START = BotSpellTypes::Lull; // Do not remove or change this
constexpr uint16 COMMANDED_END = BotSpellTypes::SummonCorpse; // Do not remove this, increment as needed
}
@@ -747,6 +748,8 @@ bool IsClientBotSpellType(uint16 spellType);
bool IsHealBotSpellType(uint16 spellType);
bool SpellTypeRequiresLoS(uint16 spellType, uint16 cls = 0);
bool SpellTypeRequiresTarget(uint16 spellType, uint16 cls = 0);
bool SpellTypeRequiresCastChecks(uint16 spellType);
bool SpellTypeRequiresAEChecks(uint16 spellType);
bool IsCommandedSpellType(uint16 spellType);
// These should not be used to determine spell category..