Advertisement
Guest User

Untitled

a guest
Mar 1st, 2016
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.15 KB | None | 0 0
  1. local npc = NPC({
  2.     name = "Chondur",
  3.    
  4.     messages = {
  5.         greet = "Be greeted, child. What do you want in an old shaman's hut?",
  6.         farewell = "Good bye.",
  7.         walkway = "Good bye!",
  8.         sendTrade = "Well, I currently buy mysterious and enigmatic voodoo skulls and a few other things I might need for my rituals."
  9.     },
  10.    
  11.     keywords = {
  12.         ["rituals"]  = "Hm. I don't think you need another one of my counterspells to cross the barrier on Goroma.",
  13.     },
  14.    
  15.     shop = {
  16.         {id = 5669,     buy = 0,        sell = 4000,        name= "Mysterious Voodoo Skull"},
  17.         {id = 5670,     buy = 0,        sell = 4000,        name= "Enigmatic Voodoo Skull"},
  18.         {id = 9969,     buy = 0,        sell = 4000,        name= "black skull"},
  19.         {id = 2798,     buy = 0,        sell = 500,         name= "blood herb"},
  20.         {id = 9447,     buy = 0,        sell = 10000,       name= "blood goblet"},
  21.     }
  22. })
  23.  
  24. npc.topicHandler:addTopics({
  25.  
  26.     ---stampor mount
  27.     {word = {"mount", "stampor"},
  28.         answer = "You did bring all the items I requqested, cuild. Good. Shall I travel to the spirit realm and try finding a stampor compasion for you?",
  29.        
  30.         default = {
  31.             reset = true
  32.         },
  33.        
  34.         condition = {
  35.             topicCondition.notCondition(topicCondition.haveMount(11), "You already have stampor mount.")
  36.         },
  37.        
  38.         topics = {
  39.             {
  40.                 word = "yes",
  41.                 answer = {
  42.                     "Ohhhhh Mmmmmmmmmmmm Ammmmmgggggggaaaaaaa ...",
  43.                     "Aaaaaaaaaahhmmmm Mmmaaaaaaaaaa Kaaaaaamaaaa ...",
  44.                     "Brrt! I think it worked! It's a male stampor. I linked this spirit to yours. You can probably already summon him to you ...",
  45.                     "So, since me are done here... I need to prepare another ritual, so please let me work, child."
  46.                 },
  47.                
  48.                 reset = true,
  49.                
  50.                 condition = {
  51.                     topicCondition.notCondition(topicCondition.haveMount(11), "You already have stampor mount."),
  52.                     topicCondition.haveItem(13299, 50, "Sorry you don't have the necessary items."),
  53.                     topicCondition.haveItem(13301, 30, "Sorry you don't have the necessary items."),
  54.                     topicCondition.haveItem(13300, 100, "Sorry you don't have the necessary items.")
  55.                 },
  56.                
  57.                 action = {
  58.                     topicAction.removeItem(13299, 50),
  59.                     topicAction.removeItem(13301, 30),
  60.                     topicAction.removeItem(13300, 100),
  61.                     topicAction.giveMount(11),
  62.                     topicAction.playerMagicEffect(CONST_ME_MAGIC_RED)
  63.                 },         
  64.             },
  65.            
  66.             {
  67.                 word = "no",
  68.                 answer = "Maybe next time.",           
  69.            
  70.                 reset = true,
  71.             }
  72.         }, 
  73.     },
  74.    
  75.     ---Shaman Outfit Quest
  76.    
  77.     --getting the first addon quest
  78.     {word = "addon",
  79.         answer = {
  80.             "Deep in the Tiquandian jungle a monster lurks which is seldom seen. It is the revenge of the jungle against humankind. ...",
  81.             "This monster, if slain, carries a rare root called Mandrake. If you find it, bring it to me. Also, gather 5 of the voodoo dolls used by the mysterious dworc voodoomasters. ...",
  82.             "If you manage to fulfil this task, I will grant you your own staff. Have you understood everything and are ready for this test?"
  83.         },
  84.        
  85.         default = {
  86.             reset = true
  87.         },
  88.        
  89.         condition = {
  90.             topicCondition.haveOutfit(154, 158, "Come back when you can wear shamanic clothing."),
  91.             topicCondition.haveStorage(Storage.OutfitQuest.ShamanAddons, -1)
  92.         },
  93.        
  94.         topics = {
  95.             {
  96.                 word = "yes",
  97.                 answer = "Good! Come back once you found a mandrake and collected 5 dworcish voodoo dolls.",
  98.                
  99.                 reset = true,
  100.                
  101.                 condition = {
  102.                     topicCondition.haveOutfit(154, 158, "Come back when you can wear shamanic clothing."),
  103.                     topicCondition.haveStorage(Storage.OutfitQuest.ShamanAddons, -1)
  104.                 },
  105.                
  106.                 action = {
  107.                     topicAction.setStorage(Storage.OutfitQuest.ShamanAddons, 1)
  108.                 },
  109.             },
  110.            
  111.             {
  112.                 word = "no",
  113.                 answer = "Maybe next time.",   
  114.  
  115.                 reset = true,
  116.             }
  117.         },
  118.        
  119.     },
  120.  
  121.     --back with items
  122.     {word = {"addon", "dworc voodoo doll"},
  123.         answer = "Have you gathered the mandrake and the 5 voodoo dolls from the dworcs?",
  124.        
  125.         default = {
  126.             reset = true
  127.         },
  128.        
  129.         condition = {
  130.             topicCondition.haveOutfit(154, 158, "Come back when you can wear shamanic clothing."),
  131.             topicCondition.haveStorage(Storage.OutfitQuest.ShamanAddons, 1)
  132.         }, 
  133.        
  134.         topics = {
  135.             {
  136.                 word = "yes",
  137.                 answer = "I am proud of you, my child, excellent work. This staff shall be yours from now on!",
  138.                
  139.                 reset = true,
  140.                
  141.                 condition = {
  142.                     topicCondition.haveOutfit(154, 158, "Come back when you can wear shamanic clothing."),
  143.                     topicCondition.haveStorage(Storage.OutfitQuest.ShamanAddons, 1),
  144.                     topicCondition.haveItem(5015, 1),
  145.                     topicCondition.haveItem(3955, 5)
  146.                 },
  147.                
  148.                 conditionDefault = {
  149.                     message = "You don't have the required items."
  150.                 },
  151.  
  152.                 action = {
  153.                     topicAction.setStorage(Storage.OutfitQuest.ShamanAddons, 2),
  154.                     topicAction.removeItem(5015, 1),
  155.                     topicAction.removeItem(3955, 5),
  156.                     topicAction.giveOutfitAddon(154, 158, 1)
  157.                 },
  158.             },
  159.    
  160.             {
  161.                 word = "no",
  162.                 answer = "Maybe next time.",   
  163.  
  164.                 reset = true,
  165.             }  
  166.         },
  167.     },
  168.  
  169.     --second addon quest
  170.    
  171.     {word = "addon",
  172.         answer = {
  173.             " You have successfully passed the first task. If you can fulfil my second task, I will grant you a mask like the one I wear. Will you listen to the requirements?"
  174.         },
  175.        
  176.         default = {
  177.             reset = true
  178.         },
  179.        
  180.         condition = {
  181.             topicCondition.haveStorage(Storage.OutfitQuest.ShamanAddons, 2),
  182.             topicCondition.haveOutfitAddon(154, 158, 1)
  183.         },
  184.        
  185.         topics = {
  186.             {
  187.                 word = "yes",
  188.                 answer = {
  189.                     "The dworcs of Tiquanda like to wear certain tribal masks which I would like to take a look at. Please bring me 5 of these masks. ...",
  190.                     "Secondly, the high ape magicians of Banuta use banana staves. I would love to learn more about theses staves, so pleasebring me 5 of them also. ...",
  191.                     " If you manage to fulfil this task, I will grant you your own mask. Have you understood everything and are ready for this test?"
  192.                 },
  193.                
  194.                 default = {
  195.                     reset = true
  196.                 },
  197.                
  198.                 condition = {
  199.                     topicCondition.haveStorage(Storage.OutfitQuest.ShamanAddons, 2),
  200.                     topicCondition.haveOutfitAddon(154, 158, 1)
  201.                 },
  202.                
  203.                 topics = {
  204.                     {  
  205.                         word = "yes",
  206.                         answer = {
  207.                             "Good! Come back once you have collected 5 tribal masks and 5 banana staves.",
  208.                             "I shall grant you a sign of your progress as shaman if you can fulfil my task."
  209.                         },
  210.                        
  211.                         reset = true,
  212.                        
  213.                         condition = {
  214.                             topicCondition.haveStorage(Storage.OutfitQuest.ShamanAddons, 2),
  215.                             topicCondition.haveOutfitAddon(154, 158, 1)
  216.                         },
  217.                        
  218.                         action = {
  219.                             topicAction.setStorage(Storage.OutfitQuest.ShamanAddons, 3)
  220.                         },
  221.                     },
  222.                    
  223.                     {
  224.                         word = "no",
  225.                         answer = "Maybe next time.",   
  226.  
  227.                         reset = true,
  228.                     }
  229.                 },
  230.                
  231.  
  232.             },
  233.        
  234.             {
  235.                 word = "no",
  236.                 answer = "Maybe next time.",   
  237.  
  238.                 reset = true,
  239.             }          
  240.         },
  241.     },
  242.  
  243.     {word = {"addon", "tribal masks"},
  244.         answer = "Have you gathered the 5 tribal masks and the 5 banana staves?",
  245.        
  246.         default = {
  247.             reset = true
  248.         },     
  249.        
  250.         condition = {
  251.             topicCondition.haveStorage(Storage.OutfitQuest.ShamanAddons, 3),
  252.             topicCondition.haveOutfitAddon(154, 158, 1)
  253.         }, 
  254.        
  255.         topics = {
  256.             {
  257.                 word = "yes",
  258.                 answer = "Well done, my child! I hereby grant you the right to wear a shamanic mask. Do it proudly.",
  259.                
  260.                 reset = true,
  261.                
  262.                 condition = {
  263.                     topicCondition.haveOutfit(154, 158, "Come back when you can wear shamanic clothing."),
  264.                     topicCondition.haveStorage(Storage.OutfitQuest.ShamanAddons, 3),
  265.                     topicCondition.haveItem(3966, 5),
  266.                     topicCondition.haveItem(3967, 5)
  267.                 },
  268.                
  269.                 conditionDefault = {
  270.                     message = "You don't have the required items."
  271.                 },
  272.  
  273.                 action = {
  274.                     topicAction.setStorage(Storage.OutfitQuest.ShamanAddons, 4),
  275.                     topicAction.removeItem(3966, 5),
  276.                     topicAction.removeItem(3967, 5),
  277.                     topicAction.giveOutfitAddon(154, 158, 2),
  278.                     topicAction.playerMagicEffect(CONST_ME_MAGIC_GREEN),
  279.                     topicAction.giveAchievement("Way of the Shaman")
  280.                 }, 
  281.             },
  282.            
  283.             {
  284.                 word = "no",
  285.                 answer = "Maybe next time.",   
  286.  
  287.                 reset = true,
  288.             }
  289.         }, 
  290.     }, 
  291.    
  292.     --- Friend and Traders Quest - wooden stake
  293.    
  294.    
  295.     {word = {"wooden stake", "stake"},
  296.         answer = {
  297.             "Ten prayers for a blessed stake? Don't tell me they made you travel whole Tibia for it! Listen, child, if you bring me a wooden stake, I'll bless it for you. <chuckles>"
  298.         },
  299.        
  300.         default = { reset = true },
  301.        
  302.         condition = {
  303.             topicCondition.haveStorage(Storage.FriendsandTraders.TheBlessedStake, 12),
  304.         },
  305.        
  306.         topics = {
  307.             {
  308.                 word = {"wooden stake", "stake"},
  309.                 answer = {
  310.                     "Would you like to receive a spiritual prayer to bless your stake?"
  311.                 },
  312.                
  313.                 default = {
  314.                     reset = true
  315.                 },
  316.                
  317.                 condition = {
  318.                     topicCondition.haveStorage(Storage.FriendsandTraders.TheBlessedStake, 12),
  319.                     ritualExaustionCondition
  320.                 },
  321.                
  322.                 topics = {
  323.                     word = "yes",
  324.                     answer = "<mumblemumble> Sha Kesh Mar!",
  325.                    
  326.                     reset = true,
  327.                    
  328.                     condition = {
  329.                         topicCondition.haveStorage(Storage.FriendsandTraders.TheBlessedStake, 12),
  330.                         function (cid)
  331.                             local player = Player(cid)
  332.                            
  333.                             if (player:getStorageValue(Storage.FriendsandTraders.TheBlessedStakeWaitTime) + 7 * 24 * 60 * 60) < os.time() then
  334.                                 return true
  335.                             else
  336.                                 npcHandler:say("sorry I'm still exhausted from the last ritual. come back later and try again.", cid)
  337.                             end
  338.                            
  339.                             return false
  340.                         end,
  341.                        
  342.                         topicCondition.haveItem(5941, 1, "You don't have the stake."),
  343.                     },
  344.                    
  345.                     action = {
  346.                         topicAction.removeItem(5941, 1),
  347.                         topicAction.giveItem(5942, 1),
  348.                         topicAction.playerMagicEffect(CONST_ME_HOLYAREA),
  349.                         topicAction.giveAchievement("Blessed!"),
  350.                         function (cid)
  351.                             local player = Player(cid)
  352.                             player:setStorageValue(Storage.FriendsandTraders.TheBlessedStakeWaitTime, os.time())
  353.                             return true
  354.                         end
  355.                     },             
  356.                 }
  357.             }
  358.         },
  359.     },
  360. })
  361.  
  362.  
  363. function onCreatureAppear(cid)          npc:onCreatureAppear(cid)           end
  364. function onCreatureDisappear(cid)       npc:onCreatureDisappear(cid)        end
  365. function onCreatureSay(cid, type, msg)  npc:onCreatureSay(cid, type, msg)   end
  366. function onThink()                      npc:onThink()                       end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement