- Хроники
- The 2nd Throne: Gracia
- Исходники
- Присутствуют
- Сборка
- nextgen 7584
JavaScript:
package items;
import java.sql.SQLException;
import l2n.database.L2DatabaseFactory;
import l2n.database.utils.mysql;
import l2n.extensions.scripts.ScriptFile;
import l2n.game.cache.Msg;
import l2n.game.handler.holder.ItemHandler;
import l2n.game.handler.IItemHandler;
import l2n.game.model.actor.L2Playable;
import l2n.game.model.actor.L2Player;
import l2n.game.model.instances.L2ItemInstance;
public class PremiumItem implements IItemHandler, ScriptFile
{
private static int[] _itemIds = {9693};
private int i;
public void useItem(L2Playable playable, L2ItemInstance item)
{
if (!playable.isPlayer())
return;
L2Player activeChar = (L2Player) playable;
if(activeChar.getInventory().getCountOf(9693) < 1)
{
activeChar.sendPacket(Msg.INCORRECT_ITEM_COUNT);
return;
}
else
{
activeChar.getInventory().destroyItem(item, 1, false);
{
try
{
mysql.setEx(L2DatabaseFactory.getInstanceLogin(), "UPDATE `accounts` SET `l2money` = +1;
}
catch(SQLException e)
{
e.printStackTrace();
}
}
}
}
public final int[] getItemIds()
{
return _itemIds;
}
public void onLoad()
{
ItemHandler.getInstance().registerItemHandler(this);
}
public void onReload()
{}
public void onShutdown()
{}
}
Код:
----------
1. ERROR in C:\Users\Administrator\Desktop\server\game\.\data\scripts\items\PremiumItem.java (at line 43)
mysql.setEx(L2DatabaseFactory.getInstanceLogin(), "UPDATE `accounts` SET `l2money` = +1;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
String literal is not properly closed by a double-quote
----------
2. ERROR in C:\Users\Administrator\Desktop\server\game\.\data\scripts\items\PremiumItem.java (at line 62)
ItemHandler.getInstance().registerItemHandler(this);
^^^^^^^^^^^^^^^^^^^
The method registerItemHandler(PremiumItem) is undefined for the type ItemHandler
----------
[compiled 128961 lines in 5584 ms: 23094.7 lines/s]
2 problems (2 errors)[807 .class files generated]
org.eclipse.jdt.internal.compiler.tool.EclipseCompilerImpl$3$2@551be910
org.eclipse.jdt.internal.compiler.tool.EclipseCompilerImpl$3$2@1b624517