Disable item consumption when hp and sp are full

Phenex

New member
Messages
16
Points
0
Is there away to make healing items from being consumed when your HP and SP are full? for example ygg berry?

Thanks in advance.

 
What do you mean...?? ok, I just want some one to tell me how this is done If this is possible to do. If it's through src, then which file and where do i edit it kinda thing.

 
Last edited by a moderator:
It depends, if you want it to work for ALL healing items, then your best bet is a src edit.

However, if you only want to make a select few items have this effect, you can do so with script code.

Example of the latter:

This is the original Item for 607 (Yggdrasilberry).

{ Id: 607 AegisName: "Yggdrasilberry" Name: "Yggdrasil Berry" Type: 0 Buy: 5000 Weight: 300 BuyingStore: true Delay: 5000 Script: <" percentheal 100,100; ">},

This is the modified version to fit your request:

{ Id: 607 AegisName: "Yggdrasilberry" Name: "Yggdrasil Berry" Type: 0 Buy: 5000 Weight: 300 BuyingStore: true Delay: 5000 KeepAfterUse: true Script: <" if (readparam(Hp) == readparam(MaxHP) || readparam(Sp) == readparam(MaxSP)) { end; } else { percentheal 100,100; delitem 607,1; } ">},

You'll notice the KeepAfterUse: true

this will prevent the item from being deleted upon using it, even if they had maxHP/SP.

Then if they weren't, we heal them, and manually delete the item.

 
Back
Top