From d71e79b3065d282dc3f803893d1340240599e080 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Thu, 1 Mar 2018 13:44:10 -0500 Subject: [PATCH] Add 2013 NPC vs NPC push change They remove NPC vs NPC melee push in 2013 --- zone/attack.cpp | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index 7648f566a..457518c67 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -3615,21 +3615,30 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const if (RuleB(Combat, MeleePush) && damage > 0 && !IsRooted() && (IsClient() || zone->random.Roll(RuleI(Combat, MeleePushChance)))) { a->force = EQEmu::skills::GetSkillMeleePushForce(skill_used); - if (IsNPC()) - a->force *= 0.10f; // force against NPCs is divided by 10 I guess? ex bash is 0.3, parsed 0.03 against an NPC - // update NPC stuff - auto new_pos = glm::vec3(m_Position.x + (a->force * std::cos(a->hit_heading) + m_Delta.x), - m_Position.y + (a->force * std::sin(a->hit_heading) + m_Delta.y), m_Position.z); - if (position_update_melee_push_timer.Check() && zone->zonemap && zone->zonemap->CheckLoS(glm::vec3(m_Position), new_pos)) { // If we have LoS on the new loc it should be reachable. - if (IsNPC()) { - // Is this adequate? - - Teleport(new_pos); - SendPositionUpdate(); - } + if (IsNPC()) { + if (attacker->IsNPC()) + a->force = 0.0f; // 2013 change that disabled NPC vs NPC push + else + a->force *= 0.10f; // force against NPCs is divided by 10 I guess? ex bash is 0.3, parsed 0.03 against an NPC } - else { - a->force = 0.0f; // we couldn't move there, so lets not + // update NPC stuff + if (a->force != 0.0f) { + auto new_pos = glm::vec3( + m_Position.x + (a->force * std::cos(a->hit_heading) + m_Delta.x), + m_Position.y + (a->force * std::sin(a->hit_heading) + m_Delta.y), m_Position.z); + if (position_update_melee_push_timer.Check() && zone->zonemap && + zone->zonemap->CheckLoS( + glm::vec3(m_Position), + new_pos)) { // If we have LoS on the new loc it should be reachable. + if (IsNPC()) { + // Is this adequate? + + Teleport(new_pos); + SendPositionUpdate(); + } + } else { + a->force = 0.0f; // we couldn't move there, so lets not + } } }