NektroposMountedSwineshead.lua 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. --[[
  2. Script Name : SpawnScripts/Nektropos1/NektroposMountedSwineshead.lua
  3. Script Purpose :
  4. Script Author : smash
  5. Script Date : 1/26/2016
  6. Script Notes :
  7. --]]
  8. function spawn(NPC)
  9. end
  10. function respawn(NPC)
  11. spawn(NPC)
  12. end
  13. function casted_on(NPC, Spawn, Message)
  14. if Message == "inspect" then
  15. Dialog1(NPC, Spawn)
  16. end
  17. end
  18. function Dialog1(NPC, Spawn)
  19. local conversation = CreateConversation()
  20. local fun_name
  21. if CanReceiveQuest(Spawn, 175) then
  22. fun_name = "Dialog1_1"
  23. elseif HasQuest(Spawn, 176) then
  24. fun_name = "Dialog1_3"
  25. end
  26. if not HasCompletedQuest(Spawn, 176) then
  27. AddConversationOption(conversation, "Inspect the eyes.", fun_name)
  28. end
  29. AddConversationOption(conversation, "Stop examining the head.", "CloseConversation")
  30. StartDialogConversation(conversation, 1, NPC, Spawn, "This is a mounted boar's head. It appears decayed and smells horrid. It looks as though a taxidermist never preserved it. There is something odd about the eyes.")
  31. end
  32. function Dialog1_1(NPC, Spawn)
  33. local conversation = CreateConversation()
  34. AddConversationOption(conversation, "Take the black eye.", "OfferTheBoarsHead")
  35. AddConversationOption(conversation, "Stop examining the head.", "CloseConversation")
  36. StartDialogConversation(conversation, 1, NPC, Spawn, "The eyes appear to be made of glass, like marbles. One is red and one is black. The black one looks loose.")
  37. end
  38. function Dialog1_3(NPC, Spawn)
  39. local conversation = CreateConversation()
  40. if HasQuest(Spawn, 176) then
  41. AddConversationOption(conversation, "Place the red eye in the hollow socket.", "Dialog2")
  42. end
  43. AddConversationOption(conversation, "Stop examining the head.", "CloseConversation")
  44. StartDialogConversation(conversation, 1, NPC, Spawn, "There is only one red eye. The eye appears to be made of glass, like a marble. The second eye socket is hollow.")
  45. end
  46. function Dialog2(NPC, Spawn)
  47. local conversation = CreateConversation()
  48. AddConversationOption(conversation, "Stop examining the head.", "CloseConversation")
  49. StartDialogConversation(conversation, 1, "You place the red marble-like eye in the hollow socket. A key falls from the mouth of the boar. You now have the Library's Key! You also hear a rumbling coming from down the hall.")
  50. SetStepComplete(Spawn, 176, 1)
  51. --We only want to spawn the swine fiend if there is not one currently spawned so groups don't get swarmed
  52. if GetSpawnByLocationID(GetZone(NPC), 1584471) == nil then
  53. SpawnByLocationID(GetZone(NPC), 1584471)
  54. end
  55. end
  56. function OfferTheBoarsHead(NPC, Spawn)
  57. OfferQuest(NPC, Spawn, 175)
  58. end