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

That script begins with net.sf.l2j.   i need ru.catssoftware. please can u will help me to meke it?

Lol addapt it to your sources
  • 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

    • We all know the CMS platforms that make us wonder every day why nothing truly new comes to the market. The answer seems simple: monopoly. And yes, to some extent that's true. But most people don't stop to think why they became monopolies in the first place.   It's largely a legacy trend that started back when PHP was supposed to "change the world." Well, here we are - and it didn't. PHP is increasingly becoming a technology many of us want to move away from rather than integrate into modern projects.   This is the 21st century. JavaScript powers the internet. With JavaScript, we can build the frontend, the backend, modules, run parallel processing with Workers, integrate seamlessly with cloud providers, and scale without friction. It has the largest open-source community in the world. The ecosystem is massive. What has been missing, however, is a truly powerful CMS written entirely in JavaScript.   The good news? I’ve been working on such a project for years, and I believe the time is coming to move into a beta testing phase. If anyone is interested in joining the testing phase and providing feedback, I would be happy to connect. I would also genuinely love to hear your opinion about a product like this.   Imagine a CMS with: A built-in builder Ready-to-use plugins A JavaScript-first architecture Designed primarily for online services   Because most CMS platforms today focus heavily on becoming eCommerce systems for selling physical products, and in doing so, they lose sight of a huge audience. There are countless people who want to build: Paid online services Digital or hand-crafted product platforms Gaming websites Coffee shop websites Subscription-based platforms And many other service-oriented projects What do you think about a CMS built specifically for the service economy rather than traditional eCommerce?
    • You keep talking a lot but you still haven't proven anything... why don't you show the community that this extender doesn't work? Why don't you show them all the bugs? hahaha Your silence and lack of evidence prove that you're a liar trying to make a quick buck selling what I publish for free.   Why do you want a domain? You say this extender crashes? Well, prove it, so everyone can see if you're right. Or if you simply want to convince people not to use this extender for free, why do you want to sell it?
    • Send me your server domain. As far as i know, you don’t have any money where are you going to get 1k from? 🙂 Even if they ban you, you will just come back with 4–5 accounts like always. You are still the same idiot. What was that server with the crash L2Galaxy or something like that?  
    • Adrenaline Premium and other private bots continue to function normally. XD
  • 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..