Would it be possible to add some kind of currency to turn the character into AIO Buffer?
thank you all !
thank you all !
natan55 wrote:Would it be possible to add some kind of currency to turn the character into AIO Buffer?
thank you all !
natan55 wrote:Would it be possible to add some kind of currency to turn the character into AIO Buffer?
thank you all !
// www.l2destruction.com
// 75x
// www.l2destruction.com
// Source File Name: NobleCustomItem.java
package net.sf.l2j.gameserver.handler.itemhandlers;
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.datatables.CharNameTable;
import net.sf.l2j.gameserver.handler.IItemHandler;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;
import net.sf.l2j.gameserver.model.base.Experience;
import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
public class AioCustomItem
implements IItemHandler
{
public AioCustomItem()
{
}
@Override
public void useItem(L2PlayableInstance playable, L2ItemInstance item)
{
if (Config.AIO_BUFFER_NAME_PREFIX != null)
{
playable.setName(Config.AIO_BUFFER_NAME_PREFIX + playable.getName());
}
// Restore
playable.setCurrentCp(playable.getMaxCp());
playable.setCurrentHp(playable.getMaxHp());
playable.setCurrentMp(playable.getMaxMp());
if(Config.AIO_CUSTOM_ITEMS)
{
if(!(playable instanceof L2PcInstance))
return;
L2PcInstance activeChar = (L2PcInstance)playable;
if(activeChar.isAIOBuffer())
{
activeChar.sendMessage("You Are Already A *AIO*!.");
} else
{
activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 16));
activeChar.setIsAIOBuffer(true);
// Set level to maximum if needed
long pXp = activeChar.getExp();
long tXp = Experience.LEVEL[Config.MAX_PLAYER_LEVEL];
if (pXp < tXp)
{
activeChar.addExpAndSp(tXp - pXp, 0);
}
activeChar.sendMessage("You Are Now a *AIO*,You Are Granted With *AIO* Status , And *AIO* Skills.");
activeChar.broadcastUserInfo();
playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
}
}
}
@Override
public int[] getItemIds()
{
return ITEM_IDS;
}
private static final int ITEM_IDS[] = { Config.AIO_COIN_ID1};
}
public void load()
{
+registerItemHandler(new NobleCustomItem());
+/** Properties ini for L2Destruction Noblesse Item By KallonE */
+public static final String AIOITEM = "./config/CustomMods/AioItem.ini";
+
+// Aio item
+Properties AioItem = new Properties();
+try (InputStream is = new FileInputStream(new File(AIOITEM)))
+{
+ AioItem.load(is);
+}
+catch (Exception e)
+{
+ e.printStackTrace();
+ throw new Error("Failed to Load " + AIOITEM + " File.");
+}
+
+AIO_CUSTOM_ITEMS = Boolean.parseBoolean(AioItem.getProperty("EnableAioCustomItem", "true"));
+AIO_COIN_ID1 = Integer.parseInt(AioItem.getProperty("AioCoin", "7840"));
+/** *AIO* Item L2Destruction KallonE */
+public static boolean AIO_CUSTOM_ITEMS;
+public static int AIO_COIN_ID1;
SCRASH0 likes this post
|
|