Welcome to PGMZ! My goal is to make it easy for everyone to find and share great plugins for creating amazing games. As a plugin developer myself, I'm excited to grow this community with all of you.
Quest System - QuestSystem.js
Plugin desc : Quest system v1.7.0
License : MIT License
Author : unagi ootoro
Website : https://github.com/unagiootoro/RPGMZ/blob/master/QuestSystem.js
Desc page : https://raw.githubusercontent.com/unagiootoro/RPGMZ/master/QuestSystem.js
Download Page : https://raw.githubusercontent.com/unagiootoro/RPGMZ/master/QuestSystem.js
File name : QuestSystem.js
Help of plugin :
@target MV MZ
@plugindesc Quest system v1.7.0
@author unagi ootoro
@url https://raw.githubusercontent.com/unagiootoro/RPGMZ/master/QuestSystem.js
@help
It is a plugin that introduces the quest system.
【How to use】
■ Creating a quest
Quest uses the plugin parameter "QuestDatas"
Create by editing.
"Requester", "Reward", "Quest content" required for the quest according to this parameter
Set items such as.
■ Quest state management
Each quest has a status (unordered, in progress, reported, etc.)
Its state is managed by variables.
The meanings of variable values are as follows.
0: Quest unregistered
Quests that are not registered and are not displayed in the list
1: Quest unordered
Unordered quest
2: Quest in progress
Orders received and ongoing quests
3: Quest can be reported
Quest that fulfilled the request and became reportable
4: Quest reported
The quest that made the report
5: Quest failure
Failed quest reward
6: Quest expired
Expired quest
7: Hidden quest
Hidden quest that only shows the outline
■ About state management performed by the quest plugin
The quest plugin only manages the following states:
・ When you receive an order for a quest, change the status from unordered to in progress.
・ When reporting a quest, change the status from reportable to reported
・ When canceling an in-progress quest, change the status from in-progress to unordered
If you want to change to a state other than the above, use the event command.
You need to change the value of the variable.
■ Reward receipt
Quest rewards will be received when you make a report.
■ Start of quest scene
The quest scene can be started in two ways:
・ Call "Quest Management" from the menu
-Execute the plug-in command "StartQuestScene"
It is assumed that these two are mainly used properly as follows.
Plugin command: Create a facility like a request office,
Orders and reports for quests there.
Menu: Check the status of each quest.
■ Quest command
The quest command classifies quests and orders and reports quests.
Used to manage commands.
* Plug-in commands and quest commands set in the menu
Because it is set by default
If you want to use it in a basic way, you do not need to change it.
There are the following types of quest commands.
all: Show all quests
questOrder: Show unordered quests
orderingQuest: View ongoing quests
questCancel: Cancel quest orders for ongoing quests
questReport: Report and receive rewards for reportable quests
reportedQuest: View reported quests
failedQuest: Show failed quests
expiredQuest: Show expired quests
hiddenQuest: Show hidden quests
■ Page break for quest details
If the detailed description of the quest cannot be displayed on one page, the page will automatically break.
If you want to manually break the page, in the quest detailed description
<newpage>
You can display the following content on a separate page by entering .
【Use plugin commands from scripts】
The functionality of plugin commands can also be used from scripts.
The MV version does not support the plug-in command itself, so
If you want to use the function in the plugin command, you need to use this script.
■ Start of quest scene
QuestSystemAlias.QuestUtils.startQuestScene(questCommands, fileName1 = "", fileName2 = "", xOfs = 240, yOfs = 300)
questCommands: Specify quest commands in the form ["all", "questOrder"].
fileName1: Specify the file name of the background image. (Optional)
fileName2: Specify the file name of the background standing image. (Optional)
xOfs: Specifies the X coordinate of the background standing image. (Optional)
yOfs: Specifies the Y coordinate of the background standing image. (Optional)
■ Reward acquisition
QuestSystemAlias.QuestUtils.getRewards(variableId)
variableId: Specify the variable ID of the target quest.
■ Change of detailed description of quest
QuestSystemAlias.QuestUtils.changeDetail(variableId, detail)
variableId: Specify the variable ID of the target quest.
detail: Specify the detailed description after the change.
■ Change of reward
QuestSystemAlias.QuestUtils.changeRewards(variableId, rawardDatas)
variableId: Specify the variable ID of the target quest.
rawardDatas: Specify rewards in the following format:
{type: "reward type", itemId: item ID, itemCount: number of items, gold: gold, exp: experience points}
type: Specify one of "gold", "exp", "item", "weapon", "armor".
itemId: Specify the corresponding ID when the type is one of "item", "weapon", "armor".
For example, if you want to specify a weapon with ID5, set type to "weapon" and itemId to 5.
itemCount: Specifies the number of items to get when the type is "item", "weapon", or "armor".
gold: Specifies the gold to get if the type is "gold".
exp: Specifies the experience value to obtain when type is "exp".
【License】
This plugin is available under the terms of the MIT license.
@command StartQuestScene
@text Quest scene start
@desc Start the quest scene.
@arg QuestCommands
@type select[]
@option all
@option questOrder
@option orderingQuest
@option questCancel
@option questReport
@option reportedQuest
@option failedQuest
@option expiredQuest
@option hiddenQuest
@default ["questOrder", "questCancel", "questReport"]
@text quest command
@desc Specify the quest command.
@arg BackgroundImage
@text background image
@type struct<BackgroundImage>
@default {"FileName1": "", "FileName2": "", "XOfs": "240", "YOfs": "300"}
@desc
Specify the background image of the quest scene.
@command GetRewards
@text Get rewards
@desc Get rewards for quests.
@arg VariableId
@type variable
@text variable ID
@desc Specify the variable ID of the quest to get the reward.
@command ChangeDetail
@text Quest details changed
@desc Change the quest details.
@arg VariableId
@type variable
@text variable ID
@desc Specifies the variable ID of the quest whose details you want to change.
@arg DetailNote
@type note
@text details
@desc Set the quest details to change.
@arg Detail
@type multiline_string
@text details(compatibility)
@desc (This is an older parameter but is left for compatibility.)Set the quest details to change.
@command ChangeRewards
@text Reward change
@desc Change quest rewards.
@arg VariableId
@type variable
@text variable ID
@desc Specify the variable ID of the quest whose reward you want to change.
@arg Rewards
@type struct<Reward>[]
@text reward
@desc Set the reward for the quest you want to change.
@param QuestDatas
@text quest data
@type struct<QuestData>[]
@default []
@desc
Register the quest data.
@param EnabledQuestMenu
@text Quest menu enabled
@type boolean
@on display
@off hidden
@default true
@desc
Specify whether to add the quest management screen to the menu.
@param EnabledQuestMenuSwitchId
@text Quest menu activation switch ID
@type switch
@default 0
@desc
Specify the switch ID that determines whether the quest management screen of the menu is valid / invalid.
@param MenuCommands
@text Menu display command
@type select[]
@option all
@option questOrder
@option orderingQuest
@option questCancel
@option questReport
@option reportedQuest
@option failedQuest
@option expiredQuest
@option hiddenQuest
@default ["orderingQuest", "reportedQuest", "all"]
@desc
Specify the filter command to be used on the quest management screen of the menu. See help quest command
@param MenuBackgroundImage
@text menu background image
@type struct<BackgroundImage>
@default {"FileName1": "", "FileName2": "", "XOfs": "240", "YOfs": "300"}
@desc
Specify the background image of the quest scene in the menu.
@param DisplayRequestor
@text View requester
@type boolean
@on display
@off hidden
@default true
@desc
Specify whether to display the title.
@param DisplayRewards
@text Reward display
@type boolean
@default true
@desc
Specify whether to display the reward request location.
@param DisplayDifficulty
@text Display of difficulty
@type boolean
@on display
@off hidden
@default true
@desc
Specify whether to display the quest difficulty level.
@param DisplayPlace
@text Display location
@type boolean
@default true
@desc
Specify whether to display the request location of the quest.
@param DisplayTimeLimit
@text Expiration date display
@type boolean
@on display
@off hidden
@default true
@desc
Specify whether to display the expiration date of the quest.
@param EnabledQuestOrderingCountWindow
@text Whether or not to display the number of quest orders window
@type boolean
@on display
@off hidden
@default true
@desc
Specifies whether or not to display the Quest Order Quantity window.
@param QuestOrderSe
@text Quest Order SE
@type struct<QuestOrderSe>
@default {"FileName": "Skill1", "Volume": "90", "Pitch": "100", "Pan": "0"}
@desc
Set the SE to play when you receive an order for a quest.
@param QuestReportMe
@text Quest Report ME
@type struct<QuestReportMe>
@default {"FileName": "Item", "Volume": "90", "Pitch": "100", "Pan": "0"}
@desc
Set the ME to play when reporting a quest.
@param WindowSize
@text Window size
@type struct<WindowSize>
@default {"CommandWindowWidth": "300", "CommandWindowHeight": "160", "DialogWindowWidth": "400", "GetRewardWindowWidth": "540" }
@desc
Set the size of various windows.
@param Text
@text Display text
@type struct<Text>
@default {"MenuQuestSystemText":"Quest confirmation","QuestOrderText":"Do you want to take this quest?","QuestOrderYesText":"Receive","QuestOrderNoText":"not accepted","QuestCancelText":"Do you want to cancel this quest?","QuestCancelYesText":"cancel","QuestCancelNoText":"do not cancel","QuestReportText":"Do you want to report this quest?","QuestReportYesText":"Report","QuestReportNoText":"do not report","NothingQuestText":"There is no corresponding quest.","GetRewardText":"Received the following items as a reward.","ReachedLimitText":"The number of quests has reached the limit.","HiddenTitleText":"??????????","AllCommandText":"All quests","QuestOrderCommandText":"Receive quest","OrderingQuestCommandText":"quest in progress","QuestCancelCommandText":"quest cancellation","QuestReportCommandText":"Report quest","ReportedQuestCommandText":"Reported quest","FailedQuestCommandText":"quest that failed","ExpiredQuestCommandText":"Expired quest","HiddenQuestCommandText":"unknown quest","NotOrderedStateText":"unordered","OrderingStateText":"in progress","ReportableStateText":"can be reported","ReportedStateText":"reported","FailedStateText":"failure","ExpiredStateText":"expired","RequesterText":"[Requester]:","RewardText":"[Reward]:","DifficultyText":"[Difficulty]:","PlaceText":"[Location]:","TimeLimitText":"[Period]:"}
@desc
Sets the text used in the game.
@param TextColor
@text Display text color
@type struct<TextColor>
@default {"NotOrderedStateColor":"#aaaaaa","OrderingStateColor":"#ffffff","ReportableStateColor":"#ffff00","ReportedStateColor":"#60ff60","FailedStateColor":"#0000ff","ExpiredStateColor":"#ff0000"}
@desc
Sets the color of the text used in the game.
@param CommandIcon
@text command icon
@type struct <CommandIcon>
@default {"AllCommandIcon": "0", "QuestOrderCommandIcon": "0", "OrderingQuestCommandIcon": "0", "QuestCancelCommandIcon": "0", "QuestReportCommandIcon": "0", "ReportedQuestCommandIcon": "0" , "FailedQuestCommandIcon": "0", "ExpiredQuestCommandIcon": "0", "HiddenQuestCommandIcon": "0"}
@desc
Specify the icon of the quest command.
@param GoldIcon
@text gold icon
@type number
@default 314
@desc
Set the gold icon to be displayed in the reward column.
@param ExpIcon
@text Experience point icon
@type number
@default 89
@desc
Set the experience value icon to be displayed in the reward column.
@param QuestTitleWrap
@text Quest title With or without line breaks
@type boolean
@default false
@desc
Set the presence or absence of line breaks in the quest title.
@param MaxOrderingQuests
@text Maximum number of quests that can be ordered
@type number
@default 3
@desc
Specify the number of quests that can be ordered at one time. If it is 0, you can receive infinite orders.