BreenoMesspieTest.lua 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. --[[
  2. Script Name : SpawnScripts/qeynos_combined02/BreenoMesspieTest.lua
  3. Script Author : Rylec
  4. Script Date : 2021.10.03 10:10:51
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SpawnSet(NPC, "visual_state", "2120")
  10. SpawnSet(NPC, "action_state", "11420")
  11. SpawnSet(NPC, "mood_state", 11852)
  12. SetLuaBrain(NPC)
  13. SetBrainTick(NPC, 500)
  14. Think(NPC, Spawn)
  15. SetPlayerProximityFunction(NPC, 20, "InRange")
  16. end
  17. function hailed(NPC, Spawn)
  18. SpawnSet(NPC, "visual_state", 0)
  19. local choice = MakeRandomInt(1,8)
  20. if choice == 1 then
  21. PlayFlavor(NPC, "voiceover/english/halfling_eco_good_1/ft/halfling/halfling_eco_good_1_hail_gm_d79063bf.mp3", "Ahhhhh, that's what I love about Qeynos. So many bakeries and so many pies!", "scheme", 894976267, 1675938925, Spawn)
  22. elseif choice == 2 then
  23. PlayFlavor(NPC, "voiceover/english/halfling_eco_good_1/ft/halfling/halfling_eco_good_1_hail_gm_103d60c5.mp3", "Well, looks like it's getting close to naptime again.", "yawn", 121409065, 1108008452, Spawn)
  24. elseif choice == 3 then
  25. PlayFlavor(NPC, "voiceover/english/halfling_eco_good_1/ft/halfling/halfling_eco_good_1_hail_gm_75c0e97c.mp3", "Welcome to the city, adventurer. Be mindful of the peace and quiet. Here in Qeynos, we value our privacy.", "bow", 1955296899, 2249687997, Spawn)
  26. elseif choice == 4 then
  27. PlayFlavor(NPC, "voiceover/english/halfling_eco_good_1/ft/halfling/halfling_eco_good_1_hail_gm_7d33c817.mp3", "Nice weather we're having. Should make for a good harvest this season, if it holds up.", "nod", 3022454580, 2853198849, Spawn)
  28. elseif choice == 5 then
  29. PlayFlavor(NPC, "voiceover/english/halfling_eco_good_1/ft/halfling/halfling_eco_good_1_hail_gm_7f5ac93.mp3", "I just need enough to tide me over until I need more.", "agree", 1669752330, 425539219, Spawn)
  30. elseif choice == 6 then
  31. PlayFlavor(NPC, "voiceover/english/halfling_eco_good_1/ft/halfling/halfling_eco_good_1_hail_gm_f657192c.mp3", "Nostalgia isn't what it used to be.", "sigh", 2017572665, 1813639796, Spawn)
  32. elseif choice == 7 then
  33. PlayFlavor(NPC, "voiceover/english/halfling_eco_good_1/ft/halfling/halfling_eco_good_1_hail_gm_cf902b40.mp3", "Get on now! There's plenty of work to be done. Maybe you should lend a hand, if you feel up to it.", "stare", 1396062221, 310311489, Spawn)
  34. elseif choice == 8 then
  35. PlayFlavor(NPC, "voiceover/english/halfling_eco_good_1/ft/halfling/halfling_eco_good_1_hail_gm_50622dfa.mp3", "Whoa, hello there! Eager and in a hurry I see. My advice, take your time. The city isn't going anywhere.", "wave", 2627404831, 2664895493, Spawn)
  36. end
  37. --AddTimer(NPC, 40000, "ResetState", 1, Spawn)
  38. end
  39. function InRange(NPC, Spawn)
  40. -- These lines will be triggered if you on Live log in next to Breeno, but are not included when you hail him. I put them in as a proximity function just to safe keep them.
  41. -- FaceTarget(NPC, Spawn)
  42. local proximityChoice = MakeRandomInt(1,3)
  43. if proximityChoice == 1 then
  44. PlayFlavor(NPC, "voiceover/english/halfling_eco_good_1/ft/halfling/halfling_eco_good_1_aoi_gm_fea5fead.mp3", "The world is round. It's round I say, as well it should be!", "curse", 4205711950, 2062936277, Spawn)
  45. elseif proximityChoice == 2 then
  46. PlayFlavor(NPC, "voiceover/english/halfling_eco_good_1/ft/halfling/halfling_eco_good_1_aoi_gm_89ed3363.mp3", "Wonderful, more troublesome adventurers in the city.", "sarcasm", 3296911201, 4000062691, Spawn)
  47. else
  48. PlayFlavor(NPC, "voiceover/english/halfling_eco_good_1/ft/halfling/halfling_eco_good_1_hail_gm_cd9164d6.mp3", "You're a stranger. And I don't like strangers, no sir I don't!", "sulk", 785726454, 3155500140, Spawn)
  49. end
  50. end
  51. function respawn(NPC)
  52. spawn(NPC)
  53. end
  54. function Think(NPC, Spawn)
  55. local mostHated = GetMostHated(NPC)
  56. if mostHated ~= nil then
  57. aggro(NPC, mostHated)
  58. end
  59. end
  60. function aggro(NPC, Spawn)
  61. local timebetweenShots = MakeRandomInt(8000,12000)
  62. if GetTempVariable(NPC, "CASTING") ~= "True" then
  63. SetTempVariable(NPC, "CASTING", "True")
  64. SpawnSet(NPC, "visual_state", 0)
  65. CastSpell(Spawn, 993, 1 , NPC)
  66. AddTimer(NPC, timebetweenShots, "FinishedCasting") -- PLAY WITH TIME HERE
  67. end
  68. end
  69. -- Timer callback to allow casting again
  70. function FinishedCasting(NPC)
  71. SetTempVariable(NPC, "CASTING", "False")
  72. AddTimer(NPC, 1550, "ResetState")
  73. end
  74. function ResetState(NPC)
  75. SpawnSet(NPC, "visual_state", 2120)
  76. end