p49beddiarysearch.lua 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --[[
  2. Script Name : SpawnScripts/Nektropos1/p49_bed_diary_search.lua
  3. Script Author : smash
  4. Script Date : 2016.09.08 04:02:12
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. end
  10. function casted_on(NPC, Spawn, Message)
  11. if GetTempVariable(NPC, "NythsSpawned") ~= "true" then
  12. SetTempVariable(NPC, "NythsSpawned", "true")
  13. --Spawn the Nyths
  14. SpawnGroupByID(GetZone(NPC), 1043630)
  15. end
  16. ReadBook1(NPC, Spawn)
  17. end
  18. function ReadBook1(NPC, Spawn)
  19. local conversation = CreateConversation()
  20. AddConversationOption(conversation, "Examine the book.", "ReadBook2")
  21. AddConversationOption(conversation, "Leave it alone.", "CloseConversation")
  22. StartDialogConversation(conversation, 1, NPC, Spawn, "You find a book hidden under one of the pillows.")
  23. end
  24. function ReadBook2(NPC, Spawn)
  25. local conversation = CreateConversation()
  26. AddConversationOption(conversation, "Read it.", "ReadBook3")
  27. AddConversationOption(conversation, "Put it back under the pillow.", "CloseConversation")
  28. StartDialogConversation(conversation, 1, NPC, Spawn, "It appears to be the diary of a young girl named Crysta.")
  29. end
  30. function ReadBook3(NPC, Spawn)
  31. local conversation = CreateConversation()
  32. AddConversationOption(conversation, "Put the book back under the pillow.", "CloseConversation")
  33. StartDialogConversation(conversation, 1, NPC, Spawn, "Most of the book talks about her daily life and how she would spend countless hours with her sister Melanie. Apparently the girls would spend all day playing in Melanies room.")
  34. --SpawnSet(NPC, "show_command_icon", "0")
  35. --SpawnSet(NPC, "display_hand_icon", "0")
  36. if GetTempVariable(NPC, "CrystaSpawned") ~= "true" then
  37. --Spawn Crysta and Melanie
  38. SpawnGroupByID(GetZone(NPC), 43674)
  39. SetTempVariable(NPC, "CrystaSpawned", "true")
  40. end
  41. end