bullseye92 Posted April 4, 2012 Share Posted April 4, 2012 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 More sharing options...
0 insaNNe Posted April 5, 2012 Share Posted April 5, 2012 go in l2jmods.prop and put this: AntiPkNpc = 36606 36606 - anti-pk npc id Link to comment Share on other sites More sharing options...
0 bullseye92 Posted April 5, 2012 Author Share Posted April 5, 2012 I had this code too i just forgot to upload it.Still doesnt wotk though xD Link to comment Share on other sites More sharing options...
0 bullseye92 Posted April 5, 2012 Author Share Posted April 5, 2012 Is there any chance that this line changed on HI5? super.onIntentionAttack(target) ?? Link to comment Share on other sites More sharing options...
Question
bullseye92
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
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now