Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPC DoTs stop doing damage (server side) when corpse is looted. #4248

Open
noudess opened this issue Apr 9, 2024 · 0 comments
Open

NPC DoTs stop doing damage (server side) when corpse is looted. #4248

noudess opened this issue Apr 9, 2024 · 0 comments

Comments

@noudess
Copy link
Contributor

noudess commented Apr 9, 2024

If an NPC casts a DoT on you, dies, and his corpse no longer exists, any residual DoTs should still do damage,

The client is showing this, but since the code inside spell_effects.cpp needs a non-null caster to accurately calculate the damage, the server stops calling Client::Damage().

I really only see this as an issue if an NPC owns the DoT. I think the calculated_effect_value should be calculated once when the spell lands and does the 1st hit, and used for the rest of that spells duration.

This will make the server match client. I can see how this causes the famed, I died, a few seconds later my corpse pops up, as the server didnt apply the damage of a DoT from a no longer existing NPC or it's corpse.

I am ok making these changes if peeps concur. Someone suggested I make this behind a rule, and I will do that.

            if (caster && effect_value < 0) {

                if (IsDetrimentalSpell(buff.spellid)) {
                    if (caster->IsClient()) {
                        if (!caster->CastToClient()->GetFeigned()) {
                            AddToHateList(caster, -effect_value);
                        }
                    } else if (!IsClient()) { // Allow NPC's to generate hate if casted on other NPC's
                        AddToHateList(caster, -effect_value);
                    }
                }

                effect_value = caster->GetActDoTDamage(buff.spellid, effect_value, this);

                caster->ResourceTap(-effect_value, buff.spellid);
                effect_value = -effect_value;
                Damage(caster, effect_value, buff.spellid, spell.skill, false, i, true);
            } else if (effect_value > 0) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants