SphereCommunity
Problem healing and armor shield - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Problem healing and armor shield (/Thread-Problem-healing-and-armor-shield)



Problem healing and armor shield - admin_teclis - 11-26-2012 04:49 AM

Hi all,
I have a problem with the script healing ... (I copied the script at the end of topic)
My script calculates the time of blindfolded based on dex ...
So if dex is high time bandaged will be minor and so on ....
Only seems to me to be unpacked time ... That is not real ..
In addition, always Nellos weave script, I can not figure out how do I make sure that the bandaged do not overlap, but to start the other must finish the first, or even if blindfold again after the time is already bandaged resets and restarts the time jumping blindfolded previous ...

Last question .. I can not set the armor shields .. I mean I put it but it is real and heels ... If I put 85 on the script I have 5 armor to 0 and parrying 90 of 100 .... There is a formula to calculate it??
Thanks to all ...

Code:
[defname healing]  

//Options
instant            0 // 0 = Healing with delay    |     1 = Intant Healing
interrupt        0 //0 = Do not interrupt when get hit | 1 = When get hit interrupt the healing process
delay            3 //Healing delay in seconds    
crimtimer        3 //Criminal timer in minutes
ressamnt            8 //Amount of bandages that you need to ress
failwait            1 //When fail  have to wait the delay ? 0 = No  1 = Yes
distancia            3 //Number of tiles to be too far away to heal
curaarmado        0 // Can heal with a weapon on hands ? 0 = No 1 = Yes
falhaskill        1 //When start healing if using another skill will fail the other skill ? 0 = No, the both can work together  1 = Yes, will cancel the other skill and will start healing
bloodreturn           1 //Return bloody bandages ? 0 = No 1 = Yes
healmax            1000 //Maximum skill you can get.
healdiff            1,1,1 //Gain diff.  0 to 29.9,30.0 to 59.9,60.0 to maximum
iscriminal        1 //Healing criminal or player killer is a crime ? 0 = No 1 = Yes
fullhits            0 //Healing heal full life in just one bandage ? 0 = No 1 = Yes
vetpermitido        1 //Is veterynary working ? 0 = No, you can't heal pets 1 = Yes, veterinary on
curasummun        0 // Can heal summun pets?    0 = No 1 = Yes    
curapoison        1 //Can cure poison ?    0 = No  1 = Yes
healmim            850 //Minimum healing needed to heal poison
healapoisoned    0 //If poisoned and is not allowed to cure poison can you heal as if you're not poisoned ? 0 = You can't heal as long as poison stands still  1 = You heal as if you weren't poisoned


[ITEMDEF 0e21]
DEFNAME=i_bandage    
RESOURCES=i_cloth
TYPE=T_BANDAGE
WEIGHT=.1
DUPELIST=0ee9
CATEGORY=Items by Professions
SUBSECTION=Healer
DESCRIPTION=Clean Bandages

on @dclick
if !(<src.findid(i_heal_timer)>) || !(<src.findid(i_heal_delay)>)
    target @99 Cosa vuoi curare?
    return 1
else    
    if (<def.instant> == 1)
        src.sysmessage @99 Devi aspettare <eval <src.findid(i_heal_timer).timer>> secondi per curare di nuovo.
    else
        src.sysmessage @99 Devi aspettare la bendata.
    endif
    return 1
endif

on @targon_item
src.sysmessage @99 Non puoi curare item.
return

on @targon_ground
src.sysmessage @99 Non puoi curare il terreno.
return

on @targon_char
link = <src.targ.uid>

if (<src.findid(i_heal_timer)>)
    src.sysmessage @99 Devi aspettare <eval <src.findid(i_heal_timer).timer>> secondi per curare di nuovo.
    return 1
endif

if (<def.curaarmado> == 0)
    if (<src.findlayer(1)>)
        src.findlayer(1).unequip
    endif
    if (<src.findlayer(2)>)
        src.findlayer(2).unequip
    endif
endif

if (<def.falhaskill> == 1)
    if (<src.action> != -1)
        src.action = -1
    endif
endif

if (<src.flags> & statf_dead)
    src.sysmessage @0481 Non puoi curarti da morto.
    return 1
endif

if (<link.distance> > <def.distancia>)
    src.sysmessage @0481 Sei troppo lontano da <link.name>
    return 1
elseif !(<link.canseelos>)
    src.sysmessage @0481 Non riesci a vedere <link.name>
    return 1
endif

if (<def.curasummun> == 0)
    if (<link.flags> & statf_conjured)
        src.sysmessage @0481 Non puoi curare creature summonate.
        return 1
    endif
