EQEmu / Server

Open Source Fan-Based EverQuest Emulator Server project
https://docs.eqemu.io/
GNU General Public License v3.0
447 stars 411 forks source link

NPCs summon despite being in melee range #2651

Open r33kgr3yj0y opened 1 year ago

r33kgr3yj0y commented 1 year ago

Encountering this problem in multiple zones, especially when pulling multiple NPCs.

NPCs will be in melee range, yet they will still summon. When you have a group of NPCs, your puller's back will wind up to the group of mobs in no time, due to the nature of this unnecessary summon.

How to reproduce: 1) Go to a zone with trivial summoning mobs. 2) Damage them within summoning HP 3) Observe getting summoned multiple times from multiple angles despite the NPCs already being able to hit you. Possible contributing factors: being mounted + shrunk

Possible solutions: make it so NPCs check if they can hit the PC prior to summon. Thank you for your time

PS: This is my first issue submit to eq emu, so if i am in the wrong place or doing anything incorrectly, please tell me so I can correct it in an edit.

Aeadoin commented 1 year ago

Mobs do check if their target is in Combat Range before attempting to summon:

        if (is_combat_range) {

I could possibly see if adding a range check to Mob::HateSummon() would help any, do we know what Live behavior is like?

r33kgr3yj0y commented 1 year ago

Do mounts mess with perceived "combat range?" maybe the solution is in how NPCs view mounts?

Aeadoin commented 1 year ago

Mob::CombatRange(Mob* other, float fixed_size_mod, bool aeRampage) is based on two factors mostly:

The Attacker and Defenders Sizes.

    float other_size_mod = other->GetSize();

We already do some fixed sizes for certain Races (Dragons mostly), so I could always play around with how Horses behave... and worse case we may need to add a fixed size to prevent this from occurring.

    if (GetRace() == RT_DRAGON || GetRace() == RT_WURM || GetRace() == RACE_GHOST_DRAGON_196) { //For races with a fixed size
        size_mod = 60.0f;
    }
    else if (size_mod < 6.0) {
        size_mod = 8.0f;
    }

    if (other->GetRace() == RT_DRAGON || other->GetRace() == RT_WURM || other->GetRace() == RACE_GHOST_DRAGON_196) { //For races with a fixed size
        other_size_mod = 60.0f;
    }
    else if (other_size_mod < 6.0) {
        other_size_mod = 8.0f;
    }