From 693abdd42cce8caa255f99eefd0f7fdab4905c20 Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Thu, 12 Dec 2024 07:59:54 -0600 Subject: [PATCH] ^cast adjustments for spellid casts --- zone/bot.cpp | 8 ++++++++ zone/bot.h | 1 + zone/bot_commands/cast.cpp | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index ff8214f1a..39ba17500 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -11184,6 +11184,14 @@ bool Bot::AttemptForcedCastSpell(Mob* tar, uint16 spell_id) { tar = this; } + if ((IsCharmSpell(forcedSpellID) || IsPetSpell(forcedSpellID) && HasPet())) { + return false; + } + + if (IsResurrectSpell(forcedSpellID) && (!tar->IsCorpse() || !tar->CastToCorpse()->IsPlayerCorpse())) { + return false; + } + if (IsBeneficialSpell(forcedSpellID)) { if ( (tar->IsNPC() && !tar->GetOwner()) || diff --git a/zone/bot.h b/zone/bot.h index 98475e909..287721ae9 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -752,6 +752,7 @@ public: // "Quest API" Methods bool HasBotSpellEntry(uint16 spell_id); + bool CanUseBotSpell(uint16 spell_id); void ApplySpell(int spell_id, int duration = 0, int level = -1, ApplySpellType apply_type = ApplySpellType::Solo, bool allow_pets = false, bool is_raid_group_only = true); void BreakInvis(); void Escape(); diff --git a/zone/bot_commands/cast.cpp b/zone/bot_commands/cast.cpp index 65d03ad2b..afc923118 100644 --- a/zone/bot_commands/cast.cpp +++ b/zone/bot_commands/cast.cpp @@ -551,7 +551,7 @@ void bot_command_cast(Client* c, const Seperator* sep) SPDat_Spell_Struct spell = spells[chosenSpellID]; LogTestDebug("Starting bySpellID checks."); //deleteme - if (!bot_iter->HasBotSpellEntry(chosenSpellID)) { + if (!bot_iter->CanUseBotSpell(chosenSpellID)) { LogTestDebug("{} does not have {} [#{}].", bot_iter->GetCleanName(), spell.name, chosenSpellID); //deleteme continue; }