mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
more blocked buff tweaks
This commit is contained in:
+20
-11
@@ -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
@@ -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
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user