Что дописать?

Здравствуйте. Нужно собственно что бы квестовый итем давался на всех кто бил РБ, или хотя бы на пати которое добило...
Может есть люди, которые знаю java

Code:
    public String onKill(NpcInstance paramNpcInstance, QuestState paramQuestState) {
        int i = paramNpcInstance.getNpcId();
        int j = paramQuestState.getCond();
        for (byte b = 0; b < DROPLIST_COND.length; b++) {
            if (j == DROPLIST_COND[b][0] && i == DROPLIST_COND[b][2] && (DROPLIST_COND[b][3] == 0 || paramQuestState.getQuestItemsCount(DROPLIST_COND[b][3]) > 0L))
                if (DROPLIST_COND[b][5] == 0) {
                    paramQuestState.rollAndGive(DROPLIST_COND[b][4], DROPLIST_COND[b][7], DROPLIST_COND[b][6]);
                } else if (paramQuestState.rollAndGive(DROPLIST_COND[b][4], DROPLIST_COND[b][7], DROPLIST_COND[b][7], DROPLIST_COND[b][5], DROPLIST_COND[b][6]) && DROPLIST_COND[b][1] != j && DROPLIST_COND[b][1] != 0) {
                    paramQuestState.setCond(Integer.valueOf(DROPLIST_COND[b][1]).intValue());
                    paramQuestState.setState(2);
                }
        }
        return null;
    }
 
Провобовал такой метод еще добавить... но не получается..
В яве вообще не понимаю, беру примеры из других квестов.
Code:
    public String onAttack(NpcInstance paramNpcInstance, QuestState paramQuestState) {
        if (paramNpcInstance.getNpcId() == 40042 && paramQuestState.getQuestItemsCount(9881) >= 1L && paramQuestState.getQuestItemsCount(9882) == 0L) {
            paramQuestState.giveItems(9882, 1L);
            paramQuestState.playSound("ItemSound.quest_itemget");
            Functions.npcSayCustomMessage(paramNpcInstance, "WHO_DARES_TO_AND_STEAL_MY_NOBLE_BLOOD", new Object[0]);
        }
        return null;
    }
 
Ответа тут не ождешься))
Пришлось с утра изучить основы ява.( оказалось все теже переменные и фукнции как в пайтон. ну похожи)
На основе уже имеющегося квеста, добавил в onTalk разговор с сундуком который появляется после убийства РБ. и выдачу квест итема. и соответственно передачу параметра paramQuestState.setCond
Далее на основе кабрио рб создал свой АИ этому рб для появления сундука.
Ну и уже правки в хтм, клиент.
Кому нужен будет квест, пишите.

Смысл такой. Берешь квест, убиваешь определенное колличество мобов, далее идешь снова к нпс за второй частью, летишь на рб ( пофиг кто убил, главное сундук который после него появляется) берешь у него квест итем и сдаешь у нпс квест.
Квест повторяющийся.

Это первый мой квест. Интересно было ппц. Всем спасибо за помощь(нет).
 
Last edited:
скачай obs, хули вы все мучаетесь, один бендикамом снимает, другой вообще телефоном
Есть у меня обс . Видео другу вообще снимал, в телеграм. А потом уже решил еще сюда залить.
 
ну видео на телефон снимать это вообще жестяк)
Тут еще качество порезало сильно. В оригинале все четко.
И повторюсь, снято было для друга, через телеграмм на телефоне)
 
подскажите кстати, может кто знает. Есть ли квесты в lineage 2 помимо квеста на нублесс, где при убийстве босса , выдается квест итем на все пати ?
 
По просьбе

gamergame


Просил за денюжку записать подробный гайд. Но не уверен что он подробный и поможет. Поэтому оставляю в общем доступе для всех. Если вдруг получится "геймергейм" можешь на пиво скинуть))
Надеюсь хоть кому то поможет.
Если конечно я не единственный человек, который не умел это делать))

И так само видео



Java:
package quests;

