vampir Posted March 20, 2011 Posted March 20, 2011 hi I made few weeks ago a guard that hit only pkers for some1 to make server together but since i am not intrested anymore, i am posting it here :) So if this guard see pker, he is attacking him(like normal guard), the thing is that if some1 else is aggroing, attacking or doing anything to this guard, he is still going to hit pker. Also if there is no pker around and guy is using provoke or something, he is not going to hit back, so its cool for custom servers with pk guards that attack other players while farming. And here is the code: java/com/l2jserver/gameserver/ai/l2AttackableAI.java line about 405 in last rev of l2jserver: make from: // Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event super.onIntentionAttack(target); to: // 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()!=31034){ super.onIntentionAttack(target); }else if(target instanceof L2PcInstance && ((L2PcInstance) target).getKarma() == 0){ getActiveChar().clearAggroList(); } Small code but working perfectly, 100% tested, as u can see the custom guard id is 31034, so change it to anything u want :) There is no configs for that but seems i am too lazy for that so do it by yourself if u want If there is such code already then sorry :) Credits: Vampir(me)
ArkeyWave Posted March 20, 2011 Posted March 20, 2011 :o :o .. i do like it :D because of this Also if there is no pker around and guy is using provoke or something, he is not going to hit back this is annoying when people are farming and guards hit them because of these skills .. i will test it ^^ Thanks for sharing :D
pipiou21 Posted March 21, 2011 Posted March 21, 2011 Nice, thanks :p, i'm using it with the one that pk-killer is not killing cursed players :P!
disorder25 Posted March 22, 2011 Posted March 22, 2011 Thank you very much, I have been looking for this for quite some time. Work like a charm.
An4rchy Posted March 22, 2011 Posted March 22, 2011 Well, gj, i hope this will give the solution to: GM REMOVE GUARDS WE CAN'T FARM :P
disorder25 Posted March 23, 2011 Posted March 23, 2011 Well, gj, i hope this will give the solution to: GM REMOVE GUARDS WE CAN'T FARM :P It will give you that soluction for sure One question Vampir can we make pkers drop items when killed by the guard? Thank you.
vampir Posted March 23, 2011 Author Posted March 23, 2011 It will give you that soluction for sure One question Vampir can we make pkers drop items when killed by the guard? Thank you. Would need to take a look at that, but since now i making 2 other shares, i will check that out later :P
Eimanto Posted March 23, 2011 Posted March 23, 2011 Amazing fix, thanks for share. It was making me angry when guards were attacking players who were using AOE skills;]
disorder25 Posted March 24, 2011 Posted March 24, 2011 Would need to take a look at that, but since now i making 2 other shares, i will check that out later :P Thank you
vampir Posted March 25, 2011 Author Posted March 25, 2011 It will give you that soluction for sure One question Vampir can we make pkers drop items when killed by the guard? Thank you. as i was checking now, they are dropping after being kill by guard, drop rate is low but u can change it in configs
ScRaB4ever Posted March 25, 2011 Posted March 25, 2011 well i have a problem with getActiveChar(). it shows me its wrong
Eimanto Posted March 25, 2011 Posted March 25, 2011 So tell what server pack you are using, cuz other people don't have any problems with this fix.
Eimanto Posted March 25, 2011 Posted March 25, 2011 Its obvious, that you are using not L2OFF, but how your pack is called, what's the name? For excample it could be l2jfree, l2jequal and so on.
vampir Posted March 25, 2011 Author Posted March 25, 2011 Its obvious, that you are using not L2OFF, but how your pack is called, what's the name? For excample it could be l2jfree, l2jequal and so on. he said l2j not l2off and probably il - interlude, for sure u will have to change that code to make it work on interlude, what pack u are using?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now