9
3

Mnemir.lua 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/Mnemir.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.03.14 07:03:15
  5. Script Purpose :
  6. :
  7. --]]
  8. local QUEST = 406 -- Filling the Coffers
  9. function spawn(NPC)
  10. SetTempVariable(NPC, "Hailed", "false")
  11. end
  12. function hailed(NPC, Spawn)
  13. if GetQuestStep(Spawn, QUEST) == 3 and GetTempVariable(NPC, "Hailed") == "false" then
  14. FaceTarget(NPC, Spawn)
  15. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1032.mp3", "", "", 0, 0, Spawn)
  16. conversation = CreateConversation()
  17. AddConversationOption(conversation, "Your taxes weren't all in your mailbox, you still owe more.", "Option1")
  18. StartConversation(conversation, NPC, Spawn, "What yous want?")
  19. elseif GetTempVariable(NPC, "Hailed") == "true" and GetQuestStep(Spawn, QUEST) == 3 then
  20. Option2(NPC, Spawn)
  21. elseif GetQuestStep(Spawn, QUEST) >= 4 then
  22. local choice = MakeRandomInt(1,3)
  23. if choice == 1 then
  24. PlayFlavor(NPC, "", "..ugh!", "", 0, 0, Spawn)
  25. elseif choice == 2 then
  26. PlayFlavor(NPC, "", "...", "", 0, 0, Spawn)
  27. else
  28. PlayFlavor(NPC, "", "...nng...", "", 0, 0, Spawn)
  29. end
  30. end
  31. end
  32. function Option1(NPC, Spawn)
  33. FaceTarget(NPC, Spawn)
  34. SetTempVariable(NPC, "Hailed", "true")
  35. if GetTempVariable(NPC, "Hailed") == "true" then
  36. AddPrimaryEntityCommand(Spawn, NPC, "Punch", 2)
  37. AddPrimaryEntityCommand(Spawn, NPC, "Footkick", 2)
  38. end
  39. conversation = CreateConversation()
  40. AddConversationOption(conversation, "Don't play dumb, Mnemir. Just give up the money you owe before I force it out of you.", "Option2")
  41. StartConversation(conversation, NPC, Spawn, "What?! That's a lie!")
  42. end
  43. function Option2(NPC, Spawn)
  44. FaceTarget(NPC, Spawn)
  45. PlayAnimation(NPC, 29558)
  46. conversation = CreateConversation()
  47. AddConversationOption(conversation, "We'll see about that...")
  48. StartConversation(conversation, NPC, Spawn, "I won't! I don't have it! I won't give you anything! You can't make me do anything!")
  49. end
  50. function casted_on(NPC, Spawn, SpellName)
  51. local result = MakeRandomInt(1, 3)
  52. if SpellName == 'Footkick' then
  53. if result == 1 then
  54. PlayAnimation(Spawn, 11761)
  55. PlayAnimation(NPC, 11911)
  56. elseif result == 2 then
  57. PlayAnimation(Spawn, 11761)
  58. PlayAnimation(NPC, 11911)
  59. else
  60. if GetQuestStep(Spawn, QUEST) == 3 then
  61. SetStepComplete(Spawn, QUEST, 3)
  62. end
  63. PlayAnimation(Spawn, 11761)
  64. PlayAnimation(NPC, 11767)
  65. AddTimer(NPC, 1300, "wasted")
  66. end
  67. elseif SpellName == 'Punch' then
  68. if result == 1 then
  69. PlayAnimation(Spawn, 10783)
  70. PlayAnimation(NPC, 11911)
  71. elseif result == 2 then
  72. PlayAnimation(Spawn, 10783)
  73. PlayAnimation(NPC, 11911)
  74. else
  75. if GetQuestStep(Spawn, QUEST) == 3 then
  76. SetStepComplete(Spawn, QUEST, 3)
  77. end
  78. PlayAnimation(Spawn, 10783)
  79. PlayAnimation(NPC, 11767)
  80. AddTimer(NPC, 1300, "wasted")
  81. end
  82. end
  83. end
  84. function wasted(NPC, Spawn)
  85. SpawnSet(NPC, "visual_state", "228")
  86. RemovePrimaryEntityCommand(NPC, "Punch")
  87. RemovePrimaryEntityCommand(NPC, "Footkick")
  88. AddTimer(NPC, 300000, "returned")
  89. end
  90. function returned(NPC, Spawn)
  91. SpawnSet(NPC, "visual_state", "0")
  92. SetTempVariable(NPC, "Hailed", "false")
  93. end
  94. function respawn(NPC)
  95. spawn(NPC)
  96. end