Fix ^cast summoncorpse

This commit is contained in:
nytmyr
2025-01-27 23:33:16 -06:00
parent 69d5d1a883
commit b5a200554b
2 changed files with 17 additions and 20 deletions
+7 -8
View File
@@ -9644,17 +9644,16 @@ bool Bot::CastChecks(uint16 spell_id, Mob* tar, uint16 spell_type, bool precheck
return false; return false;
} }
if ( if (spells[spell_id].target_type == ST_Self && tar != this) {
spells[spell_id].target_type == ST_Self && if (spell_type == BotSpellTypes::SummonCorpse && RuleB(Bots, AllowCommandedSummonCorpse)) {
tar != this && // Don't cancel (Summon Corpse is allowed)
( }
spell_type != BotSpellTypes::SummonCorpse || else {
RuleB(Bots, AllowCommandedSummonCorpse)
)
) {
LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} on {} due to ST_Self.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} on {} due to ST_Self.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName());
return false; return false;
} }
}
if ( if (
this == tar && this == tar &&
+7 -9
View File
@@ -779,13 +779,8 @@ bool Mob::DoCastingChecksOnTarget(bool check_on_casting, int32 spell_id, Mob *sp
if (IsGroupSpell(spell_id)) { if (IsGroupSpell(spell_id)) {
return true; return true;
} else if (spells[spell_id].target_type == ST_Self) { } else if (spells[spell_id].target_type == ST_Self) {
if (IsBot() && (IsEffectInSpell(spell_id, SE_SummonCorpse) && RuleB(Bots, AllowCommandedSummonCorpse))) {
//spell_target = this;
}
else {
spell_target = this; spell_target = this;
} }
}
} else { } else {
if (IsGroupSpell(spell_id) && spell_target != this) { if (IsGroupSpell(spell_id) && spell_target != this) {
ignore_on_casting = true; ignore_on_casting = true;
@@ -1925,10 +1920,13 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
// single target spells // single target spells
case ST_Self: case ST_Self:
{ {
if (IsBot() && (IsEffectInSpell(spell_id, SE_SummonCorpse) && RuleB(Bots, AllowCommandedSummonCorpse))) { if (
//spell_target = this; !(
} IsBot() &&
else { IsEffectInSpell(spell_id, SE_SummonCorpse) &&
RuleB(Bots, AllowCommandedSummonCorpse)
)
) { // summon corpse spells are self only, bots need a fallthrough to summon corpses
spell_target = this; spell_target = this;
} }