SphereCommunity
attacker.x.ignore problem - Printable Version

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



attacker.x.ignore problem - Rizz - 05-09-2015 07:07 AM

PHP Code:
@gethit

IF (<CTAG0.war_targ> != <src.uid>)
    FOR 
X 0 <attacker>
        IF (<
attacker.<dLOCAL.X>> == <src.uid>)
            
attacker.<dLOCAL.X>.threat=0
            attacker
.<dLOCAL.X>.ignore=1
        
ENDIF
    ENDFOR
    
ENDIF 

CTAG0.war_targ is taken from PACKET5.

This code should prevent the automatic attack when you get hit by someone but it doesn't work...
If you get a hit, you'll start to attack instead of ignore the new target.
Where is the problem?

I don't wanna use @combatadd bcuz I need the attacker join to the list.


RE: attacker.x.ignore problem - XuN - 05-09-2015 05:02 PM

Do you have more attackers in the list? The problem here (I bet) is that when there is no more characters to fight on it will fight this one, i'll commit a fix for this, if this is not the case reply here.

BTW: Your loop is wrong, use this syntax: FOR X 0 <eval <attacker>-1> // so if you have 10 attackers it runs from 0 to 9 (which results a total of 10).

BTW2: Argn2 from @CombatAdd sets automatically ignore to 1


EDIT: It seems I did not update the wiki when added arguments to this trigger, updated it now Smile


RE: attacker.x.ignore problem - Rizz - 05-11-2015 04:01 AM

I tried with an empty and not empty attacker list, still the same.

I cannot use @combatadd bcuz this one will trigger only one time (when the new attacker joins the list).


RE: attacker.x.ignore problem - XuN - 05-11-2015 05:19 PM

Try build from here, I added some code: https://www.dropbox.com/s/k1aqepw37wytzn9/SphereSvr.exe?dl=0

The point on using @CombatAdd was to set this to ignore 1/0 instead of using @gethit (which the less you use, the better... ) and update ignore in the packet5? IDK what you want to achieve in here, it was just an idea.