I made a RPG mod for Dodgeball, I have there a bot with 10k HP. It all works great as long as bot is getting hit with knives, plain bullets, etc....
BUT when he's hit with m79 grenade and base Damage exceeds 150 (standard amount of Health) he is getting instantly killed. I've tried modifying OnPlayerDamage() in many different ways even changing Damage and Result to 0 but he's still getting killed. It's like server is totally skipping OnPlayerDamage() and killing bot regardless of any damage modifications.
tmpDmg:=Damage;
...
Lots of tmpDmg modifications according to classes, skills, etc.
...
if(Victim=Boss)then
begin
if(round(tmpDmg)<=Players[Victim].HP)then
begin
Players[Victim].HP:=Players[Victim].HP-round(tmpDmg);
Result:=0;
end
else
begin
NewDmg:=round(tmpDmg)-Players[Victim].HP;
Players[Victim].HP:=0;
Result:=NewDmg;
end;
end;
After that shot with m79 bot's HP is decreased by the tmpDmg amount but his real Health drops to -400. I repeat: it only happens on m79 grenade hit (and maybe some other explosives but I do not use them in my mod) and when Damage >=150 even when OnPlayerDamage() Result=0.
Any ideas?