ThelwHelpRePaidia Posted March 7, 2018 Posted March 7, 2018 (edited) package net.sf.l2j.gameserver.handler.itemhandlers; Pvpitem.java package net.sf.l2j.gameserver.handler.itemhandlers; import net.sf.l2j.gameserver.handler.IItemHandler; import net.sf.l2j.gameserver.model.actor.Playable; import net.sf.l2j.gameserver.model.actor.instance.Player; import net.sf.l2j.gameserver.model.item.instance.ItemInstance; import net.sf.l2j.gameserver.model.olympiad.OlympiadManager; import net.sf.l2j.gameserver.network.SystemMessageId; public class Pvpitem implements IItemHandler { @Override public void useItem(Playable playable, ItemInstance item, boolean forceUse) { if (!(playable instanceof Player)) return; Player player = (Player) playable; if (player.isInCombat()) { player.sendMessage("You can't use this item because you are in combat"); return; } if (player.getKarma() > 0) { player.sendMessage("You can't use this item if you have karma."); return; } if (player.isCursedWeaponEquipped()) { player.sendMessage("You can't use this item with a cursed weapon."); return; } if (player.isDead()) { player.sendMessage("You can't use this item while you are dead."); return; } if (player.getActiveTradeList() != null || player.getActiveEnchantItem() != null) { player.sendMessage("Cannot use while trading/enchanting"); return; } else if (player.isInOlympiadMode() || OlympiadManager.getInstance().isRegisteredInComp(player)) { player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT); return; } final int pvps = player.getPvpKills() + 1000; player.setPvpKills(pvps); player.broadcastUserInfo(); player.sendMessage("Your PVP count is now " + pvps); playable.destroyItem("Consume", item.getObjectId(), 1, null, false); } } package net.sf.l2j.gameserver.handler; ItemHandler.java registerItemHandler(new ClanItem()); registerItemHandler(new ExpAndSpItem()); registerItemHandler(new CleanKarma()); + registerItemHandler(new Pvpitem()); } public void registerItemHandler(IItemHandler handler) { _datatable.put(handler.getClass().getSimpleName().intern().hashCode(), handler); } Edited March 7, 2018 by melron Cleaned.
melron Posted March 7, 2018 Posted March 7, 2018 @ThelwHelpRePaidia Are you the creator of this code?
ThelwHelpRePaidia Posted March 7, 2018 Author Posted March 7, 2018 1 minute ago, melron said: @ThelwHelpRePaidia Are you the creator of this code? No i addapted it from other client.
Kara Posted March 7, 2018 Posted March 7, 2018 10 minutes ago, ThelwHelpRePaidia said: ? What happened after i saw your code:
Kara Posted March 7, 2018 Posted March 7, 2018 1 minute ago, .Elfocrash said: Jesus christ clean this mess up. Create a validator and cleanup your ifelseifelsifelse haduken Ναι αυτο σε πειραξε εσενα τα bracket που ειναι στο χυμα δεν σε πηραξαν.
ThelwHelpRePaidia Posted March 7, 2018 Author Posted March 7, 2018 2 minutes ago, Evie Frye said: What happened after i saw your code:
SweeTs Posted March 7, 2018 Posted March 7, 2018 3 hours ago, melron said: Cleaned... Come on.. Previous version was better, yet I have no idea what it exactly was... Some crazy math to calculate the addition(?) :D
Kara Posted March 7, 2018 Posted March 7, 2018 4 hours ago, melron said: Cleaned... Pff nab now you made it worst. I called Steven Hawking to check it out and you cleaned it...
'Hater Posted March 8, 2018 Posted March 8, 2018 Adapting shitcoded codes from pride pack to acis from you is like the child of this couple :
'Baggos' Posted March 8, 2018 Posted March 8, 2018 mmm nice.. I really miss comments like this since 2010. You guys really help this guy to make it better with your comments. This section must be renamed to <Share and humiliate>. Maybe the bullying you get/got from your real life, makes you to act like this on forums. (proven by psychology) Anyway.. Maybe my words, just gave you reason to continue spam with quotes on this one. So, spend your time to quote this, may make you feel better, if you feel I attack your intelligence.. Goodnight! 1 1
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