a_locked_chest.lua 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. --[[
  2. Script Name : ItemScripts/a_locked_chest.lua
  3. Script Purpose :
  4. Script Author : Ememjr\\Dorbin
  5. Script Date : 2019-10-07
  6. Script Notes :
  7. --]]
  8. local quest = 480
  9. function examined(Item, Player)
  10. if CanReceiveQuest(Player,quest) then
  11. Dialog1(Item,Player)
  12. else
  13. conversation = CreateConversation()
  14. AddConversationOption(conversation, "[Keep the chest]")
  15. AddConversationOption(conversation, "[Throw the chest away]", "QuestFinish")
  16. StartDialogConversation(conversation, 2, Item, Player, "This locked chest has the same markings as one you've found before. It appears worthless to you.")
  17. end
  18. end
  19. function Dialog1(Item,Player)
  20. conversation = CreateConversation()
  21. if CanReceiveQuest(Player,quest) then
  22. AddConversationOption(conversation, "[Read the parchment]", "Dialog2")
  23. end
  24. AddConversationOption(conversation, "[Put the chest away]", "CloseItemConversation")
  25. StartDialogConversation(conversation, 2, Item, Player, "The chest's lock appears broken beyond opening. A parchment is plastered to the side with the word \"BOUNTY\" in large letters at the top. Perhaps someone was trying to complete this bounty before returning the chest?")
  26. end
  27. function Dialog2(Item,Player)
  28. conversation = CreateConversation()
  29. if CanReceiveQuest(Player,quest) then
  30. AddConversationOption(conversation, "[Commit to the task]", "Offer")
  31. end
  32. AddConversationOption(conversation, "[Put the chest away]", "CloseItemConversation")
  33. StartDialogConversation(conversation, 2, Item, Player, "\"A valuable chest was unlawfully taken by a band of Darkblade brigands. A generous reward will be provided to the one who returns this stolen property to Anrean Velvinna in the Beggar's Court.\"")
  34. end
  35. function Offer(Item,Player)
  36. if CanReceiveQuest(Player,quest) then
  37. OfferQuest(nil,Player,quest)
  38. end
  39. CloseItemConversation(Item,Player)
  40. end
  41. function QuestFinish(Item,Player)
  42. CloseItemConversation(Item,Player)
  43. if HasItem(Player,2115,1) then
  44. RemoveItem(Player,2115)
  45. end
  46. end