More fixes

TGB, ^cast, group/ae checks, in group/raid checks, inviting others bots to group, group disband fix, prevent rogue bs spam, ^follow fixes and cleanup, follow owner only by default when joining raid/group, group buff fixes for bots, range fixes for group buffs
This commit is contained in:
nytmyr
2024-10-31 07:32:16 -05:00
parent 32e37660d8
commit 4aa7a18b4f
17 changed files with 1053 additions and 670 deletions
+41 -7
View File
@@ -2196,14 +2196,42 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
case ST_Group:
case ST_GroupNoPets:
{
if(IsClient() && CastToClient()->TGB() && IsTGBCompatibleSpell(spell_id) && (slot != CastingSlot::Item || RuleB(Spells, AllowItemTGB))) {
if( (!target) ||
(target->IsNPC() && !(target->GetOwner() && target->GetOwner()->IsClient())) ||
(target->IsCorpse()) )
if (
IsClient() && CastToClient()->TGB() &&
IsTGBCompatibleSpell(spell_id) &&
(slot != CastingSlot::Item || RuleB(Spells, AllowItemTGB))
) {
if (
!target ||
target->IsCorpse() ||
(
target->IsNPC() &&
!(target->GetOwner() && target->GetOwner()->IsClient())
)
) {
spell_target = this;
else
}
else {
spell_target = target;
} else {
}
}
else if (
IsBot() && RuleB(Bots, EnableBotTGB) &&
IsTGBCompatibleSpell(spell_id) &&
(slot != CastingSlot::Item || RuleB(Spells, AllowItemTGB))
) {
if (
!spell_target ||
spell_target->IsCorpse() ||
(
spell_target->IsNPC() &&
!(spell_target->GetOwner() && spell_target->GetOwner()->IsOfClientBot())
)
) {
spell_target = this;
}
}
else {
spell_target = this;
}
@@ -2530,8 +2558,14 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, in
//range check our target, if we have one and it is not us
float range = spells[spell_id].range + GetRangeDistTargetSizeMod(spell_target);
if(IsClient() && CastToClient()->TGB() && IsTGBCompatibleSpell(spell_id) && IsGroupSpell(spell_id))
if (
(
(IsClient() && CastToClient()->TGB()) || (IsBot() && RuleB(Bots, EnableBotTGB)
) &&
IsTGBCompatibleSpell(spell_id) && IsGroupSpell(spell_id))
) {
range = spells[spell_id].aoe_range;
}
range = GetActSpellRange(spell_id, range);
if(IsClient() && IsIllusionSpell(spell_id) && (HasProjectIllusion())){