Jump to content

Recommended Posts

Posted (edited)

Hello, I'm trying to incorporate quest custom in l2jsunrise, but I can't do it. Copy the quest (Q00258_BringWolfPelts), rename it to (Q10506_BringWolfPelts1) ... create a new npc for the quest "32890" embed it in the Q1060_BringWolfPelts1.java

 

Original BringWolfPelts

 

Quote

/*
 * Copyright (C) 2004-2013 L2J DataPack
 * 
 * This file is part of L2J DataPack.
 * 
 * L2J DataPack is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * L2J DataPack is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package quests.Q00258_BringWolfPelts;

import java.util.HashMap;
import java.util.Map;

import l2r.gameserver.enums.QuestSound;
import l2r.gameserver.model.actor.L2Npc;
import l2r.gameserver.model.actor.instance.L2PcInstance;
import l2r.gameserver.model.quest.Quest;
import l2r.gameserver.model.quest.QuestState;
import l2r.gameserver.model.quest.State;

/**
 * Bring Wolf Pelts (258)
 * @author xban1x
 */
public final class Q00258_BringWolfPelts extends Quest
{
    // Npc
    private static final int LECTOR = 30001;
    // Item
    private static final int WOLF_PELT = 702;
    // Monsters
    private static final int[] MONSTERS = new int[]
    {
        20120, // Wolf
        20442, // Elder Wolf
    };
    // Rewards
    private static final Map<Integer, Integer> REWARDS = new HashMap<>();
    
    static
    {
        REWARDS.put(390, 1); // Cotton Shirt
        REWARDS.put(29, 6); // Leather Pants
        REWARDS.put(22, 9); // Leather Shirt
        REWARDS.put(1119, 13); // Short Leather Gloves
        REWARDS.put(426, 16); // Tunic
    }
    
    // Misc
    private static final int MIN_LVL = 3;
    private static final int WOLF_PELT_COUNT = 40;
    
    public Q00258_BringWolfPelts()
    {
        super(258, Q00258_BringWolfPelts.class.getSimpleName(), "Bring Wolf Pelts");
        addStartNpc(LECTOR);
        addTalkId(LECTOR);
        addKillId(MONSTERS);
        registerQuestItems(WOLF_PELT);
    }
    
    @Override
    public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
    {
        final QuestState st = player.getQuestState(getName());
        if ((st != null) && event.equalsIgnoreCase("30001-03.html"))
        {
            st.startQuest();
            return event;
        }
        return null;
    }
    
    @Override
    public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
    {
        final QuestState st = killer.getQuestState(getName());
        if ((st != null) && st.isCond(1))
        {
            st.giveItems(WOLF_PELT, 1);
            if (st.getQuestItemsCount(WOLF_PELT) >= WOLF_PELT_COUNT)
            {
                st.setCond(2, true);
            }
            else
            {
                st.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
            }
        }
        return super.onKill(npc, killer, isSummon);
    }
    
    @Override
    public String onTalk(L2Npc npc, L2PcInstance player)
    {
        final QuestState st = getQuestState(player, true);
        String htmltext = getNoQuestMsg(player);
        if (st == null)
        {
            return htmltext;
        }
        
        switch (st.getState())
        {
            case State.CREATED:
            {
                htmltext = (player.getLevel() >= MIN_LVL) ? "30001-02.htm" : "30001-01.html";
                break;
            }
            case State.STARTED:
            {
                switch (st.getCond())
                {
                    case 1:
                    {
                        htmltext = "30001-04.html";
                        break;
                    }
                    case 2:
                    {
                        if (st.getQuestItemsCount(WOLF_PELT) >= WOLF_PELT_COUNT)
                        {
                            final int chance = getRandom(16);
                            for (Map.Entry<Integer, Integer> reward : REWARDS.entrySet())
                            {
                                if (chance < reward.getValue())
                                {
                                    st.giveItems(reward.getKey(), 1);
                                    break;
                                }
                            }
                            st.exitQuest(true, true);
                            htmltext = "30001-05.html";
                            break;
                        }
                    }
                }
                break;
            }
        }
        return htmltext;
    }
}
 

 

Edited Quest

 

Quote

/*
 * Copyright (C) 2004-2013 L2J DataPack
 * 
 * This file is part of L2J DataPack.
 * 
 * L2J DataPack is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * L2J DataPack is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package quests.Q10506_BringWolfPelts1;

import java.util.HashMap;
import java.util.Map;

import l2r.gameserver.enums.QuestSound;
import l2r.gameserver.model.actor.L2Npc;
import l2r.gameserver.model.actor.instance.L2PcInstance;
import l2r.gameserver.model.quest.Quest;
import l2r.gameserver.model.quest.QuestState;
import l2r.gameserver.model.quest.State;

/**
 * Bring Wolf Pelts (258)
 * @author xban1x
 */
public final class Q10506_BringWolfPelts1 extends Quest
{
    // Npc
    private static final int LECTOR = 32890;
    // Item
    private static final int WOLF_PELT = 702;
    // Monsters
    private static final int[] MONSTERS = new int[]
    {
        20120, // Wolf
        20442, // Elder Wolf
    };
    // Rewards
    private static final Map<Integer, Integer> REWARDS = new HashMap<>();
    
    static
    {
        REWARDS.put(390, 1); // Cotton Shirt
        REWARDS.put(29, 6); // Leather Pants
        REWARDS.put(22, 9); // Leather Shirt
        REWARDS.put(1119, 13); // Short Leather Gloves
        REWARDS.put(426, 16); // Tunic
    }
    
    // Misc
    private static final int MIN_LVL = 3;
    private static final int WOLF_PELT_COUNT = 40;
    
    public Q10506_BringWolfPelts1()
    {
        super(10506, Q10506_BringWolfPelts1.class.getSimpleName(), "Bring Wolf Pelts");
        addStartNpc(LECTOR);
        addTalkId(LECTOR);
        addKillId(MONSTERS);
        registerQuestItems(WOLF_PELT);
    }
    
    @Override
    public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
    {
        final QuestState st = player.getQuestState(getName());
        if ((st != null) && event.equalsIgnoreCase("32890-03.html"))
        {
            st.startQuest();
            return event;
        }
        return null;
    }
    
    @Override
    public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
    {
        final QuestState st = killer.getQuestState(getName());
        if ((st != null) && st.isCond(1))
        {
            st.giveItems(WOLF_PELT, 1);
            if (st.getQuestItemsCount(WOLF_PELT) >= WOLF_PELT_COUNT)
            {
                st.setCond(2, true);
            }
            else
            {
                st.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
            }
        }
        return super.onKill(npc, killer, isSummon);
    }
    
    @Override
    public String onTalk(L2Npc npc, L2PcInstance player)
    {
        final QuestState st = getQuestState(player, true);
        String htmltext = getNoQuestMsg(player);
        if (st == null)
        {
            return htmltext;
        }
        
        switch (st.getState())
        {
            case State.CREATED:
            {
                htmltext = (player.getLevel() >= MIN_LVL) ? "32890-02.htm" : "32890-01.html";
                break;
            }
            case State.STARTED:
            {
                switch (st.getCond())
                {
                    case 1:
                    {
                        htmltext = "32890-04.html";
                        break;
                    }
                    case 2:
                    {
                        if (st.getQuestItemsCount(WOLF_PELT) >= WOLF_PELT_COUNT)
                        {
                            final int chance = getRandom(16);
                            for (Map.Entry<Integer, Integer> reward : REWARDS.entrySet())
                            {
                                if (chance < reward.getValue())
                                {
                                    st.giveItems(reward.getKey(), 1);
                                    break;
                                }
                            }
                            st.exitQuest(true, true);
                            htmltext = "32890-05.html";
                            break;
                        }
                    }
                }
                break;
            }
        }
        return htmltext;
    }
}
 

 

QUEST NPC BYPASS

 

Quote

<html><body>Trader Lector:<br>
I may be a merchant now, but I used to be a <font color="LEVEL">Leather Cutter.</font> I used to work for Duke Van Dyke in my early days. During the Elmore War, I made hundreds of leather armors for the Duke's soldiers in ten days. Even after retiring, I still practice making leather armor from time to time to keep my skills sharp.<br>
A few days ago, Consul Sir Windawood came to see me himself and asked me to make fifty leather armors for the newly established militia. I can make that many on my own, but I don't have enough materials. I need quite a few more <font color="LEVEL">wolf pelts.</font> Can I ask you to find them for me?<br>
<a action="bypass -h Quest Q10506_BringWolfPelts1 32890-03.html">Say that you'll help.</a>
</body></html>

 

And when starting the server I have an error.

 

[22:43:02] WARN: Failed loading: (C:\Server\game\data\scripts\quest\Q10506_BringWolfPelts1\Q10506_BringWolfPelts1.java) @ scripts.ini:13 - Reason: doesnt exists or is not a file.
 
What is missing ?

 

I Copy this Post  in this forum....

 

https://maxcheaters.com/topic/245452-how-can-i-make-a-custom-quest-hf/

https://maxcheaters.com/topic/234528-custom-quest/

 

 

Edited by amarhat
Posted

You need to add the script path in your script loading list. (forgot the name since I did not touch l2 for more that 2 years xd) Its usually in the same folder where your quest folders are.

Edit: "questmasterhandler.java"

Posted
On 2/12/2023 at 7:55 AM, Finn said:

You need to add the script path in your script loading list. (forgot the name since I did not touch l2 for more that 2 years xd) Its usually in the same folder where your quest folders are.

Edit: "questmasterhandler.java"

 

Yes! i d it ! but i have this error !

 

[22:43:02] WARN: Failed loading: (C:\Server\game\data\scripts\quest\Q10506_BringWolfPelts1\Q10506_BringWolfPelts1.java) @ scripts.ini:13 - Reason: doesnt exists or is not a file.

 

"questmasterhandler.java" i not in my package ! My file name is  SCRIPT.INI in  game\data\

 

Quote

# This file contains a list of scripts that should be loaded by the GameServer
# The path is relative to the scripts folder, for example scripts/event.py would
# require the following entry:
# event.py
#
# Note: You can also load an script during server runtime using the Admin Panel

# Global Loader
handlers/loader/GlobalLoader.java

conquerablehalls/flagwar/BanditStronghold/BanditStronghold.java
conquerablehalls/flagwar/WildBeastReserve/WildBeastReserve.java

quest/Q10506_BringWolfPelts1/Q10506_BringWolfPelts1.java

 

If Put the rute of quest  in this file i have the error in console ! I do not know what to do.....

 

 

 

Posted (edited)

did u set the class for it? same file just scroll down. also activate custom quests in your setting file. dont know how sunrise handles it. might be different.

Edited by Finn
Posted
3 hours ago, Finn said:

did u set the class for it? same file just scroll down. also activate custom quests in your setting file. dont know how sunrise handles it. might be different.

Thx !  Its Works !  I had not registered all the files in the handlers loaders !!!!!

 

Thx So much ! ! 

 

  • Vision locked this topic
Guest
This topic is now closed to further replies.


  • Posts

    • Nothing about high five is hardcore even at x1, such easy Chronicle. 
    • This is actually very interesting, i've seen similar concepts applied to different games (even single-player games such as skyrim with PrismaUI Prisma UI - Next-Gen Web UI Framework at Skyrim Special Edition Nexus - Mods and Community ) if it works seamlessly with the client then it would be insane. I believe everyone is tired of getting cancer with xdat/flash/.uc edits
    • Dragic is a trusted guy—buy with confidence. The feature list looks incredibly solid, and you've clearly put a ton of work into this pack. Good luck with the sale, mate!
    • Im Selling my Interlude server L2wish only The Data and Core of L2wish based on lucera2 files with source code reconstructed which i did a long time ago. Im not selling the servername copyrights logos launcher etc only server data and source code, including Essence Interface reworked with interface source also.      EXP/SP: x75  Adena: x20  Drop: x20  Spoil: x20  Seal Stones: x5  Fangs of Stakato: x5  Raid Boss EXP/SP: x75  Raid Boss Drop: x1  Epic Boss Drop: x1  Manor: x5  Safe Enchant: +3  Max Enchant: Unlimited   Normal Scroll S/A Grade: 50%   Blessed Scroll S/A Grade: 55%    Normal Scroll B/C/D Grade: 50%    Blessed Scroll B/C/D Grade 55%  Max clans in ally (2)  3rd Class Cost (700 Halisha's Mark from Shrine of Loyalty)  NPC Buffer with 3h buff duration  GM Shop until B-Grade  Mana Potions  (1000 Power Delay 10 Seconds)  Auto-learn skills   Buff Slots (22+4 extra with Divine Inspiration)  Autopickup  Auction House in NPC at all towns  Offline Stores  Max Clients per PC (2)  Retail Geodata and Pathnodes  Reworked movement  Shift + Click Droplist on Monsters  Alt + Click Remove Buffs  Global Shout & Trade Chat  Special akamanah and zariche transformation  Seven Sings (Open)  Olympiad Weekly Circle  Olympiad Non-class  (5 min participants to begin)  Olympiad Class based (5 min participants to begin)  Tyrannosaurus drop Top LS chance 20% 5 Minutes Respawn  Flames of Invincibility cast 5 sec / duration 30 sec  Premium Account System  Auto Farm system using 10th Skill Bar.  IMPROVED RING OF CORE +1 STR +1 INT • INCREASE M. ATK. AND P. ATK.  IMPROVED EARRING OF ORFEN +1 WIT • INCREASE CASTING SPEED.  Subclass Quest           Part I: Kill Cabrio (Aden-Seal of Shilen) Talk to the box and bring the item to Subclass Quest           NPC.           Part II: Go for Hallate TOI 3, Kernon TOI 8 and Golkonda TOI 11, (Regardless of the order)           kill them, talk to the boxes and bring the sticks to Subclass Quest NPC to redeem your           subclass item.    Vote Reward System with Vote Coins and 12 Hours Vote Rune.  Vote Rune increases your P. Def and M. Def by 6%, P. Attack and M. Attack by 4%, Movement Speed by 4%.  Duration 12 Hours   Quest Name Drop  Relics of the Old Empire x4-8  Gather The Flames x3  Alliance with the Ketra Orcs x5  Alliance with the Varka Silenos x5  War with Ketra Orcs x10  War with the Varka Silenos x10  The Finest Food x5  A Powerful Primeval Creature x5  Rise and Fall of the Elroki Tribe x8  Legacy of Insolence x6-50%  Exploration of Giants Cave Part 1 x3  Exploration of Giants Cave Part 2 x3   Seekers of the Holy Grail x10   Guardians of the Holy Grail x10  Hunt of the Golden Ram Mercenary Force x10  The Zero Hour x5  Delicious Top Choice Meat x1  Heart in Search of Power x1  Whisper of Dreams 1/2 x3  In Search Of Fragments Of The Dimension x1 Raid Boss Name LvL Respawn  Frintezza    80 Respawn 48 Hours + - 30 Min  • Frintezza’s Necklace drop chance is 100%  Valakas    80 Respawn 240 Hours + - 30 Min  Sleep time 30 Minutes • Necklace of Valakas drop chance is 100%  Antharas    80 Respawn 192 Hours + - 30 Min  Sleep time 30 Minutes • Earring of Antharas drop chance is 100%  Baium    80 Respawn 120 Hours + - 30 Min  Sleep time 30 Minutes • Ring of Baium drop chance is 100%  Zaken    80 Respawn 48 Hours + - 30 Min  Door Open 22:00 in the night • Zaken’s Earring drop chance is 100%  Orfen    80 Every 24 Hours -+ 20 Minutes  • Earring of Orfen drop chance is 30%  Core    80 Every 26 Hours -+ 20 Minutes   • Ring of Core drop chance is 30%  Ant Queen    80 Every 28 Hours -+ 20 Minutes • Ring of Queen Ant drop chance is 30%  Splendor Barakiel    80 Spawn 6 Hours + - 15 Min Random  Subclass - Cabrio    80 Spawn 6 Hours + - 15 Min Random  Subclass - Hallate    80 Spawn 6 Hours + - 15 Min Random  Subclass - Kernon    80 Spawn 6 Hours + - 15 Min Random  Subclass - Golkonda    80 Spawn 6 Hours + - 15 Min Random   Ketra's Hero Hekaton    80 Spawn 22 Hours + - 15 Min Random   Ketra's Commander Tayr    80 Spawn 22 Hours + - 15 Min Random  Varka's Hero Shadith    80 Spawn 22 Hours + - 15 Min Random   Varka's Commander    80 Spawn 22 Hours + - 15 Min Random   Command Description .getreward Get vote reward from Hopzone. .rune Your Rune Informations. .menu Personal Menu Options. .raid Shows Normal Raids & Respawn. .epic Shows Epic Raids & Respawn. .rewards Get your Achievments. .offline Offline Shops. .relog Clearing your cache fps.     Source code reconstructed from my Lucera2 project.             Akamanah/Zariche transformation (This video was with an old interface version).             Contact me for more informations, trollers will be not answered and don't expect a low price or a price drop. This project was running with 500+ real players.
  • 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..