GarionDunam.lua 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. --[[
  2. Script Name : SpawnScripts/Nettleville/GarionDunam.lua
  3. Script Purpose : Garion Dunam <Alchemist>
  4. Script Author : Scatman
  5. Script Date : 2009.08.12
  6. Script Notes : Updated 1/6/2020 by Shatou
  7. Script Notes : Created Delivery quest. Applied voiceovers. Reorganized turnins and hails. 2022.03.06 Dorbin
  8. --]]
  9. local FAR_SEAS_DIRECT_REQUISITION_CVS0276_QUEST_ID = 502
  10. local FAR_SEAS_DIRECT_REQUISITION_CVS0431_QUEST_ID = 503
  11. local Delivery = 5499
  12. function spawn(NPC)
  13. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  14. ProvidesQuest(NPC, Delivery)
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function InRange(NPC, Spawn)
  20. local chance = math.random(0, 100)
  21. if chance <= 25 then
  22. Talk(NPC, Spawn)
  23. end
  24. end
  25. function LeaveRange(NPC, Spawn)
  26. end
  27. function Talk(NPC, Spawn)
  28. FaceTarget(NPC, Spawn)
  29. local choice = math.random(1, 5)
  30. if choice == 1 then
  31. PlayFlavor(NPC, "voiceover/english/human_eco_good_1/ft/service/alchemist/human_alchemist_service_good_1_hail_gm_a8ed74c7.mp3", "There are no refunds for caster error at this shop! Oh ... hello you're not here about a refund.", "no", 383508519, 1836231230, Spawn)
  32. elseif choice == 2 then
  33. PlayFlavor(NPC, "voiceover/english/human_eco_good_1/ft/service/alchemist/human_alchemist_service_good_1_hail_gm_59de96bd.mp3", "What happened to the highly explosive bottle that was on my desk? Have you seen it?", "peer", 1482977865, 753937939, Spawn)
  34. elseif choice == 3 then
  35. PlayFlavor(NPC, "voiceover/english/alchemist_garion_dunam/qey_village01/alchemistgarion000.mp3", "Garion is my name, potions my game. What can I get for you?", "hello", 3929426518, 2943920843, Spawn)
  36. elseif choice == 4 then
  37. PlayFlavor(NPC, "voiceover/english/human_eco_good_1/ft/service/alchemist/human_alchemist_service_good_1_hail_gm_ec533e4c.mp3", "Are you wounded? I just made up a fresh batch of healing potions an hour ago.", "hello", 3929603973, 2846331407, Spawn)
  38. elseif choice == 5 then
  39. PlayFlavor(NPC, "voiceover/english/human_eco_good_1/ft/service/alchemist/human_alchemist_service_good_1_hail_gm_efd903ba.mp3", "Hello, adventurer! Are you looking for a specific potion or ingredient?", "agree", 3478121196, 1626504328, Spawn)
  40. end
  41. end
  42. function hailed(NPC, Spawn)
  43. FaceTarget(NPC, Spawn)
  44. PlayFlavor(NPC, "voiceover/english/alchemist_garion_dunam/qey_village01/alchemistgarion000.mp3", "", "", 3929426518, 2943920843, Spawn)
  45. conversation = CreateConversation()
  46. if GetQuestStep(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0276_QUEST_ID) == 3 then
  47. AddConversationOption(conversation, "I have a direct delivery from the Far Seas Trading Co.", "dlg_0_1")
  48. end
  49. if GetQuestStep(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0431_QUEST_ID) == 2 then
  50. AddConversationOption(conversation, "I have a direct delivery from the Far Seas Trading Co.", "dlg_0_1")
  51. end
  52. if not HasQuest(Spawn, Delivery) and not HasCompletedQuest(Spawn, Delivery) and GetLevel(Spawn) >= 6 then
  53. AddConversationOption(conversation, "Have any work?", "DeliveryJob")
  54. end
  55. if GetQuestStep(Spawn, Delivery) == 2 then
  56. AddConversationOption(conversation, "I have delievered the elixer. Here is Tillheel's payment.", "DeliveryDone")
  57. end
  58. AddConversationOption(conversation, "Just looking around. Thanks.")
  59. StartConversation(conversation, NPC, Spawn, "Garion is my name, potions my game. What can I get for you?")
  60. end
  61. function DeliveryJob(NPC, Spawn)
  62. FaceTarget(NPC, Spawn)
  63. PlayFlavor(NPC, "voiceover/english/alchemist_garion_dunam/qey_village01/alchemistgarion001.mp3", "", "nod", 2055816089, 3874140273, Spawn)
  64. conversation = CreateConversation()
  65. AddConversationOption(conversation, "Sure. I'll deliver this for you.","QuestOffer")
  66. AddConversationOption(conversation, "On second thought, nevermind.")
  67. StartConversation(conversation, NPC, Spawn, "Garion is my name, potions my game. What can I get for you?")
  68. end
  69. function QuestOffer(NPC,Spawn,Quest)
  70. FaceTarget(NPC, Spawn)
  71. OfferQuest(NPC,Spawn, 5499)
  72. end
  73. function DeliveryDone(NPC, Spawn)
  74. FaceTarget(NPC, Spawn)
  75. PlayFlavor(NPC, "voiceover/english/alchemist_garion_dunam/qey_village01/alchemistgarion002.mp3", "", "thank", 4005071360, 3982549677, Spawn)
  76. conversation = CreateConversation()
  77. SetStepComplete(Spawn, Delivery, 2)
  78. AddConversationOption(conversation, "I'll keep that in mind. Thank you.")
  79. StartConversation(conversation, NPC, Spawn, "A job well done! Please, keep the change, and if you ever need any potions remember name 'Garion Dunum, Alchemist Supreme'.")
  80. end
  81. --[[Far Seas Direct Requisition CVS0276 QUEST (502)]]----[[Far Seas Direct Requisition CVS0431 QUEST (503)]]--
  82. function dlg_0_1(NPC, Spawn)
  83. FaceTarget(NPC, Spawn)
  84. conversation = CreateConversation()
  85. PlayFlavor(NPC, "voiceover/english/alchemist_garion_dunam/qey_village01/alchemistgarion003.mp3", "", "", 784804131, 2104992484, Spawn)
  86. if HasQuest(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0276_QUEST_ID) then
  87. SetStepComplete(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0276_QUEST_ID, 3)
  88. elseif HasQuest(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0431_QUEST_ID) then
  89. SetStepComplete(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0431_QUEST_ID, 2)
  90. end
  91. AddConversationOption(conversation, "What customers!?")
  92. StartConversation(conversation, NPC, Spawn, "'Bout time this made its way to the alchemist supreme! I was about to complain to the Far Seas. Well, a job done is a job done. Here's your pay. Move along. You're scaring the customers.")
  93. end