Command System
Introduction
The command system is a script system which allows you to script your own commands. This can be done in the command folder which is included in the EOSource download folder. The amount of commands is unlimited and is very easy to use. Here is a little guide about how to work with the command script system.

The Command Header
Main
{
	commandname =	"reborn"

	type = "player"
}

All commands must start with a header, the commandname describes the name of the command which you should type to activate the command. the type checks what the type is. In this case the type is: Player, but if you want it to be for admins the type should be admin.

Calling
Calls are used to make the command do something. Like making it announce something, giving the player an item, warping someone to a location and such. A list of calls can be found below.

List of calls.

  • call GiveItem(id, amount);
  • call RemoveItem(id, amount);
  • call GiveExp(amount);
  • call SetExp(amount);
  • call GiveSpell(id);
  • call PlaySound(id);
  • call Warp(mapid,x,y);
  • call SetGender(id);
  • call SetClass(id);
  • call SetHairStyle(id);
  • call SetHairColor(id);
  • call SetAdmin(id);
  • call SetPartner(id);
  • call SetHome(id);
  • call QuestBox("title", "text");
  • call InfoBox("title", "text");
  • call SetTitle("text");
  • call SetRace(id);
  • call SetName("Name");
  • call Quake(strength, map/world);
  • call SetStats("str / int / wis / agi / con / cha", amount);
  • call ShowMessage("message", "announcement / servermessage / showhint / privatemessage / publicmessage");

Victim support
In order to use these commands on victims simply add a new comma and add a 3rd argument saying victim. Which should look like this: GiveItem(arguments[1], arguments[2], victim); So when you create a command let's say: #award and use that call you can type like: #award hollow 1 50. Then the user hollow will be awarded with 50 gold. This works with every call! More calls and checks may be added in the near future.

Command Checks
Checks are used to check if a player has, is or does something to continue to the next step. An example of a check is to check if a player's level is 200 to go to the next step. If this is not the case than it will break immediatly. A check can also be compared with an 'if' if level 200 is not true than it will go to the 'else' else if it is not true than it can for example show a warn message. This is optional and can be done in all checks but is not needed. This works like this: check Level(200, "You are not level 200."); This means that if you aren't level 200 that it will shwo the message: You are not level 200.

List of checks.

  • check Item(id, amount);
  • check Level(amount);
  • check Reborn(amount);
  • check Stripped(FailMessage);
  • check Admin(id);
  • check Class(name);
  • check Home(name);
  • check Partner(name);
  • check Spell(id);
  • check Name(name);
  • check Race(id);
  • check Location(mapid,x,y);

As you've seen earlier this guide you can add messages to let a player know if a check returns false by doing check checkname(checkhere, "message here"); but this is optional and not needed.

Arguments
You can use arguments in any call by putting the input as "arguments[1], aruments[2], arguments[3]".For Example:
Main
{
	commandname =	"sitem"
	type = "admin"
	
	call giveitem(arguments[1], arguments[2]);
}

A complete command
This is an example #reborn command made with cmf+ the reborn command checks if you are level 200, If that's the case it will set your level and exp to 0 and give you 1 reborn. It will also announce an earthquake on the map and shows a servermessage and kick the character.

Main
{
	commandname =	"reborn"
	type = "player"

	check level(200, "You need level 200 to reborn.");
	call setlevel(0);
	call setexp(0);
	call givereborn(1);
	call characterservermsg("You have reborned, Congratulations!");
	call quake(8, map);
}