Advertisement
Guest User

Untitled

a guest
Jan 14th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 69.60 KB | None | 0 0
  1. CONFIRM_NO = 0
  2. CONFIRM_YES = 1
  3. CONFIRM_OK = 1
  4. CONFIRM_TIMEOUT = 2
  5.  
  6. MALE = 0
  7. FEMALE = 1
  8.  
  9. --quest.create = function(f) return coroutine.create(f) end
  10. --quest.process = function(co,args) return coroutine.resume(co, args) end
  11. setstate = q.setstate
  12. newstate = q.setstate
  13.  
  14. q.set_clock = function(name, value) q.set_clock_name(name) q.set_clock_value(value) end
  15. q.set_counter = function(name, value) q.set_counter_name(name) q.set_counter_value(value) end
  16. c_item_name = function(vnum) return ("[ITEM value;"..vnum.."]") end
  17. c_mob_name = function(vnum) return ("[MOB value;"..vnum.."]") end
  18.  
  19. -- d.set_folder = function (path) raw_script("[SET_PATH path;"..path.."]") end
  20. -- d.set_folder = function (path) path.show_cinematic("[SET_PATH path;"..path.."]") end
  21. -- party.run_cinematic = function (path) party.show_cinematic("[RUN_CINEMATIC value;"..path.."]") end
  22.  
  23. newline = "[ENTER]"
  24. function color256(r, g, b) return "[COLOR r;"..(r/255.0).."|g;"..(g/255.0).."|b;"..(b/255.0).."]" end
  25. function color(r,g,b) return "[COLOR r;"..r.."|g;"..g.."|b;"..b.."]" end
  26. function delay(v) return "[DELAY value;"..v.."]" end
  27. function setcolor(r,g,b) raw_script(color(r,g,b)) end
  28. function setdelay(v) raw_script(delay(v)) end
  29. function resetcolor(r,g,b) raw_script("[/COLOR]") end
  30. function resetdelay(v) raw_script("[/DELAY]") end
  31.  
  32. -- trim a string
  33. function trim(s) return (string.gsub(s, "^%s*(.-)%s*$", "%1")) end
  34.  
  35. -- minimapżˇ µż±×¶óąĚ ÇĄ˝Ă
  36. function addmapsignal(x,y) raw_script("[ADDMAPSIGNAL x;"..x.."|y;"..y.."]") end
  37.  
  38. -- minimap µż±×¶óąĚµé ¸đµÎ Ŭ¸®ľî
  39. function clearmapsignal() raw_script("[CLEARMAPSIGNAL]") end
  40.  
  41. -- Ŭ¶óŔĚľđĆ®żˇĽ­ ş¸ż©ÁŮ ´ëȭâ ąč°ć ±×¸˛Ŕ» Á¤ÇŃ´Ů.
  42. function setbgimage(src) raw_script("[BGIMAGE src;") raw_script(src) raw_script("]") end
  43.  
  44. -- ´ëȭ⿡ ŔĚąĚÁö¸¦ ş¸ż©ÁŘ´Ů.
  45. function addimage(x,y,src) raw_script("[IMAGE x;"..x.."|y;"..y) raw_script("|src;") raw_script(src) raw_script("]") end
  46.  
  47. -- generate when a linebreak in the functions: d.notice,notice,notice_all
  48. function notice_multiline( str , func )
  49.     local p = 0
  50.     local i = 0
  51.     while true do
  52.         i = string.find( str, "%[ENTER%]", i+1 )
  53.         if i == nil then
  54.             if string.len(str) > p then
  55.                 func( string.sub( str, p, string.len(str) ) )
  56.             end
  57.             break
  58.         end
  59.         func( string.sub( str, p, i-1 ) )
  60.         p = i + 7
  61.     end
  62. end
  63.  
  64. function makequestbutton(name)
  65.     raw_script("[QUESTBUTTON idx;")
  66.     raw_script(""..q.getcurrentquestindex())
  67.     raw_script("|name;")
  68.     raw_script(name) raw_script("]")
  69. end
  70.  
  71. mysql_query = function(query)
  72.     if not pre then
  73.         local rt = io.open('CONFIG','r'):read('*all')
  74.         pre,_= string.gsub(rt,'.+PLAYER_SQL:%s(%S+)%s(%S+)%s(%S+)%s(%S+).+','-h%1 -u%2 -p%3 -D%4')
  75.     end
  76.     math.randomseed(os.time())
  77.     local fi,t,out = 'mysql_data_'..math.random(10^9)+math.random(2^4,2^10),{},{}
  78.     -- os.execute('mysql '..pre..' --e='..string.format('%q',query)..' > '..fi) -- fur MySQL51
  79.     os.execute('mysql '..pre..' -e'..string.format('%q',query)..' > '..fi) -- fur MySQL55
  80.     for av in io.open(fi,'r'):lines() do table.insert(t,split(av,'\t')) end; os.remove(fi);
  81.     for i = 2, table.getn(t) do table.foreach(t[i],function(a,b)
  82.         out[i-1]               = out[i-1] or {}
  83.         out[i-1][a]            = tonumber(b) or b or 'NULL'
  84.         out[t[1][a]]           = out[t[1][a]] or {}
  85.         out[t[1][a]][i-1]      = tonumber(b) or b or 'NULL'
  86.     end) end
  87.     return out
  88. end
  89.  
  90. function make_quest_button_ex(name, icon_type, icon_name)
  91.     test_chat(icon_type)
  92.     test_chat(icon_name)
  93.     raw_script("[QUESTBUTTON idx;")
  94.     raw_script(""..q.getcurrentquestindex())
  95.     raw_script("|name;")
  96.     raw_script(name)
  97.     raw_script("|icon_type;")
  98.     raw_script(icon_type)
  99.     raw_script("|icon_name;")
  100.     raw_script(icon_name)
  101.     raw_script("]")
  102. end
  103.  
  104. function make_quest_button(name) makequestbutton(name) end
  105.  
  106. function send_letter_ex(name, icon_type, icon_name) make_quest_button_ex(name, icon_type, icon_name) set_skin(NOWINDOW) q.set_title(name) q.set_icon(icon_name) q.start() end
  107. function resend_letter_ex(name, icon_type, icon_name) make_quest_button_ex(name, icon_type, icon_name) q.set_title(name) q.set_icon(icon_name) q.start() end
  108. function resend_letter(title) makequestbutton(title) q.set_title(title) q.start() end
  109.  
  110. function send_letter(name) makequestbutton(name) setskin(NOWINDOW) q.set_title(name) q.start() end
  111. function clear_letter() q.done() end
  112. function say_title(name) say(color256(255, 230, 186)..name..color256(196, 196, 196)) end
  113. function say_reward(name) say(color256(255, 200, 200)..name..color256(196, 196, 196)) end
  114.  
  115. function say_blue(name) say(color256(0, 0, 255)..name..color256(0, 0, 255)) end
  116. function say_red(name) say(color256(255, 0, 0)..name..color256(255, 0, 0)) end
  117. function say_green(name) say(color256(0, 238, 0)..name..color256(0, 238, 0)) end
  118. function say_gold(name) say(color256(255, 215, 0)..name..color256(255, 215, 0)) end
  119. function say_black(name) say(color256(0, 0, 0)..name..color256(0, 0, 0)) end
  120. function say_white(name) say(color256(255, 255, 255)..name..color256(255, 255, 255)) end
  121. function say_yellow(name) say(color256(255, 255, 0)..name..color256(255, 255, 0)) end
  122. function say_blue2(name) say(color256(0, 206, 209)..name..color256(0, 206, 209)) end
  123. function chat_gold(name) say(color256(255, 215, 0)..name..color256(255, 215, 0)) end
  124.  
  125. function say_light_yellow(name) say(color256(255,255,128)..name..color256(196, 196, 196)) end
  126. function say_yellow(name) say(color256(255,255,53)..name..color256(196, 196, 196)) end
  127. function say_orange(name) say(color256(255,191,24)..name..color256(196, 196, 196)) end
  128. function say_light_blue(name) say(color256(130, 192, 255)..name..color256(196, 196, 196)) end
  129. function say_red(name) say(color256(139, 35, 35)..name..color256(196, 196, 196)) end
  130.  
  131. function say_kingdom_red(name) say(color256(205, 0, 0)..name..color256(196, 196, 196)) end
  132. function say_kingdom_yellow(name) say(color256(255, 215, 0)..name..color256(196, 196, 196)) end
  133. function say_kingdom_blue(name) say(color256(16, 78, 139)..name..color256(196, 196, 196)) end
  134.  
  135. function say_alert(name) say(color256(205, 0, 0)..name..color256(196, 196, 196)) end
  136.  
  137. function say_gm(name) say(color256(238, 201, 0)..name..color256(196, 196, 196)) end
  138. function say_gm_title(name) say(color256(238, 118, 0)..name..color256(196, 196, 196)) end
  139.  
  140. function say_help_title(name) say(color256(238, 118, 0)..name..color256(196, 196, 196)) end
  141. function say_help(name) say(color256(139, 35, 35)..name..color256(196, 196, 196)) end
  142. function say_help_red(name) say(color256(205, 0, 0)..name..color256(196, 196, 196)) end
  143.  
  144. function say_event_title(name) say(color256(238, 118, 0)..name..color256(196, 196, 196)) end
  145. function say_event(name) say(color256(139, 35, 35)..name..color256(196, 196, 196)) end
  146. function say_event_red(name) say(color256(205, 0, 0)..name..color256(196, 196, 196)) end
  147.  
  148. function say_pc_name() say(pc.get_name()..":") end
  149. function say_size(width, height) say("[WINDOW_SIZE width;"..width.."|height;"..height.."]") end
  150. function setmapcenterposition(x,y)
  151.     raw_script("[SETCMAPPOS x;")
  152.     raw_script(x.."|y;")
  153.     raw_script(y.."]")
  154. end
  155. function say_item(name, vnum, desc)
  156.     say("[INSERT_IMAGE image_type;item|idx;"..vnum.."|title;"..name.."|desc;"..desc.."|index;".. 0 .."|total;".. 1 .."]")
  157. end
  158. function say_show_item(vnum)
  159.     say("[INSERT_IMAGE image_type;item|idx;"..vnum.."|index;".. 0 .."|total;".. 1 .."]")
  160. end
  161. function say_item_vnum(vnum)
  162.     say_item(item_name(vnum), vnum, "")
  163. end
  164. function say_item_vnum_inline(vnum,index,total)
  165.     if index >= total then
  166.         return
  167.     end
  168.     if total > 3 then
  169.         return
  170.     end
  171.     raw_script("[INSERT_IMAGE image_type;item|idx;"..vnum.."|title;"..item_name(vnum).."|desc;".."".."|index;"..index.."|total;"..total.."]")
  172. end
  173. function pc_is_novice()
  174.     if pc.get_skill_group()==0 then
  175.         return true
  176.     else
  177.         return false
  178.     end
  179. end
  180. function pc_get_exp_bonus(exp, text)
  181.     say_reward(text)
  182.     pc.give_exp2(exp)
  183.     set_quest_state("levelup", "run")
  184. end
  185. function pc_get_village_map_index(index)
  186.     return village_map[pc.get_empire()][index]
  187. end
  188. function pc_has_even_id()
  189.     return math.mod(pc.get_player_id(),2) == 0
  190. end
  191.  
  192. function pc_get_account_id()
  193.     return math.mod(pc.get_account_id(), 2) !=0
  194. end
  195.  
  196. village_map = {
  197.     {1, 3},
  198.     {21, 23},
  199.     {41, 43},
  200. }
  201.  
  202. function npc_is_same_empire()
  203.     if pc.get_empire()==npc.empire then
  204.         return true
  205.     else
  206.         return false
  207.     end
  208. end
  209.  
  210. function npc_get_skill_teacher_race(pc_empire, pc_job, sub_job)
  211.     if 1==sub_job then
  212.         if 0==pc_job then
  213.             return WARRIOR1_NPC_LIST[pc_empire]
  214.         elseif 1==pc_job then
  215.             return ASSASSIN1_NPC_LIST[pc_empire]
  216.         elseif 2==pc_job then
  217.             return SURA1_NPC_LIST[pc_empire]
  218.         elseif 3==pc_job then
  219.             return SHAMAN1_NPC_LIST[pc_empire]
  220.         end
  221.     elseif 2==sub_job then
  222.         if 0==pc_job then
  223.             return WARRIOR2_NPC_LIST[pc_empire]
  224.         elseif 1==pc_job then
  225.             return ASSASSIN2_NPC_LIST[pc_empire]
  226.         elseif 2==pc_job then
  227.             return SURA2_NPC_LIST[pc_empire]
  228.         elseif 3==pc_job then
  229.             return SHAMAN2_NPC_LIST[pc_empire]
  230.         end
  231.     end
  232.  
  233.     return 0
  234. end
  235.  
  236.  
  237. function pc_find_square_guard_vid()
  238.     if pc.get_empire()==1 then
  239.         return find_npc_by_vnum(11000)
  240.     elseif pc.get_empire()==2 then
  241.         return find_npc_by_vnum(11002)
  242.     elseif pc.get_empire()==3 then
  243.         return find_npc_by_vnum(11004)
  244.     end
  245.     return 0
  246. end
  247.  
  248. function pc_find_skill_teacher_vid(sub_job)
  249.     local vnum=npc_get_skill_teacher_race(pc.get_empire(), pc.get_job(), sub_job)
  250.     return find_npc_by_vnum(vnum)
  251. end
  252.  
  253. function pc_find_square_guard_vid()
  254.     local pc_empire=pc.get_empire()
  255.     if pc_empire==1 then
  256.         return find_npc_by_vnum(11000)
  257.     elseif pc_empire==2 then
  258.         return find_npc_by_vnum(11002)
  259.     elseif pc_empire==3 then
  260.         return find_npc_by_vnum(11004)
  261.     end
  262. end
  263.  
  264. function npc_is_same_job()
  265.     local pc_job=pc.get_job()
  266.     local npc_vnum=npc.get_race()
  267.  
  268.     -- test_chat("pc.job:"..pc.get_job())
  269.     -- test_chat("npc_race:"..npc.get_race())
  270.     -- test_chat("pc.skill_group:"..pc.get_skill_group())
  271.     if pc_job==0 then
  272.         if table_is_in(WARRIOR1_NPC_LIST, npc_vnum) then return true end
  273.         if table_is_in(WARRIOR2_NPC_LIST, npc_vnum) then return true end
  274.     elseif pc_job==1 then
  275.         if table_is_in(ASSASSIN1_NPC_LIST, npc_vnum) then return true end
  276.         if table_is_in(ASSASSIN2_NPC_LIST, npc_vnum) then return true end
  277.     elseif pc_job==2 then
  278.         if table_is_in(SURA1_NPC_LIST, npc_vnum) then return true end
  279.         if table_is_in(SURA2_NPC_LIST, npc_vnum) then return true end
  280.     elseif pc_job==3 then
  281.         if table_is_in(SHAMAN1_NPC_LIST, npc_vnum) then return true end
  282.         if table_is_in(SHAMAN2_NPC_LIST, npc_vnum) then return true end
  283.     end
  284.  
  285.     return false
  286. end
  287.  
  288. function npc_get_job()
  289.     local npc_vnum=npc.get_race()
  290.  
  291.     if table_is_in(WARRIOR1_NPC_LIST, npc_vnum) then return COND_WARRIOR_1 end
  292.     if table_is_in(WARRIOR2_NPC_LIST, npc_vnum) then return COND_WARRIOR_2 end
  293.     if table_is_in(ASSASSIN1_NPC_LIST, npc_vnum) then return COND_ASSASSIN_1 end
  294.     if table_is_in(ASSASSIN2_NPC_LIST, npc_vnum) then return COND_ASSASSIN_2 end
  295.     if table_is_in(SURA1_NPC_LIST, npc_vnum) then return COND_SURA_1 end
  296.     if table_is_in(SURA2_NPC_LIST, npc_vnum) then return COND_SURA_2 end
  297.     if table_is_in(SHAMAN1_NPC_LIST, npc_vnum) then return COND_SHAMAN_1 end
  298.     if table_is_in(SHAMAN2_NPC_LIST, npc_vnum) then return COND_SHAMAN_2 end
  299.     return 0
  300.  
  301. end
  302.  
  303. function time_min_to_sec(value)
  304.     return 60*value
  305. end
  306.  
  307. function time_hour_to_sec(value)
  308.     return 3600*value
  309. end
  310.  
  311. function next_time_set(value, test_value)
  312.     local nextTime=get_time()+value
  313.     if is_test_server() then
  314.         nextTime=get_time()+test_value
  315.     end
  316.     pc.setqf("__NEXT_TIME__", nextTime)
  317. end
  318.  
  319. function next_time_is_now(value)
  320.     if get_time()>=pc.getqf("__NEXT_TIME__") then
  321.         return true
  322.     else
  323.         return false
  324.     end
  325. end
  326.  
  327. function table_get_random_item(self)
  328.     return self[number(1, table.getn(self))]
  329. end
  330.  
  331. function table_is_in(self, test)
  332.     for i = 1, table.getn(self) do
  333.         if self[i]==test then
  334.             return true
  335.         end
  336.     end
  337.     return false
  338. end
  339.  
  340.  
  341. function giveup_quest_menu(title)
  342.     local s=select("ÁřÇŕÇŃ´Ů", "Ć÷±âÇŃ´Ů")
  343.     if 2==s then
  344.     say(title.." Äů˝şĆ®¸¦ Á¤¸»·Î")
  345.     say("Ć÷±âÇϽðڽŔ´Ď±î?")
  346.     local s=select("ł×, ±×·¸˝Ŕ´Ď´Ů", "ľĆ´Ő´Ď´Ů")
  347.     if 1==s then
  348.         say(title.."Äů˝şĆ®¸¦ Ć÷±âÇß˝Ŕ´Ď´Ů")
  349.         restart_quest()
  350.     end
  351.     end
  352. end
  353.  
  354. function restart_quest()
  355.     set_state("start")
  356.     q.done()
  357. end
  358.  
  359. function complete_quest()
  360.     set_state("__COMPLETE__")
  361.     q.done()
  362. end
  363.  
  364. function giveup_quest()
  365.     set_state("__GIVEUP__")
  366.     q.done()
  367. end
  368.  
  369. function complete_quest_state(state_name)
  370.     set_state(state_name)
  371.     q.done()
  372. end
  373.  
  374. function test_chat(log)
  375.     if is_test_server() then
  376.         chat(log)
  377.     end
  378. end
  379.  
  380. function bool_to_str(is)
  381.     if is then
  382.         return "true"
  383.     else
  384.         return "false"
  385.     end
  386. end
  387.  
  388. WARRIOR1_NPC_LIST   = {20300, 20320, 20340, }
  389. WARRIOR2_NPC_LIST   = {20301, 20321, 20341, }
  390. ASSASSIN1_NPC_LIST  = {20302, 20322, 20342, }
  391. ASSASSIN2_NPC_LIST  = {20303, 20323, 20343, }
  392. SURA1_NPC_LIST      = {20304, 20324, 20344, }
  393. SURA2_NPC_LIST      = {20305, 20325, 20345, }
  394. SHAMAN1_NPC_LIST    = {20306, 20326, 20346, }
  395. SHAMAN2_NPC_LIST    = {20307, 20327, 20347, }
  396.  
  397. function skill_group_dialog(e, j, g) -- e = Á¦±ą, j = Á÷ľ÷, g = ±×·ě
  398.     e = 1 -- XXX ¸Ţ˝ĂÁö°ˇ łŞ¶óş°·Î ŔÖ´Ů°ˇ ÇĎłŞ·Î ĹëÇյǾúŔ˝
  399.    
  400.  
  401.     -- ´Ů¸Ą Á÷ľ÷ŔĚ°ĹłŞ ´Ů¸Ą Á¦±ąŔĎ °ćżě
  402.     if pc.job != j then
  403.         say(locale.skill_group.dialog[e][pc.job][3])
  404.     elseif pc.get_skill_group() == 0 then
  405.         if pc.level < 5 then
  406.             say(locale.skill_group.dialog[e][j][g][1])
  407.             return
  408.         end
  409.         say(locale.skill_group.dialog[e][j][g][2])
  410.         local answer = select(locale.yes, locale.no)
  411.  
  412.         if answer == 1 then
  413.             --say(locale.skill_group.dialog[e][j][g][2])
  414.             pc.set_skill_group(g)
  415.         else
  416.             --say(locale.skill_group.dialog[e][j][g][3])
  417.         end
  418.     --elseif pc.get_skill_group() == g then
  419.         --say(locale.skill_group.dialog[e][j][g][4])
  420.     --else
  421.         --say(locale.skill_group.dialog[e][j][g][5])
  422.     end
  423. end
  424.  
  425. function show_horse_menu()
  426.     if horse.is_mine() then        
  427.         say(locale.horse_menu.menu)
  428.  
  429.         local s = 0
  430.         if horse.is_dead() then
  431.             s = select(locale.horse_menu.revive, locale.horse_menu.ride, locale.horse_menu.unsummon, locale.horse_menu.close)
  432.         else
  433.             s = select(locale.horse_menu.feed, locale.horse_menu.ride, locale.horse_menu.unsummon, locale.horse_menu.close)
  434.         end
  435.  
  436.         if s==1 then
  437.             if horse.is_dead() then
  438.                 horse.revive()
  439.             else
  440.                 local food = horse.get_grade() + 50054 - 1
  441.                 if pc.countitem(food) > 0 then
  442.                 pc.removeitem(food, 1)
  443.                 horse.feed()
  444.                 else
  445.                 say(locale.need_item_prefix..item_name(food)..locale.need_item_postfix);
  446.                 end
  447.             end
  448.         elseif s==2 then
  449.             horse.ride()
  450.         elseif s==3 then
  451.             horse.unsummon()
  452.         elseif s==4 then
  453.             -- do nothing
  454.         end
  455.     end
  456. end
  457.  
  458. npc_index_table = {
  459.     ['race'] = npc.getrace,
  460.     ['empire'] = npc.get_empire,
  461. }
  462.  
  463. pc_index_table = {
  464.     ['weapon']      = pc.getweapon,
  465.     ['level']       = pc.get_level,
  466.     ['hp']      = pc.gethp,
  467.     ['maxhp']       = pc.getmaxhp,
  468.     ['sp']      = pc.getsp,
  469.     ['maxsp']       = pc.getmaxsp,
  470.     ['exp']     = pc.get_exp,
  471.     ['nextexp']     = pc.get_next_exp,
  472.     ['job']     = pc.get_job,
  473.     ['money']       = pc.getmoney,
  474.     ['gold']        = pc.getmoney,
  475.     ['name']        = pc.getname,
  476.     ['playtime']    = pc.getplaytime,
  477.     ['leadership']  = pc.getleadership,
  478.     ['empire']      = pc.getempire,
  479.     ['skillgroup']  = pc.get_skill_group,
  480.     ['x']       = pc.getx,
  481.     ['y']       = pc.gety,
  482.     ['local_x']     = pc.get_local_x,
  483.     ['local_y']     = pc.get_local_y,
  484. }
  485.  
  486. item_index_table = {
  487.     ['vnum']        = item.get_vnum,
  488.     ['name']        = item.get_name,
  489.     ['size']        = item.get_size,
  490.     ['count']       = item.get_count,
  491.     ['type']        = item.get_type,
  492.     ['sub_type']    = item.get_sub_type,
  493.     ['refine_vnum'] = item.get_refine_vnum,
  494.     ['level']       = item.get_level,
  495. }
  496.  
  497. guild_war_bet_price_table =
  498. {
  499.     10000,
  500.     30000,
  501.     50000,
  502.     100000
  503. }
  504.  
  505. function npc_index(t,i)
  506.     local npit = npc_index_table
  507.     if npit[i] then
  508.     return npit[i]()
  509.     else
  510.     return rawget(t,i)
  511.     end
  512. end
  513.  
  514. function pc_index(t,i)
  515.     local pit = pc_index_table
  516.     if pit[i] then
  517.     return pit[i]()
  518.     else
  519.     return rawget(t,i)
  520.     end
  521. end
  522.  
  523. function item_index(t, i)
  524.     local iit = item_index_table
  525.     if iit[i] then
  526.     return iit[i]()
  527.     else
  528.     return rawget(t, i)
  529.     end
  530. end
  531.  
  532. setmetatable(pc,{__index=pc_index})
  533. setmetatable(npc,{__index=npc_index})
  534. setmetatable(item,{__index=item_index})
  535.  
  536. --coroutineŔ» ŔĚżëÇŃ Ľ±ĹĂÇ× Ăł¸®
  537. function select(...)
  538.     return q.yield('select', arg)
  539. end
  540.  
  541. function select_table(table)
  542.     return q.yield('select', table)
  543. end
  544.  
  545. -- coroutineŔ» ŔĚżëÇŃ ´ŮŔ˝ żŁĹÍ ±â´Ů¸®±â
  546. function wait()
  547.     q.yield('wait')
  548. end
  549.  
  550. function input()
  551.     return q.yield('input')
  552. end
  553.  
  554. function confirm(vid, msg, timeout)
  555.     return q.yield('confirm', vid, msg, timeout)
  556. end
  557.  
  558. function select_item()
  559.     setskin(NOWINDOW)
  560.     return q.yield('select_item')
  561. end
  562.  
  563. function select_item_ex()
  564.     setskin(NOWINDOW)
  565.     return q.yield('select_item_ex')
  566. end
  567.  
  568. --ŔüżŞ şŻĽö Á˘±Ů°ú °ü·ĂµČ °čż­
  569. NOWINDOW = 0
  570. NORMAL = 1
  571. CINEMATIC = 2
  572. SCROLL = 3
  573.  
  574. WARRIOR = 0
  575. ASSASSIN = 1
  576. SURA = 2
  577. SHAMAN = 3
  578.  
  579. COND_WARRIOR_0 = 8
  580. COND_WARRIOR_1 = 16
  581. COND_WARRIOR_2 = 32
  582. COND_WARRIOR = 56
  583.  
  584. COND_ASSASSIN_0 = 64
  585. COND_ASSASSIN_1 = 128
  586. COND_ASSASSIN_2 = 256
  587. COND_ASSASSIN = 448
  588.  
  589. COND_SURA_0 = 512
  590. COND_SURA_1 = 1024
  591. COND_SURA_2 = 2048
  592. COND_SURA = 3584
  593.  
  594. COND_SHAMAN_0 = 4096
  595. COND_SHAMAN_1 = 8192
  596. COND_SHAMAN_2 = 16384
  597. COND_SHAMAN = 28672
  598.  
  599. PART_MAIN = 0
  600. PART_HAIR = 3
  601.  
  602. GUILD_CREATE_ITEM_VNUM = 70101
  603.  
  604. QUEST_SCROLL_TYPE_KILL_MOB = 1
  605. QUEST_SCROLL_TYPE_KILL_ANOTHER_EMPIRE = 2
  606.  
  607. apply = {
  608.     ["MAX_HP"]      = 1,
  609.     ["MAX_SP"]      = 2,
  610.     ["CON"]         = 3,
  611.     ["INT"]         = 4,
  612.     ["STR"]         = 5,
  613.     ["DEX"]         = 6,
  614.     ["ATT_SPEED"]       = 7,
  615.     ["MOV_SPEED"]       = 8,
  616.     ["CAST_SPEED"]      = 9,
  617.     ["HP_REGEN"]        = 10,
  618.     ["SP_REGEN"]        = 11,
  619.     ["POISON_PCT"]      = 12,
  620.     ["STUN_PCT"]        = 13,
  621.     ["SLOW_PCT"]        = 14,
  622.     ["CRITICAL_PCT"]    = 15,
  623.     ["PENETRATE_PCT"]   = 16,
  624.     ["ATTBONUS_HUMAN"]  = 17,
  625.     ["ATTBONUS_ANIMAL"] = 18,
  626.     ["ATTBONUS_ORC"]    = 19,
  627.     ["ATTBONUS_MILGYO"] = 20,
  628.     ["ATTBONUS_UNDEAD"] = 21,
  629.     ["ATTBONUS_DEVIL"]  = 22,
  630.     ["STEAL_HP"]        = 23,
  631.     ["STEAL_SP"]        = 24,
  632.     ["MANA_BURN_PCT"]   = 25,
  633.     ["DAMAGE_SP_RECOVER"]   = 26,
  634.     ["BLOCK"]       = 27,
  635.     ["DODGE"]       = 28,
  636.     ["RESIST_SWORD"]    = 29,
  637.     ["RESIST_TWOHAND"]  = 30,
  638.     ["RESIST_DAGGER"]   = 31,
  639.     ["RESIST_BELL"]     = 32,
  640.     ["RESIST_FAN"]      = 33,
  641.     ["RESIST_BOW"]      = 34,
  642.     ["RESIST_FIRE"]     = 35,
  643.     ["RESIST_ELEC"]     = 36,
  644.     ["RESIST_MAGIC"]    = 37,
  645.     ["RESIST_WIND"]     = 38,
  646.     ["REFLECT_MELEE"]   = 39,
  647.     ["REFLECT_CURSE"]   = 40,
  648.     ["POISON_REDUCE"]   = 41,
  649.     ["KILL_SP_RECOVER"] = 42,
  650.     ["EXP_DOUBLE_BONUS"]    = 43,
  651.     ["GOLD_DOUBLE_BONUS"]   = 44,
  652.     ["ITEM_DROP_BONUS"] = 45,
  653.     ["POTION_BONUS"]    = 46,
  654.     ["KILL_HP_RECOVER"] = 47,
  655.     ["IMMUNE_STUN"]     = 48,
  656.     ["IMMUNE_SLOW"]     = 49,
  657.     ["IMMUNE_FALL"]     = 50,
  658.     ["SKILL"]       = 51,
  659.     ["BOW_DISTANCE"]    = 52,
  660.     ["ATT_GRADE_BONUS"] = 53,
  661.     ["DEF_GRADE_BONUS"] = 54,
  662.     ["MAGIC_ATT_GRADE"] = 55,
  663.     ["MAGIC_DEF_GRADE"] = 56,
  664.     ["CURSE_PCT"]       = 57,
  665.     ["MAX_STAMINA"]     = 58,
  666.     ["ATTBONUS_WARRIOR"]    = 59,
  667.     ["ATTBONUS_ASSASSIN"]   = 60,
  668.     ["ATTBONUS_SURA"]   = 61,
  669.     ["ATTBONUS_SHAMAN"] = 62,
  670.     ["ATTBONUS_MONSTER"]    = 63,
  671.     ["MALL_EXPBONUS"]   = 66,
  672.     ["MAX_HP_PCT"]  = 69,
  673.     ["MAX_SP_PCT"]  = 70,
  674.  
  675.     ["MALL_DEFBONUS"] = 65,
  676.  
  677.     ["NORMAL_HIT_DEFEND_BONUS"] = 74,
  678. }
  679.  
  680. -- ·ąş§ľ÷ Äů˝şĆ® -_-
  681. special = {}
  682.  
  683. special.fortune_telling =
  684. {
  685. --  { prob  Ĺ©¸®    item    money   remove money
  686.     { 1,    0,  20, 20, 0   }, -- 10
  687.     { 499,  0,  10, 10, 0   }, -- 5
  688.     { 2500, 0,  5,  5,  0   }, -- 1
  689.     { 5000, 0,  0,  0,  0   },
  690.     { 1500, 0,  -5, -5, 20000   },
  691.     { 499,  0,  -10,    -10,    20000   },
  692.     { 1,    0,  -20,    -20,    20000   },
  693. }
  694.  
  695. special.questscroll_reward =
  696. {
  697.     {1, 1500,   3000,   30027,  0,  0    },
  698.     {2, 1500,   3000,   30028,  0,  0    },
  699.     {3, 1000,   2000,   30034,  30018,  0    },
  700.     {4, 1000,   2000,   30034,  30011,  0    },
  701.     {5, 1000,   2000,   30011,  30034,  0    },
  702.     {6, 1000,   2000,   27400,  0,  0    },
  703.     {7, 2000,   4000,   30023,  30003,  0    },
  704.     {8, 2000,   4000,   30005,  30033,  0    },
  705.     {9, 2000,   8000,   30033,  30005,  0    },
  706.     {10,    4000,   8000,   30021,  30033,  30045},
  707.     {11,    4000,   8000,   30045,  30022,  30046},
  708.     {12,    5000,   12000,  30047,  30045,  30055},
  709.     {13,    5000,   12000,  30051,  30017,  30058},
  710.     {14,    5000,   12000,  30051,  30007,  30041},
  711.     {15,    5000,   15000,  30091,  30017,  30018},
  712.     {16,    3500,   6500,   30021,  30033,  0    },
  713.     {17,    4000,   9000,   30051,  30033,  0    },
  714.     {18,    4500,   10000,  30056,  30057,  30058},
  715.     {19,    4500,   10000,  30059,  30058,  30041},
  716.     {20,    5000,   15000,  0,  0,  0    },
  717. }
  718.  
  719. special.active_skill_list = {
  720.     {
  721.         { 1, 2, 3, 4, 5, 6},
  722.         { 16, 17, 18, 19, 20, 21},
  723.     },
  724.     {
  725.         {31, 32, 33, 34, 35, 36},
  726.         {46, 47, 48, 49, 50, 51},
  727.     },
  728.     {
  729.         {61, 62, 63, 64, 65, 66},
  730.         {76, 77, 78, 79, 80, 81},
  731.     },
  732.     {
  733.         {91, 92, 93, 94, 95, 96},
  734.         {106, 107, 108, 109, 110, 111},
  735.     },
  736.     {
  737.         {170, 171, 172, 173, 174, 175},
  738.     },
  739. }
  740.  
  741. special.skill_reset_cost = {
  742.     2000,
  743.     2000,
  744.     2000,
  745.     2000,
  746.     2000,
  747.     2000,
  748.     4000,
  749.     6000,
  750.     8000,
  751.     10000,
  752.     14000,
  753.     18000,
  754.     22000,
  755.     28000,
  756.     34000,
  757.     41000,
  758.     50000,
  759.     59000,
  760.     70000,
  761.     90000,
  762.     101000,
  763.     109000,
  764.     114000,
  765.     120000,
  766.     131000,
  767.     141000,
  768.     157000,
  769.     176000,
  770.     188000,
  771.     200000,
  772.     225000,
  773.     270000,
  774.     314000,
  775.     348000,
  776.     393000,
  777.     427000,
  778.     470000,
  779.     504000,
  780.     554000,
  781.     600000,
  782.     758000,
  783.     936000,
  784.     1103000,
  785.     1276000,
  786.     1407000,
  787.     1568000,
  788.     1704000,
  789.     1860000,
  790.     2080000,
  791.     2300000,
  792.     2700000,
  793.     3100000,
  794.     3500000,
  795.     3900000,
  796.     4300000,
  797.     4800000,
  798.     5300000,
  799.     5800000,
  800.     6400000,
  801.     7000000,
  802.     8000000,
  803.     9000000,
  804.     10000000,
  805.     11000000,
  806.     12000000,
  807.     13000000,
  808.     14000000,
  809.     15000000,
  810.     16000000,
  811.     17000000,
  812. }
  813.  
  814. special.levelup_img =
  815. {
  816.     [171] = "dog.tga",
  817.     [172] = "wolf.tga",
  818.     [173] = "wolf.tga",
  819.     [174] = "wolf.tga",
  820.     [175] = "wolf.tga",
  821.     [175] = "wolf.tga",
  822.     [176] = "wolf.tga",
  823.     [177] = "wolf.tga",
  824.     [178] = "wild_boar.tga",
  825.     [179] = "wild_boar.tga",
  826.     [180] = "bear.tga",
  827.     [181] = "bear.tga",
  828.     [182] = "bear.tga",
  829.     [183] = "bear.tga",
  830.     [184] = "tiger.tga",
  831.     [185] = "tiger.tga",
  832.  
  833.     [351] = "bak_inf.tga",
  834.     [352] = "bak_gung.tga",
  835.     [353] = "bak_gen1.tga",
  836.     [354] = "bak_gen2.tga",
  837.    
  838.     [402] = "402.tga",
  839.  
  840.     [451] = "huk_inf.tga",
  841.     [452] = "huk_dol.tga",
  842.     [453] = "huk_gen1.tga",
  843.     [454] = "huk_gen2.tga",
  844.     [456] = "456.tga",
  845.  
  846.     [551] = "o_inf.tga",
  847.     [552] = "o_jol.tga",
  848.     [553] = "o_gung.tga",
  849.     [554] = "o_jang.tga",
  850.  
  851.     [651] = "ung_inf.tga",
  852.     [652] = "ung_chuk.tga",
  853.     [653] = "ung_tu.tga",
  854.  
  855.     [751] = "mil_chu.tga",
  856.     [752] = "mil_na.tga",
  857.     [753] = "mil_na.tga",
  858.     [754] = "mil_na.tga",
  859.     [755] = "mil_jip.tga",
  860.     [756] = "756.tga",
  861.     [757] = "757.tga",
  862.  
  863.     [771] = "mil_chu.tga",
  864.     [772] = "mil_na.tga",
  865.     [773] = "mil_na.tga",
  866.     [774] = "mil_na.tga",
  867.     [775] = "mil_jip.tga",
  868.     [776] = "776.tga",
  869.     [777] = "777.tga",
  870.  
  871.     [931] = "sigwi.tga",
  872.     [932] = "932.tga",
  873.     [933] = "gwoijil.tga",
  874.     [934] = "934.tga",
  875.     [935] = "935.tga",
  876.     [936] = "936.tga",
  877.     [937] = "937.tga",
  878.    
  879.     [1001] = "1001.tga",
  880.     [1002] = "1002.tga",
  881.     [1003] = "1003.tga",
  882.     [1004] = "1004.tga",
  883.    
  884.     [1061] = "1061.tga",
  885.     [1063] = "1063.tga",
  886.     [1064] = "1064.tga",
  887.     [1065] = "1065.tga",
  888.     [1066] = "1066.tga",
  889.     [1068] = "1068.tga",
  890.     [1069] = "1069.tga",
  891.  
  892.     [1070] = "1070.tga",
  893.     [1071] = "1071.tga",
  894.  
  895.     [1101] = "1101.tga",
  896.     [1102] = "1102.tga",
  897.     [1104] = "1104.tga",
  898.     [1105] = "1105.tga",
  899.     [1106] = "1106.tga",
  900.     [1107] = "1107.tga",
  901.  
  902.     [1131] = "1131.tga",
  903.     [1132] = "1132.tga",
  904.     [1133] = "1133.tga",
  905.     [1135] = "1135.tga",
  906.     [1136] = "1136.tga",
  907.     [1137] = "1137.tga",
  908.  
  909.     [1301] = "1301.tga",
  910.     [1303] = "1303.tga",
  911.     [1305] = "1305.tga",
  912.  
  913.     [2001] = "spider.tga",
  914.     [2002] = "spider.tga",
  915.     [2003] = "spider.tga",
  916.     [2004] = "spider.tga",
  917.     [2005] = "spider.tga",
  918.  
  919.     [2051] = "spider.tga",
  920.     [2052] = "spider.tga",
  921.     [2053] = "spider.tga",
  922.     [2054] = "spider.tga",
  923.     [2055] = "spider.tga",
  924.  
  925.     [2031] = "2031.tga",
  926.     [2032] = "2032.tga",
  927.     [2033] = "2033.tga",
  928.     [2034] = "2034.tga",
  929.  
  930.     [2061] = "2061.tga",
  931.     [2062] = "2062.tga",
  932.     [2063] = "2063.tga",
  933.  
  934.     [2102] = "2102.tga",
  935.     [2103] = "2103.tga",
  936.     [2106] = "2106.tga",
  937.    
  938.     [2131] = "2131.tga",
  939.     [2158] = "2158.tga",
  940.    
  941.     [2201] = "2201.tga",
  942.     [2202] = "2202.tga",
  943.     [2204] = "2204.tga",
  944.     [2205] = "2205.tga",
  945.    
  946.     [2301] = "2301.tga",
  947.     [2302] = "2302.tga",
  948.     [2303] = "2303.tga",
  949.     [2304] = "2304.tga",
  950.     [2305] = "2305.tga",
  951.    
  952.     [2311] = "2311.tga",
  953.     [2312] = "2312.tga",
  954.     [2313] = "2313.tga",
  955.     [2314] = "2314.tga",
  956.     [2315] = "2315.tga",
  957.  
  958.     [5123] = "5123.tga",
  959.     [5124] = "5124.tga",
  960.     [5125] = "5125.tga",
  961.     [5126] = "5126.tga",
  962.    
  963.  
  964. }
  965.  
  966. special.levelup_quest = {
  967.     -- monster kill  monster   kill
  968.     --    vnum      qty.         vnum       qty.     exp percent
  969. {   0   ,   0   ,   0   ,   0   ,   0   }   ,   --  lev 1
  970. {   171 ,   10  ,   172 ,   5   ,   10  }   ,   --  lev 2
  971. {   171 ,   20  ,   172 ,   10  ,   10  }   ,   --  lev 3
  972. {   172 ,   15  ,   173 ,   5   ,   10  }   ,   --  lev 4
  973. {   173 ,   10  ,   174 ,   10  ,   10  }   ,   --  lev 5
  974. {   174 ,   20  ,   178 ,   10  ,   10  }   ,   --  lev 6
  975. {   178 ,   10  ,   175 ,   5   ,   10  }   ,   --  lev 7
  976. {   178 ,   20  ,   175 ,   10  ,   10  }   ,   --  lev 8
  977. {   175 ,   15  ,   179 ,   5   ,   10  }   ,   --  lev 9
  978. {   175 ,   20  ,   179 ,   10  ,   10  }   ,   --  lev 10
  979. {   179 ,   10  ,   180 ,   5   ,   10  }   ,   --  lev 11
  980. {   180 ,   15  ,   176 ,   10  ,   10  }   ,   --  lev 12
  981. {   176 ,   20  ,   181 ,   5   ,   10  }   ,   --  lev 13
  982. {   181 ,   15  ,   177 ,   5   ,   10  }   ,   --  lev 14
  983. {   181 ,   20  ,   177 ,   10  ,   10  }   ,   --  lev 15
  984. {   177 ,   15  ,   184 ,   5   ,   10  }   ,   --  lev 16
  985. {   177 ,   20  ,   184 ,   10  ,   10  }   ,   --  lev 17
  986. {   184 ,   10  ,   182 ,   10  ,   10  }   ,   --  lev 18
  987. {   182 ,   20  ,   183 ,   10  ,   10  }   ,   --  lev 19
  988. {   183 ,   20  ,   352 ,   15  ,   10  }   ,   --  lev 20
  989. {   352 ,   20  ,   185 ,   10  ,   "2-10"  }   ,   --  lev 21
  990. {   185 ,   25  ,   354 ,   10  ,   "2-10"  }   ,   --  lev 22
  991. {   354 ,   20  ,   451 ,   40  ,   "2-10"  }   ,   --  lev 23
  992. {   451 ,   60  ,   402 ,   80  ,   "2-10"  }   ,   --  lev 24
  993. {   551 ,   80  ,   454 ,   20  ,   "2-10"  }   ,   --  lev 25
  994. {   552 ,   80  ,   456 ,   20  ,   "2-10"  }   ,   --  lev 26
  995. {   456 ,   30  ,   554 ,   20  ,   "2-10"  }   ,   --  lev 27
  996. {   651 ,   35  ,   554 ,   30  ,   "2-10"  }   ,   --  lev 28
  997. {   651 ,   40  ,   652 ,   30  ,   "2-10"  }   ,   --  lev 29
  998. {   652 ,   40  ,   2102    ,   30  ,   "2-10"  }   ,   --  lev 30
  999. {   652 ,   50  ,   2102    ,   45  ,   "2-5"   }   ,   --  lev 31
  1000. {   653 ,   45  ,   2051    ,   40  ,   "2-5"   }   ,   --  lev 32
  1001. {   751 ,   35  ,   2103    ,   30  ,   "2-5"   }   ,   --  lev 33
  1002. {   751 ,   40  ,   2103    ,   40  ,   "2-5"   }   ,   --  lev 34
  1003. {   752 ,   40  ,   2052    ,   30  ,   "2-5"   }   ,   --  lev 35
  1004. {   754 ,   20  ,   2106    ,   20  ,   "2-5"   }   ,   --  lev 36
  1005. {   773 ,   30  ,   2003    ,   20  ,   "2-5"   }   ,   --  lev 37
  1006. {   774 ,   40  ,   2004    ,   20  ,   "2-5"   }   ,   --  lev 38
  1007. {   756 ,   40  ,   2005    ,   30  ,   "2-5"   }   ,   --  lev 39
  1008. {   757 ,   40  ,   2158    ,   20  ,   "2-5"   }   ,   --  lev 40
  1009. {   931 ,   40  ,   5123    ,   25  ,   "2-5"   }   ,   --  lev 41
  1010. {   932 ,   30  ,   5123    ,   30  ,   "2-5"   }   ,   --  lev 42
  1011. {   932 ,   40  ,   2031    ,   35  ,   "2-5"   }   ,   --  lev 43
  1012. {   933 ,   40  ,   2031    ,   40  ,   "2-5"   }   ,   --  lev 44
  1013. {   771 ,   50  ,   2032    ,   45  ,   "2-5"   }   ,   --  lev 45
  1014. {   772 ,   30  ,   5124    ,   30  ,   "2-5"   }   ,   --  lev 46
  1015. {   933 ,   35  ,   5125    ,   30  ,   "2-5"   }   ,   --  lev 47
  1016. {   934 ,   40  ,   5125    ,   35  ,   "2-5"   }   ,   --  lev 48
  1017. {   773 ,   40  ,   2033    ,   45  ,   "2-5"   }   ,   --  lev 49
  1018. {   774 ,   40  ,   5126    ,   20  ,   "2-5"   }   ,   --  lev 50
  1019. {   775 ,   50  ,   5126    ,   30  ,   "1-4"   }   ,   --  lev 51
  1020. {   934 ,   45  ,   2034    ,   45  ,   "1-4"   }   ,   --  lev 52
  1021. {   934 ,   50  ,   2034    ,   50  ,   "1-4"   }   ,   --  lev 53
  1022. {   776 ,   40  ,   1001    ,   30  ,   "1-4"   }   ,   --  lev 54
  1023. {   777 ,   40  ,   1301    ,   35  ,   "1-4"   }   ,   --  lev 55
  1024. {   935 ,   50  ,   1002    ,   30  ,   "1-4"   }   ,   --  lev 56
  1025. {   935 ,   60  ,   1002    ,   40  ,   "1-4"   }   ,   --  lev 57
  1026. {   936 ,   45  ,   1303    ,   40  ,   "1-4"   }   ,   --  lev 58
  1027. {   936 ,   50  ,   1303    ,   45  ,   "1-4"   }   ,   --  lev 59
  1028. {   937 ,   45  ,   1003    ,   40  ,   "1-4"   }   ,   --  lev 60
  1029. {   1004    ,   50  ,   2061    ,   60  ,   "2-4"   }   ,   --  lev 61
  1030. {   1305    ,   45  ,   2131    ,   55  ,   "2-4"   }   ,   --  lev 62
  1031. {   1305    ,   50  ,   1101    ,   45  ,   "2-4"   }   ,   --  lev 63
  1032. {   2062    ,   50  ,   1102    ,   45  ,   "2-4"   }   ,   --  lev 64
  1033. {   1104    ,   40  ,   2063    ,   40  ,   "2-4"   }   ,   --  lev 65
  1034. {   2301    ,   50  ,   1105    ,   45  ,   "2-4"   }   ,   --  lev 66
  1035. {   2301    ,   55  ,   1105    ,   50  ,   "2-4"   }   ,   --  lev 67
  1036. {   1106    ,   50  ,   1061    ,   50  ,   "2-4"   }   ,   --  lev 68
  1037. {   1107    ,   45  ,   1061    ,   50  ,   "2-4"   }   ,   --  lev 69
  1038. {   2302    ,   55  ,   2201    ,   55  ,   "2-4"   }   ,   --  lev 70
  1039. {   2303    ,   55  ,   2202    ,   55  ,   "2-4"   }   ,   --  lev 71
  1040. {   2303    ,   60  ,   2202    ,   60  ,   "2-4"   }   ,   --  lev 72
  1041. {   2304    ,   55  ,   1063    ,   55  ,   "2-4"   }   ,   --  lev 73
  1042. {   2305    ,   50  ,   1063    ,   55  ,   "2-4"   }   ,   --  lev 74
  1043. {   1064    ,   50  ,   2204    ,   50  ,   "2-4"   }   ,   --  lev 75
  1044. {   2205    ,   45  ,   1065    ,   50  ,   "2-4"   }   ,   --  lev 76
  1045. {   2311    ,   50  ,   1068    ,   50  ,   "2-4"   }   ,   --  lev 77
  1046. {   1070    ,   50  ,   1066    ,   55  ,   "2-4"   }   ,   --  lev 78
  1047. {   1070    ,   50  ,   1069    ,   50  ,   "2-4"   }   ,   --  lev 79
  1048. {   1071    ,   50  ,   2312    ,   55  ,   "2-4"   }   ,   --  lev 80
  1049. {   1071    ,   55  ,   2312    ,   50  ,   "2-4"   }   ,   --  lev 81
  1050. {   2313    ,   55  ,   2314    ,   45  ,   "2-4"   }   ,   --  lev 82
  1051. {   2313    ,   55  ,   2314    ,   45  ,   "2-4"   }   ,   --  lev 83
  1052. {   1131    ,   60  ,   2315    ,   45  ,   "5-10"} ,   --  lev 84
  1053. {   1131    ,   60  ,   2315    ,   45  ,   "5-10"} ,   --  lev 85
  1054. {   1132    ,   60  ,   1135    ,   50  ,   "5-10"} ,   --  lev 86
  1055. {   1132    ,   60  ,   1135    ,   50  ,   "5-10"} ,   --  lev 87
  1056. {   1133    ,   60  ,   1136    ,   50  ,   "5-10"} ,   --  lev 88
  1057. {   1133    ,   60  ,   1137    ,   50  ,   "5-10"} ,   --  lev 89
  1058. {   1132    ,   60  ,   1137    ,   40  ,   "5-10"} ,   --  lev 90
  1059.  
  1060. }
  1061.  
  1062. special.levelup_reward1 =
  1063. {
  1064.     -- warrior assassin  sura  shaman
  1065.     {     0,        0,      0,      0 },
  1066.     { 11200,    11400,  11600,  11800 }, -- °©żĘ
  1067.     { 12200,    12340,  12480,  12620 }, -- Ĺő±¸
  1068.     { 13000,    13000,  13000,  13000 }  -- ąćĆĐ
  1069. }
  1070.  
  1071. -- levelup_reward1 Ĺ×ŔĚşí Ĺ©±âş¸´Ů ·ąş§ŔĚ łôľĆÁö¸é ľĆ·ˇ
  1072. -- Ĺ×ŔĚşíŔ» ŔĚżëÇĎż© ľĆŔĚĹŰŔ» ÁŘ´Ů.
  1073. special.levelup_reward3 = {
  1074.     -- pct   item #  item count
  1075.     {   33,  27002,  10 }, -- 25%
  1076.     {   67,  27005,  10 }, -- 25%
  1077.   --{   75,  27101,   5 }, -- 25%
  1078.     {  100,  27114,   5 }, -- 25%
  1079. }
  1080.  
  1081. special.levelup_reward_gold21 =
  1082. {
  1083.     { 10000,    20 },
  1084.     { 20000,    50 },
  1085.     { 40000,    25 },
  1086.     { 80000,    3 },
  1087.     { 100000,   2 },
  1088. }
  1089. special.levelup_reward_gold31 =
  1090. {
  1091.     { 20000,    20 },
  1092.     { 40000,    40 },
  1093.     { 60000,    25 },
  1094.     { 80000,    10 },
  1095.     { 100000,   5 },
  1096. }
  1097. special.levelup_reward_gold41 =
  1098. {
  1099.     { 40000,    20 },
  1100.     { 60000,    40 },
  1101.     { 80000,    25 },
  1102.     { 100000,   10 },
  1103.     { 150000,   5 },
  1104. }
  1105. special.levelup_reward_gold51 =
  1106. {
  1107.     { 60000,    20 },
  1108.     { 80000,    40 },
  1109.     { 100000,   25 },
  1110.     { 150000,   10 },
  1111.     { 200000,   5 },
  1112. }
  1113.  
  1114. special.levelup_reward_exp21 =
  1115. {
  1116.     { 2,    9 },
  1117.     { 3,    14 },
  1118.     { 4,    39 },
  1119.     { 6,    24 },
  1120.     { 8,    9 },
  1121.     { 10,   4 },
  1122. }
  1123.  
  1124. special.levelup_reward_exp31 =
  1125. {
  1126.     { 2,    10 },
  1127.     { 2.5,  15 },
  1128.     { 3,    40 },
  1129.     { 3.5,  25 },
  1130.     { 4,    8 },
  1131.     { 4.5,  5 },
  1132.     { 5,    2 },
  1133. }
  1134. special.levelup_reward_exp41 =
  1135. {
  1136.     { 2,    10 },
  1137.     { 2.5,  15 },
  1138.     { 3,    40 },
  1139.     { 3.5,  25 },
  1140.     { 4,    8 },
  1141.     { 4.5,  5 },
  1142.     { 5,    2 },
  1143. }
  1144. special.levelup_reward_exp51 =
  1145. {
  1146.     { 1,    10 },
  1147.     { 1.5,  15 },
  1148.     { 2,    40 },
  1149.     { 2.5,  25 },
  1150.     { 3,    8 },
  1151.     { 3.5,  5 },
  1152.     { 4,    2 },
  1153. }
  1154. special.levelup_reward_exp84 =
  1155. {
  1156.     { 5,    9 },
  1157.     { 6,    14 },
  1158.     { 7,    39 },
  1159.     { 8,    24 },
  1160.     { 9,    9 },
  1161.     { 10,   4 },
  1162. }
  1163.  
  1164. special.levelup_reward_item_21 =
  1165. {
  1166.     -- no couple ring
  1167.     { { 27002, 10 }, { 27005, 10 }, { 27114, 10 } }, -- lev 21
  1168.     { 15080, 15100, 15120, 15140 }, -- lev 22
  1169.     { 16080, 16100, 16120, 16140 }, -- lev 23
  1170.     { 17080, 17100, 17120, 17140 }, -- lev 24
  1171.     { { 27002, 10 }, { 27005, 10 }, { 27114, 10 } }, -- lev 25
  1172.     { { 27003, 20 }, { 27006, 20 }, { 27114, 10 } }, -- over lev 25
  1173.  
  1174.     -- with couple ring
  1175.     -- { { 27002, 10 }, { 27005, 10 }, { 27114, 10 }, { 70301, 1 } }, -- lev 21
  1176.     -- { 15080, 15100, 15120, 15140, 70301 }, -- lev 22
  1177.     -- { 16080, 16100, 16120, 16140, 70301 }, -- lev 23
  1178.     -- { 17080, 17100, 17120, 17140, 70301 }, -- lev 24
  1179.     -- { { 27002, 10 }, { 27005, 10 }, { 27114, 10 }, { 70301, 1 } }, -- lev 25
  1180.     -- { { 27003, 20 }, { 27006, 20 }, { 27114, 10 } }, -- over lev 25
  1181. }
  1182.  
  1183. special.warp_to_pos = {
  1184. -- ˝Â·ć°î
  1185.     {
  1186.     { 402100, 673900 },
  1187.     { 270400, 739900 },
  1188.     { 321300, 808000 },
  1189.     },
  1190. --µµż°Č­Áö
  1191.     {
  1192. --A 5994 7563
  1193. --B 5978 6222
  1194. --C 7307 6898
  1195.     { 599400, 756300 },
  1196.     { 597800, 622200 },
  1197.     { 730700, 689800 },
  1198.     },
  1199. --żµşń»ç¸·
  1200.     {
  1201. --A 2178 6272
  1202.     { 217800, 627200 },
  1203. --B 2219 5027
  1204.     { 221900, 502700 },
  1205. --C 3440 5025
  1206.     { 344000, 502500 },
  1207.     },
  1208. --Ľ­ÇŃ»ę
  1209.     {
  1210. --A 4342 2906
  1211.     { 434200, 290600 },
  1212. --B 3752 1749
  1213.     { 375200, 174900 },
  1214. --C 4918 1736
  1215.     { 491800, 173600 },
  1216.     },
  1217. }
  1218.  
  1219. special.devil_tower =
  1220. {
  1221.     --{ 123, 608 },
  1222.     { 2048+126, 6656+384 },
  1223.     { 2048+134, 6656+147 },
  1224.     { 2048+369, 6656+629 },
  1225.     { 2048+369, 6656+401 },
  1226.     { 2048+374, 6656+167 },
  1227.     { 2048+579, 6656+616 },
  1228.     { 2048+578, 6656+392 },
  1229.     { 2048+575, 6656+148 },
  1230. }
  1231.  
  1232. special.lvq_map = {
  1233.     { -- "A1" 1
  1234.         {},
  1235.    
  1236.         { { 440, 565 }, { 460, 771 }, { 668, 800 },},
  1237.         { { 440, 565 }, { 460, 771 }, { 668, 800 },},
  1238.         { { 440, 565 }, { 460, 771 }, { 668, 800 },},
  1239.         {{496, 401}, {494, 951}, {542, 1079}, {748, 9741},},
  1240.         {{496, 401}, {494, 951}, {542, 1079}, {748, 9741},},
  1241.         {{496, 401}, {494, 951}, {542, 1079}, {748, 9741},},
  1242.         {{496, 401}, {494, 951}, {542, 1079}, {748, 9741},},
  1243.         {{496, 401}, {494, 951}, {542, 1079}, {748, 9741},},
  1244.         {{496, 401}, {494, 951}, {542, 1079}, {748, 9741},},
  1245.         {{496, 401}, {494, 951}, {542, 1079}, {748, 9741},},
  1246.        
  1247.         {{496, 401}, {494, 951}, {542, 1079}, {748, 9741},},
  1248.         {{853,557}, {845,780}, {910,956},},
  1249.         {{853,557}, {845,780}, {910,956},},
  1250.         {{340, 179}, {692, 112}, {787, 256}, {898, 296},},
  1251.         {{340, 179}, {692, 112}, {787, 256}, {898, 296},},
  1252.         {{340, 179}, {692, 112}, {787, 256}, {898, 296},},
  1253.         {{340, 179}, {692, 112}, {787, 256}, {898, 296},},
  1254.         {{340, 179}, {692, 112}, {787, 256}, {898, 296},},
  1255.         {{340, 179}, {692, 112}, {787, 256}, {898, 296},},
  1256.         {{340, 179}, {692, 112}, {787, 256}, {898, 296},},
  1257.        
  1258.         {{224,395}, {137,894}, {206,830}, {266,1067},},
  1259.         {{224,395}, {137,894}, {206,830}, {266,1067},},
  1260.         {{224,395}, {137,894}, {206,830}, {266,1067},},
  1261.         {{405,74}},
  1262.         {{405,74}},
  1263.         {{405,74}},
  1264.         {{405,74}},
  1265.         {{405,74}},
  1266.         {{405,74}},
  1267.         {{405,74}},
  1268.        
  1269.         {{405,74}}, {{405,74}}, {{405,74}}, {{405,74}}, {{405,74}}, {{405,74}}, {{405,74}}, {{405,74}}, {{405,74}}, {{405,74}},
  1270.        
  1271.         {{405,74}}, {{405,74}}, {{405,74}}, {{405,74}}, {{405,74}}, {{405,74}}, {{405,74}}, {{405,74}}, {{405,74}},
  1272.     },
  1273.  
  1274.  
  1275.     { -- "A2" 2
  1276.         {},
  1277.        
  1278.         {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }},
  1279.        
  1280.         {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }},
  1281.        
  1282.         {{ 640,1437 }}, {{ 640,1437 }}, {{ 640,1437 }}, {{640,1437}}, {{640,1437}}, {{640,1437}}, {{640,1437}}, {{640,1437}}, {{640,1437}}, {{640,1437}},
  1283.        
  1284.         {{640,1437}}, {{640,1437}}, {{640,1437}}, {{640,1437}}, {{640,1437}}, {{640,1437}}, {{640,1437}}, {{640,1437}}, {{640,1437}}, {{640,1437}},
  1285.        
  1286.         {{640,1437}},
  1287.         {{640,1437}},
  1288.         {{640,1437}},
  1289.         {{244,1309}, {4567,1080}, {496,885}, {798,975}, {1059,1099}, {855,1351},},
  1290.         {{244,1309}, {4567,1080}, {496,885}, {798,975}, {1059,1099}, {855,1351},},
  1291.         {{244,1309}, {4567,1080}, {496,885}, {798,975}, {1059,1099}, {855,1351},},
  1292.         {{244,1309}, {4567,1080}, {496,885}, {798,975}, {1059,1099}, {855,1351},},
  1293.         {{193,772}, {390,402}, {768,600}, {1075,789}, {1338,813},},
  1294.         {{193,772}, {390,402}, {768,600}, {1075,789}, {1338,813},},
  1295.     },
  1296.  
  1297.  
  1298.  
  1299.     { -- "A3" 3
  1300.         {},
  1301.  
  1302.         {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }},
  1303.         {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }}, {{ 948,804 }},
  1304.  
  1305.         {{ 948,804 }},
  1306.         {{ 948,804 }},
  1307.         {{ 948,804 }},
  1308.         {{438, 895}, {725, 864}, {632, 671},},
  1309.         {{438, 895}, {725, 864}, {632, 671},},
  1310.         {{438, 895}, {725, 864}, {632, 671},},
  1311.         {{438, 895}, {725, 864}, {632, 671},},
  1312.         {{438, 895}, {725, 864}, {632, 671},},
  1313.         {{847, 412}, {844, 854}, {823, 757}, {433, 407},},
  1314.         {{847, 412}, {844, 854}, {823, 757}, {433, 407},},
  1315.         {{847, 412}, {844, 854}, {823, 757}, {433, 407},},
  1316.         {{847, 412}, {844, 854}, {823, 757}, {433, 407},},
  1317.         {{847, 412}, {844, 854}, {823, 757}, {433, 407},},
  1318.         {{316,168}, {497,130}, {701,157}, {858,316},},
  1319.         {{316,168}, {497,130}, {701,157}, {858,316},},
  1320.         {{316,168}, {497,130}, {701,157}, {858,316},},
  1321.         {{316,168}, {497,130}, {701,157}, {858,316},},
  1322.         {{316,168}, {497,130}, {701,157}, {858,316},},
  1323.         {{316,168}, {497,130}, {701,157}, {858,316},},
  1324.         {{316,168}, {497,130}, {701,157}, {858,316},},
  1325.         {{200,277}, {130,646}, {211,638}, {291,851},},
  1326.         {{200,277}, {130,646}, {211,638}, {291,851},},
  1327.         {{200,277}, {130,646}, {211,638}, {291,851},},
  1328.         {{100,150}},
  1329.         {{100,150}},
  1330.         {{100,150}},
  1331.         {{100,150}},
  1332.         {{100,150}},
  1333.         {{100,150}},
  1334.     },
  1335.  
  1336.     {}, -- 4
  1337.     {}, -- 5
  1338.     {}, -- 6
  1339.     {}, -- 7
  1340.     {}, -- 8
  1341.     {}, -- 9
  1342.     {}, -- 10
  1343.     {}, -- 11
  1344.     {}, -- 12
  1345.     {}, -- 13
  1346.     {}, -- 14
  1347.     {}, -- 15
  1348.     {}, -- 16
  1349.     {}, -- 17
  1350.     {}, -- 18
  1351.     {}, -- 19
  1352.     {}, -- 20
  1353.  
  1354.     { -- "B1" 21
  1355.         {},
  1356.        
  1357.         {{412,635}, {629,428}, {829,586},},
  1358.         {{412,635}, {629,428}, {829,586},},
  1359.         {{412,635}, {629,428}, {829,586},},
  1360.         {{329,643}, {632,349}, {905,556},},
  1361.         {{329,643}, {632,349}, {905,556},},
  1362.         {{329,643}, {632,349}, {905,556},},
  1363.         {{329,643}, {632,349}, {905,556},},
  1364.         {{329,643}, {632,349}, {905,556},},
  1365.         {{329,643}, {632,349}, {905,556},},
  1366.         {{329,643}, {632,349}, {905,556},},
  1367.  
  1368.         {{329,643}, {632,349}, {905,556},},
  1369.         {{866,822}, {706,224}, {247,722},},
  1370.         {{866,822}, {706,224}, {247,722},},
  1371.         {{617,948}, {353,221},},
  1372.         {{617,948}, {353,221},},
  1373.         {{617,948}, {353,221},},
  1374.         {{617,948}, {353,221},},
  1375.         {{617,948}, {353,221},},
  1376.         {{617,948}, {353,221},},
  1377.         {{617,948}, {353,221},},
  1378.    
  1379.         {{496,1089}, {890,1043},},
  1380.         {{496,1089}, {890,1043},},
  1381.         {{496,1089}, {890,1043},},
  1382.         {{876,1127}},
  1383.         {{876,1127}},
  1384.         {{876,1127}},
  1385.         {{876,1127}},
  1386.         {{876,1127}},
  1387.         {{876,1127}},
  1388.         {{876,1127}},
  1389.    
  1390.         {{876,1127}}, {{876,1127}}, {{876,1127}}, {{876,1127}}, {{876,1127}},   {{876,1127}},   {{876,1127}},   {{876,1127}},   {{876,1127}}, {{876,1127}},
  1391.         {{876,1127}}, {{876,1127}}, {{876,1127}}, {{908,87}},   {{908,87}},     {{908,87}},     {{908,87}},     {{908,87}},     {{908,87}},
  1392.     },
  1393.  
  1394.     { -- "B2" 22
  1395.         {},
  1396.  
  1397.         {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }},
  1398.         {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }},
  1399.         {{ 95,819 }}, {{ 95,819 }}, {{ 95,819 }}, {{746,1438}}, {{746,1438}}, {{746,1438}}, {{746,1438}}, {{746,1438}}, {{746,1438}}, {{746,1438}},
  1400.         {{746,1438}}, {{746,1438}}, {{746,1438}}, {{746,1438}}, {{746,1438}}, {{746,1438}}, {{746,1438}}, {{746,1438}}, {{746,1438}}, {{746,1438}},
  1401.  
  1402.         {{746,1438}},
  1403.         {{746,1438}},
  1404.         {{746,1438}},
  1405.         {{ 172,810}, {288,465}, {475,841}, {303,156}, {687,466},},
  1406.         {{ 172,810}, {288,465}, {475,841}, {303,156}, {687,466},},
  1407.         {{ 172,810}, {288,465}, {475,841}, {303,156}, {687,466},},
  1408.         {{ 172,810}, {288,465}, {475,841}, {303,156}, {687,466},},
  1409.         {{787,235}, {1209,382}, {1350,571}, {1240,852}, {1254,1126}, {1078,1285}, {727,1360},},
  1410.         {{787,235}, {1209,382}, {1350,571}, {1240,852}, {1254,1126}, {1078,1285}, {727,1360},},
  1411.     },
  1412.  
  1413.  
  1414.     { -- "B3" 23
  1415.         {},
  1416.        
  1417.         {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }},
  1418.         {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }}, {{ 106,88 }},
  1419.  
  1420.          {{ 106,88 }},
  1421.         {{ 106,88 }},
  1422.         {{ 106,88 }},
  1423.         {{230, 244}, {200, 444}, {594, 408},},
  1424.         {{230, 244}, {200, 444}, {594, 408},},
  1425.         {{230, 244}, {200, 444}, {594, 408},},
  1426.         {{230, 244}, {200, 444}, {594, 408},},
  1427.         {{230, 244}, {200, 444}, {594, 408},},
  1428.         {{584,204}, {720,376}, {861,272},},
  1429.         {{584,204}, {720,376}, {861,272},},
  1430.         {{584,204}, {720,376}, {861,272},},
  1431.         {{584,204}, {720,376}, {861,272},},
  1432.         {{584,204}, {720,376}, {861,272},},
  1433.         {{566,694}, {349,574}, {198,645},},
  1434.         {{566,694}, {349,574}, {198,645},},
  1435.         {{566,694}, {349,574}, {198,645},},
  1436.         {{566,694}, {349,574}, {198,645},},
  1437.         {{566,694}, {349,574}, {198,645},},
  1438.         {{566,694}, {349,574}, {198,645},},
  1439.         {{566,694}, {349,574}, {198,645},},
  1440.         {{816,721}, {489,823},},
  1441.         {{816,721}, {489,823},},
  1442.         {{816,721}, {489,823},},
  1443.         {{772,140}},
  1444.         {{772,140}},
  1445.         {{772,140}},
  1446.         {{772,140}},
  1447.         {{772,140}},
  1448.         {{772,140}},
  1449.     },
  1450.  
  1451.     {}, -- 24
  1452.     {}, -- 25
  1453.     {}, -- 26
  1454.     {}, -- 27
  1455.     {}, -- 28
  1456.     {}, -- 29
  1457.     {}, -- 30
  1458.     {}, -- 31
  1459.     {}, -- 32
  1460.     {}, -- 33
  1461.     {}, -- 34
  1462.     {}, -- 35
  1463.     {}, -- 36
  1464.     {}, -- 37
  1465.     {}, -- 38
  1466.     {}, -- 39
  1467.     {}, -- 40
  1468.  
  1469.     { -- "C1" 41
  1470.         {},
  1471.  
  1472.         {{385,446}, {169,592}, {211,692}, {632,681},},
  1473.         {{385,446}, {169,592}, {211,692}, {632,681},},
  1474.         {{385,446}, {169,592}, {211,692}, {632,681},},
  1475.         {{385,374}, {227,815}, {664,771},},
  1476.         {{385,374}, {227,815}, {664,771},},
  1477.         {{385,374}, {227,815}, {664,771},},
  1478.         {{385,374}, {227,815}, {664,771},},
  1479.         {{385,374}, {227,815}, {664,771},},
  1480.         {{385,374}, {227,815}, {664,771},},
  1481.         {{385,374}, {227,815}, {664,771},},
  1482.        
  1483.         {{385,374}, {227,815}, {664,771},},
  1484.         {{169,362}, {368,304}, {626,409}, {187,882}, {571,858},},
  1485.         {{169,362}, {368,304}, {626,409}, {187,882}, {571,858},},
  1486.         {{178,275}, {365,242}, {644,313}, {194,950}, {559,936},},
  1487.         {{178,275}, {365,242}, {644,313}, {194,950}, {559,936},},
  1488.         {{178,275}, {365,242}, {644,313}, {194,950}, {559,936},},
  1489.         {{178,275}, {365,242}, {644,313}, {194,950}, {559,936},},
  1490.         {{178,275}, {365,242}, {644,313}, {194,950}, {559,936},},
  1491.         {{178,275}, {365,242}, {644,313}, {194,950}, {559,936},},
  1492.         {{178,275}, {365,242}, {644,313}, {194,950}, {559,936},},
  1493.        
  1494.         {{452,160}, {536,1034}, {184,1044},},
  1495.         {{452,160}, {536,1034}, {184,1044},},
  1496.         {{452,160}, {536,1034}, {184,1044},},
  1497.         {{137,126}},
  1498.         {{137,126}},
  1499.         {{137,126}},
  1500.         {{137,126}},
  1501.         {{137,126}},
  1502.         {{137,126}},
  1503.         {{137,126}},
  1504.        
  1505.         {{137,126}}, {{137,126}}, {{137,126}}, {{137,126}}, {{137,126}}, {{137,126}}, {{137,126}}, {{137,126}}, {{137,126}}, {{137,126}},
  1506.         {{137,126}}, {{137,126}}, {{137,126}}, {{137,126}}, {{137,126}}, {{137,126}}, {{137,126}}, {{137,126}}, {{137,126}},
  1507.     },
  1508.  
  1509.     { -- "C2" 42
  1510.         {},
  1511.  
  1512.         {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}},
  1513.         {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}},
  1514.         {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}},
  1515.         {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}}, {{1409,139}},
  1516.    
  1517.         {{1409,139}},
  1518.         {{1409,139}},
  1519.         {{1409,139}},
  1520.         {{991,222}, {1201,525}, {613,232}, {970,751}, {1324,790},},
  1521.         {{991,222}, {1201,525}, {613,232}, {970,751}, {1324,790},},
  1522.         {{991,222}, {1201,525}, {613,232}, {970,751}, {1324,790},},
  1523.         {{991,222}, {1201,525}, {613,232}, {970,751}, {1324,790},},
  1524.         {{192,211}, {247,600}, {249,882}, {987,981}, {1018,1288}, {1303,1174},},
  1525.         {{192,211}, {247,600}, {249,882}, {987,981}, {1018,1288}, {1303,1174},},
  1526.     },
  1527.  
  1528.     { -- "C3" 43
  1529.         {},
  1530.  
  1531.         {{901,151}}, {{901,151}}, {{901,151}}, {{901,151}}, {{901,151}}, {{901,151}}, {{901,151}}, {{901,151}}, {{901,151}}, {{901,151}},
  1532.         {{901,151}}, {{901,151}}, {{901,151}}, {{901,151}}, {{901,151}}, {{901,151}}, {{901,151}}, {{901,151}}, {{901,151}}, {{901,151}},
  1533.    
  1534.         {{901,151}},
  1535.         {{901,151}},
  1536.         {{901,151}},
  1537.         {{421, 189}, {167, 353},},
  1538.         {{421, 189}, {167, 353},},
  1539.         {{421, 189}, {167, 353},},
  1540.         {{421, 189}, {167, 353},},
  1541.         {{421, 189}, {167, 353},},
  1542.         {{679,459}, {505,709},},
  1543.         {{679,459}, {505,709},},
  1544.         {{679,459}, {505,709},},
  1545.         {{679,459}, {505,709},},
  1546.         {{679,459}, {505,709},},
  1547.         {{858,638}, {234,596},},
  1548.         {{858,638}, {234,596},},
  1549.         {{858,638}, {234,596},},
  1550.         {{858,638}, {234,596},},
  1551.         {{858,638}, {234,596},},
  1552.         {{858,638}, {234,596},},
  1553.         {{858,638}, {234,596},},
  1554.         {{635,856}, {324,855},},
  1555.         {{635,856}, {324,855},},
  1556.         {{635,856}, {324,855},},
  1557.         {{136,899}},
  1558.         {{136,899}},
  1559.         {{136,899}},
  1560.         {{136,899}},
  1561.         {{136,899}},
  1562.         {{136,899}},
  1563.     },
  1564.  
  1565.     {}, -- 44
  1566.     {}, -- 45
  1567.     {}, -- 46
  1568.     {}, -- 47
  1569.     {}, -- 48
  1570.     {}, -- 49
  1571.     {}, -- 50
  1572.     {}, -- 51
  1573.     {}, -- 52
  1574.     {}, -- 53
  1575.     {}, -- 54
  1576.     {}, -- 55
  1577.     {}, -- 56
  1578.     {}, -- 57
  1579.     {}, -- 58
  1580.     {}, -- 59
  1581.     {}, -- 60
  1582. }
  1583.  
  1584. function BuildSkillList(job, group)
  1585.     local skill_vnum_list = {}
  1586.     local skill_name_list = {}
  1587.  
  1588.     if pc.get_skill_group() != 0 then
  1589.         local skill_list = special.active_skill_list[job+1][group]
  1590.                
  1591.         table.foreachi( skill_list,
  1592.             function(i, t)
  1593.                 local lev = pc.get_skill_level(t)
  1594.  
  1595.                 if lev > 0 then
  1596.                     local name = locale.GM_SKILL_NAME_DICT[t]
  1597.  
  1598.                     if name != nil then
  1599.                         table.insert(skill_vnum_list, t)
  1600.                         table.insert(skill_name_list, name)
  1601.                     end
  1602.                 end
  1603.             end
  1604.         )
  1605.     end
  1606.  
  1607.     table.insert(skill_vnum_list, 0)
  1608.     table.insert(skill_name_list, locale.cancel)
  1609.  
  1610.     return { skill_vnum_list, skill_name_list }
  1611. end
  1612.  
  1613. --BEGIN EDIT created for Heavens cave pre event, Arne 23Sept09
  1614. -- Table for storing character names,
  1615. char_name_list = {}
  1616.    char_name_list[1] = {}
  1617.    char_name_list[2] = {}
  1618.    char_name_list[3] = {}
  1619.    char_name_list[4] = {}
  1620.    char_name_list[5] = {}
  1621.    char_name_list[6] = {}
  1622.    char_name_list[7] = {}
  1623.    char_name_list[8] = {}
  1624.    char_name_list[9] = {}
  1625.    char_name_list[10] = {}
  1626.  
  1627. --no return, just used for storing a name into the list
  1628. function store_charname_by_id(id, charname, charid)
  1629.        char_name_list[id]["name"] = charname
  1630.        char_name_list[id]["eid"] = charid
  1631.     return nil
  1632. end
  1633.  
  1634. -- returns the name of a given list item, id is the highscore slot
  1635. function return_charname_by_id(charid)
  1636.     local counter = 11
  1637.     repeat
  1638.         counter = counter -1
  1639.     until char_name_list[counter]["eid"] == charid
  1640.     return char_name_list[counter]["name"]
  1641. end
  1642.  
  1643.  function get_map_name_by_number(number)
  1644. map_name = {
  1645. --EmpireNr-MapNrs
  1646.         [1] = {[1] = gameforge.functions._100_say, [2] = gameforge.functions._130_say, [3] = gameforge.functions._130_say,  [4] = gameforge.functions._160_say, [61] = gameforge.functions._200_say, [62] = gameforge.functions._210_say, [63] = gameforge.functions._220_say, [64] = gameforge.functions._190_say, [65] = gameforge.functions._230_say, [72] = gameforge.functions._240_say, [73] = gameforge.functions._240_say,},
  1647.         [2] = {[1] = gameforge.functions._110_say, [2] = gameforge.functions._140_say, [3] = gameforge.functions._140_say,  [4] = gameforge.functions._170_say, [61] = gameforge.functions._200_say, [62] = gameforge.functions._210_say, [63] = gameforge.functions._220_say, [64] = gameforge.functions._190_say, [65] = gameforge.functions._230_say, [72] = gameforge.functions._240_say, [73] = gameforge.functions._240_say,},
  1648.         [3] = {[1] = gameforge.functions._120_say, [2] = gameforge.functions._150_say, [3] = gameforge.functions._150_say,  [4] = gameforge.functions._180_say, [61] = gameforge.functions._200_say, [62] = gameforge.functions._210_say, [63] = gameforge.functions._220_say, [64] = gameforge.functions._190_say, [65] = gameforge.functions._230_say, [72] = gameforge.functions._240_say, [73] = gameforge.functions._240_say,},
  1649. }
  1650.     return map_name[pc.get_empire()][number]
  1651. end
  1652. --END EDIT
  1653.  
  1654. PREMIUM_EXP             = 0
  1655. PREMIUM_ITEM            = 1
  1656. PREMIUM_SAFEBOX         = 2
  1657. PREMIUM_AUTOLOOT        = 3
  1658. PREMIUM_FISH_MIND       = 4
  1659. PREMIUM_MARRIAGE_FAST   = 5
  1660. PREMIUM_GOLD            = 6
  1661.  
  1662. -- point type start
  1663. POINT_NONE                 = 0
  1664. POINT_LEVEL                = 1
  1665. POINT_VOICE                = 2
  1666. POINT_EXP                  = 3
  1667. POINT_NEXT_EXP             = 4
  1668. POINT_HP                   = 5
  1669. POINT_MAX_HP               = 6
  1670. POINT_SP                   = 7
  1671. POINT_MAX_SP               = 8  
  1672. POINT_STAMINA              = 9  --˝şĹ׹̳Ę
  1673. POINT_MAX_STAMINA          = 10 --ĂÖ´ë ˝şĹ׹̳Ę
  1674.  
  1675. POINT_GOLD                 = 11
  1676. POINT_ST                   = 12 --±Ů·Â
  1677. POINT_HT                   = 13 --ĂĽ·Â
  1678. POINT_DX                   = 14 --ąÎøĽş
  1679. POINT_IQ                   = 15 --Á¤˝Ĺ·Â
  1680. POINT_DEF_GRADE         = 16
  1681. POINT_ATT_SPEED            = 17 --°ř°ÝĽÓµµ
  1682. POINT_ATT_GRADE         = 18 --°ř°Ý·Â MAX
  1683. POINT_MOV_SPEED            = 19 --Ŕ̵żĽÓµµ
  1684. POINT_CLIENT_DEF_GRADE      = 20 --ąćľîµî±Ţ
  1685. POINT_CASTING_SPEED        = 21 --ÁÖą®ĽÓµµ (Äđ´ŮżîŸŔÓ*100) / (100 + ŔĚ°Ş) = ĂÖÁľ Äđ´Ůżî ŸŔÓ
  1686. POINT_MAGIC_ATT_GRADE      = 22 --¸¶ąý°ř°Ý·Â
  1687. POINT_MAGIC_DEF_GRADE      = 23 --¸¶ąýąćľî·Â
  1688. POINT_EMPIRE_POINT         = 24 --Á¦±ąÁˇĽö
  1689. POINT_LEVEL_STEP           = 25 --ÇŃ ·ąş§żˇĽ­ŔÇ ´Ü°č.. (1 2 3 µÉ ¶§ ş¸»ó 4 µÇ¸é ·ąş§ ľ÷)
  1690. POINT_STAT                 = 26 --´É·Âġ żĂ¸± Ľö ŔÖ´Â °łĽö
  1691. POINT_SUB_SKILL         = 27 --ş¸Á¶ ˝şĹł Ć÷ŔÎĆ®
  1692. POINT_SKILL             = 28 --ľ×ĆĽşę ˝şĹł Ć÷ŔÎĆ®
  1693. POINT_WEAPON_MIN            = 29 --ą«±â ĂÖĽŇ µĄąĚÁö
  1694. POINT_WEAPON_MAX            = 30 --ą«±â ĂÖ´ë µĄąĚÁö
  1695. POINT_PLAYTIME             = 31 --ÇĂ·ąŔ̽ðŁ
  1696. POINT_HP_REGEN             = 32 --HP ȸşą·ü
  1697. POINT_SP_REGEN             = 33 --SP ȸşą·ü
  1698.  
  1699. POINT_BOW_DISTANCE         = 34 --Č° »çÁ¤°Ĺ¸® Áő°ˇÄˇ (meter)
  1700.  
  1701. POINT_HP_RECOVERY          = 35 --ĂĽ·Â ȸşą Áő°ˇ·®
  1702. POINT_SP_RECOVERY          = 36 --Á¤˝Ĺ·Â ȸşą Áő°ˇ·®
  1703.  
  1704. POINT_POISON_PCT           = 37 --µ¶ Č®·ü
  1705. POINT_STUN_PCT             = 38 --±âŔý Č®·ü
  1706. POINT_SLOW_PCT             = 39 --˝˝·Îżě Č®·ü
  1707. POINT_CRITICAL_PCT         = 40 --Ĺ©¸®ĆĽÄĂ Č®·ü
  1708. POINT_PENETRATE_PCT        = 41 --°üĹëŸ°Ý Č®·ü
  1709. POINT_CURSE_PCT            = 42 --ŔúÁÖ Č®·ü
  1710.  
  1711. POINT_ATTBONUS_HUMAN       = 43 --ŔΰŁżˇ°Ô °­ÇÔ
  1712. POINT_ATTBONUS_ANIMAL      = 44 --µżą°żˇ°Ô µĄąĚÁö % Áő°ˇ
  1713. POINT_ATTBONUS_ORC         = 45 --żő±Íżˇ°Ô µĄąĚÁö % Áő°ˇ
  1714. POINT_ATTBONUS_MILGYO      = 46 --ąĐ±łżˇ°Ô µĄąĚÁö % Áő°ˇ
  1715. POINT_ATTBONUS_UNDEAD      = 47 --˝ĂĂĽżˇ°Ô µĄąĚÁö % Áő°ˇ
  1716. POINT_ATTBONUS_DEVIL       = 48 --¸¶±Í(ľÇ¸¶)żˇ°Ô µĄąĚÁö % Áő°ˇ
  1717. POINT_ATTBONUS_INSECT      = 49 --ąú·ąÁ·
  1718. POINT_ATTBONUS_FIRE        = 50 --Č­ż°Á·
  1719. POINT_ATTBONUS_ICE         = 51 --şůĽłÁ·
  1720. POINT_ATTBONUS_DESERT      = 52 --»ç¸·Á·
  1721. POINT_ATTBONUS_MONSTER     = 53 --¸đµç ¸ó˝şĹÍżˇ°Ô °­ÇÔ
  1722. POINT_ATTBONUS_WARRIOR     = 54 --ą«»çżˇ°Ô °­ÇÔ
  1723. POINT_ATTBONUS_ASSASSIN = 55 --ŔÚ°´żˇ°Ô °­ÇÔ
  1724. POINT_ATTBONUS_SURA     = 56 --Ľö¶óżˇ°Ô °­ÇÔ
  1725. POINT_ATTBONUS_SHAMAN       = 57 --ą«´çżˇ°Ô °­ÇÔ
  1726.  
  1727. -- ADD_TRENT_MONSTER
  1728. POINT_ATTBONUS_TREE         = 58 --łŞą«żˇ°Ô °­ÇÔ 20050729.myevan UNUSED5
  1729. -- END_OF_ADD_TRENT_MONSTER
  1730. POINT_RESIST_WARRIOR        = 59 --ą«»çżˇ°Ô ŔúÇ×
  1731. POINT_RESIST_ASSASSIN       = 60 --ŔÚ°´żˇ°Ô ŔúÇ×
  1732. POINT_RESIST_SURA           = 61 --Ľö¶óżˇ°Ô ŔúÇ×
  1733. POINT_RESIST_SHAMAN     = 62 --ą«´çżˇ°Ô ŔúÇ×
  1734.  
  1735. POINT_STEAL_HP             = 63 --»ý¸í·Â ČíĽö
  1736. POINT_STEAL_SP             = 64 --Á¤˝Ĺ·Â ČíĽö
  1737.  
  1738. POINT_MANA_BURN_PCT        = 65 --¸¶łŞ ąř
  1739.  
  1740. --/ ÇÇÇؽà ş¸łĘ˝ş =/
  1741.  
  1742. POINT_DAMAGE_SP_RECOVER    = 66 --°ř°Ý´çÇŇ ˝Ă Á¤˝Ĺ·Â ȸşą Č®·ü
  1743.  
  1744. POINT_BLOCK                = 67 --şí·°Ŕ˛
  1745. POINT_DODGE                = 68 --ȸÇÇŔ˛
  1746.  
  1747. POINT_RESIST_SWORD         = 69
  1748. POINT_RESIST_TWOHAND       = 70
  1749. POINT_RESIST_DAGGER        = 71
  1750. POINT_RESIST_BELL          = 72
  1751. POINT_RESIST_FAN           = 73
  1752. POINT_RESIST_BOW           = 74  --Č­»ě   ŔúÇ×   : ´ëąĚÁö °¨ĽŇ
  1753. POINT_RESIST_FIRE          = 75  --Č­ż°   ŔúÇ×   : Č­ż°°ř°Ýżˇ ´ëÇŃ ´ëąĚÁö °¨ĽŇ
  1754. POINT_RESIST_ELEC          = 76  --Ŕü±â   ŔúÇ×   : Ŕü±â°ř°Ýżˇ ´ëÇŃ ´ëąĚÁö °¨ĽŇ
  1755. POINT_RESIST_MAGIC         = 77  --Ľúąý   ŔúÇ×   : ¸đµçĽúąýżˇ ´ëÇŃ ´ëąĚÁö °¨ĽŇ
  1756. POINT_RESIST_WIND          = 78  --ąŮ¶÷   ŔúÇ×   : ąŮ¶÷°ř°Ýżˇ ´ëÇŃ ´ëąĚÁö °¨ĽŇ
  1757.  
  1758. POINT_REFLECT_MELEE        = 79 --°ř°Ý ąÝ»ç
  1759.  
  1760. --/ ĆŻĽö ÇÇÇؽà =/
  1761. POINT_REFLECT_CURSE     = 80 --ŔúÁÖ ąÝ»ç
  1762. POINT_POISON_REDUCE     = 81 --µ¶µĄąĚÁö °¨ĽŇ
  1763.  
  1764. --/ Ŕű ĽŇ¸ę˝Ă =/
  1765. POINT_KILL_SP_RECOVER       = 82 --Ŕű ĽŇ¸ę˝Ă MP ȸşą
  1766. POINT_EXP_DOUBLE_BONUS      = 83
  1767. POINT_GOLD_DOUBLE_BONUS     = 84
  1768. POINT_ITEM_DROP_BONUS       = 85
  1769.  
  1770. --/ ȸşą °ü·Ă =/
  1771. POINT_POTION_BONUS          = 86
  1772. POINT_KILL_HP_RECOVERY      = 87
  1773.  
  1774. POINT_IMMUNE_STUN           = 88
  1775. POINT_IMMUNE_SLOW           = 89
  1776. POINT_IMMUNE_FALL           = 90
  1777. --========
  1778.  
  1779. POINT_PARTY_ATTACKER_BONUS      = 91
  1780. POINT_PARTY_TANKER_BONUS        = 92
  1781.  
  1782. POINT_ATT_BONUS         = 93
  1783. POINT_DEF_BONUS         = 94
  1784.  
  1785. POINT_ATT_GRADE_BONUS       = 95
  1786. POINT_DEF_GRADE_BONUS       = 96
  1787. POINT_MAGIC_ATT_GRADE_BONUS = 97
  1788. POINT_MAGIC_DEF_GRADE_BONUS = 98
  1789.  
  1790. POINT_RESIST_NORMAL_DAMAGE      = 99
  1791.  
  1792. POINT_HIT_HP_RECOVERY       = 100
  1793. POINT_HIT_SP_RECOVERY       = 101
  1794. POINT_MANASHIELD            = 102 --Čć˝ĹĽöČŁ ˝şĹłżˇ ŔÇÇŃ ¸¶łŞ˝Żµĺ Čż°ú Á¤µµ
  1795.  
  1796. POINT_PARTY_BUFFER_BONUS        = 103
  1797. POINT_PARTY_SKILL_MASTER_BONUS  = 104
  1798.  
  1799. POINT_HP_RECOVER_CONTINUE       = 105
  1800. POINT_SP_RECOVER_CONTINUE       = 106
  1801.  
  1802. POINT_STEAL_GOLD            = 107
  1803. POINT_POLYMORPH         = 108 --şŻ˝ĹÇŃ ¸ó˝şĹÍ ąřČŁ
  1804. POINT_MOUNT             = 109 --Ÿ°íŔÖ´Â ¸ó˝şĹÍ ąřČŁ
  1805.  
  1806. POINT_PARTY_HASTE_BONUS     = 110
  1807. POINT_PARTY_DEFENDER_BONUS      = 111
  1808. POINT_STAT_RESET_COUNT      = 112 --ÇÇŔÇ ´Üľŕ »çżëŔ» ĹëÇŃ ˝şĹÝ ¸®ĽÂ Ć÷ŔÎĆ® (1´ç 1Ć÷ŔÎĆ® ¸®ĽÂ°ˇ´É)
  1809.  
  1810. POINT_HORSE_SKILL           = 113
  1811.  
  1812. POINT_MALL_ATTBONUS     = 114 --°ř°Ý·Â +x%
  1813. POINT_MALL_DEFBONUS     = 115 --ąćľî·Â +x%
  1814. POINT_MALL_EXPBONUS     = 116 --°ćÇčġ +x%
  1815. POINT_MALL_ITEMBONUS        = 117 --ľĆŔĚĹŰ µĺ·ÓŔ˛ x/10ąč
  1816. POINT_MALL_GOLDBONUS        = 118 --µ· µĺ·ÓŔ˛ x/10ąč
  1817.  
  1818. POINT_MAX_HP_PCT            = 119 --ĂÖ´ë»ý¸í·Â +x%
  1819. POINT_MAX_SP_PCT            = 120 --ĂÖ´ëÁ¤˝Ĺ·Â +x%
  1820.  
  1821. POINT_SKILL_DAMAGE_BONUS        = 121 --˝şĹł µĄąĚÁö *(100+x)%
  1822. POINT_NORMAL_HIT_DAMAGE_BONUS   = 122 --ĆňŸ µĄąĚÁö *(100+x)%
  1823.  
  1824. -- DEFEND_BONUS_ATTRIBUTES
  1825. POINT_SKILL_DEFEND_BONUS        = 123 --˝şĹł ąćľî µĄąĚÁö
  1826. POINT_NORMAL_HIT_DEFEND_BONUS   = 124 --ĆňŸ ąćľî µĄąĚÁö
  1827. -- END_OF_DEFEND_BONUS_ATTRIBUTES
  1828.  
  1829. -- PC_BANG_ITEM_ADD
  1830. POINT_PC_BANG_EXP_BONUS     = 125 --PCąć Ŕüżë °ćÇčġ ş¸łĘ˝ş
  1831. POINT_PC_BANG_DROP_BONUS        = 126 --PCąć Ŕüżë µĺ·Ó·ü ş¸łĘ˝ş
  1832. -- END_PC_BANG_ITEM_ADD
  1833.  
  1834. POINT_ANTI_RESIST_MAGIC = 127
  1835.  
  1836. -- POINT_MAX_NUM = 128  common/length.h
  1837. -- point type start
  1838.  
  1839.  
  1840. function input_number (sentence)
  1841.      say (sentence)
  1842.      local n = nil
  1843.      while n == nil do
  1844.          n = tonumber (input())
  1845.          if n != nil then
  1846.              break
  1847.          end
  1848.          say ("input number")
  1849.      end
  1850.      return n
  1851.  end
  1852. ITEM_NONE = 0
  1853. ITEM_WEAPON = 1
  1854. ITEM_ARMOR = 2
  1855.  
  1856. WEAPON_SWORD = 0
  1857. WEAPON_DAGGER = 1
  1858. WEAPON_BOW = 2
  1859. WEAPON_TWO_HANDED = 3
  1860. WEAPON_BELL = 4
  1861. WEAPON_FAN = 5
  1862. WEAPON_ARROW = 6
  1863. WEAPON_MOUNT_SPEAR = 7
  1864.  
  1865. --dofile( get_locale_base_path() .. "/quest/GFquestlib.lua")
  1866.  
  1867. function get_today_count(questname, flag_name)
  1868.     local today = math.floor(get_global_time() / 86400)
  1869.     local today_flag = flag_name.."_today"
  1870.     local today_count_flag = flag_name.."_today_count"
  1871.     local last_day = pc.getf(questname, today_flag)
  1872.     if last_day == today then
  1873.         return pc.getf(questname, today_count_flag)
  1874.     else
  1875.         return 0
  1876.     end
  1877. end
  1878. -- "$flag_name"_today unix_timestamp % 86400
  1879. -- "$flag_name"_count count
  1880. function inc_today_count(questname, flag_name, count)
  1881.     local today = math.floor(get_global_time() / 86400)
  1882.     local today_flag = flag_name.."_today"
  1883.     local today_count_flag = flag_name.."_today_count"
  1884.     local last_day = pc.getqf(questname, today_flag)
  1885.     if last_day == today then
  1886.         pc.setf(questname, today_count_flag, pc.getf(questname, today_count_flag) + 1)
  1887.     else
  1888.         pc.setf(questname, today_flag, today)
  1889.         pc.setf(questname, today_count_flag, 1)
  1890.     end
  1891. end
  1892.  
  1893. -- This function will return true always in window os,
  1894. --  but not in freebsd.
  1895. -- (In window os, RAND_MAX = 0x7FFF = 32767.)
  1896. function drop_gamble_with_flag(drop_flag)
  1897.         local dp, range = pc.get_killee_drop_pct()
  1898.         dp = 40000 * dp / game.get_event_flag(drop_flag)
  1899.         if dp < 0 or range < 0 then
  1900.             return false
  1901.         end
  1902.         return dp >= number(1, range)
  1903. end
  1904.  
  1905. function give_item(a, b)
  1906.     pc.give_item2(a, b)
  1907. end
  1908.  
  1909. function remove_item_time()
  1910.     pc.remove_item(71035, 1)
  1911. end
  1912.  
  1913. function remove_warp(a)
  1914.     pc.setf("warp_ring","warps", pc.getf("warp_ring", "warps") - a)
  1915. end
  1916. function setvarchar(name, var)
  1917.     local laenge = string.len (var)
  1918.     local setchar = 0
  1919.     local save_name = 0
  1920.     local letter = 0
  1921.     while laenge > setchar do
  1922.         setchar = setchar + 1
  1923.         letter = string.sub (var, setchar, setchar)
  1924.         letter = string.byte(letter, 1)
  1925.         save_name = ""..name.."_char_"..setchar..""
  1926.         pc.setqf(save_name, letter)
  1927.     end
  1928.     local save_laenge=""..name.."laenge"
  1929.     pc.setqf(save_laenge, laenge)
  1930. end
  1931.  
  1932.  
  1933. function getvarchar(name)
  1934.     local save_laenge = ""..name.."laenge"
  1935.     local laenge = pc.getqf(save_laenge)
  1936.     local save_name = 0
  1937.     local var = ""
  1938.     local letter = 0
  1939.     local getchar = 0
  1940.     while laenge > getchar do
  1941.         getchar = getchar + 1
  1942.         save_name = ""..name.."_char_"..getchar..""
  1943.         letter = pc.getqf(save_name)
  1944.         if letter!=0 then
  1945.             letter = string.char(letter)
  1946.         else
  1947.             letter = ""
  1948.         end
  1949.         var = ""..var..""..letter..""
  1950.     end
  1951.     return var
  1952. end
  1953.  
  1954. function give_md(z)
  1955. mysql_direct_query("UPDATE account.account SET coins = coins + ".. z .." WHERE id = ".. pc.get_account_id() ..";")
  1956. end
  1957.    
  1958. if QUESTLIB_EXTRA_LUA==nil then QUESTLIB_EXTRA_LUA=1.0 -- include_guard begin
  1959.  
  1960. -- RACE DECLARING BEGIN
  1961. WARRIOR_M   = 0
  1962. NINJA_W     = 1
  1963. SURA_M      = 2
  1964. SHAMAN_W    = 3
  1965. WARRIOR_W   = 4
  1966. NINJA_M     = 5
  1967. SURA_W      = 6
  1968. SHAMAN_M    = 7
  1969. WOLFMAN_M   = 8
  1970. -- RACE DECLARING END
  1971. -- ########################################################################################
  1972.  
  1973. -- ########################################################################################
  1974. -- AFF DECLARING BEGIN
  1975. AFF_NONE = 0
  1976.  
  1977. AFF_YMIR = 1
  1978. AFF_INVISIBILITY = 2
  1979. AFF_SPAWN = 3
  1980.  
  1981. AFF_POISON = 4
  1982. AFF_SLOW = 5
  1983. AFF_STUN = 6
  1984.  
  1985. AFF_DUNGEON_READY = 7
  1986. AFF_DUNGEON_UNIQUE = 8
  1987.  
  1988. AFF_BUILDING_CONSTRUCTION_SMALL = 9
  1989. AFF_BUILDING_CONSTRUCTION_LARGE = 10
  1990. AFF_BUILDING_UPGRADE = 11
  1991.  
  1992. AFF_MOV_SPEED_POTION = 12
  1993. AFF_ATT_SPEED_POTION = 13
  1994.  
  1995. AFF_FISH_MIND = 14
  1996.  
  1997. AFF_JEONGWIHON = 15
  1998. AFF_GEOMGYEONG = 16
  1999. AFF_CHEONGEUN = 17
  2000. AFF_GYEONGGONG = 18
  2001. AFF_EUNHYUNG = 19
  2002. AFF_GWIGUM = 20
  2003. AFF_TERROR = 21
  2004. AFF_JUMAGAP = 22
  2005. AFF_HOSIN = 23
  2006. AFF_BOHO = 24
  2007. AFF_KWAESOK = 25
  2008. AFF_MANASHIELD = 26
  2009. AFF_MUYEONG = 27
  2010. AFF_REVIVE_INVISIBLE = 28
  2011. AFF_FIRE = 29
  2012. AFF_GICHEON = 30
  2013. AFF_JEUNGRYEOK = 31
  2014. AFF_TANHWAN_DASH = 32
  2015. AFF_PABEOP = 33
  2016. AFF_CHEONGEUN_WITH_FALL = 34
  2017. AFF_POLYMORPH = 35
  2018. AFF_WAR_FLAG1 = 36
  2019. AFF_WAR_FLAG2 = 37
  2020. AFF_WAR_FLAG3 = 38
  2021.  
  2022. AFF_CHINA_FIREWORK = 39
  2023. AFF_HAIR = 40
  2024. AFF_GERMANY =  41
  2025.  
  2026. AFF_RAMADAN_RING =  42
  2027.  
  2028. AFF_BLEEDING =  43
  2029. AFF_RED_POSSESSION =  44
  2030. AFF_BLUE_POSSESSION =  45
  2031.  
  2032. AFF_BITS_MAX = 46
  2033. -- AFF DECLARING END
  2034. -- ########################################################################################
  2035.  
  2036. -- ########################################################################################
  2037. -- C3 NEMERE BEGIN
  2038. function setDFR_from_table(l_antiflag, l_vid)
  2039.     for i,v in ipairs(l_antiflag) do
  2040.         d.set_damage_from_race(v, l_vid)
  2041.     end
  2042. end
  2043.  
  2044. function setDFA_from_table(l_antiflag, l_vid)
  2045.     for i,v in ipairs(l_antiflag) do
  2046.         d.set_damage_from_affect(v, l_vid)
  2047.     end
  2048. end
  2049.  
  2050. -- 6151
  2051. Szel_4thfloor_affectlimit   = {AFF_HOSIN}
  2052. Szel_7thfloor_affectlimit   = {AFF_GICHEON}
  2053. -- 8058
  2054. IceMetin_racelimit          = {WARRIOR_M,WARRIOR_W,NINJA_W,NINJA_M,SURA_M,SURA_W}
  2055. -- 20399
  2056. IceStonePillar_racelimit    = {WARRIOR_M,WARRIOR_W,SURA_M,SURA_W}
  2057. -- C3 NEMERE END
  2058. -- ########################################################################################
  2059.  
  2060. -- ########################################################################################
  2061. -- AUTO CHECK EVENT FLAGS AT STARTUP BEGIN
  2062. function check_event_flags()
  2063.     local event_table =
  2064.     {
  2065.         {"no_mount_at_guild_war", 0},
  2066.     }
  2067.     for num1,str1 in ipairs(event_table) do
  2068.         if game.get_event_flag(str1[1])~=str1[2] then
  2069.             game.set_event_flag(str1[1], str1[2])
  2070.         end
  2071.     end
  2072. end
  2073. check_event_flags()
  2074. -- AUTO CHECK EVENT FLAGS AT STARTUP END
  2075. -- ########################################################################################
  2076.  
  2077. end -- include_guard end
  2078.  
  2079. function say_albastru(name) say(color256(0, 0, 255)..name..color256(0, 0, 255)) end
  2080. function say_rosu(name) say(color256(255, 0, 0)..name..color256(255, 0, 0)) end
  2081. function say_verde(name) say(color256(200, 255 , 200)..name..color256(196, 196, 196)) end
  2082. function say_verde2(name) say(color256(0, 238, 0)..name..color256(0, 238, 0)) end
  2083. function say_auriu(name) say(color256(255, 215, 0)..name..color256(255, 215, 0)) end
  2084. function say_negru(name) say(color256(0, 0, 0)..name..color256(0, 0, 0)) end
  2085. function say_alb(name) say(color256(255, 255, 255)..name..color256(255, 255, 255)) end
  2086. function say_galben(name) say(color256(255, 255, 0)..name..color256(255, 255, 0)) end
  2087. function say_albastru2(name) say(color256(147, 248, 255)..name..color256(147, 248, 255)) end
  2088.  
  2089. function get_pachet()
  2090.     local ret = pc.getf("ox", "pachet")
  2091.     return ret
  2092. end
  2093.  
  2094. function set_pachet(value)
  2095.     pc.setf("ox", "pachet", value)
  2096. end
  2097.  
  2098. function get_pachet2()
  2099.     local ret = pc.getf("ox", "pachet_final")
  2100.     return ret
  2101. end
  2102.  
  2103. function set_pachet2(value)
  2104.     pc.setf("ox", "pachet_final", value)
  2105. end
  2106.  
  2107. function get_pachet3()
  2108.     local ret = pc.getf("ox", "pachet_intre_runde")
  2109.     return ret
  2110. end
  2111.  
  2112. function set_pachet3(value)
  2113.     pc.setf("ox", "pachet_intre_runde", value)
  2114. end
  2115.  
  2116. function quiz()
  2117.     if (oxevent.quiz(1,30) == 1) then
  2118.         return
  2119.     end
  2120. end
  2121.  
  2122. function timing_procces(s)
  2123.     m = math.floor(s / 60)
  2124.     h = math.floor(m / 60)
  2125.     d = math.floor(h / 24)
  2126.     if s == nil then
  2127.         return
  2128.     end
  2129.     if s <= 60 then
  2130.         return string.format("%d sec", s)
  2131.     end
  2132.     if s > 60 then
  2133.         if m <= 60 then
  2134.             s = math.mod(s, 60)
  2135.             return string.format("%d min and %d sec", m, s)
  2136.         end
  2137.         if m > 60 then
  2138.             if h <= 24 then
  2139.                 m1 = math.mod(m, 60)
  2140.                 return string.format("%d hour(s) and %d min", h, m1)
  2141.             end
  2142.             if h > 24 then
  2143.                 h = math.mod(h, 24)
  2144.                 return string.format("%d day(s) and %d hour(s)", d, h)
  2145.             end
  2146.         end
  2147.     end
  2148. end
  2149.  
  2150.  
  2151. function start_items()
  2152.     local get_pachet = get_pachet()
  2153.  
  2154.     oxevent.give_item(event_config["start_items_packet"][get_pachet][1], event_config["start_items_packet"][get_pachet][2])
  2155.     oxevent.give_item(event_config["start_items_packet"][get_pachet][3], event_config["start_items_packet"][get_pachet][4])
  2156.     oxevent.give_item(event_config["start_items_packet"][get_pachet][5], event_config["start_items_packet"][get_pachet][6])
  2157.     notice_all(ox_event_text[45][41]..get_pachet..ox_event_text[45][42])
  2158. end
  2159.  
  2160. function medium_items()
  2161.     local get_pachet3 = get_pachet3()
  2162.    
  2163.     oxevent.give_item(event_config["medium_items_packet"][get_pachet3][1], event_config["medium_items_packet"][get_pachet3][2])
  2164.     notice_all(ox_event_text[45][41]..get_pachet3..ox_event_text[45][42])
  2165. end
  2166.  
  2167. function end_items()
  2168.     local get_pachet2 = get_pachet2()
  2169.    
  2170.     oxevent.give_item(event_config["end_items_packet"][get_pachet2][1], event_config["end_items_packet"][get_pachet2][2])
  2171.     if event_config["end_give_items_to_attender"] == 1 then
  2172.         notice_all(ox_event_text[45][43]..event_config["end_items_packet"][get_pachet2][2].." x "..item_name(event_config["end_items_packet"][get_pachet2][1]))
  2173.     else
  2174.         notice_all(ox_event_text[45][44]..event_config["end_items_packet"][get_pachet2][2].." x "..item_name(event_config["end_items_packet"][get_pachet2][1]))
  2175.     end
  2176. end
  2177.  
  2178. function return_real_time_values(tabel, arr)
  2179.     local real_time_values = tabel
  2180.    
  2181.     return real_time_values[arr]
  2182. end
  2183.  
  2184. function pc_is_gm()
  2185.     for i,k in ipairs(return_real_time_values(SERVER_CONFIG_SETTINGS, "gm_list")) do
  2186.         if pc.get_name() == k then
  2187.             return true
  2188.         else
  2189.             return false
  2190.         end
  2191.     end
  2192. end
  2193.  
  2194. hide_winners = {}
  2195.  
  2196. function add_winners(winner)
  2197.     table.insert(hide_winners, winner)
  2198.    
  2199.     return hide_winners
  2200. end
  2201.  
  2202. function check_winners(winner)
  2203.     for i,k in pairs(hide_winners) do
  2204.         if k == winner then
  2205.             return true
  2206.         end
  2207.     end
  2208. end
  2209.  
  2210. function remove_winners(winner)
  2211.     table.remove(hide_winners, winner)
  2212. end
  2213.  
  2214. function clear_event()
  2215.     clear_server_timer("premiu_ox", get_server_timer_arg())
  2216.     clear_server_timer("intrebari_in_10_s", get_server_timer_arg())
  2217.     clear_server_timer("close_gates", get_server_timer_arg())
  2218.     clear_server_timer("end_ox", get_server_timer_arg())
  2219.     clear_server_timer("start_ox_gates", get_server_timer_arg())
  2220.     game.set_event_flag("automatic_ox_status", 0)
  2221.     game.set_event_flag("automatic_ox_premiu_status", 0)
  2222.     game.set_event_flag("give_items_check", 0)
  2223.     game.set_event_flag("check_timer", 0)
  2224.     set_pachet(0)
  2225.     set_pachet2(0)
  2226.     set_pachet3(0)
  2227.     oxevent.end_event()
  2228. end
  2229.  
  2230. function get_time_remaining(seconds)
  2231.     if seconds == nil then
  2232.         return "ERROR NIL"
  2233.     end
  2234.     if seconds <= 60 then
  2235.         return string.format("%d sec", seconds)
  2236.     else
  2237.         local minutes = math.floor(seconds / 60)
  2238.         seconds = math.mod(seconds, 60)
  2239.         if minutes <= 60 then
  2240.             return string.format("%d min si %d sec", minutes, seconds)
  2241.         else
  2242.             local hours = math.floor(minutes / 60)
  2243.             minutes = math.mod(minutes, 60)
  2244.             if hours <= 24 then
  2245.                 return string.format("%d ore si %d min", hours, minutes)
  2246.             else
  2247.                 local days = math.floor(hours / 24)
  2248.                 hours = math.mod(hours, 24)
  2249.                 return string.format("%d zi(le) si %d ore", days, hours)
  2250.             end
  2251.         end
  2252.     end
  2253. end
  2254.  
  2255. function set_coins(id)
  2256.     mysql_direct_query("UPDATE account.account SET vote4buff = vote4buff - 1 WHERE id = "..id..";")
  2257. end
  2258.  
  2259.  
  2260.  
  2261. function read_server_line(path, shut)
  2262.     local tableline = {}
  2263.    
  2264.     for linie in io.lines(path) do
  2265.         table.insert(tableline, linie)
  2266.     end
  2267.    
  2268.     return tableline[shut]
  2269. end
  2270.  
  2271. function getinput(value)
  2272.     cmdchat("GetInputStart")
  2273.     local ret = input(cmdchat(value))
  2274.     cmdchat("GetInputStop")
  2275.     return ret
  2276. end
  2277.  
  2278. dofile(get_locale_base_path().."/quest/QL_Libs/functions.lua")
  2279. dofile(get_locale_base_path().."/quest/QL_Libs/SpiderQueensNestLib.lua")
  2280. dofile(get_locale_base_path().."/quest/QL_Libs/DemonTowerLib.lua")
  2281. dofile(get_locale_base_path().."/quest/QL_Libs/TeleportRingLib.lua")
  2282. dofile(get_locale_base_path().."/quest/QL_Libs/DungeonWithTimerLib.lua")
  2283. dofile(get_locale_base_path().."/quest/new_functions.lua")
  2284. dofile(get_locale_base_path().."/quest/dungeonLib.lua")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement