widgetdeadstatue.lua 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --[[
  2. Script Name : SpawnScripts/CryptBetrayal/widgetdeadstatue.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.11.01 08:11:07
  5. Script Purpose :
  6. :
  7. --]]
  8. local StrengthOfTheIreMinions = 5390
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 5, "InRange", Spawn)
  11. end
  12. function InRange(NPC, Spawn)
  13. if not HasQuest(Spawn, StrengthOfTheIreMinions) and not HasCompletedQuest(Spawn, StrengthOfTheIreMinions) then
  14. SpawnSet(NPC, "show_command_icon", 1)
  15. SpawnSet(NPC, "display_hand_icon", 1)
  16. end
  17. end
  18. function casted_on(NPC, Spawn, SpellName)
  19. if SpellName == 'examine statue' then
  20. conversation = CreateConversation()
  21. AddConversationOption(conversation, "Touch statue.", "offer")
  22. AddConversationOption(conversation, "Leave it alone.")
  23. StartDialogConversation(conversation, 1, NPC, Spawn, "This statue radiates an ominous force. You feel compelled to touch it.")
  24. SetAccessToEntityCommand(Spawn,NPC,"examine statue", 0)
  25. SpawnSet(NPC, "show_command_icon", 0)
  26. SpawnSet(NPC, "display_hand_icon", 0)
  27. AddTimer(NPC, 10000, "check", 1, Spawn)
  28. end
  29. end
  30. function check(NPC, Spawn)
  31. if not HasQuest(Spawn, StrengthOfTheIreMinions) and not HasCompletedQuest(Spawn, StrengthOfTheIreMinions) then
  32. SpawnSet(NPC, "show_command_icon", 1)
  33. SpawnSet(NPC, "display_hand_icon", 1)
  34. SetAccessToEntityCommand(Spawn,NPC,"examine statue", 1)
  35. end
  36. end
  37. function offer(NPC, Spawn)
  38. OfferQuest(NPC, Spawn, StrengthOfTheIreMinions)
  39. conversation = CreateConversation()
  40. AddConversationOption(conversation, "Fight the ire minions.")
  41. AddConversationOption(conversation, "exit")
  42. StartDialogConversation(conversation, 1, NPC, Spawn, "As you touch the statue your mind is filled with a voice that says, \"Destroy the ire minions and use their hate to strengthen your knowledge of battle.\"")
  43. end
  44. function respawn(NPC)
  45. spawn(NPC)
  46. end