Skip to content
Snippets Groups Projects
Commit 04b8116e authored by MELERIX's avatar MELERIX
Browse files

BETA: Chest Caught Quests from Jython to Java by '''nonom''' (thanks '''Adry_85''' for testing).

parent 23cf2b59
No related branches found
No related tags found
No related merge requests found
Showing
with 156 additions and 3 deletions
<html><body>Fishermen's Guild Member O'Fulle:<br> <html><body>Fishermen's Guild Member O'Fulle:<br>
Did you find the <font color="LEVEL">large yellow treasure box</font> If so, let me authenticate it! I'll open it to verify its contents.<br> Did you find the <font color="LEVEL">large yellow treasure box</font> If so, let me authenticate it! I'll open it to verify its contents.<br>
<a action="bypass -h Quest 28_ChestCaughtWithABaitOfIcyAir 31572-07.htm">"Here it is."</a> <a action="bypass -h Quest 28_ChestCaughtWithABaitOfIcyAir 31572-08.htm">"Here it is."</a>
</body></html> </body></html>
\ No newline at end of file
/*
* This program 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.
*
* This program 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.Q28_ChestCaughtWithABaitOfIcyAir;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.quest.State;
/**
* Chest Caught With A Bait Of Icy Air (28)<br>
* Original Jython script by Skeleton
* @author nonom
*/
public class Q28_ChestCaughtWithABaitOfIcyAir extends Quest
{
private static final String qn = "28_ChestCaughtWithABaitOfIcyAir";
// NPCs
private static final int OFULLE = 31572;
private static final int KIKI = 31442;
// Items
private static final int YELLOW_TREASURE_BOX = 6503;
private static final int KIKIS_LETTER = 7626;
private static final int ELVEN_RING = 881;
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = event;
final QuestState st = player.getQuestState(qn);
if (st == null)
{
return htmltext;
}
switch (event)
{
case "31572-04.htm":
st.set("cond", "1");
st.setState(State.STARTED);
st.playSound("ItemSound.quest_accept");
break;
case "31572-08.htm":
if ((st.getInt("cond") == 1) && (st.hasQuestItems(YELLOW_TREASURE_BOX)))
{
htmltext = "31572-07.htm";
st.set("cond", "2");
st.giveItems(KIKIS_LETTER, 1);
st.takeItems(YELLOW_TREASURE_BOX, -1);
st.playSound("ItemSound.quest_middle");
}
break;
case "31442-03.htm":
if ((st.getInt("cond") == 2) && (st.hasQuestItems(KIKIS_LETTER)))
{
htmltext = "31442-02.htm";
st.giveItems(ELVEN_RING, 1);
st.takeItems(KIKIS_LETTER, -1);
st.playSound("ItemSound.quest_finish");
st.exitQuest(false);
}
break;
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
String htmltext = getNoQuestMsg(player);
final QuestState st = player.getQuestState(qn);
if (st == null)
{
return htmltext;
}
final int npcId = npc.getNpcId();
switch (st.getState())
{
case State.COMPLETED:
htmltext = getAlreadyCompletedMsg(player);
break;
case State.CREATED:
final QuestState qs = player.getQuestState("51_OFullesSpecialBait");
if (npcId == OFULLE)
{
htmltext = "31572-02.htm";
if (qs != null)
{
htmltext = ((player.getLevel() >= 36) && qs.isCompleted()) ? "31572-01.htm" : htmltext;
}
}
break;
case State.STARTED:
final int cond = st.getInt("cond");
switch (npcId)
{
case OFULLE:
switch (cond)
{
case 1:
htmltext = "31572-06.htm";
if (st.hasQuestItems(YELLOW_TREASURE_BOX))
{
htmltext = "31572-05.htm";
}
break;
case 2:
htmltext = "31572-09.htm";
break;
}
break;
case KIKI:
if (cond == 2)
{
htmltext = "31442-01.htm";
}
break;
}
break;
}
return htmltext;
}
public Q28_ChestCaughtWithABaitOfIcyAir(int questId, String name, String descr)
{
super(questId, name, descr);
addStartNpc(OFULLE);
addTalkId(OFULLE, KIKI);
}
public static void main(String[] args)
{
new Q28_ChestCaughtWithABaitOfIcyAir(28, qn, "Chest Caught With A Bait Of Icy Air");
}
}
<html><body>Magister Anabel:<br> <html><body>Magister Anabel:<br>
Neither love nor friendship will ever last between a mortal Human and an Elf.<br> Neither love nor friendship will ever last between a mortal Human and an Elf.<br>
They fade with time, but memories, they'll last forever. What can I do for you?<br> They fade with time, but memories, they'll last forever. What can I do for you?<br>
<a action="bypass -h Quest 29_ChestCaughtWithABaitOfEarth 30909-02.htm">"I found the box with the names Anabel and Liesel on it."</a> <a action="bypass -h Quest 29_ChestCaughtWithABaitOfEarth 30909-03.htm">"I found the box with the names Anabel and Liesel on it."</a>
</body></html> </body></html>
\ No newline at end of file
<html><body>Fishermen's Guild Member Willie:<br> <html><body>Fishermen's Guild Member Willie:<br>
Certainly you're not finished already! I don't believe it! Have you already found the <font color="LEVEL">small purple treasure box</font>? Let me see it!<br> Certainly you're not finished already! I don't believe it! Have you already found the <font color="LEVEL">small purple treasure box</font>? Let me see it!<br>
<a action="bypass -h Quest 29_ChestCaughtWithABaitOfEarth 31574-07.htm">"Here it is."</a> <a action="bypass -h Quest 29_ChestCaughtWithABaitOfEarth 31574-08.htm">"Here it is."</a>
</body></html> </body></html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment