Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 22.69 KB | None | 0 0
  1. --[[
  2.     Date:       23.10.2017
  3.     Quest Name: Herbal.lua
  4.     Author:     Dominik Michalski
  5.     Version:    1.0.0
  6. ]]--
  7.  
  8. quest herbal begin
  9.     -- send target and talk about this system with npc
  10.     state start begin
  11.         when login or levelup or enter with pc.level >= 40 begin
  12.             set_state (herb_inform)
  13.         end
  14.     end
  15.     state herb_inform begin
  16.         when letter begin
  17.             send_letter("Rośliny")
  18.             local v = find_npc_by_vnum (20142)
  19.             if v != 0 then
  20.                 target.vid ("__TARGET__",v,"Idź do Zielarki")
  21.             end
  22.         end
  23.         when button or info begin
  24.             say_cegla("  Oferta:")
  25.             say("")
  26.             say("Zielarka znajdująca się w Mistycznej Puszczy")
  27.             say("ma dla Ciebie ofertę.")
  28.             say("Użyj Pierścienia Teleportacji, aby ją odwiedzić.")
  29.             say("")
  30.         end
  31.        
  32.         when __TARGET__.target.click or 20142.chat."Rośliny" begin
  33.             target.delete("__TARGET__")
  34.             say_title(mob_name(20142))
  35.             say("")
  36.             say("Witaj Poszukiwaczu Przygód!")
  37.             say("Znajdujemy się w Mistycznej Puszczy, niedawno odkryliśmy  ")
  38.             say("tę lokację i odczytaliśmy starożytne inskrypcje.")
  39.             say("")
  40.             say("Zapisano w nich, jak wytwarzać specjalne napary  ")
  41.             say("wzmacnające nas w walce. ")
  42.             say("Teraz już wiemy co możemy zrobić z roślinami wystepującymi")
  43.             say("na wszystkich mapach!. Pokażę Ci podstawy ich katologowania,")
  44.             say("jeśli tylko jakieś zdobędziesz przynieś je do mnie, a")
  45.             say("postaram się zrobić z nich napary, które pomogą Ci w walce.")
  46.             say("")
  47.             wait()
  48.             say_title(mob_name(20142))
  49.             say("")
  50.             say("Proszę, to Sierp dzięki któremu będzie Ci łatwiej ")
  51.             say("zbierać rośliny, wraz ze zbieraniem roślin Sierpem ")
  52.             say("zwięsza się jego szansa na pomyślne zebranie rośliny.")
  53.             say("Jest również dostępny Magiczny Sierp, który zapewnia")
  54.             say("100% szans na zebranie rośliny, lecz moze zostać użyty ")
  55.             say("tylko 10 razy.")
  56.             say("")
  57.             say_item_vnum(herbal.settings()['specialItemVnum'], "Magiczny Sierp", "Dzięki temu przedmiotowi możesz zebrać każdy napotkany kwiat.")
  58.             say("")
  59.             pc.give_item2(herbal.settings()['defaultItemVnum'],1)
  60.             pc.give_item2(herbal.settings()['specialItemVnum'],1)
  61.             pc.set_skill_level(herbal.settings()['skillVnum'], herbal.getSkillLevel()+1)
  62.             clear_letter()
  63.             set_state(main_part)
  64.         end
  65.        
  66.     -- just for inform if player didn't click on mission
  67.         -- click on box npc
  68.         -- click on box npc
  69.         when 20136.click begin
  70.             herbal.cutFlower(false, 20136, -1)
  71.         end
  72.        
  73.         when 20137.click begin
  74.             herbal.cutFlower(false, 20137, -1)
  75.         end
  76.        
  77.         when 20138.click begin
  78.             herbal.cutFlower(false, 20138, -1)
  79.         end
  80.        
  81.         when 20139.click begin
  82.             herbal.cutFlower(false, 20139, -1)
  83.         end
  84.        
  85.         when 20140.click begin
  86.             herbal.cutFlower(false, 20140, -1)
  87.         end
  88.        
  89.         when 20141.click begin
  90.             herbal.cutFlower(false, 20141, -1)
  91.         end
  92.        
  93.         -- use default sickle item
  94.         when 20136.take with item.vnum == 51017 begin
  95.             if herbal.sickleItemProcess() == true then
  96.                 if herbal.cutFlower(false, 20136, item.get_socket(1)) == true then
  97.                     herbal.sicklePointIncrease()
  98.                 end
  99.             end
  100.         end
  101.        
  102.         when 20137.take with item.vnum == 51017 begin
  103.             if herbal.sickleItemProcess() == true then
  104.                 if herbal.cutFlower(false, 20137, item.get_socket(1)) == true then
  105.                     herbal.sicklePointIncrease()
  106.                 end
  107.             end
  108.         end
  109.        
  110.         when 20138.take with item.vnum == 51017 begin
  111.             if herbal.sickleItemProcess() == true then
  112.                 if herbal.cutFlower(false, 20138, item.get_socket(1)) == true then
  113.                     herbal.sicklePointIncrease()
  114.                 end
  115.             end
  116.         end
  117.        
  118.         when 20139.take with item.vnum == 51017 begin
  119.             if herbal.sickleItemProcess() == true then
  120.                 if herbal.cutFlower(false, 20139, item.get_socket(1)) == true then
  121.                     herbal.sicklePointIncrease()
  122.                 end
  123.             end
  124.         end
  125.        
  126.         when 20140.take with item.vnum == 51017 begin
  127.             if herbal.sickleItemProcess() == true then
  128.                 if herbal.cutFlower(false, 20140, item.get_socket(1)) == true then
  129.                     herbal.sicklePointIncrease()
  130.                 end
  131.             end
  132.         end
  133.        
  134.         when 20141.take with item.vnum == 51017 begin
  135.             if herbal.sickleItemProcess() == true then
  136.                 if herbal.cutFlower(false, 20141, item.get_socket(1)) == true then
  137.                     herbal.sicklePointIncrease()
  138.                 end
  139.             end
  140.         end
  141.        
  142.         -- use Special Item to pick flower
  143.         when 20136.take with item.vnum == 51027 begin
  144.             if herbal.specialItemProcess() == true then
  145.                 herbal.cutFlower(true, 20136, -1)
  146.             end
  147.         end
  148.        
  149.         when 20137.take with item.vnum == 51027 begin
  150.             if herbal.specialItemProcess() == true then
  151.                 herbal.cutFlower(true, 20137, -1)
  152.             end
  153.         end
  154.        
  155.         when 20138.take with item.vnum == 51027 begin
  156.             if herbal.specialItemProcess() == true then
  157.                 herbal.cutFlower(true, 20138, -1)
  158.             end
  159.         end
  160.        
  161.         when 20139.take with item.vnum == 51027 begin
  162.             if herbal.specialItemProcess() == true then
  163.                 herbal.cutFlower(true, 20139, -1)
  164.             end
  165.         end
  166.        
  167.         when 20140.take with item.vnum == 51027 begin
  168.             if herbal.specialItemProcess() == true then
  169.                 herbal.cutFlower(true, 20140, -1)
  170.             end
  171.         end
  172.        
  173.         when 20141.take with item.vnum == 51027 begin
  174.             if herbal.specialItemProcess() == true then
  175.                 herbal.cutFlower(true, 20141, -1)
  176.             end
  177.         end
  178.         --
  179.        
  180.     end
  181.    
  182.     -- main part of this system
  183.     state main_part begin
  184.    
  185.         function settings()
  186.             return {
  187.                 ['skillVnum'] = 132,
  188.                 ['maxLevel'] = 20,
  189.                 ['readDelay'] = 2, -- in hours
  190.                
  191.                 ['skillBookVnum'] = 51032,
  192.                 ['defaultItemVnum'] = 51017,
  193.                 ['specialItemVnum'] = 51027,
  194.                
  195.                 ['bookReadChance'] = 40, -- percentage
  196.                 ['defaultChance'] = 10, -- percentage
  197.                 ['maxChance'] = 50, -- percentage
  198.                 ['defaultCount'] = 1,
  199.                 ['sicleAllowUse'] = 10,
  200.                
  201.                 -- default sicle settings
  202.                 ['sickle_add_1'] = 10,
  203.                 ['sickle_add_2'] = 30,
  204.                 ['sickle_add_3'] = 60,
  205.                 ['sickle_add_4'] = 100,
  206.                 ['sickle_add_5'] = 150,
  207.                 ['sickle_add_6'] = 210,
  208.                 ['sickle_add_7'] = 280,
  209.                 ['sickle_add_8'] = 370,
  210.                 ['sickle_add_9'] = 470,
  211.                 ['sickle_add_10'] = 580,
  212.                 ['maxSicklePoints'] = 580,
  213.                
  214.                 -- choose lang for texts in mission
  215.                 ['choosenLang'] = "pl",
  216.                 ['translation'] = {
  217.                     ['pl'] = {
  218.                         ['chat_skill_max_level'] = "Posiadasz już maksymalny poziom tej umiejętności.",
  219.                         ['chat_dont_have_item'] = "Nie posiadasz odpowiedniej księgi, aby rozwinąć tę umiejętność.",
  220.                         ['chat_training_success'] = "Pomyślnie zakończyłeś trening!",
  221.                         ['chat_upgraded_to_master'] = "Rozwinąłeś umiejętność na poziom Mistrzowski.",
  222.                         ['chat_training_failed'] = "Trening zakończony niepowodzeniem. Spróbuj ponownie później.",
  223.                         ['chat_cant_read_by_time'] = "Nie możesz jeszcze czytać tej książki. Spróbuj ponownie za %d minut.",
  224.                         ['chat_picking_success'] = "Brawo! Udało Ci się zebrać Roślinę!",
  225.                         ['chat_picking_failed'] = "Nie udało Ci się zebrać Rośliny.",
  226.                         ['chat_cannot_pick'] = "Nie możesz zebrać tej rośliny, odbierz pierwsze misje od Zielarki.",
  227.                         ['chat_inform_about_count_of_picked'] = "Do tej pory napotkałeś %d Kwiatów.",
  228.                         ['chat_not_enough_level'] = "Aby zebrać ten kwiat potrzebujesz %d poziom Zielarstwa.",
  229.                         ['chat_not_enough_level_to_plant'] = "Aby zasadzić ten kwiat potrzebuejsz %d poziom Zielarstwa.",
  230.                         ['chat_cannot_plant'] = "Odbierz pierwsze misje od Zielarki, aby tego dokonać.",
  231.                     },
  232.                    
  233.                     ['eng'] = {
  234.                         ['chat_skill_max_level'] = "You have maxium level of this skill.",
  235.                         ['chat_dont_have_item'] = "You don't have proper book to upgrade this skill.",
  236.                         ['chat_training_success'] = "You have successfully finished training!",
  237.                         ['chat_upgraded_to_master'] = "You have upgraded skill to the Master level.",
  238.                         ['chat_training_failed'] = "Training failed. Please try again later.",
  239.                         ['chat_cant_read_by_time'] = "You can't read this book now. Try again in %d minutes.",
  240.                         ['chat_picking_success'] = "Congratulations! You was able to collect this Flower!",
  241.                         ['chat_picking_failed'] = "You didn't be able to collect this Flower.",
  242.                         ['chat_cannot_pick'] = "You can't collect this Flower, go to Herbalist and get mission before you do it again.",
  243.                         ['chat_inform_about_count_of_picked'] = "You already found the %d Flowers!",
  244.                         ['chat_not_enough_level'] = "To pick this Flower you need %d level of Herbal Skill.",
  245.                         ['chat_not_enough_level_to_plant'] = "To plant this seed you need %d of Herbal Skill.",
  246.                         ['chat_cannot_plant'] = "Get mission from Herbalist to do this.",
  247.                     },
  248.                 },
  249.             }
  250.         end
  251.    
  252.         function getSkillLevel()
  253.             return tonumber(pc.get_skill_level(herbal.settings()['skillVnum']))
  254.         end
  255.    
  256.         function learnByBook()
  257.             -- check if player have item(just for sure)
  258.             if pc.count_item(herbal.settings()['skillBookVnum']) < 1 then
  259.                 chat(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_dont_have_item'])
  260.                 return
  261.             end
  262.             -- check if player can read the book(time limit)
  263.             if pc.getqf("nextRead") >= get_time() and not pc.is_skill_book_no_delay() then
  264.                 chat(string.format(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_cant_read_by_time'], math.floor((pc.getqf("nextRead") - get_time())/60) ))
  265.                 return
  266.             end
  267.             -- check if player have max level of skillVnum
  268.             if herbal.getSkillLevel() >= herbal.settings()['maxLevel'] then
  269.                 chat(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_skill_max_level'])
  270.                 return
  271.             end
  272.            
  273.             local readChance
  274.             if pc.is_skill_book_always_read() then
  275.                 readChance = 0
  276.             else
  277.                 readChance = number(1, 100)
  278.             end
  279.            
  280.             pc.remove_item(herbal.settings()['skillBookVnum'], 1)
  281.             if pc.getqf("nextRead") >= get_time() then
  282.                 pc.remove_skill_book_no_delay()
  283.             end
  284.  
  285.             pc.remove_skill_book_always_read()
  286.             pc.setqf("nextRead", get_time() + ( (herbal.settings()['readDelay']) * 3600 ))
  287.            
  288.             if readChance <= herbal.settings()['bookReadChance'] then
  289.                 pc.set_skill_level(herbal.settings()['skillVnum'], herbal.getSkillLevel()+1)
  290.                
  291.                 -- other info when player advances to the max level
  292.                 if herbal.getSkillLevel() == herbal.settings()['maxLevel'] then
  293.                     chat(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_training_success'])
  294.                     chat(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_upgraded_to_master'])
  295.                 else
  296.                     chat(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_training_success'])
  297.                 end
  298.             else
  299.                 chat(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_training_failed'])
  300.             end
  301.         end
  302.    
  303.         function getRequiredLevel(flowerVnum)
  304.             if flowerVnum == 20136 or flowerVnum == 20138 then
  305.                 return 0
  306.             elseif flowerVnum == 20140 or flowerVnum == 20141 then
  307.                 return 5
  308.             elseif flowerVnum == 20139 then
  309.                 return 10
  310.             elseif flowerVnum == 20137 then
  311.                 return 15
  312.             else
  313.                 return 20
  314.             end
  315.         end
  316.    
  317.         function getChance(level)
  318.             if level >= 1 and level < herbal.settings()['maxChance'] then
  319.                 return tonumber(herbal.settings()['defaultChance'] + level*2)
  320.             elseif level >= herbal.settings()['maxLevel'] then
  321.                 return tonumber(herbal.settings()['maxChance'])
  322.             else
  323.                 return -1
  324.             end
  325.         end
  326.        
  327.         function get_herb_from_flower(flowerVnum)
  328.             local reward_table = {
  329.                 [20136] = {['vnum'] = 51016, ['seed'] = 51056, ['seedChance'] = 20},
  330.                 [20137] = {['vnum'] = 51015, ['seed'] = 51055, ['seedChance'] = 5},
  331.                 [20138] = {['vnum'] = 51014, ['seed'] = 51054, ['seedChance'] = 20},
  332.                 [20139] = {['vnum'] = 51013, ['seed'] = 51053, ['seedChance'] = 10},
  333.                 [20140] = {['vnum'] = 51012, ['seed'] = 51052, ['seedChance'] = 15},
  334.                 [20141] = {['vnum'] = 51011, ['seed'] = 51051, ['seedChance'] = 15}
  335.             }
  336.             return reward_table[tonumber(flowerVnum)]
  337.         end
  338.    
  339.         function cutFlower(byPremiumSicle, flowerVnum, siclePercentage)
  340.             local chance = herbal.getChance(herbal.getSkillLevel())
  341.            
  342.             if siclePercentage != -1 then
  343.                 chance = chance + siclePercentage
  344.             end
  345.             if chance == -1 then
  346.                 chat(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_cannot_pick'])
  347.                 return
  348.             end
  349.             if herb.get_point_from_wear() > 0 then
  350.                 chance = chance + herb.get_point_from_wear()
  351.                 chat("get_point_from_wear" .. herb.get_point_from_wear())
  352.             end
  353.             local requiredLevel = herbal.getRequiredLevel(flowerVnum)
  354.             if herbal.getSkillLevel() < requiredLevel then
  355.                 chat(string.format(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_not_enough_level'], requiredLevel))
  356.                 return
  357.             end
  358.            
  359.             if byPremiumSicle == true then
  360.                 chance = 100
  361.             end
  362.             chat("chance"..chance)
  363.             -- prevent
  364.             if chance > 100 then chance = 100 end
  365.            
  366.             herbal.increasePickedCount()   
  367.             npc.purge() -- remove NPC from map
  368.             if number(1, 100) <= chance then
  369.                 chat(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_picking_success'])
  370.                 pc.give_item2(herbal.get_herb_from_flower(flowerVnum)['vnum'], 1)
  371.                
  372.                 if number(1, 100) <= herbal.get_herb_from_flower(flowerVnum)['seedChance'] then
  373.                     pc.give_item2(herbal.get_herb_from_flower(flowerVnum)['seed'], number(1, 2))
  374.                 end
  375.                 return true
  376.             else
  377.                 chat(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_picking_failed'])
  378.             end
  379.         end
  380.        
  381.         function increasePickedCount()
  382.             if herbal.getSkillLevel() < 1 then
  383.                 return
  384.             end
  385.            
  386.             local picked = pc.getqf("pickedFlowers")
  387.             pc.setqf("pickedFlowers", picked + 1)
  388.             chat(string.format(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_inform_about_count_of_picked'], picked+1))
  389.         end
  390.        
  391.         function specialItemProcess(flowerVnum)
  392.             if herbal.getSkillLevel() < 1 then
  393.                 chat(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_cannot_pick'])
  394.                 return false
  395.             end
  396.             local requiredLevel = herbal.getRequiredLevel(flowerVnum)
  397.             if herbal.getSkillLevel() < requiredLevel then
  398.                 chat(string.format(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_not_enough_level'], requiredLevel))
  399.                 return
  400.             end
  401.        
  402.              -- set flag, that item was first used
  403.             if item.get_socket(1) != 1 then
  404.                 item.set_socket(1, 1)
  405.                 item.set_socket(0, herbal.settings()['sicleAllowUse']) -- set the count for using sickle
  406.             end
  407.            
  408.             if item.get_socket(0) > 0 then
  409.                 item.set_socket(0, item.get_socket(0) - 1)
  410.                 if item.get_socket(0) == 0 then
  411.                     item.remove()
  412.                 end
  413.                
  414.                 return true
  415.             end
  416.         end
  417.        
  418.         function sickleItemProcess(flowerVnum)
  419.             local requiredLevel = herbal.getRequiredLevel(flowerVnum)
  420.             if herbal.getSkillLevel() < 1 then
  421.                 chat(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_cannot_pick'])
  422.                 return false
  423.             elseif herbal.getSkillLevel() < requiredLevel then
  424.                 chat(string.format(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_not_enough_level'], requiredLevel))
  425.                 return
  426.             else
  427.                 if item.get_socket(2) == 0 then
  428.                     item.set_socket(2, herbal.settings()['sickle_add_1'])
  429.                 end
  430.                
  431.                 return true
  432.             end
  433.         end
  434.        
  435.         function sicklePointIncrease()
  436.             if item.get_socket(0) >= herbal.settings()['maxSicklePoints'] then
  437.                 return
  438.             end
  439.            
  440.             item.set_socket(0, item.get_socket(0) + 1)
  441.             local points = item.get_socket(0)
  442.             if points == herbal.settings()['sickle_add_1'] then
  443.                 item.set_socket(1, 1) -- 1%
  444.                 item.set_socket(2, herbal.settings()['sickle_add_2'])
  445.             elseif points == herbal.settings()['sickle_add_2'] then
  446.                 item.set_socket(1, 2) -- 2%
  447.                 item.set_socket(2, herbal.settings()['sickle_add_3'])
  448.             elseif points == herbal.settings()['sickle_add_3'] then
  449.                 item.set_socket(1, 3) -- 3%
  450.                 item.set_socket(2, herbal.settings()['sickle_add_4'])
  451.             elseif points == herbal.settings()['sickle_add_4'] then
  452.                 item.set_socket(1, 4) -- 4%
  453.                 item.set_socket(2, herbal.settings()['sickle_add_5'])
  454.             elseif points == herbal.settings()['sickle_add_5'] then
  455.                 item.set_socket(1, 5) -- 5%
  456.                 item.set_socket(2, herbal.settings()['sickle_add_6'])
  457.             elseif points == herbal.settings()['sickle_add_6'] then
  458.                 item.set_socket(1, 6) -- 6%
  459.                 item.set_socket(2, herbal.settings()['sickle_add_7'])
  460.             elseif points == herbal.settings()['sickle_add_7'] then
  461.                 item.set_socket(1, 7) -- 7%
  462.                 item.set_socket(2, herbal.settings()['sickle_add_8'])
  463.             elseif points == herbal.settings()['sickle_add_8'] then
  464.                 item.set_socket(1, 8) -- 8%
  465.                 item.set_socket(2, herbal.settings()['sickle_add_9'])
  466.             elseif points == herbal.settings()['sickle_add_9'] then
  467.                 item.set_socket(1, 9) -- 9%
  468.                 item.set_socket(2, herbal.settings()['sickle_add_10'])
  469.             elseif points == herbal.settings()['sickle_add_10'] then
  470.                 item.set_socket(1, 10) -- 10%
  471.             end
  472.            
  473.             chat("Sickle Points " .. item.get_socket(0))
  474.             chat("Sickle Add Chance " .. item.get_socket(1))
  475.             chat("Sickle Next Level points " .. item.get_socket(2))
  476.         end
  477.        
  478.        
  479.         -- plant the flower
  480.         function plantFlower(itemVnum, flowerVnum)
  481.             local requiredLevel = herbal.getRequiredLevel(flowerVnum)
  482.             if herbal.getSkillLevel() < requiredLevel then
  483.                 chat(string.format(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_not_enough_level_to_plant'], requiredLevel))
  484.                 return
  485.             end
  486.             if requiredLevel == 20 then
  487.                 chat(herbal.settings()['translation'][herbal.settings()['choosenLang']]['chat_cannot_plant'])
  488.                 return
  489.             end
  490.            
  491.             pc.remove_item(itemVnum, 1)
  492.             mob.spawn(flowerVnum, pc.get_local_x()+number(1, 2), pc.get_local_y()+number(1, 2),0,0)
  493.         end
  494.        
  495.         when 51051.use begin
  496.             herbal.plantFlower(51051, 20141)
  497.         end
  498.         when 51052.use begin
  499.             herbal.plantFlower(51052, 20140)
  500.         end
  501.         when 51053.use begin
  502.             herbal.plantFlower(51053, 20139)
  503.         end
  504.         when 51054.use begin
  505.             herbal.plantFlower(51054, 20138)
  506.         end
  507.         when 51055.use begin
  508.             herbal.plantFlower(51055, 20137)
  509.         end
  510.         when 51056.use begin
  511.             herbal.plantFlower(51056, 20136)
  512.         end
  513.         --
  514.        
  515.         when 51032.use begin
  516.             herbal.learnByBook()
  517.         end
  518.    
  519.         -- click on box npc
  520.         when 20136.click begin
  521.             herbal.cutFlower(false, 20136, -1)
  522.         end
  523.        
  524.         when 20137.click begin
  525.             herbal.cutFlower(false, 20137, -1)
  526.         end
  527.        
  528.         when 20138.click begin
  529.             herbal.cutFlower(false, 20138, -1)
  530.         end
  531.        
  532.         when 20139.click begin
  533.             herbal.cutFlower(false, 20139, -1)
  534.         end
  535.        
  536.         when 20140.click begin
  537.             herbal.cutFlower(false, 20140, -1)
  538.         end
  539.        
  540.         when 20141.click begin
  541.             herbal.cutFlower(false, 20141, -1)
  542.         end
  543.        
  544.         -- use default sickle item
  545.         when 20136.take with item.vnum == 51017 begin
  546.             if herbal.sickleItemProcess(20136) == true then
  547.                 if herbal.cutFlower(false, 20136, item.get_socket(1)) == true then
  548.                     herbal.sicklePointIncrease()
  549.                 end
  550.             end
  551.         end
  552.        
  553.         when 20137.take with item.vnum == 51017 begin
  554.             if herbal.sickleItemProcess(20137) == true then
  555.                 if herbal.cutFlower(false, 20137, item.get_socket(1)) == true then
  556.                     herbal.sicklePointIncrease()
  557.                 end
  558.             end
  559.         end
  560.        
  561.         when 20138.take with item.vnum == 51017 begin
  562.             if herbal.sickleItemProcess(20138) == true then
  563.                 if herbal.cutFlower(false, 20138, item.get_socket(1)) == true then
  564.                     herbal.sicklePointIncrease()
  565.                 end
  566.             end
  567.         end
  568.        
  569.         when 20139.take with item.vnum == 51017 begin
  570.             if herbal.sickleItemProcess(20139) == true then
  571.                 if herbal.cutFlower(false, 20139, item.get_socket(1)) == true then
  572.                     herbal.sicklePointIncrease()
  573.                 end
  574.             end
  575.         end
  576.        
  577.         when 20140.take with item.vnum == 51017 begin
  578.             if herbal.sickleItemProcess(20140) == true then
  579.                 if herbal.cutFlower(false, 20140, item.get_socket(1)) == true then
  580.                     herbal.sicklePointIncrease()
  581.                 end
  582.             end
  583.         end
  584.        
  585.         when 20141.take with item.vnum == 51017 begin
  586.             if herbal.sickleItemProcess(20141) == true then
  587.                 if herbal.cutFlower(false, 20141, item.get_socket(1)) == true then
  588.                     herbal.sicklePointIncrease()
  589.                 end
  590.             end
  591.         end
  592.        
  593.         -- use Special Item to pick flower
  594.         when 20136.take with item.vnum == 51027 begin
  595.             if herbal.specialItemProcess(20136) == true then
  596.                 herbal.cutFlower(true, 20136, -1)
  597.             end
  598.         end
  599.        
  600.         when 20137.take with item.vnum == 51027 begin
  601.             if herbal.specialItemProcess(20137) == true then
  602.                 herbal.cutFlower(true, 20137, -1)
  603.             end
  604.         end
  605.        
  606.         when 20138.take with item.vnum == 51027 begin
  607.             if herbal.specialItemProcess(20138) == true then
  608.                 herbal.cutFlower(true, 20138, -1)
  609.             end
  610.         end
  611.        
  612.         when 20139.take with item.vnum == 51027 begin
  613.             if herbal.specialItemProcess(20139) == true then
  614.                 herbal.cutFlower(true, 20139, -1)
  615.             end
  616.         end
  617.        
  618.         when 20140.take with item.vnum == 51027 begin
  619.             if herbal.specialItemProcess(20140) == true then
  620.                 herbal.cutFlower(true, 20140, -1)
  621.             end
  622.         end
  623.        
  624.         when 20141.take with item.vnum == 51027 begin
  625.             if herbal.specialItemProcess(20141) == true then
  626.                 herbal.cutFlower(true, 20141, -1)
  627.             end
  628.         end
  629.        
  630.         -- talk with quest NPC
  631.         when 20142.chat."Kim jesteś?" begin
  632.             say_title(mob_name(20142))
  633.             say("")
  634.             say("Jestem zielarką badającą rośliny i starożytne ")
  635.             say("przepisy znalezione w tej krainie.")
  636.             say("")
  637.             say("Przyjdź do mnie ze znalezionymi roślinami, a ")
  638.             say("możemy spróbować przerobić je na potężne mikstury.")
  639.             say("")
  640.         end
  641.        
  642.         when 20142.chat."Otwórz okno wytwarzania mikstur" begin
  643.             say("")
  644.             say("Witaj Poszukiwaczu Przygód!")
  645.             say("Pomogę Ci przetworzyć zdobyte przez Ciebie")
  646.             say("Rośliny na silne mikstury, wspomagające Cię ")
  647.             say("w walce.")
  648.             say("")
  649.             wait()
  650.             setskin(NOWINDOW)
  651.             command("cube open")
  652.         end
  653.        
  654.         when 20142.chat."Rośliny" begin
  655.             say_title(mob_name(20142))
  656.             say("")
  657.             say("Witaj Poszukiwaczu Przygód!")
  658.             say("Znajdujemy się w Mistycznej Puszczy, niedawno odkryliśmy  ")
  659.             say("tę lokację i odczytaliśmy starożytne inskrypcje.")
  660.             say("")
  661.             say("Zapisano w nich, jak wytwarzać specjalne napary  ")
  662.             say("wzmacnające nas w walce. ")
  663.             say("Teraz już wiemy co możemy zrobić z roślinami wystepującymi")
  664.             say("na wszystkich mapach!. Pokażę Ci podstawy ich katologowania,")
  665.             say("jeśli tylko jakieś zdobędziesz przynieś je do mnie, a")
  666.             say("postaram się zrobić z nich napary, które pomogą Ci w walce.")
  667.             say("")
  668.             wait()
  669.             say_title(mob_name(20142))
  670.             say("")
  671.             say("Proszę, to Sierp dzięki któremu będzie Ci łatwiej ")
  672.             say("zbierać rośliny, wraz ze zbieraniem roślin Sierpem ")
  673.             say("zwięsza się jego szansa na pomyślne zebranie rośliny.")
  674.             say("Jest również dostępny Magiczny Sierp, który zapewnia")
  675.             say("100% szans na zebranie rośliny, lecz moze zostać użyty ")
  676.             say("tylko 10 razy.")
  677.             say("")
  678.             say_item_vnum(herbal.settings()['specialItemVnum'], "Magiczny Sierp", "Dzięki temu przedmiotowi możesz zebrać każdy napotkany kwiat.")
  679.             say("")
  680.         end
  681.        
  682.     end
  683. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement