MerchantVleko.lua 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. --[[
  2. Script Name : SpawnScripts/TempleSt/MerchantVleko.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.10.23 11:10:35
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local VlekoPlan = 5873
  10. function spawn(NPC)
  11. ProvidesQuest(NPC, VlekoPlan)
  12. Emotes(NPC)
  13. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  14. SetTempVariable(NPC,"CalloutTimer","false")
  15. AddTimer(NPC,MakeRandomInt(2000,4000),"Twergo")
  16. end
  17. function LeaveRange(NPC,Spawn)
  18. Twergo(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, "","","cutthroat",0,0)
  34. end
  35. AddTimer(NPC,5200,"Emotes")
  36. elseif Choice == 2 then
  37. if not IsPlayer(GetTarget(NPC)) then
  38. PlayFlavor(NPC, "","","chuckle",0,0)
  39. end
  40. AddTimer(NPC,5200,"Emotes")
  41. elseif Choice == 3 then
  42. if not IsPlayer(GetTarget(NPC)) then
  43. PlayFlavor(NPC, "","","neener",0,0)
  44. end
  45. AddTimer(NPC,5000,"Emotes")
  46. elseif Choice == 4 then
  47. if not IsPlayer(GetTarget(NPC)) then
  48. PlayFlavor(NPC, "","","threaten",0,0)
  49. end
  50. AddTimer(NPC,7300,"Emotes")
  51. elseif Choice == 5 then
  52. if not IsPlayer(GetTarget(NPC)) then
  53. PlayFlavor(NPC, "","","whome",0,0)
  54. end
  55. AddTimer(NPC,7300,"Emotes")
  56. end
  57. else --If Recently Called Out to Player
  58. AddTimer(NPC,7000,"Emotes")
  59. end
  60. end
  61. function Twergo(NPC,Spawn)
  62. local zone = GetZone(NPC)
  63. local TwergoGnome = GetSpawnByLocationID(zone,420561)
  64. SetTarget(NPC,TwergoGnome)
  65. FaceTarget(NPC, TwergoGnome)
  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. Dialog1(NPC,Spawn)
  77. end
  78. end
  79. function Dialog1(NPC,Spawn)
  80. SetTarget(NPC,Spawn)
  81. FaceTarget(NPC, Spawn)
  82. Dialog.New(NPC, Spawn)
  83. Dialog.AddDialog("Kahhh!!! I hate those Togglesmeets! Their items are shoddy. We only makes the finest quality items. Togglesmeets will sell you the unsafes! My poppa sells you good quality!")
  84. Dialog.AddVoiceover("voiceover/english/merchant_vleko/fprt_hood03/mer_merchantvleko.mp3",4226142003,2683221742)
  85. if CanReceiveQuest(Spawn, VlekoPlan) then
  86. Dialog.AddOption("Ridiculous! Convince them to move their stall!", "Dialog1a")
  87. elseif GetQuestStep(Spawn, VlekoPlan)==2 then
  88. Dialog.AddOption("Here is the orcish sword you requested.", "Dialog2")
  89. end
  90. Dialog.AddOption("How about I just browse your wares.")
  91. Dialog.Start()
  92. end
  93. function Dialog1a(NPC,Spawn)
  94. SetTarget(NPC,Spawn)
  95. FaceTarget(NPC, Spawn)
  96. Dialog.New(NPC, Spawn)
  97. Dialog.AddDialog("We do! We do! We tell them to leave, or they maybe have an accident. Accidents happen all the time. They don't believe us, but poppa says to wait and watch. Geheeea! Maybe you help me pass the time?")
  98. Dialog.AddVoiceover("voiceover/english/merchant_vleko/fprt_hood03/quests/vleko/vleko_x1_initial.mp3",86797808,1238006206)
  99. PlayFlavor(NPC, "","","nod",0,0, Spawn)
  100. Dialog.AddOption("I could be persuaded... What do you have in mind?", "OfferQuest1")
  101. Dialog.AddOption("I have better thing to do.")
  102. Dialog.Start()
  103. end
  104. function OfferQuest1(NPC,Spawn)
  105. if CanReceiveQuest(Spawn, VlekoPlan) then
  106. OfferQuest(NPC, Spawn, VlekoPlan)
  107. end
  108. end
  109. function Dialog2(NPC,Spawn)
  110. SetTarget(NPC,Spawn)
  111. FaceTarget(NPC, Spawn)
  112. Dialog.New(NPC, Spawn)
  113. Dialog.AddDialog("Hide it! Hide it! If Togglesmeets see it then poppa will know what I'm doing! Okay, pass it to me. Good. Now, take this money and keep your mouth shut. I don't know you, and I've never seen you. Hehehehe ... soon, accidents happen to Togglesmeets.")
  114. Dialog.AddVoiceover("voiceover/english/merchant_vleko/fprt_hood03/quests/vleko/vleko_x1_finish.mp3",1524753071,3531869216)
  115. PlayFlavor(NPC, "","","scheme",0,0, Spawn)
  116. Dialog.AddOption("Thanks. Good luck with your feud, or whatever!")
  117. Dialog.Start()
  118. SetStepComplete(Spawn, VlekoPlan, 2)
  119. end