SphereCommunity
Healing System Help - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Healing System Help (/Thread-Healing-System-Help)



Healing System Help - Paulo_BR - 10-17-2012 07:37 AM

I picked up this script in the session downloads site, and is giving an error when I put the bag in Bandagen says that I can not use it from the ground, and the Bandagen is in my backpack, how can I fix this error?
Already tried everything and can not fix.

And sphere to read the script I have to make a save in the script and give resync the console.

Thank you.

Quote:// Healing System v4.0
// Scripted by Fusion (a.k.a. Jdog)


[defname def_bandage]
AllowReadyBandage 1 // Allow players to 'ready' bandages?
BloodyBandageAtFail 1 // Bloody bandages at failure or success?
BandageDelay 4 // 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 2 // 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> Onde deseja aplicar a bandagem?
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> Voce aplica bandagem em voce.
else
src.sysmessage @<def0.MessageColor> Voce aplicou bandagem no alvo.
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> O alvo nao precisa ser curado.
endif
endif
else
src.sysmessage @<def0.MessageColor> Esta muito longe.
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> O alvo esta muito longe.
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> Voce aplicou as bandagens, mas nao conseguil ajudar.
cont.sysmessage @<def0.MessageColor> Voce falhou ao tentar ressucitar o alvo.
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> Seus dedos escorregam ao tentar aplicar a bandagem.
findid(i_memory_healer).remove
events -e_heal_interrupt
return 0

[EOF]



RE: Healing System Help - Barnabus - 10-17-2012 08:28 AM

I think your problem is your TYPEDEF Dclick try this instead.
PHP Code:
ON=@DCLICK
    
IF (<SRC.FINDID.i_memory_healer>)
        
SRC.SYSMESSAGE @0029,,1 You cannot heal again yet
        
RETURN 1
    
ENDIF
    IF (<
CONT>!=<SRC.FINDLAYER(21).UID>)
      
SRC.SYSMESSAGE @0029,,1 Bandages must be in your pack to use
      RETURN 
1
    
ENDIF
    
SRC.SYSMESSAGE @95,,1 Who do you wish to heal?
    
TARGET
    
RETURN 

IF (<CONT>!=<SRC.FINDLAYER(21).UID>)
SRC.SYSMESSAGE @0029,,1 Bandages must be in your pack to use
RETURN 1
ENDIF

Checks to see if it is inside your pack I think if you want it to be used from a bag in a bag, you could just do
IF (<SRC.FINDID.i_bandage>) and it shouldnt matter how deep the bandage is stored.


RE: Healing System Help - Paulo_BR - 10-17-2012 02:15 PM

Oh man, its work now, thank you so much!!!!!!