Welcome to the Builder Academy

Question Is there a way to fix the bloodloss death from not giving xp award

More
24 Feb 2023 03:13 #10252 by Nero
I have noticed that if a mob dies from a blood loss debuff while in combat the xp isn't awarded for the kill. Is there a way to fix that?

Please Log in or Create an account to join the conversation.

More
24 Feb 2023 22:01 #10253 by thomas
Well, the reason for this is that the blood loss doesn't have a "killer". The character just bleeds out, with no-one attacking.

You could try to add this functionality this by adding a "last_hit_by" pointer to the character structs, and if this was set to a player that's still online, you could award XP as usual.
The actual kill happens in github.com/tbamud/tbamud/blob/5305783e1b...42/src/limits.c#L405
Code:
} else if (GET_POS(i) == POS_MORTALLYW) { if (damage(i, i, 2, TYPE_SUFFERING) == -1) continue; }
What is happening here is that "i is damaging i". If "i" had a "last_hit_by" pointer, that could be used here.
Note, make sure to remove the last_hit_by pointer when the char it is pointing _to_ leaves the game or dies.
The following user(s) said Thank You: Nero

Please Log in or Create an account to join the conversation.

Time to create page: 0.170 seconds