Posts: 2
Threads: 1
Joined: Apr 2014
04-04-2014, 02:39 PM
(This post was last modified: 04-04-2014, 02:44 PM by kakuratso.)
Hello. I would like to create a weapon like painkiller. When the charakter eat it, painkiller gain his life about 1/4.
Painkiller may be like a milk or a beer but char can make only one sip.
Thanks given by:
Posts: 864
Threads: 49
Joined: Mar 2008
04-04-2014, 03:29 PM
(This post was last modified: 04-04-2014, 03:30 PM by STM1993.)
There are a few ways to make a pill that heals an exact amount of HP instantly.
1) Done in an X-LF2 mod. Weapon drops from sky, when it lands, it transforms into a criminal. This criminal has a catching itr kind 3. If anyone walks into it, it will catch the person and go into a frame with an itr that hits the person with negative injury values.
2) A better version of the above is to use itr kind 8 as it won't interrupt a character as badly and doesn't require transforming into a criminal. When a character touches the pill, the pill will go into the frame number that the itr kind 8 "dvx" uses. This frame will hit the person with an itr with negative injury values. The reason why the injury tag in itr kind 8 isn't used is because it only heals dark red HP.
To see how exactly itr kind 8 works, see John's D^J healing spell in john_ball.dat.
3) This pill is a weapon can be picked up when you want to take it, causing it to go a specific on_hand frame (24 for all characters I think), which has a next leading to a frame that opoints a ball. This ball needs to have state 18(unless you change the characters' pickup frame to use state 12) and hits the character with an itr.
Normally you can stop there, but if you're going for a full mod anyway, the ball can then grab the character and bring him into a special frame. In the special frame, he will spawn a hidden milk and then drink it just for a very short while, then destroy the milk. The purpose of this is to prevent HP from exceeding 500.
Hope that helps.
Posts: 2,340
Threads: 78
Joined: Mar 2008
@STM1993: I think it's still supposed to be a normal bottle object you can drink from, but it should instantly heal a big chunk with just one sip and be empty.