Skip to content
Snippets Groups Projects
Commit 2f3c8f3d authored by ivantotov's avatar ivantotov
Browse files

Retail-like Quest: Under The Shadow Of The Ivory Tower (343).

parent 57cb8a30
No related branches found
No related tags found
No related merge requests found
Showing
with 11 additions and 280 deletions
...@@ -191,7 +191,6 @@ quests/234_FatesWhisper/__init__.py ...@@ -191,7 +191,6 @@ quests/234_FatesWhisper/__init__.py
quests/255_Tutorial/__init__.py quests/255_Tutorial/__init__.py
quests/334_TheWishingPotion/__init__.py quests/334_TheWishingPotion/__init__.py
quests/335_TheSongOfTheHunter/__init__.py quests/335_TheSongOfTheHunter/__init__.py
quests/343_UnderTheShadowOfTheIvoryTower/__init__.py
quests/348_ArrogantSearch/__init__.py quests/348_ArrogantSearch/__init__.py
quests/384_WarehouseKeepersPastime/__init__.py quests/384_WarehouseKeepersPastime/__init__.py
quests/386_StolenDignity/__init__.py quests/386_StolenDignity/__init__.py
......
<html><body>Magic Trader Cema:<br>
Will you join our research? We are investigating the use of nebulite for the greater public good. However, we are having a hard time finding nebulite for our study. The Dwarven collectors we hired for this task have not been heard from in over a month.<br>
Would you do this work for us? Around the crater of the Ivory Tower you will find<font color="LEVEL"> manashen gargoyles, enchanted monster eyes, enchanted stone golems</font>, and enchanted iron golems. They have fallen under the spell of the<font color="LEVEL"> Nebulite Orbs</font>, which are fragments of the meteorite. If you kill these monsters you can easily collect the nebulite samples we need for our research.<br>
You shall be well-compensated for your efforts.<br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30834-02c.htm">"Tell me more about the Dwarven collectors."</a>
</body></html>
\ No newline at end of file
<html><body>Magic Trader Cema:<br>
Ah yes, the Dwarves... They are collectors, specialists in rare items. Most collectors belong to the Golden Key Guild, but I have since discovered that those two collectors are notorious for being lazy and playing tricks. I should never have hired them... Sigh...</body></html>
\ No newline at end of file
<html><body>Magic Trader Cema:<br>
Good job! So, what do you want? Do you want adena in exchange for the orbs or would you prefer trading them for useful items?<br>
You may find a few things among the exchange items that you haven't seen elsewhere. If you have any question, please ask me. I'll answer your question.<br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30834-04a.htm">Ask about the Cursed Bone</a><br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30834-04b.htm">Ask about the Ectoplasm Liqueur</a><br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30834-05.htm">Receive money</a><br>
<a action="bypass -h npc_%objectId%_multisell 7834">"I wish to exchange the orbs for useful items."</a><br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30834-07.htm">"I wish to continue collecting."</a><br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30834-06.htm">"I quit!"</a>
</body></html>
\ No newline at end of file
<html><body>Lich King Akron:<br>
Why are you still here? Is there something that you want of me?<br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30835-02.htm">Give him Ectoplasm Liqueur.</a><br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30835-04.htm">"Goodbye."</a></body></html>
\ No newline at end of file
<html><body>Lich King Akron:<br>Good bye, my little Magus!</body></html>
\ No newline at end of file
<html><body>Marsha:<br><msg><br><br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 1">Show scissors</a><br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 2">Show rock</a><br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 3">Show paper</a>
</body></html>
\ No newline at end of file
<html><body>Collector Marsha:<br>
Player:<font color="LEVEL"> %player%</font><br>
Collector Marsha:<font color="LEVEL">%marsha%</font><br>
%msg%<br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30934-03.htm">%again%</a><br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30934-02a.htm">Quit</a></body></html>
\ No newline at end of file
<html><body>Collector Trumpin:<br>
Do you care to play another round? As I said, I'm just trying to get rid of all the Nebulite Orbs I've collected so far. I know that your pride won't let you accept them for free, that's why I came up with this game.<br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30935-04.htm">"Tell me the rules of the game."</a><br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30935-02.htm">Play the game.</a><br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30935-05.htm">Quit</a></body></html>
\ No newline at end of file
<html><body>Trumpin:<br>
We will play a simple toin-cossing game - you choose head or tails, if you're right you win 10 orbs, if you're wrong you loose 10. If you get two right in a row, you will get 30 orbs!<br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30935-03.htm">"Ok I'm ready!"</a></body></html>
\ No newline at end of file
<html><body>Collector Trumpin:<br>
Wasn't that fun? Would you like to play again?<br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30935-02.htm">Play the coin-toss game.</a><br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30935-05.htm">Quit</a></body></html>
\ No newline at end of file
<html><body>Collector Trumpin:<br>
Here are your %nebulites% Nebulite Orbs!<br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30935-06.htm">Return</a></body></html>
\ No newline at end of file
<html><body>Collector Trumpin:<br>
Oops, sorry, you're wrong! It was %toss%!<font color="LEVEL"> You lose!</font> I'll take those 10 Nebulite Orbs. Better luck next time!<br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30935-06.htm">Return</a></body></html>
\ No newline at end of file
<html><body>Collector Trumpin:<br>
What's that? %toss%? Let's see~<br>
%msg1%<br>
<font color="LEVEL">%msg2%</font><br>
Do you want to stop playing the game and receive your %orbs% Nebulite Orbs or would you like to play the next round? If you win again you will receive %next% Nebulite Orbs.<br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower quit">Take %orbs% Nebulite Orbs.</a><br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30935-03.htm">Play the next round.</a></body></html>
\ No newline at end of file
# Made by mtrix - v0.2 by DrLecter
import sys
from com.l2jserver import Config
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 = "343_UnderTheShadowOfTheIvoryTower"
ORB = 4364
ECTOPLASM = 4365
ADENA = 57
CHANCE = 50
RANDOM_REWARDS=[[951,1], #Enchant Weapon C
[955,1], #Enchant Weapon D
[2511,550],#SpiritShot: Grade C
[736,1], #SoE
]
#Roshambo
OPTIONS={0:"Scissors",1:"Rock",2:"Paper"}
OUTCOME={0:1,1:2,2:0}
#Coin Toss
TOSS={0:"Heads",1:"Tails"}
ORBS=[10,30,70,150,310,0]
#Messages
start_msg=["One~ Two~ Three~","Go! One~ Two~ Three~","Ready? Go! One~ Two~ Three~","Here we go! One~ Two~ Three~"]
tie_msg=["Ah ha! A tie! Take back the orbs that you bet. Well, shall we play again?",\
"Ha! A tie! Take back the orbs that you bet. Shall we try again?"]
win_msg=["Well, you certainly got lucky that time! Take all the orbs we put up as a bet. Come on! Let's play another round!",\
"Oh no! I lose! Go ahead. Take all the orbs we put up as a bet. Come on! Let's play again!",\
"Oh no! I lose! Go ahead. Take all the orbs we put up as a bet. Humph... Come on! Let's play again!"]
lose_msg=["Oh, too bad. You lose! Shall we play another round?",\
"Oh...! You lose! Oh well, the orbs are mine. Shall we play another round?",\
"Oh, too bad, you lose! I'll take those orbs now... Hey now, shall we play another round?"]
again_msg=["Play the game.","Play the rock paper scissors game."]
toss_msg=[["You're right!","You win!"],\
["Hu wah! Right again!","You won twice in a row!"],\
["Hu wah! Right again!","You won three times in a row!"],\
["Ho ho! Right again!","You won four times in a row!"]]
class Quest (JQuest) :
def __init__(self,id,name,descr):
JQuest.__init__(self,id,name,descr)
self.questItemIds = [ORB]
def onEvent (self,event,st) :
htmltext = event
marsha = self.getRandom(3)
random2 = self.getRandom(2)
orbs = st.getQuestItemsCount(ORB)
if event == "30834-02.htm" :
st.setState(State.STARTED)
st.set("cond","1")
st.playSound("ItemSound.quest_accept")
elif event == "30834-05.htm" :
if orbs :
st.giveItems(ADENA,orbs*125)
st.takeItems(ORB,-1)
else :
htmltext = "30834-09.htm"
elif event == "30835-02.htm":
if st.getQuestItemsCount(ECTOPLASM) :
st.takeItems(ECTOPLASM,1)
item=RANDOM_REWARDS[self.getRandom(len(RANDOM_REWARDS))]
st.rewardItems(item[0],int(item[1]))
htmltext="30835-02a.htm"
elif event == "30934-02.htm" :
if orbs < 10 :
htmltext = "30934-03a.htm"
else:
st.set("rps_1sttime","1")
elif event == "30934-03.htm" :
if orbs>=10 :
st.takeItems(ORB,10)
st.set("playing","1")
htmltext = st.showHtmlFile("30934-03.htm").replace("<msg>", start_msg[self.getRandom(len(start_msg))])
else :
htmltext = "30934-03a.htm"
elif event in [ "1","2","3" ]:
if st.getInt("playing"):
player=int(event)-1
if OUTCOME[player] == marsha:
msg=lose_msg
elif OUTCOME[marsha] == player:
st.giveItems(ORB,20)
msg=win_msg
else:
st.giveItems(ORB,10)
msg=tie_msg
st.unset("playing")
htmltext = st.showHtmlFile("30934-04.htm").replace("%player%", OPTIONS[player]).\
replace("%marsha%", OPTIONS[marsha]).replace("%msg%", msg[self.getRandom(len(msg))]).\
replace("%again%", again_msg[self.getRandom(len(again_msg))])
else:
htmltext="Player is cheating"
st.takeItems(ORB,-1)
elif event == "30935-02.htm" :
if orbs < 10 :
htmltext = "30935-02a.htm"
else:
st.set("ct_1sttime","1")
elif event == "30935-03.htm" :
if orbs>=10 :
st.set("toss","1")
else :
st.unset("row")
htmltext = "30935-02a.htm"
elif event in ["4","5"] :
if st.getInt("toss"):
if orbs>=10:
if random2==int(event)-4 :
row = st.getInt("row")
if row<4 :
row += 1
template="30935-06d.htm"
else:
st.giveItems(ORB,310)
row=0
template="30935-06c.htm"
else :
row = 0
st.takeItems(ORB,10)
template="30935-06b.htm"
st.set("row",str(row))
htmltext = st.showHtmlFile(template).replace("%toss%",TOSS[random2]).\
replace("%msg1%",toss_msg[row-1][0]).replace("%msg2%",toss_msg[row-1][1]).\
replace("%orbs%",str(ORBS[row-1])).replace("%next%",str(ORBS[row]))
else:
st.unset("row")
htmltext = "30935-02a.htm"
st.unset("toss")
else:
st.takeItems(ORB,-1)
htmltext="Player is cheating"
elif event == "quit":
if st.getInt("row"):
qty=st.getInt("row")-1
st.giveItems(ORB,ORBS[qty])
st.unset("row")
htmltext = st.showHtmlFile("30935-06a.htm").replace("%nebulites%",str(ORBS[qty]))
else:
st.takeItems(ORB,-1)
htmltext="Player is cheating"
elif event in ["30834-06.htm","30834-02b.htm"] :
st.playSound("ItemSound.quest_finish")
st.exitQuest(1)
return htmltext
def onTalk (self,npc,player):
htmltext = Quest.getNoQuestMsg(player)
st = self.getQuestState(player, True)
if not st : return htmltext
npcId = npc.getId()
id = st.getState()
level = player.getLevel()
cond = st.getInt("cond")
if npcId==30834 :
if id == State.CREATED :
if player.getClassId().getId() in [ 0x11,0xc,0xd,0xe,0x10,0x1a,0x1b,0x1c,0x1e,0x28,0x29,0x2b,0x5e,0x5f,0x60,0x61,0x62,0x67,0x68,0x69,0x6e,0x6f,0x70]:
if level >= 40:
htmltext = "30834-01.htm"
else:
htmltext = "30834-01a.htm"
st.exitQuest(1)
else:
htmltext = "30834-01b.htm"
st.exitQuest(1)
elif cond==1 :
if st.getQuestItemsCount(ORB) :
htmltext = "30834-04.htm"
else :
htmltext = "30834-03.htm"
elif npcId==30835 :
htmltext = "30835-01.htm"
elif npcId==30934 :
if st.getInt("rps_1sttime") :
htmltext = "30934-01a.htm"
else :
htmltext = "30934-01.htm"
elif npcId==30935 :
st.unset("row")
if st.getInt("ct_1sttime") :
htmltext = "30935-01a.htm"
else :
htmltext = "30935-01.htm"
return htmltext
def onKill(self,npc,player,isPet):
st = self.getQuestState(player, False)
if not st : return
if st.getState() != State.STARTED : return
npcId = npc.getId()
if self.getRandom(100) < CHANCE :
st.giveItems(ORB,1)
st.playSound("ItemSound.quest_itemget")
return
QUEST = Quest(343,qn,"Under The Shadow Of The Ivory Tower")
QUEST.addStartNpc(30834)
QUEST.addTalkId(30834)
QUEST.addTalkId(30835)
QUEST.addTalkId(30935)
QUEST.addTalkId(30934)
for i in range(20563,20567) :
QUEST.addKillId(i)
\ No newline at end of file
<html><body>Magic Trader Cema:<br> <html><body>Magic Trader Cema:<br>
We need someone to gather materials for a research project that is being conducted at Hardin's Academy. It is imperative that this person be cognizant of the forces of magic. If you know a well-trained Mystic, send him to me.<br> We need someone to gather materials for a research project that is being conducted at Hardin's Academy. It is imperative that this person be cognizant of the forces of magic. If you know a well-trained Mystic, send him to me.<br>
(This quest can only be undertaken by non-orc Mystics level 40 or higher.)</body></html> (This quest can only be undertaken by non-Orc Mystics level 40 or higher.)
\ No newline at end of file </body></html>
\ No newline at end of file
<html><body>Magic Trader Cema:<br> <html><body>Magic Trader Cema:<br>
This job is too much for you. It is far too dangerous for one of your skill level.<br> This job is too much for you. It is far too dangerous for one of your skill level.<br>
(This quest can only be undertaken by a Mystic of level 40 or higher.)</body></html> (This quest can only be undertaken by a Mystic of level 40 or higher.)
\ No newline at end of file </body></html>
<html><body>Magic Trader Cema:<br> <html><body>Magic Trader Cema:<br>
Have you heard of nebulite? It is a mineral often found in meteorites. Processed properly, even a tiny amount can produce tremendous energy. It is quite valuable to those who seek to amplify magical power.<br> Have you heard of Nebulite? It is a mineral often found in meteorites. Processed properly, even a tiny amount can produce tremendous energy. It is quite valuable to those who seek to amplify magical power.<br>
The Dwarves say that nebulite was used by the Titans as their primary source of energy. At that time the mineral was abundant, but the expansion of the titan civilization exhausted most of the precious material. Nowadays it is quite rare, and can only be found in a few places...<br> The Dwarves say that Nebulite was used by the Titans as their primary source of energy. At that time the mineral was abundant, but the expansion of the titan civilization exhausted most of the precious material. Nowadays it is quite rare, and can only be found in a few places...<br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30834-02a.htm">"Where can nebulite be found?"</a> <a action="bypass -h Quest Q00343_UnderTheShadowOfTheIvoryTower 30834-04.htm">"Where can Nebulite be found?"</a>
</body></html> </body></html>
\ No newline at end of file
<html><body>Magic Trader Cema:<br> <html><body>Magic Trader Cema:<br>
It is well-known that the crater of the Ivory Tower was created by a gigantic meteorite... However, not many know that the meteorite was composed almost entirely of nebulite, and is currently locked away in the basement of the tower! Those in the Ivory Tower want to keep all the nebulite for themselves!<br> It is well-known that the crater of the Ivory Tower was created by a gigantic meteorite... However, not many know that the meteorite was composed almost entirely of Nebulite, and is currently locked away in the basement of the tower! Those in the Ivory Tower want to keep all the Nebulite for themselves!<br>
Does this seem fair? Should the source of the most powerful magical power on earth be monopolized by a few privileged groups? I think not! That nebulite should be used for the greater public good! Don't you agree?<br> Does this seem fair? Should the source of the most powerful magical power on earth be monopolized by a few privileged groups? I think not! That Nebulite should be used for the greater public good! Don't you agree?<br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30834-02.htm">"I agree"</a><br> <a action="bypass -h Quest Q00343_UnderTheShadowOfTheIvoryTower 30834-05.htm">"I agree."</a><br>
<a action="bypass -h Quest 343_UnderTheShadowOfTheIvoryTower 30834-02b.htm">"I disaagree"</a> <a action="bypass -h Quest Q00343_UnderTheShadowOfTheIvoryTower 30834-04a.html">"I disagree."</a>
</body></html> </body></html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment