9
3

widgetsmallmachine.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. --[[
  2. Script Name : SpawnScripts/Edgewater/widgetsmallmachine.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.05 05:07:35
  5. Script Purpose :
  6. :
  7. --]]
  8. local TheMucusFeedingMachine = 5288
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  11. end
  12. function hailed(NPC, Spawn)
  13. FaceTarget(NPC, Spawn)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function InRange(NPC, Spawn)
  19. if not HasQuest(Spawn, TheMucusFeedingMachine) and not HasCompletedQuest(Spawn, TheMucusFeedingMachine) then
  20. AddPrimaryEntityCommand(Spawn, NPC, "examine machine", 5, "examine machine", "", 100)
  21. SpawnSet(NPC, "show_command_icon", 1)
  22. SpawnSet(NPC, "display_hand_icon", 1)
  23. end
  24. end
  25. function casted_on(NPC, Spawn, SpellName)
  26. if SpellName == 'examine machine' then
  27. conversation = CreateConversation()
  28. AddConversationOption(conversation, "Read plate", "offer")
  29. AddConversationOption(conversation, "Leave it alone")
  30. StartDialogConversation(conversation, 1, NPC, Spawn, "You find a small machine with a brass plate attached to the front.")
  31. SetAccessToEntityCommand(Spawn,NPC,"examine machine", 0)
  32. SpawnSet(NPC, "show_command_icon", 0)
  33. SpawnSet(NPC, "display_hand_icon", 0)
  34. AddTimer(NPC, 10000, "check", 1, Spawn)
  35. end
  36. end
  37. function offer(NPC, Spawn)
  38. OfferQuest(NPC, Spawn, TheMucusFeedingMachine)
  39. conversation = CreateConversation()
  40. AddConversationOption(conversation, "I should destroy them")
  41. StartDialogConversation(conversation, 1, NPC, Spawn, "The brass plate reads: \"Drudge Mucus Auto-Feeder.\" Who in the world would want to feed those things, let alone let them exist at all!?")
  42. end
  43. function check(NPC, Spawn)
  44. if not HasQuest(Spawn, TheMucusFeedingMachine) and not HasCompletedQuest(Spawn, TheMucusFeedingMachine) then
  45. SpawnSet(NPC, "show_command_icon", 1)
  46. SpawnSet(NPC, "display_hand_icon", 1)
  47. SetAccessToEntityCommand(Spawn,NPC,"examine machine", 1)
  48. end
  49. end