Помогите разобраться в квесте что к чему - Форум администраторов игровых серверов
Форум администраторов игровых серверов StormWall - Защита от DDos атак
Регистрация Мнения Справка Сообщество Календарь
Вернуться   Форум администраторов игровых серверов > MMO > Lineage II > Работа со скриптами

Работа со скриптами Помощь в редактировании и написании квестов к Java серверам, а так же эвентов.

Ответ
Опции темы
Непрочитано 21.08.2012, 13:07   #1
Аватар для CrownClown
Пользователь

Автор темы (Топик Стартер) Помогите разобраться в квесте что к чему

Помогите разобраться в квесте что к чему
PHP код:
package quests;

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

public class 
_241_PossessorOfaPreciousSoul1 extends Quest implements ScriptFile
{

    @
Override
    
public void onLoad()
    {
    }

    @
Override
    
public void onReload()
    {
    }

    @
Override
    
public void onShutdown()
    {
    }

    private static final 
int LEGENG_OF_SEVENTEEN 7587;
    private static final 
int MALRUK_SUCCUBUS_CLAW 7597;
    private static final 
int ECHO_CRYSTAL 7589;
    private static final 
int FADED_POETRY_BOOK 7588;
    private static final 
int CRIMSON_MOSS 7598;
    private static final 
int MEDICINE 7599;
    private static final 
int VIRGILS_LETTER 7677;

    public 
_241_PossessorOfaPreciousSoul1()
    {
        
super(false);

        
addStartNpc(31739);
        
addTalkId(30753);
        
addTalkId(30754);
        
addTalkId(31042);
        
addTalkId(30692);
        
addTalkId(31742);
        
addTalkId(31744);
        
addTalkId(31336);
        
addTalkId(31743);
        
addTalkId(31740);

        
addKillId(21154);
        
addKillId(27113);
        
addKillId(20244);
        
addKillId(20245);
        
addKillId(21511);
        
addKillId(20669);

        
addQuestItem(LEGENG_OF_SEVENTEENMALRUK_SUCCUBUS_CLAWFADED_POETRY_BOOKECHO_CRYSTALMEDICINECRIMSON_MOSS);
    }

    @
Override
    
public String onEvent(String eventQuestState stNpcInstance npc)
    {
        if(
event.equalsIgnoreCase("31739-02.htm"))
        {
            
st.setCond(1);
            
st.setState(STARTED);
            
st.playSound(SOUND_ACCEPT);
        }
        else if(
event.equalsIgnoreCase("30753-02.htm"))
            
st.setCond(2);
        else if(
event.equalsIgnoreCase("30754-02.htm"))
            
st.setCond(3);
        else if(
event.equalsIgnoreCase("31739-04.htm"))
        {
            
st.takeItems(LEGENG_OF_SEVENTEEN, -1);
            
st.setCond(5);
        }
        else if(
event.equalsIgnoreCase("31042-02.htm"))
            
st.setCond(6);
        else if(
event.equalsIgnoreCase("31042-04.htm"))
        {
            
st.takeItems(MALRUK_SUCCUBUS_CLAW, -1);
            
st.giveItems(ECHO_CRYSTAL1);
            
st.setCond(8);
        }
        else if(
event.equalsIgnoreCase("31739-06.htm"))
        {
            
st.takeItems(ECHO_CRYSTAL, -1);
            
st.setCond(9);
        }
        else if(
event.equalsIgnoreCase("30692-02.htm"))
        {
            
st.giveItems(FADED_POETRY_BOOK1);
            
st.setCond(10);
        }
        else if(
event.equalsIgnoreCase("31739-08.htm"))
        {
            
st.takeItems(FADED_POETRY_BOOK, -1);
            
st.setCond(11);
        }
        else if(
event.equalsIgnoreCase("31742-02.htm"))
            
st.setCond(12);
        else if(
event.equalsIgnoreCase("31744-02.htm"))
            
st.setCond(13);
        else if(
event.equalsIgnoreCase("31336-02.htm"))
            
st.setCond(14);
        else if(
event.equalsIgnoreCase("31336-04.htm"))
        {
            
st.takeItems(CRIMSON_MOSS, -1);
            
st.giveItems(MEDICINE1);
            
st.setCond(16);
        }
        else if(
event.equalsIgnoreCase("31743-02.htm"))
        {
            
st.takeItems(MEDICINE, -1);
            
st.setCond(17);
        }
        else if(
event.equalsIgnoreCase("31742-04.htm"))
            
st.setCond(18);
        else if(
event.equalsIgnoreCase("31740-02.htm"))
            
st.setCond(19);
        else if(
event.equalsIgnoreCase("31740-04.htm"))
        {
            
st.giveItems(VIRGILS_LETTER1);
            
st.addExpAndSp(2630430);
            
st.unset("cond");
            
st.exitCurrentQuest(false);
        }
        return 
event;
    }

    @
Override
    
public String onTalk(NpcInstance npcQuestState st)
    {
        if(!
st.getPlayer().isSubClassActive())
            return 
"Subclass only!";

        
String htmltext "noquest";
        
int npcId npc.getNpcId();
        
int cond st.getCond();
        if(
npcId == 31739)
        {
            if(
cond == 0)
                if(
st.getPlayer().getLevel() >= 50)
                    
htmltext "31739-01.htm";
                else
                {
                    
htmltext "31739-00.htm";
                    
st.exitCurrentQuest(true);
                }
            else if(
cond == 1)
                
htmltext "31739-02r.htm";
            else if(
cond == && st.getQuestItemsCount(LEGENG_OF_SEVENTEEN) >= 1)
                
htmltext "31739-03.htm";
            else if(
cond && st.getQuestItemsCount(ECHO_CRYSTAL) < 1)
                
htmltext "31739-04r.htm";
            else if(
cond == && st.getQuestItemsCount(ECHO_CRYSTAL) == 1)
                
htmltext "31739-05.htm";
            else if(
cond 10 && st.getQuestItemsCount(FADED_POETRY_BOOK) < 1)
                
htmltext "31739-06r.htm";
            else if(
cond == 10 && st.getQuestItemsCount(FADED_POETRY_BOOK) == 1)
                
htmltext "31739-07.htm";
            else if(
cond == 11)
                
htmltext "31739-08r.htm";
        }
        else if(
npcId == 30753)
        {
            if(
cond == 1)
                
htmltext "30753-01.htm";
            else if(
cond == 2)
                
htmltext "30753-02r.htm";
        }
        else if(
npcId == 30754)
        {
            if(
cond == 2)
                
htmltext "30754-01.htm";
            else if(
cond == && st.getQuestItemsCount(LEGENG_OF_SEVENTEEN) < 1)
                
htmltext "30754-02r.htm";
        }
        else if(
npcId == 31042)
        {
            if(
cond == 5)
                
htmltext "31042-01.htm";
            else if(
cond == && st.getQuestItemsCount(MALRUK_SUCCUBUS_CLAW) < 10)
                
htmltext "31042-02r.htm";
            else if(
cond == && st.getQuestItemsCount(MALRUK_SUCCUBUS_CLAW) == 10)
                
htmltext "31042-03.htm";
            else if(
cond == && st.getQuestItemsCount(ECHO_CRYSTAL) >= 1)
                
htmltext "31042-04r.htm";
            else if(
cond == && st.getQuestItemsCount(ECHO_CRYSTAL) == 0)
            {
                
st.giveItems(ECHO_CRYSTAL1);
                
htmltext "31042-04r.htm";
            }
        }
        else if(
npcId == 30692)
        {
            if(
cond == 9)
                
htmltext "30692-01.htm";
            else if(
cond == 10)
                
htmltext "30692-02r.htm";
        }
        else if(
npcId == 31742)
        {
            if(
cond == 11)
                
htmltext "31742-01.htm";
            else if(
cond == 12)
                
htmltext "31742-02r.htm";
            else if(
cond == 17)
                
htmltext "31742-03.htm";
            else if(
cond >= 18)
                
htmltext "31742-04r.htm";
        }
        else if(
npcId == 31744)
        {
            if(
cond == 12)
                
htmltext "31744-01.htm";
        }
        else if(
npcId == 31336)
        {
            if(
cond == 13)
                
htmltext "31336-01.htm";
            else if(
cond == 14 && st.getQuestItemsCount(CRIMSON_MOSS) < 5)
                
htmltext "31336-02r.htm";
            else if(
cond == 15 && st.getQuestItemsCount(CRIMSON_MOSS) >= 5)
                
htmltext "31336-03.htm";
            else if(
cond == 16 && st.getQuestItemsCount(MEDICINE) >= 1)
                
htmltext "31336-04r.htm";
        }
        else if(
npcId == 31743)
        {
            if(
cond == 16 && st.getQuestItemsCount(MEDICINE) >= 1)
                
htmltext "31743-01.htm";
        }
        else if(
npcId == 31740)
        {
            if(
cond == 18)
                
htmltext "31740-01.htm";
            else if(
cond == 19)
                
htmltext "31740-03.htm";
        }
        return 
htmltext;
    }

    @
Override
    
public String onKill(NpcInstance npcQuestState st)
    {
        if(!
st.getPlayer().isSubClassActive())
            return 
null;

        
int npcId npc.getNpcId();
        
int cond st.getCond();

        if(
cond == 3)
        {
            if(
npcId == 21154 && Rnd.chance(10))
                
st.addSpawn(27113);
            else if(
npcId == 27113 && st.getQuestItemsCount(LEGENG_OF_SEVENTEEN) == 0)
            {
                
st.giveItems(LEGENG_OF_SEVENTEEN1);
                
st.setCond(4);
                
st.playSound(SOUND_ITEMGET);
            }
        }
        else if(
cond == 6)
        {
            if((
npcId == 20244 || npcId == 20245) && Rnd.chance(10))
            {
                if(
st.getQuestItemsCount(MALRUK_SUCCUBUS_CLAW) <= 9)
                    
st.giveItems(MALRUK_SUCCUBUS_CLAW1);
                if(
st.getQuestItemsCount(MALRUK_SUCCUBUS_CLAW) == 10)
                {
                    
st.playSound(SOUND_MIDDLE);
                    
st.setCond(7);
                }
                else
                    
st.playSound(SOUND_ITEMGET);
            }
        }
        else if(
cond == 14)
            if(
npcId == 20669 && Rnd.chance(10))
            {
                if(
st.getQuestItemsCount(CRIMSON_MOSS) <= 4)
                    
st.giveItems(CRIMSON_MOSS1);
                if(
st.getQuestItemsCount(CRIMSON_MOSS) == 5)
                {
                    
st.playSound(SOUND_MIDDLE);
                    
st.setCond(15);
                }
                else
                    
st.playSound(SOUND_ITEMGET);
            }
        return 
null;
    }

CrownClown вне форума Отправить сообщение для CrownClown с помощью Skype™ Ответить с цитированием
Непрочитано 21.08.2012, 13:12   #2
Аватар для Ashe
Олдфаг

По умолчанию Re: Помогите разобраться в квесте что к чему

offtop:
Свернуть ↑Развернуть ↓
__________________
Fortuna - non penis, in manus non recipe.

Последний раз редактировалось Ashe; 21.08.2012 в 13:45.
Ashe вне форума Ответить с цитированием
Сказали спасибо:
Непрочитано 21.08.2012, 13:12   #3
Аватар для [STIGMATED]
Супергерой

По умолчанию Re: Помогите разобраться в квесте что к чему

Что конкретно вас интересует по квесту? Объяснять каждую строчку никто не возьмется.
[STIGMATED] вне форума Отправить сообщение для [STIGMATED] с помощью Skype™ Ответить с цитированием
Сказали спасибо:
Непрочитано 21.08.2012, 13:15   #4
Аватар для CrownClown
Пользователь

Автор темы (Топик Стартер) Re: Помогите разобраться в квесте что к чему

Мне надо узнать как убрать ограничени на сабклас, на уровень, как зделать так чтобы при взятии квеста идти можно было сразу фармить квест вещ а не говорить с нпц
CrownClown вне форума Отправить сообщение для CrownClown с помощью Skype™ Ответить с цитированием
Непрочитано 21.08.2012, 13:16   #5
Аватар для [STIGMATED]
Супергерой

По умолчанию Re: Помогите разобраться в квесте что к чему

Цитата:
Сообщение от CrownClown Посмотреть сообщение
Мне надо узнать как убрать ограничени на сабклас, на уровень, как зделать так чтобы при взятии квеста идти можно было сразу фармить квест вещ а не говорить с нпц
Проверка на саб класс
Код:
if(!st.getPlayer().isSubClassActive()) 
            return "Subclass only!";
[STIGMATED] вне форума Отправить сообщение для [STIGMATED] с помощью Skype™ Ответить с цитированием
Непрочитано 21.08.2012, 13:20   #6
Аватар для Ashe
Олдфаг

По умолчанию Re: Помогите разобраться в квесте что к чему

Проверка на lvl:
Цитата:
if(st.getPlayer().getLevel() >= 50)
Добавлено через 4 минуты
Цитата:
Сообщение от CrownClown Посмотреть сообщение
как зделать так чтобы при взятии квеста идти можно было сразу фармить квест вещ а не говорить с нпц
Переписать логику в квесте - убрать ненужные cond'ишины.
__________________
Fortuna - non penis, in manus non recipe.

Последний раз редактировалось Ashe; 21.08.2012 в 13:24. Причина: Добавлено сообщение
Ashe вне форума Ответить с цитированием
Непрочитано 21.08.2012, 13:31   #7
Аватар для CrownClown
Пользователь

Автор темы (Топик Стартер) Re: Помогите разобраться в квесте что к чему

PHP код:
import sys
from net
.sf.l2j import Config
from net
.sf.l2j.gameserver.model.quest import State
from net
.sf.l2j.gameserver.model.quest import QuestState
from net
.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest

qn 
"q902_FeatherGathering"

## нпц
NPC 300301

## Мобы
MOBS = [22132,22130,22131,22135]
#босс
BOSS 25450

## Дроп
#id перьев с мобов в мос
FEATHER 2129
#сколько нужно?
FEATHER_NEED 1000
#шанс дропа, %
FEATHER_CHANCE 100
#id итема с босса
BOSS_ITEM 2125

##Награда
#id крыльев
WINGS 7058

class Quest (JQuest) :

 
def __init__(self,id,name,descr) : JQuest.__init__(self,id,name,descr)

 
def onEvent (self,event,st) :
   
htmltext event
   
if event == "accept.htm":
     
st.setState(State.STARTED)
     
st.playSound("ItemSound.quest_accept")
     
st.set("cond","1")
   
elif event == "finish.htm":
     if 
st.getQuestItemsCount(FEATHER) >= FEATHER_NEED and st.getQuestItemsCount(BOSS_ITEM) >= 1:
       
st.takeItems(FEATHER, -1)
       
st.takeItems(BOSS_ITEM, -1)
       
st.giveItems(WINGS1)
       
st.set("cond","0")
       
st.playSound("ItemSound.quest_finish")
       
st.setState(State.COMPLETED)
     else:
       
htmltext "mobs.htm"
   
return htmltext

 def onTalk 
(self,npc,player):
   
st player.getQuestState(qn)
   if 
not st
     return 
"<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>"
   
npcId npc.getNpcId()
   
idd st.getState()
   
cond st.getInt("cond")
   if 
npcId == NPC:
     if 
idd == State.COMPLETED :
       
htmltext "completed.htm"
     
if idd == State.CREATED :
       
htmltext "hello1.htm"
     
elif cond == 1:
       if 
st.getQuestItemsCount(FEATHER) >= FEATHER_NEED and st.getQuestItemsCount(BOSS_ITEM) >= 1:
         
htmltext "mobs2.htm"
       
else:
         
htmltext "mobs.htm"
   
return htmltext

 def onKill
(self,npc,player,isPet):
   
st player.getQuestState(qn)
   if 
not st or st.getInt("cond") != 1:
     return
   
npcId npc.getNpcId()
   
reward 0
   limit 
1
   chance 
100
   
if npcId in MOBS:
     
reward FEATHER
     limit 
FEATHER_NEED
     chance 
FEATHER_CHANCE
   
if npcId == BOSS:
     
reward BOSS_ITEM
     limit 
1
   
if reward 0:
     
party player.getParty()
     if 
party:
       for 
member in party.getPartyMembers():
         if 
not member.isAlikeDead():
           
st member.getQuestState("q902_FeatherGathering")
           if 
st and st.getQuestItemsCount(reward) < limit and st.getRandom(100) <= chance:
             
st.giveItems(reward1)
             
st.playSound("ItemSound.quest_itemget")
             if 
st.getQuestItemsCount(reward) >= limit:
               
st.playSound("ItemSound.quest_middle")
     else:
       if 
st.getQuestItemsCount(reward) < limit and st.getRandom(100) <= chance:
         
st.giveItems(reward1)
         
st.playSound("ItemSound.quest_itemget")
   return  

QUEST Quest(902qn"Feather Gathering")

QUEST.addStartNpc(NPC)
QUEST.addTalkId(NPC)
QUEST.addKillId(BOSS)

for 
m in MOBS:
  
QUEST.addKillId(m
Возможно ли переделать этот квест под Java ?
CrownClown вне форума Отправить сообщение для CrownClown с помощью Skype™ Ответить с цитированием
Непрочитано 21.08.2012, 13:32   #8
Аватар для Ashe
Олдфаг

По умолчанию Re: Помогите разобраться в квесте что к чему

Цитата:
Сообщение от CrownClown Посмотреть сообщение
PHP код:
import sys
from net
.sf.l2j import Config
from net
.sf.l2j.gameserver.model.quest import State
from net
.sf.l2j.gameserver.model.quest import QuestState
from net
.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest

qn 
"q902_FeatherGathering"

## нпц
NPC 300301

## Мобы
MOBS = [22132,22130,22131,22135]
#босс
BOSS 25450

## Дроп
#id перьев с мобов в мос
FEATHER 2129
#сколько нужно?
FEATHER_NEED 1000
#шанс дропа, %
FEATHER_CHANCE 100
#id итема с босса
BOSS_ITEM 2125

##Награда
#id крыльев
WINGS 7058

class Quest (JQuest) :

 
def __init__(self,id,name,descr) : JQuest.__init__(self,id,name,descr)

 
def onEvent (self,event,st) :
   
htmltext event
   
if event == "accept.htm":
     
st.setState(State.STARTED)
     
st.playSound("ItemSound.quest_accept")
     
st.set("cond","1")
   
elif event == "finish.htm":
     if 
st.getQuestItemsCount(FEATHER) >= FEATHER_NEED and st.getQuestItemsCount(BOSS_ITEM) >= 1:
       
st.takeItems(FEATHER, -1)
       
st.takeItems(BOSS_ITEM, -1)
       
st.giveItems(WINGS1)
       
st.set("cond","0")
       
st.playSound("ItemSound.quest_finish")
       
st.setState(State.COMPLETED)
     else:
       
htmltext "mobs.htm"
   
return htmltext

 def onTalk 
(self,npc,player):
   
st player.getQuestState(qn)
   if 
not st
     return 
"<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>"
   
npcId npc.getNpcId()
   
idd st.getState()
   
cond st.getInt("cond")
   if 
npcId == NPC:
     if 
idd == State.COMPLETED :
       
htmltext "completed.htm"
     
if idd == State.CREATED :
       
htmltext "hello1.htm"
     
elif cond == 1:
       if 
st.getQuestItemsCount(FEATHER) >= FEATHER_NEED and st.getQuestItemsCount(BOSS_ITEM) >= 1:
         
htmltext "mobs2.htm"
       
else:
         
htmltext "mobs.htm"
   
return htmltext

 def onKill
(self,npc,player,isPet):
   
st player.getQuestState(qn)
   if 
not st or st.getInt("cond") != 1:
     return
   
npcId npc.getNpcId()
   
reward 0
   limit 
1
   chance 
100
   
if npcId in MOBS:
     
reward FEATHER
     limit 
FEATHER_NEED
     chance 
FEATHER_CHANCE
   
if npcId == BOSS:
     
reward BOSS_ITEM
     limit 
1
   
if reward 0:
     
party player.getParty()
     if 
party:
       for 
member in party.getPartyMembers():
         if 
not member.isAlikeDead():
           
st member.getQuestState("q902_FeatherGathering")
           if 
st and st.getQuestItemsCount(reward) < limit and st.getRandom(100) <= chance:
             
st.giveItems(reward1)
             
st.playSound("ItemSound.quest_itemget")
             if 
st.getQuestItemsCount(reward) >= limit:
               
st.playSound("ItemSound.quest_middle")
     else:
       if 
st.getQuestItemsCount(reward) < limit and st.getRandom(100) <= chance:
         
st.giveItems(reward1)
         
st.playSound("ItemSound.quest_itemget")
   return  

QUEST Quest(902qn"Feather Gathering")

QUEST.addStartNpc(NPC)
QUEST.addTalkId(NPC)
QUEST.addKillId(BOSS)

for 
m in MOBS:
  
QUEST.addKillId(m
Возможно ли переделать этот квест под Java ?
Да 10 букв
__________________
Fortuna - non penis, in manus non recipe.
Ashe вне форума Ответить с цитированием
Непрочитано 21.08.2012, 13:34   #9
Аватар для CrownClown
Пользователь

Автор темы (Топик Стартер) Re: Помогите разобраться в квесте что к чему

Если не сикрет как?)
CrownClown вне форума Отправить сообщение для CrownClown с помощью Skype™ Ответить с цитированием
Непрочитано 21.08.2012, 13:35   #10
Аватар для Ashe
Олдфаг

По умолчанию Re: Помогите разобраться в квесте что к чему

Цитата:
Сообщение от CrownClown Посмотреть сообщение
Если не сикрет как?)
С помощью рук и головы, только тссс - это страшная тайна
__________________
Fortuna - non penis, in manus non recipe.
Ashe вне форума Ответить с цитированием
Ответ

Метки
квесты


Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.

Быстрый переход

Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Помогите разобраться =( Bobt World of WarCraft 2 07.02.2012 14:30
Помогите разобраться с MySQL Nemesis Aion 3 04.07.2010 13:37
Ошибка ! помогите разобраться . zoxan Серверная часть 4 14.01.2010 16:47
помогите разобраться с .hml SalAndreas Lineage II 2 21.11.2009 15:33
Помогите разобраться Urukhai Lineage II 6 17.10.2009 17:26


© 2007–2024 «Форум администраторов игровых серверов»
Защита сайта от DDoS атак — StormWall
Работает на Булке неизвестной версии с переводом от zCarot
Текущее время: 06:20. Часовой пояс GMT +3.

Вверх