# Created by Kerberos
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 = "1001_FortuneTelling"

BODY = "<html><body>占い師 ミネ:<br>汝に近づく影．．．私のビジョンを言葉で表現するには限界がある。<br>しかし、これが最もふさわしい答えになるだろう。この言葉を覚えておけ。<br><br><center>"
#BODY = "<html><body>Fortune-Teller Mine:<br>I see an image approaching before you... It is difficult to put what I saw into words.<br>How can I say this? Okay, listen closely:<br><br><center>"
END = "</center><br><br>だ．．．これが意味するところをよく考えてみることだ．．．"
#END = "</center><br><br>Take these words to heart. You should seriously consider the meaning...</body></html>"
FORTUNE = [ \
	"人間関係にひびが入る。", \
	"周りの人々に当り散らせば人間関係にひびが入る。", \
	"些細な誤解が争いにつながる。", \
	"自分のやり方を押し付けずに協力すれば一挙両得だ。", \
	"邪魔が多くて悩まされる。", \
	"仕掛けておいた餌に魚が食いつく。", \
	# ここから下は<ことわざ>をランダムに並べただけです [JOJO]
	"聞いて極楽見て地獄。", \
	"好事魔多し。", \
	"好きこそ物の上手なれ。", \
	"血で血を洗う。", \
	"所変われば品変わる。", \
	"花より団子。", \
	"闇夜の鉄砲。", \
	"医者の不養生。", \
	"牛に引かれて善光寺参り。", \
	"鬼の居ぬ間の洗濯。", \
	"苦しいときの神頼み。", \
	"壁に耳。", \
	"酒は百薬の長。", \
	"重箱の隅を楊枝でほじくる。", \
	"精神一到何事か成らざらん。", \
	"雉も鳴かずば撃たれまい。", \
	"君子危うきに近寄らず。", \
	"敵は本能寺にあり。", \
	"青は藍より出でて藍よりも青し。", \
	"石が流れて木の葉が沈む。", \
	"犬も歩けば棒に当たる。", \
	"馬の耳に念仏馬の耳に念仏。", \
	"雨降って地固まる。", \
	"律義者の子沢山。", \
	"先んずれば人を制す。", \
	"死人に口なし。", \
	"大欲は無欲に似たり。", \
	"時は金なり。", \
	"多芸は無芸。", \
	"善は急げ。", \
	"知らぬが仏。", \
	"転ばぬ先の杖。", \
	"君子は豹変する。", \
	"果報は寝て待て。", \
	"鬼の念仏。", \
	"魚心あれば水心。", \
	"石橋を叩いて渡る。", \
	"会うは別れの始め。", \
	"嘘も方便。", \
	]
	# ここまで (合計45個)
#	"What you\'ve endured will return as a benefit.", \
#	"The dragon now acquires an eagle\'s wings.", \
#	"Be warned as you may be overwhelmed by surroundings if you lack a clear opinion.", \
#	"A new trial or start may be successful as luck shadows changes.", \
#	"You may feel nervous and anxious because of unfavorable situations.", \
#	"You may meet the person you\'ve longed to see.", \
#	"You may meet many new people but it will be difficult to find a perfect person who wins your heart.", \
#	"Good fortune and opportunity may lie ahead as if one's born in a golden spoon.", \
#	"Be confident and act tenaciously at all times. You may be able to accomplish to perfection during somewhat unstable situations.", \
#	"There may be an occasion where you are consoled by people.", \
#	"Be independent at all times.", \
#	"Do not loosen up with your precautions.", \
#	"Closely observe people who pass by since you may meet a precious person who can help you.", \
#	"Listen to the advice that's given to you with a humble attitude.", \
#	"Focus on networking with like-minded people. They may join you for a big mission in the future.", \
#	"Staying busy rather than being stationary will help.", \
#	"You may lose your drive and feel lost.", \
#	"People around you will encourage your every task in the future.", \
#	"Be kind to and care for those close to you, they may help in the future.", \
#	"Your ambition and dream will come true.", \
#	"Your value will shine as your potential is finally realized.", \
#	"If you keep smiling without despair, people will come to trust you and offer help.", \
#	"There may be a little loss, but think of it as an investment for yourself.", \
#	"The difficult situations will turn to hope with unforeseen help.", \
#	"Impatience may lie ahead as the situation is unfavorable.", \
#	"Be responsible with your tasks but do not hesitate to ask for colleagues\' help.", \
#	"You may fall in danger each time when acting upon improvisation.", \
#	"A determined act after prepared research will attract people.", \
#	"A rest will promise a bigger development.", \
#	"You will be rewarded for your efforts and accomplishments.", \
#	"There are many things to consider after encountering hindrances.", \
#	"Consider other\'s situations and treat them sincerely at all times.", \
#	"A comparison to others may be helpful.", \
#	"Be cautious to control emotions as temptations are nearby.", \
#	"Momentarily delay an important decision.", \
#	"Be confident and act tenaciously at all times. You may be able to accomplish to perfection during somewhat unstable situations.", \
#	"Visiting a place you\'ve never been before may bring luck.", \
#	"What used to be well managed may stumble one after another.", \
#	"Your steady pursuit of new information and staying ahead of others will raise your value.", \
#	"Being neutral is a good way to go, but clarity may be helpful contrary to your hesitance.", \
#	"Skillful evasion is needed when dealing with people who pick fights as a disaster may arise from it.", \
#	"Small things make up big things so even value trivial matters.", \
#	"Bigger mistakes will be on the road if you fail to correct a small mistake.", \
#	"Momentarily delay an important decision.", \
#	"A remedy is on its way for a serious illness."]

class Quest (JQuest) :

 def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

 def onTalk (Self,npc,player):
    st = player.getQuestState(qn)
    if not st: return
    if st.getQuestItemsCount(57) < 1000 :
      htmltext="lowadena.htm"
    else :
      st.takeItems(57,1000)
      st.getRandom(45)
      htmltext=BODY+FORTUNE[st.getRandom(45)]+END
    st.exitQuest(1)
    return htmltext

QUEST       = Quest(-1,qn,"Custom")

QUEST.addStartNpc(32616)
QUEST.addTalkId(32616)