Ορίστε πέρνα αυτό και θα είσαι κομπλέ:
net.sf.l2j.gameserver.handler.itemhandlers βάλε αυτό εδώ:
package net.sf.l2j.gameserver.handler.itemhandlers;
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.handler.IItemHandler;
import net.sf.l2j.gameserver.model.L2Player;
import net.sf.l2j.gameserver.model.actor.instance.L2ItemInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;
/**
*
* @author Nicolas
*/
public class ClanRepItem implements IItemHandler
{
public void useItem(L2PlayableInstance playable, L2ItemInstance item, boolean forceUse)
{
if (!(playable instanceof L2Player))
{
return;
}
L2Player player = (L2Player)playable;
if (player.getClan().getLeader().getPlayerInstance() != player)
{
player.sendMessage("You're not the clan leader.You should give the item to your clan's leader.");
return;
}
else if (!(player.getClan().getLevel() >= 6))
{
player.sendMessage("Your clan should be more than 5 level to use this item!");
return;
}
if (player.getClan() == null)
{
player.sendMessage("How the hell it's possible to use that item without a clan?");
return;
}
player.getClan().setReputationScore(player.getClan().getReputationScore()+Config.CLAN_REP_SCORE, true);
player.destroyItem("Clan rep item", item, player, true);
player.sendMessage("You got + "+Config.CLAN_REP_SCORE+" in your clan reputation score.");
}
@Override
public int[] getItemIds() {
// TODO Auto-generated method stub
return null;
}
@Override
public void useItem(L2PlayableInstance playable, L2ItemInstance item) {
// TODO Auto-generated method stub
}
}
Μετά κάντο register
net.sf.l2j.gameserver.handler.ItemHandler
import net.sf.l2j.gameserver.handler.itemhandlers.ClanRepItem;
if(Config.ALLOW_CLAN_REP_ITEM)
{
registerItemHandler(new ClanRepItem());
}
τα configs sto net.sf.l2j ~>Config.java
public static boolean ALLOW_CLAN_REP_ITEM;
public static int CLAN_REP_SCORE;
/* Clan Rep Item Configs /**/
ALLOW_CLAN_REP_ITEM = Boolean.parseBoolean(L2JFortSettings.getProperty("AllowClanRepItem", "false"));
CLAN_REP_SCORE = Integer.parseInt(L2JFortSettings.getProperty("ClanRepScore", "300"));
Και τέλος τα κλασσικά config:
#-----------------------#
# Clan Reputation Item #
#-----------------------#
#With this item clan leaders can take + clan reputation score
#Allow clan reputation item?
#Default clan rep points: 300 (Set it by your own)
AllowClanRepItem = True
ClanReputationCoinReputation = 300
Κάντο βήμα βήμα και θα είσαι κομπλέ!