Advertisement
Guest User

Grizzly Adams by Seminari (The_Hide)

a guest
Dec 26th, 2012
417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 22.47 KB | None | 0 0
  1. -- start shit
  2. local keywordHandler = KeywordHandler:new()
  3. local npcHandler = NpcHandler:new(keywordHandler)
  4. NpcSystem.parseParameters(npcHandler)
  5. local talkState = {}
  6.  
  7. function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
  8. function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid) end
  9. function onCreatureSay(cid, type, msg)        npcHandler:onCreatureSay(cid, type, msg) end
  10. function onThink()                            npcHandler:onThink() end
  11. --returns how many msgs he have said already
  12. function cancelNPCTalk(events)
  13.   local ret=1
  14.   for aux=1,table.getn(events) do
  15.      if events[aux].done==FALSE then
  16.         stopEvent(events[aux].event)
  17.      else
  18.         ret=ret+1
  19.      end
  20.   end
  21.   events=nil
  22.   return(ret)
  23. end
  24.  
  25. function doCreatureSayWithDelay(cid,text,type,delay,e)
  26.    if delay<=0 then
  27.       doCreatureSay(cid,text,type)
  28.    else
  29.       local func=function(pars)
  30.                     doCreatureSay(pars.cid,pars.text,pars.type)
  31.                     pars.e.done=TRUE
  32.                  end
  33.       e.done=FALSE
  34.       e.event=addEvent(func,delay,{cid=cid, text=text, type=type, e=e})
  35.    end
  36. end
  37.  
  38. function doNPCTalkALot(msgs,interval)
  39.   local e={}
  40.   local ret={}
  41.   if interval==nil then interval=3000 end --3 seconds is default time between messages
  42.   for aux=1,table.getn(msgs) do
  43.       e[aux]={}
  44.       doCreatureSayWithDelay(getNpcCid(),msgs[aux],TALKTYPE_PRIVATE_NP,(aux-1)*interval,e[aux])
  45.       table.insert(ret,e[aux])
  46.   end
  47.   return(ret)
  48. end
  49. --end shit :P
  50.  
  51.       --    Killing In the Name Of.. --
  52.       --            (taski)          --
  53.       -- ~~~~~~~~ By Seminari ~~~~~~ --
  54.       --          //// | \\\\        --
  55.       --         / __     __ \       --
  56.       --         |[*]  |  [*]|       --
  57.       --         |     ^     |       --
  58.       --          \ \_____/ /        --
  59.       --           --\___/--         --
  60.       --           \______/          --
  61.       -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
  62.  
  63.      
  64.  
  65. function creatureSayCallback(cid, type, msg)
  66.     if(not npcHandler:isFocused(cid)) then
  67.         return false
  68.     end      
  69. -- zmienne lokalne
  70.    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
  71.     local namee = getPlayerName(cid)
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78. local taski_do_wziecia_msg = ""
  79. local x_msg_taked_task = ""
  80. local taski_do_cancel_msg = ""
  81. local taski_czy_cancelowac_napewno_msg = ""
  82. local taski_do_report_msg = ""
  83. local ilosc_w_msgu = 0
  84. local ilosc_w_msgu2 = 0
  85. local ilosc_w_msgu3 = 0
  86.     -- joinowanie
  87.     if msgcontains(msg, 'join') then
  88.         if KITNO_hasPlayerJoinedPawAndFur(cid) then
  89.             npcHandler:say("You are allready member of Paw and Fur society, maybe you want to do some {task}s?", cid)
  90.             return true
  91.         elseif not(KITNO_hasPlayerJoinedPawAndFur(cid)) then
  92.             npcHandler:say("Are you really want to join Paw and Fur society?", cid)
  93.             talkState[talkUser] = 1
  94.         end
  95.     elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
  96.         if KITNO_doJoinToPawAndFur(cid) then
  97.             npcHandler:say("You are joined the Paw and Fur society, you can take now some {task}s.", cid)
  98.             talkState[talkUser] = 0
  99.             return true
  100.         elseif not(KITNO_doJoinToPawAndFur(cid)) then
  101.             npcHandler:say("You are allready member of Paw and Fur society, maybe you want to do some {task}s?", cid)
  102.             talkState[talkUser] = 0
  103.             return true
  104.         end
  105.     elseif msgcontains(msg, 'no') and talkState[talkUser] == 1 then
  106.         npcHandler:say("If no then no, idiot!", cid)
  107.         talkState[talkUser] = 0
  108.         return true
  109.     elseif msgcontains(msg, 'no') then
  110.         npcHandler:say("If no then no!", cid)
  111.         talkState[talkUser] = 0
  112.         return true
  113.     -- koniec joinowania
  114.     -- branie taskow
  115.     elseif (msgcontains(msg, 'task') or msgcontains(msg, 'tasks')) then
  116.         if not(KITNO_hasPlayerJoinedPawAndFur(cid)) then
  117.             npcHandler:say("Sorry, but before you start any task you need to {join} Paw and Fur society.", cid)
  118.         elseif KITNO_hasPlayerJoinedPawAndFur(cid) then
  119.             if not(KITNO_canPlayerTakeMoreTaskFromGrizzlyAdams(cid)) then
  120.                 npcHandler:say("Sorry, but you allready taked maximum tasks ("..KITNO_max_tasks_in_paw_and_fur.."), You can {cancel} or {report}.", cid)
  121.             elseif KITNO_canPlayerTakeMoreTaskFromGrizzlyAdams(cid) then
  122.                 for a,b in pairs(KITNO_Paw_and_Fur_tasks_for_lvl) do
  123.                     if getPlayerLevel(cid) >= a.lvl_min and getPlayerLevel(cid) <= a.lvl_max then
  124.                         for i=1, #b.tasks do
  125.                             for c,d in pairs(KITNO_Paw_and_Fur_tasks_tbl) do
  126.                                 if b.tasks[i] == c then
  127.                                     if KITNO_getPlayerSTGValue(cid, d.task_started_stg) < 1 then
  128.                                         ilosc_w_msgu3 = ilosc_w_msgu3 + 1
  129.                                         taski_do_wziecia_msg = taski_do_wziecia_msg .. " {".. c .."}<<"
  130.                                     end
  131.                                 end
  132.                             end
  133.                         end
  134.                         taski_do_wziecia_msg = string.gsub (taski_do_wziecia_msg, "<<", "," , (ilosc_w_msgu3 - 2))
  135.                         if ilosc_w_msgu3 >= 2 then taski_do_wziecia_msg = string.gsub (taski_do_wziecia_msg, "<<", " or" , 1) end
  136.                         taski_do_wziecia_msg = string.gsub (taski_do_wziecia_msg, "<<", "." , 1)
  137.                         npcHandler:say("You can take this tasks: ".. taski_do_wziecia_msg .."", cid)
  138.                         if KITNO_canPlayerAskAboutSpecialTasksFromGrizzlyAdams(cid) then
  139.                             npcHandler:say("Also you can ask about {special} tasks.", cid)
  140.                         end
  141.                         talkState[talkUser] = b.talk_to_take_task
  142.                         return true
  143.                     else
  144.                         npcHandler:say("Sorry, but in table there is no lvl on which u are ("..getPlayerLevel(cid)..") <-- this lvl isn't in task table.", cid)
  145.                         talkState[talkUser] = 0
  146.                         return true
  147.                     end
  148.                 end
  149.             end
  150.         end
  151.     -- koniec brania taskow
  152.     -- cancelowanie taskow
  153.     elseif (msgcontains(msg, 'cancel') or msgcontains(msg, 'cancels')) then
  154.         if not(KITNO_hasPlayerJoinedPawAndFur(cid)) then
  155.             npcHandler:say("Sorry, but before you start any task you need to {join} Paw and Fur society.", cid)
  156.             return true
  157.         elseif KITNO_hasPlayerJoinedPawAndFur(cid) then
  158.             if not(KITNO_hasPlayerStartedAnyTaskFromGrizzlyAdams(cid)) then
  159.                 npcHandler:say("You can't cancel any {task} because you haven't started yet any {task}.", cid)
  160.                 return true
  161.             elseif KITNO_hasPlayerStartedAnyTaskFromGrizzlyAdams(cid) then
  162.                 for a,b in pairs(KITNO_Paw_and_Fur_tasks_for_lvl) do
  163.                     for i=1, #b.tasks do
  164.                         for c,d in pairs(KITNO_Paw_and_Fur_tasks_tbl) do
  165.                             if b.tasks[i] == c then
  166.                                 if KITNO_getPlayerSTGValue(cid, d.task_started_stg) >= 1 then
  167.                                     ilosc_w_msgu = ilosc_w_msgu + 1
  168.                                     taski_do_cancel_msg = taski_do_cancel_msg .. " {".. c .."}<<"
  169.                                 end
  170.                             end
  171.                         end
  172.                     end
  173.                     taski_do_cancel_msg = string.gsub (taski_do_cancel_msg, "<<", "," , (ilosc_w_msgu - 2))
  174.                     if ilosc_w_msgu >= 2 then taski_do_cancel_msg = string.gsub (taski_do_cancel_msg, "<<", " or" , 1) end
  175.                     taski_do_cancel_msg = string.gsub (taski_do_cancel_msg, "<<", "." , 1)
  176.                     npcHandler:say("You can cancel this tasks: ".. taski_do_cancel_msg .."", cid)
  177.                     if KITNO_canPlayerAskAboutSpecialTasksFromGrizzlyAdams(cid) then
  178.                         npcHandler:say("Also you can ask about {special} tasks.", cid)
  179.                     end
  180.                     talkState[talkUser] = KITNO_PawAndFur_talk_cancel
  181.                     return true
  182.                 end
  183.             end
  184.         end
  185.     -- koniec cancelowania taskow
  186.     -- raportowanie taskow
  187.     elseif (msgcontains(msg, 'report') or msgcontains(msg, 'raport')) then
  188.         if not(KITNO_hasPlayerJoinedPawAndFur(cid)) then
  189.             npcHandler:say("Sorry, but before you start any task you need to {join} Paw and Fur society.", cid)
  190.             return true
  191.         elseif KITNO_hasPlayerJoinedPawAndFur(cid) then
  192.             if not(KITNO_hasPlayerStartedAnyTaskFromGrizzlyAdams(cid)) then
  193.                 npcHandler:say("You can't report any {task} because you haven't started yet any {task}.", cid)
  194.                 return true
  195.             elseif KITNO_hasPlayerStartedAnyTaskFromGrizzlyAdams(cid) then
  196.                 for a,b in pairs(KITNO_Paw_and_Fur_tasks_for_lvl) do
  197.                     for i=1, #b.tasks do
  198.                         for c,d in pairs(KITNO_Paw_and_Fur_tasks_tbl) do
  199.                             if b.tasks[i] == c then
  200.                                 if KITNO_getPlayerSTGValue(cid, d.task_started_stg) >= 1 then
  201.                                     ilosc_w_msgu2 = ilosc_w_msgu2 + 1
  202.                                     taski_do_report_msg = taski_do_report_msg .. " {".. c .."}<<"
  203.                                 end
  204.                             end
  205.                         end
  206.                     end
  207.                     taski_do_report_msg = string.gsub (taski_do_report_msg, "<<", "," , (ilosc_w_msgu2 - 2))
  208.                     if ilosc_w_msgu2 >= 2 then taski_do_report_msg = string.gsub (taski_do_report_msg, "<<", " or" , 1) end
  209.                     taski_do_report_msg = string.gsub (taski_do_report_msg, "<<", "." , 1)
  210.                     npcHandler:say("You can report this tasks: ".. taski_do_report_msg .."", cid)
  211.                     if KITNO_canPlayerAskAboutSpecialTasksFromGrizzlyAdams(cid) then
  212.                         npcHandler:say("Also you can ask about {special} tasks.", cid)
  213.                     end
  214.                     talkState[talkUser] = KITNO_PawAndFur_talk_report
  215.                     return true
  216.                 end
  217.             end
  218.         end
  219.     -- konkretne taski
  220.     elseif isInArray(KITN0_spis_wszystkich_taskow_Paw_and_Fur, msg:lower()) then
  221.         for e,f in pairs(KITNO_Paw_and_Fur_tasks_tbl) do
  222.             if msgcontains(msg, e) then
  223.                 -- talka daje do brania taska
  224.                 if talkState[talkUser] == f.talk_to_take_task then
  225.                     if KITNO_getPlayerSTGValue(cid, f.task_started_stg) >= 1 then
  226.                         npcHandler:say("You allrady have started this {task}!", cid)
  227.                         talkState[talkUser] = 0
  228.                         return true
  229.                     elseif KITNO_getPlayerSTGValue(cid, f.task_started_stg) < 1 then
  230.                         npcHandler:say(f.text_when_player_want_to_take_task, cid)
  231.                         talkState[talkUser] = f.talk_take_task
  232.                         return true
  233.                     end
  234.                 -- talka daje do cancelowania taska
  235.                 elseif talkState[talkUser] == KITNO_PawAndFur_talk_cancel then
  236.                     if KITNO_getPlayerSTGValue(cid, f.task_started_stg) < 1 then
  237.                         npcHandler:say("You haven't started yet this {task} so you can't {cancel} them!", cid)
  238.                         talkState[talkUser] = 0
  239.                         return true
  240.                     elseif KITNO_getPlayerSTGValue(cid, f.task_started_stg) >= 1 then
  241.                         if KITNO_getPlayerSTGValue(cid, f.task_started_stg) == 1 then
  242.                             taski_czy_cancelowac_napewno_msg = "You have allready killed: ".. KITNO_getPlayerSTGValue(cid,f.task_counter_stg) .."/".. f.task_required_kills .." ".. e ..". Do You really want to cancel this task?"
  243.                         elseif KITNO_getPlayerSTGValue(cid, f.task_started_stg) == 2 then
  244.                             taski_czy_cancelowac_napewno_msg = "You can kill boss of ".. e ..", but you really want to {cancel}? Then You won't be able to kill this boss."
  245.                         elseif KITNO_getPlayerSTGValue(cid, f.task_started_stg) == 3 then
  246.                             taski_czy_cancelowac_napewno_msg = "You killed boss, you should {report} that, but if you really want to {cancel} then u won't get points"
  247.                         end
  248.                         npcHandler:say(taski_czy_cancelowac_napewno_msg, cid)
  249.                         talkState[talkUser] = f.talk_cancel_task
  250.                         return true
  251.                     end
  252.                 -- reportowanie tasku
  253.                 elseif talkState[talkUser] == KITNO_PawAndFur_talk_report then
  254.                     if KITNO_getPlayerSTGValue(cid, f.task_started_stg) < 1 then
  255.                         npcHandler:say("You haven't yet started this {task}!", cid)
  256.                         talkState[talkUser] = 0
  257.                         return true
  258.                     elseif KITNO_getPlayerSTGValue(cid, f.task_started_stg) == 1 then
  259.                         if KITNO_getPlayerSTGValue(cid, f.task_counter_stg) < f.task_required_kills then
  260.                             npcHandler:say("Sorry but you have allready killed: "..  KITNO_getPlayerSTGValue(cid,f.task_counter_stg) .."/".. f.task_required_kills .." ".. e ..". Come back when you done!", cid)
  261.                             talkState[talkUser] = 0
  262.                             return true
  263.                         elseif KITNO_getPlayerSTGValue(cid, f.task_counter_stg) >= f.task_required_kills then
  264.                             KITNO_addPlayerPointsToPawAndFur(cid, f.task_points)
  265.                             if f.reward_exp ~= nil then
  266.                                 doPlayerAddExperience(cid, f.reward_exp)
  267.                             end
  268.                             if f.boss then
  269.                                 KITNO_setPlayerSTGValue(cid, f.task_started_stg, 2)
  270.                                 KITNO_setPlayerSTGValue(cid, f.task_counter_stg, 0)
  271.                             elseif not(f.boss) then
  272.                                 KITNO_setPlayerSTGValue(cid, f.task_started_stg, -1)
  273.                                 KITNO_setPlayerSTGValue(cid, f.task_counter_stg, 0)
  274.                                 KITNO_updateNumberOfStartedTasksFromGrizzlyAdams(cid, -1)
  275.                             end
  276.                             npcHandler:say(f.text_when_player_reported_succesfull_task, cid)
  277.                             if f.text_when_player_reported_succesfull_task2 ~= nil then
  278.                                 npcHandler:say(f.text_when_player_reported_succesfull_task2, cid)
  279.                             end
  280.                             talkState[talkUser] = 0
  281.                             return true
  282.                         end
  283.                     elseif KITNO_getPlayerSTGValue(cid, f.task_started_stg) == 2 then
  284.                         npcHandler:say("First kill boss of ".. e .." and then {report} back to me. Of course you can {cancel} but you won't be able to kill boss!", cid)
  285.                         talkState[talkUser] = 0
  286.                         return true
  287.                     elseif KITNO_getPlayerSTGValue(cid, f.task_started_stg) == 3 then
  288.                         if f.boss_points == nil then f.boss_points = 0 end
  289.                         KITNO_setPlayerSTGValue(cid, f.task_started_stg, -1)
  290.                         KITNO_setPlayerSTGValue(cid, f.task_counter_stg, 0)
  291.                         KITNO_addPlayerPointsToPawAndFur(cid, f.boss_points)
  292.                         npcHandler:say("Good work, for this boss i added you ".. f.boss_points .." task points.", cid)
  293.                         KITNO_updateNumberOfStartedTasksFromGrizzlyAdams(cid, -1)
  294.                         talkState[talkUser] = 0
  295.                         return true
  296.                     end
  297.                
  298.                 end
  299.             end
  300.         end
  301.     -- yesy
  302.     elseif msgcontains(msg, 'yes') then
  303.         -- branie taskow
  304.         if talkState[talkUser] >= 200 and talkState[talkUser] <= 299 then
  305.             for g,h in pairs(KITNO_Paw_and_Fur_tasks_tbl) do
  306.                 if talkState[talkUser] == h.talk_take_task then
  307.                     if KITNO_getPlayerSTGValue(cid, h.task_started_stg) >= 1 then
  308.                         npcHandler:say("You allrady have started this {task}!", cid)
  309.                         talkState[talkUser] = 0
  310.                         return true
  311.                     elseif KITNO_getPlayerSTGValue(cid, h.task_started_stg) < 1 then
  312.                         x_msg_taked_task = KITNO_Paw_and_Fur_when_player_taked_task_msgs_tbl[math.random(1,#KITNO_Paw_and_Fur_when_player_taked_task_msgs_tbl)]
  313.                         npcHandler:say(x_msg_taked_task, cid)
  314.                         KITNO_setPlayerSTGValue(cid, h.task_started_stg, 1)
  315.                         KITNO_setPlayerSTGValue(cid, h.task_counter_stg, 0)
  316.                         KITNO_updateNumberOfStartedTasksFromGrizzlyAdams(cid, 1)
  317.                         talkState[talkUser] = 0
  318.                         return true
  319.                     end
  320.                 end
  321.             end
  322.         -- cancelowanie taskow
  323.         elseif talkState[talkUser] >= 300 and talkState[talkUser] <= 399 then
  324.             for g,h in pairs(KITNO_Paw_and_Fur_tasks_tbl) do
  325.                 if talkState[talkUser] == h.talk_cancel_task then
  326.                     if KITNO_getPlayerSTGValue(cid, h.task_started_stg) < 1 then
  327.                         npcHandler:say("You allrady haven't yet started this {task}!", cid)
  328.                         talkState[talkUser] = 0
  329.                         return true
  330.                     elseif KITNO_getPlayerSTGValue(cid, h.task_started_stg) >= 1 then
  331.                         npcHandler:say("You canceled task called ".. g ..".", cid)
  332.                         KITNO_setPlayerSTGValue(cid, h.task_started_stg, -1)
  333.                         KITNO_setPlayerSTGValue(cid, h.task_counter_stg, -1)
  334.                         KITNO_updateNumberOfStartedTasksFromGrizzlyAdams(cid, -1)
  335.                         talkState[talkUser] = 0
  336.                         return true
  337.                     end
  338.                 end
  339.             end
  340.         -- branie tasku na demony
  341.         elseif talkState[talkUser] == 6666 then
  342.             if KITNO_getStatusDemonTaskInPawAndFur(cid) < 1 then
  343.                 KITNO_setStatusDemonTaskInPawAndFur(cid, 1)
  344.                 KITNO_setCounterDemonsInPawAndFur(cid, 0)
  345.                 npcHandler:say("Good show, old chap! Come back to me when you are done hunting.", cid)
  346.                 talkState[talkUser] = 0
  347.                 return true
  348.             end
  349.        
  350.         end
  351.    
  352.     -- rangi
  353.     elseif msgcontains(msg, 'rank') then
  354.         npcHandler:say("Your current rank is ".. KITNO_getPlayerRankNameInPawAndFur(cid) .." to advance to next {rank} ask about {promotion}", cid)
  355.     -- promotion
  356.     elseif (msgcontains(msg, 'promotion') or msgcontains(msg, 'advance')) then
  357.         if KITNO_getPlayerRankInPawAndFur(cid) < 1 then
  358.             if KITNO_getPlayerPointsInPawAndFur(cid) >= KITNO_Paw_and_Fur_rank_tbl[1].points_to_reach_this_rank then
  359.                 if getPlayerLevel(cid) >= KITNO_Paw_and_Fur_rank_tbl[1].minimum_lvl_to_reach_this_rank then
  360.                     KITNO_advancePlayerToRankInPawAndFur(cid, 1)
  361.                     npcHandler:say(KITNO_Paw_and_Fur_rank_tbl[1].msg_przy_advance, cid)
  362.                     if KITNO_Paw_and_Fur_rank_tbl[1].msg_przy_advance2 ~= nil then
  363.                         npcHandler:say(KITNO_Paw_and_Fur_rank_tbl[1].msg_przy_advance2, cid)
  364.                     end
  365.                     doPlayerAddExperience(cid, KITNO_Paw_and_Fur_rank_tbl[1].reward_exp)
  366.                 else
  367.                     npcHandler:say("To {advance} to next {rank} you need to have " .. KITNO_Paw_and_Fur_rank_tbl[1].minimum_lvl_to_reach_this_rank .. "+ lvl.", cid)
  368.                 end
  369.             else
  370.                 npcHandler:say("To {advance} to next {rank} you need to get " .. KITNO_Paw_and_Fur_rank_tbl[1].points_to_reach_this_rank .. " points. (You allready have: ".. KITNO_getPlayerPointsInPawAndFur(cid) .." points).", cid)
  371.             end
  372.         elseif KITNO_getPlayerRankInPawAndFur(cid) >= 1 then
  373.             if KITNO_getPlayerPointsInPawAndFur(cid) >= KITNO_Paw_and_Fur_rank_tbl[KITNO_getPlayerRankInPawAndFur(cid) + 1].points_to_reach_this_rank then
  374.                 if getPlayerLevel(cid) >= KITNO_Paw_and_Fur_rank_tbl[KITNO_getPlayerRankInPawAndFur(cid) + 1].minimum_lvl_to_reach_this_rank then
  375.                     KITNO_advancePlayerToRankInPawAndFur(cid, KITNO_getPlayerRankInPawAndFur(cid) + 1)
  376.                     npcHandler:say(KITNO_Paw_and_Fur_rank_tbl[KITNO_getPlayerRankInPawAndFur(cid) + 1].msg_przy_advance, cid)
  377.                     if KITNO_Paw_and_Fur_rank_tbl[KITNO_getPlayerRankInPawAndFur(cid) + 1].msg_przy_advance2 ~= nil then
  378.                         npcHandler:say(KITNO_Paw_and_Fur_rank_tbl[KITNO_getPlayerRankInPawAndFur(cid) + 1].msg_przy_advance2, cid)
  379.                     end
  380.                     doPlayerAddExperience(cid, KITNO_Paw_and_Fur_rank_tbl[KITNO_getPlayerRankInPawAndFur(cid) + 1].reward_exp)
  381.                     if KITNO_Paw_and_Fur_rank_tbl[KITNO_getPlayerRankInPawAndFur(cid) + 1].reward_item ~= nil then
  382.                         doPlayerAddItem(cid, KITNO_Paw_and_Fur_rank_tbl[KITNO_getPlayerRankInPawAndFur(cid) + 1].reward_item, KITNO_Paw_and_Fur_rank_tbl[KITNO_getPlayerRankInPawAndFur(cid) + 1].reward_item_count)
  383.                     end
  384.                 else
  385.                     npcHandler:say("To {advance} to next {rank} you need to have " .. KITNO_Paw_and_Fur_rank_tbl[KITNO_getPlayerRankInPawAndFur(cid) + 1].minimum_lvl_to_reach_this_rank .. "+ lvl.", cid)
  386.                 end
  387.             else
  388.             npcHandler:say("To {advance} to next {rank} you need to get" .. KITNO_Paw_and_Fur_rank_tbl[KITNO_getPlayerRankInPawAndFur(cid) + 1].points_to_reach_this_rank .. " points.  (You allready have: ".. KITNO_getPlayerPointsInPawAndFur(cid) .." points).", cid)
  389.             end
  390.         end
  391.        
  392.     -- special taski
  393.     elseif msgcontains(msg, 'special') then
  394.         if not(KITNO_canPlayerAskAboutSpecialTasksFromGrizzlyAdams(cid)) then
  395.             npcHandler:say("Your {rank} is too low to talk with me about {special} tasks.", cid)
  396.             talkState[talkUser] = 0
  397.             return true
  398.         elseif KITNO_canPlayerAskAboutSpecialTasksFromGrizzlyAdams(cid) then
  399.             if KITNO_getStatusSpecialTasksInPawAndFur(cid) < 1 then
  400.                 KITNO_setStatusSpecialTasksInPawAndFur(cid, 1)
  401.                 npcHandler:say("Have you heared about Tiquandas Revenge? It is said that the jungle itself is alive and takes revenge for all the bad things people have done to it. ...", cid)
  402.                 npcHandler:say("I myself believe that there is some truth in this clap trap. Something 'real' which therefore must have a hideout somewhere. Go find it and take revenge yourself! Ask me about the special task when you're done.", cid)
  403.                 talkState[talkUser] = 0
  404.                 return true
  405.             elseif KITNO_getStatusSpecialTasksInPawAndFur(cid) == 1 then
  406.                 npcHandler:say("Come back when you kill Tiquandas Revenge. You can't {cancel} this {task} because {special} tasks cannot be canceled.", cid)
  407.                 talkState[talkUser] = 0
  408.                 return true
  409.             elseif KITNO_getStatusSpecialTasksInPawAndFur(cid) == 2 then
  410.                 KITNO_setStatusSpecialTasksInPawAndFur(cid, 3)
  411.                 npcHandler:say("Great accievement, old chap! You are an outstanding hunter, no doubt about it!", cid)
  412.                 talkState[talkUser] = 0
  413.                 return true
  414.             elseif KITNO_getStatusSpecialTasksInPawAndFur(cid) == 3 then
  415.                 KITNO_setStatusSpecialTasksInPawAndFur(cid, 4)
  416.                 npcHandler:say("This task is a very dangerous one. I want you to look for Demodras' hideout. It might be somewhere under the Plains of Havoc. Good luck, old chap, come back in one piece and ask me about the special task when you're done.", cid)
  417.                 talkState[talkUser] = 0
  418.                 return true
  419.             elseif KITNO_getStatusSpecialTasksInPawAndFur(cid) == 4 then
  420.                 npcHandler:say("Come back when you kill Demodras. You can't {cancel} this {task} because {special} tasks cannot be canceled.", cid)
  421.                 talkState[talkUser] = 0
  422.                 return true
  423.             elseif KITNO_getStatusSpecialTasksInPawAndFur(cid) == 5 then
  424.                 KITNO_setStatusSpecialTasksInPawAndFur(cid, 6)
  425.                 npcHandler:say("Jolly good show! You can cross swords with any creature in this world! I bow to you.", cid)
  426.                 talkState[talkUser] = 0
  427.                 return true
  428.             elseif KITNO_getStatusSpecialTasksInPawAndFur(cid) == 6 then
  429.                 if not(KITNO_canPlayerAskAboutDemonTaskFromGrizzlyAdams(cid)) then
  430.                     npcHandler:say("Your {rank} is too low to talk about next {special} task... Demons are soo much powerful.", cid)
  431.                     talkState[talkUser] = 0
  432.                     return true
  433.                 elseif KITNO_canPlayerAskAboutDemonTaskFromGrizzlyAdams(cid) then
  434.                     if KITNO_getStatusDemonTaskInPawAndFur(cid) < 1 then
  435.                         npcHandler:say("The spawn of pure evil must be erased from Tibia. You'll find demons lurking in the northern ruins of Edron as well as in some of other deeper dungeons of Tibia. Slay 6666 demons for the Greater Good! Do you think you can handle this task?", cid)
  436.                         talkState[talkUser] = 6666
  437.                         return true
  438.                     elseif KITNO_getStatusDemonTaskInPawAndFur(cid) == 1 then
  439.                         if KITNO_getCounterDemonsInPawAndFur(cid) < KITNO_how_many_demons_required_in_special_paw_and_fur then
  440.                             npcHandler:say("You allready killed ".. KITNO_getCounterDemonsInPawAndFur(cid) .."/".. KITNO_how_many_demons_required_in_special_paw_and_fur .." demons. Come back when you done.", cid)
  441.                             talkState[talkUser] = 0
  442.                             return true
  443.                         elseif KITNO_getCounterDemonsInPawAndFur(cid) >= KITNO_how_many_demons_required_in_special_paw_and_fur then
  444.                             KITNO_setStatusDemonTaskInPawAndFur(cid, 2)
  445.                             KITNO_setCounterDemonsInPawAndFur(cid, 0)
  446.                             doPlayerAddItem(cid, KITNO_PawAndFur_Holy_Icon_id, 1)
  447.                             KITNO_givePlayerAccesToStartDemonOak(cid)
  448.                             npcHandler:say("Such derring do deserves a special reward! Take this holy icon, It neutralizes great evil and gives you access to areas which are protected by those forces.", cid)
  449.                             talkState[talkUser] = 0
  450.                             return true
  451.                         end
  452.                     elseif KITNO_getStatusDemonTaskInPawAndFur(cid) == 2 then
  453.                         if KITNO_getPlayerStatusInDemonOak(cid) == 1 then
  454.                             npcHandler:say("You have mission to destroy Demon Oak, after you done this {task}, come back and talk about {special} task.", cid)
  455.                         elseif KITNO_getPlayerStatusInDemonOak(cid) == 2 then
  456.                        
  457.                         end
  458.                    
  459.                     end
  460.                
  461.                 end
  462.                
  463.             end
  464.         end
  465.     end
  466.  
  467.  
  468.     return true
  469. end
  470.  
  471. npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
  472. npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement