Skip to content
Snippets Groups Projects
Commit a13dd709 authored by Adry_85's avatar Adry_85
Browse files

BETA: Quest '''Curiosity Of A Dwarf''' (329) in Java.

	Patch by: ivantotov
	Reviewed by: Adry_85
parent c0610860
No related branches found
No related tags found
No related merge requests found
Showing
with 193 additions and 97 deletions
...@@ -460,7 +460,7 @@ quests/Q00325_GrimCollector/Q00325_GrimCollector.java ...@@ -460,7 +460,7 @@ quests/Q00325_GrimCollector/Q00325_GrimCollector.java
quests/Q00326_VanquishRemnants/Q00326_VanquishRemnants.java quests/Q00326_VanquishRemnants/Q00326_VanquishRemnants.java
quests/327_ReclaimTheLand/__init__.py quests/327_ReclaimTheLand/__init__.py
quests/Q00328_SenseForBusiness/Q00328_SenseForBusiness.java quests/Q00328_SenseForBusiness/Q00328_SenseForBusiness.java
quests/329_CuriosityOfDwarf/__init__.py quests/Q00329_CuriosityOfADwarf/Q00329_CuriosityOfADwarf.java
quests/330_AdeptOfTaste/__init__.py quests/330_AdeptOfTaste/__init__.py
quests/Q00331_ArrowOfVengeance/Q00331_ArrowOfVengeance.java quests/Q00331_ArrowOfVengeance/Q00331_ArrowOfVengeance.java
quests/333_BlackLionHunt/__init__.py quests/333_BlackLionHunt/__init__.py
......
# Made by Mr. - Version 0.3 by DrLecter
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 = "329_CuriosityOfDwarf"
GOLEM_HEARTSTONE = 1346
BROKEN_HEARTSTONE = 1365
ADENA = 57
class Quest (JQuest) :
def __init__(self,id,name,descr):
JQuest.__init__(self,id,name,descr)
self.questItemIds = [BROKEN_HEARTSTONE, GOLEM_HEARTSTONE]
def onEvent (self,event,st) :
htmltext = event
if event == "30437-03.htm" :
st.set("cond","1")
st.setState(State.STARTED)
st.playSound("ItemSound.quest_accept")
elif event == "30437-06.htm" :
st.exitQuest(1)
st.playSound("ItemSound.quest_finish")
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()
if id == State.CREATED :
st.set("cond","0")
if st.getInt("cond")==0 :
if player.getLevel() >= 33 :
htmltext = "30437-02.htm"
else:
htmltext = "30437-01.htm"
st.exitQuest(1)
else :
heart=st.getQuestItemsCount(GOLEM_HEARTSTONE)
broken=st.getQuestItemsCount(BROKEN_HEARTSTONE)
if broken+heart>0 :
st.giveItems(ADENA,50*broken+1000*heart)
st.takeItems(BROKEN_HEARTSTONE,-1)
st.takeItems(GOLEM_HEARTSTONE,-1)
htmltext = "30437-05.htm"
else:
htmltext = "30437-04.htm"
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()
n = self.getRandom(100)
if npcId == 20085 :
if n<5 :
st.giveItems(GOLEM_HEARTSTONE,1)
st.playSound("ItemSound.quest_itemget")
elif n<58 :
st.giveItems(BROKEN_HEARTSTONE,1)
st.playSound("ItemSound.quest_itemget")
elif npcId == 20083 :
if n<6 :
st.giveItems(GOLEM_HEARTSTONE,1)
st.playSound("ItemSound.quest_itemget")
elif n<56 :
st.giveItems(BROKEN_HEARTSTONE,1)
st.playSound("ItemSound.quest_itemget")
return
QUEST = Quest(329,qn,"Curiosity Of Dwarf")
QUEST.addStartNpc(30437)
QUEST.addTalkId(30437)
QUEST.addKillId(20083)
QUEST.addKillId(20085)
\ No newline at end of file
<html><body>Trader Rolento:<br> <html><body>Trader Rolento:<br>
As Elves are infatuated with poetry and songs and Orcs rave over war, we Dwarves love to make things with our very own hands. Ever since I was young, I immensely enjoyed fooling around with toys with springs or pocket watches. My dream is to make a<font color="LEVEL"> golem</font> with my own hands some day.<br> As Elves are infatuated with poetry and songs and Orcs rave over war, we Dwarves love to make things with our very own hands. Ever since I was young, I immensely enjoyed fooling around with toys with springs or pocket watches. My dream is to make a <font color="LEVEL">golem</font> with my own hands some day.<br>
However, I am not talking about the animate, monster golems that you can see frequently. The golems made by the dwarves are automatic dolls that move according to minute mechanical devices. It is totally different from stone golems or granite golems, which are magically blessed with life.<br> However, I am not talking about the animate, monster golems that you can see frequently. The golems made by the dwarves are automatic dolls that move according to minute mechanical devices. It is totally different from stone golems or granite golems, which are magically blessed with life.<br>However, I always wondered what the energy source of a magically created golem would be. No matter how carefully I looked at it, I could not find the part that generated power... . There are many golems in the wastelands here. They say it is because the devil Beleth and the magicians of the Ivory Tower used them as weapons of war in this land. If that is true, then that means that more than a thousand years have passed since the golems were abandoned in this land. Don't you find it surprising that they are still moving? What do you think? Aren't you getting curious, too? If you have time later, let's research it together.<br>
However, I always wondered what the energy source of a magically created golem would be. No matter how carefully I looked at it, I could not find the part that generated power ... . There are many golems in the wastelands here. They say it is because the devil Beleth and the magicians of the Ivory Tower used them as weapons of war in this land. If that is true, then that means that more than a thousand years have passed since the golems were abandoned in this land. Don't you find it surprising that they are still moving? What do you think? Aren't you getting curious, too? If you have time later, let's research it together.<br> (Quest for characters level 33 and above.)
(Quest for characters level 33 and above.)
</body></html> </body></html>
\ No newline at end of file
<html><body>Trader Rolento:<br> <html><body>Trader Rolento:<br>
As Elves are infatuated with poetry and songs and Orcs rave over war, we Dwarves love to make things with our very own hands. Ever since I was young, I immensely enjoyed fooling around with toys with springs or pocket watches. My dream is to make a<font color="LEVEL"> golem</font> with my own hands someday.<br> As Elves are infatuated with poetry and songs and Orcs rave over war, we Dwarves love to make things with our very own hands. Ever since I was young, I immensely enjoyed fooling around with toys with springs or pocket watches. My dream is to make a <font color="LEVEL">golem</font> with my own hands someday.<br>
However, I am not talking about the animate, monster golems that you can see frequently. The golems made by the dwarves are automatic dolls that move according to minute mechanical devices. It is totally different from stone golems or granite golems, which were magically blessed with life.<br> However, I am not talking about the animate, monster golems that you can see frequently. The golems made by the dwarves are automatic dolls that move according to minute mechanical devices. It is totally different from stone golems or granite golems, which were magically blessed with life.<br>
However, I always wondered what the energy source of a magically created golem would be. No matter how carefully I looked at it, I could not find the part that generated power ... There are many golems in the Wastelands here. They say it is because the devil Beleth and the magicians of the Ivory Tower used them as weapons of war in this land. If that is true, then that means that more than a thousand years have passed since the golems were abandoned in this land. What do you think? Aren't you getting curious, too? If you grant my request, it will be a great help to my studies ... will you help me?<br> However, I always wondered what the energy source of a magically created golem would be. No matter how carefully I looked at it, I could not find the part that generated power... There are many golems in the Wastelands here. They say it is because the devil Beleth and the magicians of the Ivory Tower used them as weapons of war in this land. If that is true, then that means that more than a thousand years have passed since the golems were abandoned in this land. What do you think? Aren't you getting curious, too? If you grant my request, it will be a great help to my studies... will you help me?<br>
<a action="bypass -h Quest 329_CuriosityOfDwarf 30437-03.htm">Say you will help</a> <a action="bypass -h Quest Q00329_CuriosityOfADwarf 30437-03.htm">Say you will help</a>
</body></html> </body></html>
\ No newline at end of file
<html><body>Trader Rolento:<br> <html><body>Trader Rolento:<br>
Good! We understand each other well. Actually, I recently had a chance to see a destroyed granite golem, and within the remains I saw a piece of stone of a different hue. I asked Sal, who has profound knowledge of magic, and he said the stone was a<font color="LEVEL"> heartstone</font>. I found out that all the golems made by the magicians had a heartstone in the center of their bodies.<br> Good! We understand each other well. Actually, I recently had a chance to see a destroyed granite golem, and within the remains I saw a piece of stone of a different hue. I asked Sarien, who has profound knowledge of magic, and he said the stone was a <font color="LEVEL">heartstone</font>. I found out that all the golems made by the magicians had a heartstone in the center of their bodies.<br>
What was it that he said? Something about putting a symbolic heart that resembles the living body into a still stone figure, and then gathering the magic forces before beginning the spells ... . Of course I didn't understand a word of what he was talking about, but anyway, it seems almost certain that the heartstone is the power source of the golem.<br> What was it that he said? Something about putting a symbolic heart that resembles the living body into a still stone figure, and then gathering the magic forces before beginning the spells... . Of course I didn't understand a word of what he was talking about, but anyway, it seems almost certain that the heartstone is the power source of the golem.<br>
So, I would like you to go into the Wastelands and get me the<font color="LEVEL"> heartstone of a golem</font>. There are many<font color="LEVEL"> granite golems</font> in the Wastelands. There are also granite golems that are nicknamed<font color="LEVEL"> punchers,</font> because they brandish their fists about fiercely.<br> So, I would like you to go into the Wastelands and get me the <font color="LEVEL">heartstone of a golem</font>. There are many <font color="LEVEL">granite golems</font> in the Wastelands. There are also granite golems that are nicknamed <font color="LEVEL">punchers,</font> because they Brandish their fists about fiercely.<br>
Most heartstones shatter or crack when the golem is killed, but very rarely you can obtain whole, perfect heartstones. I would like you to bring me all the heartstones you can find -- whether they be broken or whole. I will compensate you for as many as you bring back. Of course, I will be more generous for<font color="LEVEL"> perfect heartstones</font>. Most heartstones shatter or crack when the golem is killed, but very rarely you can obtain whole, perfect heartstones. I would like you to bring me all the heartstones you can find -- whether they be broken or whole. I will compensate you for as many as you bring back. Of course, I will be more generous for <font color="LEVEL">perfect heartstones</font>.
</body></html> </body></html>
\ No newline at end of file
<html><body>Trader Rolento:<br> <html><head><body>Trader Rolento:<br>
Oh dear, your hands are still empty. As I already told you, I need the<font color="LEVEL"> heartstones of granite golems and punchers</font>. Please go to the Wastelands and find heartstones for me.<br> Oh dear, your hands are still empty. As I already told you, I need the <font color="LEVEL">heartstones of granite golems and punchers</font>. Please go to the Wastelands and find heartstones for me.<br>
<a action="bypass -h Quest 329_CuriosityOfDwarf 30437-06.htm">Say you will quit</a><br> <a action="bypass -h Quest Q00329_CuriosityOfADwarf 30437-06.html">Say you will quit</a><br>
<a action="bypass -h Quest 329_CuriosityOfDwarf 30437-07.htm">Say you will continue</a> <a action="bypass -h Quest Q00329_CuriosityOfADwarf 30437-07.html">Say you will continue</a>
</body></html> </body></html>
\ No newline at end of file
<html><body>Trader Rolento:<br> <html><body>Trader Rolento:<br>
Oh, you have found some! I will reveal whether or not the power to move rocks like living humans for hundreds of years lies within this small stone. I must begin my research immediately -- starting tonight. Although it is difficult because I do not have any proper tools or measuring devices, because this is not a workshop, I can measure the size with a ruler and the weight with a scale, and pound it with my hammer to fathom its solidity and density. Hmm ... so this goes like this ... and ...<br> Oh, you have found some! I will reveal whether or not the power to move rocks like living humans for hundreds of years lies within this small stone. I must begin my research immediately -- starting tonight. Although it is difficult because I do not have any proper tools or measuring devices, because this is not a workshop, I can measure the size with a ruler and the weight with a scale, and pound it with my hammer to fathom its solidity and density. Hmm ... so this goes like this ... and ...<br>
Oh dear, I've been wrapped up too much in my own thoughts, forgive me! As we promised, I will reward you by the number of heartstones you have brought.<br> Oh dear, I've been wrapped up too much in my own thoughts, forgive me! As we promised, I will reward you by the number of heartstones you have brought.<br>But I wish to have some more heartstones to send to my guild brothers in Giran. What do you say? Could I ask you another favor?<br>
But I wish to have some more heartstones to send to my guild brothers in Giran. What do you say? Could I ask you another favor?<br> <a action="bypass -h Quest Q00329_CuriosityOfADwarf 30437-06.html">Say you will quit</a><br>
<a action="bypass -h Quest 329_CuriosityOfDwarf 30437-06.htm">Say you will quit</a><br> <a action="bypass -h Quest Q00329_CuriosityOfADwarf 30437-07.html">Say you will continue</a>
<a action="bypass -h Quest 329_CuriosityOfDwarf 30437-07.htm">Say you will continue</a>
</body></html> </body></html>
\ No newline at end of file
<html><body>Trader Rolento:<br> <html><body>Trader Rolento:<br>
I'm sorry that you are quitting, it is too bad. I'll have to ask someone else. Thanks anyway. May the divine blessing of Maphr, our God of the Earth, be with you! I'm sorry that you are quitting, it is too bad. I'll have to ask someone else. Thanks anyway. May the divine blessing of Maphr, our God of the Earth, be with you!
</body></html> </body></html>
\ No newline at end of file
<html><body>Trader Rolento:<br> <html><body>Trader Rolento:<br>
I want to thank you. Thank you so much for helping me satisfy my curiosity. If my studies produce results, then we Dwarves may be able to develop a new power tool that moves mechanical devices. It is all thanks to you. That granted, please help me a little more. I want to thank you. Thank you so much for helping me satisfy my curiosity. If my studies produce results, then we Dwarves may be able to develop a new power tool that moves mechanical devices. It is all thanks to you. That granted, please help me a little more.
</body></html> </body></html>
\ No newline at end of file
/*
* Copyright (C) 2004-2013 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.Q00329_CuriosityOfADwarf;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.ItemHolder;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.quest.State;
import com.l2jserver.gameserver.util.Util;
/**
* Curiosity Of A Dwarf (329)
* @author ivantotov
*/
public final class Q00329_CuriosityOfADwarf extends Quest
{
// NPC
private static final int TRADER_ROLENTO = 30437;
// Items
private static final int GOLEM_HEARTSTONE = 1346;
private static final int BROKEN_HEARTSTONE = 1365;
// Misc
private static final int MIN_LEVEL = 33;
// Monsters
private static final Map<Integer, List<ItemHolder>> MONSTER_DROPS = new HashMap<>();
static
{
MONSTER_DROPS.put(20083, Arrays.asList(new ItemHolder(GOLEM_HEARTSTONE, 3), new ItemHolder(BROKEN_HEARTSTONE, 54))); // Granitic Golem
MONSTER_DROPS.put(20085, Arrays.asList(new ItemHolder(GOLEM_HEARTSTONE, 3), new ItemHolder(BROKEN_HEARTSTONE, 58))); // Puncher
}
private Q00329_CuriosityOfADwarf(int questId, String name, String descr)
{
super(questId, name, descr);
addStartNpc(TRADER_ROLENTO);
addTalkId(TRADER_ROLENTO);
addKillId(MONSTER_DROPS.keySet());
registerQuestItems(GOLEM_HEARTSTONE, BROKEN_HEARTSTONE);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final QuestState st = player.getQuestState(getName());
String htmltext = null;
if (st == null)
{
return htmltext;
}
switch (event)
{
case "30437-03.htm":
{
if (st.isCreated())
{
st.startQuest();
htmltext = event;
}
break;
}
case "30437-06.html":
{
st.exitQuest(true, true);
htmltext = event;
break;
}
case "30437-07.html":
{
htmltext = event;
break;
}
}
return htmltext;
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
final QuestState st = killer.getQuestState(getName());
if ((st != null) && Util.checkIfInRange(1500, npc, killer, true))
{
final int rnd = getRandom(100);
for (ItemHolder drop : MONSTER_DROPS.get(npc.getId()))
{
if (rnd < drop.getCount())
{
st.giveItemRandomly(npc, drop.getId(), 1, 0, 1.0, true);
break;
}
}
}
return super.onKill(npc, killer, isSummon);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
String htmltext = getNoQuestMsg(player);
final QuestState st = player.getQuestState(getName());
if (st == null)
{
return htmltext;
}
switch (st.getState())
{
case State.CREATED:
{
htmltext = player.getLevel() >= MIN_LEVEL ? "30437-02.htm" : "30437-01.htm";
break;
}
case State.STARTED:
{
if (hasAtLeastOneQuestItem(player, getRegisteredItemIds()))
{
final long broken = st.getQuestItemsCount(BROKEN_HEARTSTONE);
final long golem = st.getQuestItemsCount(GOLEM_HEARTSTONE);
st.giveAdena(((broken * 50) + (golem * 1000) + ((broken + golem) >= 10 ? 1183 : 0)), true);
takeItems(player, -1, getRegisteredItemIds());
htmltext = "30437-05.html";
}
else
{
htmltext = "30437-04.html";
}
break;
}
}
return htmltext;
}
public static void main(String[] args)
{
new Q00329_CuriosityOfADwarf(329, Q00329_CuriosityOfADwarf.class.getSimpleName(), "Curiosity Of A Dwarf");
}
}
\ No newline at end of file
UPDATE character_quests SET name='Q00329_CuriosityOfADwarf' WHERE name='329_CuriosityOfDwarf';
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment