Jump to content

[Share][Gr]Clan Reputation Item


Recommended Posts

den kserw an yparxei kai allo share den epsaksa na sas pw thn alh8eia, kseskoniza to pc mou kai to vrhka :P

package handlers.itemhandlers;

import com.l2jserver.gameserver.handler.IItemHandler;
import com.l2jserver.gameserver.model.actor.L2Playable;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.network.SystemMessageId;

/**
* @author -=DoctorNo=-
*/
public class ClanReputation implements IItemHandler
{
// --------------------------------------------------
// Interval configs.
// --------------------------------------------------
private static final int ITEM_IDS = 1515; // item id here.
private static final int Rep_Score = 10000; // reputation points here.

@Override
public boolean useItem(L2Playable playable, L2ItemInstance item, boolean forceUse){
	if (!playable.isPlayer())
	{
		playable.sendPacket(SystemMessageId.ITEM_NOT_FOR_PETS);
		return false;
	}

	L2PcInstance activeChar = playable.getActingPlayer();

	if ((activeChar.getClan() == null) || !activeChar.isClanLeader()){
		activeChar.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
		return false;
	}
	activeChar.getClan().addReputationScore(Rep_Score, true);
	activeChar.destroyItemByItemId("clan", ITEM_IDS, 1, activeChar, true);
	activeChar.sendMessage("You have successfully add "+Rep_Score+" reputation point(s) to your clan.");
	return true;
    }

public int getItemIds(){
	return ITEM_IDS;
}
}

logika den 8a exei provlhmata to eixa dokimasei se H5 prin poluuuu kairo :P

Link to comment
Share on other sites

It's already shared dude, but good job!

 

Keep sharing new ideas!

Oute kaseta na isoun esu

Valantis :den kserw an yparxei kai allo share den epsaksa na sas pw thn alh8eia, kseskoniza to pc mou kai to vrhka

 

 

Elfo :Come up with new ideas people

 

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.



×
×
  • Create New...