more blocked buff tweaks

This commit is contained in:
nytmyr
2024-12-17 13:09:22 -06:00
parent e220163153
commit f33ed3d4cd
3 changed files with 26 additions and 15 deletions
+20 -11
View File
@@ -9585,22 +9585,31 @@ bool Bot::CastChecks(uint16 spell_id, Mob* tar, uint16 spellType, bool doPrechec
return false;
}
if (RuleB(Spells, EnableBlockedBuffs) && IsBeneficialSpell(spell_id) && tar->IsClient() && tar->IsBlockedBuff(spell_id)) {
LogBotPreChecksDetail("{} says, 'Cancelling cast of {} on {} due to IsBlockedBuff.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); //deleteme
return false;
}
if (RuleB(Bots, AllowBotBlockedBuffs) && IsBeneficialSpell(spell_id)) {
if (tar->IsBot() && tar->IsBlockedBuff(spell_id)) {
LogBotPreChecksDetail("{} says, 'Cancelling cast of {} on {} due to IsBlockedBuff.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); //deleteme
return false;
}
else if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsBot() && tar->GetOwner()->IsBlockedPetBuff(spell_id)) {
if (
IsBeneficialSpell(spell_id) &&
(
(RuleB(Spells, EnableBlockedBuffs) && tar->IsClient()) ||
(RuleB(Bots, AllowBotBlockedBuffs) && tar->IsBot())
)
) {
if (tar->IsBlockedBuff(spell_id)) {
LogBotPreChecksDetail("{} says, 'Cancelling cast of {} on {} due to IsBlockedPetBuff.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); //deleteme
return false;
}
}
if (
IsBeneficialSpell(spell_id) && tar->IsPet() &&
(
(RuleB(Spells, EnableBlockedBuffs) && tar->GetOwner() && tar->GetOwner()->IsClient()) ||
(RuleB(Bots, AllowBotBlockedBuffs) && tar->GetOwner() && tar->GetOwner()->IsBot())
)
) {
if (tar->GetOwner()->IsBlockedPetBuff(spell_id)) {
LogBotPreChecksDetail("{} says, 'Cancelling cast of {} on {} due to IsBlockedPetBuff.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); //deleteme
return false;
}
}
LogBotPreChecksDetail("{} says, 'Doing CanCastSpellType checks of {} on {}.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); //deleteme
if (!CanCastSpellType(spellType, spell_id, tar)) {
return false;
+2 -2
View File
@@ -480,8 +480,8 @@ public:
uint16 GetSpellByAA(int id, AA::Rank* &rank);
void CleanBotBlockedBuffs();
void ClearBotBlockedBuffs() { bot_blocked_buffs.clear(); }
bool IsBlockedBuff(int32 spell_id) override; //TODO bot rewrite - fix these to call from mob.h
bool IsBlockedPetBuff(int32 spell_id) override; //TODO bot rewrite - fix these to call from mob.h
bool IsBlockedBuff(int32 spell_id) override;
bool IsBlockedPetBuff(int32 spell_id) override;
void SetBotBlockedBuff(uint16 spell_id, bool block);
void SetBotBlockedPetBuff(uint16 spell_id, bool block);
+4 -2
View File
@@ -4081,8 +4081,10 @@ bool Mob::SpellOnTarget(
// now check if the spell is allowed to land
if (
(!spelltar->IsBot() && RuleB(Spells, EnableBlockedBuffs)) ||
(spelltar->IsBot() && RuleB(Bots, AllowBotBlockedBuffs))
(RuleB(Spells, EnableBlockedBuffs) && spelltar->IsClient()) ||
(RuleB(Spells, EnableBlockedBuffs) && spelltar->IsPet() && spelltar->GetOwner() && spelltar->GetOwner()->IsClient()) ||
(RuleB(Bots, AllowBotBlockedBuffs) && spelltar->IsBot()) ||
(RuleB(Bots, AllowBotBlockedBuffs) && spelltar->IsPet() && spelltar->GetOwner() && spelltar->GetOwner()->IsBot())
) {
// We return true here since the caster's client should act like normal
if (spelltar->IsBlockedBuff(spell_id)) {