107 lines
4.1 KiB
Text
107 lines
4.1 KiB
Text
-- INSERT INTO "quests" ("qst_id", "qst_script") VALUES (QUESTID, 'quest.SCRIPTNAME');
|
|
|
|
local common = require("base.common")
|
|
local monsterQuests = require("monster.base.quests") -- for Monster kill quests. Can be removed for all others
|
|
local M = {}
|
|
|
|
local GERMAN = Player.german
|
|
local ENGLISH = Player.english
|
|
|
|
-- Insert the quest title here, in both languages
|
|
local title = {}
|
|
title[GERMAN] = "Deutscher Questtitel"
|
|
title[ENGLISH] = "English Quest Title"
|
|
|
|
-- Insert an extensive description of each status here, in both languages
|
|
-- Make sure that the player knows exactly where to go and what to do
|
|
local description = {}
|
|
description[GERMAN] = {}
|
|
description[ENGLISH] = {}
|
|
description[GERMAN][1] = "Tolle lange Beschreibung die angezeigt wird wenn man Queststatus 1 erreicht, auch was man wo machen muss ..."
|
|
description[ENGLISH][1] = "Cool long description which is displayed when you reach quest status 1, also mention what to do where now ..."
|
|
|
|
-- Insert the position of the quest start here (probably the position of an NPC or item)
|
|
local start = position(1, 2, 3) OR Start = {1, 2, 3}
|
|
|
|
-- For each status insert a list of positions where the quest will continue, i.e. a new status can be reached there
|
|
local questTarget = {}
|
|
questTarget[1] = {position(1, 2, 3), position(4, 5, 6)} OR QuestTarget[1] = {{1, 2, 3}, {4, 5, 6}}
|
|
|
|
-- Insert the quest status which is reached at the end of the quest
|
|
local FINAL_QUEST_STATUS = 0
|
|
|
|
-- Register the monster kill parts of the quest.
|
|
monsterQuests.addQuest{
|
|
questId = 123,
|
|
location = {position = position(1, 1, 0), radius = 10},
|
|
queststatus = {from = 1, to = 5},
|
|
questTitle = {german = "Deutscher Titel des Quests", english = "English title of the quest"},
|
|
monsterName = {german = "Monster Name", english = "monster name"},
|
|
npcName = "Name of the NPC to return to",
|
|
raceIds = {0, 1} -- all monsters with races 0 (humans) or 1 (dwarves)
|
|
}
|
|
monsterQuests.addQuest{
|
|
questId = 123,
|
|
locations = {
|
|
{position = position(1, 1, 0), radius = 10},
|
|
{position = position(1, 1, -3), radius = 10}
|
|
},
|
|
queststatus = {from = 6, to = 10},
|
|
questTitle = {german = "Deutscher Titel des Quests", english = "English title of the quest"},
|
|
monsterName = {german = "Monster Name", english = "monster name"},
|
|
npcName = "Name of the NPC to return to",
|
|
monsterIds = {15, 325} -- monsters with the monster IDs 15 and 325
|
|
}
|
|
monsterQuests.addQuest{
|
|
questId = 123,
|
|
location = {position = position(1, 1, 0), radius = 10},
|
|
queststatus = {from = 11, to = 15},
|
|
questTitle = {german = "Deutscher Titel des Quests", english = "English title of the quest"},
|
|
monsterName = {german = "Monster Name", english = "monster name"},
|
|
npcName = "Name of the NPC to return to",
|
|
monsterGroupIds = {6, 10} -- all monsters in the monster groups 6 (drows) and 10 (mummies)
|
|
}
|
|
|
|
function M.QuestTitle(user)
|
|
return common.GetNLS(user, title[GERMAN], title[ENGLISH])
|
|
end
|
|
|
|
function M.QuestDescription(user, status)
|
|
local german = description[GERMAN][status] or ""
|
|
local english = description[ENGLISH][status] or ""
|
|
|
|
return common.GetNLS(user, german, english)
|
|
end
|
|
|
|
-- Availability of the quest
|
|
-- Possible values: Player.questAvailable (yellow quest marker "!")
|
|
-- Player.questWillBeAvailable (grey quest marker "!")
|
|
-- Player.questNotAvailable (no quest marker)
|
|
-- If the quest could be available soon (e.g. missing skill) return Player.questWillBeAvailable
|
|
-- and if the player tries to accept the quest, inform them what exactly is missing to do so.
|
|
-- If the quest will not be available (wrong town, too much skill already, etc.) return
|
|
-- Player.questNotAvailable.
|
|
-- The function below is the server default. It will be used if this entry point is not defined.
|
|
--[[
|
|
function M.QuestAvailability(user, status)
|
|
if status == 0 then
|
|
return Player.questAvailable
|
|
else
|
|
return Player.questNotAvailable
|
|
end
|
|
end
|
|
--]]
|
|
|
|
function M.QuestStart()
|
|
return start
|
|
end
|
|
|
|
function M.QuestTargets(user, status)
|
|
return questTarget[status]
|
|
end
|
|
|
|
function M.QuestFinalStatus()
|
|
return FINAL_QUEST_STATUS
|
|
end
|
|
|
|
return M
|