forgottenserver icon indicating copy to clipboard operation
forgottenserver copied to clipboard

Quest via Lua and dynamic descriptions

Open MillhioreBT opened this issue 3 years ago • 0 comments

Pull Request Prelude

  • [x] I have followed [proper The Forgotten Server code styling][code].
  • [x] I have read and understood the [contribution guidelines][cont] before making this PR.
  • [x] I am aware that this PR may be closed if the above-mentioned criteria are not fulfilled.

Changes Proposed

These changes add the ability to create Quest from Revscripts. Support for dynamic descriptions via a callback has also been added. Example of data/scripts/quests/#dynamic.lua

local questII = Game.createQuest("Example Quest II", 1002, 1)

questII:createMission("Example Mission 1", 1002, 1, 10, false, function (player)
    return string.format("Example description %d by %s.", player.storage[1002], player:getName())
end)

questII:register()

GIF 13-07-2022 06-19-33 a  m

Notes: Suggestions to improve the code are welcome if possible <3

Issues addressed: Nothing!

MillhioreBT avatar Jul 13 '22 10:07 MillhioreBT