forgottenserver
forgottenserver copied to clipboard
Quest via Lua and dynamic descriptions
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()

Notes: Suggestions to improve the code are welcome if possible <3
Issues addressed: Nothing!