From e68b8af19a1e509e48cdce0de7925e9f76d2c1a5 Mon Sep 17 00:00:00 2001 From: Adry_85 <adrya85@hotmail.it> Date: Tue, 4 Nov 2014 22:40:29 +0100 Subject: [PATCH] Retail-like quest Help Rood Raise A New Pet! (352). --- L2J_DataPack/dist/game/data/scripts.cfg | 1 - .../352_HelpRoodRaiseANewPet/31067-02.htm | 5 - .../352_HelpRoodRaiseANewPet/31067-03.htm | 6 - .../352_HelpRoodRaiseANewPet/31067-04.htm | 7 - .../352_HelpRoodRaiseANewPet/31067-06.htm | 6 - .../352_HelpRoodRaiseANewPet/31067-07.htm | 6 - .../352_HelpRoodRaiseANewPet/31067-08.htm | 6 - .../352_HelpRoodRaiseANewPet/31067-09.htm | 3 - .../352_HelpRoodRaiseANewPet/__init__.py | 89 --------- .../31067-01.htm | 2 +- .../Q00352_HelpRoodRaiseANewPet/31067-02.htm | 5 + .../Q00352_HelpRoodRaiseANewPet/31067-03.htm | 5 + .../Q00352_HelpRoodRaiseANewPet/31067-04.htm | 7 + .../Q00352_HelpRoodRaiseANewPet/31067-05.html | 5 + .../31067-06.html} | 5 +- .../Q00352_HelpRoodRaiseANewPet/31067-07.html | 6 + .../Q00352_HelpRoodRaiseANewPet/31067-08.html | 3 + .../Q00352_HelpRoodRaiseANewPet/31067-09.html | 6 + .../Q00352_HelpRoodRaiseANewPet/31067-10.html | 6 + .../Q00352_HelpRoodRaiseANewPet/31067-11.html | 6 + .../Q00352_HelpRoodRaiseANewPet.java | 185 ++++++++++++++++++ .../scripts/quests/QuestMasterHandler.java | 2 + .../dist/sql/game/updates/20141104update.sql | 1 + 23 files changed, 241 insertions(+), 132 deletions(-) delete mode 100644 L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-02.htm delete mode 100644 L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-03.htm delete mode 100644 L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-04.htm delete mode 100644 L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-06.htm delete mode 100644 L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-07.htm delete mode 100644 L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-08.htm delete mode 100644 L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-09.htm delete mode 100644 L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/__init__.py rename L2J_DataPack/dist/game/data/scripts/quests/{352_HelpRoodRaiseANewPet => Q00352_HelpRoodRaiseANewPet}/31067-01.htm (80%) create mode 100644 L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-02.htm create mode 100644 L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-03.htm create mode 100644 L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-04.htm create mode 100644 L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-05.html rename L2J_DataPack/dist/game/data/scripts/quests/{352_HelpRoodRaiseANewPet/31067-05.htm => Q00352_HelpRoodRaiseANewPet/31067-06.html} (58%) create mode 100644 L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-07.html create mode 100644 L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-08.html create mode 100644 L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-09.html create mode 100644 L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-10.html create mode 100644 L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-11.html create mode 100644 L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/Q00352_HelpRoodRaiseANewPet.java create mode 100644 L2J_DataPack/dist/sql/game/updates/20141104update.sql diff --git a/L2J_DataPack/dist/game/data/scripts.cfg b/L2J_DataPack/dist/game/data/scripts.cfg index 20865def8a..8d419c9e5b 100644 --- a/L2J_DataPack/dist/game/data/scripts.cfg +++ b/L2J_DataPack/dist/game/data/scripts.cfg @@ -248,7 +248,6 @@ quests/343_UnderTheShadowOfTheIvoryTower/__init__.py quests/345_MethodToRaiseTheDead/__init__.py quests/348_ArrogantSearch/__init__.py quests/351_BlackSwan/__init__.py -quests/352_HelpRoodRaiseANewPet/__init__.py quests/355_FamilyHonor/__init__.py quests/371_ShriekOfGhosts/__init__.py quests/372_LegacyOfInsolence/__init__.py diff --git a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-02.htm b/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-02.htm deleted file mode 100644 index b8b3e853ba..0000000000 --- a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-02.htm +++ /dev/null @@ -1,5 +0,0 @@ -<html><body>Pet Manager Rood:<br> -Beauty is only the beginning! It's so light you can wrap it around your arm or let it sit on your shoulder. Its combat capability is quite extraordinary!<br> -It can fly high in the sky and launch a remote attack! This makes it the best possible pet for the upper class! Alas, there is one flaw.<br> -<a action="bypass -h Quest 352_HelpRoodRaiseANewPet 31067-03.htm">"What flaw?"</a> -</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-03.htm b/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-03.htm deleted file mode 100644 index d592fa98b1..0000000000 --- a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-03.htm +++ /dev/null @@ -1,6 +0,0 @@ -<html><body>Pet Manager Rood:<br> -Lienrik are quite headstrong and hard to tame.<br> -The training must begin while it's still a baby. However, stealing one if its eggs is almost impossible. The mother of the species puts up a desperate fight, and even if you succeed in catching one, there's no guarantee that you can train it. It's not profitable at all for now. Not at all!<br> -If I could get one of its eggs, at least I could try my best to train it. Wouldn't the ladies in town be impressed if I showed up with a tamed lienrik?<br> -<a action="bypass -h Quest 352_HelpRoodRaiseANewPet 31067-04.htm">"I will get a Lienrik Egg for you."</a> -</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-04.htm b/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-04.htm deleted file mode 100644 index 82930bfb65..0000000000 --- a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-04.htm +++ /dev/null @@ -1,7 +0,0 @@ -<html><body>Pet Manager Rood:<br> -Ready to do this? Today is a lucky day for both of us! Let me tell you a little more about Lienrik.<br> -Both Lienrik and Lienrik Lads <font color="LEVEL">can be found near Heine</font>. Approach both carefully, as once can spew poison from a great distance.<br> -Both kinds lay <font color="LEVEL">eggs</font>, but finding a female Lienrik is very rare.<br> -Well, if you can do this for me, I'll make it worth your while -- I promise!<br> -Even bringing back one would make my day!<br> -</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-06.htm b/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-06.htm deleted file mode 100644 index d1d2ea61e4..0000000000 --- a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-06.htm +++ /dev/null @@ -1,6 +0,0 @@ -<html><body>Pet Manager Rood:<br> -Oh my! These are the Lienrik Eggs! I tried so hard to get one, and now you've done it so easily! It's wonderful to finally have them! Here is the reward I promised!<br> -<a action="bypass -h npc_%objectId%_Chat">"I will bring you some more eggs."</a><br> -<a action="bypass -h Quest 352_HelpRoodRaiseANewPet 31067-09.htm">"I quit."</a><br> -<a action="bypass -h Quest 352_HelpRoodRaiseANewPet 31067-07.htm">"When do I get my lienrik?"</a> -</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-07.htm b/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-07.htm deleted file mode 100644 index f636d62c5d..0000000000 --- a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-07.htm +++ /dev/null @@ -1,6 +0,0 @@ -<html><body>Pet Manager Rood:<br> -Hmm, certainly not until I successfully raise it! This is no docile duck we're talking about here...<br> -Let me work on it. Just keep bringing me more eggs. I suspect it will take many tries to get it right.<br> -<a action="bypass -h npc_%objectId%_Chat">"I will bring you more eggs."</a><br> -<a action="bypass -h Quest 352_HelpRoodRaiseANewPet 31067-09.htm">"I quit."</a> -</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-08.htm b/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-08.htm deleted file mode 100644 index a594704117..0000000000 --- a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-08.htm +++ /dev/null @@ -1,6 +0,0 @@ -<html><body>Pet Manager Rood:<br> -Oh my! These are the Lienrik Eggs! And what's this? Is this a female Lienrik Egg? Such a rarity... You are incredible! I will hatch this and mate her with a male. What a great job! Thank you so much! Now I must concentrate on raising a lienrik. Here is your reward!<br> -<a action="bypass -h npc_%objectId%_Chat">"I will bring you more eggs."</a><br> -<a action="bypass -h Quest 352_HelpRoodRaiseANewPet 31067-09.htm">"I quit."</a><br> -<a action="bypass -h Quest 352_HelpRoodRaiseANewPet 31067-07.htm">"When do I get my lienrik?"</a> -</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-09.htm b/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-09.htm deleted file mode 100644 index 5605e6a2fd..0000000000 --- a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-09.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>Pet Manager Rood:<br> -Hmm... a quiter, eh? Go ahead... I can't stop you. I'll do my best with what I have now... But if you change your mind, please stop by. I can always use more eggs. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/__init__.py b/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/__init__.py deleted file mode 100644 index 29e9d33e52..0000000000 --- a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/__init__.py +++ /dev/null @@ -1,89 +0,0 @@ -# Made by mtrix -import sys -from com.l2jserver.gameserver.model.quest import State -from com.l2jserver.gameserver.model.quest import QuestState -from com.l2jserver.gameserver.model.quest import Quest as JQuest - -qn = "352_HelpRoodRaiseANewPet" - -ADENA = 57 -LIENRIK_EGG1 = 5860 -LIENRIK_EGG2 = 5861 -CHANCE = 30 -CHANCE2 = 7 - -class Quest (JQuest) : - - def __init__(self,id,name,descr): - JQuest.__init__(self,id,name,descr) - self.questItemIds = [LIENRIK_EGG1, LIENRIK_EGG2] - - def onEvent (self,event,st) : - htmltext = event - if event == "31067-04.htm" : - st.set("cond","1") - st.setState(State.STARTED) - st.playSound("ItemSound.quest_accept") - elif event == "31067-09.htm" : - st.playSound("ItemSound.quest_finish") - st.exitQuest(1) - return htmltext - - def onTalk (self,npc,player): - htmltext = Quest.getNoQuestMsg(player) - st = player.getQuestState(qn) - if not st : return htmltext - - npcId = npc.getId() - id = st.getState() - level = player.getLevel() - cond = st.getInt("cond") - eggs1 = st.getQuestItemsCount(LIENRIK_EGG1) - eggs2 = st.getQuestItemsCount(LIENRIK_EGG2) - if id == State.CREATED : - if level>=39 : - htmltext = "31067-01.htm" - else : - htmltext = "<html><body>(This is a quest that can only be performed by players of level 39 and above.)</body></html>" - st.exitQuest(1) - elif cond==1 : - if not eggs1 and not eggs2 : - htmltext = "31067-05.htm" - elif eggs1 and not eggs2 : - htmltext = "31067-06.htm" - st.giveItems(ADENA,eggs1*209) - st.takeItems(LIENRIK_EGG1,-1) - st.playSound("ItemSound.quest_itemget") - elif not eggs1 and eggs2 : - htmltext = "31067-08.htm" - st.giveItems(ADENA,eggs2*2050) - st.takeItems(LIENRIK_EGG2,-1) - st.playSound("ItemSound.quest_itemget") - elif eggs1 and eggs2 : - htmltext = "31067-08.htm" - st.giveItems(ADENA,eggs1*209+eggs2*2050) - st.takeItems(LIENRIK_EGG1,-1) - st.takeItems(LIENRIK_EGG2,-1) - st.playSound("ItemSound.quest_itemget") - return htmltext - - def onKill(self,npc,player,isPet): - st = player.getQuestState(qn) - if not st : return - if st.getState() != State.STARTED : return - npcId = npc.getId() - random = self.getRandom(100) - if random<=CHANCE : - st.giveItems(LIENRIK_EGG1,1) - if random<=CHANCE2 : - st.giveItems(LIENRIK_EGG2,1) - return - -QUEST = Quest(352,qn,"Help Rood Raise A New Pet") - -QUEST.addStartNpc(31067) - -QUEST.addTalkId(31067) - -QUEST.addKillId(20786) -QUEST.addKillId(20787) \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-01.htm b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-01.htm similarity index 80% rename from L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-01.htm rename to L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-01.htm index 5dcf110d11..edbe9c70ed 100644 --- a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-01.htm +++ b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-01.htm @@ -2,5 +2,5 @@ Have you seen the Lienrik near Heine? Oh, they're so beautiful... I must have one!<br> Just imagine it. They fly, so they don't get dirty...and those marvelous colors! And their skin feels cool and moist, like a delicious mug of ale on a hot summer day.<br> Warm and furry pets are passé these days. A Lienrik is much more unique.<br> -<a action="bypass -h Quest 352_HelpRoodRaiseANewPet 31067-02.htm">"Very intresting."</a> +<a action="bypass -h Quest Q00352_HelpRoodRaiseANewPet 31067-02.htm">Keep listening.</a> </body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-02.htm b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-02.htm new file mode 100644 index 0000000000..6385e2090e --- /dev/null +++ b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-02.htm @@ -0,0 +1,5 @@ +<html><body>Pet Manager Rood:<br> +Its beauty is only the beginning! It's so light you can wrap it around your arm or let it sit on your shoulder! Its combat capability is quite extraordinary!<br> +It can fly high in the sky and launch a remote attack! This makes it the best possible pet for the upper class! Alas, there is one flaw.<br> +<a action="bypass -h Quest Q00352_HelpRoodRaiseANewPet 31067-03.htm">"What flaw?"</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-03.htm b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-03.htm new file mode 100644 index 0000000000..80b3254f83 --- /dev/null +++ b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-03.htm @@ -0,0 +1,5 @@ +<html><body>Pet Manager Rood:<br> +Lienriks are quite headstrong and hard to tame.<br>The training must begin while it's still a baby. However, stealing one of its eggs is almost impossible. The mother of the species puts up a desperate fight, and even if you succeed in catching one, there's no guarantee that you can train it. It's not profitable at all for now. Not at all!<br> +If I could get one of its eggs, at least I could try my best to train it. Wouldn't the ladies in town be impressed if I showed up with a tamed lienrik?<br> +<a action="bypass -h Quest Q00352_HelpRoodRaiseANewPet 31067-04.htm">"I will get a Lienrik Egg for you."</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-04.htm b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-04.htm new file mode 100644 index 0000000000..d667de75ce --- /dev/null +++ b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-04.htm @@ -0,0 +1,7 @@ +<html><body>Pet Manager Rood:<br> +You'll really do it? I knew today was a good day. I'll tell you about the Lienrik.<br> +The Lienrik dwells near the <font color="LEVEL">Rest Area of the Animals</font>. There's the Lienrik and the Lienrik Lad. One has a range attack and one spews poison up close.<br> +Both have the <font color="LEVEL">Lienrik Egg</font>. That's where the fun begins: The egg determines gender, with the females being the most valuable.<br> +I can't pay money for one, but I'll definitely offer a reward. Bring back as many as you can.<br> +I might even let you keep one~ +</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-05.html b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-05.html new file mode 100644 index 0000000000..ebde9c8655 --- /dev/null +++ b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-05.html @@ -0,0 +1,5 @@ +<html><body>Pet Manager Rood:<br> +Have you ever seen an animal called a Lienrik? Oh, they're so beautiful... I must have one!<br> +What, you don't know what I'm talking about? Hmpph!<br> +(Only characters who are level 39 or higher may undertake this quest.) +</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-05.htm b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-06.html similarity index 58% rename from L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-05.htm rename to L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-06.html index d51fbab911..b72e4f359b 100644 --- a/L2J_DataPack/dist/game/data/scripts/quests/352_HelpRoodRaiseANewPet/31067-05.htm +++ b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-06.html @@ -1,4 +1,5 @@ <html><body>Pet Manager Rood:<br> Are you still here? Go to the <font color="LEVEL">Rest Area of the Animals</font> and bring back a <font color="LEVEL">Lienrik Egg</font> or a <font color="LEVEL">Lienrik Lad Egg</font>. I'll make it worth your while, I promise you that. Or are you just going to give up?<br> -<a action="bypass -h npc_%objectId%_Chat">"I will bring you more eggs."</a><br> -<a action="bypass -h Quest 352_HelpRoodRaiseANewPet 31067-09.htm">"I quit."</a></body></html> \ No newline at end of file +<a action="bypass -h Quest Q00352_HelpRoodRaiseANewPet 31067-07.html">Say that you will get the egg.</a><br> +<a action="bypass -h Quest Q00352_HelpRoodRaiseANewPet 31067-08.html">Say you want to quit.</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-07.html b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-07.html new file mode 100644 index 0000000000..309972bf0a --- /dev/null +++ b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-07.html @@ -0,0 +1,6 @@ +<html><body>Pet Manager Rood:<br> +Ready to do this? Today is a lucky day for both of us! Let me repeat what I told you earlier about Lienrik.<br>Both Lienrik and Lienrik Lads can be found in the <font color="LEVEL">Rest Area of the Animals</font>. Approach both carefully, as once can spew poison from a great distance.<br> +Both kinds lay <font color="LEVEL">eggs</font>, but finding a female Lienrik is very rare.<br> +Well, if you can do this for me, I'll make it worth your while -- I promise!<br> +Even bringing back one would make my day! +</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-08.html b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-08.html new file mode 100644 index 0000000000..42073c83e0 --- /dev/null +++ b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-08.html @@ -0,0 +1,3 @@ +<html><body>Pet Manager Rood:<br> +Hmm... a quitter, eh? Go ahead... I can't stop you. I'll do my best with what I have now... But if you change your mind, please stop by. I can always use more eggs. +</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-09.html b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-09.html new file mode 100644 index 0000000000..995d38dbf8 --- /dev/null +++ b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-09.html @@ -0,0 +1,6 @@ +<html><body>Pet Manager Rood:<br> +Oh my! These are Lienrik Eggs! I tried so hard to get one, and now you've done it so easily! It's wonderful to finally have them! Here is the reward I promised!<br> +<a action="bypass -h Quest Q00352_HelpRoodRaiseANewPet 31067-07.html">"I'll bring you some more eggs."</a><br> +<a action="bypass -h Quest Q00352_HelpRoodRaiseANewPet 31067-08.html">"I quit."</a><br> +<a action="bypass -h Quest Q00352_HelpRoodRaiseANewPet 31067-10.html">"When do I get my lienrik?"</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-10.html b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-10.html new file mode 100644 index 0000000000..4fd8c44c12 --- /dev/null +++ b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-10.html @@ -0,0 +1,6 @@ +<html><body>Pet Manager Rood:<br> +Hmm, certainly not until I successfully raise it! This is no docile duck we're talking about here...<br> +Let me work on it. Just keep bringing me more eggs. I suspect it will take many tries to get it right. <br> +<a action="bypass -h Quest Q00352_HelpRoodRaiseANewPet 31067-07.html">"I will bring more eggs."</a><br> +<a action="bypass -h Quest Q00352_HelpRoodRaiseANewPet 31067-08.html">"I quit."</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-11.html b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-11.html new file mode 100644 index 0000000000..e966ff6e1c --- /dev/null +++ b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/31067-11.html @@ -0,0 +1,6 @@ +<html><body>Pet Manager Rood:<br> +Oh my! These are Lienrik Eggs! And what's this? Is this a female Lienrik Egg? Such a rarity... You are incredible! I will hatch this and mate her with a male. What a great job! Thank you so very much! Now I must concentrate on raising a lienrik. Here is your reward!<br> +<a action="bypass -h Quest Q00352_HelpRoodRaiseANewPet 31067-07.html">"I will bring you more eggs."</a><br> +<a action="bypass -h Quest Q00352_HelpRoodRaiseANewPet 31067-08.html">"I quit."</a><br> +<a action="bypass -h Quest Q00352_HelpRoodRaiseANewPet 31067-10.html">"When do I get my lienrik?"</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/Q00352_HelpRoodRaiseANewPet.java b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/Q00352_HelpRoodRaiseANewPet.java new file mode 100644 index 0000000000..7a10a7234b --- /dev/null +++ b/L2J_DataPack/dist/game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/Q00352_HelpRoodRaiseANewPet.java @@ -0,0 +1,185 @@ +/* + * Copyright (C) 2004-2014 L2J DataPack + * + * This file is part of L2J DataPack. + * + * L2J DataPack 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. + * + * L2J DataPack 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.Q00352_HelpRoodRaiseANewPet; + +import java.util.HashMap; +import java.util.Map; + +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.util.Util; + +/** + * Help Rood Raise A New Pet! (352) + * @author Adry_85 + */ +public final class Q00352_HelpRoodRaiseANewPet extends Quest +{ + private static final class DropInfo + { + public final int _firstChance; + public final int _secondChance; + + public DropInfo(int firstChance, int secondChance) + { + _firstChance = firstChance; + _secondChance = secondChance; + } + + public int getFirstChance() + { + return _firstChance; + } + + public int getSecondChance() + { + return _secondChance; + } + } + + // NPC + private static final int ROOD = 31067; + // Items + private static final int LIENRIK_EGG1 = 5860; + private static final int LIENRIK_EGG2 = 5861; + // Misc + private static final int MIN_LEVEL = 39; + + private static final Map<Integer, DropInfo> MOBS = new HashMap<>(); + static + { + MOBS.put(20786, new DropInfo(46, 48)); // lienrik + MOBS.put(21644, new DropInfo(46, 48)); // lienrik_a + MOBS.put(21645, new DropInfo(69, 71)); // lienrik_lad_a + } + + public Q00352_HelpRoodRaiseANewPet() + { + super(352, Q00352_HelpRoodRaiseANewPet.class.getSimpleName(), "Help Rood Raise A New Pet!"); + addStartNpc(ROOD); + addTalkId(ROOD); + addKillId(MOBS.keySet()); + registerQuestItems(LIENRIK_EGG1, LIENRIK_EGG2); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + final QuestState qs = getQuestState(player, false); + if (qs == null) + { + return null; + } + + String htmltext = null; + switch (event) + { + case "31067-02.htm": + case "31067-03.htm": + case "31067-07.html": + case "31067-10.html": + { + htmltext = event; + break; + } + case "31067-04.htm": + { + qs.setMemoState(1); + qs.startQuest(); + htmltext = event; + break; + } + case "31067-08.html": + { + qs.exitQuest(true, true); + htmltext = event; + break; + } + } + return htmltext; + } + + @Override + public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) + { + final QuestState qs = getQuestState(killer, false); + + if ((qs == null) || !Util.checkIfInRange(1500, npc, killer, true)) + { + return null; + } + + final DropInfo info = MOBS.get(npc.getId()); + + if (getRandom(100) < info.getFirstChance()) + { + qs.giveItemRandomly(npc, LIENRIK_EGG1, 1, 0, 1.0, true); + } + else if (getRandom(100) < info.getSecondChance()) + { + qs.giveItemRandomly(npc, LIENRIK_EGG2, 1, 0, 1.0, true); + } + return super.onKill(npc, killer, isSummon); + } + + @Override + public String onTalk(L2Npc npc, L2PcInstance player) + { + QuestState qs = getQuestState(player, true); + String htmltext = getNoQuestMsg(player); + if (qs.isCreated()) + { + htmltext = (player.getLevel() >= MIN_LEVEL) ? "31067-01.htm" : "31067-05.html"; + } + else if (qs.isStarted()) + { + final long LienrikEgg1Count = getQuestItemsCount(player, LIENRIK_EGG1); + final long LienrikEgg2Count = getQuestItemsCount(player, LIENRIK_EGG2); + + if ((LienrikEgg1Count == 0) && (LienrikEgg2Count == 0)) + { + htmltext = "31067-06.html"; + } + else if ((LienrikEgg1Count >= 1) && (LienrikEgg2Count == 0)) + { + if (LienrikEgg1Count >= 10) + { + giveAdena(player, (LienrikEgg1Count * 34) + 4000, true); + } + else + { + giveAdena(player, (LienrikEgg1Count * 34) + 2000, true); + } + + takeItems(player, LIENRIK_EGG1, -1); + htmltext = "31067-10.html"; + } + else if (LienrikEgg1Count >= 1) + { + giveAdena(player, 4000 + ((LienrikEgg1Count * 34) + (LienrikEgg2Count * 1025)), true); + takeItems(player, LIENRIK_EGG1, -1); + takeItems(player, LIENRIK_EGG2, -1); + htmltext = "31067-11.html"; + } + } + return htmltext; + } +} diff --git a/L2J_DataPack/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_DataPack/dist/game/data/scripts/quests/QuestMasterHandler.java index c33b6cfcc3..f8ac009903 100644 --- a/L2J_DataPack/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_DataPack/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -278,6 +278,7 @@ import quests.Q00341_HuntingForWildBeasts.Q00341_HuntingForWildBeasts; import quests.Q00344_1000YearsTheEndOfLamentation.Q00344_1000YearsTheEndOfLamentation; import quests.Q00347_GoGetTheCalculator.Q00347_GoGetTheCalculator; import quests.Q00350_EnhanceYourWeapon.Q00350_EnhanceYourWeapon; +import quests.Q00352_HelpRoodRaiseANewPet.Q00352_HelpRoodRaiseANewPet; import quests.Q00354_ConquestOfAlligatorIsland.Q00354_ConquestOfAlligatorIsland; import quests.Q00356_DigUpTheSeaOfSpores.Q00356_DigUpTheSeaOfSpores; import quests.Q00357_WarehouseKeepersAmbition.Q00357_WarehouseKeepersAmbition; @@ -711,6 +712,7 @@ public class QuestMasterHandler Q00344_1000YearsTheEndOfLamentation.class, Q00347_GoGetTheCalculator.class, Q00350_EnhanceYourWeapon.class, + Q00352_HelpRoodRaiseANewPet.class, Q00354_ConquestOfAlligatorIsland.class, Q00356_DigUpTheSeaOfSpores.class, Q00357_WarehouseKeepersAmbition.class, diff --git a/L2J_DataPack/dist/sql/game/updates/20141104update.sql b/L2J_DataPack/dist/sql/game/updates/20141104update.sql new file mode 100644 index 0000000000..501bc02d24 --- /dev/null +++ b/L2J_DataPack/dist/sql/game/updates/20141104update.sql @@ -0,0 +1 @@ +UPDATE character_quests SET name='Q00352_HelpRoodRaiseANewPet' WHERE name='352_HelpRoodRaiseANewPet'; \ No newline at end of file -- GitLab