SphereCommunity
paralyze shield problem.. - Printable Version

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



paralyze shield problem.. - Pidrila - 02-09-2014 05:36 PM

i have a problem with paralyze shield..
first of all i have combat system on@=gethit trigger
and a paralyze field with on@=gethit trigger function..
when i get a spellsucces or gethit then player who hits other player (who have equiped this shield) then he gets paralyzed, but the problem is there that when player is gets paralyzed, the other player who has this shield, didnt get the last damage from player.. as like it missed the target.. that should not be..

here is the paralyze shield script

Code:
[ITEMDEF i_paralizzly_shield]
ID=I_SHIELD_Dupre
NAME=Paralizzly Shield
ARMOR=70
TYPE=T_SHIELD
SKILLMAKE=CARPENTRY 200.0, t_carpentry
VALUE=100

ON=@CREATE
HITPOINTS=100
COLOR=04ad

ON=@Click
MESSAGE  <name>
MESSAGE [Durability: <HITPOINTS>]
return 1

ON=@EQUIP
IF (<SRC.ISMAGE>)
SRC.events +e_paralizzly_shield
ELSE
SRC.events -e_paralizzly_shield
unequip
src.sysmessage @07a1,3 You cant equip mage items.
return 1
endif


ON=@UNEQUIP
SRC.events -e_paralizzly_shield
RETURN 1



[EVENTS e_paralizzly_shield]
ON=@GETHIT
IF !(<src.archery>>960.0)
IF rand(4)==1
var.act <src.act.uid>
src.newitem i_ice_memory_shield
src.act.equip
src.act <var.act>
src.damage <eval <act.tag0.damage>>,1,<uid>
return 1
endif
ENDIF


ON=@SpellSuccess
IF (<ARGN>==49) || (<ARGN>==1) || (<ARGN>==27) || (<ARGN>==57) || (<ARGN>==42) || (<ARGN>==43) || (<ARGN>==3) || (<ARGN>==69) || (<ARGN>==28) || (<ARGN>==18) || (<ARGN>==51) || (<ARGN>==12) || (<ARGN>==30) || (<ARGN>==5) || (<ARGN>==31) || (<ARGN>==53) || (<ARGN>==46) || (<ARGN>==55) || (<ARGN>==37) || (<ARGN>==38) || (<ARGN>==47) || (<ARGN>==39)
        if !(<act.uid> == <src.uid>)
        IF !(<SRC.NPC>)
            IF rand(4)==1
            timerf 1,ACT.SPELLEFFECT S_PARALYZE,10000
            timerf 1,ACT.SAY @0444 Paralyze!
            endif
            endif
            ENDIF
            ENDIF





ON=@SPELLEFFECT
IF (<ARGN>==49) || (<ARGN>==1) || (<ARGN>==27) || (<ARGN>==57) || (<ARGN>==42) || (<ARGN>==43) || (<ARGN>==3) || (<ARGN>==69) || (<ARGN>==28) || (<ARGN>==18) || (<ARGN>==51) || (<ARGN>==12) || (<ARGN>==30) || (<ARGN>==5) || (<ARGN>==31) || (<ARGN>==53) || (<ARGN>==46) || (<ARGN>==55) || (<ARGN>==37) || (<ARGN>==38) || (<ARGN>==47) || (<ARGN>==39)
    IF !(<SRC.UID>==<UID>)
        IF !(<SRC.NPC>)
                IF rand(4)==1
          SRC.SPELLEFFECT S_PARALYZE,10000
                RETURN 1
            ENDIF
            ENDIF
            ENDIF
            ENDIF

[ITEMDEF i_ice_memory_shield]
ID=I_MEMORY
TYPE=T_EQ_SCRIPT

ON=@EQUIP
TIMERD=1

ON=@TIMER
CONT.EFFECT=3,i_fx_curse,15,15,1
CONT.FLAGS |= 04
CONT.SAY @0444 Paralyze!
REMOVE
RETURN 1



RE: paralyze shield problem.. - Samba - 02-09-2014 06:35 PM