endif

if (<def.vetpermitido> == 1)
    if (<link.isplayer>)
        local.skill = healing
    else
        local.skill = veterinary
    endif
else
    if !(<link.isplayer>)
        src.sysmessage @0481 Voce so pode curar players.
        return 1
    endif
endif

local.skill = healing

if (<def.instant> == 1)
    if (<link.flags> & statf_poisoned)
        if (<def.curapoison> == 1)
            if (<src.<local.skill>> >= <def.healmim>)
                if (Rand(80) < Rand(<src.<local.skill>> +1))
                    link.spelleffect s_cure,<src.<local.skill>>
                    src.say @083 Hai curato <link.name> dal veleno.
                    serv.newitem i_heal_timer
                    new.equip
                    src.f_criminal_check
                    src.bloodyreturn 1
                    src.healgain <local.skill>
                    if (<amount> == 1)
                        remove
                    else
                        amount -= 1
                        update
                    endif
                    return 1
                else
                    src.say @083 Hai fallito la cura a <link.name> dal veleno.
                        if (<def.failwait> == 1)
                            serv.newitem i_heal_timer
                            new.equip
                        endif
                    return 1
                endif
            else
                src.sysmessage @077a Non hai <local.skill> suffuciente per curare il veleno.
                return 1
            endif
        else
            if (<def.healapoisoned> == 0)
                src.sysmessage @077a Non puoi curarti se sei avvelenato.
                return 1
            else
                if (<link.hits> < <link.maxhits>)
                    if (Rand(80) < Rand(<src.<local.skill>> +1))
                        local.hits <link.hits>
                        if (<def.fullhits> == 0)
                            link.spelleffect s_greater_heal,<src.<local.skill>>
                        else
                            link.hits = <link.maxhits>
                        endif
                        local.hits = <link.hits> - <eval <local.hits>>
                        src.say @077a Hai curato <link.name> di <eval <local.hits>> hits
                        serv.newitem i_heal_timer
                        new.equip
                        src.f_criminal_check
                        if (<amount> == 1)
                            remove
                        else
                            amount -= 1
                            update
                        endif
                        src.bloodyreturn 1
                        src.healgain <local.skill>
                        return 1
                    else
                        src.say @0480 Hai fallito la cura di <link.name>
                        if (<def.failwait> == 1)
                            serv.newitem i_heal_timer
                            new.equip
                        endif
                        return 1
                    endif
                else
                    src.sysmessage @0481 Voce nao prescisa curar <link.name>
                    return 1
                endif
            endif
        endif
    endif

    if (<link.flags> & statf_dead)
        if (<link.uid> != <src.uid>)    
            if (<src.restest <def.ressamnt> i_bandage>)
                link.resurrect
                src.bloodyreturn 5
                src.healgain <local.skill>
                src.say Hai resuscitato <link.name>
                return 1
            else
                src.sysmessage @0481 Devi avere 8 bende per resuscitare.
                return 1
            endif
        else
            src.sysmessage @0481 Non puoi resuscitarlo
            return 1
        endif
    endif

    if (<link.hits> < <link.maxhits>)
        if (Rand(80) < Rand(<src.<local.skill>> +1))
            local.hits <link.hits>
            if (<def.fullhits> == 0)
                link.spelleffect s_greater_heal,<src.<local.skill>>
            else
                link.hits = <link.maxhits>
            endif
            local.hits = <link.hits> - <eval <local.hits>>
            src.say @077a Hai curato <link.name> di <eval <local.hits>> hits
            serv.newitem i_heal_timer
            new.equip
            src.f_criminal_check
            if (<amount> == 1)
                remove
            else
                amount -= 1
                update
            endif
            src.healgain <local.skill>
            src.bloodyreturn 1
            return 1
        else
            src.say @0480 Hai fallito la cura di <link.name>
            if (<def.failwait> == 1)
                serv.newitem i_heal_timer
                new.equip
            endif
            return 1
        endif
    else
        src.sysmessage @0481 Voce nao prescisa curar <link.name>
        return 1
    endif
