• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

NPC Advanced Quests Library - discussion before release

@UPDATE!
You can visit page NPC Quests and test newest version of NPC quest maker.
I'm waiting for my graphic now to make all missing buttons and backgrounds. 'kill' missions doesn't work yet. Library to make it compatible with 0.3.6 and all 0.4 is also not ready.

NPC Quests
Example code to 'LOAD HTML':
XML:
<div id="main">

<div name="missionBox" class="missionBox"><div name="missionName" class="missionName">nbbnb</div><div name="missionComment" class="missionComment">bnbnbn</div><img src="images/add_text.png" class="addButton" onclick="addText(this);"><div class="textsHolder" name="textsHolder"><div name="taskText" class="taskText"><b style="font-size:24px">Text:</b> <input type="text" name="text" value="hi bi00th" size="100" maxlength="255"><br><b style="font-size:24px">Answers:</b> <img src="images/add_answer.png" class="addButton" onclick="addAnswer(this);" alt="Add answer"><div class="answersHolder" name="answersHolder"><div class="answer" name="answer"><b style="font-size:24px">Words:</b> <img src="images/add_word.png" class="addButton" onclick="addAnswerWord(this);" alt="Add word"><div name="answerWordsHolder" class="answerWordsHolder"><div class="answerWord" name="answerWord"><input type="text" name="answerWordInput" size="20" maxlength="255" value="mission"><button name="wordRemover" type="" value="" onclick="removeWord(this)">Remove word</button></div><div class="answerWord" name="answerWord"><input type="text" name="answerWordInput" size="20" maxlength="255" value="quest"><button name="wordRemover" type="" value="" onclick="removeWord(this)">Remove word</button></div></div><b style="font-size:24px">Requirements:</b> <img src="images/add_requirement.png" class="addButton" onclick="addRequirement(this);" alt="Add requirement"><div name="answerRequirementsHolder" class="answerRequirementsHolder"></div><b style="font-size:24px">Actions:</b> <img src="images/add_action.png" class="addButton" onclick="addAction(this);" alt="Add action"><div name="answerActionsHolder" class="answerActionsHolder"><div class="answerAction" name="answerAction"><div name="typeAndParametersOfAction"><span name="typeOfAction"><select name="reqID" onchange="changeActionParameters(this);" style="visibility: visible; "><option value="0">None</option><option value="1">Say</option><option value="2" sekted="sekted" selected="selected">Go to next text</option><option value="3">Go to next mission</option><option value="4">Go to next mission and show text</option><option value="5">Go to text and show it's text</option><option value="6">Go to mission</option><option value="7">Go to mission and show text</option><option value="8">Go to start of NPC</option><option value="9">Add kill mission</option><option value="10">Remove kill mission</option><option value="11">Add Item Count</option><option value="12">Add Item Special</option><option value="13">Remove Item Count</option><option value="14">Add Item Slot</option><option value="15">Remove Item Slot</option><option value="16">Change Experience</option><option value="17">Set Experience</option><option value="18">Change Level</option><option value="19">Set Level</option><option value="20">Change HP</option><option value="21">Set HP</option><option value="22">Change Mana</option><option value="23">Set Mana</option><option value="24">Change Storage</option><option value="25">Set Storage</option><option value="26">Unset Storage</option><option value="27">Teleport NPC</option><option value="28">Teleport Player</option><option value="29">Show effect</option><option value="30">Show animated text</option><option value="31">Add item to position [if possible]</option><option value="32">Remove item from position [if possible]</option><option value="33">Add Money</option><option value="34">Remove Money</option></select></span><span name="parametersOfAction"></span><button name="actionRemover" type="" value="" onclick="removeAction(this)">Remove action</button></div></div></div></div></div></div><div name="taskText" class="taskText"><b style="font-size:24px">Text:</b> <input type="text" name="text" value="nice mission text, want make ? {yes}?" size="100" maxlength="255"><br><b style="font-size:24px">Answers:</b> <img src="images/add_answer.png" class="addButton" onclick="addAnswer(this);" alt="Add answer"><div class="answersHolder" name="answersHolder"><div class="answer" name="answer"><b style="font-size:24px">Words:</b> <img src="images/add_word.png" class="addButton" onclick="addAnswerWord(this);" alt="Add word"><div name="answerWordsHolder" class="answerWordsHolder"><div class="answerWord" name="answerWord"><input type="text" name="answerWordInput" size="20" maxlength="255" value="yes"><button name="wordRemover" type="" value="" onclick="removeWord(this)">Remove word</button></div><div class="answerWord" name="answerWord"><input type="text" name="answerWordInput" size="20" maxlength="255" value="ok"><button name="wordRemover" type="" value="" onclick="removeWord(this)">Remove word</button></div><div class="answerWord" name="answerWord"><input type="text" name="answerWordInput" size="20" maxlength="255" value="i do"><button name="wordRemover" type="" value="" onclick="removeWord(this)">Remove word</button></div></div><b style="font-size:24px">Requirements:</b> <img src="images/add_requirement.png" class="addButton" onclick="addRequirement(this);" alt="Add requirement"><div name="answerRequirementsHolder" class="answerRequirementsHolder"></div><b style="font-size:24px">Actions:</b> <img src="images/add_action.png" class="addButton" onclick="addAction(this);" alt="Add action"><div name="answerActionsHolder" class="answerActionsHolder"><div class="answerAction" name="answerAction"><div name="typeAndParametersOfAction"><span name="typeOfAction"><select name="reqID" onchange="changeActionParameters(this);" style="visibility: visible; "><option value="0">None</option><option value="1">Say</option><option value="2">Go to next text</option><option value="3" sekted="sekted" selected="selected">Go to next mission</option><option value="4">Go to next mission and show text</option><option value="5">Go to text and show it's text</option><option value="6">Go to mission</option><option value="7">Go to mission and show text</option><option value="8">Go to start of NPC</option><option value="9">Add kill mission</option><option value="10">Remove kill mission</option><option value="11">Add Item Count</option><option value="12">Add Item Special</option><option value="13">Remove Item Count</option><option value="14">Add Item Slot</option><option value="15">Remove Item Slot</option><option value="16">Change Experience</option><option value="17">Set Experience</option><option value="18">Change Level</option><option value="19">Set Level</option><option value="20">Change HP</option><option value="21">Set HP</option><option value="22">Change Mana</option><option value="23">Set Mana</option><option value="24">Change Storage</option><option value="25">Set Storage</option><option value="26">Unset Storage</option><option value="27">Teleport NPC</option><option value="28">Teleport Player</option><option value="29">Show effect</option><option value="30">Show animated text</option><option value="31">Add item to position [if possible]</option><option value="32">Remove item from position [if possible]</option><option value="33">Add Money</option><option value="34">Remove Money</option></select></span><span name="parametersOfAction"></span><button name="actionRemover" type="" value="" onclick="removeAction(this)">Remove action</button></div></div></div></div><div class="answer" name="answer"><b style="font-size:24px">Words:</b> <img src="images/add_word.png" class="addButton" onclick="addAnswerWord(this);" alt="Add word"><div name="answerWordsHolder" class="answerWordsHolder"><div class="answerWord" name="answerWord"><input type="text" name="answerWordInput" size="20" maxlength="255" value="no"><button name="wordRemover" type="" value="" onclick="removeWord(this)">Remove word</button></div><div class="answerWord" name="answerWord"><input type="text" name="answerWordInput" size="20" maxlength="255" value="don't"><button name="wordRemover" type="" value="" onclick="removeWord(this)">Remove word</button></div></div><b style="font-size:24px">Requirements:</b> <img src="images/add_requirement.png" class="addButton" onclick="addRequirement(this);" alt="Add requirement"><div name="answerRequirementsHolder" class="answerRequirementsHolder"></div><b style="font-size:24px">Actions:</b> <img src="images/add_action.png" class="addButton" onclick="addAction(this);" alt="Add action"><div name="answerActionsHolder" class="answerActionsHolder"><div class="answerAction" name="answerAction"><div name="typeAndParametersOfAction"><span name="typeOfAction"><select name="reqID" onchange="changeActionParameters(this);" style="visibility: visible; "><option value="0">None</option><option value="1">Say</option><option value="2">Go to next text</option><option value="3">Go to next mission</option><option value="4">Go to next mission and show text</option><option value="5">Go to text and show it's text</option><option value="6">Go to mission</option><option value="7">Go to mission and show text</option><option value="8" sekted="sekted" selected="selected">Go to start of NPC</option><option value="9">Add kill mission</option><option value="10">Remove kill mission</option><option value="11">Add Item Count</option><option value="12">Add Item Special</option><option value="13">Remove Item Count</option><option value="14">Add Item Slot</option><option value="15">Remove Item Slot</option><option value="16">Change Experience</option><option value="17">Set Experience</option><option value="18">Change Level</option><option value="19">Set Level</option><option value="20">Change HP</option><option value="21">Set HP</option><option value="22">Change Mana</option><option value="23">Set Mana</option><option value="24">Change Storage</option><option value="25">Set Storage</option><option value="26">Unset Storage</option><option value="27">Teleport NPC</option><option value="28">Teleport Player</option><option value="29">Show effect</option><option value="30">Show animated text</option><option value="31">Add item to position [if possible]</option><option value="32">Remove item from position [if possible]</option><option value="33">Add Money</option><option value="34">Remove Money</option></select></span><span name="parametersOfAction"></span><button name="actionRemover" type="" value="" onclick="removeAction(this)">Remove action</button></div></div></div></div></div></div></div></div><div name="missionBox" class="missionBox"><div name="missionName" class="missionName">complet miss</div><div name="missionComment" class="missionComment">sdsdsd</div><img src="images/add_text.png" class="addButton" onclick="addText(this);"><div class="textsHolder" name="textsHolder"><div name="taskText" class="taskText"><b style="font-size:24px">Text:</b> <input type="text" name="text" value="hi my quest maker, are you here to talk about {mission}?" size="100" maxlength="255"><br><b style="font-size:24px">Answers:</b> <img src="images/add_answer.png" class="addButton" onclick="addAnswer(this);" alt="Add answer"><div class="answersHolder" name="answersHolder"><div class="answer" name="answer"><b style="font-size:24px">Words:</b> <img src="images/add_word.png" class="addButton" onclick="addAnswerWord(this);" alt="Add word"><div name="answerWordsHolder" class="answerWordsHolder"><div class="answerWord" name="answerWord"><input type="text" name="answerWordInput" size="20" maxlength="255" value="mission"><button name="wordRemover" type="" value="" onclick="removeWord(this)">Remove word</button></div><div class="answerWord" name="answerWord"><input type="text" name="answerWordInput" size="20" maxlength="255" value="quest"><button name="wordRemover" type="" value="" onclick="removeWord(this)">Remove word</button></div></div><b style="font-size:24px">Requirements:</b> <img src="images/add_requirement.png" class="addButton" onclick="addRequirement(this);" alt="Add requirement"><div name="answerRequirementsHolder" class="answerRequirementsHolder"></div><b style="font-size:24px">Actions:</b> <img src="images/add_action.png" class="addButton" onclick="addAction(this);" alt="Add action"><div name="answerActionsHolder" class="answerActionsHolder"><div class="answerAction" name="answerAction"><div name="typeAndParametersOfAction"><span name="typeOfAction"><select name="reqID" onchange="changeActionParameters(this);" style="visibility: visible; "><option value="0">None</option><option value="1">Say</option><option value="2" sekted="sekted" selected="selected">Go to next text</option><option value="3">Go to next mission</option><option value="4">Go to next mission and show text</option><option value="5">Go to text and show it's text</option><option value="6">Go to mission</option><option value="7">Go to mission and show text</option><option value="8">Go to start of NPC</option><option value="9">Add kill mission</option><option value="10">Remove kill mission</option><option value="11">Add Item Count</option><option value="12">Add Item Special</option><option value="13">Remove Item Count</option><option value="14">Add Item Slot</option><option value="15">Remove Item Slot</option><option value="16">Change Experience</option><option value="17">Set Experience</option><option value="18">Change Level</option><option value="19">Set Level</option><option value="20">Change HP</option><option value="21">Set HP</option><option value="22">Change Mana</option><option value="23">Set Mana</option><option value="24">Change Storage</option><option value="25">Set Storage</option><option value="26">Unset Storage</option><option value="27">Teleport NPC</option><option value="28">Teleport Player</option><option value="29">Show effect</option><option value="30">Show animated text</option><option value="31">Add item to position [if possible]</option><option value="32">Remove item from position [if possible]</option><option value="33">Add Money</option><option value="34">Remove Money</option></select></span><span name="parametersOfAction"></span><button name="actionRemover" type="" value="" onclick="removeAction(this)">Remove action</button></div></div></div></div></div></div><div name="taskText" class="taskText"><b style="font-size:24px">Text:</b> <input type="text" name="text" value="have you done my nice mission? {yes}?" size="100" maxlength="255"><br><b style="font-size:24px">Answers:</b> <img src="images/add_answer.png" class="addButton" onclick="addAnswer(this);" alt="Add answer"><div class="answersHolder" name="answersHolder"><div class="answer" name="answer"><b style="font-size:24px">Words:</b> <img src="images/add_word.png" class="addButton" onclick="addAnswerWord(this);" alt="Add word"><div name="answerWordsHolder" class="answerWordsHolder"><div class="answerWord" name="answerWord"><input type="text" name="answerWordInput" size="20" maxlength="255" value="ye"><button name="wordRemover" type="" value="" onclick="removeWord(this)">Remove word</button></div><div class="answerWord" name="answerWord"><input type="text" name="answerWordInput" size="20" maxlength="255" value="yes"><button name="wordRemover" type="" value="" onclick="removeWord(this)">Remove word</button></div></div><b style="font-size:24px">Requirements:</b> <img src="images/add_requirement.png" class="addButton" onclick="addRequirement(this);" alt="Add requirement"><div name="answerRequirementsHolder" class="answerRequirementsHolder"><div class="answerRequirement" name="answerRequirement"><div name="typeAndParametersOfRequirement"><span name="typeOfRequirement"><select name="reqID" onchange="changeRequirementParameters(this);" style="visibility: visible; "><option value="0">None</option><option value="1">Level</option><option value="2">Magic Level</option><option value="3">Skill Level</option><option value="4">Vocation IS</option><option value="5">Vocation IS NOT</option><option value="6">Item Count</option><option value="7">Item Slot</option><option value="8" sekted="sekted" selected="selected">Money</option><option value="9">Storage Value</option><option value="10">Check Kill Mission</option></select></span><span name="parametersOfRequirement"><select name="param1" style="visibility: visible; "><option value=">="> >= (higher or equal)</option><option value=">=" sekted="sekted" selected="selected"> <= (lower or equal)</option><option value="=="> = (equal)</option><option value="~="> != (not equal)</option><option value="%"> % (modulo equal 0)</option></select><input type="text" name="param2" size="10" value="4"></span><button name="requirementRemover" type="" value="" onclick="removeRequirement(this)">Remove requirement</button></div><b style="margin-left:20px">Fail actions: </b><img src="images/add_action.png" class="addButton" onclick="addFailAction(this);" alt="Add fail action"><div name="failActionsHolder" class="failActionsHolder"><div class="answerAction" name="answerAction"><div name="typeAndParametersOfAction"><span name="typeOfAction"><select name="reqID" onchange="changeActionParameters(this);" style="visibility: visible; "><option value="0">None</option><option value="1" sekted="sekted" selected="selected">Say</option><option value="2">Go to next text</option><option value="3">Go to next mission</option><option value="4">Go to next mission and show text</option><option value="5">Go to text and show it's text</option><option value="6">Go to mission</option><option value="7">Go to mission and show text</option><option value="8">Go to start of NPC</option><option value="9">Add kill mission</option><option value="10">Remove kill mission</option><option value="11">Add Item Count</option><option value="12">Add Item Special</option><option value="13">Remove Item Count</option><option value="14">Add Item Slot</option><option value="15">Remove Item Slot</option><option value="16">Change Experience</option><option value="17">Set Experience</option><option value="18">Change Level</option><option value="19">Set Level</option><option value="20">Change HP</option><option value="21">Set HP</option><option value="22">Change Mana</option><option value="23">Set Mana</option><option value="24">Change Storage</option><option value="25">Set Storage</option><option value="26">Unset Storage</option><option value="27">Teleport NPC</option><option value="28">Teleport Player</option><option value="29">Show effect</option><option value="30">Show animated text</option><option value="31">Add item to position [if possible]</option><option value="32">Remove item from position [if possible]</option><option value="33">Add Money</option><option value="34">Remove Money</option></select></span><span name="parametersOfAction"><input type="type" value="I told you to bring me 5000 gold!" size="50" name="param1"></span><button name="actionRemover" type="" value="" onclick="removeAction(this)">Remove action</button></div></div><div class="answerAction" name="answerAction"><div name="typeAndParametersOfAction"><span name="typeOfAction"><select name="reqID" onchange="changeActionParameters(this);" style="visibility: visible; "><option value="0">None</option><option value="1">Say</option><option value="2">Go to next text</option><option value="3">Go to next mission</option><option value="4">Go to next mission and show text</option><option value="5">Go to text and show it's text</option><option value="6">Go to mission</option><option value="7">Go to mission and show text</option><option value="8" sekted="sekted" selected="selected">Go to start of NPC</option><option value="9">Add kill mission</option><option value="10">Remove kill mission</option><option value="11">Add Item Count</option><option value="12">Add Item Special</option><option value="13">Remove Item Count</option><option value="14">Add Item Slot</option><option value="15">Remove Item Slot</option><option value="16">Change Experience</option><option value="17">Set Experience</option><option value="18">Change Level</option><option value="19">Set Level</option><option value="20">Change HP</option><option value="21">Set HP</option><option value="22">Change Mana</option><option value="23">Set Mana</option><option value="24">Change Storage</option><option value="25">Set Storage</option><option value="26">Unset Storage</option><option value="27">Teleport NPC</option><option value="28">Teleport Player</option><option value="29">Show effect</option><option value="30">Show animated text</option><option value="31">Add item to position [if possible]</option><option value="32">Remove item from position [if possible]</option><option value="33">Add Money</option><option value="34">Remove Money</option></select></span><span name="parametersOfAction"></span><button name="actionRemover" type="" value="" onclick="removeAction(this)">Remove action</button></div></div></div></div></div><b style="font-size:24px">Actions:</b> <img src="images/add_action.png" class="addButton" onclick="addAction(this);" alt="Add action"><div name="answerActionsHolder" class="answerActionsHolder"><div class="answerAction" name="answerAction"><div name="typeAndParametersOfAction"><span name="typeOfAction"><select name="reqID" onchange="changeActionParameters(this);" style="visibility: visible; "><option value="0">None</option><option value="1">Say</option><option value="2">Go to next text</option><option value="3" sekted="sekted" selected="selected">Go to next mission</option><option value="4">Go to next mission and show text</option><option value="5">Go to text and show it's text</option><option value="6">Go to mission</option><option value="7">Go to mission and show text</option><option value="8">Go to start of NPC</option><option value="9">Add kill mission</option><option value="10">Remove kill mission</option><option value="11">Add Item Count</option><option value="12">Add Item Special</option><option value="13">Remove Item Count</option><option value="14">Add Item Slot</option><option value="15">Remove Item Slot</option><option value="16">Change Experience</option><option value="17">Set Experience</option><option value="18">Change Level</option><option value="19">Set Level</option><option value="20">Change HP</option><option value="21">Set HP</option><option value="22">Change Mana</option><option value="23">Set Mana</option><option value="24">Change Storage</option><option value="25">Set Storage</option><option value="26">Unset Storage</option><option value="27">Teleport NPC</option><option value="28">Teleport Player</option><option value="29">Show effect</option><option value="30">Show animated text</option><option value="31">Add item to position [if possible]</option><option value="32">Remove item from position [if possible]</option><option value="33">Add Money</option><option value="34">Remove Money</option></select></span><span name="parametersOfAction"></span><button name="actionRemover" type="" value="" onclick="removeAction(this)">Remove action</button></div></div><div class="answerAction" name="answerAction"><div name="typeAndParametersOfAction"><span name="typeOfAction"><select name="reqID" onchange="changeActionParameters(this);" style="visibility: visible; "><option value="0">None</option><option value="1" sekted="sekted" selected="selected">Say</option><option value="2">Go to next text</option><option value="3">Go to next mission</option><option value="4">Go to next mission and show text</option><option value="5">Go to text and show it's text</option><option value="6">Go to mission</option><option value="7">Go to mission and show text</option><option value="8">Go to start of NPC</option><option value="9">Add kill mission</option><option value="10">Remove kill mission</option><option value="11">Add Item Count</option><option value="12">Add Item Special</option><option value="13">Remove Item Count</option><option value="14">Add Item Slot</option><option value="15">Remove Item Slot</option><option value="16">Change Experience</option><option value="17">Set Experience</option><option value="18">Change Level</option><option value="19">Set Level</option><option value="20">Change HP</option><option value="21">Set HP</option><option value="22">Change Mana</option><option value="23">Set Mana</option><option value="24">Change Storage</option><option value="25">Set Storage</option><option value="26">Unset Storage</option><option value="27">Teleport NPC</option><option value="28">Teleport Player</option><option value="29">Show effect</option><option value="30">Show animated text</option><option value="31">Add item to position [if possible]</option><option value="32">Remove item from position [if possible]</option><option value="33">Add Money</option><option value="34">Remove Money</option></select></span><span name="parametersOfAction"><input type="type" value="Thank you very much! Sorry, but i got shit reward for you" size="50" name="param1"></span><button name="actionRemover" type="" value="" onclick="removeAction(this)">Remove action</button></div></div><div class="answerAction" name="answerAction"><div name="typeAndParametersOfAction"><span name="typeOfAction"><select name="reqID" onchange="changeActionParameters(this);" style="visibility: visible; "><option value="0">None</option><option value="1">Say</option><option value="2">Go to next text</option><option value="3">Go to next mission</option><option value="4">Go to next mission and show text</option><option value="5">Go to text and show it's text</option><option value="6">Go to mission</option><option value="7">Go to mission and show text</option><option value="8">Go to start of NPC</option><option value="9">Add kill mission</option><option value="10">Remove kill mission</option><option value="11" sekted="sekted" selected="selected">Add Item Count</option><option value="12">Add Item Special</option><option value="13">Remove Item Count</option><option value="14">Add Item Slot</option><option value="15">Remove Item Slot</option><option value="16">Change Experience</option><option value="17">Set Experience</option><option value="18">Change Level</option><option value="19">Set Level</option><option value="20">Change HP</option><option value="21">Set HP</option><option value="22">Change Mana</option><option value="23">Set Mana</option><option value="24">Change Storage</option><option value="25">Set Storage</option><option value="26">Unset Storage</option><option value="27">Teleport NPC</option><option value="28">Teleport Player</option><option value="29">Show effect</option><option value="30">Show animated text</option><option value="31">Add item to position [if possible]</option><option value="32">Remove item from position [if possible]</option><option value="33">Add Money</option><option value="34">Remove Money</option></select></span><span name="parametersOfAction">Item ID: <input type="text" name="param1" size="6" value="1234"> Count: <input type="text" name="param2" size="6" value="5"></span><button name="actionRemover" type="" value="" onclick="removeAction(this)">Remove action</button></div></div></div></div></div></div></div></div><div name="missionBox" class="missionBox"><div name="missionName" class="missionName">end mission</div><div name="missionComment" class="missionComment"></div><img src="images/add_text.png" class="addButton" onclick="addText(this);"><div class="textsHolder" name="textsHolder"><div name="taskText" class="taskText"><b style="font-size:24px">Text:</b> <input type="text" name="text" value="hey. i got no more missions for you. thx for help!" size="100" maxlength="255"><br><b style="font-size:24px">Answers:</b> <img src="images/add_answer.png" class="addButton" onclick="addAnswer(this);" alt="Add answer"><div class="answersHolder" name="answersHolder"></div></div></div></div></div>
 
ERRORS:
Storage value not set! NPC cannot save missions without storage!

Is there anything I'm not doing correctly?
Maybe I rushed, but I just randomly created this.

laJRIgF.png
 
'At top of page you must set storage in which NPC will save mission state. HAHA 'storage value', now it looks stupid, I must make error easier to understand, any idea?
In current version of save/load it doesn't save storage values and website version :( [+ 1 bug with adding <div id="main"> every save]
@EDIT [my last post had no sense, your screenshot didn't load]
Ok. Fixed. I tried to check if Storage value is set, but it's not working.

@EDIT 2:
When all work correctly, I will make some NPC examples.
 
Last edited:
Okay, now I get something to show up.
However, it doesn't look like an Lua code.

3fvpW5s.png
 
I spent 30 minutes to find bug why it works on home PC and doesn't after upload... on ots.me server are 'magic quotes: on' in PHP :D
Now it should work properly. It also saves storageID/storageIDkill and bug with 'add <div id="main"> every save' fixed.
 
I've added 2 new actions:
- Learn Spell
- Spawn Monster [example: spawn monsters for money, make mission to kill monsters and spawn them for player! :) ]
and one new requirement:
- Spell (know: yes/no, spell name: ...)


TODO left:
- kill missions
- save editor version info in NPC
- make normal colors of layout
- add number near 'mission name' / 'text'
 
