Medisept Posted June 25, 2014 Posted June 25, 2014 Hello there, can somebody help me and give me a clue how i could make the following case? While a player is in jail, he cant target nothing (NPC's,other players, summons etc etc) -Freya Client
0 Boorinio Posted June 26, 2014 Posted June 26, 2014 yea, but this way player wont be able to target players who are in jail. I want to make him cant target anything, anywhere...(Just to make it simple, i dont want it for jail, i want it for one of my conditions, so i though this jail thingy will clean things for you). P.S: I want it if player.isInEvent can't target anything..... FREYA CLIENT try onAction packet you may have better results
0 SweeTs Posted June 25, 2014 Posted June 25, 2014 (edited) Basically you have to add a check @ onTarget method, like if target instanceof L2Playable || L2NpcInstance then return. Ofc you need a check about the zone first if isInsideZone(ZoneId.JAIL) or w/e method is on your pack (probably frozen) :P better! Do not spam. Edited June 25, 2014 by SweeTs
0 Medisept Posted June 25, 2014 Author Posted June 25, 2014 (edited) Basically you have to add a check @ onTarget method, like if target instanceof L2Playable || L2Summon then return. Ofc you need a check about the zone first if isInsideZone(ZoneId.JAIL) or w/e method is on your pack (probably frozen) :P Do not spam. I tried to this one but nothing... public void setTarget(L2Object object) { + if (this instanceof L2PcInstance) + { + L2PcInstance p = (L2PcInstance)this; + if (p.isInJail()) + { + return; + } + } if (object != null && !object.isVisible()) object = null; if (object != null && object != _target) { getKnownList().addKnownObject(object); object.getKnownList().addKnownObject(this); } _target = object; } L2Character.java Edited June 25, 2014 by Medisept
0 SweeTs Posted June 25, 2014 Posted June 25, 2014 (edited) if (object instanceof L2PcInstance && object.isInsideZone(ZoneId.JAIL)) return; If so Edited June 25, 2014 by SweeTs
0 Medisept Posted June 25, 2014 Author Posted June 25, 2014 if (object instanceof L2PcInstance && object.isInsideZone(ZoneId.JAIL)) return; If so yea, but this way player wont be able to target players who are in jail. I want to make him cant target anything, anywhere...(Just to make it simple, i dont want it for jail, i want it for one of my conditions, so i though this jail thingy will clean things for you). P.S: I want it if player.isInEvent can't target anything..... FREYA CLIENT
0 SweeTs Posted June 25, 2014 Posted June 25, 2014 (edited) Yup, I just cleaned your example. Add w/e instance you want to (block) that check :P Edited June 25, 2014 by SweeTs
0 johny123 Posted June 25, 2014 Posted June 25, 2014 i think is better is like jail system you cant target nothing so you cant escape so easy!
0 Medisept Posted June 26, 2014 Author Posted June 26, 2014 try onAction packet you may have better results It worked exactly as i want... Thanks!
0 SweeTs Posted June 26, 2014 Posted June 26, 2014 It worked exactly as i want... Thanks! Locked then.
Question
Medisept
Hello there, can somebody help me and give me a clue how i could make the following case?
While a player is in jail, he cant target nothing (NPC's,other players, summons etc etc)
-Freya Client
11 answers to this question
Recommended Posts