L2JMobius

C6 Help me Finish

dramaa · 3 · 445

Online dramaa

  • Elder
  • ****
    • Posts: 110
Code: [Select]
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */
package org.l2jmobius.gameserver.handler.itemhandlers;

/**
 *
 *
 * @author Strike
 *
 */

import org.l2jmobius.Config;
import org.l2jmobius.gameserver.handler.IItemHandler;
import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;

public class ClanRepsItem implements IItemHandler
{
private static final int ITEM_IDS[] =
{
Config.CR_ITEM_REPS_ITEM_ID
};

@Override
public void useItem(Playable playable, Item item)
{
if (!(playable instanceof Player))
{
return;
}

Player activeChar = (Player) playable;

if (!activeChar.isClanLeader())
{
activeChar.sendMessage("This can be used only by Clan Leaders!");
return;
}

else if (!(activeChar.getClan().getLevel() >= Config.CR_ITEM_MIN_CLAN_LVL))
{
activeChar.sendMessage("Requires LvL 5 Clan!");
return;
}
else
{
activeChar.getClan().setReputationScore(activeChar.getClan().getReputationScore() + Config.CR_ITEM_REPS_TO_BE_AWARDED);
activeChar.sendMessage("Your clan has earned " + Config.CR_ITEM_REPS_TO_BE_AWARDED + " rep points, Restart to see points!");
MagicSkillUse MSU = new MagicSkillUse(activeChar, activeChar, 2024, 1, 1, 0);
activeChar.broadcastPacket(MSU);
playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
}
}

@Override
public int[] getItemIds()
{
return ITEM_IDS;
}

}

no errors, and that's the config, also no errors, what am i doing wrong?  below is everything in config

Code: [Select]
public static void loadCRConfig()
{
final PropertiesParser crConfig = new PropertiesParser(CR_CONFIG_FILE);
USE_CR_ITEM = crConfig.getBoolean("EnableTheClanRepPointsItem", false);
CR_ITEM_MIN_CLAN_LVL = crConfig.getInt("ClanLevelNeededForCR", 5);
CR_ITEM_REPS_TO_BE_AWARDED = crConfig.getInt("HowManyClanRepsToGive", 500);
CR_ITEM_REPS_ITEM_ID = crConfig.getInt("CRItemID", 6567);
}

Code: [Select]
public static boolean USE_CR_ITEM;
public static int CR_ITEM_MIN_CLAN_LVL;
public static int CR_ITEM_REPS_TO_BE_AWARDED;
public static int CR_ITEM_REPS_ITEM_ID;
Code: [Select]
private static final String CR_CONFIG_FILE = "./config/custom/CR.ini";
any help?  :-\
   


Online G-hamsteR

  • Viscount
  • *****
    • Posts: 328
Stop posting dozens of messages for the same thing. Modify your previous post. And focus on one thing at a time. You are asking for basic staff, like how to make your Java changes appear on your server and whether you have to move the libs files each time. Get real, start from scratch. Noone can help you for each one of your problems.


Online dramaa

  • Elder
  • ****
    • Posts: 110
Stop posting dozens of messages for the same thing. Modify your previous post. And focus on one thing at a time. You are asking for basic staff, like how to make your Java changes appear on your server and whether you have to move the libs files each time. Get real, start from scratch. Noone can help you for each one of your problems.
ok