// ######################################################################################################################
// # #
// # BANDAGENFIX SYSTEM BY Admin Phoenix aka Levanthis #
// # #
// # Features: #
// # Clean Poison #
// # Raise up from Death #
// # Imbuing Bandages with Healing Potion to get some extra Hitpoints #
// # Cleaing bloody Bandages to get new clean bandages #
// ######################################################################################################################
[DEFNAME healing]
successcheck_veterinary 10.0
successcheck_veterinary_poison 30.0
successcheck_veterinary_death 35.0
[ITEMDEF 0ee9]
DUPEITEM=0e21
[ITEMDEF 0e21]
DEFNAME=i_bandage
NAME=clean Bandagen
RESOURCES=i_cloth
TYPE=T_BANDAGE
WEIGHT=.1
DUPELIST=0ee9
CATEGORY=Items - Jobs
SUBSECTION=Healer
DESCRIPTION=Clean Bandages
ON=@TARGON_ITEM
IF (<src.targ.baseid> == i_bottle_yellow) || (<src.targ.baseid> == i_potion_HealLess) || (<src.targ.baseid> == i_potion_Heal) || (<src.targ.baseid> == i_potion_HealGreat)
IF (<src.restest 1 <src.targ.baseid>>)
src.consume=1 <src.targ.baseid>
serv.newitem=i_bandage_imbue
IF (<src.targ.dmore2> <= 500)
new.name=<name> imbue with a weak Heal Potion.
ELSEIF (<src.targ.dmore2> > 500) && (<src.targ.dmore2> <= 600)
new.name=<name> imbue with a Heal Potion.
ELSE
new.name=<name> imbue with a strong Heal Potion.
ENDIF
new.more2=<src.targ.dmore2>
IF (<amount> <= 5)
new.amount=<amount>
src.consume=<amount> <baseid>
ELSE
new.amount=5
src.consume=5 <baseid>
ENDIF
new.bounce=<src.uid>
serv.newitem=i_bottle_empty
new.bounce=<src.uid>
ELSE
src.smsg @<def0.def_smsg_norm>,3 <src.targ.name> should bein your backpack.
ENDIF
ELSE
src.smsg @<def0.def_smsg_norm>,3 You can not use the bandage on it.
ENDIF
RETURN 1
[ITEMDEF i_bandage_imbue]
ID=i_bandage
NAME=Clean Bandagen
RESOURCES=i_cloth
TYPE=T_BANDAGE
WEIGHT=.1
DUPELIST=0ee9
CATEGORY=Items - Berufe
SUBSECTION=Healer
DESCRIPTION=Clean Bandages with Heal Potion
[TYPEDEF T_BANDAGE]
ON=@DCLICK
IF (<src.flags>&statf_freeze) || (<src.flags>&statf_dead) || (<src.flags>&statf_stone) || (<src.flags>&statf_polymorph) || (<src.flags>&statf_invisible) || (<src.flags>&statf_insubstantial)
src.smsg In your condition you can not use it.
ELSEIF ( <src.findlayer(layer_horse.uid)> )
src.smsg @<def0.def_smsg_norm>,3 You can not use it riding a horse.
ELSEIF !(<src.restest 1 i_bandage>)
src.smsg You have no bandage on your backpack!
ELSEIF (<src.ctag0.action>)
src.smsg You can not use the bandage at the moment!
ELSEIF (<src.action> > 0)
src.smsg You are busy.
ELSE
IF (<src.findlayer(1).ID>)
src.findlayer(1).UNEQUIP
ENDIF
IF (<src.findlayer(2).ID>)
src.findlayer(2).UNEQUIP
ENDIF
TARGETG Choose the person you want to heal.
ENDIF
RETURN 1
ON=@TARGON_GROUND
serv.newitem=i_gold
new.p=<src.targp>
IF (<new.distance> > 2)
src.smsg @<def0.def_smsg_norm>,3 You are too far away.
ELSEIF (<new.canseelos>)
src.smsg You drop the bandage on the ground.
p=<src.targp>
update
ELSE
src.smsg @<def0.def_smsg_norm>,3 You can not drop the bandage here.
ENDIF
new.remove
RETURN 1
ON=@TARGON_CHAR
IF (<src.findlayer(1).ID>)
src.findlayer(1).UNEQUIP
ENDIF
IF (<src.findlayer(2).ID>)
src.findlayer(2).UNEQUIP
ENDIF
IF (<src.ctag0.action>)
src.smsg You can not use the bandage again!
ELSEIF !(<src.targ.canseelos>)
src.smsg @<def0.def_smsg_norm>,3 <src.targ.name> not in sight!
ELSEIF (<src.targ.distance> > 1)
src.smsg @<def0.def_smsg_norm>,3 <src.targ.name> is too far away from you.
ELSEIF (<src.targ.hits> >= <src.targ.maxhits>)
src.smsg @<def0.def_smsg_norm>,3 <src.targ.name> it fully healed.
ELSEIF (<src.flags>&statf_freeze) || (<src.flags>&statf_stone) || (<src.flags>&statf_polymorph) || (<src.flags>&statf_invisible) || (<src.flags>&statf_insubstantial)
src.smsg @<def0.def_smsg_norm>,3 In your condition you can not use it.
ELSEIF (<src.targ.flags>&statf_freeze) || (<src.targ.flags>&statf_stone) || (<src.targ.flags>&statf_invisible) || (<src.targ.flags>&statf_insubstantial)
src.smsg @<def0.def_smsg_norm>,3 You can not heal <src.targ.name> at the moment.
ELSEIF (<src.targ.isplayer>)
IF (<src.targ.hits> < <src.targ.maxhits>)
IF (<src.targ.flags>&statf_poisoned)
IF (<src.healing> >= 60.0)
IF (<src.restest 3 i_bandage>)
IF (<EVAL RAND(<src.healing>)> > <eval Rand(<def0.successcheck_veterinary_poison>)>)
f_healing_bandage_poison
ELSE
src.anim=010
src.consume 3 i_bandage
src.smsg @<def0.def_smsg_norm>,3 You failed healing <src.targ.name> from poison.
ENDIF
ELSE
src.smsg @<def0.def_smsg_norm>,3 You don not have enough bandage to heal <src.targ.name> from poison.
ENDIF
RETURN 1
ELSE
src.smsg @<def0.def_smsg_norm>,3 You are not good enough in healing.
ENDIF
ENDIF
IF (<src.targ.flags>&statf_dead)
IF (<src.healing> > 80.0)
IF (<src.restest 5 i_bandage>)
IF (<EVAL RAND(<src.healing>)> > <eval Rand(<def0.successcheck_veterinary_death>)>)
f_healing_bandage_death
ELSE
src.anim=010
src.consume 5 i_bandage
src.smsg @<def0.def_smsg_norm>,3 You failed getting back <src.targ.name> from the dark side.
ENDIF
ELSE
src.smsg @<def0.def_smsg_norm>,3 You don not have enough bandage to heal <src.targ.name>
ENDIF
ELSE
src.smsg @<def0.def_smsg_norm>,3 You are not good enough in healing.
ENDIF
RETURN 1
ENDIF
IF (<src.restest 1 i_bandage>)
IF (<EVAL RAND(<src.healing>)> > <eval Rand(<def0.successcheck_veterinary>)>)
src.smsg @<def0.def_smsg_norm>,3 You success healing <src.targ.name>.
f_healing_parameters <src.healing>,<more2>
f_healing_bandage_animation
ELSE
src.smsg @<def0.def_smsg_norm>,3 You failed healing <src.targ.name>.
src.anim=010
src.consume 1 i_bandage
ENDIF
ELSE
src.smsg @<def0.def_smsg_norm>,3 You don not have enough bandage to heal <src.targ.name>.
ENDIF
src.ctag0.action=1
src.timerf 2,ctag0.action=
ELSE
src.smsg @<def0.def_smsg_norm>,3 <src.targ.name> has fully health.
ENDIF
RETURN 1
// Begin Veterinary
ELSEIF !(<src.targ.isplayer>)
IF (<src.targ.hits> < <src.targ.maxhits>)
// Anfang Giftheilen
IF (<src.targ.flags>&statf_poisoned)
IF (<src.veterinary> >= 60.0)
IF (<src.restest 3 i_bandage>)
IF (<EVAL RAND(<src.veterinary>)> > <eval Rand(<def0.successcheck_veterinary_poison>)>)
f_healing_bandage_poison
ELSE
src.anim=010
src.consume 3 i_bandage
src.smsg @<def0.def_smsg_norm>,3 You failed healing <src.targ.name> from poison.
ENDIF
ELSE
src.smsg @<def0.def_smsg_norm>,3 You don not have enough bandage to heal <src.targ.name> from poison.
ENDIF
RETURN 1
ELSE
src.smsg @<def0.def_smsg_norm>,3 You are not good enough in healing.
ENDIF
RETURN 1
ENDIF
// End Giftheilen
// Anfang normales Heilen
IF (<src.restest 1 i_bandage>)
IF (<EVAL RAND(<src.veterinary>)> > <eval Rand(<def0.successcheck_veterinary>)>)
src.smsg @<def0.def_smsg_norm>,3 You success healing <src.targ.name>.
f_healing_parameters <src.veterinary>,<more2>
f_healing_bandage_animation
ELSE
src.smsg @<def0.def_smsg_norm>,3 You failed healing <src.targ.name>.
src.anim=010
src.consume 1 i_bandage
ENDIF
ELSE
src.smsg @<def0.def_smsg_norm>,3 You don not have enough bandage to heal <src.targ.name>.
ENDIF
// Ende normales Heilen
src.ctag0.action=1
src.timerf 2,ctag0.action=
ELSE
src.smsg @<def0.def_smsg_norm>,3 <src.targ.name> has fully health.
ENDIF
// Ende Tierheilung
ELSE
src.smsg @<def0.def_smsg_norm>,3 You can not heal this.
ENDIF
RETURN 1
// Ende Heilung
[FUNCTION f_healing_parameters]
local.healing=<eval <argv[0]>/100>
doswitch <dlocal.healing>
src.targ.hits += <eval {1 2}> // 0
src.targ.hits += <eval {1 3}> // 10
src.targ.hits += <eval {2 6}> // 20
src.targ.hits += <eval {4 8}> // 30
src.targ.hits += <eval {6 12}> // 40
src.targ.hits += <eval {10 15}> // 50
src.targ.hits += <eval {12 19}> // 60
src.targ.hits += <eval {15 23}> // 70
src.targ.hits += <eval {17 27}> // 80
src.targ.hits += <eval {19 30}> // 90
src.targ.hits += <eval {23 33}> // 100
src.targ.hits += <eval {25 37}> // 110
src.targ.hits += <eval {28 40}> // 120
src.targ.hits += <eval {30 44}> // 130
src.targ.hits += <eval {34 48}> // 140
src.targ.hits += <eval {37 51}> // 150
enddo
IF (<dargv[1]> > 0)
src.targ.hits +=<eval <argv[1]>/50>
src.smsg @<def0.def_smsg_norm>,3 Imbue bandages give you some extra hitpoints.
ENDIF
[FUNCTION f_healing_bandage_animation]
src.anim=010
src.consume 1 i_bandage
local.amount=<eval {1 4}>
IF (<dlocal.amount> > 1)
serv.newitem i_bandage_bloody
new.bounce
ENDIF
IF (<src.targ.hits> > <src.targ.maxhits>)
src.targ.hits=<src.targ.maxhits>
ENDIF
[FUNCTION f_healing_bandage_poison]
src.smsg @<def0.def_smsg_norm>,3 You clean the blood from poison.
src.targ.flags &=~ statf_poisoned
src.targ.findlayer(layer_flag_poison).remove
src.targ.update
src.consume 3 i_bandage
serv.newitem i_bandage_bloody,<eval {1 3}>
new.bounce
src.anim=010
[FUNCTION f_healing_bandage_death]
src.smsg @<def0.def_smsg_norm>,3 You raised <src.targ.name> from the death.
src.smsg @<def0.def_smsg_norm>,3 You were raised from the death from <src.name>.
src.targ.spelleffect s_resurrection 1000
src.consume 5 i_bandage
serv.newitem i_bandage_bloody,<eval {1 5}>
new.bounce
src.anim=010
[ITEMDEF 0e22]
DUPEITEM=0e20
[ITEMDEF 0e20]
DEFNAME=i_bandage_bloody
TYPE=T_BANDAGE_BLOOD
RESOURCES=1 I_BANDAGE 1 I_BLOOD
WEIGHT=.1
CATEGORY=Items - Berufe
SUBSECTION=Healer
DESCRIPTION=BLOODY BANDAGES
DUPELIST=0e22
ON=@DCLICK
IF (<src.restest <baseid>>)
IF (<src.findlayer(1).ID>)
src.findlayer(1).UNEQUIP
ENDIF
IF (<src.findlayer(2).ID>)
src.findlayer(2).UNEQUIP
ENDIF
target Where you wanna clean the bloody bandage?
ELSE
src.smsg @<def0.def_smsg_norm>,3 You don not have <name> in your backpack.
ENDIF
RETURN 1
ON=@TARGON_CHAR
src.smsg @<def0.def_smsg_norm>,3 You can not do this!
RETURN 1
ON=@TARGON_GROUND
serv.newitem=i_gold
new.p=<src.targp>
IF ((<new.isneartype.P t_water_wash 0>) || (<new.isneartype.P t_water 0>))
new.remove
src.anim=021
src.smsg You cleaned the bloody bandages.
serv.newitem=i_bandage
local.amount=<eval {<amount>/2> <amount>}>
IF (<dlocal.amount> == 0)
local.amount=1
ENDIF
new.amount=<dlocal.amount>
new.bounce
remove
RETURN 1
ELSE
new.remove
src.smsg @<def0.def_smsg_norm>,3 You can not clean the bloody bandages there.
RETURN 1
ENDIF
ON=@TARGON_ITEM
IF ((<src.targ.baseid> == i_water_bloody) || (<src.targ.type> == t_water) || (<src.targ.type> == t_water_wash) ||(<src.targ.baseid> == i_wash_basin) || (<src.targ.baseid> == i_barrel_water) || (<src.targ.baseid> == i_tub_water))
src.anim=021
src.smsg You clean the blood bandages.
serv.newitem=i_bandage
new.amount=<amount>
new.bounce
remove
RETURN 1
ENDIF
[EOF]