From 04b8116e2b74a065a6bd84f343203cad20f3d41a Mon Sep 17 00:00:00 2001 From: MELERIX <MELERIX@users.noreply.github.com> Date: Thu, 10 May 2012 17:42:38 +0000 Subject: [PATCH] BETA: Chest Caught Quests from Jython to Java by '''nonom''' (thanks '''Adry_85''' for testing). --- L2J_DataPack_BETA/dist/game/data/scripts.cfg | 8 +- .../scripts/handlers/effecthandlers/Fear.java | 1 - .../27_ChestCaughtWithABaitOfWind/__init__.py | 83 ---------- .../__init__.py | 94 ----------- .../31574-03.htm | 4 - .../__init__.py | 94 ----------- .../30_ChestCaughtWithABaitOfFire/__init__.py | 83 ---------- .../31434-00.htm | 0 .../31434-01.htm | 0 .../31434-02.htm | 0 .../31570-01.htm | 0 .../31570-02.htm | 0 .../31570-03.htm | 0 .../31570-04.htm | 0 .../31570-05.htm | 0 .../31570-06.htm | 0 .../31570-07.htm | 2 + .../Q27_ChestCaughtWithABaitOfWind.java | 154 ++++++++++++++++++ .../31442-01.htm | 2 +- .../31442-02.htm | 0 .../31442-03.htm | 0 .../31572-01.htm | 0 .../31572-02.htm | 0 .../31572-03.htm | 0 .../31572-04.htm | 0 .../31572-05.htm | 2 +- .../31572-06.htm | 0 .../31572-07.htm | 0 .../31572-08.htm | 0 .../31572-09.htm | 0 .../Q28_ChestCaughtWithABaitOfIcyAir.java | 153 +++++++++++++++++ .../30909-01.htm | 2 +- .../30909-02.htm | 0 .../30909-03.htm | 0 .../31574-01.htm | 0 .../31574-02.htm | 0 .../31574-04.htm | 0 .../31574-05.htm | 2 +- .../31574-06.htm | 0 .../31574-07.htm | 0 .../31574-08.htm | 0 .../31574-09.htm | 0 .../Q29_ChestCaughtWithABaitOfEarth.java | 153 +++++++++++++++++ .../30629-01.htm | 0 .../30629-02.htm | 0 .../30629-03.htm | 0 .../31577-00.htm | 0 .../31577-01.htm | 0 .../31577-02.htm | 0 .../31577-03.htm | 0 .../31577-03a.htm | 0 .../31577-04.htm | 0 .../31577-04a.htm | 0 .../31577-05.htm | 0 .../Q30_ChestCaughtWithABaitOfFire.java | 154 ++++++++++++++++++ 55 files changed, 624 insertions(+), 367 deletions(-) delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/__init__.py delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/__init__.py delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-03.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/__init__.py delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/__init__.py rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{27_ChestCaughtWithABaitOfWind => Q27_ChestCaughtWithABaitOfWind}/31434-00.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{27_ChestCaughtWithABaitOfWind => Q27_ChestCaughtWithABaitOfWind}/31434-01.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{27_ChestCaughtWithABaitOfWind => Q27_ChestCaughtWithABaitOfWind}/31434-02.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{27_ChestCaughtWithABaitOfWind => Q27_ChestCaughtWithABaitOfWind}/31570-01.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{27_ChestCaughtWithABaitOfWind => Q27_ChestCaughtWithABaitOfWind}/31570-02.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{27_ChestCaughtWithABaitOfWind => Q27_ChestCaughtWithABaitOfWind}/31570-03.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{27_ChestCaughtWithABaitOfWind => Q27_ChestCaughtWithABaitOfWind}/31570-04.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{27_ChestCaughtWithABaitOfWind => Q27_ChestCaughtWithABaitOfWind}/31570-05.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{27_ChestCaughtWithABaitOfWind => Q27_ChestCaughtWithABaitOfWind}/31570-06.htm (100%) create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-07.htm create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/Q27_ChestCaughtWithABaitOfWind.java rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{28_ChestCaughtWithABaitOfIcyAir => Q28_ChestCaughtWithABaitOfIcyAir}/31442-01.htm (83%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{28_ChestCaughtWithABaitOfIcyAir => Q28_ChestCaughtWithABaitOfIcyAir}/31442-02.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{28_ChestCaughtWithABaitOfIcyAir => Q28_ChestCaughtWithABaitOfIcyAir}/31442-03.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{28_ChestCaughtWithABaitOfIcyAir => Q28_ChestCaughtWithABaitOfIcyAir}/31572-01.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{28_ChestCaughtWithABaitOfIcyAir => Q28_ChestCaughtWithABaitOfIcyAir}/31572-02.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{28_ChestCaughtWithABaitOfIcyAir => Q28_ChestCaughtWithABaitOfIcyAir}/31572-03.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{28_ChestCaughtWithABaitOfIcyAir => Q28_ChestCaughtWithABaitOfIcyAir}/31572-04.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{28_ChestCaughtWithABaitOfIcyAir => Q28_ChestCaughtWithABaitOfIcyAir}/31572-05.htm (90%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{28_ChestCaughtWithABaitOfIcyAir => Q28_ChestCaughtWithABaitOfIcyAir}/31572-06.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{28_ChestCaughtWithABaitOfIcyAir => Q28_ChestCaughtWithABaitOfIcyAir}/31572-07.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{28_ChestCaughtWithABaitOfIcyAir => Q28_ChestCaughtWithABaitOfIcyAir}/31572-08.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{28_ChestCaughtWithABaitOfIcyAir => Q28_ChestCaughtWithABaitOfIcyAir}/31572-09.htm (100%) create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/Q28_ChestCaughtWithABaitOfIcyAir.java rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{29_ChestCaughtWithABaitOfEarth => Q29_ChestCaughtWithABaitOfEarth}/30909-01.htm (80%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{29_ChestCaughtWithABaitOfEarth => Q29_ChestCaughtWithABaitOfEarth}/30909-02.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{29_ChestCaughtWithABaitOfEarth => Q29_ChestCaughtWithABaitOfEarth}/30909-03.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{29_ChestCaughtWithABaitOfEarth => Q29_ChestCaughtWithABaitOfEarth}/31574-01.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{29_ChestCaughtWithABaitOfEarth => Q29_ChestCaughtWithABaitOfEarth}/31574-02.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{29_ChestCaughtWithABaitOfEarth => Q29_ChestCaughtWithABaitOfEarth}/31574-04.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{29_ChestCaughtWithABaitOfEarth => Q29_ChestCaughtWithABaitOfEarth}/31574-05.htm (90%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{29_ChestCaughtWithABaitOfEarth => Q29_ChestCaughtWithABaitOfEarth}/31574-06.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{29_ChestCaughtWithABaitOfEarth => Q29_ChestCaughtWithABaitOfEarth}/31574-07.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{29_ChestCaughtWithABaitOfEarth => Q29_ChestCaughtWithABaitOfEarth}/31574-08.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{29_ChestCaughtWithABaitOfEarth => Q29_ChestCaughtWithABaitOfEarth}/31574-09.htm (100%) create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/Q29_ChestCaughtWithABaitOfEarth.java rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{30_ChestCaughtWithABaitOfFire => Q30_ChestCaughtWithABaitOfFire}/30629-01.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{30_ChestCaughtWithABaitOfFire => Q30_ChestCaughtWithABaitOfFire}/30629-02.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{30_ChestCaughtWithABaitOfFire => Q30_ChestCaughtWithABaitOfFire}/30629-03.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{30_ChestCaughtWithABaitOfFire => Q30_ChestCaughtWithABaitOfFire}/31577-00.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{30_ChestCaughtWithABaitOfFire => Q30_ChestCaughtWithABaitOfFire}/31577-01.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{30_ChestCaughtWithABaitOfFire => Q30_ChestCaughtWithABaitOfFire}/31577-02.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{30_ChestCaughtWithABaitOfFire => Q30_ChestCaughtWithABaitOfFire}/31577-03.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{30_ChestCaughtWithABaitOfFire => Q30_ChestCaughtWithABaitOfFire}/31577-03a.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{30_ChestCaughtWithABaitOfFire => Q30_ChestCaughtWithABaitOfFire}/31577-04.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{30_ChestCaughtWithABaitOfFire => Q30_ChestCaughtWithABaitOfFire}/31577-04a.htm (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{30_ChestCaughtWithABaitOfFire => Q30_ChestCaughtWithABaitOfFire}/31577-05.htm (100%) create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/Q30_ChestCaughtWithABaitOfFire.java diff --git a/L2J_DataPack_BETA/dist/game/data/scripts.cfg b/L2J_DataPack_BETA/dist/game/data/scripts.cfg index 2d7a341aba..effaa05469 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts.cfg +++ b/L2J_DataPack_BETA/dist/game/data/scripts.cfg @@ -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 diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/Fear.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/Fear.java index 3e21316002..6bc13f042e 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/Fear.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/Fear.java @@ -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; diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/__init__.py b/L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/__init__.py deleted file mode 100644 index 450ec0fde0..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/__init__.py +++ /dev/null @@ -1,83 +0,0 @@ -# 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) diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/__init__.py b/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/__init__.py deleted file mode 100644 index 5842121c29..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/__init__.py +++ /dev/null @@ -1,94 +0,0 @@ -### --------------------------------------------------------------------------- -### 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) diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-03.htm deleted file mode 100644 index a5eb7495ba..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-03.htm +++ /dev/null @@ -1,4 +0,0 @@ -<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 diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/__init__.py b/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/__init__.py deleted file mode 100644 index 9f41e831d0..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/__init__.py +++ /dev/null @@ -1,94 +0,0 @@ -### --------------------------------------------------------------------------- -### 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) diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/__init__.py b/L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/__init__.py deleted file mode 100644 index 080719d61e..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/__init__.py +++ /dev/null @@ -1,83 +0,0 @@ -# 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) diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31434-00.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31434-00.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31434-00.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31434-00.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31434-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31434-01.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31434-01.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31434-01.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31434-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31434-02.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31434-02.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31434-02.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31570-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-01.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31570-01.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-01.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31570-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-02.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31570-02.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-02.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31570-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-03.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31570-03.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-03.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31570-04.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-04.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31570-04.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-04.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31570-05.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-05.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31570-05.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-05.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31570-06.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-06.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/27_ChestCaughtWithABaitOfWind/31570-06.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-06.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-07.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-07.htm new file mode 100644 index 0000000000..c5eab222a9 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/31570-07.htm @@ -0,0 +1,2 @@ +<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 diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/Q27_ChestCaughtWithABaitOfWind.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/Q27_ChestCaughtWithABaitOfWind.java new file mode 100644 index 0000000000..54348fec56 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q27_ChestCaughtWithABaitOfWind/Q27_ChestCaughtWithABaitOfWind.java @@ -0,0 +1,154 @@ +/* + * 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"); + } +} diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31442-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31442-01.htm similarity index 83% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31442-01.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31442-01.htm index 049931d258..f8f0fa7ac4 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31442-01.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31442-01.htm @@ -1,5 +1,5 @@ <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 diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31442-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31442-02.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31442-02.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31442-02.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31442-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31442-03.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31442-03.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31442-03.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-01.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-01.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-01.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-02.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-02.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-02.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-03.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-03.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-03.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-04.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-04.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-04.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-04.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-05.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-05.htm similarity index 90% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-05.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-05.htm index 39714b8a30..2b675c0a7f 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-05.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-05.htm @@ -1,4 +1,4 @@ <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> -<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> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-06.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-06.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-06.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-06.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-07.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-07.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-07.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-07.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-08.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-08.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-08.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-08.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-09.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-09.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/28_ChestCaughtWithABaitOfIcyAir/31572-09.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/31572-09.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/Q28_ChestCaughtWithABaitOfIcyAir.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/Q28_ChestCaughtWithABaitOfIcyAir.java new file mode 100644 index 0000000000..c0ec6b524e --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q28_ChestCaughtWithABaitOfIcyAir/Q28_ChestCaughtWithABaitOfIcyAir.java @@ -0,0 +1,153 @@ +/* + * 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"); + } +} diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/30909-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/30909-01.htm similarity index 80% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/30909-01.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/30909-01.htm index 346cce2bef..25834eca4a 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/30909-01.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/30909-01.htm @@ -1,5 +1,5 @@ <html><body>Magister Anabel:<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> -<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> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/30909-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/30909-02.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/30909-02.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/30909-02.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/30909-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/30909-03.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/30909-03.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/30909-03.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-01.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-01.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-01.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-02.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-02.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-02.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-04.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-04.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-04.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-04.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-05.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-05.htm similarity index 90% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-05.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-05.htm index d8c175a3b2..f93b4b41d9 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-05.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-05.htm @@ -1,4 +1,4 @@ <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> -<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> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-06.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-06.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-06.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-06.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-07.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-07.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-07.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-07.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-08.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-08.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-08.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-08.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-09.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-09.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/29_ChestCaughtWithABaitOfEarth/31574-09.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/31574-09.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/Q29_ChestCaughtWithABaitOfEarth.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/Q29_ChestCaughtWithABaitOfEarth.java new file mode 100644 index 0000000000..65f3e392a2 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q29_ChestCaughtWithABaitOfEarth/Q29_ChestCaughtWithABaitOfEarth.java @@ -0,0 +1,153 @@ +/* + * 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.Q29_ChestCaughtWithABaitOfEarth; + +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 Earth (29)<br> + * Original Jython script by Skeleton + * @author nonom + */ +public class Q29_ChestCaughtWithABaitOfEarth extends Quest +{ + private static final String qn = "29_ChestCaughtWithABaitOfEarth"; + + // NPCs + private static final int WILLIE = 31574; + private static final int ANABEL = 30909; + + // Items + private static final int PURPLE_TREASURE_BOX = 6507; + private static final int SMALL_GLASS_BOX = 7627; + private static final int PLATED_LEATHER_GLOVES = 2455; + + @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 "31574-04.htm": + st.set("cond", "1"); + st.setState(State.STARTED); + st.playSound("ItemSound.quest_accept"); + break; + case "31574-08.htm": + if ((st.getInt("cond") == 1) && (st.hasQuestItems(PURPLE_TREASURE_BOX))) + { + htmltext = "31574-07.htm"; + st.set("cond", "2"); + st.giveItems(SMALL_GLASS_BOX, 1); + st.takeItems(PURPLE_TREASURE_BOX, -1); + st.playSound("ItemSound.quest_middle"); + } + break; + case "30909-03.htm": + if ((st.getInt("cond") == 2) && (st.hasQuestItems(SMALL_GLASS_BOX))) + { + htmltext = "30909-02.htm"; + st.giveItems(PLATED_LEATHER_GLOVES, 1); + st.takeItems(SMALL_GLASS_BOX, -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("52_WilliesSpecialBait"); + if (npcId == WILLIE) + { + htmltext = "31574-02.htm"; + if (qs != null) + { + htmltext = ((player.getLevel() >= 48) && qs.isCompleted()) ? "31574-01.htm" : htmltext; + } + } + break; + case State.STARTED: + final int cond = st.getInt("cond"); + switch (npcId) + { + case WILLIE: + switch (cond) + { + case 1: + htmltext = "31574-06.htm"; + if (st.hasQuestItems(PURPLE_TREASURE_BOX)) + { + htmltext = "31574-05.htm"; + } + break; + case 2: + htmltext = "31574-09.htm"; + break; + } + break; + case ANABEL: + if (cond == 2) + { + htmltext = "30909-01.htm"; + } + break; + } + break; + } + return htmltext; + } + + public Q29_ChestCaughtWithABaitOfEarth(int questId, String name, String descr) + { + super(questId, name, descr); + + addStartNpc(WILLIE); + addTalkId(WILLIE, ANABEL); + } + + public static void main(String[] args) + { + new Q29_ChestCaughtWithABaitOfEarth(29, qn, "Chest Caught With A Bait Of Earth"); + } +} diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/30629-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/30629-01.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/30629-01.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/30629-01.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/30629-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/30629-02.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/30629-02.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/30629-02.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/30629-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/30629-03.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/30629-03.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/30629-03.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-00.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-00.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-00.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-00.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-01.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-01.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-01.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-02.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-02.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-02.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-03.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-03.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-03.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-03a.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-03a.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-03a.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-03a.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-04.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-04.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-04.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-04.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-04a.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-04a.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-04a.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-04a.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-05.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-05.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/30_ChestCaughtWithABaitOfFire/31577-05.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/31577-05.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/Q30_ChestCaughtWithABaitOfFire.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/Q30_ChestCaughtWithABaitOfFire.java new file mode 100644 index 0000000000..3947f9804c --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q30_ChestCaughtWithABaitOfFire/Q30_ChestCaughtWithABaitOfFire.java @@ -0,0 +1,154 @@ +/* + * 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.Q30_ChestCaughtWithABaitOfFire; + +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 Fire (30)<br> + * Original Jython script by Ethernaly + * @author nonom + */ +public class Q30_ChestCaughtWithABaitOfFire extends Quest +{ + private static final String qn = "30_ChestCaughtWithABaitOfFire"; + + // NPCs + private static final int LINNAEUS = 31577; + private static final int RUKAL = 30629; + + // Items + private static final int RED_TREASURE_BOX = 6511; + private static final int RUKAL_MUSICAL = 7628; + private static final int PROTECTION_NECKLACE = 916; + + @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 "31577-02.htm": + st.set("cond", "1"); + st.setState(State.STARTED); + st.playSound("ItemSound.quest_accept"); + break; + case "31577-04a.htm": + if ((st.getInt("cond") == 1) && (st.hasQuestItems(RED_TREASURE_BOX))) + { + htmltext = "31577-04.htm"; + st.set("cond", "2"); + st.giveItems(RUKAL_MUSICAL, 1); + st.takeItems(RED_TREASURE_BOX, -1); + st.playSound("ItemSound.quest_middle"); + } + break; + case "30629-02.htm": + if ((st.getInt("cond") == 2) && (st.hasQuestItems(RUKAL_MUSICAL))) + { + htmltext = "30629-03.htm"; + st.giveItems(PROTECTION_NECKLACE, 1); + st.takeItems(RUKAL_MUSICAL, -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("53_LinnaeusSpecialBait"); + if (npcId == LINNAEUS) + { + htmltext = "31577-00.htm"; + if (qs != null) + { + htmltext = ((player.getLevel() >= 61) && qs.isCompleted()) ? "31577-01.htm" : htmltext; + } + } + break; + case State.STARTED: + final int cond = st.getInt("cond"); + switch (npcId) + { + case LINNAEUS: + switch (cond) + { + case 1: + htmltext = "31577-03a.htm"; + if (st.hasQuestItems(RED_TREASURE_BOX)) + { + htmltext = "31577-03.htm"; + } + break; + case 2: + htmltext = "31577-05.htm"; + break; + } + break; + case RUKAL: + if (cond == 2) + { + htmltext = "30629-01.htm"; + } + break; + } + break; + } + return htmltext; + } + + public Q30_ChestCaughtWithABaitOfFire(int questId, String name, String descr) + { + super(questId, name, descr); + + addStartNpc(LINNAEUS); + addTalkId(LINNAEUS, RUKAL); + } + + public static void main(String[] args) + { + new Q30_ChestCaughtWithABaitOfFire(30, qn, "Chest Caught With A Bait Of Fire"); + } +} -- GitLab