Remove misc target_type checks

This commit is contained in:
nytmyr
2024-12-10 14:01:29 -06:00
parent 746bccf4fd
commit 2bffc1b79c
2 changed files with 23 additions and 30 deletions
+1 -9
View File
@@ -9739,15 +9739,7 @@ bool Bot::CanCastSpellType(uint16 spellType, uint16 spell_id, Mob* tar) {
case BotSpellTypes::Invisibility: case BotSpellTypes::Invisibility:
case BotSpellTypes::MovementSpeed: case BotSpellTypes::MovementSpeed:
case BotSpellTypes::SendHome: case BotSpellTypes::SendHome:
if ( // TODO bot rewrite - fix this, missing other target types (43 for example) if (tar == this && spells[spell_id].target_type == ST_TargetsTarget) {
!(
spells[spell_id].target_type == ST_Target ||
spells[spell_id].target_type == ST_Pet ||
(tar == this && spells[spell_id].target_type != ST_TargetsTarget) ||
spells[spell_id].target_type == ST_Group ||
spells[spell_id].target_type == ST_GroupTeleport
)
) {
LogBotPreChecks("{} says, 'Cancelling cast of {} on {} due to target_type checks. Using {}'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName(), GetSpellTargetType(spell_id)); //deleteme LogBotPreChecks("{} says, 'Cancelling cast of {} on {} due to target_type checks. Using {}'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName(), GetSpellTargetType(spell_id)); //deleteme
return false; return false;
} }
+22 -21
View File
@@ -595,27 +595,28 @@ bool Bot::AIDoSpellCast(int32 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgain
} else } else
dist2 = DistanceSquared(m_Position, tar->GetPosition()); dist2 = DistanceSquared(m_Position, tar->GetPosition());
if ( //if (
( // (
( // (
( // (
(spells[AIBot_spells[i].spellid].target_type==ST_GroupTeleport && AIBot_spells[i].type == BotSpellTypes::RegularHeal) || // (spells[AIBot_spells[i].spellid].target_type==ST_GroupTeleport && AIBot_spells[i].type == BotSpellTypes::RegularHeal) ||
spells[AIBot_spells[i].spellid].target_type ==ST_AECaster || // spells[AIBot_spells[i].spellid].target_type ==ST_AECaster ||
spells[AIBot_spells[i].spellid].target_type ==ST_Group || // spells[AIBot_spells[i].spellid].target_type ==ST_Group ||
spells[AIBot_spells[i].spellid].target_type ==ST_AEBard || // spells[AIBot_spells[i].spellid].target_type ==ST_AEBard ||
( // (
tar == this && spells[AIBot_spells[i].spellid].target_type != ST_TargetsTarget // tar == this && spells[AIBot_spells[i].spellid].target_type != ST_TargetsTarget
) // )
) && // ) &&
dist2 <= spells[AIBot_spells[i].spellid].aoe_range*spells[AIBot_spells[i].spellid].aoe_range // dist2 <= spells[AIBot_spells[i].spellid].aoe_range*spells[AIBot_spells[i].spellid].aoe_range
) || // ) ||
dist2 <= GetActSpellRange(AIBot_spells[i].spellid, spells[AIBot_spells[i].spellid].range)*GetActSpellRange(AIBot_spells[i].spellid, spells[AIBot_spells[i].spellid].range) // dist2 <= GetActSpellRange(AIBot_spells[i].spellid, spells[AIBot_spells[i].spellid].range)*GetActSpellRange(AIBot_spells[i].spellid, spells[AIBot_spells[i].spellid].range)
) && // ) &&
( // (
mana_cost <= GetMana() || // mana_cost <= GetMana() ||
IsBotNonSpellFighter() // IsBotNonSpellFighter()
) // )
) { //) {
if (IsValidSpellRange(AIBot_spells[i].spellid, tar) && (mana_cost <= GetMana() || IsBotNonSpellFighter())) {
casting_spell_AIindex = i; casting_spell_AIindex = i;
LogAI("spellid [{}] tar [{}] mana [{}] Name [{}]", AIBot_spells[i].spellid, tar->GetName(), mana_cost, spells[AIBot_spells[i].spellid].name); LogAI("spellid [{}] tar [{}] mana [{}] Name [{}]", AIBot_spells[i].spellid, tar->GetName(), mana_cost, spells[AIBot_spells[i].spellid].name);
result = Mob::CastSpell(AIBot_spells[i].spellid, tar->GetID(), EQ::spells::CastingSlot::Gem2, spells[AIBot_spells[i].spellid].cast_time, AIBot_spells[i].manacost == -2 ? 0 : mana_cost, oDontDoAgainBefore, -1, -1, 0, &(AIBot_spells[i].resist_adjust)); result = Mob::CastSpell(AIBot_spells[i].spellid, tar->GetID(), EQ::spells::CastingSlot::Gem2, spells[AIBot_spells[i].spellid].cast_time, AIBot_spells[i].manacost == -2 ? 0 : mana_cost, oDontDoAgainBefore, -1, -1, 0, &(AIBot_spells[i].resist_adjust));