Apollo's Guide to the EO+ Quest System



Greetings and welcome to my quest making tutorial for use with the EO+ system. This Page is designed to provide a step by step tutorial in Quest Design for beginners, as well as a reference for people who wish to make even more complex quests. Best of Luck to all of you. ~Apollo

Getting Started
Making a New EO+ File
Quest Name and Version
Intoduction to Quest States
Describing the State Goal
How to Create a Quest Action
Making Quest Goals
Finishing a Quest
Apollo's Step by Step Quest for Beginners
EO+ Syntax Dictionary
Creating Your Own Custom Commands
Plugin for NotePad++





Getting Started



The very first thing you will want to do is write out some notes on how your quest should work. After this, you will need to make some id entries with your pub editor for the Quest ID. Quest ID's are important for organizing your quests into a logical order. You may already have Quest NPC's on your server with NPC ID's all over the place, but with the Quest ID system you may use a numbering order to help you organize quest steps. For instance, your NPC ID's may be 166, 135, and 241, but you can simply add a Quest ID to each of these for order (example 1,2, and 3). Once you have given your Quest NPC's a Quest ID you are ready to move on.



Making a New EO+ File



Once you have your NPC's tagged with Quest ID's, the next logical step is to make your EO+ quest file. What you'll want to do first is determine the NPC that begins the quest. For this example I will reference the SkyWonder Rescue from EO Main. The Quest's first character is Jessica(NPC 192), and her Quest ID is 13. Using any text editor (I don't recommend notepad, but it will work fine) you need to start a new file and save it as 00013.eqf. This will tell EO+ that the Quest ID is 13 and begins with the NPC that has the Quest ID 13. In some later server builds, quests can be linked to an NPC via the startnpc parameter. More on that later.


Quest Name and Version



At the very beginning of your new EO+ file, you will need to declare the Quest Name and Version number. This is where the actual EO+ code begins. There are two declarations that can be used outside of {brackets} in EO+. The First one is "Main". You will use this heading to declare only your Quest name and Version number.
To begin the heading, on the first line type: Main
On the second line make an opening bracket: {
On the third line, the Quest should be named by typing: questname "Skywonder Rescue"
On the fourth line, the Version # must be entered: version 1.0
Finally on the fifth line enter the closing bracket: }
Make sure to Surround your Quest name With Quotes and use the Decimal form for the Version number (Major.minor). Version number will be used to update Quest scripts in EOSERV.
Example: "Pjedro's Son".
Your finished Header Should look like this:
Main
{
	questname	"Skywonder Rescue"
	version		1
}



Introduction to Quest States



A quest state is the way the server determines at what point in the quest your character is in. Each state will be given a name starting with the first state always being named Begin. After the first state, you may name the states whatever you would like. You should have an idea of the number of quest states you will need to make your quest work when you start, but it isn't hard to develop a quest with EO+ from scratch either. Lets start making states. Here is an example of how the first two states will begin:

State Begin
{

}
State TalkToWolfLeader
{

}


Describing the State Goal



Each state should have a described goal to be displayed in the Quest Book. This goal will be what tells the player the next step of action to take. To create this tag simply type desc followed by the description in " ". Lets add some descriptive tags to our Skywonder quest:
State Begin
{
	desc	"Talk to Jessica"

}
State TalkToWolfLeader
{
	desc	"Talk to the Wolf Leader"

}


How to Create a Quest Action



Quest actions are where the magic happens. You will use actions to put into motion everything a quest can do. This can range from simply talking to an NPC all the way to Getting an Item and Exp reward. All actions are triggered by the action tag followed by the actual action call. The most frequently used actions in a quest are "AddNpcText" and "AddNpcInput". You will use these to create your quest dialogs. In some quest states you will find that you may talk to more than 1 NPC character at a time. This is where your skills as a writer will come in handy!
To create your first dialog, use the "action" tag, followed by "AddNpcText(npc quest id, "message");
It is very important to pay attention to the punctuation here. If you leave out a " or the ; at the end things could go terribly wrong. Your dialog may not even be displayed. Here is how an added dialog would look:
State Begin
{
	desc	"Talk to Jessica"
	action	AddNpcText(13, "Hello, as you can see I live peacefully with the blobsies in the wonderful sky, then one day the wolfman and the foxes got into a fight and all the foxes moved to here");

}
State TalkToWolfLeader
{
	desc	"Talk to the Wolf Leader"
	action	AddNpcText(13, "Go talk to the wolfman first im sure he's willing to compromise so we can all live in peace again.");
	action	AddNpcText( 14, "Hello there, i see Jessica sent you, what do you want?");

}


As you can see, the TalkToWolfLeader state actually has Jessica's second dialog, as well as the first dialog from the Wolfman. Once the quest state has moved to the TalkToWolfLeader state, Jessica will always instruct players to talk to the Wolf Leader.
Now for adding some interaction via the dialog window. AddNpcInput works just like AddNpcText except it needs a link value to direct what happens when a link is clicked. The action call works like this: AddNpcInput(NPC Quest ID, Input ID, "message");
The Input ID is up to you, but you should keep it ordered beginning with 1. (0 is not used as a link as the quest engine reserves 0 for cancel). Lets add some input links:
State Begin
{
	desc	"Talk to Jessica"
	action	AddNpcText(13, "Hello, as you can see I live peacefully with the blobsies in the wonderful sky, then one day the wolfman and the foxes got into a fight and all the foxes moved to here");

}
State TalkToWolfLeader
{
	desc	"Talk to the Wolf Leader"
	action	AddNpcText(13, "Go talk to the wolfman first im sure he's willing to compromise so we can all live in peace again.");
	action	AddNpcText( 14, "Hello there, i see Jessica sent you, what do you want?");
	action	AddNpcInput( 14, 1, "I come in peace");
	action	AddNpcInput( 14, 2, "Nothing, bye");

}


There are many more actions that can be added into a quest state similar to these. I will cover those later in this guide.

Making Quest Goals



Every quest state must have a method of being satisfied so that it can move on to the next state. The tag used to define these goals is called "rule". A rule has a basic structure: rule tag, rule type, and goto state. The most basic rule is TalkedToNpc(Npc Quest ID). Lets add this to our begin state:
State Begin
{
	desc	"Talk to Jessica"
	action	AddNpcText(13, "Hello, as you can see I live peacefully with the blobsies in the wonderful sky, then one day the wolfman and the foxes got into a fight and all the foxes moved to here");

	rule	TalkedToNpc(13) goto TalkToWolfLeader
}
State TalkToWolfLeader
{
	desc	"Talk to the Wolf Leader"
	action	AddNpcText(13, "Go talk to the wolfman first im sure he's willing to compromise so we can all live in peace again.");
	action	AddNpcText( 14, "Hello there, i see Jessica sent you, what do you want?");
	action	AddNpcInput( 14, 1, "I come in peace");
	action	AddNpcInput( 14, 2, "Nothing, bye");

}


As you can see, all that is required to move from the "Begin" state to the "TalkToWolfLeader" state is that a player must have simply opened the dialog window with Jessica.
Rules can also be used to determine what the Input Link will do next. The rule "InputNpc(Input ID)" will help us handle links. Now lets add a rule for clicking a link and a new state to go to:
State Begin
{
	desc	"Talk to Jessica"
	action	AddNpcText(13, "Hello, as you can see I live peacefully with the blobsies in the wonderful sky, then one day the wolfman and the foxes got into a fight and all the foxes moved to here");

	rule	TalkedToNpc(13) goto TalkToWolfLeader
}
State TalkToWolfLeader
{
	desc	"Talk to the Wolf Leader"
	action	AddNpcText(13, "Go talk to the wolfman first im sure he's willing to compromise so we can all live in peace again.");
	action	AddNpcText( 14, "Hello there, i see Jessica sent you, what do you want?");
	action	AddNpcInput( 14, 1, "I come in peace");
	action	AddNpcInput( 14, 2, "Nothing, bye");

	rule	InputNpc(1) goto GetBirdFeathers

}
State GetBirdFeathers
{
	desc	"Find 10 bird feathers"
	action	AddNpcText( 14, "We are currently at war with the birdmans on the other mountain. I am currently too busy to talk about peace with the foxes.");
	action	AddNpcText( 14, "You know i hate those annoying birdmans, if you help us fight the birdmans and bring me 10 bird feathers I will think about your offer." );

}
State GiveFeathers
{
	desc	"Give 10 bird feathers"
	action	AddNpcText(14, "Hi again, i can see you have been fighting with the birdmans, your help is greatly appreciated!");
	action	AddNpcText(14, "Will you give me those bird feathers?");
	
	action	AddNpcInput(14, 2, "Ok, here you are");
	action	AddNpcInput(14, 1, "No, these are mine");

	rule	InputNpc(2) goto TalkToJessica

}


Some Quests will have requirements such as gathering items in this one. Two rules are used here. GotItems is used to check your items for your Quest progress, and LostItems checks your items to see if you lost any of your required items before moving on to a new state. GotItems should be used to forward to the next state, while LostItems will be used to backtrack to the old state should you lose any items along the way. Both contain two values (Item ID, Amount). This is how they should look when added:
State Begin
{
	desc	"Talk to Jessica"
	action	AddNpcText(13, "Hello, as you can see I live peacefully with the blobsies in the wonderful sky, then one day the wolfman and the foxes got into a fight and all the foxes moved to here");

	rule	TalkedToNpc(13) goto TalkToWolfLeader
}
State TalkToWolfLeader
{
	desc	"Talk to the Wolf Leader"
	action	AddNpcText(13, "Go talk to the wolfman first im sure he's willing to compromise so we can all live in peace again.");
	action	AddNpcText( 14, "Hello there, i see Jessica sent you, what do you want?");
	action	AddNpcInput( 14, 1, "I come in peace");
	action	AddNpcInput( 14, 2, "Nothing, bye");

	rule	InputNpc(1) goto GetBirdFeathers

}
State GetBirdFeathers
{
	desc	"Find 10 bird feathers"
	action	AddNpcText( 14, "We are currently at war with the birdmans on the other mountain. I am currently too busy to talk about peace with the foxes.");
	action	AddNpcText( 14, "You know i hate those annoying birdmans, if you help us fight the birdmans and bring me 10 bird feathers I will think about your offer." );

	rule 	GotItems(299,10) goto GiveFeathers

}
State GiveFeathers
{
	desc	"Give 10 bird feathers"
	action	AddNpcText(14, "Hi again, i can see you have been fighting with the birdmans, your help is greatly appreciated!");
	action	AddNpcText(14, "Will you give me those bird feathers?");
	
	action	AddNpcInput(14, 2, "Ok, here you are");
	action	AddNpcInput(14, 1, "No, these are mine");

	rule	InputNpc(2) goto TalkToJessica
	rule	LostItems(299,10) goto GetBirdFeathers

}


Finishing a Quest



Well here's where it all comes to an end. There are basically two types of Quest endings. One is when the quest can be repeated, the other is when the quest cannot be repeated. To finish our short version of the SkyWonder Rescue we will need a couple more states added. One I have already labeled in the previous "rule" as "TalkToJessica" and a new state we shall call "Reward". Having already covered examples of the first state, "TalkToJessica" is easy to make. All that is needed is a "TalkedToNpc" rule to send us on to the Reward state. Here's how the last two states should look:
State TalkToJessica
{
	desc	"Go see Jessica for your reward"
	action	RemoveItem(299,10);
	action	AddNpcText(14, "Go tell Jessica we shall make peace with the Foxes");
	action	AddNpcText(13, "Thank you so much for your help, please accept this reward");

	rule	TalkedToNpc(13) goto Reward
}
State Reward
{

}


As you can see, I have added the RemoveItem(Item ID, Amount) action to the TalkToJessica state so that the feathers from the previous input are actually removed since the link had been clicked. The state is ready to move on to the "Reward" state.
A few basic things should be handled in the "Reward" state, namely giving rewards and either resetting or ending the quest. Using GiveExp(amount) and GiveItem(Item ID, amount) we can throw in some nice rewards here.
State Reward
{
	action	GiveExp(500);
	action	GiveItem(1, 500);
}


And now for the finale. All that is left is to either use Reset() or End() to Repeat or End this Quest. If the Quest is ended, it will display in the character's Quest history book. For this Quest I will add Reset() to be able to repeat the quest again.
State Reward
{
	action	GiveExp(500);
	action	GiveItem(1, 500);
	action	Reset();
}


And That's it. Congrats on making your first mini-quest using EO+!


Apollo's Step by Step Quest for Beginners



Ok, now with a little bit of understanding of the EO+ layout I will make a quest from scratch. I will use 2 Npc's for this as well: Wise Man and Pig Farmer. Next, I will make a flow chart for this quest.
Talk to Wiseman
Kill 5 rats
Return to Wiseman
Step on a tile
Return to Wiseman
Collect 5 Penguin Meat
Return to Wiseman
Talk to Pig Farmer
Return to Wiseman
Kill another player in pk
Return to Wiseman/Open Class Menu
Change Class

Wow, that's a lot to do. Shouldn't take very long to make though. First, I will add the header and make an empty state for each:

Main
{
	questname "Wiseman Quest"
	version		1
}
State Begin
{

}
State KillRats
{

}
State Wiseman1
{

}
State TileStep
{

}
State Wiseman2
{

}
State GetPenguinMeat
{

}
State Wiseman3
{

}
State TalkToPigFarmer
{

}
State Wiseman4
{

}
State KillPlayer
{

}
State ClassMenu
{

}
State Priest
{

}
State Magician
{

}
State Rogue
{

}
State Archer
{

}
State Warrior
{

}

Next, I will add description tags where needed:
Main
{
	questname "Wiseman Quest"
	version		1
}
State Begin
{

}
State KillRats
{
	desc	"Kill 5 Rats"
}
State Wiseman1
{
	desc	"Talk to Wiseman"
}
State TileStep
{
	desc	"Check the Boat Door"
}
State Wiseman2
{
	desc	"Talk to Wiseman"
}
State GetPenguinMeat
{
	desc	"Find 5 Penguin Meat"
}
State Wiseman3
{
	desc 	"Talk to Wiseman"
}
State TalkToPigFarmer
{
	desc	"Talk to Pig Farmer"
}
State Wiseman4
{
	desc	"Talk to Wiseman"
}
State KillPlayer
{
	desc	"Kill 1 Player in PK"
}
State ClassMenu
{
	desc	"Talk to Wiseman"
}
State Priest
{

}
State Magician
{

}
State Rogue
{

}
State Archer
{

}
State Warrior
{

}

That was easy, now for some dialog:
Main
{
	questname "Wiseman Quest"
	version		1
}
State Begin
{
	action AddNpcText(4, "Hellow there, I am tired of changing classes for just anyone");

}
State KillRats
{
	desc	"Kill 5 Rats"
	action	AddNpcText(4, "Prove you aren't lazy, Kill 5 Rats.");
}
State Wiseman1
{
	desc	"Talk to Wiseman"
	action 	AddNpcText(4, "Ok, but I have a request of you");
}
State TileStep
{
	desc	"Check the Boat Door"
	action	AddNpcText(4, "Check that boat that sails to Newb Land to ensure the door to the captain's chamber is locked");
}
State Wiseman2
{
	desc	"Talk to Wiseman"
	action	AddNpcText(4, "Good, now I am hungry. Go fetch about 5 Penguin meat for my dinner");
}
State GetPenguinMeat
{
	desc	"Find 5 Penguin Meat"
}
State Wiseman3
{
	desc 	"Talk to Wiseman"
	action	AddNpcText(4, "Did you get 5 penguin meat?");
}
State TalkToPigFarmer
{
	desc	"Talk to Pig Farmer"
	action	AddNpcText(4, "Invite the Pig Farmer to Town Square to share this meal with me");
	action	AddNpcText(24, "Wiseman, eh? Tell that old fart I am fat enough. I will pass"); 
}
State Wiseman4
{
	desc	"Talk to Wiseman"
	action	AddNpcText(4, "He refused? How rude! Go take out my anger on another player");
}
State KillPlayer
{
	desc	"Kill 1 Player in PK"
}
State ClassMenu
{
	desc	"Talk to Wiseman"
	action  AddNpcText(4, "You look like you could use a class change. What class would you like?");
}
State Priest
{

}
State Magician
{

}
State Rogue
{

}
State Archer
{

}
State Warrior
{

}

Looking good, now for some rules:
Main
{
	questname "Wiseman Quest"
	version		1
}
State Begin
{
	action	AddNpcText(4, "Hellow there, I am tired of changing classes for just anyone");

	rule	TalkedToNpc(4) goto KillRats
}
State KillRats
{
	desc	"Kill 5 Rats"
	action	AddNpcText(4, "Prove you aren't lazy, Kill 5 Rats.");

	rule	KilledNpcs(2, 5) goto Wiseman1
}
State Wiseman1
{
	desc	"Talk to Wiseman"
	action 	AddNpcText(4, "Ok, but I have a request of you");
	
	rule	TalkedToNpc(4) goto TileStep
}
State TileStep
{
	desc	"Check the Boat Door"
	action	AddNpcText(4, "Check that boat that sails to Newb Land to ensure the door to the captain's chamber is locked");

	rule	EnterCoord(1,6,21) goto Wiseman2
}
State Wiseman2
{
	desc	"Talk to Wiseman"
	action	AddNpcText(4, "Good, now I am hungry. Go fetch about 5 Penguin meat for my dinner");

	rule	TalkedToNpc(4) goto GetPenguinMeat
}
State GetPenguinMeat
{
	desc	"Find 5 Penguin Meat"
	
	rule	GotItems(259,5) goto Wiseman 3
}
State Wiseman3
{
	desc 	"Talk to Wiseman"
	action	AddNpcText(4, "Did you get 5 penquin meat?");

	rule	LostItems(259,5) goto Wiseman2
	rule	TalkedToNpc(4) goto TalkToPigFarmer
}
State TalkToPigFarmer
{
	desc	"Talk to Pig Farmer"
	action	AddNpcText(4, "Invite the Pig Farmer to Town Square to share this meal with me");
	action	AddNpcText(24, "Wiseman, eh? Tell that old fart I am fat enough. I will pass"); 
	
	rule	TalkedToNpc(24) goto Wiseman4
}
State Wiseman4
{
	desc	"Talk to Wiseman"
	action	AddNpcText(4, "He refused? How rude! Go take out my anger on another player");

	rule 	TalkedToNpc(4) goto KillPlayer
}
State KillPlayer
{
	desc	"Kill 1 Player in PK"

	rule	KilledPlayers(1) goto ClassMenu
}
State ClassMenu
{
	desc	"Talk to Wiseman"
	action	AddNpcText(4, "You look like you could use a class change. What class would you like?");
	action	AddNpcInput(2, "Priest");
	action	AddNpcInput(3, "Magician");
	action	AddNpcInput(4, "Rogue");
	action	AddNpcInput(5, "Archer");
	action	AddNpcInput(6, "Warrior");

	rule	InputNpc(2) goto Priest
	rule	InputNpc(3) goto Magician
	rule	InputNpc(4) goto Rogue
	rule	InputNpc(5) goto Archer
	rule	InputNpc(6) goto Warrior
}
State Priest
{

}
State Magician
{

}
State Rogue
{

}
State Archer
{

}
State Warrior
{

}

And now to add classes and loop back to the wiseman class menu ftw!
Main
{
	questname "Wiseman Quest"
	version		1
}
State Begin
{
	action	AddNpcText(4, "Hellow there, I am tired of changing classes for just anyone");

	rule	TalkedToNpc(4) goto KillRats
}
State KillRats
{
	desc	"Kill 5 Rats"
	action	AddNpcText(4, "Prove you aren't lazy, Kill 5 Rats.");

	rule	KilledNpcs(2, 5) goto Wiseman1
}
State Wiseman1
{
	desc	"Talk to Wiseman"
	action 	AddNpcText(4, "Ok, but I have a request of you");
	
	rule	TalkedToNpc(4) goto TileStep
}
State TileStep
{
	desc	"Check the Boat Door"
	action	AddNpcText(4, "Check that boat that sails to Newb Land to ensure the door to the captain's chamber is locked");

	rule	EnterCoord(1,6,21) goto Wiseman2
}
State Wiseman2
{
	desc	"Talk to Wiseman"
	action	ShowHint("Door is locked! Check back with Wiseman");
	action	AddNpcText(4, "Good, now I am hungry. Go fetch about 5 Penguin meat for my dinner");

	rule	TalkedToNpc(4) goto GetPenguinMeat
}
State GetPenguinMeat
{
	desc	"Find 5 Penguin Meat"
	
	rule	GotItems(259,5) goto Wiseman 3
}
State Wiseman3
{
	desc 	"Talk to Wiseman"
	action	AddNpcText(4, "Did you get 5 penquin meat?");

	rule	LostItems(259,5) goto Wiseman2
	rule	TalkedToNpc(4) goto TalkToPigFarmer
}
State TalkToPigFarmer
{
	desc	"Talk to Pig Farmer"
	action	AddNpcText(4, "Invite the Pig Farmer to Town Square to share this meal with me");
	action	AddNpcText(24, "Wiseman, eh? Tell that old fart I am fat enough. I will pass"); 
	
	rule	TalkedToNpc(24) goto Wiseman4
}
State Wiseman4
{
	desc	"Talk to Wiseman"
	action	AddNpcText(4, "He refused? How rude! Go take out my anger on another player");

	rule 	TalkedToNpc(4) goto KillPlayer
}
State KillPlayer
{
	desc	"Kill 1 Player in PK"

	rule	KilledPlayers(1) goto ClassMenu
}
State ClassMenu
{
	desc	"Talk to Wiseman"
	action	AddNpcText(4, "You look like you could use a class change. What class would you like?");
	action	AddNpcInput(4, 2, "Priest");
	action	AddNpcInput(4, 3, "Magician");
	action	AddNpcInput(4, 4, "Rogue");
	action	AddNpcInput(4, 5, "Archer");
	action	AddNpcInput(4, 6, "Warrior");

	rule	InputNpc(2) goto Priest
	rule	InputNpc(3) goto Magician
	rule	InputNpc(4) goto Rogue
	rule	InputNpc(5) goto Archer
	rule	InputNpc(6) goto Warrior
}
State Priest
{
	action 	SetClass(2);
	action 	SetState("ClassMenu");
}
State Magician
{
	action 	SetClass(3);
	action 	SetState("ClassMenu");
}
State Rogue
{
	action 	SetClass(4);
	action 	SetState("ClassMenu");
}
State Archer
{
	action 	SetClass(5);
	action 	SetState("ClassMenu");
}
State Warrior
{
	action 	SetClass(6);
	action 	SetState("ClassMenu");
}

And that is basically a step by step for how to make quests. Please refer to the EO+ Syntax Dictionary for a complete list of actions and rules that can be used in the EO+ Quest System.

EO+ Syntax Dictionary
Terms in red respresent newer features from EO build 0.4.x or other features not common to general server releases.



Structural Brackets
main - Used as the header of the EO+ quest. Declarations made in the Main bracket remain constant throughout a quest. Usage:
main
{

}

state - Used to name the state. Every state MUST have a name. The first state is ALWAYS named Begin. Usage:
state StateName
{

}

random - Used to name an array of random entries. Every random MUST have a name. A random entry is selected and stored during a state function that calls them. Usage:
random RandomName
{

}

Main Declarations

questname - Used to declare the name of the quest that will be displayed in the Progress and History book for the player. "questname" must be declared only within the brackets of the "Main" header. Usage: questname "Quest Name"

version - Used to denote the quest version number. Version may be entered in a Major.minor decimal format or simply listing the major with no decimal within the brackets of the "Main" header. Some builds may reset a quest if the major version number is changed. Usage: version 1.0 or version 1

hidden - Optional - Used to delist a quest from the quest log and quest history windows.

hidden_end - Optional - Used to delist a completed quest from the quest history window.

disabled - Optional - Used to deactivate a quest completely. Progress will not be destroyed if a quest becomes disabled.

minlevel - Optional - Sets the minimum level a player can be before starting a quest.

maxlevel - Optional - Sets the maximum level a player can be before starting a quest.

needadmin - (alias adminreq) Optional - Sets the admin rank a player can be before starting a quest.

needclass - (alias classreq) Optional - Sets the class required by class ID a player can be before starting a quest.

needquest - (alias questreq) Optional - Sets the quest required to be completed by a player can be before starting a quest.

startnpc - Optional - Activates NPCs the ability to start a quest when the quest ID does not match the NPC's quest ID. This value should be set to the desired Start NPC's quest ID. This can be declared twice to allow two different NPCs to start a quest. With the addition of the startnpc tag, it is possible to stack multiple quests onto a single NPC. Usage: startnpc Quest ID

State Declarations

action - Used to denote a quest action. Action lines should end with a ";"(not required in most server builds). Usage: action ActionName(variables);

desc - Used to describe the goal of the current state. Usage: desc "Current Goal"

goto - Used only within a rule declaration to denote the target state of the satisfied rule. See "rule" for usage.

rule - Used to declare what conditions cause a state change. Rules MUST always end with a goto State tag. Usage: rule RuleType(variable) goto StateName

Random Declarations

coord - Entry of map coordiantes. Usage: coord (MapID, Xloc, Yloc)

item - Entry of an item. Usage: item(Item ID, amount)

State Actions

AddChestItem - Adds an item to a given map chest. (Visible to all players). Usage: AddChestItem(Map ID, X coordinate, Y coordinate, Item ID, amount);

AddMapItem - Adds an item to a given map location. (Visible to all players). Usage: AddMapItem(Map ID, X coordinate, Y coordinate, Item ID, amount);

AddNpcChat - Used to add an Npc chat balloon during a given state (random chance). Usage: AddNpcChat(Npc Quest ID, "message string");

AddNpcInput - Used to add a link option in the dialog window. Usage: AddNpcInput(Npc Quest ID, Input ID, "message string");

AddNpcPM - Used to add a simple message to the dialog window. Usage: AddNpcPM("name string", "message string");

AddNpcText - Used to add a simple message to the dialog window. Usage: AddNpcText(Npc Quest ID, "message string");

EmptyChests - Removes all items in all chests on a given map. Usage: EmptyChests(Map ID);

End - Used to end a quest for good. Displays Quest on History as Completed. Usage: End();

GiveBankItem - Used to reward a player with an item stored directly to the players bank locker. Usage: GiveBankItem(Item ID, amount);

GiveExp - Used to reward a player with experience points. Usage: GiveExp(amount);

GiveItem - Used to reward a player with an item. Usage: GiveItem(Item ID, amount);

GiveKarma - Used to reward karma to a player. Usage: GiveKarma(amount);

GiveStat - Adds an amount to the given stat of the player. Usage: GiveStat(Stat, amount);

GiveRandomItem - Used to reward a player with an item chosed at random from a random bracket. Usage: GiveRandomItem(RandomBracketName);

Load Map Loads a map or alternate version of a map. Usage: LoadMap(Map ID); or LoadMap(Map ID, alias);

PlayEffect - Used to play a Special Effect on a player. Usage: PlayEffect(Effect ID);

PlaySound - Used to play a Sound Effect. Usage: PlaySound(Sound ID);

PlayMusic - Used to play a midi music file. Usage: PlayMusic(Music ID);

Quake - Used to create a earthquake on a single map. If no map is given, the earthquake is the current player's map. Usage: Quake(magnitude); or Quake(magnitude, map ID);*map ID may not be supported on all server software.

QuakeWorld - Used to call an earthquake to all maps. Quake(magnitude);

RemoveBankItem - Used to remove an item stored in the players bank locker. Usage: RemoveBankItem(Item ID, amount);

RemoveChestItem - Removes a certain item from all chests on a given map. Usage: RemoveChestItem(Map ID, Item ID, amount);

RemoveItem - Used to give an item to a quest Npc. Usage: RemoveItem(Item ID, amount);

RemoveKarma - Used to remove karma from a player. Usage: RemoveKarma(amount);

RemoveMapItems - Removes all items from the ground on a given map. Usage: RemoveMapItems(Map ID);

RemoveStat - Removes an amount to the given stat of the player. Usage: RemoveStat(Stat, amount);

Reset - Resets the current quest. Usage: Reset(); *Some servers allow for the parameters "daily" and "weekly" to be passed for time bound resets.

ResetDaily - Reseta the current quest back to the "begin" state while increasing the daily completion counter by one. Usage: ResetDaily();

ResetQuest - Resets the given quest. Usage: ResetQuest(Quest ID);

Roll - Generates a random number between 1 and the entered value. Some software allows if zero is desired, two arguments may be passed. Usage: Roll(number); or Usage: Roll(low number, high number);

StartQuest - Starts a quest if not active. Usage: StartQuest(Quest ID); SetClass - Used to change the class of a player. Usage: SetClass(Class ID);

SetCoord - Used to move a player to a given coordinate. Usage: SetCoord(Map ID, X position, Y position);

SetFiance - Used to set a player's fiance. Usage: SetFiance(Name);

SetHome - Used to set a player's home. Usage: SetHome(Home);

SetMap - Used to move a player to a given coordinate. Usage: SetMap(Map ID, X position, Y position);

SetPartner - Used to set a player's partner. Usage: SetPartner(Name);

SetRace - Used to change the race of a player. Usage: SetRace(Race ID);

SetStat - Used to set the given stat of a player to the given value. Usage: SetStat(Stat, value);

SetState - Used to force a state change in the event of no realistic rules. Usage: SetState("StateName");

SetTitle - Used to set a player's title. Usage: SetTitle(Title);

ShowHint - Used to show a hint message in the client's information bar. Usage: ShowHint("message string");


State Rules
Always - Satisfies the rule with no requirements to advance to the next quest state. Usage: Always();

ArenaWins - Requires a player to have won a given amount of rounds in the Arena mini-game. Usage: Arena(amount)

CheckDaily - Checks that a calendar day has passed since the quest state was entered. Usage: CheckDaily()

CitizenOf - Checks that a player is a citizen of a certain home town. Usage: CitizenOf(Home name)

Die - Checks if a player has died. Usage: Die() or Die(count)

Disconnected - Checks if a player has disconnected from the server(actual check occurs at login). Usage: Disconnected()

DoneDaily - Checks the number of times ResetDaily() has been called within a calendar day. Usage: DoneDaily(amount) goto NextStateName

EnterArea - checks the player has entered a range of tiles. Usage: EnterArea(Map ID, X coordinate, Y coordinate, radius)

EnterCoord - Requires a player to stand at a given coordinate to progress to the next state. Usage: EnterCoord(Map ID, X coordinate, Y coordinate)

EnterMap - Requires a player to enter a specific map to progress to the next state. Usage: EnterMap(Map ID)

FinishedQuest - Checks the given quest has been completed. Usage: FinishedQuest(QuestID)

GotItems - Requires an amount of items to progress to the next state. Usage: GotItems(Item ID, amount)

GotSpell - Requires a player to have learned a spell to progress to the next state. Usage: GotSpell(Spell ID)

HasKilled - Requires a player to have killed (lifetime total) a set amount of a specific NPC. Usage: HasKilled(NPC ID, Amount)

HasStepped - Requires a player to have stepped (lifetime total) a set amount of steps. Usage: HasStepped(amountmount)

InputNpc - Uses a link value to progress to the next state. Usage: InputNpc(Input ID)

IsClass - Checks a player is has a class ID matching the given ID. Usage: IsClass(ID);

IsGender - Checks a player's gender ID matches the given ID. Usage: IsGender(ID)

IsNamed - Checks a player's name matches the given name. Usage: IsNamed(name)

IsRace - Checks a player's race ID matches the given ID. Usage: IsRace(Race ID)

IsWearing - Checks a player's equipment for a match to the given ID. Usage: IsWearing(Item ID)

KilledNpcs - Requires an amount of Npcs to be killed before progressing to the next state. Usage: KilledNpcs(Npc ID, amount)

KilledPlayers - Requires an amount of Players to be killed (via player kill zones) before progressing to the next state. Usage: KilledPlayers(amount)

LeaveArea - checks the player has left a range of tiles. Usage: LeaveArea(Map ID, X coordinate, Y coordinate, radius)

LeaveCoord - Requires a player to leave a given coordinate to progress to the next state. Usage: LeaveCoord(Map ID, X coordinate, Y coordinate)

LeaveMap - Requires a player to leave a map to progress to the next state. Usage: LeaveMap(Map ID)

LostItems - Checks a players items to make sure the GotItems rule from the previous state is still true. Will return players to a previous state if the required items becomes less than needed. Usage: LostItems(Item ID, amount)

LostSpell - Checks a players spells to make sure the GotSpell rule from the previous state is still true. Will return players to a previous state if the required spell was forgotten. Usage: LostSpell(Spell ID)

NotWearing - Checks a player's equipment to verify the given item ID is not equipped. Usage: NotWearing(Item ID);

PickupFakeItem - Displays an item visible only to the player at a given location and checks when the item is picked up. Usage: PickupFakeItem(Map ID, X coordinate, Y coordinate, Item ID, amount);

PickupRandomItem - Displays an item at random coordinates selected from a random bracket only visible to the player and checks when the item is picked up. Usage: PickupRandomItem(RandomName, Item ID, amount);

Stepped - Checks the number of steps that a player has walked since entering the quest state. Usage: Stepped(amount);

StatBetween - Checks if the given stat is within the given range. Usage: StatBetween(Stat, low value, high value);

StatGreater - Checks if the given stat is greater than the given value. Usage: StatIs(Stat, value);

StatIs - Checks if the given stat is equal to the given value. Usage: StatIs(Stat, value);

StatLess - Checks if the given stat is less than the given value. Usage: StatIs(Stat, value);

StatNot - Checks if the given stat is not equal to the given value. Usage: StatIs(Stat, value);

StatRPN - Deprecated - Checks if the given RPN expression does not equal zero. Usage: StatRPN(stat, expression);

TimeElapsed - Checks the number of minutes have passed since the quest state had been entered. Usage: TimeElasped(time); *time format is a number + h, m, or s for hours, minutes, and seconds respectively. Unequipped - Checks a player's equipment that nothing is equipped. Usage: Unequipped();

UsedItem - Requires an amount of an item to be used to progress to the next state. Usage: UsedItem(Item ID, amount)

UsedSpell - Requires an amount of a spell to be used to progress to the next state. Usage: UsedSpell(Spell ID, amount)

TalkedToNpc - Requires only that a dialog window with a specific quest npc be opened to continue to the next state. Usage: TalkedToNpc(Npc Quest ID)

WaitMinutes - Checks that the given minutes have passed (less functionality than TimeElapsed). Usage: WaitMinutes(minutes)

WaitSeconds - Checks that the given seconds have passed (less functionality than TimeElapsed). Usage: WaitSeconds(seconds)


Stat Rule Type Modifiers
accuracy
agi
armor
cha
con
base_agi
base_cha
base_con
base_int
base_str
base_wis
evade
exp
goldbank
hp
int
level
mapid
maxhp
maxtp
maxsp
maxdam
maxweight
mindam
skillpoints
statpoints
str
tp
weight
wis
x
y

Stat Rule Type Modifiers (deprecated)
admin
bot
class
direction
gender
haircolor
hairstyle
hidden
karma
race
sitting
usage
whispers
Creating your own Actions/Rules



Creating new actions and rules can be accomplished typically by editing quest.cpp where you may reference similar actions and rules, however some rules are triggered throughout the EOSERV source code. It is recommended to avoid altering the source code unless you know what you are doing.

Happy Questing!!!
~Apollo