Jump to content
  • 0

Script: Teleport With Item


Question

Posted

Hi friends, please help me to make this script correctly. I want to make when players are teleporting some zone then script will check and take quest item. I was copied this script from quest "618_IntoTheFlame" and changed item and NPC IDs but dont works in the game and GS console haven't any error. Thx for help.

 

Chronicle: Interlude

Lucera Pack

 

package ru.catssoftware.gameserver.model.quest.pack.ai;
 
import ru.catssoftware.gameserver.model.actor.instance.L2NpcInstance;
import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance;
import ru.catssoftware.gameserver.model.quest.Quest;
import ru.catssoftware.gameserver.model.quest.QuestState;
 
public class Polyne extends Quest
{
 
    public Polyne()
    {
        super(-1, QUEST, "ai");
        addStartNpc(50006);
        addStartNpc(50023);
        addTalkId(50006);
        addTalkId(50023);
        addKillId(0x186b6);
    }
 
    public String onTalk(L2NpcInstance l2npcinstance, L2PcInstance l2pcinstance)
    {
        QuestState queststate = l2pcinstance.getQuestState("Polyne");
        if(queststate == null)
            return "<html><body>\u0412\u044B \u043B\u0438\u0431\u043E \u043D\u0435 \u043D\u0430 \u043F\u043E\u0438\u0441\u043A\u0438, \u0447\u0442\u043E \u0432\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0432 \u044D\u0442\u043E\u0442 NPC, \u0438\u043B\u0438 \u0432\u044B \u043D\u0435 \u043E\u0442\u0432\u0435\u0447\u0430\u044E\u0442 \u044D\u0442\u043E\u0442 NPC \u0432 \u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0435 \u0442\u0440\u0435\u0431\u043E\u0432\u0430\u043D\u0438\u044F.</body></html>";
        int i = l2npcinstance.getNpcId();
        if(i == 50023)
            if(queststate.getInt("ok") != 0)
            {
                queststate.exitQuest(true);
                return "<html><body>Roien:<br>\u0412\u0430\u043B\u0430\u043A\u0430\u0441 \u0443\u0436\u0435 \u043F\u0440\u043E\u0441\u043D\u0443\u043B\u0441\u044F!<br>\u0412\u044B \u043D\u0435 \u043C\u043E\u0436\u0435\u0442\u0435 \u0432\u043E\u0439\u0442\u0438 \u0432 \u041B\u043E\u0433\u043E\u0432\u043E \u0412\u0430\u043B\u0430\u043A\u0430\u0441\u0430.</body></html>";
            } else
            {
                queststate.exitQuest(true);
                return "<html><body>Roien:<br>\u0423\u0441\u043B\u043E\u0432\u0438\u044F \u043D\u0435 \u041F\u0440\u0430\u0432\u043E \u0437\u0430\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F, \u0447\u0442\u043E\u0431\u044B \u041B\u043E\u0433\u043E\u0432\u043E \u0412\u0430\u043B\u0430\u043A\u0430\u0441\u0430.</body></html>";
            }
        if(i == 50006)
        {
            if(queststate.getQuestItemsCount(9564) > 0)
            {
                queststate.takeItems(9564, 1);
                l2pcinstance.teleToLocation(0x236e1, 0x23160, -12815);
                queststate.set("ok", "1");
            } else
            {
                queststate.exitQuest(true);
                return "<html><body>Asgard:<br>\u0423 \u0432\u0430\u0441 \u043D\u0435\u0442 \u041A\u043D\u0438\u0433\u0430 \u041F\u043E\u043B\u0438\u043D\u0430. \u041F\u043E\u0439\u0442\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043E\u0434\u0438\u043D, \u0430 \u0437\u0430\u0442\u0435\u043C \u0432\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043A\u043E \u043C\u043D\u0435.</body></html>";
            }
        } else
        {
            queststate.exitQuest(true);
            return "<html><body>Asgard:<br>\u0412\u0430\u043B\u0430\u043A\u0430\u0441 \u0443\u0436\u0435 \u043F\u0440\u043E\u0441\u043D\u0443\u043B\u0441\u044F!<br>\u0412\u044B \u043D\u0435 \u043C\u043E\u0436\u0435\u0442\u0435 \u0432\u043E\u0439\u0442\u0438 \u0432 \u041B\u043E\u0433\u043E\u0432\u043E \u0412\u0430\u043B\u0430\u043A\u0430\u0441\u0430.</body></html>";
        }
        return null;
    }
 
    public static String QUEST = "Polyne";
 
}

11 answers to this question

Recommended Posts

  • 0
Posted

I had create something like this 5 years ago.. I do not know if you want that script but download the bellow and check it out.

 

PS: No need 5 different teleports quest like I did. I hope you will understand the way. 

Also, that script are old and totally different lines with your lucera project. It's just a idea how to do that.

  • 0
Posted

I had create something like this 5 years ago.. I do not know if you want that script but download the bellow and check it out.

 

PS: No need 5 different teleports quest like I did. I hope you will understand the way. 

Also, that script are old and totally different lines with your lucera project. It's just a idea how to do that.

Thanks for reply, i'll check your script!

  • 0
Posted

You have to call "Polyne 50006" on your bypass to get the teleport check.

 

It probably doesn't work because you return directly when quest isn't created on player profile. You have to create quest state, store it, do your action and then delete the quest state.

  • 0
Posted

You have to call "Polyne 50006" on your bypass to get the teleport check.

 

It probably doesn't work because you return directly when quest isn't created on player profile. You have to create quest state, store it, do your action and then delete the quest state.

<a action="bypass -h npc_%objectId%_Quest Polyne">"Teleport."</a><br> but i added this text into 50006.htm other NPC as valakas quest and i was created new Polyne quest. Only need script  :-\

  • 0
Posted

If you can't even change package path, they you should forget about everything you are doing. Take your time and learn. Otherwise pray to Santa for someone give you 100% ready code, which won't happen.

 

As you are not willing to learn and understand a simpliest thing then.. Stop whatever you doing, or pay someone.

Guest
This topic is now closed to further replies.


  • Posts

    • 👑 [FOR SALE] Lineage 2 Premium UCP – Modern Web Panel with Progression & Reward Systems. Looking for the ultimate edge to make your server boom and boost revenue? Introducing the L2 Premium UCP—the most comprehensive and modern User Control Panel on the market. Developed with a total focus on player experience (UX) and administrative automation. Say goodbye to outdated, buggy panels. Give your server the look and feel of an official game!  
    • Here I agree with you, because I get tired of clients like you and I don’t see any problems. Since you act in such a strange way, I’ll mirror it back to you, little brother.   Alice will even post a correspondence with you where you've been asking the same stupid questions (about prices or products) for three years and let everyone look and draw two personal conclusions about you (you're a little child)     If anyone wants to add you as a buyer to their group, let them take you hand and foot. I'll even help you pack you into an iron box.   Let's look at your last reply where you wish me luck in sales but then immediately run off to complain on the forum  yes, that's what people like you do and yes, I don't want to see people like you in my group or anywhere near it.   We're freelancing here, and yes, at first I check for loyalty and patience with clients, but when year after year they only ask me about prices - you know, if someone needs this, it's definitely not me.   Go with God, little brother, and find happiness in your life and stop making kindergarten on forums.😂   I don't need clients like that for free - who can't even look at payment methods and immediately become aggressive - and you always use free goods, just like your favorites from the Brazilian forum, you apparently have a fever about this - I have nothing against it - we had a nice conversation, everything is fine.            
    • Looking to release interface source from newer clients, if you got a client message me on discord: ilikebeer.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..