mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-24 01:08:21 +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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RuleB(Spells, EnableBlockedBuffs) && IsBeneficialSpell(spell_id) && tar->IsClient() && tar->IsBlockedBuff(spell_id)) {
|
if (
|
||||||
LogBotPreChecksDetail("{} says, 'Cancelling cast of {} on {} due to IsBlockedBuff.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); //deleteme
|
IsBeneficialSpell(spell_id) &&
|
||||||
return false;
|
(
|
||||||
}
|
(RuleB(Spells, EnableBlockedBuffs) && tar->IsClient()) ||
|
||||||
|
(RuleB(Bots, AllowBotBlockedBuffs) && tar->IsBot())
|
||||||
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
|
if (tar->IsBlockedBuff(spell_id)) {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsBot() && tar->GetOwner()->IsBlockedPetBuff(spell_id)) {
|
|
||||||
LogBotPreChecksDetail("{} says, 'Cancelling cast of {} on {} due to IsBlockedPetBuff.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); //deleteme
|
LogBotPreChecksDetail("{} says, 'Cancelling cast of {} on {} due to IsBlockedPetBuff.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); //deleteme
|
||||||
return false;
|
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
|
LogBotPreChecksDetail("{} says, 'Doing CanCastSpellType checks of {} on {}.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); //deleteme
|
||||||
if (!CanCastSpellType(spellType, spell_id, tar)) {
|
if (!CanCastSpellType(spellType, spell_id, tar)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
+2
-2
@@ -480,8 +480,8 @@ public:
|
|||||||
uint16 GetSpellByAA(int id, AA::Rank* &rank);
|
uint16 GetSpellByAA(int id, AA::Rank* &rank);
|
||||||
void CleanBotBlockedBuffs();
|
void CleanBotBlockedBuffs();
|
||||||
void ClearBotBlockedBuffs() { bot_blocked_buffs.clear(); }
|
void ClearBotBlockedBuffs() { bot_blocked_buffs.clear(); }
|
||||||
bool IsBlockedBuff(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; //TODO bot rewrite - fix these to call from mob.h
|
bool IsBlockedPetBuff(int32 spell_id) override;
|
||||||
void SetBotBlockedBuff(uint16 spell_id, bool block);
|
void SetBotBlockedBuff(uint16 spell_id, bool block);
|
||||||
void SetBotBlockedPetBuff(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
|
// now check if the spell is allowed to land
|
||||||
if (
|
if (
|
||||||
(!spelltar->IsBot() && RuleB(Spells, EnableBlockedBuffs)) ||
|
(RuleB(Spells, EnableBlockedBuffs) && spelltar->IsClient()) ||
|
||||||
(spelltar->IsBot() && RuleB(Bots, AllowBotBlockedBuffs))
|
(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
|
// We return true here since the caster's client should act like normal
|
||||||
if (spelltar->IsBlockedBuff(spell_id)) {
|
if (spelltar->IsBlockedBuff(spell_id)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user