EO+ was designed to be a simple 'script language' based on states, actions and rules. Basically an EO+ script is a text file, loaded by the gameserver, which has a buildin safe enviroment to execute all the instructions given inside the script.
At launch time the gameserver scans for all scripts inside its /quest directory, parses the syntax and creates all needed objects into memory, from that point the server doesnt access the script files anymore to gain speed.
The moment a player logs on its current quests get loaded into memory and the needed event hooks are attached to the things the player has to do. If a RULE of the quest was satisfied the engine will attach the next state, execute its actions, dettach all the old RULEs events, and attach the new event codes.
Finally all quest progress gets saves into database again, to allow the player to continue the quest at a later time. The quest engine can keep track up to 20 quest at the same time, so the player is able to work on multiple quests if he/she wants to.
Inside the game itself we created some information windows that can show the player which quests he/she has started, and in what state. So the player knows what he/she is supposed to do to make the quest advance into a next state.
Here is a code example of a valid EO+ script, that can be loaded into the gameserver, it uses simple code:
Main
{
questname "Pjedro's Potion Quest"
version 2.0
}
state Begin
{
desc "Talk to Pjedro"
action AddNpcText( 1 , "Hello , I am pjedro the only wizzard" );
action AddNpcText( 1 , "I really need some green potions..");
action AddNpcChat( 1 , "Please help me find 10 green potions?");
action AddNpcInput( 1 , 1 , "No, this stuff scares me");
action AddNpcInput( 1 , 2 , "Sure, i will help you");
rule InputNpc( 1 ) goto Lose
rule InputNpc( 2 ) goto FindPotions
}
state FindPotions
{
desc "Find 10 green potions"
rule GotItems( 'green potion' , 10 ) goto GetReward
}
state GetReward
{
desc "Talk to Pjedro for reward"
action ShowHint("You got all the items needed!");
action AddNpcText( 1 , "Did you find my green potions?");
action AddNpcInput( 1 , 1 , "No thank you, find your own");
action AddNpcInput( 1 , 2 , "Sure, here you are");
rule InputNpc( 1 ) goto Lose;
rule InputNpc( 2 ) goto Reward;
rule LostItems( 'green potion' , 10 ) goto FindPotions
}
state Reward{
action RemoveItem( 'green potion' , 10)
action GiveItem( 'juewel ring' );
action Reset();
}
state Lose{
action ShowHint("You are a coward!");
action Reset();
}