import l2.commons.util.Rnd;
import l2.gameserver.model.instances.NpcInstance;
import l2.gameserver.model.quest.Quest;
import l2.gameserver.model.quest.QuestState;
import l2.gameserver.scripts.ScriptFile;

public class _891_armor extends Quest implements ScriptFile {
    private static final int bes = 45051;

    private static final int bet = 9881;

    private static final int bev = 9882;

    private static final int bez = 9514;

    private static final int beA = 40060;

    private static final int beB = 31030;

    private static final int[][] DROPLIST_COND = new int[][] { { 1, 2, 40060, 0, 9881, 300, 50, 1 }, { 1, 3, 31030, 0, 9882, 1, 100, 1 }   };

    public void onLoad() {}

    public void onReload() {}

    public void onShutdown() {}

    public _891_armor() {
        super(0);
        addStartNpc(45051);
        addTalkId(new int[] { 31030 });
        addKillId(new int[] { 40060 });
        addQuestItem(new int[] { 9881, 9882 });
    }

    public String onEvent(String paramString, QuestState paramQuestState, NpcInstance paramNpcInstance) {
        String str = paramString;
        if (paramString.equalsIgnoreCase("wings03.htm")) {
            paramQuestState.setCond(1);
            paramQuestState.setState(2);
            paramQuestState.playSound("ItemSound.quest_accept");
        }
        return str;
    }

    public String onTalk(NpcInstance paramNpcInstance, QuestState paramQuestState) {
        String str = "noquest";
        int i = paramNpcInstance.getNpcId();
        int j = paramQuestState.getCond();
        if (i == 45051)
            if (j == 0) {
                if (paramQuestState.getPlayer().getLevel() >= 3) {
                    str = "wings02.htm";
                } else {
                    paramQuestState.exitCurrentQuest(true);
                    return "wings01.htm";
                }
            } else if (j == 1) {
                str = "wings04.htm";
            } else if (j == 2) {
                str = "wings07.htm";
                paramQuestState.setCond(3);
            } else if (j == 3) {
                str = "wings07.htm";
            } else if (j == 4) {
                paramQuestState.takeItems(9881, -1L);
                int k = Rnd.get(17);
                if (k == 0) {
                    paramQuestState.giveItems(48, 1L);
                    paramQuestState.playSound("ItemSound.quest_jackpot");
                } else {
                    paramQuestState.giveItems(9512, 1L);
                }
                str = "wings05.htm";
                paramQuestState.playSound("ItemSound.quest_finish");
                giveExtraReward(paramQuestState.getPlayer());
                paramQuestState.exitCurrentQuest(true);
            }
        if (i == 31030) {
            if (j == 3 && paramQuestState.getQuestItemsCount(9882) == 0L) {
                paramQuestState.giveItems(9882, 1L);
                paramQuestState.setCond(4);
                paramQuestState.playSound("ItemSound.quest_jackpot");
                str = "wings06.htm";
            }
        }
        return str;
    }



    public String onKill(NpcInstance paramNpcInstance, QuestState paramQuestState) {
        int i = paramNpcInstance.getNpcId();
        int j = paramQuestState.getCond();
        for (byte b = 0; b < DROPLIST_COND.length; b++) {
            if (j == DROPLIST_COND[b][0] && i == DROPLIST_COND[b][2] && (DROPLIST_COND[b][3] == 0 || paramQuestState.getQuestItemsCount(DROPLIST_COND[b][3]) > 0L))
                if (DROPLIST_COND[b][5] == 0) {
                    paramQuestState.rollAndGive(DROPLIST_COND[b][4], DROPLIST_COND[b][7], DROPLIST_COND[b][6]);
                } else if (paramQuestState.rollAndGive(DROPLIST_COND[b][4], DROPLIST_COND[b][7], DROPLIST_COND[b][7], DROPLIST_COND[b][5], DROPLIST_COND[b][6]) && DROPLIST_COND[b][1] != j && DROPLIST_COND[b][1] != 0) {
                    paramQuestState.setCond(Integer.valueOf(DROPLIST_COND[b][1]).intValue());
                    paramQuestState.setState(2);
                }
        }
        return null;
    }
}




