EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Database/World Building (https://www.eqemulator.org/forums/forumdisplay.php?f=596)
-   -   Combat push? (https://www.eqemulator.org/forums/showthread.php?t=40405)

emho24 02-15-2016 11:10 PM

Combat push?
 
I've searched the forums and wiki - I've obviously missed this. How do you disable all the pushing around that happens in melee?

Freshmaker 02-16-2016 09:56 AM

File: zone/attack.cpp

Snippet:
Code:

                a->meleepush_xy = attacker->GetHeading() * 2.0f;
                if (RuleB(Combat, MeleePush) && damage > 0 && !IsRooted() &&
                    (IsClient() || zone->random.Roll(RuleI(Combat, MeleePushChance)))) {
                        a->force = EQEmu::GetSkillMeleePushForce(skill_used);
                        // update NPC stuff
                        auto new_pos = glm::vec3(m_Position.x + (a->force * std::sin(a->meleepush_xy) + m_Delta.x),
                                                  m_Position.y + (a->force * std::cos(a->meleepush_xy) + m_Delta.y), m_Position.z);
                        if (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);
                                        SendPosUpdate();
                                }
                        } else {
                                a->force = 0.0f; // we couldn't move there, so lets not
                        }
                }

That's the logic there. Note that "Mob" inherits all things. Meaning, disabling melee push here would result in *nothing* being pushed, PCs, pets, NPCs, *everything*.

This would mean, short of actual stuns or bash attacks, nobody will ever get interrupted while casting (movement is the sole cause of interrupting PCs/NPCs beyond genuine stuns). You could therefore situationally disable melee push for just NPCs or just PCs or whatever.

Disabling melee push on NPCs will make the game harder (with melee push, you have a shot at causing melee push to interrupt that NPC's Complete Heal cast. Without, all NPC spells guaranteed will succeed without a genuine stun/bash effect). You can do this by setting the rule MeleePushChance to 0, per the above code.

Disabling melee push on PCs will make the game easier (same reason, impossible to be interrupted now unless something genuinely stuns you with spell or bash). You would set the rule MeleePush to false to disable melee push wholesale for everything.


All times are GMT -4. The time now is 12:30 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.