Jump to content

[Share] Spawn Item By Masone


Recommended Posts

 

 

package ru.catssoftware.gameserver.handler.itemhandler;

import org.apache.log4j.Logger;
import ru.catssoftware.gameserver.ThreadPoolManager;
import ru.catssoftware.gameserver.datatables.NpcTable;
import ru.catssoftware.gameserver.handler.IItemHandler;
import ru.catssoftware.gameserver.idfactory.IdFactory;
import ru.catssoftware.gameserver.model.L2ItemInstance;
import ru.catssoftware.gameserver.model.actor.instance.L2NpcInstance;
import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance;
import ru.catssoftware.gameserver.model.actor.instance.L2PlayableInstance;
import ru.catssoftware.gameserver.network.SystemMessageId;
import ru.catssoftware.gameserver.templates.chars.L2NpcTemplate;

/**
 * Created by IntelliJ IDEA.
 * User: masone
 * Date: 02.07.15
 * Time: 20:07
 * To change this template use File | Settings | File Templates.
 */
public class spawnitem implements IItemHandler
{
    protected static Logger _log = Logger.getLogger(spawnitem.class.getName());

    private static final int[] ITEM_IDS = { 6673 };
    public void useItem(L2PlayableInstance playable, L2ItemInstance item, boolean par){}

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


    public void useItem(L2PlayableInstance playable, L2ItemInstance item)
    {
        _log.info("use item" +item);
        L2PcInstance activeChar;
        activeChar = (L2PcInstance) playable;

        L2NpcTemplate template;
        template = NpcTable.getInstance().getTemplate(60000);

        if (activeChar.isInOlympiadMode())
        {
            activeChar.sendPacket(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT);
            return;
        }

        //TODO flood protector

        L2NpcInstance npc = new L2NpcInstance(IdFactory.getInstance().getNextId(), template);
        npc.setInstanceId(activeChar.getInstanceId());
        npc.setIsInvul(true);
        npc.setTitle(activeChar.getName());
        npc.setName("masone");
        npc.updateAbnormalEffect();
        npc.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());

        ThreadPoolManager.getInstance().scheduleGeneral(new deleteNPC(npc), 60000);

        //  activeChar.destroyItem("Summon", item.getObjectId(), 1, null, true);
    }

    public class deleteNPC implements Runnable
    {

        protected L2NpcInstance _npc;
        public void run()
        {

            _npc.deleteMe();
        }
        deleteNPC(L2NpcInstance npc)
        {
            _npc = npc;
        }
    }
} 

 

 

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Add Support ShortCutPanel https://jumpshare.com/s/VTm9x1wvHmPokrqomNun
    • Καλησπερα μαγκες θα ηθελα εναν Dev ( που να γνωριζει καλα την δουλεια ) να ξεκινησουμε εξολοκληρου ενα Interlude PVP σερβερ που εχω στο μυαλο μου! Παρακαλω πολυ στειλτε μου προσωπικο στο προφιλ μου εδω για περαιτερω πληροφοριες! Ευχαριστω!
    • Open github. Find sdark94 account. Enter sdark94/trinity repository. Search for the DB backup. It is still there. I would've posted it here, if there was a HIDE_FOR_USER(S) feature, but there isn't one. You can DM me on Discord and I'll slip you a STRUCTURE-only DB export.   Yall lazy to even search the web bro. 😄 See the old videos from 3 years ago -> YOUTUBE Regarding java version, it is also visible in the source:
    • Welcome to my store : https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 60.99 $ 2016 Discord Account : 10.50 $ 2017 Discord Account :4.99 $ 2018 Discord Account : 3.99 $ 2019 Discord Account : 2.99 $ 2020 Discord Account :1.99$ 2021 Discord Account :1.50$ 2022 Discord Account :0.99$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore11 Whatsapp ; +212614849119 Welcome to my store : https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 60.99 $ 2016 Discord Account : 10.50 $ 2017 Discord Account :4.99 $ 2018 Discord Account : 3.99 $ 2019 Discord Account : 2.99 $ 2020 Discord Account :1.99$ 2021 Discord Account :1.50$ 2022 Discord Account :0.99$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore11 Whatsapp ; +212614849119 Welcome to my store : https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 60.99 $ 2016 Discord Account : 10.50 $ 2017 Discord Account :4.99 $ 2018 Discord Account : 3.99 $ 2019 Discord Account : 2.99 $ 2020 Discord Account :1.99$ 2021 Discord Account :1.50$ 2022 Discord Account :0.99$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore11 Whatsapp ; +212614849119
    • hello all sorry about this question . but what game play is this ? High Five? Interlude? Clasic? Esennce and what kind of Java using this server 8jdk? or
  • Topics

×
×
  • Create New...