9
3

widgetpigbody.lua 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --[[
  2. Script Name : SpawnScripts/Edgewater/widgetpigbody.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.05 06:07:41
  5. Script Purpose :
  6. :
  7. --]]
  8. local DangerousWaters = 5289
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  11. end
  12. function InRange(NPC, Spawn)
  13. if not HasQuest(Spawn, DangerousWaters) and not HasCompletedQuest(Spawn, DangerousWaters) then
  14. AddPrimaryEntityCommand(Spawn, NPC, "examine corpse", 5, "examine corpse", "", 100)
  15. SpawnSet(NPC, "show_command_icon", 1)
  16. SpawnSet(NPC, "display_hand_icon", 1)
  17. end
  18. end
  19. function casted_on(NPC, Spawn, SpellName)
  20. if SpellName == 'examine corpse' then
  21. conversation = CreateConversation()
  22. AddConversationOption(conversation, "Look closer", "offer")
  23. AddConversationOption(conversation, "Ignore it")
  24. StartDialogConversation(conversation, 1, NPC, Spawn, "You find a ravaged carcass of some poor animal in the bottom of the sewer.")
  25. SetAccessToEntityCommand(Spawn,NPC,"examine corpse", 0)
  26. SpawnSet(NPC, "show_command_icon", 0)
  27. SpawnSet(NPC, "display_hand_icon", 0)
  28. AddTimer(NPC, 10000, "check", 1, Spawn)
  29. end
  30. end
  31. function offer(NPC, Spawn)
  32. OfferQuest(NPC, Spawn, DangerousWaters)
  33. conversation = CreateConversation()
  34. AddConversationOption(conversation, "I will hunt them down.")
  35. StartDialogConversation(conversation, 1, NPC, Spawn, "Looking closer you can see a myriad of bite marks and gouges where needleteeth took their fill of its flesh. With the Edgewater Drains being so open to the sea, it's no wonder that such dangerous creatures lurk around in its depths. I should rid the sewer of the massive needleteeth.")
  36. end
  37. function check(NPC, Spawn)
  38. if not HasQuest(Spawn, DangerousWaters) and not HasCompletedQuest(Spawn, DangerousWaters) then
  39. SpawnSet(NPC, "show_command_icon", 1)
  40. SpawnSet(NPC, "display_hand_icon", 1)
  41. SetAccessToEntityCommand(Spawn,NPC,"examine corpse", 1)
  42. end
  43. end
  44. function respawn(NPC)
  45. spawn(NPC)
  46. end