AnimationSpeedScroll.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. --[[
  2. Script Name : SpawnScripts/DoF_design_path_script/AnimationSpeedScroll.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.07.18 06:07:48
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local Busy = false
  10. local Move = false
  11. function spawn(NPC)
  12. end
  13. function hailed(NPC, Spawn)
  14. Dialog1(NPC,Spawn)
  15. end
  16. function Dialog1(NPC, Spawn)
  17. Dialog.New(NPC, Spawn)
  18. if Busy == false then
  19. Dialog.AddDialog("This scroll will demonstrate the effects on model animations based on movement speed and spawn size. What would you like to do?")
  20. Dialog.AddOption("Setup the Spawns","Setup")
  21. Dialog.AddOption("Nevermind")
  22. elseif Move == false then
  23. Dialog.AddDialog("What would you like to do?")
  24. Dialog.AddOption("Begin Movement","Movement")
  25. Dialog.AddOption("Change Spawn Type","SpawnType1")
  26. Dialog.AddOption("Change Spawn Size","Size1")
  27. Dialog.AddOption("Reset the Spawns","Reset")
  28. Dialog.AddOption("Nevermind")
  29. else
  30. Dialog.AddDialog("What would you like to do?")
  31. Dialog.AddOption("Change Spawn Type","SpawnType1")
  32. Dialog.AddOption("Change Spawn Size","Size1")
  33. Dialog.AddOption("Reset the Spawns","Reset")
  34. Dialog.AddOption("Nevermind")
  35. end
  36. Dialog.Start()
  37. end
  38. function Movement(NPC,Spawn)
  39. Move = true
  40. Say(NPC,"Movement Initiated in...")
  41. AddTimer(NPC,1000,"Say3")
  42. AddTimer(NPC,2000,"Say2")
  43. AddTimer(NPC,3000,"Say1")
  44. AddTimer(NPC,4000,"Waypoints")
  45. end
  46. function Say3(NPC,Spawn)
  47. Say(NPC,"3")
  48. end
  49. function Say2(NPC,Spawn)
  50. Say(NPC,"2")
  51. end
  52. function Say1(NPC,Spawn)
  53. Say(NPC,"1")
  54. end
  55. function Setup(NPC,Spawn)
  56. local zone = GetZone(NPC)
  57. local Flag1 = GetSpawnByLocationID(zone, 133785993)
  58. local Flag2 = GetSpawnByLocationID(zone, 133785994)
  59. local Speed1 = GetSpawnByLocationID(zone, 133785989)
  60. local Speed2 = GetSpawnByLocationID(zone, 133785990)
  61. local Speed4 = GetSpawnByLocationID(zone, 133785991)
  62. local Speed6 = GetSpawnByLocationID(zone, 133785992)
  63. Busy = true
  64. if Flag1 ==nil then
  65. SpawnByLocationID(zone, 133785993)
  66. end
  67. if Flag2 ==nil then
  68. SpawnByLocationID(zone, 133785994)
  69. end
  70. if Speed1 ==nil then
  71. SpawnByLocationID(zone, 133785989)
  72. end
  73. if Speed2 ==nil then
  74. SpawnByLocationID(zone, 133785990)
  75. end
  76. if Speed4 ==nil then
  77. SpawnByLocationID(zone, 133785991)
  78. end
  79. if Speed6 ==nil then
  80. SpawnByLocationID(zone, 133785992)
  81. end
  82. end
  83. function Reset(NPC,Spawn)
  84. local zone = GetZone(NPC)
  85. local Flag1 = GetSpawnByLocationID(zone, 133785993)
  86. local Flag2 = GetSpawnByLocationID(zone, 133785994)
  87. local Speed1 = GetSpawnByLocationID(zone, 133785989)
  88. local Speed2 = GetSpawnByLocationID(zone, 133785990)
  89. local Speed4 = GetSpawnByLocationID(zone, 133785991)
  90. local Speed6 = GetSpawnByLocationID(zone, 133785992)
  91. Busy = false
  92. Move = false
  93. if Flag1 ~=nil then
  94. Despawn(Flag1)
  95. end
  96. if Flag2 ~=nil then
  97. Despawn(Flag2)
  98. end
  99. if Speed1 ~=nil then
  100. KillSpawn(Speed1)
  101. end
  102. if Speed2 ~=nil then
  103. KillSpawn(Speed2)
  104. end
  105. if Speed4 ~=nil then
  106. KillSpawn(Speed4)
  107. end
  108. if Speed6 ~=nil then
  109. KillSpawn(Speed6)
  110. end
  111. end
  112. function Waypoints(NPC,Spawn)
  113. local zone = GetZone(NPC)
  114. local Speed1 = GetSpawnByLocationID(zone, 133785989)
  115. local Speed2 = GetSpawnByLocationID(zone, 133785990)
  116. local Speed4 = GetSpawnByLocationID(zone, 133785991)
  117. local Speed6 = GetSpawnByLocationID(zone, 133785992)
  118. if Speed1 ~=nil then
  119. MovementLoopAddLocation(Speed1,-20, 0, -10,1)
  120. MovementLoopAddLocation(Speed1,-20, 0, -40,1)
  121. end
  122. if Speed2 ~=nil then
  123. MovementLoopAddLocation(Speed2,-16.667, 0, -10,2)
  124. MovementLoopAddLocation(Speed2,-16.667, 0, -40,2)
  125. end
  126. if Speed4 ~=nil then
  127. MovementLoopAddLocation(Speed4,-13.333, 0, -10,4)
  128. MovementLoopAddLocation(Speed4,-13.333, 0, -40,4)
  129. end
  130. if Speed6 ~=nil then
  131. MovementLoopAddLocation(Speed6,-10, 0, -10,6)
  132. MovementLoopAddLocation(Speed6,-10, 0, -40,6)
  133. end
  134. end
  135. function SpawnType1(NPC,Spawn)
  136. Dialog.New(NPC, Spawn)
  137. Dialog.AddDialog("Controls are limited to 7 Options")
  138. Dialog.AddOption("Small Cat","Cat")
  139. Dialog.AddOption("Normal Goblin","Goblin")
  140. Dialog.AddOption("Large Troglodyte","Ape")
  141. Dialog.AddOption("A Froglok","Frog")
  142. Dialog.AddOption("Shadowy Fiend","Shadow")
  143. Dialog.AddOption("Lucan Dlere","Lucan")
  144. Dialog.AddOption("Magestic Unicorn","Unicorn")
  145. Dialog.AddOption("Reset the Spawns","Reset")
  146. Dialog.AddOption("Nevermind")
  147. Dialog.Start()
  148. end
  149. function Size1(NPC,Spawn)
  150. Dialog.New(NPC, Spawn)
  151. Dialog.AddDialog("Controls are limited to 3 Options")
  152. Dialog.AddOption("Smallest Size (16)","Small")
  153. Dialog.AddOption("Normal Size (32)","Normal")
  154. Dialog.AddOption("Largest Size (50)","Large")
  155. Dialog.AddOption("Reset the Spawns","Reset")
  156. Dialog.AddOption("Nevermind")
  157. Dialog.Start()
  158. end
  159. function Small(NPC,Spawn)
  160. local zone = GetZone(NPC)
  161. local Speed1 = GetSpawnByLocationID(zone, 133785989)
  162. local Speed2 = GetSpawnByLocationID(zone, 133785990)
  163. local Speed4 = GetSpawnByLocationID(zone, 133785991)
  164. local Speed6 = GetSpawnByLocationID(zone, 133785992)
  165. if Speed1 ~=nil then
  166. SpawnSet(Speed1,"size",16)
  167. end
  168. if Speed2 ~=nil then
  169. SpawnSet(Speed2,"size",16)
  170. end
  171. if Speed4 ~=nil then
  172. SpawnSet(Speed4,"size",16)
  173. end
  174. if Speed6 ~=nil then
  175. SpawnSet(Speed6,"size",16)
  176. end
  177. end
  178. function Normal(NPC,Spawn)
  179. local zone = GetZone(NPC)
  180. local Speed1 = GetSpawnByLocationID(zone, 133785989)
  181. local Speed2 = GetSpawnByLocationID(zone, 133785990)
  182. local Speed4 = GetSpawnByLocationID(zone, 133785991)
  183. local Speed6 = GetSpawnByLocationID(zone, 133785992)
  184. if Speed1 ~=nil then
  185. SpawnSet(Speed1,"size",32)
  186. end
  187. if Speed2 ~=nil then
  188. SpawnSet(Speed2,"size",32)
  189. end
  190. if Speed4 ~=nil then
  191. SpawnSet(Speed4,"size",32)
  192. end
  193. if Speed6 ~=nil then
  194. SpawnSet(Speed6,"size",32)
  195. end
  196. end
  197. function Large(NPC,Spawn)
  198. local zone = GetZone(NPC)
  199. local Speed1 = GetSpawnByLocationID(zone, 133785989)
  200. local Speed2 = GetSpawnByLocationID(zone, 133785990)
  201. local Speed4 = GetSpawnByLocationID(zone, 133785991)
  202. local Speed6 = GetSpawnByLocationID(zone, 133785992)
  203. if Speed1 ~=nil then
  204. SpawnSet(Speed1,"size",50)
  205. end
  206. if Speed2 ~=nil then
  207. SpawnSet(Speed2,"size",50)
  208. end
  209. if Speed4 ~=nil then
  210. SpawnSet(Speed4,"size",50)
  211. end
  212. if Speed6 ~=nil then
  213. SpawnSet(Speed6,"size",50)
  214. end
  215. end
  216. function Cat(NPC,Spawn)
  217. local zone = GetZone(NPC)
  218. local Speed1 = GetSpawnByLocationID(zone, 133785989)
  219. local Speed2 = GetSpawnByLocationID(zone, 133785990)
  220. local Speed4 = GetSpawnByLocationID(zone, 133785991)
  221. local Speed6 = GetSpawnByLocationID(zone, 133785992)
  222. if Speed1 ~=nil then
  223. SpawnSet(Speed1,"model_type",305)
  224. end
  225. if Speed2 ~=nil then
  226. SpawnSet(Speed2,"model_type",305)
  227. end
  228. if Speed4 ~=nil then
  229. SpawnSet(Speed4,"model_type",305)
  230. end
  231. if Speed6 ~=nil then
  232. SpawnSet(Speed6,"model_type",305)
  233. end
  234. end
  235. function Goblin(NPC,Spawn)
  236. local zone = GetZone(NPC)
  237. local Speed1 = GetSpawnByLocationID(zone, 133785989)
  238. local Speed2 = GetSpawnByLocationID(zone, 133785990)
  239. local Speed4 = GetSpawnByLocationID(zone, 133785991)
  240. local Speed6 = GetSpawnByLocationID(zone, 133785992)
  241. if Speed1 ~=nil then
  242. SpawnSet(Speed1,"model_type",145)
  243. end
  244. if Speed2 ~=nil then
  245. SpawnSet(Speed2,"model_type",145)
  246. end
  247. if Speed4 ~=nil then
  248. SpawnSet(Speed4,"model_type",145)
  249. end
  250. if Speed6 ~=nil then
  251. SpawnSet(Speed6,"model_type",145)
  252. end
  253. end
  254. function Ape(NPC,Spawn)
  255. local zone = GetZone(NPC)
  256. local Speed1 = GetSpawnByLocationID(zone, 133785989)
  257. local Speed2 = GetSpawnByLocationID(zone, 133785990)
  258. local Speed4 = GetSpawnByLocationID(zone, 133785991)
  259. local Speed6 = GetSpawnByLocationID(zone, 133785992)
  260. if Speed1 ~=nil then
  261. SpawnSet(Speed1,"model_type",151)
  262. end
  263. if Speed2 ~=nil then
  264. SpawnSet(Speed2,"model_type",151)
  265. end
  266. if Speed4 ~=nil then
  267. SpawnSet(Speed4,"model_type",151)
  268. end
  269. if Speed6 ~=nil then
  270. SpawnSet(Speed6,"model_type",151)
  271. end
  272. end
  273. function Frog(NPC,Spawn)
  274. local zone = GetZone(NPC)
  275. local Speed1 = GetSpawnByLocationID(zone, 133785989)
  276. local Speed2 = GetSpawnByLocationID(zone, 133785990)
  277. local Speed4 = GetSpawnByLocationID(zone, 133785991)
  278. local Speed6 = GetSpawnByLocationID(zone, 133785992)
  279. if Speed1 ~=nil then
  280. SpawnSet(Speed1,"model_type",77)
  281. end
  282. if Speed2 ~=nil then
  283. SpawnSet(Speed2,"model_type",77)
  284. end
  285. if Speed4 ~=nil then
  286. SpawnSet(Speed4,"model_type",77)
  287. end
  288. if Speed6 ~=nil then
  289. SpawnSet(Speed6,"model_type",77)
  290. end
  291. end
  292. function Shadow(NPC,Spawn)
  293. local zone = GetZone(NPC)
  294. local Speed1 = GetSpawnByLocationID(zone, 133785989)
  295. local Speed2 = GetSpawnByLocationID(zone, 133785990)
  296. local Speed4 = GetSpawnByLocationID(zone, 133785991)
  297. local Speed6 = GetSpawnByLocationID(zone, 133785992)
  298. if Speed1 ~=nil then
  299. SpawnSet(Speed1,"model_type",240)
  300. end
  301. if Speed2 ~=nil then
  302. SpawnSet(Speed2,"model_type",240)
  303. end
  304. if Speed4 ~=nil then
  305. SpawnSet(Speed4,"model_type",240)
  306. end
  307. if Speed6 ~=nil then
  308. SpawnSet(Speed6,"model_type",240)
  309. end
  310. end
  311. function Lucan(NPC,Spawn)
  312. local zone = GetZone(NPC)
  313. local Speed1 = GetSpawnByLocationID(zone, 133785989)
  314. local Speed2 = GetSpawnByLocationID(zone, 133785990)
  315. local Speed4 = GetSpawnByLocationID(zone, 133785991)
  316. local Speed6 = GetSpawnByLocationID(zone, 133785992)
  317. if Speed1 ~=nil then
  318. SpawnSet(Speed1,"model_type",4112)
  319. end
  320. if Speed2 ~=nil then
  321. SpawnSet(Speed2,"model_type",4112)
  322. end
  323. if Speed4 ~=nil then
  324. SpawnSet(Speed4,"model_type",4112)
  325. end
  326. if Speed6 ~=nil then
  327. SpawnSet(Speed6,"model_type",4112)
  328. end
  329. end
  330. function Unicorn(NPC,Spawn)
  331. local zone = GetZone(NPC)
  332. local Speed1 = GetSpawnByLocationID(zone, 133785989)
  333. local Speed2 = GetSpawnByLocationID(zone, 133785990)
  334. local Speed4 = GetSpawnByLocationID(zone, 133785991)
  335. local Speed6 = GetSpawnByLocationID(zone, 133785992)
  336. if Speed1 ~=nil then
  337. SpawnSet(Speed1,"model_type",268)
  338. end
  339. if Speed2 ~=nil then
  340. SpawnSet(Speed2,"model_type",268)
  341. end
  342. if Speed4 ~=nil then
  343. SpawnSet(Speed4,"model_type",268)
  344. end
  345. if Speed6 ~=nil then
  346. SpawnSet(Speed6,"model_type",268)
  347. end
  348. end
  349. function respawn(NPC)
  350. spawn(NPC)
  351. end