Now all should work fine.
Changes:
- [make it work]
- added 'actions' to add outfit / 'requirement' 'outfit' to check if player already got that outfit and 'requirement' to check if player is pz locked
- changed colors to make it more readable
- added auto-numbers to missions / texts + special colors
- added buttons to remove Mission/Text/Answer

NPC Maker | OTS.ME

Please tell me what examples of NPCs I should post. Travel? Shop? Some kind of mission?
 
To make you test it well, do an NPC like this:

Say hi.
Depending on a chance 1 - 5
If 1, accept greet, else ignore for an hour.
First mission is to kill 10 demons.
Second mission is to bring back a demon helmet.
Third mission is to correctly pass 3/3 on a trivia questionaire.
And then after all that, reward the player by allowing him to talk to the NPC about any topic (this includes trades).

I want to see how all the different possibilities work/look like in the Lua code.
 
I will add 2 options to 'requirements':
- random from 0 to <input field> must be below <input field>
- LUA code [if statement] Code: <input field>
(for example: 'if getPlayerLevel(cid) % 3 == 2 then')

and one to 'actions':
- Execute LUA Code: <input field>
(for example: 'doPlayerAddExperience(cid, getPlayerLevel(cid))', it's stupid example, because you can use action 'Change Level' with parameter '|LEVEL|')

and then I will try to make that NPC :P
 
To make you test it well, do an NPC like this:

Say hi.
Depending on a chance 1 - 5
If 1, accept greet, else ignore for an hour.
First mission is to kill 10 demons.
Second mission is to bring back a demon helmet.
Third mission is to correctly pass 3/3 on a trivia questionaire.
And then after all that, reward the player by allowing him to talk to the NPC about any topic (this includes trades).

I want to see how all the different possibilities work/look like in the Lua code.

I made first 2 missions and then possibility to buy knight legs/knight armor [itemids are fake].
LUA code [kill missions are not ready yet, so there is no code/messagea about that in code]:
LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end

local talkStates = {}

function npcGreet(cid)
	if(cid ~= 0) then
		talkStates[getPlayerGUID(cid)] = 0
		if(getCreatureStorage(cid, 23632) == -1) then
			doCreatureSetStorage(cid, 23632, 0)
		end
		npcHandler:addFocus(cid)
		local missionID = getCreatureStorage(cid, 23632)
		if(missionID == 0) then
			selfSay("Hello |PLAYER_NAME|. I got a {mission} for you.")
			selfSay("Hello |PLAYER_NAME|. I got a {mission} for you.", cid)
			return false
		end
		if(missionID == 1) then
			selfSay("Hello! Did you kill 10 demons for me?")
			selfSay("Hello! Did you kill 10 demons for me?", cid)
			return false
		end
		if(missionID == 2) then
			selfSay("Hello! I got another {mission} for you.")
			selfSay("Hello! I got another {mission} for you.", cid)
			return false
		end
		if(missionID == 3) then
			selfSay("Hey |PLAYERNAME|! Do you have Demon Helmet for me?")
			selfSay("Hey |PLAYERNAME|! Do you have Demon Helmet for me?", cid)
			return false
		end
		if(missionID == 4) then
			selfSay("Hello |PLAYERNAME|. Want {trade}?")
			selfSay("Hello |PLAYERNAME|. Want {trade}?", cid)
			return false
		end
	end
	return false
end
npcHandler:setCallback(CALLBACK_GREET, npcGreet)

function npcTalkAboutMission(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end
	local missionID = getCreatureStorage(cid, 23632)
	local talkState = talkStates[getPlayerGUID(cid)]
	if(missionID == 0) then
		if(talkState == 0) then
			if(npcMakerMessageContains(msg, "mission") or npcMakerMessageContains(msg, "quest")) then
				if(not (getCreatureStorage(cid, 23634) >= os.time())) then
					selfSay("I'm busy! Come back after 1 hour.", cid)
					return true
				end
				if(math.random(1, 5) > 1) then
					selfSay("Sorry, but I'm too busy now to talk about mission. Come back in 1 hour.", cid)
					doCreatureSetStorage(cid, 23634, os.time()+3600)
					return true
				end
				talkStates[getPlayerGUID(cid)] = 1
				selfSay("Can you kill 10 demons for me?", cid)
				doCreatureSetStorage(cid, 23634, os.time()+3600)
				return true
			end
		elseif(talkState == 1) then
			if(npcMakerMessageContains(msg, "yes") or npcMakerMessageContains(msg, "ok")) then
				talkStates[getPlayerGUID(cid)] = 1
				doCreatureSetStorage(cid, 23632, 1)
				selfSay("Come back when you will kill 10 demons.", cid)
				return true
			elseif(npcMakerMessageContains(msg, "no") or npcMakerMessageContains(msg, "never") or npcMakerMessageContains(msg, "not")) then
				selfSay("Come back when you will be interested.", cid)
				talkStates[getPlayerGUID(cid)] = 0
				return true
			end
		end
	end
	if(missionID == 1) then
		if(talkState == 0) then
			if(npcMakerMessageContains(msg, "yes") or npcMakerMessageContains(msg, "did") or npcMakerMessageContains(msg, "done")) then
				KILL NOT READY YET
				selfSay("Thank you. I got another {mission} for you.", cid)
				doCreatureSetStorage(cid, 23632, 2)
				talkStates[getPlayerGUID(cid)] = 0
				return true
			elseif(npcMakerMessageContains(msg, "no") or npcMakerMessageContains(msg, "not") or npcMakerMessageContains(msg, "ddin't")) then
				selfSay("Come back when you will kill them.", cid)
				return true
			end
		end
	end
	if(missionID == 2) then
		if(talkState == 0) then
			if(npcMakerMessageContains(msg, "mission") or npcMakerMessageContains(msg, "quest")) then
				if(not (getCreatureStorage(cid, 23634) >= os.time())) then
					selfSay("I'm busy! Come back after 1 hour.", cid)
					return true
				end
				if(math.random(1, 5) > 1) then
					selfSay("Sorry, but I'm too busy now to talk about mission. Come back in 1 hour.", cid)
					doCreatureSetStorage(cid, 23634, os.time()+3600)
					return true
				end
				talkStates[getPlayerGUID(cid)] = 1
				selfSay("Can you bring me Demon Helmet?", cid)
				doCreatureSetStorage(cid, 23634, os.time()+3600)
				return true
			end
		elseif(talkState == 1) then
			if(npcMakerMessageContains(msg, "yes") or npcMakerMessageContains(msg, "ok") or npcMakerMessageContains(msg, "can")) then
				selfSay("Ok. Come back when you will have Demon Helmet for me.", cid)
				talkStates[getPlayerGUID(cid)] = 1
				doCreatureSetStorage(cid, 23632, 3)
				return true
			elseif(npcMakerMessageContains(msg, "no") or npcMakerMessageContains(msg, "not") or npcMakerMessageContains(msg, "can't") or npcMakerMessageContains(msg, "cannot")) then
				selfSay("Come back when you will be interested.", cid)
				talkStates[getPlayerGUID(cid)] = 0
				return true
			end
		end
	end
	if(missionID == 3) then
		if(talkState == 0) then
			if(npcMakerMessageContains(msg, "yes") or npcMakerMessageContains(msg, "do")) then
				if(not (getPlayerItemCount(cid, 1234) >= 1)) then
					selfSay("You don't have Demon Helmet. Come back when you will get it!", cid)
					return true
				end
				selfSay("Thank you very much. I really needed it. Now I got special offer for you. Want {trade}?", cid)
				talkStates[getPlayerGUID(cid)] = 1
				doCreatureSetStorage(cid, 23632, 4)
				doPlayerRemoveItem(cid, 1234, 1)
				return true
			elseif(npcMakerMessageContains(msg, "no") or npcMakerMessageContains(msg, "not") or npcMakerMessageContains(msg, "don't")) then
				selfSay("Come back when you will have it.", cid)
				return true
			end
		end
	end
	if(missionID == 4) then
		if(talkState == 0) then
			if(npcMakerMessageContains(msg, "trade")) then
				selfSay("I can sell you Knight Armor for 10k and Knight Legs for 5k;", cid)
				return true
			elseif(npcMakerMessageContains(msg, "knight armor")) then
				talkStates[getPlayerGUID(cid)] = 1
				selfSay("Do you want to buy Knight Armor for 10k?", cid)
				return true
			elseif(npcMakerMessageContains(msg, "knight legs")) then
				talkStates[getPlayerGUID(cid)] = 2
				selfSay("Do you want to buy Knight Legs for 5k?", cid)
				return true
			end
		elseif(talkState == 1) then
			if(npcMakerMessageContains(msg, "yes") or npcMakerMessageContains(msg, "ye")) then
				if(not (getPlayerMoney(cid) >= 10000)) then
					selfSay("You don't have enought money.", cid)
					talkStates[getPlayerGUID(cid)] = 0
					return true
				end
				selfSay("Here you are.", cid)
				doPlayerRemoveMoney(cid, 10000)
				doPlayerAddItem(cid, 3456, 1, true)
				talkStates[getPlayerGUID(cid)] = 0
				return true
			elseif(npcMakerMessageContains(msg, "no") or npcMakerMessageContains(msg, "not")) then
				talkStates[getPlayerGUID(cid)] = 0
				selfSay("Ok.", cid)
				return true
			end
		elseif(talkState == 2) then
			if(npcMakerMessageContains(msg, "ye") or npcMakerMessageContains(msg, "yes")) then
				if(not (getPlayerMoney(cid) >= 5000)) then
					selfSay("You don't have enought money.", cid)
					talkStates[getPlayerGUID(cid)] = 0
					return true
				end
				selfSay("Here you are.", cid)
				talkStates[getPlayerGUID(cid)] = 0
				doPlayerRemoveMoney(cid, 5000)
				doPlayerAddItem(cid, 4567, 1, true)
				return true
			elseif(npcMakerMessageContains(msg, "no") or npcMakerMessageContains(msg, "not")) then
				talkStates[getPlayerGUID(cid)] = 0
				selfSay("Ok.", cid)
				return true
			end
		end
	end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, npcTalkAboutMission)

function npcFarewell(cid)
	if(not npcHandler:isFocused(cid)) then
		return
	end
	npcHandler:releaseFocus(cid)
	selfSay(Bye!, cid)
	return false
end
npcHandler:setCallback(CALLBACK_FAREWELL, npcFarewell)

npcHandler:addModule(FocusModule:new())
'random 0-X [20% chance to start] hour interval' is added only when you want take mission, you can come back after 1 second if you killed demons or got demon helmet, after 2 missions you can talk about 'trade' anytime. Quest NPC Tool is not designed to make 'shops' with many offers [need much code] / trade by 'trade window'.
Code to 'Load NPC' you can copy from that link:
http://wklej.to/Bkr3E/text
 
Back
Top