Prince* Posted August 26, 2011 Share Posted August 26, 2011 hello all... before my post i have search on forum about like that.. but i don't have find anything like that. ----------------------------- 1)Is easy Code! 2)Work! go to: net.sf.l2j.gameserver.model.clientpackets open file attackrequest.java after that: protected void runImpl() { L2PcInstance activeChar = getClient().getActiveChar(); if (activeChar == null) return; add that: + // Peace Zone Attack Exploit Fix + //player can hit mobs(etc) but no players + L2PcInstance ptarget = (L2PcInstance)activeChar.getTarget(); + if (ptarget.isInsideZone(L2Character.ZONE_PEACE)) + { + activeChar.sendMessage("[Guard]: You cant attack player in Peace Zone"); + activeChar.sendPacket(new ActionFailed()); + return; + } + // avoid using expensive operations if not needed i know is easy code but work fine :) Quote Link to comment Share on other sites More sharing options...
TEOGR_hItMaKeR Posted August 26, 2011 Share Posted August 26, 2011 This is the code that dont allows to players hit NPCs in towns? Quote Link to comment Share on other sites More sharing options...
Prince* Posted August 26, 2011 Author Share Posted August 26, 2011 This is the code that dont allows to players hit NPCs in towns? with that code don't allow hit players if players is in peace zone.. check the trick: (trick: Stun one mob and change fast target you start attack with normal hit you new target..) Quote Link to comment Share on other sites More sharing options...
j1maras2@ Posted August 26, 2011 Share Posted August 26, 2011 Nice. But the message you entered is not needed. Quote Link to comment Share on other sites More sharing options...
MixMasteR Posted August 26, 2011 Share Posted August 26, 2011 hmm interested share.. Thank you very much. Quote Link to comment Share on other sites More sharing options...
Prince* Posted August 26, 2011 Author Share Posted August 26, 2011 thanks guys :) Quote Link to comment Share on other sites More sharing options...
AbsolutePower Posted November 17, 2011 Share Posted November 17, 2011 hello all... before my post i have search on forum about like that.. but i don't have find anything like that. ----------------------------- 1)Is easy Code! 2)Work! go to: net.sf.l2j.gameserver.model.clientpackets open file attackrequest.java after that: protected void runImpl() { L2PcInstance activeChar = getClient().getActiveChar(); if (activeChar == null) return; add that: + // Peace Zone Attack Exploit Fix + //player can hit mobs(etc) but no players + L2PcInstance ptarget = (L2PcInstance)activeChar.getTarget(); + if (ptarget.isInsideZone(L2Character.ZONE_PEACE)) + { + activeChar.sendMessage("[Guard]: You cant attack player in Peace Zone"); + activeChar.sendPacket(new ActionFailed()); + return; + } + // avoid using expensive operations if not needed i know is easy code but work fine :) working???? yes its working but its bugged... if someone have townwar event or a event in town... and the pet Bug: you can leave your pet in peace zone with out getting damage the pet... half damage goes to nobody and you will getting the half damage in game the mage will be like a super man with half damage... here is the fix: if (ptarget.isInsideZone(L2Character.ZONE_PEACE)) { L2PetInstance pet = (L2PetInstance)getPet(); if (!activeChar.isInFunEvent() || !ptarget.isInFunEvent() || !(pet !=null)) { activeChar.sendMessage("[Guard]: You cant attack player in Peace Zone"); activeChar.sendPacket(new ActionFailed()); return; } my oppinion: you can add it in l2pcinstance doAttack its better... if i am wrong correct me... :P Quote Link to comment Share on other sites More sharing options...
DnR Posted November 18, 2011 Share Posted November 18, 2011 If you 're open to few suggestions,i can provide you with the most suitable fix. First of all,attack is caused by skill intention.There are several skills that force the character to attack when the casting is finished. I believe the problem is in L2Character/void onMagicFinalizer Just change this line: if (skill.getSkillType() == SkillType.PDAM || skill.getSkillType() == SkillType.BLOW || skill.getSkillType() == SkillType.DRAIN_SOUL || skill.getSkillType() == SkillType.SOW || skill.getSkillType() == SkillType.SPOIL) { - if ((getTarget() != null) && (getTarget() instanceof L2Character)) + if ((getTarget() != null) && (getTarget() instanceof L2Character) && targets[0] == getTarget()) getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, getTarget()); } Quote Link to comment Share on other sites More sharing options...
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.
Note: Your post will require moderator approval before it will be visible.