Jump to content
  • 0

Script: Teleport With Item


developer951

Question

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";
 
}
Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

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.

Link to comment
Share on other sites

  • 0

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!

Link to comment
Share on other sites

  • 0

Easy way to add a method and bypass in l2teleportedinstance.java use the bypass in html for the teleports you want and ready

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

this can be help too http://pastebin.com/ipJfBqNs

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

Link to comment
Share on other sites

  • 0

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  :-\

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...