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 161 additions and 364 deletions
......@@ -285,10 +285,10 @@ quests/23_LidiasHeart/__init__.py
quests/24_InhabitantsOfTheForrestOfTheDead/__init__.py
quests/25_HidingBehindTheTruth/__init__.py
quests/Q26_TiredOfWaiting/Q26_TiredOfWaiting.java
quests/27_ChestCaughtWithABaitOfWind/__init__.py
quests/28_ChestCaughtWithABaitOfIcyAir/__init__.py
quests/29_ChestCaughtWithABaitOfEarth/__init__.py
quests/30_ChestCaughtWithABaitOfFire/__init__.py
quests/Q27_ChestCaughtWithABaitOfWind/Q27_ChestCaughtWithABaitOfWind.java
quests/Q28_ChestCaughtWithABaitOfIcyAir/Q28_ChestCaughtWithABaitOfIcyAir.java
quests/Q29_ChestCaughtWithABaitOfEarth/Q29_ChestCaughtWithABaitOfEarth.java
quests/Q30_ChestCaughtWithABaitOfFire/Q30_ChestCaughtWithABaitOfFire.java
quests/31_SecretBuriedInTheSwamp/__init__.py
quests/32_AnObviousLie/__init__.py
quests/33_MakeAPairOfDressShoes/__init__.py
......
......@@ -23,7 +23,6 @@ import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.instance.L2DefenderInstance;
import com.l2jserver.gameserver.model.actor.instance.L2FortCommanderInstance;
import com.l2jserver.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
import com.l2jserver.gameserver.model.actor.instance.L2SiegeFlagInstance;
import com.l2jserver.gameserver.model.actor.instance.L2SiegeSummonInstance;
......
# Made by DooMIta (ethernaly@email.it) and DrLecter.
# Visit http://www.l2jdp.com/trac if you find a bug and wish to report it.
# Visit http://www.l2jdp.com/forum/ for more details about our community and the project.
import sys
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest
qn = "27_ChestCaughtWithABaitOfWind"
#NPC
LANOSCO = 31570
SHALING = 31434
#QUEST ITEMs and REWARD
BLUE_TREASURE_BOX = 6500
STRANGE_BLUESPRINT = 7625
BLACK_PEARL_RING = 880
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onAdvEvent (self,event,npc, player) :
htmltext = event
st = player.getQuestState(qn)
if not st : return
if event== "31570-03.htm" :
st.set("cond","1")
st.setState(State.STARTED)
st.playSound("ItemSound.quest_accept")
elif event == "31570-05.htm" and st.getQuestItemsCount(BLUE_TREASURE_BOX) :
htmltext="31570-06.htm"
st.playSound("ItemSound.quest_middle")
st.giveItems(STRANGE_BLUESPRINT, 1)
st.takeItems(BLUE_TREASURE_BOX,-1)
st.set("cond","2")
elif event == "31434-02.htm" and st.getQuestItemsCount(BLACK_PEARL_RING) :
htmltext = "31434-01.htm"
st.playSound("ItemSound.quest_finish")
st.giveItems(BLACK_PEARL_RING, 1)
st.takeItems(STRANGE_BLUESPRINT,-1)
st.unset("cond")
st.exitQuest(False)
return htmltext
def onTalk(self, npc, player):
htmltext = Quest.getNoQuestMsg(player)
st = player.getQuestState(qn)
if not st : return htmltext
npcId=npc.getNpcId()
id = st.getState()
if id == State.CREATED :
req = player.getQuestState("50_LanoscosSpecialBait")
if req : reqst = req.getState()
if player.getLevel() >= 27 and req and reqst == State.COMPLETED :
htmltext = "31570-01.htm"
else :
st.exitQuest(1)
htmltext = "31570-02.htm"
elif id == State.STARTED :
cond = st.getInt("cond")
if npcId == LANOSCO :
if cond == 1 :
if st.getQuestItemsCount(BLUE_TREASURE_BOX) :
htmltext = "31570-03.htm"
else :
htmltext = "31570-04.htm"
else :
htmltext = "31570-05.htm"
else :
htmltext = "31434-00.htm"
elif id == State.COMPLETED :
htmltext = Quest.getAlreadyCompletedMsg(player)
return htmltext
QUEST=Quest(27,qn,"Chest Caught With A Bait Of Wind")
QUEST.addStartNpc(LANOSCO)
QUEST.addTalkId(LANOSCO)
QUEST.addTalkId(SHALING)
### ---------------------------------------------------------------------------
### Create by Skeleton!!!
### ---------------------------------------------------------------------------
import sys
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest
qn = "28_ChestCaughtWithABaitOfIcyAir"
# NPC List
OFulle=31572
Kiki=31442
# ~~~
# Item List
BigYellowTreasureChest=6503
KikisLetter=7626
ElvenRing=881
# ~~~
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onAdvEvent (self,event,npc, player) :
htmltext = event
st = player.getQuestState(qn)
if not st : return
if event=="31572-04.htm" :
st.set("cond","1")
st.playSound("ItemSound.quest_accept")
elif event=="31572-07.htm" :
if st.getQuestItemsCount(BigYellowTreasureChest) :
st.set("cond","2")
st.takeItems(BigYellowTreasureChest,1)
st.giveItems(KikisLetter,1)
else :
htmltext="31572-08.htm"
elif event=="31442-02.htm" :
if st.getQuestItemsCount(KikisLetter)==1 :
htmltext="31442-02.htm"
st.takeItems(KikisLetter,-1)
st.giveItems(ElvenRing,1)
st.set("cond","0")
st.exitQuest(False)
st.playSound("ItemSound.quest_finish")
else :
htmltext="31442-03.htm"
return htmltext
def onTalk (self,npc,player):
htmltext = Quest.getNoQuestMsg(player)
st = player.getQuestState(qn)
if not st : return htmltext
npcId = npc.getNpcId()
id=st.getState()
if id==State.CREATED :
st.setState(State.STARTED)
st.set("cond","0")
cond=st.getInt("cond")
id = st.getState()
if npcId==OFulle :
if cond==0 and id==State.STARTED:
PlayerLevel = player.getLevel()
if PlayerLevel >= 36 :
OFullesSpecialBait= player.getQuestState("51_OFullesSpecialBait")
if OFullesSpecialBait :
if OFullesSpecialBait.getState() == State.COMPLETED :
htmltext="31572-01.htm"
else :
htmltext="31572-02.htm"
st.exitQuest(1)
else :
htmltext="31572-03.htm"
st.exitQuest(1)
else :
htmltext="31572-02.htm"
elif cond==1 :
htmltext="31572-05.htm"
if st.getQuestItemsCount(BigYellowTreasureChest)==0 :
htmltext="31572-06.htm"
elif cond==2 :
htmltext="31572-09.htm"
elif cond==0 and id==State.COMPLETED :
htmltext=Quest.getAlreadyCompletedMsg(player)
elif npcId==Kiki :
if cond==2 :
htmltext="31442-01.htm"
return htmltext
QUEST = Quest(28,qn,"Chest Caught With A Bait Of Icy Air")
QUEST.addStartNpc(OFulle)
QUEST.addTalkId(OFulle)
QUEST.addTalkId(Kiki)
<html><body>Fishermen's Guild Member Willie:<br>
Well, it's obvious you're not here to buy fishing gear! Have you ever been fishing? Try it once, you'll be hooked! Heh heh! I'm the man to think of when you need bait!<br>
(This quest may only be undertaken by characters of level 48 or above who have completed Willie's Special Bait quest.)
</body></html>
\ No newline at end of file
### ---------------------------------------------------------------------------
### Create by Skeleton!!!
### ---------------------------------------------------------------------------
import sys
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest
qn = "29_ChestCaughtWithABaitOfEarth"
# NPC List
Willie =31574
Anabel =30909
# ~~~
# Item List
SmallPurpleTreasureChest =6507
SmallGlassBox =7627
PlatedLeatherGloves =2455
# ~~~
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onAdvEvent (self,event,npc, player) :
htmltext = event
st = player.getQuestState(qn)
if not st : return
if event =="31574-04.htm" :
st.set("cond","1")
st.playSound("ItemSound.quest_accept")
elif event=="31574-07.htm" :
if st.getQuestItemsCount(SmallPurpleTreasureChest) :
st.set("cond","2")
st.takeItems(SmallPurpleTreasureChest,1)
st.giveItems(SmallGlassBox,1)
else :
htmltext="31574-08.htm"
elif event =="30909-02.htm" :
if st.getQuestItemsCount(SmallGlassBox)==1 :
st.takeItems(SmallGlassBox,-1)
st.giveItems(PlatedLeatherGloves,1)
st.set("cond","0")
st.exitQuest(False)
st.playSound("ItemSound.quest_finish")
else :
htmltext ="30909-03.htm"
return htmltext
def onTalk (self,npc,player):
htmltext = Quest.getNoQuestMsg(player)
st = player.getQuestState(qn)
if not st : return htmltext
npcId = npc.getNpcId()
id = st.getState()
if id==State.CREATED :
st.setState(State.STARTED)
st.set("cond","0")
cond=st.getInt("cond")
id = st.getState()
if npcId ==Willie :
if cond==0 and id==State.STARTED :
PlayerLevel = player.getLevel()
if PlayerLevel >= 48 :
WilliesSpecialBait = player.getQuestState("52_WilliesSpecialBait")
if WilliesSpecialBait:
if WilliesSpecialBait.getState() == State.COMPLETED :
htmltext="31574-01.htm"
else :
htmltext="31574-02.htm"
st.exitQuest(1)
else :
htmltext="31574-03.htm"
st.exitQuest(1)
else :
htmltext="31574-02.htm"
st.exitQuest(1)
elif cond==0 and id==State.COMPLETED :
htmltext =Quest.getAlreadyCompletedMsg(player)
elif cond==1 :
htmltext="31574-05.htm"
if st.getQuestItemsCount(SmallPurpleTreasureChest)==0 :
htmltext ="31574-06.htm"
elif cond==2 :
htmltext="31574-09.htm"
elif npcId ==Anabel :
if cond==2 :
htmltext="30909-01.htm"
return htmltext
QUEST = Quest(29,qn,"Chest Caught With A Bait Of Earth")
QUEST.addStartNpc(Willie)
QUEST.addTalkId(Willie)
QUEST.addTalkId(Anabel)
# Made by Ethernaly ethernaly@email.it
# cleanup by DrLecter for the Official L2J Datapack Project.
# Visit http://www.l2jdp.com/forum/ for more details.
import sys
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest
qn = "30_ChestCaughtWithABaitOfFire"
#NPC
LINNAEUS = 31577
RUKAL = 30629
#QUEST ITEM and REWARD
RED_TREASURE_BOX = 6511
RUKAL_MUSICAL = 7628
PROTECTION_NECKLACE = 916
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onAdvEvent (self,event,npc, player) :
htmltext = event
st = player.getQuestState(qn)
if not st : return
if event== "31577-02.htm" :
st.set("cond","1")
st.setState(State.STARTED)
st.playSound("ItemSound.quest_accept")
elif event == "31577-04a.htm" and st.getQuestItemsCount(RED_TREASURE_BOX) :
htmltext="31577-04.htm"
st.playSound("ItemSound.quest_middle")
st.giveItems(RUKAL_MUSICAL, 1)
st.takeItems(RED_TREASURE_BOX,-1)
st.set("cond","2")
elif event == "30629-02.htm" and st.getQuestItemsCount(RUKAL_MUSICAL) :
htmltext = "30629-03.htm"
st.playSound("ItemSound.quest_finish")
st.giveItems(PROTECTION_NECKLACE, 1)
st.takeItems(RUKAL_MUSICAL,-1)
st.unset("cond")
st.exitQuest(False)
return htmltext
def onTalk(self, npc, player):
htmltext = Quest.getNoQuestMsg(player)
st = player.getQuestState(qn)
if not st : return htmltext
npcId=npc.getNpcId()
id = st.getState()
if id == State.CREATED :
req = player.getQuestState("53_LinnaeusSpecialBait")
if req : reqst = req.getState()
if player.getLevel() >= 61 and req and reqst == State.COMPLETED :
htmltext = "31577-01.htm"
else :
st.exitQuest(1)
htmltext = "31577-00.htm"
elif id == State.STARTED :
cond = st.getInt("cond")
if npcId == LINNAEUS :
if cond == 1 :
if st.getQuestItemsCount(RED_TREASURE_BOX) :
htmltext = "31577-03.htm"
else :
htmltext = "31577-03a.htm"
else :
htmltext = "31577-05.htm"
else :
htmltext = "30629-01.htm"
elif id == State.COMPLETED :
htmltext = Quest.getAlreadyCompletedMsg(player)
return htmltext
QUEST=Quest(30,qn,"Chest Caught With A Bait Of Fire")
QUEST.addStartNpc(LINNAEUS)
QUEST.addTalkId(LINNAEUS)
QUEST.addTalkId(RUKAL)
<html><body>Fishermen's Guild Member Lanosco:<br>
Why haven't you gone to see Shaling yet? Take the blueprint of golem to her in the Blacksmith Shop immediately!</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.Q27_ChestCaughtWithABaitOfWind;
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 Wind (27)<br>
* Original Jython script by DooMIta
* @author nonom
*/
public class Q27_ChestCaughtWithABaitOfWind extends Quest
{
private static final String qn = "27_ChestCaughtWithABaitOfWind";
// NPCs
private static final int LANOSCO = 31570;
private static final int SHALING = 31434;
// Items
private static final int BLUE_TREASURE_BOX = 6500;
private static final int STRANGE_BLUESPRINT = 7625;
private static final int BLACK_PEARL_RING = 880;
@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 "31570-03.htm":
st.set("cond", "1");
st.setState(State.STARTED);
st.playSound("ItemSound.quest_accept");
break;
case "31570-05.htm":
if ((st.getInt("cond") == 1) && (st.hasQuestItems(BLUE_TREASURE_BOX)))
{
htmltext = "31570-06.htm";
st.set("cond", "2");
st.giveItems(STRANGE_BLUESPRINT, 1);
st.takeItems(BLUE_TREASURE_BOX, -1);
st.playSound("ItemSound.quest_middle");
}
break;
case "31434-02.htm":
if ((st.getInt("cond") == 2) && (st.hasQuestItems(STRANGE_BLUESPRINT)))
{
htmltext = "31434-01.htm";
st.giveItems(BLACK_PEARL_RING, 1);
st.takeItems(STRANGE_BLUESPRINT, -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("50_LanoscosSpecialBait");
if (npcId == LANOSCO)
{
htmltext = "31570-02.htm";
if (qs != null)
{
htmltext = ((player.getLevel() >= 27) && qs.isCompleted()) ? "31570-01.htm" : htmltext;
}
}
break;
case State.STARTED:
final int cond = st.getInt("cond");
switch (npcId)
{
case LANOSCO:
if (cond == 1)
{
if (st.hasQuestItems(BLUE_TREASURE_BOX))
{
htmltext = "31570-04.htm";
}
else
{
htmltext = "31570-05.htm";
}
}
else
{
htmltext = "31570-07.htm";
}
break;
case SHALING:
if (cond == 2)
{
htmltext = "31434-00.htm";
}
break;
}
}
return htmltext;
}
public Q27_ChestCaughtWithABaitOfWind(int questId, String name, String descr)
{
super(questId, name, descr);
addStartNpc(LANOSCO);
addTalkId(LANOSCO, SHALING);
}
public static void main(String[] args)
{
new Q27_ChestCaughtWithABaitOfWind(27, qn, "Chest Caught With A Bait Of Wind");
}
}
<html><body>Mineral Trader Kiki:<br>
If you're not here to buy minerals, why have you come?<br>
You must be either a soldier or a traveler.<br>
<a action="bypass -h Quest 28_ChestCaughtWithABaitOfIcyAir 31442-02.htm">"I have a letter for you."</a>
<a action="bypass -h Quest 28_ChestCaughtWithABaitOfIcyAir 31442-03.htm">"I have a letter for you."</a>
</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