Java:
package ai;

import java.util.HashMap;
import java.util.Map;
import l2.gameserver.ai.Fighter;
import l2.gameserver.model.Creature;
import l2.gameserver.model.instances.NpcInstance;
import l2.gameserver.utils.NpcUtils;

public class armor extends Fighter {
    private static final Map<Integer, Integer> bV = new HashMap<>();

    public armor(NpcInstance paramNpcInstance) {
        super(paramNpcInstance);
    }

    protected void onEvtDead(Creature paramCreature) {
        NpcInstance npcInstance = getActor();
        Integer integer = bV.get(Integer.valueOf(npcInstance.getNpcId()));
        if (integer != null)
            NpcUtils.spawnSingle(integer.intValue(), npcInstance.getLoc(), 120000L);
        super.onEvtDead(paramCreature);
    }

    static {
        bV.put(Integer.valueOf(40042), Integer.valueOf(31030));
    }
}


Можете легко переделать под себя:
Если будут вопросы, давайте вместе попробуем их решить.

Code:
1    890    1    a,Quest Wings\0    a,fragments of wings\0    a,Wings asked you to collect 300 fragments of wings. Fly to the Wings Quest location and kill mobs Angels until you get the right number of items.\\n\0    1    9881                                                        1    300                                                        110439.00000000    -85484.00000000    -3422.00000000    76    80    2    a,Monastery Of Silence\0    1    1    1    45050    82779.00000000    149417.00000000    -3494.00000000    a,No Requirements\0    a,Wings pays a reward to the one who brings him a fragment of wings.\0    0                                                                                                                                                                                                                                                                                        0                        0    0    0    67
1    890    2    a,Quest Wings\0    a,Go back to Wings\0    a,You have collected 300 fragments. Go to Wings - Giran.\\n\0    0                                                            0                                                            82779.00000000    149417.00000000    -3494.00000000    76    80    2    a,Wings\0    0    1    1    45050    82779.00000000    149417.00000000    -3494.00000000    a,No Requirements\0    a,Wings asked you to 300 Fragments of wings, as a reward for which you will receive one Wings Coin. And in the future you will be able to exchange it for wings. Fly to the Wings Quest location and kill mobs until you get the right number of items.\0    0                                                                                                                                                                                                                                                                                        0                        0    0    0    67
1    890    3    a,Quest Wings\0    a,fragments of wings\0    a,Wings asked you to 1 Bone for wings, as a reward for which you will receive one Wings Coin. And in the future you will be able to exchange it for wings. Fly to the Wings Quest location and kill mobs Angels until you get the right number of items.\\n\0    1    9882                                                        1    1                                                        186096.00000000    -105832.00000000    -6335.00000000    76    80    2    a,Lair of Valakas\0    1    1    1    45051    82779.00000000    149417.00000000    -3494.00000000    a,No Requirements\0    a,Wings pays a reward to the one who brings him a fragment of wings.\0    0                                                                                                                                                                                                                                                                                        0                        0    0    0    67
1    890    4    a,Quest Wings\0    a,Go back to Wings\0    a,You have collected 1 fragments. Take your reward.\\n\0    0                                                            0                                                            82779.00000000    149417.00000000    -3494.00000000    76    80    2    a,Wings\0    0    1    1    45050    82779.00000000    149417.00000000    -3494.00000000    a,No Requirements\0    a,Wings asked you to 1 Bone of wings, as a reward for which you will receive one Wings Coin. And in the future you will be able to exchange it for wings. Fly to the Wings Raid Boss Quest location and kill mobs until you get the right number of items.\0    0                                                                                                                                                                                                                                                                                        0                        0    0    0    67
 
Если хотите сделать просто разговор с каким то нпс, что бы он забирал предмет и выдавал. то в onTalk добавить что то типо:

Java:
if (i == 45051)
   if (j == 1) {
        paramQuestState.giveItems(7222, 1L);
        paramQuestState.takeItems(7221, -1L);
        str = "dialogname02.htm";
        paramQuestState.setCond(2);
   }
 
Хочу теперь понять, как сделать дроп квестового итема, добивающей пати.
Вечером может поэкспериментирую.
 
Посмотрел видео. Надо переделать будет. Мне кажется я много туплю там сам))
Есть вообще тут такие, кому будет полезно?
 
По мне полезная информация. Только не первоочерёдная к сожалению. Хотя я бы свой квест в инстанс зону прикрутил бы. Только я ещё инстанс не освоил тему )))
 
Получилось пати дроп сделать.
За основу взят был нубл квест.


кому нужно, держите

Java:
package quests;

import java.util.List;
import l2.gameserver.Config;
import l2.gameserver.model.GameObject;
import l2.gameserver.model.Player;
import l2.gameserver.model.instances.NpcInstance;
import l2.gameserver.model.quest.Quest;
import l2.gameserver.model.quest.QuestState;
import l2.gameserver.scripts.ScriptFile;

public class _892_armor extends Quest implements ScriptFile {
    private static final int bcs = 31740;

    private static final int bch = 30721;

    private static final int bdh = 31741;

    private static final int bdi = 21541;

    private static final int bdj = 21544;

    private static final int bdk = 25325;

    private static final int bdl = 7591;

    private static final int bdm = 7592;

    private static final int bdn = 7593;

    private static final int bdo = 7594;

    private static final int bdg = 7678;

    private static final int bdp = 7679;

    public _892_armor() {
        super(1);
        addStartNpc(45051);
        addTalkId(45051);
        addKillId(40084);
        addQuestItem(new int[] { 9882, 9502 });
    }

    public void onLoad() {}

    public void onReload() {}

    public void onShutdown() {}

    public String onEvent(String paramString, QuestState paramQuestState, NpcInstance paramNpcInstance) {
        String str = paramString;
        if (paramString.equalsIgnoreCase("armor01.htm")) {
            paramQuestState.setCond(1);
            paramQuestState.setState(2);
            paramQuestState.playSound("ItemSound.quest_accept");
            str = "armor03.htm";
        }
        return str;
    }

    public String onTalk(NpcInstance paramNpcInstance, QuestState paramQuestState) {
        String str = "noquest";
        int i = paramNpcInstance.getNpcId();
        int j = paramQuestState.getCond();
        if (i == 45051)
            if (j == 0) {
                if (paramQuestState.getPlayer().getLevel() >= 3) {
                    str = "armor02.htm";
                } else {
                    paramQuestState.exitCurrentQuest(true);
                    return "armor03.htm";
                }
            } else if (j == 1) {
                str = "armor04.htm";
            } else if (j == 2) {
                paramQuestState.takeItems(9882, -1L);
                paramQuestState.giveItems(9502, 1L);
                str = "armor05.htm";
                paramQuestState.playSound("ItemSound.quest_finish");
                paramQuestState.exitCurrentQuest(true);
            }
        return str;
    }
    public String onKill(NpcInstance paramNpcInstance, QuestState paramQuestState) {
        int i = paramQuestState.getCond();
        int j = paramNpcInstance.getNpcId();
        int s = 20;
        if (j == 40084 && i == 1) {
            Player player = paramQuestState.getPlayer();
            List<Player> list = paramQuestState.getPartyMembers(2, Config.ALT_PARTY_DISTRIBUTION_RANGE, (GameObject)player);
            for (Player player1 : list) {
                QuestState questState = player1.getQuestState(this);
                questState.setCond(2);
                questState.giveItems(9882, 1L);
                questState.playSound("ItemSound.quest_middle");
                player.sendMessage("Ваша группа сделал последний удар!Поздравляем! ");

            }
        }
        return null;
    }
}
 
Я думаю тебе нужно отдельно оформить тему в руководствах (гайд) и конкретно описать необходимые строчки скрипта
 
Back
Top