Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Healing/Bandages scripts
Author Message
Snaigel
Journeyman
*

Posts: 75
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jan 2017
Reputation: 0



Post: #7
RE: Healing/Bandages scripts
Hi!! I use this thread of mine so I don't open a new one.

I'm using this healing script that heals you instant, but I want to add a delay of some seconds to be healed again, someone can help me?

Quote:[defname def_bandage]
AllowReadyBandage 1 // Allow players to 'ready' bandages?
BloodyBandageAtFail 1 // Bloody bandages at failure or success?
BandageDelay 0 // Delay for healing/curing.
EnableFail 1 // Enable/disable failing.
CurePoison 1 // Can poison be cured with a bandage?
HealCriminal 1 // Healing criminals is a crime?
HealInterrupt 0 // Healing interruption.
MessageColor 0790 // Color of the sysmessages.
SkillCancel 0 // Cancel used skill(s) when bandage is applied?
TargMaxDistance 3 // Maximum distance from target.
UseFromGround 0 // Can bandages be used from the ground?


[defname def_bandage_resurrect]
EnableResurrect 1 // Allow resurrection?
FirstSkillAmount 800 // First skill amount required for resurrection.
FirstSkillResurrect healing // First skill check for resurrection.
ResurrectConsume 10 // Amount of bandages consumed at resurrection.
ResurrectDelay 6 // Delay for resurrection.
SecondSkillAmount 1000 // Second skill amount required for resurrection.
SecondSkillResurrect anatomy // Second skill check for resurrection.

[typedef T_BANDAGE]
on=@DClick
if (!<def0.AllowReadyBandage>)
if (<src.findid(i_memory_healer>).uid>)
src.sysmessage @<def0.MessageColor> You are unable to perform another action.
return 1
endif
endif
if (!<def0.UseFromGround>)
if (<topobj.uid> == <src.uid>)
src.sysmessage @<def0.MessageColor> These must be used from your pack only.
endif
endif
else
target @<def0.MessageColor> Where do you want to apply the bandages?
return 1

on=@Targon_Char
if (<src.targ.distance> <= <def0.TargMaxDistance>)
if (<def0.AllowReadyBandage>)
if (<src.findid(i_memory_healer).uid>)
src.findid(i_memory_healer).remove
endif
endif
if (<src.targ.flags> & statf_dead)
if (<def0.EnableResurrect>)
if (<src.<def0.FirstSkillResurrect>> >= <def0.FirstSkillAmount>)
if (<src.<def0.SecondSkillResurrect>> >= <def0.SecondSkillAmount>)
if (<src.rescount i_bandage> >= <def0.ResurrectConsume>)
src.consume <def0.ResurrectConsume> i_bandage
serv.newitem = i_memory_healer
new.cont = <src.uid>
new.link = <src.targ.uid>
new.more = 1
new.timer = <def0.ResurrectDelay>
if (!<new.timer>)
new.trigger = @Timer
endif
if (<def0.HealInterrupt>)
src.events +e_heal_interrupt
endif
endif
else
src.sysmessage You the lack the skill(s) to do this.
endif
endif
endif
else
if (<src.targ.hits> < <src.targ.maxhits>)
if (<src.targ.uid> == <src.uid>)
src.sysmessage @<def0.MessageColor> You heal yourself.
else
src.sysmessage @<def0.MessageColor> You heal succesfully.
endif
if (<def0.SkillCancel>)
src.action = -1
endif
src.consume 1 i_bandage
src.sound = 058
serv.newitem = i_memory_healer
new.cont = <src.uid>
new.link = <src.targ.uid>
new.timer = <def0.BandageDelay>
if (!<new.timer>)
new.trigger = @Timer
endif
if (<def0.HealInterrupt>)
src.events +e_heal_interrupt
endif
else
src.sysmessage @<def0.MessageColor> Doesn't need heal.
endif
endif
else
src.sysmessage @<def0.MessageColor> Too far away.
endif
return 1


[itemdef i_memory_healer]
id = i_memory
name = Healing Memory Object
weight = 0
type = t_eq_script

on=@Create
attr = attr_invis|attr_decay

on=@Timer
if (<distance <link>> <= <def0.TargMaxDistance>)
if (<cont.tag0.failrate> > 3)
cont.tag0.failrate = 0
else
f_fail_healing
if (<def0.BloodyBandageAtFail>)
serv.newitem = i_bandage_bloody
new.cont = <cont>
endif
endif
doswitch <more>
begin
if (!<qval <link.flags> & statf_dead ? 1:0>) // Workaround for logical NOT issue.
f_heal
endif
end
begin
if (<link.flags> & statf_dead)
cont.hits -= 50
link.resurrect
endif
end
enddo
if (<def0.HealCriminal>)
if (<link.kills> > <serv.murdermincount>) || (<link.flags> & statf_criminal)
cont.criminal = 1
endif
endif
f_gain_healing
else
cont.sysmessage @<def0.MessageColor> Too far away.
endif
if (<def0.HealInterrupt>)
cont.events -e_heal_interrupt
endif
remove
return 1


[function f_heal]
if (<link.flags> & statf_poisoned)
if (<def0.CurePoison>)
link.findid(i_rune_poison).remove
endif
else
local.heal_val = <eval (<cont.healing> @ 2) / rand(20000,30000)>
link.hits += <local.heal_val>
if (<link.hits> > <link.maxhits>)
link.hits = <link.maxhits>
endif
endif
if (!<def0.BloodyBandageAtFail>)
serv.newitem = i_bandage_bloody
new.cont = <cont>
endif


[function f_fail_healing]
if (<def0.EnableFail>)
local.failchance = <eval rand(1,1100)>
if (<local.failchance> > <cont.healing>)
doswitch <cont.findid(i_memory_healer).more>
cont.sysmessage @<def0.MessageColor> You apply the bandages, but couldn't help.
cont.sysmessage @<def0.MessageColor> You fail to resurrect.
enddo
cont.tag0.failrate += 1
cont.findid(i_memory_healer).remove
endif
endif


[function f_gain_healing]
if (<cont.healing> < 1000)
cont.tag0.gainchance += 80
if (<cont.tag0.gainchance> > <cont.healing>)
cont.healing += 0.1
cont.tag0.gainchance = 0
endif
endif


[events e_heal_interrupt]
on=@GetHit
sysmessage @<def0.MessageColor> You stop applying the bandages.
findid(i_memory_healer).remove
events -e_heal_interrupt
return 0

[EOF]
[/quote]
12-17-2019 03:30 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Healing/Bandages scripts - Snaigel - 01-27-2017, 11:34 PM
RE: Healing/Bandages scripts - Snaigel - 01-28-2017, 03:24 PM
RE: Healing/Bandages scripts - zottolo - 01-30-2017, 05:39 AM
RE: Healing/Bandages scripts - Snaigel - 12-17-2019 03:30 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)