diff --git a/common/spdat.cpp b/common/spdat.cpp index 48b6351fb..8211ecfdc 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -2874,14 +2874,16 @@ bool BOT_SPELL_TYPES_BENEFICIAL(uint16 spellType, uint8 cls) { case BotSpellTypes::Buff: case BotSpellTypes::Cure: case BotSpellTypes::GroupCures: - case BotSpellTypes::DamageShields: + 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::PetDamageShields: + case BotSpellTypes::PetResistBuffs: + case BotSpellTypes::ResistBuffs: case BotSpellTypes::Resurrect: return true; case BotSpellTypes::InCombatBuff: @@ -2916,8 +2918,10 @@ bool BOT_SPELL_TYPES_OTHER_BENEFICIAL(uint16 spellType) { case BotSpellTypes::Cure: case BotSpellTypes::GroupCures: case BotSpellTypes::DamageShields: + case BotSpellTypes::PetDamageShields: case BotSpellTypes::PetBuffs: case BotSpellTypes::ResistBuffs: + case BotSpellTypes::PetResistBuffs: return true; default: return false; @@ -3050,8 +3054,10 @@ bool IsClientBotSpellType(uint16 spellType) { case BotSpellTypes::Cure: case BotSpellTypes::GroupCures: case BotSpellTypes::DamageShields: + case BotSpellTypes::PetDamageShields: case BotSpellTypes::PetBuffs: case BotSpellTypes::ResistBuffs: + case BotSpellTypes::PetResistBuffs: return true; default: return false; diff --git a/common/spdat.h b/common/spdat.h index b07bf7d96..60257a401 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -705,10 +705,12 @@ namespace BotSpellTypes constexpr uint16 PetVeryFastHeals = 49; constexpr uint16 PetHoTHeals = 50; constexpr uint16 DamageShields = 51; - constexpr uint16 ResistBuffs = 52; + constexpr uint16 ResistBuffs = 52; + constexpr uint16 PetDamageShields = 53; + constexpr uint16 PetResistBuffs = 54; - constexpr uint16 START = BotSpellTypes::Nuke; // Do not remove or change this - constexpr uint16 END = BotSpellTypes::ResistBuffs; // Do not remove this, increment as needed + constexpr uint16 START = BotSpellTypes::Nuke; // Do not remove or change this + constexpr uint16 END = BotSpellTypes::PetResistBuffs; // 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); diff --git a/zone/bot.cpp b/zone/bot.cpp index 328f5c7af..de129d9eb 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -9505,7 +9505,9 @@ bool Bot::CanCastSpellType(uint16 spellType, uint16 spellid, Mob* tar) { case BotSpellTypes::PetBuffs: case BotSpellTypes::PreCombatBuff: case BotSpellTypes::DamageShields: - case BotSpellTypes::ResistBuffs: + case BotSpellTypes::PetDamageShields: + case BotSpellTypes::ResistBuffs: + case BotSpellTypes::PetResistBuffs: if ( !( spells[spellid].target_type == ST_Target || @@ -10400,6 +10402,14 @@ uint16 Bot::GetDefaultSpellTypeIdlePriority(uint16 spellType, uint8 botClass, ui case BotSpellTypes::PreCombatBuffSong: priority = 23; + break; + case BotSpellTypes::PetResistBuffs: + priority = 24; + + break; + case BotSpellTypes::PetDamageShields: + priority = 25; + break; default: priority = 0; //unused @@ -10861,7 +10871,9 @@ uint16 Bot::GetSpellListSpellType(uint16 spellType) { case BotSpellTypes::Buff: case BotSpellTypes::PetBuffs: case BotSpellTypes::DamageShields: - case BotSpellTypes::ResistBuffs: + case BotSpellTypes::PetDamageShields: + case BotSpellTypes::ResistBuffs: + case BotSpellTypes::PetResistBuffs: return BotSpellTypes::Buff; case BotSpellTypes::AEMez: case BotSpellTypes::Mez: @@ -10921,18 +10933,21 @@ bool Bot::IsValidSpellTypeBySpellID(uint16 spellType, uint16 spellid) { switch (spellType) { case BotSpellTypes::Buff: + case BotSpellTypes::PetBuffs: if (IsResistanceOnlySpell(spellid) || IsDamageShieldOnlySpell(spellid) || IsDamageShieldAndResistanceSpellOnly(spellid)) { return false; } return true; case BotSpellTypes::ResistBuffs: + case BotSpellTypes::PetResistBuffs: if (IsResistanceOnlySpell(spellid)) { return true; } return false; case BotSpellTypes::DamageShields: + case BotSpellTypes::PetDamageShields: if (IsDamageShieldOnlySpell(spellid) || IsDamageShieldAndResistanceSpellOnly(spellid)) { return true; } diff --git a/zone/bot_commands/spell_holds.cpp b/zone/bot_commands/spell_holds.cpp index effd97a7a..fd17749d1 100644 --- a/zone/bot_commands/spell_holds.cpp +++ b/zone/bot_commands/spell_holds.cpp @@ -9,15 +9,12 @@ void bot_command_spell_holds(Client* c, const Seperator* sep) if (helper_is_help_or_usage(sep->arg[1])) { std::vector description = { - "Toggles whether or not bots can cast or receive certain spell types" + "Toggles whether or not bots can cast certain spell types" }; std::vector notes = { - "- All pet types are based off the pet's owner's setting", - "- Any remaining types use the owner's setting when a pet is the target", - "- All Heals, Cures, Buffs (DS and resists included) are based off the target's setting, not the caster", - "- e.g., BotA is healing BotB using BotB's settings", + "- All pet types are based off the pet owner's setting when a pet is the target" }; std::vector example_format = diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index d7e633822..b0ca5edf4 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -125,7 +125,9 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 spellType) { case BotSpellTypes::PetBuffs: case BotSpellTypes::PreCombatBuff: case BotSpellTypes::DamageShields: + case BotSpellTypes::PetDamageShields: case BotSpellTypes::ResistBuffs: + case BotSpellTypes::PetResistBuffs: if (!tar->IsOfClientBot() && !(tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot())) { return false; } @@ -2039,7 +2041,9 @@ uint8 Bot::GetChanceToCastBySpellType(uint16 spellType) //TODO bot rewrite - adj case BotSpellTypes::Buff: case BotSpellTypes::PetBuffs: case BotSpellTypes::ResistBuffs: + case BotSpellTypes::PetResistBuffs: case BotSpellTypes::DamageShields: + case BotSpellTypes::PetDamageShields: return RuleI(Bots, PercentChanceToCastBuff); case BotSpellTypes::Escape: return RuleI(Bots, PercentChanceToCastEscape); diff --git a/zone/mob.cpp b/zone/mob.cpp index e75ce0068..5ef232a75 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -8869,6 +8869,12 @@ std::string Mob::GetSpellTypeNameByID(uint16 spellType) { case BotSpellTypes::ResistBuffs: spellTypeName = "Resist Buff"; break; + case BotSpellTypes::PetDamageShields: + spellTypeName = "Pet Damage Shield"; + break; + case BotSpellTypes::PetResistBuffs: + spellTypeName = "Pet Resist Buff"; + break; default: break; } @@ -9039,6 +9045,12 @@ std::string Mob::GetSpellTypeShortNameByID(uint16 spellType) { case BotSpellTypes::ResistBuffs: spellTypeName = "resistbuffs"; break; + case BotSpellTypes::PetDamageShields: + spellTypeName = "petdamageshields"; + break; + case BotSpellTypes::PetResistBuffs: + spellTypeName = "petresistbuffs"; + break; default: break; } @@ -9318,7 +9330,7 @@ uint8 Mob::GetDefaultSpellMaxThreshold(uint16 spellType, uint8 stance) { case BotSpellTypes::Buff: case BotSpellTypes::Charm: case BotSpellTypes::Cure: - case BotSpellTypes::DamageShields: + case BotSpellTypes::DamageShields: case BotSpellTypes::HateRedux: case BotSpellTypes::InCombatBuff: case BotSpellTypes::InCombatBuffSong: @@ -9329,6 +9341,8 @@ uint8 Mob::GetDefaultSpellMaxThreshold(uint16 spellType, uint8 stance) { case BotSpellTypes::PetBuffs: case BotSpellTypes::PreCombatBuff: case BotSpellTypes::PreCombatBuffSong: + case BotSpellTypes::PetDamageShields: + case BotSpellTypes::PetResistBuffs: case BotSpellTypes::ResistBuffs: case BotSpellTypes::Resurrect: return 100; @@ -9401,10 +9415,6 @@ bool Mob::GetUltimateSpellHold(uint16 spellType, Mob* tar) { return tar->GetOwner()->GetSpellHold(GetPetSpellType(spellType)); } - if (BOT_SPELL_TYPES_OTHER_BENEFICIAL(spellType) && tar->IsOfClientBot()) { - return tar->GetSpellHold(spellType); - } - return GetSpellHold(spellType); } @@ -9486,6 +9496,10 @@ uint16 Mob::GetPetSpellType(uint16 spellType) { return BotSpellTypes::PetHoTHeals; case BotSpellTypes::Buff: return BotSpellTypes::PetBuffs; + case BotSpellTypes::DamageShields: + return BotSpellTypes::PetDamageShields; + case BotSpellTypes::ResistBuffs: + return BotSpellTypes::PetResistBuffs; default: break; }