else
    if (<link.flags> & statf_dead)
        if (<link.uid> != <src.uid>)    
            if (<src.restest <def.ressamnt> i_bandage>)
                src.say @0481 Applichi le bende...
                serv.newitem i_heal_delay
                new.link <link.uid>
                new.more1 1
                new.equip
                if (<amount> > 5)
                    amount -= 5
                elseif (<amount> == 5)
                    remove
                endif
                return 1
            else
                src.sysmessage @0481 Devi avere 5 bende per resuscitare
                return 1
            endif
        else
            src.sysmessage @0481 non puoi resuscitarlo
            return 1
        endif
    else
        if (<link.flags> & Statf_poisoned) || (<link.hits> < <link.maxhits>)
            if (<link.flags> & statf_poisoned)
                if (<def.curapoison> == 0)
                    if (<def.healapoisoned> == 0)
                        src.sysmessage @0481 Non puoi curarti da avvelenato.
                        return 1
                    endif
                else
                    if (<src.<local.skill>> < <def.healmim>)
                        src.sysmessage @0481 Non hai skill necessaria per curarti
                        return 1
                    endif
                endif
            endif
            src.say @0481 Applichi le bende...
            serv.newitem i_heal_delay
            new.link <link.uid>
            new.equip
            if (<amount> == 1)
                remove
            else
                amount -= 1
                update
            endif
            if (<def.interrupt> == 1)
                src.events +e_heal_disturb
            endif
        else
            src.sysmessage @99 Non riesci a curare a <link.name>
        endif
        return 1
endif

[itemdef i_heal_delay]
id=i_memory
type=t_eq_script
name=Heal Timer

on=@create
IF (<EVAL <SRC.DEX>> <= 40 )
    timer = 8
    src.say @0481 timer 10
    else
    IF ((<EVAL <SRC.DEX>> > 40) && (<EVAL <SRC.DEX>> < 50 ))
        timer = 7
        src.say @0481 timer 9
        endif
    IF ((<EVAL <SRC.DEX>> > 50) && (<EVAL <SRC.DEX>> < 60 ))
        timer = 6
            src.say @0481 timer 8
        endif
        IF ((<EVAL <SRC.DEX>> > 60) && (<EVAL <SRC.DEX>> < 70 ))
            timer = 5
             src.say @0481 timer 7
         endif
         IF ((<EVAL <SRC.DEX>> > 70) && (<EVAL <SRC.DEX>> < 80 ))
             timer = 4
              src.say @0481 timer 6
          endif
          IF ((<EVAL <SRC.DEX>> > 80) && (<EVAL <SRC.DEX>> < 90 ))
              timer = 3
               src.say @0481 timer 5
           endif
           IF ((<EVAL <SRC.DEX>> > 90) && (<EVAL <SRC.DEX>> < 100 ))
               timer = 2
                src.say @0481 timer 4
            endif


on=@timer
if (<topobj.flags>&statf_dead)
    topobj.sysmessage @99 Sei morto e non puoi curarti.
    topobj.events -e_heal_disturb
    remove
    return 0
endif

if (<link.isplayer> == 1)
    local.skill = healing
else
    local.skill = veterinary
endif

if (<more1> == 1)
    link.resurrect
    topobj.bloodyreturn 5
    topobj.healgain <local.skill>
    topobj.say @077a Hai resuscitato <link.name>
    topobj.events -e_heal_disturb
    remove
    return 0
endif

if (<link.flags> & statf_poisoned)
    if (<def.curapoison> == 1)
        if (<topobj.<local.skill>> >= <def.healmim>)
            if (Rand(80) < Rand(<topobj.<local.skill>> +1))
                link.spelleffect s_cure,<topobj.<local.skill>>
                topobj.say @083 Hai curato <link.name> dal veleno.
                topobj.f_criminal_check
                topobj.bloodyreturn 1
                topobj.healgain <local.skill>
                topobj.events -e_heal_disturb
                remove
                return 0
            else
                topobj.say @083 Eu falhei em curar <link.name> do veneno.
                topobj.events -e_heal_disturb
                remove
                return 0
            endif
        else
            topobj.sysmessage @077a Voce nao tem <local.skill> o suficiente para curar veneno.
            topobj.events -e_heal_disturb
            remove
            return 0
        endif
    else
        if (<def.healapoisoned> == 0)
            topobj.sysmessage @077a Voce nao pode curar alguem invenado.
            topobj.events -e_heal_disturb
            remove
            return 0
        else
            if (<link.hits> < <link.maxhits>)
                if (Rand(80) < Rand(<topobj.<local.skill>> +1))
                    local.hits <link.hits>
                    if (<def.fullhits> == 0)
                        link.spelleffect s_greater_heal,<topobj.<local.skill>>
                    else
                        link.hits = <link.maxhits>
                    endif
                    local.hits = <link.hits> - <eval <local.hits>>
                    topobj.say @077a Eu curei <link.name> em <eval <local.hits>> hits PER PG
                    topobj.f_criminal_check
                    topobj.bloodyreturn 1
                    topobj.healgain <local.skill>
                    topobj.events -e_heal_disturb
                    remove
                    return 0
                else
                    topobj.say @0480 Eu falhei em curar <link.name>
                    topobj.events -e_heal_disturb
                    remove
                    return 0
                endif
            else
                topobj.sysmessage @0481 Voce nao prescisa curar <link.name>
                topobj.events -e_heal_disturb
                remove
                return 0
            endif
        endif
    endif
endif

if (<link.hits> < <link.maxhits>)
    
IF (RAND(3010))<<EVAL (<CONT.HEALING>*2)+<CONT.ANATOMY>>)
    
if ((<topobj.<local.skill>> >= 300) && (<topobj.<local.skill>> <= 400))

     VAR.HEAL = 9
elseif ((<topobj.<local.skill>> >= 401) && (<topobj.<local.skill>> <= 500))

     VAR.HEAL = 11
    
elseif ((<topobj.<local.skill>> >= 501) && (<topobj.<local.skill>> <= 600))

     VAR.HEAL = 13

elseif ((<topobj.<local.skill>> >= 601) && (<topobj.<local.skill>> <= 700))

     VAR.HEAL = 15
    
elseif ((<topobj.<local.skill>> >= 701) && (<topobj.<local.skill>> <= 800))

     VAR.HEAL = 17
    
elseif ((<topobj.<local.skill>> >= 801) && (<topobj.<local.skill>> <= 900))

     VAR.HEAL = 19
    
elseif ((<topobj.<local.skill>> >= 901) && (<topobj.<local.skill>> <= 999))

     VAR.HEAL = 20
    
elseif (<topobj.<local.skill>> == 1000)

     VAR.HEAL = 21
    
endif

if (<cont.anatomy> <= (999))
var.ana = 3
var.heal = <eval <var.heal> - <var.ana>>
elseif ((<cont.anatomy> >= (1000)) && (<cont.anatomy> <= (1099)))
var.ana = 0
var.heal = <eval <var.heal> + <var.ana>>
elseif ((<cont.anatomy> >= (1100)) && (<cont.anatomy> <= (1199)))
var.ana = 1
var.heal = <eval <var.heal> + <var.ana>>
elseif ((<cont.anatomy> >= (1200)) && (<cont.anatomy> <= (1299)))
var.ana = 2
var.heal = <eval <var.heal> + <var.ana>>
elseif ((<cont.anatomy> >= (1300)) && (<cont.anatomy> <= (1399)))
var.ana = 3
var.heal = <eval <var.heal> + <var.ana>>
elseif ((<cont.anatomy> >= (1400)) && (<cont.anatomy> <= (1499)))
var.ana = 4
var.heal = <eval <var.heal> + <var.ana>>
elseif ((<cont.anatomy> >= (1500)) && (<cont.anatomy> <= (1599)))
var.ana = 5
var.heal = <eval <var.heal> + <var.ana>>
elseif ((<cont.anatomy> >= (1600)) && (<cont.anatomy> <= (1699)))
var.ana = 6
var.heal = <eval <var.heal> + <var.ana>>
elseif ((<cont.anatomy> >= (1700)) && (<cont.anatomy> <= (1799)))
var.ana = 7
var.heal = <eval <var.heal> + <var.ana>>
elseif ((<cont.anatomy> >= (1800)) && (<cont.anatomy> <= (1899)))
var.ana = 8
var.heal = <eval <var.heal> + <var.ana>>
elseif ((<cont.anatomy> >= (1900)) && (<cont.anatomy> <= (1999)))
var.ana = 9
var.heal = <eval <var.heal> + <var.ana>>
elseif (<cont.anatomy> == (2000))
var.ana = 10
var.heal = <eval <var.heal> + <var.ana>>
endif

        LINK.HITS = <EVAL <LINK.HITS>+<VAR.HEAL>>
        else
        link.hits = <link.maxhits>
endif
        local.hits = <eval <var.heal>>
        
        topobj.say @68 Hai curato <link.name> di <eval <local.hits>> hits
        topobj.f_criminal_check
        topobj.healgain <local.skill>
        topobj.bloodyreturn 1
        topobj.events -e_heal_disturb
        remove
        return 0
    else
        topobj.sysmessage @0480 Hai fallito la cura a <link.name>
        topobj.events -e_heal_disturb
        remove
        return 0
    endif
else
    topobj.sysmessage @0481 Voce nao prescisa curar <link.name>
    topobj.events -e_heal_disturb
    remove
    return 0
endif

topobj.events -e_heal_disturb
remove
return 0

[function healgain]
if (strmatch("<args>","healing"))
    if (<healing> <300)
        if (Rand(1,<getdiff1 <def.healdiff>>)==1)
            healing += 1
        endif
    elseif (<healing> < 600)
        if (Rand(1,<getdiff2 <def.healdiff>>)==1)
            healing += 1
        endif
    elseif (<healing> < <def.healmax>)
        if (Rand(1,<getdiff1 <def.healdiff>>)==1)
            healing += 1
        endif
    endif
else
    if (<veterinary> <300)
        if (Rand(1,<getdiff1 <def.healdiff>>)==1)
            veterinary += 1
        endif
    elseif (<veterinary> < 600)
        if (Rand(1,<getdiff2 <def.healdiff>>)==1)
            veterinary += 1
        endif
    elseif (<veterinary> < <def.healmax>)
        if (Rand(1,<getdiff1 <def.healdiff>>)==1)
            veterinary += 1
        endif
    endif
endif

[function getdiff1]
return <argv[1]>

[function getdiff2]
return <argv[2]>

[function getdiff3]
return <argv[3]>

[function bloodyreturn]

if (<def.bloodyreturn> != 0)
    serv.newitem i_bandage_bloody
    new.amount <argn>
    trysrc <uid> new.bounce
endif

[function f_criminal_check]
if (<def.iscriminal> == 1)
    if (strmatch("<local.skill>","healing"))
          if (<link.flags>&statf_criminal) || (<link.kills> > <serv.murdermincount>)
            if !(<flags>&statf_criminal)
                flags=<src.flags>|statf_criminal
                sysmessage @0481 criminal!
                serv.newitem i_criminal_timer
                trysrc <uid> new.equip
            endif
        endif
    endif
endif

[itemdef i_heal_timer]
id=i_memory
type=t_eq_script
name=Heal Timer

on=@create
IF (<EVAL <SRC.DEX>> <= 40 )
    timer = 10
    src.say @0481 timer 10
    else
        IF (<EVAL <SRC.DEX>> >40 && <50 )
        timer = 9
        src.say @0481 timer 9
        endif
        IF (<EVAL <SRC.DEX>> >50 && <60 )
            timer = 8
            src.say @0481 timer 8
        endif
         IF (<EVAL <SRC.DEX>> >60 && <70 )
             timer = 7
             src.say @0481 timer 7
         endif
          IF (<EVAL <SRC.DEX>> >70 && <80 )
              timer = 6
              src.say @0481 timer 6
          endif
           IF (<EVAL <SRC.DEX>> >80 && <90 )
               timer = 5
               src.say @0481 timer 5
           endif
            IF (<EVAL <SRC.DEX>> >90 && <100 )
                timer = 4
                src.say @0481 timer 4
            endif
endif

on=@timer
remove
return 0

[itemdef i_criminal_timer]
id=i_memory
type=t_eq_script
name=Criminal Timer

on=@create
timer = <eval <def.crimtimer>*60>

on=@timer
topobj.criminal 0
topobj.flags = <topobj.flags>& ~statf_criminal
remove
return 0

[events e_heal_disturb]

on @gethit
findid(i_heal_delay).remove
say @083 Eu falhei em curar.
events -e_heal_disturb

[EOF]



RE: Problem healing and armor shield - admin_teclis - 11-27-2012 11:42 PM

uhm? help me pls SadCry


RE: Problem healing and armor shield - admin_teclis - 12-05-2012 06:51 AM

i need help plssssss


RE: Problem healing and armor shield - Mordaunt - 12-05-2012 07:00 AM

Looks to me like you are putting the healing memory on the player using the bandages, surely it should go on whoever the bandages are being used on.... what if the user is healing someone else?


RE: Problem healing and armor shield - admin_teclis - 12-05-2012 11:50 PM

It possibly could be so ... I would make sure that anyone who cures a person (whether himself or others pg) can not cure it if the other has already started treatment ... is it possible? Also how do I get the armor shields? I do not understand the formula ....


RE: Problem healing and armor shield - darksun84 - 12-06-2012 12:51 AM

Armor on shield depends from the player's parrying skill, like with 100.0 parrying and a shield with 18AR, you'll get 18 AR, lesser/higher is parrying lesser/higher is the AR you get from the shield's AR value, so with 50.0 parrying you'll get 9 ar, with 150.0 parrying you 'll get 27 AR and so on