Jump to content
  • 0

[HELP]Anti Pk Guard for avoiding hitting players from aoe.


bullseye92
 Share

Question

Hello MxC i have this code and i tried to test it ingame.While compiling had no problem at all but my npc doesnt seems to work.Any ideas?

 

L2AttackableAI.java

 

// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event

 

if (target instanceof L2PcInstance && ((L2PcInstance) target).getKarma() > 0) super.onIntentionAttack(target);

else if(!(getActiveChar() instanceof L2GuardInstance)||getActiveChar() instanceof L2GuardInstance && getActiveChar().getNpcId()!= Config.ANTI_PK_NPC)

{

super.onIntentionAttack(target);

}

else if(target instanceof L2PcInstance && ((L2PcInstance) target).getKarma() == 0)

{

getActiveChar().clearAggroList();

}

}

 

 

config.java

    public static int ANTI_PK_NPC;

 

 

    ANTI_PK_NPC = Integer.parseInt(L2JModSettings.getProperty("AntiPkNpc", "36606"));

 

 

l2jmods.properties

 

# ---------------------------------------------------------------------------

# Anti PK NPC

# ---------------------------------------------------------------------------

# Put the ID of Anti-PK NPC, he will attack only PKs

# Default: 36606

AntiPkNpc = 36606

 

Do you see any error on this code?I tried to modify it and such but no chance by the moment.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

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.

 Share



  • Posts

    • @xRelic se euxaristw poli filaraki.. ara afou les oti exei arketa themata as dw allo pack kalitera gia na asxolithw.. se euxaristw kai pali
    • Το φροζεν εχει αρκετα θεματα και ενα απο αυτα ειναι λιγο με τα ραιδβοσσ στο σπαουν λιστ...μπορεις να κανεις copy paste το βοοσ και απο l2raidboss να το κανεις νπσ με δικο σου ιδ και να βαλεις συγκεκριμενο τιμε που θες να κανει σπαουν πχ //spawn valakas 1 3600 (wra) απλα θα ξανα βγιε απο την ωρα που θα βγει ... οποτε μπορεις τριτη πχ στις 8 να κανεις //spawn valakas 1 604800 ετσι θα βγει την επομενη τριτη στην ωρα που θα γινει δεαδ... αν θες παλι να εξτρα πραγματα ωστε να γινεται announcements κτλπ θες code απο την αρχη.
    • FROZEN PACK Kalispera stin omada tha ithela na kanw tin eksis erwtisi pws mporw na valaw sta raid boss na vgenoun singekrimenes meres pou thelw egw? P.x pws mporw na kanw to Baium na vgenei kathe Triti Pempti stis 20:00 me 21:00?  H to zaken na vgenei kathe Deutera Tetarti Paraskeuh 19:00 me 20:00? euxaristw apo twra opoios voithisei
    • Thanks, I forgot about New World, after the buggy launch scandal. I heard they fixed it up and planning an content update.   And yeah I'm also waiting for ashes, hope it's gonna actually launch. Keeping up to date on it fr Narc's YouTube channel.
    • It's better to change games instead of playing same game everyday... it's annoying to do same stuff in lineage 2 whilst the passion of this game came to its end.... there are plenty of games that everyone could try out tho, steam is the best choice right now to play games.... recently i'm playing from GTArcade the game "League of Angels Heaven's Fury" it has got lots of stuff to do...
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock