Code:
[ITEMDEF 0e21]
DEFNAME=i_bandage
RESOURCES=i_cloth
TYPE=t_bandage
WEIGHT=0.1
CATEGORY=Items by Professions
SUBSECTION=Healer
DESCRIPTION=Clean Bandage
On=@Dclick
IF (<CONT>!=<SRC.FINDLAYER(21).UID>)
SRC.SYSMESSAGE You must have the bandages in your backpack.
ELIF (<SRC.FINDID.i_bandage_delay>)
SRC.SYSMESSAGE You must wait to perform another action
ELSE
TARGET Where do you want to use clean bandages?
ENDIF
RETURN 1
On=@TargOn_Char
IF !(<SRC.RESTEST 1 i_bandage>)
SRC.SYSMESSAGE You have no bandages
RETURN 1
ENDIF
IF (<ARGO.NPC>==brain_undead)
SRC.SYSMESSAGE You can't heal this dead creature
RETURN 1
ENDIF
IF <ARGO.DISTANCE> > 2
SRC.SYSMESSAGE You are a healer not medicineman, come closer!
RETURN 1
ENDIF
IF (<ARGO.UID>!=<SRC.UID>) && (!<ARGO.CanSeeLos>)
SRC.SYSMESSAGE You are a healer not medium!
RETURN 1
ENDIF
IF (<ARGO.HITS> >= <ARGO.STR>) && (!(<ARGO.FLAGS> & statf_poisoned))
SRC.SYSMESSAGE Do you wanna make a mummy?
RETURN 1
ENDIF
IF <ARGO.SERIAL> == <SRC.SERIAL>
SRC.SYSMESSAGE You apply <NAME> to yourself
ELIF <SRC.FINDID.i_rune_poison>
SRC.SYSMESSAGE You cannot heal anyone else while you are poisoned
RETURN 1
ELSE
SRC.SYSMESSAGE You apply <NAME> to <ARGO.NAME>
ENDIF
IF (<SRC.HEALING> > 99.9) && (<SRC.ANATOMY> > 99.9)
SRC.NEWITEM=i_bandage_delay
NEW.EQUIP <SRC>
ELSE
SRC.FINDLAYER(1).UneQuip
SRC.FINDLAYER(2).UneQuip
SRC.NEWITEM=i_bandage_delay
NEW.EQUIP <SRC>
ENDIF
IF <SRC.STAMINA> >= <SRC.DEX>
SRC.ACT.TIMER = 3
ELSE
SRC.ACT.TIMER = 3 + ((<SRC.DEX> +- <SRC.STAMINA>) / 25)
ENDIF
SRC.ACT.TIMER = <SRC.ACT.TIMER> / 2
IF <SRC.DEX> < 1
SRC.ACT.TIMER = 5
ENDIF
SRC.TIMER = <SRC.ACT.TIMER> + 2 // to prevent using other skill while healing
IF <SRC.STAMINA> < 3
SRC.STAMINA = 0
ELSE
SRC.STAMINA = (<SRC.STAMINA> +- {3 7})
ENDIF
IF (<ARGO.NPC>==brain_animal) || (<ARGO.NPC>==brain_monster) || (<ARGO.NPC>==brain_dragon) || (<ARGO.NPC>==brain_beserk)
SRC.ACT.MORE2=2 // skill_vet
ELSE
SRC.ACT.MORE2=1 // skill_healing
ENDIF
SRC.ACT.MORE = <CONT>
SRC.ACT.MOREZ = 1 // TargOn_Char
SRC.ACT.LINK = <ARGO.SERIAL>
SRC.CONSUME 1 i_bandage
SRC.ANIM 33
RETURN 1
On=@TargOn_Item
IF <ARGO.REGION.FLAGS> & 03013
IF <ARGO.ID>==02006
SRC.SYSMESSAGE Anti-magic filed disables to resurrect
ENDIF
RETURN 1
ENDIF
IF !(<SRC.RESTEST 20 i_bandage>)
SRC.SYSMESSAGE You need more bandages
RETURN 1
ENDIF
IF <ARGO.ID>!=02006 //i_corpse
SRC.SYSMESSAGE You can't use bandages on <ARGO.NAME> // 'cos it's not a corpse.
RETURN 1
ELIF (<ARGO.DISTANCE> > 1)
SRC.SYSMESSAGE You are a healer not medicineman, come closer!
RETURN 1
ELIF (<SRC.HEALING> < 99.9) && (<SRC.ANATOMY> < 99.9) && (<SRC.SPIRITSPEAK> < 99.9) && (<SRC.FORENSICS> < 99.9)
SRC.SYSMESSAGE This is beyond your ability!
RETURN 1
ELIF (<SRC.HITS> < 2)
SRC.SYSMESSAGE You can't resurrect anyone because you too much wounded!
RETURN 1
ELIF (<SRC.FLAGS> & statf_poisoned)
SRC.SYSMESSAGE You can't resurrect anyone while you are poisoned!
RETURN 1
ENDIF
SRC.CONSUME 20 i_bandage
SRC.ANIM 32
IF (<SRC.HITS> < 2)
SRC.SYSMESSAGE Thou can't resurrect anyone because thou art wounded too much!
RETURN 1
ENDIF
IF (<ARGO.link.flags> & statf_dead)
IF (!(0<ARGO.link.clientversion>))
SRC.SYSMESSAGE Ghost must be online!
RETURN 1
ENDIF
IF (<ARGO.p.x> > <ARGO.link.p.x>)
IF (<ARGO.p.x> +- <ARGO.link.p.x>) > 1
SRC.SYSMESSAGE Ghost art too far away from body!
RETURN 1
ENDIF
ELIF <ARGO.p.x> < <ARGO.link.p.x>
IF (<ARGO.link.p.x> +- <ARGO.p.x>) > 1
SRC.SYSMESSAGE Ghost art too far away from body!
RETURN 1
ENDIF
ENDIF
IF (<ARGO.p.y> > <ARGO.link.p.y>)
IF (<ARGO.p.y> +- <ARGO.link.p.y>) > 1
SRC.SYSMESSAGE Ghost art too far away from body!
RETURN 1
ENDIF
ELIF <ARGO.p.y> < <ARGO.link.p.y>
IF (<ARGO.link.p.y> +- <ARGO.p.y>) > 1
SRC.SYSMESSAGE Ghost art too far away from body!
RETURN 1
ENDIF
ENDIF
IF RAND(102) < <EVAL(<SRC.ANATOMY> / 10)>
IF <ARGO.LINK.REGION.FLAGS> & 03013
SRC.EMOTE try to resurrect the <ARGO.LINK.NAME>
SRC.SYSMESSAGE Anti-magic filed disables to resurrect <ARGO.LINK.NAME>
RETURN 1
ENDIF
SRC.EMOTE resurrect the <ARGO.LINK.NAME>
ARGO.LINK.resurrect
ARGO.LINK.HITS = (<SRC.HITS> / 2)
SRC.HITS = (<SRC.HITS> / 2)
ELSE
SRC.SYSMESSAGE You fail to resurrect <ARGO.LINK.NAME>
ENDIF
// gain skill
IF <SRC.HEALING> < 100.0
IF RAND(<EVAL(<SRC.HEALING> / 20)>)==0
SRC.HEALING = <SRC.HEALING> + 0.1
ENDIF
ENDIF
IF (StrMatch("*Jhelom*","<SRC.SKILLCLASS>") && <SRC.HEALING> > 99.9)
IF RAND(<EVAL(<SRC.HEALING> / 17)>)==0
SRC.HEALING = <SRC.HEALING> + 0.1
ENDIF
ENDIF
RETURN 1
ELSE
SRC.SYSMESSAGE There is no ghost here!
RETURN 1
ENDIF
RETURN 1
[ITEMDEF i_bandage_delay]
NAME=bandage delay
ID=i_memory
TYPE=t_eq_script
On=@Create
ATTR=attr_invis|attr_decay
On=@Equip
IF (<TIMER> < 0) || (<TIMER> > 25)
TIMER=20
ENDIF
// morez=1 - character was targeted
// morez=2 - item was targeted
// more2 - skill (1 - healing or 2 - veterinary)
// cont - link to player who use skill
// more - link to container
// link - link to target
On=@Timer
IF (<MORE2>!=1) && (<MORE2>!=2)
CONT.SYSMESSAGE ERROR: bandage delay script is broken (wrong skill value)!
REMOVE
RETURN 1
ENDIF
IF (<CONT.FLAGS>&(statf_dead|statf_freeze))
CONT.SYSMESSAGE You cannot use bandages in your current state
REMOVE
RETURN 1
ENDIF
IF <MOREZ>==1 // TARGOn_char
IF <LINK.FINDID.i_rune_poison> || (<LINK.FLAGS> & statf_poisoned)
// check for veterinary
IF (<MORE2>==2) && (<CONT.VETERINARY> < 80.0)
CONT.SYSMESSAGE You cannot neutralize the poison because you skill in veterinary is too low
REMOVE
RETURN 1
ENDIF
IF ((<MORE2>==1) && (<CONT.HEALING> >= 80.0) && (<EVAL((<CONT.STR> * 3) / 5)> < <CONT.HITS>)) || (<MORE2>==2)
IF RAND(101) < <EVAL(<CONT.ANATOMY> / 10)>
LINK.f_cure_poison
CONT.SYSMESSAGE You neutralize the poison
CONT.NEWITEM i_bandage_bloody
CONT.ACT.TIMER=-1
CONT.ACT.BOUNCE
CONT.SFX 87
CONT.ACT.CONT = <MORE>
CONT.SYSMESSAGE You put the bloody bandage in your pack.
ELSE
CONT.SYSMESSAGE You have failed to neutralize poison
ENDIF
// gain skill
IF (<MORE2>==2) && (<CONT.VETERINARY> < 100.0)
IF RAND(<EVAL(<CONT.VETERINARY> / 20)>)==0
CONT.VETERINARY = <CONT.VETERINARY> + 0.1
ENDIF
ENDIF
IF (<MORE2>==1) && (<CONT.HEALING> < 100.0)
IF RAND(<EVAL(<CONT.HEALING> / 20)>)==0
CONT.HEALING = <CONT.HEALING> + 0.1
ENDIF
ENDIF
REMOVE
RETURN 1
ENDIF
ENDIF
IF (<LINK.HITS> < <LINK.STR>)
IF RAND(110) < <EVAL((<CONT.ANATOMY> + <CONT.HEALING>)/20)>
IF <MORE2>==2
MOREX=<EVAL ( (<CONT.VETERINARY> / 100) + (<CONT.ANATOMY> / 300) + (<CONT.DEX> / 30) )>
MOREY=<EVAL ( (<CONT.VETERINARY> / 20) + (<CONT.ANATOMY> / 200) + (<CONT.DEX> / 20) )>
ELSE
MOREX=<EVAL ( (<CONT.HEALING> / 120) + (<CONT.ANATOMY> / 345) + (<CONT.DEX> / 33) )>
MOREY=<EVAL ( (<CONT.HEALING> / 20) + (<CONT.ANATOMY> / 200) + (<CONT.DEX> / 33) )> //13 133 13
ENDIF
LINK.HITS=<LINK.HITS>+<EVAL({<MOREX> <MOREY>})>
LINK.HITS = <QVAL (<LINK.MaxHITS> < <LINK.HITS>)?<LINK.MaxHITS>:<LINK.HITS>>
CONT.SYSMESSAGE You put the bloody bandage in your pack.
SERV.NEWITEM=i_bandage_bloody
NEW.CONT=<CONT.FINDLAYER.21.UID>
LINK.SFX 87
LINK.ANIM 19
MOREX=0
MOREY=0
ELSE
CONT.SYSMESSAGE You apply bandages but they barely help
ENDIF
// gain skill
IF (<MORE2>==2) && (<CONT.VETERINARY> < 100.0)
IF RAND(<EVAL(<CONT.VETERINARY> / 10)>)==0
CONT.VETERINARY = <CONT.VETERINARY> + 0.1
ENDIF
ENDIF
IF (<MORE2>==1)
IF (<CONT.HEALING> < 100.0)
IF RAND(<EVAL(<CONT.HEALING> / 10)>)==0
CONT.HEALING = <CONT.HEALING> + 0.1
ENDIF
ELIF (StrMatch("*Jhelom*","<CONT.SKILLCLASS>") && (<CONT.HEALING> < 1050))
IF RAND(<EVAL(<CONT.HEALING> / 7)>)==0
CONT.HEALING = <CONT.HEALING> + 0.1
ENDIF
ENDIF
ENDIF
CONT.TIMER = -1
REMOVE
RETURN 1
ELSE
CONT.SYSMESSAGE Do you wanna make a mummy?
REMOVE
RETURN 1
ENDIF
ENDIF
REMOVE
RETURN 1
[FUNCTION f_cure_poison]
FINDLAYER(42).REMOVE
SOUND=snd_spell_cure
EFFECT 3,i_fx_heal_effect,1,15