Jump to content

1000pvps from item l2jacis


Recommended Posts

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 by melron
Cleaned.
Link to comment
Share on other sites

1 minute ago, melron said:

@ThelwHelpRePaidia Are you the creator of this code?

No i addapted it from other client.

Link to comment
Share on other sites

1 minute ago, .Elfocrash said:

Jesus christ clean this mess up.

Create a validator and cleanup your ifelseifelsifelse haduken

Ναι αυτο σε πειραξε εσενα τα bracket που ειναι στο χυμα δεν σε πηραξαν.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

  • Like 1
  • Sad 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • the links are offiline, could you reupload them please, if you have other versions of h5 or c6 could you share them too, thanks!
    • Good afternoon everyone, we’ll get a couple of strong players in the CP, more details can be found here https://mw2.community/topic/211276-awr-team/  
    • so i bought this crap of the server few years back and i just found it laying around on my pc and i thought i should share it, if i remember correctly this crap has a lot of bugs that people abuse 🙂   https://drive.google.com/file/d/13QWg8pi4BPbGbTmlygZ078LjL6Fb0J2a/view?usp=sharing source   https://drive.google.com/file/d/13QWg8pi4BPbGbTmlygZ078LjL6Fb0J2a/view?usp=sharing system    
    • Error: Unable to access jarfile libs\Geodata_Converter_v01.jar
    • Since last massive leak as explained as 07/09 (notably all development branches), I don't accept anymore financial newcomers that easily. People will have to contribute 100 cookies worth of contributions (bug reports/fixes) as a first step to be accepted as Donator. Free user can join after sharing over 200 cookies out of contributions, compared to 100 cookies before. You can say thanks to RusAcis, and notably his worthless leader, UnleashedForce. The size of users will continue to shrink if more leaks occur, until true helpers only will be left. New prices are as following : Joining price: 200€ + 100 cookies, or 200 cookies This fee has to be paid if you are joining aCis project. Next month, and all other months, you will have to donate only basic monthly donation. Monthly price: 10€ / 10 cookies This fee has to be paid every month. I won't accept any new join fee before the 100 cookies contribution. Your money will be instantly sent back. Also, in the same shape of idea, actual supporters/donators have to be active to stay in sources. It doesn't have to be a particular amount, you just have to share from time to time *anything*. I don't accept anymore silent ppl. Only useful people will be kept.
  • Topics

×
×
  • Create New...