TreVor Posted August 26, 2017 Posted August 26, 2017 How to make a item that will give acces lvl 10 to save the database? i based on l2jfrozen?
0 SweeTs Posted August 26, 2017 Posted August 26, 2017 Check admin command, basically copy/paste code.
0 TreVor Posted August 27, 2017 Author Posted August 27, 2017 private void showMainPage(final L2PcInstance activeChar) { AdminHelpPage.showHelpPage(activeChar, "charmanage.htm"); } private void setAccountAccessLevel(final String player, final L2PcInstance activeChar, final int banLevel) { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(false); String stmt = "SELECT account_name FROM characters WHERE char_name = ?"; PreparedStatement statement = con.prepareStatement(stmt); statement.setString(1, player); ResultSet result = statement.executeQuery(); if (result.next()) { String acc_name = result.getString(1); SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2); if (acc_name.length() > 0) { LoginServerThread.getInstance().sendAccessLevel(acc_name, banLevel); sm.addString("Account Access Level for " + player + " set to " + banLevel + "."); } else { sm.addString("Couldn't find player: " + player + "."); } activeChar.sendPacket(sm); sm = null; acc_name = null; } else This is ? and my question how to make to item?
0 TreVor Posted August 27, 2017 Author Posted August 27, 2017 package com.l2jfrozen.gameserver.handler.itemhandlers; import com.l2jfrozen.gameserver.handler.IItemHandler; import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance; import com.l2jfrozen.gameserver.network.serverpackets.SocialAction; public class PremiumBuff implements IItemHandler { public PremiumBuff() { //null } @Override public void useItem(L2PlayableInstance playable, L2ItemInstance item) { if(!(playable instanceof L2PcInstance)) return; L2PcInstance activeChar = (L2PcInstance) playable; if(activeChar.isInOlympiadMode()) { activeChar.sendMessage("This item can not be used on olympiad"); } if(activeChar.isDonator()) { activeChar.sendMessage("You are already the donator member"); } else { activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 16)); activeChar.setAccessLevel(10);; activeChar.sendMessage("Now you can use a premium buffer!"); activeChar.broadcastUserInfo(); playable.destroyItem("Consume", item.getObjectId(), 1, null, false); } activeChar = null; } @Override public int[] getItemIds() { return ITEM_IDS; } private static final int ITEM_IDS[] = { 9996 }; } i make this and dont work no consume and dont give access
0 TreVor Posted August 27, 2017 Author Posted August 27, 2017 Items consume etc and dont give access lvl to character i checka this.
0 'Baggos' Posted August 27, 2017 Posted August 27, 2017 Try this.. Works for me (for aCis). https://pastebin.com/wMTF6NF4
Question
TreVor
How to make a item that will give acces lvl 10 to save the database? i based on l2jfrozen?
6 answers to this question
Recommended Posts