i translated marriage_manage.quest and put it back to hongkong/quest in filezilla
but when i made make.sh i got this error:
syntax error : [string "startpc . is_married ()"]:24 ')' expected (to close "(" at line 23( near 'local'
Any idea why?
PHP Code:
quest marriage_manage begin
state start begin
when oldwoman.chat."I want to get married" with not pc.is_engaged_or_married() begin
if not npc.lock() then
say("Good day")
say("You want to get married?")
return
end
if pc.level < 25 then
say("Unfortunately I have bad news..")
say("It looks like you can't")
say("get married before you")
say("reach level 25.")
say("")
say_reward("Come back when you've reached level 25.")
say("")
npc.unlock()
return
end
local m_ring_num = pc.countitem(70301)
local m_has_ring = m_ring_num > 0
if not m_has_ring then
say("You need to have a special item to get married.")
say("")
say_item("You need a", 70301, "")
say_reward("Come back when you have an engagement ring.")
say("")
npc.unlock()
return
end
local m_sex = pc.get_sex()
if not marriage_manage.is_equip_wedding_dress() then
say("You can;t get married now." )
say("You have to wear the necessary clothing to get married.")
say("")
if m_sex==0 then
say_item("Clothing", marriage_manage.get_wedding_dress(pc.get_job()), "")
say_reward("Well...")
say_reward("One of you has no wedding dress")
else
say_item("Clothing", marriage_manage.get_wedding_dress(pc.get_job()), "")
say_reward("Well...")
say_reward("One of you has no wedding dress.")
end
say("")
npc.unlock()
return
end
local NEED_MONEY = 1000000
if pc.get_money() < NEED_MONEY then
say("Well...")
say("It seems that you don't have")
say("enough gold to get married.")
say("Come back when you have 1.000.000 Gold.")
say("")
say_reward(string.format("??ˇÓB?O????*n %d?U??", NEED_MONEY/10000))
say("")
npc.unlock()
return
end
say("Old Lady:")
say("Now you have enough level")
say("to get married")
say("Who do you want to marry?")
say("")
say_reward("Bitte gib den Namen ein:")
local sname = input()
if sname == "" then
say("Old Lady:")
say("You must have no fear")
say("of getting married.")
say("Come back when you've")
say("made the right decision.")
say("")
npc.unlock()
return
end
local u_vid = find_pc_by_name(sname)
local m_vid = pc.get_vid()
if u_vid == 0 then
say("Old Lady:")
say("Do you know the name?")
say("Well, come back when you")
say("know the correct name.")
say("")
say_reward(string.format("%s similar name as", sname))
say("")
npc.unlock()
return
end
if not npc.is_near_vid(u_vid, 10) then
say("Old Lady:")
say("The person who you want to")
say("marry also should be here.")
say("Find the person and")
say("then come back both here.")
say("" )
say_reward(string.format("%s is the distance to", sname))
say("")
npc.unlock()
return
end
local old = pc.select(u_vid)
local u_level = pc.get_level()
local u_job = pc.get_job()
local u_sex = pc.get_sex()
local u_name = pc.name
local u_gold = pc.get_money()
local u_married = pc.is_married()
local u_has_ring = pc.countitem(70301) > 0
local u_wear = marriage_manage.is_equip_wedding_dress()
pc.select(old)
local m_level = pc.get_level()
if u_vid == m_vid then
say("Old Lady:")
say("That's your own name.")
say("")
say_reward("You cannot marry yourself.")
say("")
npc.unlock()
return
end
if u_sex == m_sex then
say("Old Lady:")
say("I'm sorry but")
say("you can't marry someone")
say("of the same sex as you.")
say("")
say_reward("No same-sex marriage possible.")
say("")
npc.unlock()
return
end
if u_married then
say("Old Lady:")
say("Did you know that the")
say("person is still married?")
say("You should not be too hasty.")
say("" )
say_reward(string.format("%s been married", sname))
say("")
npc.unlock()
return
end
if u_level < 25 then
say("Old Lady:")
say("The person hasn't passed the level.")
say("requirement to marry.")
say("")
say_reward("Ths person needs to reach")
say_reward("level 25 before he can marry")
say("")
npc.unlock()
return
end
if m_level - u_level > 15 or u_level - m_level > 15 then
say("Old Lady:")
say("Your level difference is too high.")
say("")
say_reward("Characters with more than 15 levels")
say_reward("difference can not marry")
say("")
npc.unlock()
return
end
if not u_has_ring then
if m_ring_num >= 2 then
say("Old Lady:")
say("To get married you need")
say("a sign of love.")
say("Come back when")
say("you have one.")
else
say("Old Lady:")
say("Remember to wear a")
say("sign of love.")
say("")
end
say_item("As a sign of love, use .", 70301, "")
say_reward("The other person must also")
say_reward("have a sign of love.")
say("")
npc.unlock()
return
end
if not u_wear then
say ("Old Lady:")
say ("You have no wedding clothes.")
say ("It would be embarrassing to")
say ("marry with an armor.")
say ("Come back when you've")
say ("dressed appropriately.")
say("")
if u_sex==0 then
say_item("Clothing", marriage_manage.get_wedding_dress(u_job), "")
say_reward("To get marriedm you need to")
say_reward("wear these clothes.")
else
say_item("Clothing", marriage_manage.get_wedding_dress(u_job), "")
say_reward("To get married, you need to")
say_reward("wear a wedding dress.")
end
say("")
npc.unlock()
return
end
local ok_sign = confirm( u_vid, "Willst du"..pc.name.. "heiraten?", 30)
if ok_sign == CONFIRM_OK then
local m_name = pc.name
if pc.get_gold()>=NEED_MONEY then
pc.change_gold(-NEED_MONEY)
pc.removeitem(70301, 1)
pc.give_item2(70302, 1)
local old = pc.select(u_vid)
pc.removeitem(70301, 1)
pc.give_item2(70302, 1)
pc.select(old)
say("Old Lady:")
say("We are now ready to organize")
say("the wedding.")
say("To express my love for you I'm talking")
say("to you now from the Blessing.")
say("The wedding will take place on")
say("The island of love.")
say("")
say_reward("I send you now to the")
say_reward("island of love.")
say("")
wait()
setskin(NOWINDOW)
marriage.engage_to(u_vid)
end
else
say("Old Lady:")
say("Your partner wants to marry you.")
say("A conversation will certainly")
say("help you.")
say("")
say_reward("Your partener refused")
say_reward("to marry.")
end
say("")
npc.unlock()
end
-- ?? ???? ???? ??? ??
when oldwoman.chat."The wedding" with pc.is_engaged() begin
say("Well...")
say("Your spouse is not")
say("in your realm!!!")
say("")
wait()
setskin(NOWINDOW)
marriage.warp_to_my_marriage_map()
end
when 9011.chat."Ehe anerkennen" with pc.is_engaged() and marriage.in_my_wedding() begin
if not npc.lock() then
say("Well..")
say("Your spouse is already married")
say("or is not in your realm!!!")
say("")
return
end
say("Sofern der Partner")
say("in einem anderen Reich ist,")
say("kann er es jederzeit ueber das Item")
say("kann er es jederzeit ueber das Item.")
say("Eine Scheidung kann den Ehepartner loesen.")
local sname = input()
local u_vid = find_pc_by_name(sname)
local m_vid = pc.get_vid()
if u_vid == 0 then
say("You are too weak to")
say("get married with")
say("your partener.")
say("")
say_reward(string.format("%s parallel to", sname))
say("")
npc.unlock()
return
end
if not npc.is_near_vid(u_vid, 10) then
say("Well..")
say("It's not possible to marry without")
say("both you being near")
say("")
say("")
say_reward(string.format("%s You have to move to", sname))
say("")
npc.unlock()
return
end
if u_vid == m_vid then
say("Well...")
say("Your sex is the same.")
say("")
say_reward("You have to change your gender.")
say("")
npc.unlock()
return
end
if u_vid != marriage.find_married_vid() then
say("Well...")
say("Your spouse is not ")
say("in the same map!")
say("")
npc.unlock()
return
end
local ok_sign = confirm(u_vid, "Will you marry "..pc.name.. " ??", 30)
if ok_sign != CONFIRM_OK then
say("Well...")
say("You want to get married,")
say("So it shall be!")
say("")
npc.unlock()
return
end
say("Take with you this")
say("wedding ring")
say("")
marriage.set_to_marriage()
-- 2005.04.12.??? ?? ?? ??
-----------------------------------------------
-- say("Here you have it!")
-- say("I wish you much success.")
-- marriage_manage.give_wedding_gift()
-- old = pc.select(u_vid)
-- marriage_manage.give_wedding_gift()
-- pc.select(old)
say("")
say_reward("You have received a wedding ring.")
say("")
npc.unlock()
end
function give_wedding_gift()
local male_item = {71072, 71073, 71074}
local female_item = {71069, 71070, 71071}
if pc.get_sex() == MALE then
pc.give_item2(male_item[number(1, 3)], 1)
else
pc.give_item2(female_item[number(1, 3)], 1)
end
end
-- ??? ???? ?? ????? ?? ??
-- ?? pc.is_married() and marriage.in_my_wedding()
-- ??? ?? ??? ??? ?? ????
when 9011.chat."Wedding music launch" with
(pc.is_engaged() or pc.is_married()) and
marriage.in_my_wedding() and
not marriage.wedding_is_playing_music() begin
marriage.wedding_music(true, "wedding.mp3")
setskin(NOWINDOW)
end
when 9011.chat." Wedding music stop" with
(pc.is_engaged() or pc.is_married()) and
marriage.in_my_wedding() and
marriage.wedding_is_playing_music() begin
marriage.wedding_music(false, "default")
setskin(NOWINDOW)
end
when 9011.chat."Change time of day to night" with
pc.is_married() and
marriage.in_my_wedding() begin
marriage.wedding_dark(true)
setskin(NOWINDOW)
end
when 9011.chat."Snowfall start" with pc.is_married() and marriage.in_my_wedding() begin
marriage.wedding_snow(true)
setskin(NOWINDOW)
end
when 9011.chat."Wedding quit" with pc.is_married() and marriage.in_my_wedding() begin
if not npc.lock() then
say("Wedding Planner:")
say("Want to stop the wedding now?")
say("")
return
end
say("Wedding Planner:")
say("Do you really want to end the festival?")
say("")
local s = select("Yes","No")
if s == 1 then
local u_vid = marriage.find_married_vid()
if u_vid == 0 then
say("To stop the wedding, your")
say("partner must agree too")
say("Now that your partner is not here,")
say("I can't stop the wedding")
say("")
npc.unlock()
return
end
say("Wedding Planner:")
say("To end the marriage, your")
say("partner must agree.")
say("I'm waiting for the answer...")
say("")
local ok_sign = confirm(u_vid, "Want to stop the wedding?", 30)
if ok_sign == CONFIRM_OK then
marriage.end_wedding() -- ??? ???? ??? ??.
else
say("Wedding Quit:")
say("The other person does not agree")
say("")
end
end
npc.unlock()
end
-- ??? ???? ???? ??? ??
when 11000.chat."File for divorce" or
11002.chat." File for divorce" or
11004.chat." File for divorce" with pc.is_married() begin
if not marriage_manage.check_divorce_time() then
return
end
local u_vid = marriage.find_married_vid()
if u_vid == 0 or not npc.is_near_vid(u_vid, 10) then
say("Watchman of the village:")
say("Divorce is a very serious matter!")
say("If you want a divorce,")
say("your partner must be present.")
say("")
return
end
say("Watchman of the village:")
say("The divorce will cost 500.000 Gold")
say("In addition, the other")
say("person must agree.")
say("Do you want to divorce?")
say("")
local MONEY_NEED_FOR_ONE = 500000
local s = select("Yes", "No")
if s == 1 then
local m_enough_money = pc.gold > MONEY_NEED_FOR_ONE
local m_have_ring = pc.countitem(70302) > 0
local old = pc.select(u_vid)
local u_enough_money = pc.gold > MONEY_NEED_FOR_ONE
local u_have_ring = pc.countitem(70302) > 0
pc.select(old)
if not m_have_ring then
say("You have to bring the wedding ring.")
return;
end
if not u_have_ring then
say("The other person must also")
say("bring the wedding ring.")
return;
end
if not m_enough_money then
say("Watchman of the village:")
say("You do not have enough gold to divorce.")
say("")
say_reward(string.format("Divorce costs %dvon", MONEY_NEED_FOR_ONE/10000))
say("")
return;
end
if not u_enough_money then
say("Watchman of the village:")
say("The other person does not have enough Gold.")
say("")
say_reward("You both have to pay 500.000 Gold")
say_reward("to be able to get divorced.")
say("")
return;
end
say("Divorce is a really painful")
say("thing. Do you really want")
say("to divorce?")
say("")
local c=select("Yes", "No")
if 2 == c then
say_pc_name()
say("I want a divorce, that's")
say("my decision.")
say("")
wait()
say("Watchman of the village:")
say("You are two people who do not want")
say("to stay together, you want to")
say("enjoy your lives.")
say("")
say_reward("Ill end the marriage with a divorce.")
say("")
return
end
local ok_sign = confirm(u_vid, pc.name.." Do you want a divorce?", 30)
if ok_sign == CONFIRM_OK then
local m_enough_money = pc.gold > MONEY_NEED_FOR_ONE
local m_have_ring = pc.countitem(70302) > 0
local old = pc.select(u_vid)
local u_enough_money = pc.gold > MONEY_NEED_FOR_ONE
local u_have_ring = pc.countitem(70302) > 0
pc.select(old)
if m_have_ring and m_enough_money and u_have_ring and u_enough_money then
pc.removeitem(70302, 1)
pc.change_money(-MONEY_NEED_FOR_ONE)
local old = pc.select(u_vid)
pc.removeitem(70302, 1)
pc.change_money(-MONEY_NEED_FOR_ONE)
pc.select(old)
say("Watchman of the village:")
say("The divorce was successful.")
say("You are two different people,")
say("and that cannot be changed")
say("")
say_reward("Divorce completed successfully!")
say("")
marriage.remove()
else
say("Watchman of the village:")
say("An error has occured.")
say("I could not divorce you.")
say("Try again later.")
say("")
say_reward("Divorce failed.")
say("")
end
else
say("Watchman of the village:")
say("The other person does not agree.")
say("It is best to talk about")
say("this matter.")
say("")
say_reward("The divorce was aborted.")
say("")
end
end
end
when 11000.chat."Submit wedding ring" or
11002.chat." Submit wedding ring" or
11004.chat." Submit wedding ring" with
not pc.is_married() and
pc.count_item(70302)>0
begin
say("Watchman of the village:")
say("You will quickly forget")
say("the bad memories.")
say("")
say_reward("The wedding ring was successfully removed.")
pc.remove_item(70302)
end
when 11000.chat." One side divorce" or
11002.chat." One side divorce" or
11004.chat." One side divorce" with pc.is_married() begin
if not marriage_manage.check_divorce_time() then
return
end
say("Watchman of the village:")
say("The one-side divorce will cost you 1.000.000 Gold")
say("Do you want to continue?")
say("")
local s = select("Yes", "This is too much for me.")
local NEED_MONEY = 1000000
if s == 2 then
return
end
if pc.money < NEED_MONEY then
say("Watchman of the village:")
say("You don't have enough gold.")
say("Divorce is expensive.")
say("Come back when you've saved enough.")
say("")
return
end
say("Watchman of the village:")
say("Do you really want a divorce")
say("Have you considered it well?"
local c = select("I want a divorce!", "Nevermind.")
if c == 2 then
say("Watchman of the village:")
say("This is the right decision.")
say("Enjoy your life.")
say("Not always both have the same opinions.")
say("")
say_reward("The divorce was aborted.")
say("")
return
end
pc.removeitem(70302, 1)
pc.change_gold(-NEED_MONEY)
marriage.remove()
say("Watchman of the village:")
say("Since you have not understood my advice,")
say("you are now divorced.")
say("I hope you're happy now.")
say("")
say_reward("The one-side divorce was successful.")
say("")
end
-- ??? ?? ??
when oldwoman.chat."Liste der Hochzeiten" with not pc.is_engaged() begin
local t = marriage.get_wedding_list()
if table.getn(t) == 0 then
say("Theres no weddings at the moment.")
say("")
else
-- chat(table.getn(t))
local wedding_names = {}
table.foreachi(t, function(n, p) wedding_names[n] = p[3].."and "..p[4].." wedding" end)
wedding_names[table.getn(t)+1] = locale.confirm
local s = select_table(wedding_names)
if s != table.getn(wedding_names) then
marriage.join_wedding(t[s][1], t[s][2])
end
end
end
when 9011.click with not pc.is_engaged() and not pc.is_married() begin
say("Wedding Planner:")
say("We all came here to celebrate ")
say("this wedding.")
say("Hope you enjoy and may the couple be blessed.")
say("")
end
function check_divorce_time()
local DIVORCE_LIMIT_TIME = 86400
if is_test_server() then
DIVORCE_LIMIT_TIME = 60
end
if marriage.get_married_time() < DIVORCE_LIMIT_TIME then
say("Wedding Planner:")
say("Now enough is celebrated!")
say("All out of here!")
say("")
return false
end
return true
end
-- ?? ??? ?? ???? ??? ??
-- ?? ?? : pc.is_engaged_or_married()
function is_equip_wedding_dress()
local a = pc.get_armor()
return a >= 11901 and a <= 11904
end
function get_wedding_dress(pc_job)
if 0==pc_job then
return 11901
elseif 1==pc_job then
return 11903
elseif 2==pc_job then
return 11902
elseif 3==pc_job then
return 11904
else
return 0;
end
end
end
end