9
3

GarionDunam.lua 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. SetInfoStructString(NPC, "action_state", "alchemy_idle")
  16. end
  17. function respawn(NPC)
  18. spawn(NPC)
  19. end
  20. function InRange(NPC, Spawn)
  21. local chance = math.random(0, 100)
  22. if chance <= 25 then
  23. Talk(NPC, Spawn)
  24. end
  25. end
  26. function LeaveRange(NPC, Spawn)
  27. end
  28. function Talk(NPC, Spawn)
  29. FaceTarget(NPC, Spawn)
  30. local choice = math.random(1, 5)
  31. if choice == 1 then
  32. 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)
  33. elseif choice == 2 then
  34. 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)
  35. elseif choice == 3 then
  36. 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)
  37. elseif choice == 4 then
  38. 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)
  39. elseif choice == 5 then
  40. 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)
  41. end
  42. end
  43. function hailed(NPC, Spawn)
  44. FaceTarget(NPC, Spawn)
  45. PlayFlavor(NPC, "voiceover/english/alchemist_garion_dunam/qey_village01/alchemistgarion000.mp3", "", "", 3929426518, 2943920843, Spawn)
  46. conversation = CreateConversation()
  47. if GetQuestStep(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0276_QUEST_ID) == 3 then
  48. AddConversationOption(conversation, "I have a direct delivery from the Far Seas Trading Co.", "dlg_0_1")
  49. end
  50. if GetQuestStep(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0431_QUEST_ID) == 2 then
  51. AddConversationOption(conversation, "I have a direct delivery from the Far Seas Trading Co.", "dlg_0_1")
  52. end
  53. if not HasQuest(Spawn, Delivery) and not HasCompletedQuest(Spawn, Delivery) and GetLevel(Spawn) >= 6 then
  54. AddConversationOption(conversation, "Have any work?", "DeliveryJob")
  55. end
  56. if GetQuestStep(Spawn, Delivery) == 2 then
  57. AddConversationOption(conversation, "I have delievered the elixer. Here is Tillheel's payment.", "DeliveryDone")
  58. end
  59. AddConversationOption(conversation, "Just looking around. Thanks.")
  60. StartConversation(conversation, NPC, Spawn, "Garion is my name, potions my game. What can I get for you?")
  61. end
  62. function DeliveryJob(NPC, Spawn)
  63. FaceTarget(NPC, Spawn)
  64. PlayFlavor(NPC, "voiceover/english/alchemist_garion_dunam/qey_village01/alchemistgarion001.mp3", "", "nod", 2055816089, 3874140273, Spawn)
  65. conversation = CreateConversation()
  66. AddConversationOption(conversation, "Sure. I'll deliver this for you.","QuestOffer")
  67. AddConversationOption(conversation, "On second thought, nevermind.")
  68. StartConversation(conversation, NPC, Spawn, "I always need a good courier. Take this elixer to the sage house in the Graystone Yard. You'll find my assistant Tillheel there. He'll be expecting you. Be sure to bring my payment!")
  69. end
  70. function QuestOffer(NPC,Spawn,Quest)
  71. FaceTarget(NPC, Spawn)
  72. OfferQuest(NPC,Spawn, 5499)
  73. end
  74. function DeliveryDone(NPC, Spawn)
  75. FaceTarget(NPC, Spawn)
  76. PlayFlavor(NPC, "voiceover/english/alchemist_garion_dunam/qey_village01/alchemistgarion002.mp3", "", "thank", 4005071360, 3982549677, Spawn)
  77. conversation = CreateConversation()
  78. SetStepComplete(Spawn, Delivery, 2)
  79. AddConversationOption(conversation, "I'll keep that in mind. Thank you.")
  80. 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'.")
  81. end
  82. --[[Far Seas Direct Requisition CVS0276 QUEST (502)]]----[[Far Seas Direct Requisition CVS0431 QUEST (503)]]--
  83. function dlg_0_1(NPC, Spawn)
  84. FaceTarget(NPC, Spawn)
  85. conversation = CreateConversation()
  86. PlayFlavor(NPC, "voiceover/english/alchemist_garion_dunam/qey_village01/alchemistgarion003.mp3", "", "", 784804131, 2104992484, Spawn)
  87. if HasQuest(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0276_QUEST_ID) then
  88. SetStepComplete(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0276_QUEST_ID, 3)
  89. elseif HasQuest(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0431_QUEST_ID) then
  90. SetStepComplete(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0431_QUEST_ID, 2)
  91. end
  92. AddConversationOption(conversation, "What customers!?")
  93. 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.")
  94. end