If I recall correctly, when you return 1 on a @gethit, @attack, etc. you nullify the effect the hit/attack action would have.
So you should return 0

For example:
http://wiki.sphere.torfo.org/index.php/@GetHit

look at the end of the page


RE: paralyze shield problem.. - XuN - 02-09-2014 06:53 PM

I'll asume you are using a 'recent' build:

Code:
ON=@EQUIP
IF (<SRC.ISMAGE>)
SRC.events +e_paralizzly_shield
ELSE
SRC.events -e_paralizzly_shield
unequip
src.sysmessage @07a1,3 You cant equip mage items.
return 1
endif

Code:
ON=@EQUIPTEST //this trigger is called before @Equip, return 1 here
IF !(<SRC.ISMAGE>)
    src.sysmessage @07a1,3 You cant equip mage items.
    return 1
endif

ON=@Equip
SRC.events +e_paralizzly_shield

ON=@UnEquip
SRC.events -e_paralizzly_shield


Code:
ON=@SpellSuccess
IF (<ARGN>==49) || (<ARGN>==1) || (<ARGN>==27) || (<ARGN>==57) || (<ARGN>==42) || (<ARGN>==43) || (<ARGN>==3) || (<ARGN>==69) || (<ARGN>==28) || (<ARGN>==18) || (<ARGN>==51) || (<ARGN>==12) || (<ARGN>==30) || (<ARGN>==5) || (<ARGN>==31) || (<ARGN>==53) || (<ARGN>==46) || (<ARGN>==55) || (<ARGN>==37) || (<ARGN>==38) || (<ARGN>==47) || (<ARGN>==39)
        if !(<act.uid> == <src.uid>)
        IF !(<SRC.NPC>)
            IF rand(4)==1
            timerf 1,ACT.SPELLEFFECT S_PARALYZE,10000
            timerf 1,ACT.SAY @0444 Paralyze!
            endif
            endif
            ENDIF
            ENDIF

This can be applied to the @SpellEffect trigger too.
Code:
ON=@SpellSuccess
IF (<serv.spell.<argn>.flags>&spellflag_harm) //this will check for all harmfull spells instead of your long check (simple and fast, without unneeded checks).
    if !(<uid>==<src>)//there is no act in this trigger, so I guess you are comparing the caster  with the spell receiver.
        IF !(<SRC.NPC>)
            IF (<r4>==1)
                timerf 1,ACT.SPELLEFFECT S_PARALYZE,10000
                timerf 1,ACT.SAY @0444 Paralyze!
            endif
        endif
    ENDIF
ENDIF

And for the end, what is causing your problem:

Code:
ON=@GETHIT
IF !(<src.archery>>960.0)
IF rand(4)==1
var.act <src.act.uid>
src.newitem i_ice_memory_shield
src.act.equip
src.act <var.act>
src.damage <eval <act.tag0.damage>>,1,<uid>
return 1
endif
ENDIF

Thats what you have, this is how it should be and why:

Code:
ON=@GETHIT
IF !(<src.archery>>960.0)
    IF (<r4>==1)
        //var.act <src.act.uid> not needed, see the 2 following lines.
        serv.newitem i_ice_memory_shield //this will create an item without modifying your act
        new.equip //and new.equip will equip it to the SRC, if you want it to be equiped by the character receiving the damage change it to EQUIP=<NEW>
        //src.act <var.act>//not needed too
        //src.damage <eval <act.tag0.damage>>,1,<uid> //here you are doing damage to the character dealing it, however... where are you storing act.tag.damage? i can't see it anywhere, hence it should not do any damage.
        //And I don't see the point on dealing damage to the damage dealer in this case, with a paralyzing shield... it should paralyze him, not damage?
        //return 1 if you return 1 in the @GetHit you will stop the proccess, wich in this case is the damage itself
    endif
ENDIF



RE: paralyze shield problem.. - Pidrila - 02-09-2014 06:53 PM

ohh maan.. im soo noob that i forgot about it Big Grin

thank you Samba..

and thanks for info about these script lines. Smile