Jump to content
  • 0

item give acceslvl


TreVor

Question

6 answers to this question

Recommended Posts

  • 0
    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?

Link to comment
Share on other sites

  • 0
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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock