MartaTerrilon.lua 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. --[[
  2. Script Name : SpawnScripts/Everfrost/MartaTerrilon.lua
  3. Script Author : Flunklesnarkin
  4. Script Date : 2015.09.04 10:09:19
  5. Script Purpose :
  6. :
  7. --]]
  8. local Marta_Terrilons_Fur_Hunt = 161
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  11. ProvidesQuest(NPC, Marta_Terrilons_Fur_Hunt)
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function InRange(NPC, Spawn)
  17. end
  18. function LeaveRange(NPC, Spawn)
  19. end
  20. function hailed(NPC, Spawn)
  21. FaceTarget(NPC, Spawn)
  22. if HasQuest(Spawn, Marta_Terrilons_Fur_Hunt) == false and HasCompletedQuest(Spawn, Marta_Terrilons_Fur_Hunt) == false then
  23. Quest1Chat_1(NPC, Spawn)
  24. elseif GetQuestStep(Spawn, Marta_Terrilons_Fur_Hunt) == 1 then
  25. Quest1Chat_2(NPC, Spawn)
  26. elseif GetQuestStep(Spawn, Marta_Terrilons_Fur_Hunt) == 2 then
  27. Quest1Chat_3(NPC, Spawn)
  28. elseif HasQuest(Spawn, Marta_Terrilons_Fur_Hunt) == false and HasCompletedQuest(Spawn, Marta_Terrilons_Fur_Hunt) == true then
  29. local count = GetQuestCompleteCount(Spawn, Marta_Terrilons_Fur_Hunt)
  30. if count <=3 then
  31. Quest1Chat_4(NPC, Spawn)
  32. else
  33. Quest1Chat_5(NPC, Spawn)
  34. end
  35. end
  36. end
  37. function Quest1Chat_1(NPC, Spawn)
  38. FaceTarget(NPC, Spawn)
  39. conversation = CreateConversation()
  40. AddConversationOption(conversation, "Yes, I'm available to help.", "Offer_Marta_Terrilons_Fur_Hunt")
  41. AddConversationOption(conversation, "Sorry, I'm not interested.")
  42. StartConversation(conversation, NPC, Spawn, "Well met traveler! I am a buyer for a regional fur trading company, who is trying to establish a market for furred clothing and armor linings! I am seeking skilled hunters, capable of delivering large quantities of fur that are excellent condition! Would you be interested in this?")
  43. end
  44. function Quest1Chat_2(NPC, Spawn)
  45. FaceTarget(NPC, Spawn)
  46. conversation = CreateConversation()
  47. AddConversationOption(conversation, "You got it.")
  48. StartConversation(conversation, NPC, Spawn, "I'm going to require more furs than that! Please come back when you have some more!")
  49. end
  50. function Quest1Chat_3(NPC, Spawn)
  51. SetStepComplete(Spawn, Marta_Terrilons_Fur_Hunt, 2)
  52. FaceTarget(NPC, Spawn)
  53. conversation = CreateConversation()
  54. AddConversationOption(conversation, "Thanks.")
  55. StartConversation(conversation, NPC, Spawn, "These furs will do quite nicely! Well done, please take this in compensation for your efforts.")
  56. end
  57. function Quest1Chat_4(NPC, Spawn)
  58. FaceTarget(NPC, Spawn)
  59. conversation = CreateConversation()
  60. AddConversationOption(conversation, "Sure!", "Offer_Marta_Terrilons_Fur_Hunt")
  61. AddConversationOption(conversation, "Not right now.")
  62. StartConversation(conversation, NPC, Spawn, "Do you think you have time to bring me some more furs?")
  63. end
  64. function Quest1Chat_5(NPC, Spawn)
  65. FaceTarget(NPC, Spawn)
  66. local choice = math.random(1,2)
  67. if choice == 1 then
  68. Say(NPC, "You did fine work for me. Thanks!")
  69. else
  70. Say(NPC, "Appreciate all your help!")
  71. end
  72. end
  73. function Offer_Marta_Terrilons_Fur_Hunt(NPC, Spawn)
  74. if HasQuest(Spawn, Marta_Terrilons_Fur_Hunt) == false and HasCompletedQuest(Spawn, Marta_Terrilons_Fur_Hunt) == false then
  75. OfferQuest(NPC, Spawn, Marta_Terrilons_Fur_Hunt)
  76. FaceTarget(NPC, Spawn)
  77. conversation = CreateConversation()
  78. AddConversationOption(conversation, "I will be back with the furs.")
  79. StartConversation(conversation, NPC, Spawn, "Excellent! There are several beasts in these parts that have nice fur. I require that you bring me a good quantity of these furs, for which you will be paid.")
  80. elseif HasQuest(Spawn, Marta_Terrilons_Fur_Hunt) == false and HasCompletedQuest(Spawn, Marta_Terrilons_Fur_Hunt) == true then
  81. OfferQuest(NPC, Spawn, Marta_Terrilons_Fur_Hunt)
  82. FaceTarget(NPC, Spawn)
  83. conversation = CreateConversation()
  84. AddConversationOption(conversation, "I'll be back with the furs.")
  85. StartConversation(conversation, NPC, Spawn, "Great! Here's a list of what I need now. Bring me the most pristine furs that you can and you'll be well-rewarded.")
  86. end
  87. end