9
3

anelementalessencewell.lua 1.2 KB

123456789101112131415161718192021222324252627282930
  1. --[[
  2. Script Name : ItemScripts/anelementalessencewell.lua
  3. Script Author : dorbin
  4. Script Date : 2023.12.27 07:12:44
  5. Script Purpose :
  6. :
  7. --]]
  8. local LoreAndLegendElemental = 5402
  9. function examined(Item, Player)
  10. local LnLAccept = GetRuleFlagFloat("R_World", "LoreAndLegendAccept")
  11. if LnLAccept > 0 and not HasQuest(Player, LoreAndLegendElemental) and not HasCompletedQuest(Player, LoreAndLegendElemental) then
  12. OfferQuest(nil, Player, LoreAndLegendElemental)
  13. else
  14. conversation = CreateConversation()
  15. if HasQuest(Player, LoreAndLegendElemental) and GetQuestStepProgress(Player, LoreAndLegendElemental, 4)==0 then
  16. AddConversationOption(conversation, "Begin to study...", "Step_Complete")
  17. end
  18. AddConversationOption(conversation, "No, put away", "CloseItemConversation")
  19. StartDialogConversation(conversation, 2, Item, Player, "This item can be used to learn the secrets of elementals. Do you wish to study it?")
  20. end
  21. end
  22. function Step_Complete(Item, Player)
  23. if HasItem(Player,3573,1) then
  24. SetStepComplete(Player, LoreAndLegendElemental, 4)
  25. CloseItemConversation(Item, Player)
  26. RemoveItem(Player, 3573)
  27. end
  28. end