ChefSchmenko.lua 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. --[[
  2. Script Name : SpawnScripts/TempleSt/ChefSchmenko.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.10.24 01:10:41
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. if GetSpawnLocationID(NPC)==420550 then
  10. SpawnSet(NPC,"model_type","65")
  11. SpawnSet(NPC,"show_name","1")
  12. SpawnSet(NPC,"targetable","1")
  13. waypoints(NPC)
  14. SetTempVariable(NPC,"CalloutTimer", "0")
  15. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  16. end
  17. SetInfoStructString(NPC, "action_state", "draw_weapon_trigger")
  18. end
  19. function respawn(NPC)
  20. spawn(NPC)
  21. end
  22. function InRange(NPC,Spawn)
  23. if not IsInCombat(NPC) and GetTempVariable(NPC,"CalloutTimer")~="1" then
  24. RandomGreeting(NPC, Spawn)
  25. SetTempVariable(NPC,"CalloutTimer", "1")
  26. AddTimer(NPC,42000,"CalloutReset",1,Spawn)
  27. end
  28. end
  29. function CalloutReset(NPC,Spawn)
  30. SetTempVariable(NPC,"CalloutTimer", "0")
  31. end
  32. function hailed(NPC, Spawn)
  33. FaceTarget(NPC,Spawn)
  34. AddTimer(NPC,500,"RandomHail", 1,Spawn)
  35. end
  36. function aggro(NPC,Spawn)
  37. FaceTarget(NPC,Spawn)
  38. end
  39. function kill (NPC,Spawn)
  40. PlayFlavor(NPC,"","","1h_sword_attack",0,0)
  41. KillSpawn(Spawn)
  42. AddTimer(NPC,2500,"scoop")
  43. end
  44. function scoop(NPC,Spawn)
  45. PlayFlavor(NPC,"","","gathering_success",0,0)
  46. end
  47. function RandomHail(NPC, Spawn)
  48. local choice = MakeRandomInt(1,5)
  49. if choice == 1 then
  50. PlayFlavor(NPC, "voiceover/english/ratonga_eco_evil_urbanchef/ft/eco/evil/ratonga_eco_evil_urbanchef_guard_gm_1f674b43.mp3", "Oh! I... I'm not causing any trouble here. Don't mind me.", "whome", 3595799697, 1640670967, Spawn, 0)
  51. elseif choice == 2 then
  52. PlayFlavor(NPC, "voiceover/english/ratonga_eco_evil_urbanchef/ft/eco/evil/ratonga_eco_evil_urbanchef_hail_gm_c8ce2416.mp3", "Do you have any small animals you won't mind missing?", "scheme", 2477620923, 2758696689, Spawn, 0)
  53. elseif choice == 3 then
  54. PlayFlavor(NPC, "voiceover/english/ratonga_eco_evil_urbanchef/ft/eco/evil/ratonga_eco_evil_urbanchef_hail_gm_3c9902f6.mp3", "Fresh stew made with the finest ingredients! Come and get it!", "happy", 291667261, 3539823905, Spawn, 0)
  55. elseif choice == 4 then
  56. PlayFlavor(NPC, "voiceover/english/ratonga_eco_evil_urbanchef/ft/eco/evil/ratonga_eco_evil_urbanchef_hail_gm_6498c1fd.mp3", "Try my feline claw soup sometime. You must!", "agree", 1561843829, 2180580092, Spawn, 0)
  57. elseif choice == 5 then
  58. PlayFlavor(NPC, "voiceover/english/ratonga_eco_evil_urbanchef/ft/eco/evil/ratonga_eco_evil_urbanchef_hail_gm_a9f4bc35.mp3", "Don't bother me. I'm collecting fresh ingredients for a special recipe.", "shakefist", 2150316524, 1924252475, Spawn, 0)
  59. end
  60. end
  61. function RandomGreeting(NPC, Spawn)
  62. local choice = MakeRandomInt(1,4)
  63. if choice == 1 then
  64. PlayFlavor(NPC, "voiceover/english/ratonga_eco_evil_urbanchef/ft/eco/evil/ratonga_eco_evil_urbanchef_pig_gm_fdce8620.mp3", "Here little piglet, I have piggy treats...", "", 2158157683, 2098170175, Spawn, 0)
  65. elseif choice == 2 then
  66. PlayFlavor(NPC, "voiceover/english/ratonga_eco_evil_urbanchef/ft/eco/evil/ratonga_eco_evil_urbanchef_cat_gm_9b64702d.mp3", "Here kitty kitty kitty...", "", 550240368, 2229553634, Spawn, 0)
  67. elseif choice == 3 then
  68. PlayFlavor(NPC, "voiceover/english/ratonga_eco_evil_urbanchef/ft/eco/evil/ratonga_eco_evil_urbanchef_chase_gm_9e0faaf4.mp3", "Stop running! It makes your muscles less tender when I cook you.", "", 1878608291, 1886271523, Spawn, 0)
  69. elseif choice == 4 then
  70. PlayFlavor(NPC, "voiceover/english/ratonga_eco_evil_urbanchef/ft/eco/evil/ratonga_eco_evil_urbanchef_chase_gm_874126ec.mp3", "Just hold still, it won't hurt a bit...", "", 573333408, 2721588881, Spawn, 0)
  71. end
  72. end
  73. function Door1(NPC,Spawn)
  74. local door = GetSpawn(NPC, 1360076)
  75. UseWidget(door)
  76. end
  77. function Action(NPC,Spawn)
  78. local Choice = MakeRandomInt(1,5)
  79. if Choice == 1 then
  80. PlayFlavor(NPC,"","","peer",0,0)
  81. elseif Choice == 2 then
  82. PlayFlavor(NPC,"","","sniff",0,0)
  83. elseif Choice == 3 then
  84. PlayFlavor(NPC,"","","grumble",0,0)
  85. elseif Choice == 4 then
  86. PlayFlavor(NPC,"","","tapfoot",0,0)
  87. elseif Choice == 5 then
  88. PlayFlavor(NPC,"","","scheme",0,0)
  89. end
  90. end
  91. function waypoints(NPC)
  92. MovementLoopAddLocation(NPC, 29.21, 2.92, 25.71, 1, 1)
  93. MovementLoopAddLocation(NPC, 29.21, 2.92, 25.71, 1, 11,"Action")
  94. MovementLoopAddLocation(NPC, 27.33, 2.92, 33.05, 1, 0)
  95. MovementLoopAddLocation(NPC, 32.86, 2.98, 46.38, 1, 0)
  96. MovementLoopAddLocation(NPC, 35.7, 3, 51.58, 1, 0)
  97. MovementLoopAddLocation(NPC, 35.7, 3, 51.58, 1, 3)
  98. MovementLoopAddLocation(NPC, 43.65, 3, 46.57, 1, 0)
  99. MovementLoopAddLocation(NPC, 45.11, 3, 45.75, 1, 1)
  100. MovementLoopAddLocation(NPC, 45.11, 3, 45.75, 1, 11,"Action")
  101. MovementLoopAddLocation(NPC, 30.49, 3, 54.97, 1, 0)
  102. MovementLoopAddLocation(NPC, 33.68, 3, 63.8, 1, 0)
  103. MovementLoopAddLocation(NPC, 35.45, 3, 69.71, 1, 0)
  104. MovementLoopAddLocation(NPC, 37.3, 3, 73.3, 1, 1)
  105. MovementLoopAddLocation(NPC, 37.3, 3, 73.3, 1, 11,"Action")
  106. MovementLoopAddLocation(NPC, 34.01, 3, 66.86, 1, 8)
  107. MovementLoopAddLocation(NPC, 26.77, 3, 69.14, 1, 0)
  108. MovementLoopAddLocation(NPC, 19.62, 3.02, 71.79, 1, 0)
  109. MovementLoopAddLocation(NPC, 11.77, 3, 70.42, 1, 0)
  110. MovementLoopAddLocation(NPC, 2.56, 3, 67.84, 1, 0)
  111. MovementLoopAddLocation(NPC, -7.08, 3, 57.4, 1, 1)
  112. MovementLoopAddLocation(NPC, -7.08, 3, 57.4, 1, 11,"Action")
  113. MovementLoopAddLocation(NPC, -7.56, 3, 57.9, 1, 0)
  114. MovementLoopAddLocation(NPC, -6.65, 3, 58.56, 1, 0)
  115. MovementLoopAddLocation(NPC, -4.28, 3, 59.43, 1, 0)
  116. MovementLoopAddLocation(NPC, 3.73, 3, 70.57, 1, 0)
  117. MovementLoopAddLocation(NPC, -2.06, 3, 75.23, 1, 0)
  118. MovementLoopAddLocation(NPC, -10.82, 3, 78.88, 1, 0)
  119. MovementLoopAddLocation(NPC, -15.5, 3, 80.1, 2, 1,"Door1")
  120. MovementLoopAddLocation(NPC, -18.05, 3.03, 74.58, 2, 12,"Door1")
  121. MovementLoopAddLocation(NPC, -19.93, 3.11, 74.09, 2, 1)
  122. MovementLoopAddLocation(NPC, -19.93, 3.11, 74.09, 2, 34,"Action")
  123. MovementLoopAddLocation(NPC, -18.57, 3.03, 75.75, 2, 2,"Door1")
  124. MovementLoopAddLocation(NPC, -16.09, 3, 79.41, 2, 0,"Door1")
  125. MovementLoopAddLocation(NPC, 4.62, 3, 69.9, 2, 0)
  126. MovementLoopAddLocation(NPC, 9.21, 3, 68, 1, 0)
  127. MovementLoopAddLocation(NPC, 21.62, 2.98, 81.64, 1, 0)
  128. MovementLoopAddLocation(NPC, 24.06, 3, 80.72, 1, 1)
  129. MovementLoopAddLocation(NPC, 24.06, 3, 80.72, 1, 11,"Action")
  130. MovementLoopAddLocation(NPC, 23.03, 2.99, 67.83, 1, 0)
  131. MovementLoopAddLocation(NPC, 29.6, 3, 58.16, 1, 0)
  132. MovementLoopAddLocation(NPC, 33.84, 3, 52.08, 1, 0)
  133. MovementLoopAddLocation(NPC, 24.6, 2.92, 37.78, 1, 0)
  134. MovementLoopAddLocation(NPC, 14.59, 2.92, 35.85, 1, 1)
  135. MovementLoopAddLocation(NPC, 14.59, 2.92, 35.85, 1, 11,"Action")
  136. MovementLoopAddLocation(NPC, 23.07, 2.92, 36.48, 2, 0)
  137. MovementLoopAddLocation(NPC, 32.33, 2.92, 21.28, 1, 1)
  138. MovementLoopAddLocation(NPC, 32.33, 2.92, 21.28, 1, 7)
  139. MovementLoopAddLocation(NPC, 27.6, 2.92, 31.8, 1, 0) --Chase
  140. MovementLoopAddLocation(NPC, 28.3, 2.92, 36.05, 1, 0)
  141. MovementLoopAddLocation(NPC, 34.46, 3, 48.5, 1, 0)
  142. MovementLoopAddLocation(NPC, 36.12, 3, 50.28, 1, 0)
  143. MovementLoopAddLocation(NPC, 41.7, 3, 49.41, 1, 0)
  144. MovementLoopAddLocation(NPC, 43.56, 3, 49.41, 1, 0)
  145. MovementLoopAddLocation(NPC, 49.16, 3, 58.47, 2, 0)
  146. MovementLoopAddLocation(NPC, 54.6, 3, 66.57, 2, 0,"Model")
  147. MovementLoopAddLocation(NPC, 54.6, 3, 66.57, 2, 0,"Spawn")
  148. MovementLoopAddLocation(NPC, 54.6, 3, 66.57, 1, 5,"Despawning")
  149. end
  150. function Spawn(NPC)
  151. local zone = GetZone(NPC)
  152. local Runner = GetSpawnByLocationID(zone, 133787203)
  153. if Runner == nil then
  154. SpawnByLocationID(zone,133787203)
  155. end
  156. end
  157. function Model(NPC)
  158. SpawnSet(NPC,"model_type","2306")
  159. SpawnSet(NPC,"show_name","0")
  160. SpawnSet(NPC,"targetable","0")
  161. SpawnSet(NPC, "show_command_icon", "0")
  162. end
  163. function Despawning(NPC)
  164. Despawn(NPC)
  165. end