Server icon indicating copy to clipboard operation
Server copied to clipboard

Damage Shield - only - killing is not working correctly

Open huffin opened this issue 5 years ago • 1 comments

As the topic implies, when a damage shield is 100% of the damage done, it is supposed to yield no exp, no faction, no corpse. It is not behaving that way currently. Currently it is doing all of that: giving exp, faction hits, corpse with loot. You are supposed to need to do at least 1 dmg of melee or non-melee damage for credit for the kill.

[Fri Nov 15 11:21:16 2019] Captain Silverwind is burned by YOUR flames for 550 points of non-melee damage. [Fri Nov 15 11:21:16 2019] Captain Silverwind tries to slash YOU, but YOUR magical skin absorbs the blow! [Fri Nov 15 11:21:16 2019] Captain Silverwind is burned by YOUR flames for 550 points of non-melee damage. [Fri Nov 15 11:21:16 2019] Captain Silverwind says, 'Your name shall be added to the Guards of Faydark's most wanted list.' [Fri Nov 15 11:21:16 2019] You have slain Captain Silverwind! [Fri Nov 15 11:21:16 2019] Captain Silverwind tries to slash YOU, but YOUR magical skin absorbs the blow! [Fri Nov 15 11:21:17 2019] The war march fades.

etc etc easily reproduced

huffin avatar Nov 15 '19 17:11 huffin

Assuming the the rule EXPFromDmgShield is false on the server, I think the issue stems from how this line works in https://github.com/EQEmu/Server/blob/master/zone/attack.cpp#L2495

Mob *give_exp = hate_list.GetDamageTopOnHateList(this);

The GetDamageTopOnHateList method will return a mob that has 0 damage on the hatelist_damage. So even if the damage shield killed the mob so you technically did 0 damage then you'll still get returned because you're the only one on the hatelist. Think need something like...

Mob *give_exp = hate_list.GetDamageTopOnHateList(this);

bool damageTopWasZero = hate_list.GetEntHateAmount(give_exp, true) == 0

if (give_exp && !damageTopWasZero) {
    give_exp = killer;
} else {
    // if the top damage did 0 total damage then no faction hits, xp, or corpse
    // this can happen if a mob is killed entirely by a damage shield
    give_exp = nullptr;
}

This should handle the experience and faction hits. Will need to add a condition further down to prevent a corpse from dropping as well.

Still getting my bearings on developments on eqemu but will see if I can put in a PR for this.

crdunwel avatar Sep 08 '23 17:09 crdunwel