From 4e8764b6b96fefcb4f0b46c389bf444a1062e0bf Mon Sep 17 00:00:00 2001 From: Noudess Date: Wed, 20 May 2020 16:08:42 -0400 Subject: [PATCH 1/4] Repair aggro so CallsForHelp are completed before mob charges. --- zone/mob_ai.cpp | 2 +- zone/special_attacks.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index f37d70292..426f462d4 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -1319,7 +1319,7 @@ void Mob::AI_Process() { FaceTarget(); } } - else if (AI_movement_timer->Check() && target) { + else if (AI_movement_timer->Check() && target && CastToNPC()->GetCombatEvent()) { if (!IsRooted()) { LogAI("Pursuing [{}] while engaged", target->GetName()); RunTo(target->GetX(), target->GetY(), target->GetZ()); diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 831580e8f..717bc4fbf 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -192,7 +192,7 @@ void Mob::DoSpecialAttackDamage(Mob *who, EQ::skills::SkillType skill, int32 bas DoAttack(who, my_hit); - who->AddToHateList(this, hate, 0, false); + who->AddToHateList(this, hate, 0); if (my_hit.damage_done > 0 && aabonuses.SkillAttackProc[0] && aabonuses.SkillAttackProc[1] == skill && IsValidSpell(aabonuses.SkillAttackProc[2])) { float chance = aabonuses.SkillAttackProc[0] / 1000.0f; @@ -870,7 +870,7 @@ void Mob::DoArcheryAttackDmg(Mob *other, const EQ::ItemInstance *RangeWeapon, co } if (IsClient() && !CastToClient()->GetFeigned()) - other->AddToHateList(this, hate, 0, false); + other->AddToHateList(this, hate, 0); other->Damage(this, TotalDmg, SPELL_UNKNOWN, EQ::skills::SkillArchery); @@ -1200,9 +1200,9 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha if (TotalDmg > 0) { TotalDmg += TotalDmg * damage_mod / 100; - other->AddToHateList(this, TotalDmg, 0, false); + other->AddToHateList(this, TotalDmg, 0); } else { - other->AddToHateList(this, 0, 0, false); + other->AddToHateList(this, 0, 0); } other->Damage(this, TotalDmg, SPELL_UNKNOWN, skillInUse); @@ -1384,7 +1384,7 @@ void Mob::DoThrowingAttackDmg(Mob *other, const EQ::ItemInstance *RangeWeapon, c } if (IsClient() && !CastToClient()->GetFeigned()) - other->AddToHateList(this, WDmg, 0, false); + other->AddToHateList(this, WDmg, 0); other->Damage(this, TotalDmg, SPELL_UNKNOWN, EQ::skills::SkillThrowing); @@ -2158,7 +2158,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob *other, uint16 weapon_damage, EQ::skills::Sk CanSkillProc = false; // Disable skill procs } - other->AddToHateList(this, hate, 0, false); + other->AddToHateList(this, hate, 0); if (damage > 0 && aabonuses.SkillAttackProc[0] && aabonuses.SkillAttackProc[1] == skillinuse && IsValidSpell(aabonuses.SkillAttackProc[2])) { float chance = aabonuses.SkillAttackProc[0] / 1000.0f; From 4ad38d4c497ec4ecab6e01835aeb00f9c593c939 Mon Sep 17 00:00:00 2001 From: Noudess Date: Thu, 28 May 2020 13:17:31 -0400 Subject: [PATCH 2/4] Fix for pets, mercs, bot that don't set combat state. --- zone/mob_ai.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 426f462d4..bc3f71012 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -1319,7 +1319,9 @@ void Mob::AI_Process() { FaceTarget(); } } - else if (AI_movement_timer->Check() && target && CastToNPC()->GetCombatEvent()) { + else if (AI_movement_timer->Check() && + (IsPet() || IsMerc() || IsBot() || + (target && CastToNPC()->GetCombatEvent()))) { if (!IsRooted()) { LogAI("Pursuing [{}] while engaged", target->GetName()); RunTo(target->GetX(), target->GetY(), target->GetZ()); From fa2caf8f8356883a79d35b8fbb3518aea9855f47 Mon Sep 17 00:00:00 2001 From: Noudess Date: Thu, 28 May 2020 13:30:34 -0400 Subject: [PATCH 3/4] Comment movement code and make target required in all cases again --- zone/mob_ai.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index bc3f71012..7d18fdb1a 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -1319,9 +1319,10 @@ void Mob::AI_Process() { FaceTarget(); } } - else if (AI_movement_timer->Check() && + // mob/npc waits until call for help complete, others can move + else if (AI_movement_timer->Check() && target && (IsPet() || IsMerc() || IsBot() || - (target && CastToNPC()->GetCombatEvent()))) { + CastToNPC()->GetCombatEvent())) { if (!IsRooted()) { LogAI("Pursuing [{}] while engaged", target->GetName()); RunTo(target->GetX(), target->GetY(), target->GetZ()); From 06f3d40c2851ffb5fdd13c85fa58612f656a7835 Mon Sep 17 00:00:00 2001 From: Noudess Date: Fri, 19 Jun 2020 07:59:08 -0400 Subject: [PATCH 4/4] Replaced expensive IsPet() with GetOwnerID(). --- zone/mob_ai.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 7d18fdb1a..b7f69ac14 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -1321,7 +1321,7 @@ void Mob::AI_Process() { } // mob/npc waits until call for help complete, others can move else if (AI_movement_timer->Check() && target && - (IsPet() || IsMerc() || IsBot() || + (GetOwnerID() || IsBot() || CastToNPC()->GetCombatEvent())) { if (!IsRooted()) { LogAI("Pursuing [{}] while engaged", target->GetName());