Facebook
From Silly Gorilla, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 208
  1. Witam pomógłby mi ktoś zmienić skrypt tak aby dawał on Crystal Coins [ID ustawienie i ile ma dawac] + chciałbym aby dany task dawal takze ITEM [ID do ustawienia]
  2. KOD:
  3. [CODE]focus = 0
  4. talk_start = 0
  5. target = 0
  6. following = false
  7. attacking = false
  8. talk_state = 0
  9.  
  10. local tasks = {
  11.                    {name = "Rotworm", count = 5, exp = 1000, gp = 0, itemid = 2160, itemcnt = 2, itemid = 2640, itemcnt = 1},
  12.                    {name = "Hero", count = 20, exp = 1250, gp = 1000, itemid = 2160, itemcnt = 0},
  13.                                    {name = "Dragon", count = 30, exp = 700, gp = 200, itemid = 2160, itemcnt = 2},
  14.                                    {name = "Dragon Lord", count = 40, exp = 2000, gp = 3775, itemid = 2160, itemcnt = 0},
  15.                                    {name = "Demon", count = 50, exp = 2000, gp = 3775, itemid = 2160, itemcnt = 0},
  16.                                    {name = "Ots King", count = 80 , exp = 2000, gp = 3775, itemid = 2160, itemcnt = 0},
  17.                                    {name = "Wise Man", count = 300, exp = 2000, gp = 3775, itemid = 2160, itemcnt = 0},
  18.                                    {name = "Adobe", count = 500, exp = 2000, gp = 3775, itemid = 2160, itemcnt = 0},
  19.                                    {name = "Crazy", count = 700, exp = 2000, gp = 3775, itemid = 2160, itemcnt = 0},
  20.                                    {name = "Glacius", count = 1000, exp = 2000, gp = 3775, itemid = 2160, itemcnt = 0},
  21.                                    {name = "Moras De Greg", count = 1200, exp = 2000, gp = 3775, itemid = 2160, itemcnt = 0},
  22.                                    {name = "Farenthid", count = 1500, exp = 2000, gp = 3775, itemid = 2160, itemcnt = 0},
  23.                                    {name = "Zanur", count = 2000, exp = 2000, gp = 3775, itemid = 2160, itemcnt = 0}                     
  24.                                    }
  25.  
  26. local ilosc_taskow = 13                          
  27.  
  28.  
  29. function onThingMove(creature, thing, oldpos, oldstackpos)
  30.  
  31. end
  32.  
  33.  
  34. function onCreatureAppear(creature)
  35.  
  36. end
  37.  
  38.  
  39. function onCreatureDisappear(cid, pos)
  40.         if focus == cid then
  41.           selfSay('Dowidzenia.')
  42.           focus = 0
  43.           talk_start = 0
  44.         end
  45. end
  46.  
  47.  
  48. function onCreatureTurn(creature)
  49.  
  50. end
  51.  
  52. function msgcontains(txt, str)
  53.         return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
  54. end
  55.  
  56.  
  57. function onCreatureSay(cid, type, msg)
  58.  
  59.         msg = string.lower(msg)
  60.  
  61.         if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then
  62.                 selfSay('Witam ' .. creatureGetName(cid) .. '! Potrzebuje twojej pomocy musisz zabic kilka potworow. A wzamian dostaniesz ciekawe nagrody wystarczy wpisac \"task\". a jezeli ukonczysz zadanie wystarczy wpisz \"report\".')
  63.                 focus = cid
  64.                 talk_start = os.clock()
  65.  
  66.         elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  67.                 selfSay('Przepraszam, ' .. creatureGetName(cid) .. '! Mowie do ciebie za chwile.')
  68.  
  69.         elseif focus == cid then
  70.                 talk_start = os.clock()
  71.  
  72.                 if msgcontains(msg, 'task') then
  73.  
  74.                         local task_counter = getPlayerStorageValue(cid,123456)
  75.  
  76.                 if task_counter == -1 then
  77.  
  78.                 setPlayerStorageValue(cid,123456,1)
  79.  
  80.                 end
  81.  
  82.                 local task_counter = getPlayerStorageValue(cid,123456)
  83.  
  84.                                 if task_counter > ilosc_taskow then
  85.  
  86.                                 selfSay('Wykoanles wszystkie juz zadania ('..(task_counter-1)..'). \n Czy chcialbys wykonac je jeszcze raz?')
  87.                                 talk_state = 1
  88.  
  89.                                 else
  90.  
  91.                 setPlayerTaskMonster(cid,tasks[task_counter].name)
  92.                 setPlayerTaskMax(cid,tasks[task_counter].count)
  93.  
  94.                                 if getPlayerStorageValue(cid,1234567) == 0 then
  95.  
  96.                                 selfSay(' Nie tak szybko '..creatureGetName(cid)..'! Musisz ukonczysz poprzednie zadanie, aby otrzymac kolejne zadanie. jezeli wykonales zadanie napisz \"report\" to do mnie.')
  97.  
  98.                                 else
  99.  
  100.                                 selfSay(' To twoje '..task_counter..' Zadanie. Musisz zabic '..tasks[task_counter].count..' '..(string.lower(tasks[task_counter].name))..'s. \"Report\" wroc do mnie, gdy tylko zabijes wymagana ilosc potworow.')
  101.                             setPlayerStorageValue(cid,1234567,0)
  102.  
  103.                                 end
  104.  
  105.                                 end
  106.  
  107.                                 elseif msgcontains(msg, 'yes') and talk_state == 1 then
  108.  
  109.                                 setPlayerStorageValue(cid,123456,1)
  110.                                 selfSay('Jak sobie zyczysz '..creatureGetName(cid)..'. Mozesz teraz zaczac od nowa piszac \"task\".')
  111.                                 talk_state = 0
  112.  
  113.                                 elseif msgcontains(msg, 'no') and talk_state == 1 then
  114.  
  115.                                 selfSay('Wracaj jesli zmienisz zdanie drogi graczu.')
  116.                                 talk_state = 0
  117.  
  118.                 elseif msgcontains(msg, 'report') then
  119.  
  120.                                 if getPlayerStorageValue(cid,123456) == -1 then
  121.  
  122.                                 selfSay('Nie wykonales jeszcze zadnego mojego zadania ktore mam dla ciebie.')
  123.  
  124.                                 else
  125.  
  126.                 if getPlayerTaskCount(cid) >= getPlayerTaskMax(cid) then
  127.  
  128.                                 local task_counter = getPlayerStorageValue(cid,123456)
  129.  
  130.                  if tasks[task_counter].gp >= 1000 then
  131.  
  132.                                  gpmsg = ""..(tasks[task_counter].gp/1000).."k"
  133.  
  134.                                  else
  135.  
  136.                                  gpmsg = ""..(tasks[task_counter].gp).." gp"
  137.  
  138.                                  end
  139.  
  140.                                 if tasks[task_counter].itemcnt > 0 then
  141.  
  142.                                 if tasks[task_counter].itemcnt == 1 then
  143.  
  144.                                 itemmsg = "."
  145.  
  146.                                 else
  147.  
  148.                                 itemmsg = "s."
  149.  
  150.                                 end
  151.  
  152.                                 msg = 'Dziekuje Ci bardzo '..creatureGetName(cid)..'. Otrzymujesz '..tasks[task_counter].exp..' doswiadczenie, '..gpmsg..' i '..tasks[task_counter].itemcnt..' '..getItemName(tasks[task_counter].itemid)..itemmsg
  153.  
  154.                                 else
  155.  
  156.                                 msg = 'Dziekuje Ci Bardzo '..creatureGetName(cid)..'. Otrzymujesz '..tasks[task_counter].exp..' doswiadczenie i '..gpmsg..''
  157.  
  158.                                 end
  159.  
  160.                                 selfSay(msg)
  161.                                 AddRewards(cid,tasks[task_counter].exp, tasks[task_counter].gp, tasks[task_counter].itemid, tasks[task_counter].itemcnt)
  162.                                 setPlayerStorageValue(cid,123456,task_counter+1)
  163.                                 setPlayerTaskCount(cid,0)
  164.                                 setPlayerStorageValue(cid,1234567,1)
  165.                                 setPlayerTaskMonster(cid,"brakTaska")
  166.  
  167.                                 else
  168.  
  169.                                 if getPlayerStorageValue(cid,1234567) == 1 then
  170.  
  171.                                 selfSay('Twoim ostatnim zadaniem bylo zabic '..tasks[getPlayerStorageValue(cid,123456)-1].count..' '..string.lower(tasks[getPlayerStorageValue(cid,123456)-1].name)..'s. \nSay \"task\" aby zdobyc kolejna.')
  172.  
  173.                                 else
  174.  
  175.                                 if getPlayerTaskMax(cid) - getPlayerTaskCount(cid) == 1 then
  176.  
  177.                                 koncowka = ""
  178.  
  179.                                 else
  180.  
  181.                                 koncowka = "s"
  182.  
  183.                                 end
  184.  
  185.                                 selfSay('Przepraszam '..creatureGetName(cid)..' ale musisz zabic '..(getPlayerTaskMax(cid) - getPlayerTaskCount(cid))..' '..(string.lower(getPlayerTaskMonster(cid)))..koncowka..' wiecej.')
  186.  
  187.                                 end
  188.  
  189.                                 end
  190.  
  191.                                 end
  192.  
  193.  
  194.  
  195.  
  196.                 elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
  197.                         selfSay('Dowidzenia, ' .. creatureGetName(cid) .. '!')
  198.                         focus = 0
  199.                         talk_start = 0
  200.                 end
  201.         end
  202. end
  203.  
  204.  
  205. function onCreatureChangeOutfit(creature)
  206.  
  207. end
  208.  
  209.  
  210. function onThink()
  211.         if (os.clock() - talk_start) > 30 then
  212.                 if focus > 0 then
  213.                         selfSay('Nastepny Prosze...')
  214.                 end
  215.                 focus = 0
  216.         end
  217.         if focus ~= 0 then
  218.                 if getDistanceToCreature(focus) > 5 then
  219.                         selfSay('Dowidzenia.')
  220.                         focus = 0
  221.                 end
  222.         end
  223. end[/CODE]