Resolved How to create your own quest based on another one

vithor

Vassal
Customer
[SOLVED] Follow these two tutorials

1. https://lucera2.com/threads/how-to-add-your-quests-or-subsystems-to-an-assembly.1406/ (In the same post there is another more detailed video of the process)
2. https://mmo-dev.info/threads/Создае...убрика-копировать-вставить.25191/#post-190973
(In addition to the steps in this step, you will need to add the quest in strings_en.properties and quest_rates.propeties. And if you want to disable the copied quest use the DisableQuestId property in server.properties)

Special thanks to our friend Deazer, Uncle Bob's son, for the comment below.

===================================================


Hey guys, I modified the onKill method of a quest so that all drops have a 100% chance of falling. But the method is not being executed. Does anyone have any tips as to why? Here's my code:

The onLoad message is shown in the terminal when booting, but the onKill message does not appear

Java:
package Simple;

import l2.gameserver.model.instances.NpcInstance;
import l2.gameserver.model.quest.QuestState;
import quests._639_GuardiansOfTheHolyGrail;

public class _639_GuardiansOfTheHolyGrail_Custom extends _639_GuardiansOfTheHolyGrail {
    @Override
    public void onLoad() {
        super.onLoad();
        System.out.println("LOADED MY CUSTOM QUEST _639_GuardiansOfTheHolyGrail_Custom");
    }

    @Override
    public String onKill(NpcInstance var1, QuestState var2) {
        System.out.println("EXECUTING METHOD onKill");
       
        int var3 = var1.getNpcId();
        if (var3 == 22123) {
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22122) {
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22128) {
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22130) {
            var2.rollAndGive(8056, 1, (double)17.0F);
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22135) {
            var2.rollAndGive(8056, 1, (double)30.0F);
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22132) {
            var2.rollAndGive(8056, 1, 3.4);
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22131) {
            var2.rollAndGive(8056, 1, 3.4);
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22129) {
            var2.rollAndGive(8056, 1, 3.4);
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22133) {
            var2.rollAndGive(8056, 1, 3.4);
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22134) {
            var2.rollAndGive(8056, 1, 3.4);
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 != 22127 && var3 != 22125) {
            if (var3 == 22126 || var3 == 22124) {
                var2.rollAndGive(8069, 1, (double)100.0F);
            }
        } else {
            var2.rollAndGive(8069, 1, (double)100.0F);
        }

        return null;
    }
}
 
Last edited:
Hey guys, I modified the onKill method of a quest so that all drops have a 100% chance of falling. But the method is not being executed. Does anyone have any tips as to why? Here's my code:

The onLoad message is shown in the terminal when booting, but the onKill message does not appear

Java:
package Simple;

import l2.gameserver.model.instances.NpcInstance;
import l2.gameserver.model.quest.QuestState;
import quests._639_GuardiansOfTheHolyGrail;

public class _639_GuardiansOfTheHolyGrail_Custom extends _639_GuardiansOfTheHolyGrail {
    @Override
    public void onLoad() {
        super.onLoad();
        System.out.println("LOADED MY CUSTOM QUEST _639_GuardiansOfTheHolyGrail_Custom");
    }

    @Override
    public String onKill(NpcInstance var1, QuestState var2) {
        System.out.println("EXECUTING METHOD onKill");
       
        int var3 = var1.getNpcId();
        if (var3 == 22123) {
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22122) {
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22128) {
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22130) {
            var2.rollAndGive(8056, 1, (double)17.0F);
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22135) {
            var2.rollAndGive(8056, 1, (double)30.0F);
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22132) {
            var2.rollAndGive(8056, 1, 3.4);
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22131) {
            var2.rollAndGive(8056, 1, 3.4);
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22129) {
            var2.rollAndGive(8056, 1, 3.4);
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22133) {
            var2.rollAndGive(8056, 1, 3.4);
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 == 22134) {
            var2.rollAndGive(8056, 1, 3.4);
            var2.rollAndGive(8069, 1, (double)100.0F);
        } else if (var3 != 22127 && var3 != 22125) {
            if (var3 == 22126 || var3 == 22124) {
                var2.rollAndGive(8069, 1, (double)100.0F);
            }
        } else {
            var2.rollAndGive(8069, 1, (double)100.0F);
        }

        return null;
    }
}
@Deazer Do you know what it could be?
 
@Deazer Do you know what it could be?
There's nothing to discuss, it's completely absurd when a person has a temperature of 39+
Your code can't work because it's not properly integrated into the game server. The onLoad message appears, showing the quest loads, but onKill isn't executed, meaning the game isn't calling it. The server might not recognize your custom quest class, or the NPC kill event isn't hooked to your onKill method.
I'm ashamed to even look at this. Use the forum search - there are already examples. You need to write the whole quest, not this piece of nonsense.
The only advice I can give you is to familiarize yourself with the basic principles of programming!
 
I created a new quest from scratch based on the one I wanted to modify, I don't know if it's the best solution, but it works. Tutorial on what to do above.
 
Back
Top