Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stop damage/ARGN1 if...
Author Message
Artyk
Journeyman
*

Posts: 75
Likes Given: 43
Likes Received: 9 in 9 posts
Joined: Sep 2014
Reputation: 0



Post: #2
RE: Stop damage/ARGN1 if...
I would do something like this, I hope it's well written, i'm a bit asleep Big Grin

PHP Code:
ON=@GETHIT
IF (<ARGN2> & dam_magic)    // splitted if so you can put serv.log to catch errors
    
IF (<tag0.magicalshield> > 0)    // tag0 instead of tag, so if it is not set, it becomes 0
        // local variable to calculate the amount absorbed
        
local.ms_absorb = <qval <argn1> >= <tag0.magicalshield> ? <tag0.magicalshield> : <argn1>>
        
argn1 -= <local.ms_absorb>
        
tag.magicalshield -= <local.ms_absorb>
        
        
sfx 952
        EFFECT 3 i_fx_sparkle_2
1616
        resendtooltip
=1
        
// only return 1 if all the damage was mitigated, otherwise go on
        
IF (<argn1> <= 0)
            return 
1
        
ENDIF
    ENDIF
ENDIF

// repeat the same as magic shield for physical
IF (<ARGN2> & dam_physical)
    IF (<
tag0.defenseshield> > 0)
        
local.ds_absorb = <qval <argn1> >= <tag0.defenseshield> ? <tag0.defenseshield> : <argn1>>
        
argn1 -= <local.ds_absorb>
        
tag.defenseshield -= <local.ds_absorb>
        
        
EFFECT 3 i_fx_curse1616
        resendtooltip
=1
        dorand 
3
        sfx 952
        sfx 953
        sfx 954
        
        
IF (<argn1> <= 0)
            return 
1
        
ENDIF
    ENDIF
ENDIF

// ------------------------------------------------- Didn't understand the part below
IF (<eval <tag.defenseshield>> <= 1)
tag.lifeleft <eval <muldiv <hits>,100,<maxhits>>>
tag.defenseshield <eval <tag.defenseshield>>
tag.magicalshield <eval <tag.magicalshield>>
UPDATE 1
resendtooltip
=1

ELSEIF (<eval <tag.magicalshield>> <= 1)
tag.lifeleft <eval <muldiv <hits>,100,<maxhits>>>
tag.defenseshield <eval <tag.defenseshield>>
tag.magicalshield <eval <tag.magicalshield>>
UPDATE 1
resendtooltip
=1
ENDIF 
(This post was last modified: 08-17-2018 09:29 AM by Artyk.)
08-17-2018 09:28 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Stop damage/ARGN1 if... - Lano - 08-17-2018, 08:00 AM
RE: Stop damage/ARGN1 if... - Artyk - 08-17-2018 09:28 AM
RE: Stop damage/ARGN1 if... - Coruja - 08-17-2018, 02:14 PM
RE: Stop damage/ARGN1 if... - Lano - 08-17-2018, 04:23 PM

Forum Jump:


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