Shidhun
Journeyman
Posts: 59
Likes Given: 5
Likes Received: 3 in 3 posts
Joined: Jul 2012
Reputation: 1
|
RE: Healing fails
You could try something like this :
Code:
[SKILL 17]
DEFNAME=Skill_Healing
KEY=Healing
TITLE=Heilkunde
PROMPT_MSG=@0c4,0,1 Wen willst Du heilen?
DELAY=3.0,2.0
FLAGS=01
ADV_RATE=10.0,285.0,810.0
BONUS_STATS=0
BONUS_STR=0
BONUS_DEX=0
BONUS_INT=0
STAT_STR=0
STAT_DEX=0
STAT_INT=0
ON=@WAIT
RETURN 0
ON=@SELECT
FINDID(i_bandage).DCLICK
RETURN 1
ON=@START
IF (<ISPLAYER>)
//DO the same as bandages and not use the skill?
RETURN 1
ELSE
SAYUA 955,0,0,deu *trying to heal*
ENDIF
RETURN 0
ON=@SUCCESS
IF (<NPC>)
IF (<HITS> < <MAXHITS>)
HITS += <HEALING>/20
IF (<HITS> > <MAXHITS>)
HITS=<MAXHITS>
ENDIF
ENDIF
RETURN 0
ENDIF
RETURN 1
Code:
[ITEMDEF 0e21]
DEFNAME=i_bandage
NAME=Bandagen
RESOURCES=i_cloth
TYPE=T_BANDAGE
WEIGHT=.1
DYE=1
VALUE=1
DUPELIST=0ee9
ON=@DClick
SRC.SYSMESSAGEUA 0c4,0,0,deu Whom do you want to heal?
TARGET
RETURN 1
ON=@TARGON_CHAR
SRC.ACTION -1
IF !(<SRC.RESTEST 1 i_bandage>)
SRC.SYSMESSAGEUA 0c4,0,0,deu You need bandages to heal somebody!
RETURN 1
ELSEIF (<SRC.TAG0.Healing>)
SRC.SYSMESSAGEUA 0c4,0,0,deu You haven't finished your previous healing attempt!
RETURN 1
ELSEIF (<SRC.TARG.DISTANCE> > 4)
SRC.SYSMESSAGEUA 0c4,0,0,deu You are to far away from <SRC.TARG.ANAME> for healing!
RETURN 1
ELSEIF !(<SRC.TARG.CANSEELOS>)
SRC.SYSMESSAGEUA 0c4,0,0,deu You have to be able to see <SRC.TARG.ANAME> for healing !
RETURN 1
ELSEIF (<SRC.TARG.FLAGS>&02)
SRC.SYSMESSAGEUA 0c4,0,0,deu <SRC.TARG.ANAME> is a ghost, you can not help using a bandage.
IF (<SRC.HEALING> >= 950)
SRC.SYSMESSAGEUA 0c4,0,0,deu If you find the corpse of <SRC.TARG.ANAME>, you might be able to ress him.
ENDIF
RETURN 1
ELSEIF (<src.targ.flags>&04000000)
SRC.SYSMESSAGEUA 0c4,0,0,deu You can't heal summoned creatures!
RETURN 1
ELSE
IF ((<SRC.TARG.HITS> < <SRC.TARG.MAXHITS>)||(<SRC.TARG.FLAGS>&0400080))
IF ((<SRC.DISPID> == c_man)||(<SRC.DISPID> == c_woman)||(<SRC.DISPID> == c_elf_male)||(<SRC.DISPID> == c_elf_female))
SRC.ANIM 19
ELSE
SRC.ANIM 6
ENDIF
IF (<SRC.FINDLAYER(1)>)
SRC.FINDLAYER(1).UNEQUIP
ENDIF
IF (<SRC.FINDLAYER(2)>)
SRC.FINDLAYER(2).UNEQUIP
ENDIF
IF (<AMOUNT> > 1)
AMOUNT -= 1
UPDATE
ELSE
REMOVE
ENDIF
NEWITEM i_mem_healing
NEW.LINK=<SRC.TARG.UID>
SRC.EQUIP <NEW>
RETURN 1
ELSE
SRC.SYSMESSAGEUA 0c4,0,0,deu The Target is at full health!
RETURN 1
ENDIF
ENDIF
RETURN 1
ON=@TARGON_ITEM
IF !(<SRC.TARG.ID>==02006) //Corpse
SRC.SYSMESSAGEUA 0c4,0,0,deu That cant' be resurrected!
RETURN 1
ELSEIF !(<AMOUNT> > 9)
SRC.SYSMESSAGEUA 0c4,0,0,deu You don't have enough bandages to bring someone back to life!
RETURN 1
ELSEIF (<SRC.TAG0.Healing>)
SRC.SYSMESSAGEUA 0c4,0,0,deu You haven't finished your previous healing attempt!
RETURN 1
ELSEIF (<SRC.TARG.DISTANCE> > 4)
SRC.SYSMESSAGEUA 0c4,0,0,deu You are to far away!
RETURN 1
ELSEIF !(<SRC.TARG.CANSEELOS>)
SRC.SYSMESSAGEUA 0c4,0,0,deu You need to be able to actually see<SRC.TARG.LINK.ANAME> !
RETURN 1
ELSEIF !(<SRC.TARG.LINK.FLAGS>&02)
SRC.SYSMESSAGEUA 38,0,0,deu The Player has allready been resurrected.
RETURN 1
ELSE
IF (<SRC.FINDLAYER(1)>)
SRC.FINDLAYER(1).UNEQUIP
ENDIF
IF (<SRC.FINDLAYER(2)>)
SRC.FINDLAYER(2).UNEQUIP
ENDIF
IF (<SRC.TAG0.PLOT1> & 0100)||(<SRC.FLAGS>&0400)
SRC.ANIM 7
ELSE
SRC.ANIM=32
ENDIF
IF (<AMOUNT> > 10)
AMOUNT -= 10
UPDATE
ELSE
REMOVE
ENDIF
NEWITEM=i_mem_healing
SRC.EQUIP <NEW>
NEW.LINK=<SRC.TARG.UID>
RETURN 1
ENDIF
RETURN 1
ON=@TARGON_GROUND
SRC.SYSMESSAGEUA 0c4,0,0,deu What exactly do you want to heal?!?
RETURN 1
Code:
[ITEMDEF i_mem_healing]
ID=i_memory
TYPE=t_eq_script
LAYER=53
NAME=Healing
ON=@EQUIP
ATTR=attr_decay
//How much is healed?
IF ((RAND(50)+RAND(50)) < 20) //Failchance
MORE1 -1
TIMER=2
ELSE
MORE1=<EVAL ((<SRC.HEALING>/60) + {0 ((<SRC.ANATOMY>/200) + (<SRC.HEALING>/70))} + 10 )>
TIMER={2 3}
ENDIF
IF (<LINK.NPC>)&&(<SRC.VETERINARY> = 1000)
TIMERF -= {5 10}
ENDIF
SRC.TAG.Healing=1
ON=@UNEQUIP
SRC.TAG.Healing=
ON=@TIMER
IF (<LINK.UID>)
CONT.ACTION -1
IF (<LINK.ISCHAR>)
IF !((<LINK.HITS> < <LINK.MAXHITS>)||(<LINK.FLAGS>&0400080))
CONT.SYSMESSAGEUA 0c4,0,0,deu <LINK.ANAME> is allready at full health!
REMOVE
RETURN 1
ENDIF
IF !(<LINK.NPC>)||(<LINK.NPC>==2)
IF !(<LINK.UID> == <CONT.UID>)
IF (<MORE1> <= 0)
CONT.SYSMESSAGEUA 0c4,0,0,deu You fail at healing <LINK.ANAME> .
LINK.SYSMESSAGEUA 0c4,0,0,deu <CONT.ANAME> tries to heal you, but fails.
IF ({1 10} > 2)
NEWITEM=i_bandage_bloody
CONT.BOUNCE <NEW.UID>
ENDIF
//Skillgain @fail
CONT.SKILLGAIN Healing 1
REMOVE
RETURN 0
ELSE
LOCAL.Diff=<EVAL (100*(<LINK.MAXHITS>-<LINK.HITS>))/<LINK.MAXHITS>>
IF ((<CONT.HEALING> >= {750 1200}) && (<LINK.FLAGS>&0400000))
LINK.FINDLAYER(49).REMOVE
CONT.SYSMESSAGEUA 0c4,0,0,deu Du remove <LINK.ANAME>s hallucinations.
LOCAL.Diff += 20
ENDIF
IF ((<CONT.HEALING> >= {500 1200}) && (<LINK.FLAGS>&080))
LINK.FINDLAYER(42).REMOVE
CONT.SYSMESSAGEUA 0c4,0,0,deu You cure <LINK.ANAME> from the poison.
LOCAL.Diff += 10
ENDIF
IF ({1 10} > 2)
NEWITEM=i_bandage_bloody
CONT.BOUNCE <NEW.UID>
ENDIF
//Skillgain @success
CONT.SKILLGAIN Healing <LOCAL.Diff>
CONT.SKILLGAIN Anatomy <LOCAL.Diff>
IF (<LINK.HITS> < <LINK.MAXHITS>)
LINK.HITS += <MORE1>
IF (<LINK.HITS> > <LINK.MAXHITS>)
LINK.HITS=<LINK.MAXHITS>
ENDIF
CONT.SYSMESSAGEUA 0c4,0,0,deu You heal <LINK.ANAME>.
ENDIF
LINK.SYSMESSAGEUA 0c4,0,0,deu <CONT.ANAME> is healing you.
REMOVE
RETURN 0
ENDIF
ELSE
IF (<MORE1> <= 0)
CONT.SYSMESSAGEUA 0c4,0,0,deu You fail healing yourself.
IF ({1 10} > 2)
NEWITEM=i_bandage_bloody
CONT.BOUNCE <NEW.UID>
ENDIF
//Skillgain @fail
CONT.SKILLGAIN Healing 1
REMOVE
RETURN 0
ELSE
LOCAL.Diff=<EVAL (100*(<LINK.MAXHITS>-<LINK.HITS>))/<LINK.MAXHITS>>
IF ((<CONT.HEALING> >= {750 1200}) && (<CONT.FLAGS>&0400000))
CONT.FINDLAYER(49).REMOVE
CONT.SYSMESSAGEUA 0c4,0,0,deu You remove the hallucinating effects.
LOCAL.Diff += 20
ENDIF
IF ((<CONT.HEALING> >= {500 1200}) && (<CONT.FLAGS>&080))
CONT.FINDLAYER(42).REMOVE
CONT.SYSMESSAGEUA 0c4,0,0,deu You cure yourself from poison.
LOCAL.Diff += 10
ENDIF
IF ({1 10} > 2)
NEWITEM=i_bandage_bloody
CONT.BOUNCE <NEW.UID>
ENDIF
//Skillgain @success
CONT.SKILLGAIN Healing <LOCAL.Diff>
CONT.SKILLGAIN Anatomy <LOCAL.Diff>
IF (<CONT.HITS> < <CONT.MAXHITS>)
CONT.HITS += <MORE1>
IF (<CONT.HITS> > <CONT.MAXHITS>)
CONT.HITS=<CONT.MAXHITS>
ENDIF
CONT.SYSMESSAGEUA 0c4,0,0,deu You heal yourself.
ENDIF
REMOVE
RETURN 0
ENDIF
ENDIF
ELSE
IF (<MORE1> <= 0)
CONT.SYSMESSAGEUA 0c4,0,0,deu Your attempt toheal <LINK.ANAME> fails.
IF ({1 10} > 2)
NEWITEM=i_bandage_bloody
CONT.BOUNCE <NEW.UID>
ENDIF
//VetGain @fail
CONT.SKILLGAIN VETERINARY 1
REMOVE
RETURN 0
ELSE
MORE1=<EVAL ((<CONT.VETERINARY>/50) + {(<CONT.VETERINARY>/100) ((<CONT.ANIMALLORE>/200) + (<CONT.VETERINARY>/50))} + 10)>
LOCAL.Diff=<EVAL (100*(<LINK.MAXHITS>-<LINK.HITS>))/<LINK.MAXHITS>>
IF ((<CONT.VETERINARY> >= {750 1200}) && (<LINK.FLAGS>&0400000))
LINK.FINDLAYER(49).REMOVE
CONT.SYSMESSAGEUA 0c4,0,0,deu You remove <LINK.ANAME>s hallucinations.
LOCAL.Diff += 20
ENDIF
IF ((<CONT.VETERINARY> >= {500 1200}) && (<LINK.FLAGS>&080))
LINK.FINDLAYER(42).REMOVE
CONT.SYSMESSAGEUA 0c4,0,0,deu You cure <LINK.ANAME> from the poison.
LOCAL.Diff += 10
ENDIF
IF (<LINK.HITS> < <LINK.MAXHITS>)
LINK.HITS += <MORE1>
IF (<LINK.HITS> > <LINK.MAXHITS>)
LINK.HITS=<LINK.MAXHITS>
ENDIF
CONT.SYSMESSAGEUA 0c4,0,0,deu You heal <LINK.ANAME>.
ENDIF
IF ({1 10} > 2)
NEWITEM=i_bandage_bloody
CONT.BOUNCE <NEW.UID>
ENDIF
//VetGain bei Erfolg
IF (<CONT.TAG0.xpsys.barde>&0100000)
LOCAL.Diff += {10 20}
ENDIF
CONT.SKILLGAIN VETERINARY <LOCAL.Diff>
CONT.SKILLGAIN ANIMALLORE <LOCAL.Diff>
REMOVE
RETURN 0
ENDIF
ENDIF
//Resurrect
ELSEIF (<CONT.Healing> < 950)
CONT.SYSMESSAGEUA 0c4,0,0,deu You are doing your best, but fail.
IF !(<LINK.LINK.TAG0.Corpse>)
CONT.SKILLGAIN Healing 50
LINK.LINK.TAG.Corpse=<LINK>
LINK.LINK.SYSMESSAGEUA 55,0,0,deu <CONT.ANAME> hat gerade deinen Körper mit Bandagen behandelt.
ENDIF
NEWITEM=i_bandage_bloody
NEW.AMOUNT={6 10}
CONT.BOUNCE <NEW.UID>
REMOVE
RETURN 1
ELSEIF (<CONT.HEALING> >= {950 (1100 - (<CONT.ANATOMY>/20))})
CONT.SYSMESSAGEUA 0c4,0,0,deu you are resurrecting <LINK.LINK.ANAME> .
NEWITEM=i_bandage_bloody
NEW.AMOUNT=<EVAL {6 10}>
CONT.BOUNCE <NEW.UID>
//Gain für Ressen
CONT.SKILLGAIN Healing 90
LINK.LINK.GO <LINK.P>
LINK.LINK.RESURRECT
REMOVE
RETURN 0
ELSE
IF !(<LINK.LINK.TAG0.Corpse>)
CONT.SKILLGAIN Healing 50
LINK.LINK.TAG.Corpse=<LINK>
CONT.SYSMESSAGEUA 0c4,0,0,deu You fail resurrecting <LINK.LINK.ANAME> , but are taking care of some wounds.
LINK.LINK.SYSMESSAGEUA 55,0,0,deu <CONT.ANAME> has tried to resurrect you.
ELSE
CONT.SYSMESSAGEUA 0c4,0,0,deu You fail resurrecting <LINK.LINK.ANAME> !
LINK.LINK.SYSMESSAGEUA 0c4,0,0,deu <CONT.ANAME> tries to resurrect you, but fails!
ENDIF
NEWITEM=i_bandage_bloody
NEW.AMOUNT={6 10}
CONT.BOUNCE <NEW.UID>
REMOVE
RETURN 1
ENDIF
ENDIF
REMOVE
RETURN 1
This way, you can use the normale Actdiffs from the skill-Def
|
|