humanskeletonbones.lua 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. --[[
  2. Script Name : SpawnScripts/SerpentSewer/humanskeletonbones.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.01 08:07:26
  5. Script Purpose :
  6. :
  7. --]]
  8. local CrazyTalkingSkull = 5270
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  11. end
  12. function InRange(NPC, Spawn)
  13. if not HasQuest(Spawn, CrazyTalkingSkull) and not HasCompletedQuest(Spawn, CrazyTalkingSkull) or HasQuest(Spawn, CrazyTalkingSkull) and GetQuestStep(Spawn, CrazyTalkingSkull) == 2 then
  14. AddPrimaryEntityCommand(Spawn, NPC, "hail", 5, "hail", "", 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 == 'hail' then
  21. if not HasQuest(Spawn, CrazyTalkingSkull) then
  22. OfferQuest(NPC, Spawn, CrazyTalkingSkull)
  23. conversation = CreateConversation()
  24. AddConversationOption(conversation, "How is it that a skull can speak?", "dlg1")
  25. StartDialogConversation(conversation, 1, NPC, Spawn, "Oh my! How rude of me! Allow me to introduce myself, or at least what little is left. I am Gord, or rather, was, Gord Smith. Like I said, these sewers aren't safe.")
  26. elseif GetQuestStep(Spawn, CrazyTalkingSkull) == 2 then
  27. SetStepComplete(Spawn, CrazyTalkingSkull, 2)
  28. conversation = CreateConversation()
  29. AddConversationOption(conversation, "WHAT!?", "attack_spawn")
  30. StartDialogConversation(conversation, 1, NPC, Spawn, "How wonderful! You've returned with my body! Wait, what's this? I said be careful, you half wit! I guess I have to kill you now.")
  31. PlayFlavor(NPC, "voiceover/english/talking_skull/fprt_sewer02/quests/talking_skull/talking_skull_005.mp3", "", "", 1373178593, 1244187654, Spawn)
  32. end
  33. SetAccessToEntityCommand(Spawn,NPC,"hail", 0)
  34. SpawnSet(NPC, "show_command_icon", 0)
  35. SpawnSet(NPC, "display_hand_icon", 0)
  36. AddTimer(NPC, 10000, "check", 1, Spawn)
  37. end
  38. end
  39. function dlg1(NPC, Spawn)
  40. conversation = CreateConversation()
  41. AddConversationOption(conversation, "I'll see what I can do.", "dlg2")
  42. StartDialogConversation(conversation, 1, NPC, Spawn, "Well that is a mystery. I imagine it has something to do with my untimely demise. I speculate that, perhaps, if I were reunited with my bodily remains then I may be able to rest in peace. What say you, traveler? Will you help me recover my remains?")
  43. end
  44. function dlg2(NPC, Spawn)
  45. conversation = CreateConversation()
  46. AddConversationOption(conversation, "Right.")
  47. StartDialogConversation(conversation, 1, NPC, Spawn, "Can I help you with something? Are you lost? Perhaps you could get lost somewhere closer to my bodily remains? Yes I think that would be beneficial for me. Oh, and do be careful with my bones when you find them.")
  48. end
  49. function check(NPC, Spawn)
  50. if not HasQuest(Spawn, CrazyTalkingSkull) and not HasCompletedQuest(Spawn, CrazyTalkingSkull) then
  51. SpawnSet(NPC, "show_command_icon", 1)
  52. SpawnSet(NPC, "display_hand_icon", 1)
  53. SetAccessToEntityCommand(Spawn,NPC,"hail", 1)
  54. end
  55. end
  56. function attack_spawn(NPC, Spawn)
  57. zone = GetZone(Spawn)
  58. skeleton = SpawnByLocationID(zone, 133772386)
  59. if skeleton ~= nil then
  60. Attack(skeleton, Spawn)
  61. end
  62. end
  63. function respawn(NPC)
  64. spawn(NPC)
  65. end