Advertisement
NautilusEt

hunting_v3.quest translated

Jun 18th, 2014
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.93 KB | None | 0 0
  1. quest hunting begin
  2.     state start begin
  3.         function setting()
  4.             return {
  5.                 ["hTytul"] = "Hunting",
  6.                 ["hOpis1"] = "Go on the hunt to hone in merciless ",
  7.                 ["hOpis2"] = "killing as ruthless monsters!",
  8.                 ["hOpis3"] = "On each level you can choose the form ",
  9.                 ["hOpis4"] = "of the four monsters that want to kill.",
  10.                 ["hOpis5"] = "For the execution of the mission is a reward. I am in a hurry.",
  11.                 ["hOpis6"] = "Go to the Yang-Shin to start the mission!.",
  12.                 ["hDisc1"] = "Yang-Shin sends you to hunt. [ENTER] Your goal is to:",
  13.                 ["hDisc2a"] = "You have to kill yet",
  14.                 ["hDisc2b"] = "such [ENTER] monsters",
  15.                 ["hDisc3"] = "So far ? uśmierciłeś ? ",
  16.                 ["hNagTytul"] = "Reward",
  17.                 ["hNagOpis1"] = "Return to Yang-Shin and ask him to report.",
  18.                 ["hNagOpis2"] = "You will receive the award for bravery in combat.",
  19.                 ["hNag1"] = "For the task you have the right to choose one of two prizes.",
  20.                 ["hNag2"] = "Choose wisely.",
  21.                 ["hYouCant1"] = "I can not give you another mission. You have a little bit to improve my!",
  22.                 ["hYouCant2"] = "Come back when you reach the next level of experience.",
  23.                 ["hNoMission1"] = "Unfortunately, I have a mission for you.",
  24.                 ["hNoMission2"] = "Return to me when you will become stronger.",
  25.                
  26.                 --[[ In this table are stored respectively
  27.                     [level] = {id 1 moba, ilość, id 2 moba, ilość, id 3 moba, ilość, id 4 moba, ilość, id nagrody 1, ilość, id nagrody 2, ilość, yang za misję, exp za misję}, ]]--
  28.                 ["hMobSetTable"] =
  29.                 {
  30.                   --[idx] = {id1, count1, id2, count2, id3, count3, id4, count4, reward_id1, count_reward1, reward_id2, count_reward2, yang, exp},
  31.                     [1] =  {101, 10, 171, 10, 102, 7, 103, 5, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 1500, ["EXP"] = 500},
  32.                     [2] =  {102, 10, 172, 10, 103, 7, 104, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 2500, ["EXP"] = 1000},
  33.                     [3] =  {103, 10, 173, 10, 104, 7, 105, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 3500, ["EXP"] = 1500},
  34.                     [4] =  {104, 10, 174, 10, 105, 7, 106, 5, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 4500, ["EXP"] = 2000},
  35.                     [5] =  {105, 10, 175, 10, 106, 7, 107, 5, ["ID_R1"] = 8001, ["C_R1"] = 100, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 5500, ["EXP"] = 2500},
  36.                     [6] =  {106, 10, 176, 10, 107, 7, 108, 5, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 6500, ["EXP"] = 3000},
  37.                     [7] =  {107, 10, 177, 10, 108, 7, 109, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 7500, ["EXP"] = 3500},
  38.                     [8] =  {108, 10, 178, 10, 109, 7, 110, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 8500, ["EXP"] = 4000},
  39.                     [9] =  {109, 10, 179, 10, 110, 7, 111, 5, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 9500, ["EXP"] = 4500},
  40.                     [10] =  {110, 10, 180, 10, 111, 7, 112, 5, ["ID_R1"] = 8001, ["C_R1"] = 100, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 10500, ["EXP"] = 5000},
  41.                     [11] =  {111, 10, 181, 10, 112, 7, 113, 5, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 11500, ["EXP"] = 6000},
  42.                     [12] =  {112, 10, 182, 10, 113, 7, 114, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 12500, ["EXP"] = 6500},
  43.                     [13] =  {113, 10, 183, 10, 114, 7, 115, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 13500, ["EXP"] = 7000},
  44.                     [14] =  {114, 10, 184, 10, 115, 7, 131, 5, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 14500, ["EXP"] = 7500},
  45.                     [15] =  {115, 10, 185, 10, 131, 7, 132, 5, ["ID_R1"] = 8001, ["C_R1"] = 100, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 15500, ["EXP"] = 8000},
  46.                     [16] =  {131, 10, 132, 10, 133, 7, 134, 5, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 16500, ["EXP"] = 8500},
  47.                     [17] =  {132, 10, 133, 10, 134, 7, 135, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 17500, ["EXP"] = 9000},
  48.                     [18] =  {133, 10, 134, 10, 135, 7, 136, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 18500, ["EXP"] = 9500},
  49.                     [19] =  {134, 10, 135, 10, 136, 7, 137, 5, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 19500, ["EXP"] = 10000},
  50.                     [20] =  {135, 10, 136, 10, 137, 7, 138, 5, ["ID_R1"] = 8001, ["C_R1"] = 100, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 20500, ["EXP"] = 10500},
  51.                     [21] =  {301, 10, 351, 10, 303, 7, 304, 5, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 1500, ["EXP"] = 500},
  52.                     [22] =  {302, 10, 352, 10, 304, 7, 353, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 2500, ["EXP"] = 1000},
  53.                     [23] =  {303, 10, 353, 10, 354, 7, 331, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 3500, ["EXP"] = 1500},
  54.                     [24] =  {391, 10, 392, 10, 393, 10, 394, 10, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 4500, ["EXP"] = 2000},
  55.                     [25] =  {191, 5, 192, 5, 193, 5, 194, 5, ["ID_R1"] = 8001, ["C_R1"] = 100, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 5500, ["EXP"] = 2500},
  56.                     [26] =  {395, 10, 396, 10, 396, 10, 398, 10, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 6500, ["EXP"] = 3000},
  57.                     [27] =  {401, 10, 402, 10, 403, 7, 404, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 7500, ["EXP"] = 3500},
  58.                     [28] =  {402, 10, 403, 10, 404, 7, 405, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 8500, ["EXP"] = 4000},
  59.                     [29] =  {403, 10, 404, 10, 405, 7, 406, 5, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 9500, ["EXP"] = 4500},
  60.                     [30] =  {404, 10, 405, 10, 406, 7, 431, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 40500, ["EXP"] = 5000},
  61.                     [31] =  {405, 10, 406, 10, 431, 7, 432, 5, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 11500, ["EXP"] = 6000},
  62.                     [32] =  {406, 10, 431, 10, 432, 7, 433, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 12500, ["EXP"] = 6500},
  63.                     [33] =  {431, 10, 432, 10, 433, 7, 434, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 13500, ["EXP"] = 7000},
  64.                     [34] =  {432, 10, 433, 10, 434, 7, 435, 5, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 14500, ["EXP"] = 7500},
  65.                     [35] =  {433, 10, 434, 10, 435, 7, 436, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 15500, ["EXP"] = 8000},
  66.                     [36] =  {434, 10, 435, 10, 436, 7, 451, 5, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 16500, ["EXP"] = 8500},
  67.                     [37] =  {435, 10, 436, 10, 451, 7, 452, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 17500, ["EXP"] = 9000},
  68.                     [38] =  {436, 10, 451, 10, 452, 7, 453, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 18500, ["EXP"] = 9500},
  69.                     [39] =  {451, 10, 452, 10, 453, 7, 454, 5, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 19500, ["EXP"] = 40000},
  70.                     [40] =  {452, 10, 453, 10, 454, 20, 455, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 20500, ["EXP"] = 40500},
  71.                     [41] =  {531, 10, 532, 10, 533, 20, 534, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13023, ["C_R2"] = 1, ["YANG"] = 22500, ["EXP"] = 41500},
  72.                     [42] =  {631, 10, 632, 10, 633, 20, 634, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13042, ["C_R2"] = 1, ["YANG"] = 25000, ["EXP"] = 42500},
  73.                     [43] =  {651, 10, 652, 10, 653, 20, 654, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13042, ["C_R2"] = 1, ["YANG"] = 27500, ["EXP"] = 43500},
  74.                     [44] =  {701, 10, 702, 10, 703, 20, 704, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13042, ["C_R2"] = 1, ["YANG"] = 27500, ["EXP"] = 43500},
  75.                     [45] =  {702, 10, 703, 10, 704, 20, 705, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13042, ["C_R2"] = 1, ["YANG"] = 27500, ["EXP"] = 43500},
  76.                 },
  77.                 ["hEnableQuestIMG"] = 0,
  78.                
  79.             }
  80.         end
  81.        
  82.         when letter begin
  83.             local settings = hunting.setting()
  84.             if pc.get_level() < pc.getqf("current")+1 then  --In this way, check availability of mission at the current level.
  85.                                                             --pc.getqf("current") If you have not been set, is 0, so that the character could get on your level mission (born level 1) I need to add to it 1
  86.                 return
  87.             end
  88.             if settings.hMobSetTable[pc.getqf("current")+1] == nil then --If there is no mission in the table on my level, and all below already done, it shows a message that there is no mission
  89.                 return
  90.             end
  91.             send_letter("Hunting - Expedition "..pc.getqf("current")+1)
  92.         end
  93.        
  94.         when button or info begin                      
  95.             local settings = hunting.setting()
  96.             local mobs_table = {}               --Empty array, which immediately ? zapełnimy ?
  97.             say("Na co chcesz dzisiaj zapolować? ")
  98.            
  99.             for i=1,7,2 do                              --This loop retrieves the ID possible to kill monsters in the mission and throw their name into the empty array mobs_table
  100.                 table.insert(mobs_table, mob_name(settings.hMobSetTable[pc.getqf("current")+1][i]))
  101.             end
  102.             table.insert(mobs_table, "Anuluj")          --I throw myself to the plate yet "Cancel" button
  103.             local s=select_table(mobs_table)            --then choose a table
  104.            
  105.             if s == table.getn(mobs_table) then         --Returns if the item is equal to the size of the array (the array has five elements, and the fifth element is the "Cancel" button)
  106.                 return
  107.             end
  108.             pc.setqf("current", pc.getqf("current")+1)  --Here, I set myself the Current to the current mission
  109.             local current = pc.getqf("current")
  110.             pc.setqf("kill_vnum", settings.hMobSetTable[current][s*2-1])    --Here I set myself a mob to kill. s * 2 - 1 always gives the ID monster from the table according to the selected button
  111.                                                                             -- -1 Is because the cells of the monsters have odd ID, 1, 3, 5, 7 is a 1 * 2 2 2 * 2 -1 to 4 to 3 (because it is 3 in Table 2), etc.
  112.             pc.setqf("kill_count", settings.hMobSetTable[current][s*2])     --and here I throw a number of
  113.             pc.setqf("killed_count", 0)
  114.             --syschat(current.." | "..pc.getqf("kill_vnum").." | "..pc.getqf("kill_count")) --I used to debug
  115.             set_state(zabij)
  116.         end
  117.     end
  118.     state zabij begin
  119.         when letter begin
  120.             q.set_counter(mob_name(pc.getqf("kill_vnum")), pc.getqf("kill_count")-pc.getqf("killed_count")) --counter in the quest under the key N
  121.             send_letter("Hunting")
  122.         end
  123.         when button or info begin
  124.             local settings = hunting.setting()
  125.             --[[ Here I display a text and image ]]--
  126.             if hunting.setting().hEnableQuestIMG == 1 then         
  127.                 setskin(SCROLL)
  128.                 setbgimage('level_bg.tga')
  129.                 addimage(20, 12, special.levelup_img[pc.getqf("kill_vnum")])
  130.             end
  131.             say_title(settings.hTytul)
  132.             say_title(settings.hDisc1..""..mob_name(pc.getqf("kill_vnum")))
  133.             say_title(settings.hDisc2a.." "..pc.getqf("kill_count")-pc.getqf("killed_count").." "..settings.hDisc2b)
  134.             say_title(settings.hDisc3.." "..pc.getqf("killed_count").." "..mob_name(pc.getqf("kill_vnum")))        
  135.         end
  136.        
  137.         when kill with not npc.is_pc() and npc.get_race()==pc.getqf("kill_vnum") begin  --event killing
  138.             local settings = hunting.setting()
  139.             local current = pc.getqf("current")
  140.             pc.setqf("killed_count", pc.getqf("killed_count") + 1)  --I increase the number of dead, if the dead ID agrees with the ID monster that I kill
  141.             q.set_counter(mob_name(pc.getqf("kill_vnum")), pc.getqf("kill_count")-pc.getqf("killed_count")) --updates the counter under N
  142.             if pc.getqf("killed_count") >= pc.getqf("kill_count") then  --if all killed ...
  143.                 clear_letter()
  144.                 set_state(reward)
  145.             end
  146.         end
  147.     end
  148.     state reward begin
  149.         when letter begin
  150.             local v = find_npc_by_vnum(20019)
  151.             if v != 0 then
  152.                 target.vid("__TARGET__", v, "Yang-Shin")
  153.             end
  154.             send_letter("Award")
  155.         end
  156.        
  157.         when button or info begin
  158.             local settings = hunting.setting()
  159.             local current = pc.getqf("current")
  160.         --[[ Displays a window with a choice awards ]]--
  161.             say_title(settings.hNagTytul)
  162.             say(settings.hNag1)
  163.             chat("wybor tablicy 1")
  164.             local s=select(item_name(settings.hMobSetTable[current].ID_R1).." x"..settings.hMobSetTable[current].C_R1, item_name(settings.hMobSetTable[current].ID_R2).." x"..settings.hMobSetTable[current].C_R2)
  165.             if s==1 then
  166.                 pc.give_item2(settings.hMobSetTable[current].ID_R1, settings.hMobSetTable[current].C_R1)
  167.             else
  168.                 pc.give_item2(settings.hMobSetTable[current].ID_R2, settings.hMobSetTable[current].C_R2)
  169.             end
  170.             pc.change_money(tonumber(settings.hMobSetTable[current].YANG))
  171.             pc.give_exp2(tonumber(settings.hMobSetTable[current].EXP))
  172.            
  173.             pc.delqf("kill_count")
  174.             pc.delqf("killed_count")
  175.             pc.delqf("kill_vnum")
  176.             clear_letter()
  177.             q.done()
  178.             set_state(start)
  179.         end
  180.     end
  181. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement