Jump to content
  • 0

Anti-mob System


serjtk

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   0
  • Joined:  11/12/14
  • Last Seen:  

Hello all,

I've been trying to create a system wich in a 2x1, 3x1, 4x1 (etc..) situation, mobers wil receive a debuff like decrease agi.

This is an example made by chat gpt/deep seek. This one does not show any problems on rAthena, but no working at all.

Quote

-    script    AntiGankSystem    -1,{
OnPCAttackEvent:
    if (strcharinfo(3) == "guild_vs3") { // Aplica apenas nesses mapas
        set .targetID, getcharid(0);
        set .attackers, 0;

        // Obtém lista de jogadores próximos no mesmo mapa PvP
        getmapxy .@map$, .@x, .@y, 0;
        setarray .@players, getmapunits(BL_PC, .@map$);

        for (set .@i, 0; .@i < getarraysize(.@players); set .@i, .@i + 1) {
            if (getcharid(0, .@players[.@i]) != .targetID) {
                if (checkvending(.@players[.@i]) == 0) { 
                    set .attackers, .attackers + 1;
                }
            }
        }

        // Se houver 2 ou mais atacantes no mesmo alvo, aplica penalidade
        if (.attackers >= 2) {
            sc_start SC_DECREASEAGI, 10000, 10;  // Reduz a velocidade de movimento
        }
    }
    end;
}
 


Could you guys please make some comments?

Thank you.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  04/15/25
  • Last Seen:  

On 2/28/2025 at 8:07 AM, serjtk said:

Hello all,

I've been trying to create a system wich in a 2x1, 3x1, 4x1 (etc..) situation, mobers wil receive a debuff like decrease agi.

This is an example made by chat gpt/deep seek. This one does not show any problems on rAthena, but no working at all.


Could you guys please make some comments?

Thank you. Geometry Dash

Unfortunately, OnPCAttackEvent alone doesn't give you all the context you need. You might consider combining OnPCAttackEvent with a timer or periodic check to aggregate attack data.

Use src mod for better tracking. If you're open to modifying the source (src), you could implement a true anti-gank system by tracking attackers on the target side, which is more reliable.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...