GarionDunam.lua 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. --]]
  8. local FAR_SEAS_DIRECT_REQUISITION_CVS0276_QUEST_ID = 502
  9. local FAR_SEAS_DIRECT_REQUISITION_CVS0431_QUEST_ID = 503
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function InRange(NPC, Spawn)
  17. local chance = math.random(0, 100)
  18. if chance <= 25 then
  19. Talk(NPC, Spawn)
  20. end
  21. end
  22. function LeaveRange(NPC, Spawn)
  23. end
  24. function hailed(NPC, Spawn)
  25. Talk(NPC, Spawn)
  26. end
  27. function Talk(NPC, Spawn)
  28. FaceTarget(NPC, Spawn)
  29. if (not HasQuest(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0276_QUEST_ID) or GetQuestStep(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0276_QUEST_ID) ~= 3) and (not HasQuest(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0431_QUEST_ID) or GetQuestStep(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0431_QUEST_ID) ~= 2) then
  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, "", "Garion is my name, potions my game. What can I get for you?", "", 1689589577, 4560189, 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. else
  43. conversation = CreateConversation()
  44. AddConversationOption(conversation, "I have a direct delivery from the Far Seas Trading Co.", "dlg_0_1")
  45. StartConversation(conversation, NPC, Spawn, "Garion is my name, potions my game. What can I get for you?")
  46. end
  47. end
  48. --[[Far Seas Direct Requisition CVS0276 QUEST (502)]]----[[Far Seas Direct Requisition CVS0431 QUEST (503)]]--
  49. function dlg_0_1(NPC, Spawn)
  50. FaceTarget(NPC, Spawn)
  51. conversation = CreateConversation()
  52. if HasQuest(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0276_QUEST_ID) then
  53. SetStepComplete(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0276_QUEST_ID, 3)
  54. elseif HasQuest(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0431_QUEST_ID) then
  55. SetStepComplete(Spawn, FAR_SEAS_DIRECT_REQUISITION_CVS0431_QUEST_ID, 2)
  56. end
  57. AddConversationOption(conversation, "What customers!")
  58. 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.")
  59. end