Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- quest fortune_telling begin
- state start begin
- when oldwoman.chat."I heard, you are a fortune teller." begin
- if pc.level<=20 then
- say_title("Old Woman:")
- say("")
- say("Your face tells me, that you are not living for")
- say("too long. Why do you want to know your destiny")
- say("? So you have any problems? Your destiny needs")
- say("a lot of training. Return later on.")
- say("")
- say("")
- return
- end
- if get_time()-pc.getqf("time") < 8*60*60 then
- local passed_time = get_time() - pc.getqf("time")
- say_title("Old Woman:")
- say("")
- say("Do you really want to live your life, like the")
- say("fortune teller told you? You should not take the")
- say("predictions seriously. The really important")
- say("things are your attitudes and mine. If both are")
- say("positive, nothing goes wrong. If you still want")
- say("to know your fortune return tomorrow.")
- say("")
- say("")
- say("")
- wait()
- local idx = pc.getqf("idx")
- if idx!=0 then
- say_title("Old Woman:")
- say("")
- say("Information: Your prediction says:")
- say("")
- say(locale.fortune_words[idx][1])
- wait()
- if pc.getqf("talisman") == 0 and special.fortune_telling[idx][5] > 0 then
- local talisman_cost = special.fortune_telling[idx][5]
- wait()
- say_title("Old Woman:")
- say("")
- say("You will be unlucky and you have not bought")
- say("the talisman against the evil yet..")
- say("Are you interested in buying my talisman of")
- say("opulence?")
- say("")
- local s = select("Yes, I want to buy it.","No, thanks.")
- if s == 1 then
- if pc.gold < talisman_cost then
- say_title("Old Woman:")
- say("")
- say("I may be friendly, but I can not sell it for free.")
- say("If you want to avoid bad luck and infelicity,")
- say("you will pay the price, the talisman is worth.")
- say("")
- say("")
- pc.setqf("talisman", 0)
- else
- pc.give_item2(70052,1)
- pc.changegold(-talisman_cost)
- pc.setqf("talisman", 1)
- end
- else
- end
- end
- end
- end
- local gold = 7777
- say_title("Old Woman:")
- say("")
- say("You are too young for breathing so deeply!")
- say("Do you want to know your fortune? Told by a ")
- say("harmonic and mysterious force.")
- say("")
- local s = select("Tell me the fortune", "Don't tell me the fortune")
- if s == 2 then
- say_title("Old Woman:")
- say("")
- say("Right.")
- say("That is right, follow your own path and try to")
- say("do your best is important. Good luck.")
- say("")
- return
- end
- local n = number(1, 10000)
- local i
- local idx
- for i = 1, table.getn(special.fortune_telling) do
- if n<=special.fortune_telling[i][1] then
- idx = i
- break
- else
- n = n - special.fortune_telling[i][1]
- end
- end
- i = idx
- say(locale.fortune_words[i][2])
- local t = {}
- n = 0
- local j
- for j = 2,4 do
- if special.fortune_telling[i][j] != 0 then
- n=n+1
- t[n] = j
- end
- end
- if n > 0 then
- n = number(1, n)
- __give_char_priv(t[n]-1, special.fortune_telling[i][t[n]])
- end
- pc.setqf("time", get_time())
- pc.setqf("idx", i)
- if special.fortune_telling[i][5]>0 then
- wait()
- say(locale.fortune_words[i][3])
- local talisman_cost = special.fortune_telling[i][5]
- local s = select("Yes, I would like one.","No, thanks.")
- if s == 1 then
- if pc.gold < talisman_cost then
- say("I may be friendly, but I cannot sell it for free.")
- say("If you want to avoid bad luck and infelicity,")
- say("you will pay the price, the talisman is worth.")
- say("")
- say("")
- say("It costs"..gold.." Yang.")
- say("")
- pc.setqf("talisman", 0)
- else
- pc.give_item2(70052,1)
- pc.changegold(-talisman_cost)
- pc.setqf("talisman", 1)
- end
- elseif s == 2 then
- say_title("Old Woman:")
- say("")
- say("You are going? Perhaps you are right. Bad luck and")
- say("sorrow are part of the life. Be careful and")
- say("farewell. If you change your mind, come back")
- say("to me.")
- say("")
- pc.setqf("talisman", 0)
- end
- end
- end -- end_of_when
- end -- end_of_state
- end -- end_of_quest
Advertisement
Add Comment
Please, Sign In to add comment