9
3

abubblingbeaker.lua 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. --[[
  2. Script Name : SpawnScripts/RuinsVarsoon/abubblingbeaker.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.01.22 04:01:10
  5. Script Purpose :
  6. :
  7. --]]
  8. local Acidic = 5449
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  11. end
  12. function casted_on(NPC, Spawn, SpellName)
  13. if SpellName == 'pick up the beaker' then
  14. local con = CreateConversation()
  15. AddConversationOption(con, "Drink it. What harm could it do?", "DeathByAcid") -- a little something special I cooked up.
  16. AddConversationOption(con, "Pour a bit of the liquid onto the ground.", "offer")
  17. AddConversationOption(con, "Throw it down before whatever liquid contained within can cause you harm")
  18. StartDialogConversation(con, 1, NPC, Spawn, "A mysterious liquid seems to be bubbling of its own volition within the beaker. Each air pocket rising from the mixture lets out a slight puff of smoke, but the area around the beaker doesn't feel warm to the touch at all.")
  19. end
  20. end
  21. function offer(NPC, Spawn)
  22. local con = CreateConversation()
  23. AddConversationOption(con, "Wrack your brain to think of who would be interested in this mixture.","Offer2")
  24. AddConversationOption(con, "Dump the entire beaker out.")
  25. StartDialogConversation(con, 1, NPC, Spawn, "The ground boils and bubbles away as the liquid eats a hole in it. Thankfully you didn't decide to test it by drinking it!")
  26. SetAccessToEntityCommand(Spawn,NPC,"pick up the beaker", 0)
  27. SpawnSet(NPC, "show_command_icon", 0)
  28. SpawnSet(NPC, "display_hand_icon", 0)
  29. AddTimer(NPC, 10000, "check", 1, Spawn)
  30. end
  31. function KeepMix (NPC, Spawn)
  32. OfferQuest(NPC, Spawn, Acidic)
  33. CloseConversation(NPC, Spawn)
  34. end
  35. function DeathByAcid(NPC,Spawn)
  36. local con = CreateConversation()
  37. AddConversationOption(con, "Ugh..")
  38. StartDialogConversation(con, 1, NPC, Spawn, "Was that really a wise idea?")
  39. PlayAnimation(Spawn, 308)
  40. AddTimer(NPC, 5000, "Death", 1, Spawn)
  41. end
  42. function Death(NPC,Spawn)
  43. KillSpawn(Spawn,NPC)
  44. end
  45. function Offer2(NPC,Spawn)
  46. local con = CreateConversation()
  47. AddConversationOption(con, "Keep the mixture and find someone willing to buy it.","KeepMix")
  48. StartDialogConversation(con, 1, NPC, Spawn, "It's possible that a mage would have a better use for it; it certainly seems that a mage created it. However, perhaps someone with more nimble fingers would find a more clever use... a rogue? Perhaps a locksmith? There are certainly a few in Qeynos who might be interested...")
  49. end
  50. function InRange(NPC, Spawn)
  51. if HasQuest(Spawn, Acidic) or HasCompletedQuest(Spawn, Acidic) then
  52. SetAccessToEntityCommand(Spawn,NPC,"pick up the beaker", 0)
  53. SpawnSet(NPC, "show_command_icon", 0)
  54. SpawnSet(NPC, "display_hand_icon", 0)
  55. end
  56. end
  57. function check(NPC, Spawn)
  58. if not HasQuest(Spawn, Acidic) and not HasCompletedQuest(Spawn, Acidic) then
  59. SpawnSet(NPC, "show_command_icon", 1)
  60. SpawnSet(NPC, "display_hand_icon", 1)
  61. SetAccessToEntityCommand(Spawn,NPC,"pick up the beaker", 1)
  62. end
  63. end
  64. function respawn(NPC)
  65. spawn(NPC)
  66. end