AngusFallowfur.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. --[[
  2. Script Name : SpawnScripts/Graystone/AngusFallowfur.lua
  3. Script Purpose : Angus Fallowfur
  4. Script Author : Scatman
  5. Script Date : 2009.09.27
  6. Script Notes :
  7. --]]
  8. -- Quest ID's
  9. local A_TIME_FOR_FIGHTING = 289
  10. function hailed(NPC, Spawn)
  11. FaceTarget(NPC, Spawn)
  12. RandomVoice(NPC, Spawn)
  13. if HasCompletedQuest(Spawn, A_TIME_FOR_FIGHTING) then
  14. Say(NPC, "Just keep walking.", Spawn)
  15. elseif HasQuest(Spawn, A_TIME_FOR_FIGHTING) then
  16. LittleBusyWithQuest(NPC, Spawn)
  17. else
  18. Say(NPC, "I'm a little busy right now, sorry.")
  19. end
  20. end
  21. function healthchanged(NPC, Spawn)
  22. local hp_percent = GetHP(NPC) / GetMaxHP(NPC)
  23. if hp_percent <= 0.25 then
  24. SpawnSet(NPC, "attackable", 0)
  25. SpawnSet(NPC, "show_level", 0)
  26. AddTimer(NPC, 500, "StopAttacking", 1, Spawn)
  27. end
  28. end
  29. function StopAttacking(NPC, Spawn)
  30. Say(NPC, "This is over.", Spawn)
  31. ClearHate(NPC)
  32. ClearEncounter(NPC)
  33. end
  34. function RandomVoice(NPC, Spawn)
  35. local choice = math.random(1, 3)
  36. if choice == 1 then
  37. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1002.mp3", "", "", 0, 0, Spawn)
  38. elseif choice == 2 then
  39. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1002.mp3", "", "", 0, 0, Spawn)
  40. else
  41. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1002.mp3", "", "", 0, 0, Spawn)
  42. end
  43. end
  44. ---------------------------------------------------------------------------------------------------
  45. -- QUEST 1
  46. ---------------------------------------------------------------------------------------------------
  47. function LittleBusyWithQuest(NPC, Spawn)
  48. FaceTarget(NPC, Spawn)
  49. conversation = CreateConversation()
  50. if not QuestStepIsComplete(Spawn, A_TIME_FOR_FIGHTING, 2) then
  51. AddConversationOption(conversation, "Oh, wow. I saw a shining light up here and thought someone had installed a lighthouse, guess it was just your forehead.", "dlg_8_1")
  52. AddConversationOption(conversation, "A little busy doing what? Standing here like a lamppost?", "dlg_5_1")
  53. AddConversationOption(conversation, "Only a little busy?", "dlg_6_1")
  54. AddConversationOption(conversation, "Why be sorry? It saved me what would probably be a boring conversation.", "dlg_7_1")
  55. StartConversation(conversation, NPC, Spawn, "I'm a little busy right now, sorry.")
  56. else
  57. Say(NPC, "Just keep walking.", Spawn)
  58. end
  59. end
  60. function dlg_5_1(NPC, Spawn)
  61. FaceTarget(NPC, Spawn)
  62. conversation = CreateConversation()
  63. AddConversationOption(conversation, "I see.")
  64. StartConversation(conversation, NPC, Spawn, "I'm contemplating, if you must know.")
  65. end
  66. function dlg_6_1(NPC, Spawn)
  67. FaceTarget(NPC, Spawn)
  68. conversation = CreateConversation()
  69. AddConversationOption(conversation, "Indeed.")
  70. StartConversation(conversation, NPC, Spawn, "Busy enough to want you to leave.")
  71. end
  72. function dlg_7_1(NPC, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. conversation = CreateConversation()
  75. AddConversationOption(conversation, "That makes two of us.")
  76. StartConversation(conversation, NPC, Spawn, "And me as well.")
  77. end
  78. function dlg_8_1(NPC, Spawn)
  79. FaceTarget(NPC, Spawn)
  80. conversation = CreateConversation()
  81. AddConversationOption(conversation, "Shiny!", "dlg_8_2")
  82. AddConversationOption(conversation, "Glossy!", "dlg_8_2")
  83. AddConversationOption(conversation, "Reflective!", "dlg_8_2")
  84. AddConversationOption(conversation, "B-A-L-D.", "dlg_8_2")
  85. AddConversationOption(conversation, "Sorry, no. I'll be going now.")
  86. StartConversation(conversation, NPC, Spawn, "Did I hear that correctly?")
  87. end
  88. function dlg_8_2(NPC, Spawn)
  89. SetStepComplete(Spawn, A_TIME_FOR_FIGHTING, 2)
  90. FaceTarget(NPC, Spawn)
  91. conversation = CreateConversation()
  92. SpawnSet(NPC, "attackable", 1)
  93. SpawnSet(NPC, "show_level", 1)
  94. AddHate(Spawn, NPC, 1)
  95. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/angus_fallowfur/qey_village03/quest_angus_fallowfur_fightover_6c8d9e55.mp3", "This is over.", "", 577369163, 1894242120, Spawn)
  96. AddConversationOption(conversation, "We'll see!")
  97. StartConversation(conversation, NPC, Spawn, "You're going down!")
  98. end