Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- quest hunting begin
- state start begin
- function setting()
- return {
- ["hTytul"] = "Hunting",
- ["hOpis1"] = "Go on the hunt to hone in merciless ",
- ["hOpis2"] = "killing as ruthless monsters!",
- ["hOpis3"] = "On each level you can choose the form ",
- ["hOpis4"] = "of the four monsters that want to kill.",
- ["hOpis5"] = "For the execution of the mission is a reward. I am in a hurry.",
- ["hOpis6"] = "Go to the Yang-Shin to start the mission!.",
- ["hDisc1"] = "Yang-Shin sends you to hunt. [ENTER] Your goal is to:",
- ["hDisc2a"] = "You have to kill yet",
- ["hDisc2b"] = "such [ENTER] monsters",
- ["hDisc3"] = "So far ? uśmierciłeś ? ",
- ["hNagTytul"] = "Reward",
- ["hNagOpis1"] = "Return to Yang-Shin and ask him to report.",
- ["hNagOpis2"] = "You will receive the award for bravery in combat.",
- ["hNag1"] = "For the task you have the right to choose one of two prizes.",
- ["hNag2"] = "Choose wisely.",
- ["hYouCant1"] = "I can not give you another mission. You have a little bit to improve my!",
- ["hYouCant2"] = "Come back when you reach the next level of experience.",
- ["hNoMission1"] = "Unfortunately, I have a mission for you.",
- ["hNoMission2"] = "Return to me when you will become stronger.",
- --[[ In this table are stored respectively
- [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ę}, ]]--
- ["hMobSetTable"] =
- {
- --[idx] = {id1, count1, id2, count2, id3, count3, id4, count4, reward_id1, count_reward1, reward_id2, count_reward2, yang, exp},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- [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},
- },
- ["hEnableQuestIMG"] = 0,
- }
- end
- when letter begin
- local settings = hunting.setting()
- if pc.get_level() < pc.getqf("current")+1 then --In this way, check availability of mission at the current level.
- --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
- return
- end
- 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
- return
- end
- send_letter("Hunting - Expedition "..pc.getqf("current")+1)
- end
- when button or info begin
- local settings = hunting.setting()
- local mobs_table = {} --Empty array, which immediately ? zapełnimy ?
- say("Na co chcesz dzisiaj zapolować? ")
- 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
- table.insert(mobs_table, mob_name(settings.hMobSetTable[pc.getqf("current")+1][i]))
- end
- table.insert(mobs_table, "Anuluj") --I throw myself to the plate yet "Cancel" button
- local s=select_table(mobs_table) --then choose a table
- 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)
- return
- end
- pc.setqf("current", pc.getqf("current")+1) --Here, I set myself the Current to the current mission
- local current = pc.getqf("current")
- 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
- -- -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.
- pc.setqf("kill_count", settings.hMobSetTable[current][s*2]) --and here I throw a number of
- pc.setqf("killed_count", 0)
- --syschat(current.." | "..pc.getqf("kill_vnum").." | "..pc.getqf("kill_count")) --I used to debug
- set_state(zabij)
- end
- end
- state zabij begin
- when letter begin
- 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
- send_letter("Hunting")
- end
- when button or info begin
- local settings = hunting.setting()
- --[[ Here I display a text and image ]]--
- if hunting.setting().hEnableQuestIMG == 1 then
- setskin(SCROLL)
- setbgimage('level_bg.tga')
- addimage(20, 12, special.levelup_img[pc.getqf("kill_vnum")])
- end
- say_title(settings.hTytul)
- say_title(settings.hDisc1..""..mob_name(pc.getqf("kill_vnum")))
- say_title(settings.hDisc2a.." "..pc.getqf("kill_count")-pc.getqf("killed_count").." "..settings.hDisc2b)
- say_title(settings.hDisc3.." "..pc.getqf("killed_count").." "..mob_name(pc.getqf("kill_vnum")))
- end
- when kill with not npc.is_pc() and npc.get_race()==pc.getqf("kill_vnum") begin --event killing
- local settings = hunting.setting()
- local current = pc.getqf("current")
- 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
- q.set_counter(mob_name(pc.getqf("kill_vnum")), pc.getqf("kill_count")-pc.getqf("killed_count")) --updates the counter under N
- if pc.getqf("killed_count") >= pc.getqf("kill_count") then --if all killed ...
- clear_letter()
- set_state(reward)
- end
- end
- end
- state reward begin
- when letter begin
- local v = find_npc_by_vnum(20019)
- if v != 0 then
- target.vid("__TARGET__", v, "Yang-Shin")
- end
- send_letter("Award")
- end
- when button or info begin
- local settings = hunting.setting()
- local current = pc.getqf("current")
- --[[ Displays a window with a choice awards ]]--
- say_title(settings.hNagTytul)
- say(settings.hNag1)
- chat("wybor tablicy 1")
- 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)
- if s==1 then
- pc.give_item2(settings.hMobSetTable[current].ID_R1, settings.hMobSetTable[current].C_R1)
- else
- pc.give_item2(settings.hMobSetTable[current].ID_R2, settings.hMobSetTable[current].C_R2)
- end
- pc.change_money(tonumber(settings.hMobSetTable[current].YANG))
- pc.give_exp2(tonumber(settings.hMobSetTable[current].EXP))
- pc.delqf("kill_count")
- pc.delqf("killed_count")
- pc.delqf("kill_vnum")
- clear_letter()
- q.done()
- set_state(start)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement