MerchantVlepo.lua 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. --[[
  2. Script Name : SpawnScripts/TempleSt/MerchantVlepo.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.10.23 04:10:43
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local VlepoPlan = 5917
  10. function spawn(NPC)
  11. ProvidesQuest(NPC, VlepoPlan)
  12. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  13. SetTempVariable(NPC,"CalloutTimer","false")
  14. AddTimer(NPC,2000,"Qwergo")
  15. AddTimer(NPC,MakeRandomInt(2500,4000),"Emotes")
  16. end
  17. function LeaveRange(NPC,Spawn)
  18. Qwergo(NPC,Spawn)
  19. if GetTempVariable(NPC,"CalloutTimer")=="true" then
  20. SetTempVariable(NPC,"CalloutTimer","false")
  21. end
  22. end
  23. function InRange(NPC,Spawn)
  24. end
  25. function ResetCallout(NPC,Spawn)
  26. SetTempVariable(NPC,"CalloutTimer","false")
  27. end
  28. function Emotes(NPC,Spawn)
  29. local Choice = MakeRandomInt(1,5)
  30. if GetTempVariable(NPC,"CalloutTimer")=="false" then
  31. if Choice == 1 then
  32. if not IsPlayer(GetTarget(NPC)) then
  33. PlayFlavor(NPC, "","","tantrum",0,0)
  34. end
  35. AddTimer(NPC,2200,"Emotes")
  36. elseif Choice == 2 then
  37. if not IsPlayer(GetTarget(NPC)) then
  38. PlayFlavor(NPC, "","","shakefist",0,0)
  39. end
  40. AddTimer(NPC,5200,"Emotes")
  41. elseif Choice == 3 then
  42. if not IsPlayer(GetTarget(NPC)) then
  43. PlayFlavor(NPC, "","","point",0,0)
  44. end
  45. AddTimer(NPC,5000,"Emotes")
  46. elseif Choice == 4 then
  47. if not IsPlayer(GetTarget(NPC)) then
  48. PlayFlavor(NPC, "","","taunt",0,0)
  49. end
  50. AddTimer(NPC,7300,"Emotes")
  51. elseif Choice == 5 then
  52. if not IsPlayer(GetTarget(NPC)) then
  53. PlayFlavor(NPC, "","","glare",0,0)
  54. end
  55. AddTimer(NPC,6300,"Emotes")
  56. end
  57. else --If Recently Called Out to Player
  58. AddTimer(NPC,7000,"Emotes")
  59. end
  60. end
  61. function Qwergo(NPC,Spawn)
  62. local zone = GetZone(NPC)
  63. local QwergoGnome = GetSpawnByLocationID(zone,420562)
  64. SetTarget(NPC,QwergoGnome)
  65. FaceTarget(NPC, QwergoGnome)
  66. end
  67. function respawn(NPC)
  68. spawn(NPC)
  69. end
  70. function hailed(NPC, Spawn)
  71. SetTarget(NPC,Spawn)
  72. if GetFactionAmount(Spawn,12) <0 then
  73. FaceTarget(NPC, Spawn)
  74. PlayFlavor(NPC, "","","shakefist",0,0, Spawn)
  75. else
  76. if GetQuestStep(Spawn,VlepoPlan) ==1 then
  77. PlayFlavor(NPC,"","Why you return? I don't see Shinska's weapon?","shrug",0,0,Spawn)
  78. else
  79. Dialog1(NPC,Spawn)
  80. end
  81. end
  82. end
  83. function Dialog1(NPC,Spawn)
  84. SetTarget(NPC,Spawn)
  85. FaceTarget(NPC, Spawn)
  86. Dialog.New(NPC, Spawn)
  87. Dialog.AddDialog("My son and I runs a reputable business. Only good quality items do we sell. Those thieving Togglesmeets will steal from you, so you wants to buy from us!")
  88. Dialog.AddVoiceover("voiceover/english/voice_emotes/greetings/greetings_"..MakeRandomInt(1,3).."_1046.mp3",0,0)
  89. if CanReceiveQuest(Spawn, VlepoPlan) then
  90. Dialog.AddOption("You must have quite the selection!", "Dialog2")
  91. elseif GetQuestStep(Spawn, VlepoPlan)==2 then
  92. Dialog.AddOption("Here is a weapon from Shinska's you wanted.", "Dialog3")
  93. end
  94. Dialog.AddOption("How about I just browse your wares.")
  95. Dialog.Start()
  96. end
  97. function Dialog2(NPC,Spawn)
  98. SetTarget(NPC,Spawn)
  99. FaceTarget(NPC, Spawn)
  100. Dialog.New(NPC, Spawn)
  101. Dialog.AddDialog("Oh, yes we do. My son and I were here first. We were selling all types of items, then those gnomes moved in. I'll put a stop to it soon! Maybe for some money you help me?")
  102. PlayFlavor(NPC, "","","agree",0,0, Spawn)
  103. if CanReceiveQuest(Spawn, VlepoPlan) then
  104. Dialog.AddOption("If there is coin involved, I would be happy to.", "Offer")
  105. end
  106. Dialog.AddOption("Not right now. I'm busy.")
  107. Dialog.Start()
  108. end
  109. function Offer(NPC,Spawn)
  110. OfferQuest(NPC,Spawn,VlepoPlan)
  111. end
  112. function Dialog3(NPC,Spawn)
  113. SetTarget(NPC,Spawn)
  114. FaceTarget(NPC, Spawn)
  115. Dialog.New(NPC, Spawn)
  116. Dialog.AddDialog("Good, good. I know my plan will work. Tonight when the gnomes leave, I slip in and put this weapon in their stall. Later, I call over Ogre Guard and tell him that the Shinska is missing a weapon. Dumb Ogre comes over here and checks my honest and clean merchandise, and then he sees the gnomes and smashes them into the ground. Here's your money. Now, you no say anything, you got it?")
  117. PlayFlavor(NPC, "","","scheme",0,0, Spawn)
  118. Dialog.AddOption("See what? I didn't see a thing...")
  119. Dialog.Start()
  120. SetStepComplete(Spawn,VlepoPlan,2)
  121. end
  122. --Whydo we even care? Those gnomes will blow themselves up one of these days, anyway.
  123. --Oh, yes we do. My son and I were here first. We were selling all types of items, then those gnomes moved in. I'll put a stop to it soon! Maybe for some money you help me?
  124. function RandomGreeting(NPC, Spawn)
  125. local choice = MakeRandomInt(1,4)
  126. if choice == 1 then
  127. PlayFlavor(NPC, "", "You like good wares? You come to my stall!", "", 0, 0, Spawn, 0)
  128. elseif choice == 2 then
  129. PlayFlavor(NPC, "voiceover/english/optional2/ratonga_eco_evil_2/ft/service/alchemist/ratonga_alchemist_service_evil_2_hail_gm_edc44700.mp3", "I need to get some eye of griffin, a bear's paw, the heart of an innocent man--that'll be tough in this city!", "confused", 3775164756, 640959658, Spawn, 0)
  130. elseif choice == 3 then
  131. PlayFlavor(NPC, "voiceover/english/optional2/ratonga_eco_evil_2/ft/service/alchemist/ratonga_alchemist_service_evil_2_hail_gm_2a2e86d7.mp3", "Poison testers, it's been my biggest seller for the past several months. Of course, poison was a close second. ", "ponder", 968328188, 2082601565, Spawn, 0)
  132. elseif choice == 4 then
  133. PlayFlavor(NPC, "voiceover/english/optional2/ratonga_eco_evil_2/ft/service/alchemist/ratonga_alchemist_service_evil_2_hail_gm_3e1da8c1.mp3", "Be careful what you touch in here. You're liable to kill us all!", "tapfoot", 299699712, 1352254492, Spawn, 0)
  134. end
  135. end