questBugSquashing.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --[[
  2. Script Name : SpawnScripts/Antonica/questBugSquashing.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.05.19 05:05:51
  5. Script Purpose :
  6. :
  7. --]]
  8. local Quest = 5842
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 20, "InRange", Spawn)
  11. end
  12. function casted_on(NPC, Spawn, SpellName)
  13. if SpellName == 'inspect' then
  14. local con = CreateConversation()
  15. if CanReceiveQuest(Spawn,Quest) then
  16. Dialog1(NPC,Spawn)
  17. elseif HasCompletedQuest(Spawn, Quest) then
  18. AddConversationOption(con, "[Leave the carcass.]")
  19. StartDialogConversation(con, 1, NPC, Spawn, "This is a dead klicnik that has historically plagued these lands. You've done what you could to thin their numbers.")
  20. elseif HasQuest(Spawn, Quest) and not HasCompletedQuest(Spawn, Quest) then
  21. AddConversationOption(con, "I must squish more klicnik warriors!")
  22. StartDialogConversation(con, 1, NPC, Spawn, "This is a dead klicnik reminds you of your mission to remove them from the Antonica countryside. You must do what you can to reduce their numbers!")
  23. end
  24. end
  25. end
  26. function Dialog1(NPC,Spawn)
  27. local con = CreateConversation()
  28. AddConversationOption(con, "[Look closer...]", "Dialog2")
  29. AddConversationOption(con, "[Leave the carcass.]")
  30. StartDialogConversation(con, 1, NPC, Spawn, "Whatever this was, it appears hard as a shell with a surface that glimmers with a faint light.")
  31. end
  32. function Dialog2(NPC,Spawn)
  33. local con = CreateConversation()
  34. AddConversationOption(con, "I should destroy the klicnik warriors!", "offer")
  35. AddConversationOption(con, "[Leave the carcass.]")
  36. StartDialogConversation(con, 1, NPC, Spawn, "Upon closer inspection you realize that it is an old, empty carapace for a klicnik warrior! Why are there so many of these dangerous insects so close to fair Qeynos?!")
  37. end
  38. function offer(NPC, Spawn)
  39. CloseConversation(NPC,Spawn)
  40. OfferQuest(NPC, Spawn, Quest)
  41. end