planter_1.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. --[[
  2. Script Name : SpawnScripts/Castleview/planter_1.lua
  3. Script Purpose : planter_1
  4. Script Author : Scatman
  5. Script Date : 2009.10.02
  6. Script Notes :
  7. --]]
  8. local HIGH_ELF_MENTOR_QUEST_2 = 224
  9. function spawn(NPC)
  10. SetRequiredQuest(NPC, HIGH_ELF_MENTOR_QUEST_2, 1)
  11. end
  12. function hailed(NPC, Spawn)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function casted_on(Target, Caster, SpellName)
  18. if HasQuest(Caster, HIGH_ELF_MENTOR_QUEST_2) and not QuestStepIsComplete(Caster, HIGH_ELF_MENTOR_QUEST_2, 1) and SpellName == "Plant Seeds" then
  19. conversation = CreateConversation()
  20. AddConversationOption(conversation, "Plant the seeds.", "PlantSeeds")
  21. StartDialogConversation(conversation, 1, Target, Caster, "This is one of the planters that Vindain spoke of.")
  22. end
  23. end
  24. function PlantSeeds(NPC, Spawn)
  25. SetStepComplete(Spawn, HIGH_ELF_MENTOR_QUEST_2, 1)
  26. local GreenWisp = SpawnMob(GetZone(Spawn), 2360172, false, 787.97, -15.615, -123.30, 220)
  27. Despawn(GreenWisp, 300000)
  28. conversation = CreateConversation()
  29. AddConversationOption(conversation, "Leave the planter.", "CloseConversation")
  30. StartDialogConversation(conversation, 1, NPC, Spawn, "You place a seed, some soil, and some water into the planter. A fresh green wisp plant begins to grow at a surprising rate.")
  31. end