Page 1 of 1
Breaking poison damage?
Posted: Sat Jul 13, 2019 12:27 am
by Ravick
Hi there.
Is it possible to create an inventory item that stops player from taking poison damage?
I mean, player got hit by a Poison Cloud or so, and is taking damage from it seconds later, then he uses an item from his inventory, and then the hurting stops. Is it possible? How could it be done?
It could be in DECORATE, ACS or Zscript.
Thaks in advanced.

Re: Breaking poison damage?
Posted: Sat Jul 13, 2019 12:48 am
by Blue Shadow
This should work, and requires ZScript:
Code: Select all
class Antidote : CustomInventory
{
States
{
Spawn:
PTN1 ABC 3;
Loop;
Pickup:
TNT1 A 0
{
if (player && player.poisoncount)
{
player.poisoncount = 0;
return true;
}
return false;
}
Stop;
}
}
Re: Breaking poison damage?
Posted: Sat Jul 13, 2019 1:11 am
by Ravick
Thanks!!
___
edit: I'm still a n00b in ZScript... so, I apologize if the question is dumb: This function checks if player has any poisoncount, and, if so, sets it to zero?

Re: Breaking poison damage?
Posted: Sat Jul 13, 2019 1:24 am
by Blue Shadow
Yes. poisoncount is the duration of the poison. It ticks down to zero where upon the player is healed from the poison.
What the item does is check if the player is poisoned, and if so, it's picked up and the player is healed from the poison. If the player is not poisoned, it cannot be picked up.
Re: Breaking poison damage?
Posted: Sun Jul 14, 2019 12:52 am
by Ravick
Thank you.
I guess it'd work in the Use state as well (?)
I'll test myself n' play around with Zscript.

Re: Breaking poison damage?
Posted: Sun Jul 14, 2019 12:56 am
by Blue Shadow
Yes.