Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

Latest commit

 

History

History
557 lines (483 loc) · 16.9 KB

monsters.xml.md

File metadata and controls

557 lines (483 loc) · 16.9 KB
title layout
monsters.xml
wiki

{% include toc.md %}

monsters.xml file configuration

Data from the monsters.xml file are used to set up configuration values about every computered related beings the players will encounter during the online experience.

The monsters.xml file has to be located in the data directory.

Each configuration option in this xml file, is defined using a <monster> tag within the <monster**s**> main node, which itself has got an <attributes> child node, and some others. Here is an example:

{% highlight xml %}

  <exp>10</exp>
</monster>
{% endhighlight %}

Note: This file can be used by both the client and the server if the necessary data is provided. That's why we provide options for both applications here for simplification and easier documentation purpose. But when you should be careful to provide only the client data when dealing with client configuration, or the players will more information about the monsters than they should actually have.

General (Client and server) nodes description

<monsters> node description

The &lt;monsters&gt; node is the monsters.xml file main node and permits to determine monsters definition start and ending. This node has only one parameter for now, offset, which is added to all the monster IDs. It defaults to 1002 for the TmwAthena protocol, for backwards compatibility with older clients, which did it automatically in the netcode.

This node is required by both the client and the server.

{% highlight xml %}

... {% endhighlight %}

<monster> node description

The &lt;monster&gt; node is used to define the different values used to bring a specific monster up to life within the game. Each monster's definition is then defined within its start and ending tags.

This node is required by both the client and the server.

{% highlight xml %}

... ... {% endhighlight %}
Parameter name Type Mandatory Default value Description
id integer Yes   It is the id of the monster. This parameter has to be unique for each monster.
The system will use the monster id to refer on it in many ways.
name string No "unnamed" Tells the monster name. Used to ease configuration on server and with the client
but displayed to players on the client side.
targetCursor string
defined value
No "normal" Used by the client only. Tells which circle cursor size should be use when displaying the target cursor around the monster sprite while in game. It mainly depends on the sprite's pixel size.
Acceptable values are:
small
normal
large

<attack> node description

See Attack Node Configuration

Server nodes description

<attributes> node description

The &lt;attributes&gt; node is used to define the current monster main necessary attributes. These shouldn't be left in the client version.

This node is required by the server, and will be ignored by the client.

{% highlight xml %}

... ... {% endhighlight %}
Parameter name Type Mandatory Default value Description
hp integer Yes   The monster hit points.
size integer No 16 The monster maximal amplitude in pixels. Used to compute player's hit area.
speed float No 4.0 The monster's speed in tiles per second.
(A tile is the smallest square map unit: by default, a tile is 32 pixel long.)
attack-min integer Yes   The minimal attack strength of the monster. If your character hasn't got any armor,
these are the minimal hit points he/she will lose when hit by the monster.
attack-delta integer Yes   The amplitude between minimal and maximal damages the monster can do.
attack-magic integer Yes  
mutation integer No 0 The mutation indicates the amplitude in percent where attributes get modified with.
For instance, with a mutation of 50, each attribute can be altered to become 100% to 149% of what they are. A value \&lt; 0 or \&gt; 99 will be ignored.
gender string No unspecified The gender of the monster. Valid values are: "male", "female", "unspecified". This information has no effect on the behaviour of the being. But if a gender is set the client can display this gender.

<behavior> node description

The &lt;behavior&gt; node is used to define the monster's way to move and think when dealing with players interaction. These values shouldn't be left in the client version.

This node is required by the server, and will be ignored by the client.

{% highlight xml %}

... ... {% endhighlight %}
Parameter name Type Mandatory Default value Description
aggressive boolean
true/false
Yes   Defines if the given monster will attack the player as soon as it see them.
If set to "false", the monster only starts to attack its opponent once it received the first damages.
cowardly boolean
true/false
Yes   Defines if the monster will start to flee the battle once its HP are becoming low.
**Note:** FIXME: Not implemented yet.
track-range integer Yes   Distance in tiles the monster tracks enemies in (pathfinding algorithmn is used for calculating distance).
stroll-range integer Yes   Distance in pixels the being chooses new destinations in when not fighting (as when wandering).
attack-distance integer Yes   Preferred distance in pixels to the enemy the monster tries to reach when in combat (horizontal or vertical). Used for range attackers, for instance. A value of 32 means a close combat range when your tiles side length are 32 pixels wide.
script file name No "" Filename of a script that controls the monsters behavior. Should only be used for rare monsters to reduce server load. (Providing this file makes all the other tags unnecessary). The script filename must be relative to the `data/scripts` directory.

<exp> node description

The &lt;exp&gt; node is used to define the reward points for defeating a monster. See the experience documentation for further details. These values shouldn't be left in the client version.

This node is optional but recommended for the server, and will be ignored by the client.

{% highlight xml %}

150 ... ... {% endhighlight %}
Type Mandatory Default value Description
integer No 0 Tells how much experience points a monster is giving upon victory.

<drop> node description

The &lt;drop&gt; node is used to define items dropped after defeating a monster. See the items.xml documentation for further details. There can be multiple <drop> nodes for one monster. These values shouldn't be left in the client version.

This node is optional but recommended for the server, and will be ignored by the client.

{% highlight xml %}

... ... {% endhighlight %}
Parameter name Type Mandatory Default value Description
item integer Yes   Tells the drop item Id taken into your [items.xml](items.xml.html) file.
percent float Yes   Tells the chance (8.0 = 8%) to see the drop be spanwed on the map floor after the monster's death.

<script> node description

The &lt;script&gt; node is used to define the monster through a whole script.

This node is optional for the server, and will be ignored by the client.

{% highlight xml %}

<script>mymonster.lua</script> ... ... {% endhighlight %}
Type Mandatory Default value Description
string
filename
Yes   The script filename to be used for the given monster.
The script filename must be relative to the `data/scripts` directory.

<vulnerability> node description

The &lt;vulnerability&gt; node is used to define the current monster vulnerabilities, or on the opposite strength against one or several magical elements. These values shouldn't be left in the client version.

This node is optional for the server, and will be ignored by the client.

{% highlight xml %}

... ... {% endhighlight %}
Parameter name Type Mandatory Default value Description
element string Yes "" Tells to which element the weakness or the strength is. ('fire', 'earth', 'ice', 'metal' are some examples.)
factor float Yes "" Tells how much the recieved damage is reduced (example values: 0 would mean no damange is dealt at all, 1 means damage is left unchanged, 2 would mean double damage)

Client nodes description

<sprite> node description

The &lt;sprite&gt; node is used to define the monster sprite used to be displayed by the client.

This node is unused by the server, optional but very recommended for the client.

{% highlight xml %}

monsters/my-monster.xml ... ... {% endhighlight %}
Type Mandatory Default value Description
xml filename Yes "" Tells the xml file used to display the monster sprites. (Used by the Mana Client only).
The given file must be relative to the `data/graphics/sprites` directory.

<sound> node description

The &lt;sound&gt; nodes are used to define the monster sounds played on certain monster's events.

This node is unused by the server, and optional for the client.

{% highlight xml %}

monsters/maggot/maggot-hit1.ogg monsters/maggot/maggot-hit2.ogg monsters/maggot/maggot-miss1.ogg ... ... {% endhighlight %}
Parameter name Type Mandatory Default value Description
event string
defined keywords
Yes   Tells the event at which the corresponding sound should be played.
Available events are:
'die', 'miss', 'hit', 'strike', 'dodge'.
There can be several sounds nodes and so, events for one monster. The same event can even be set multiple times. The given sounds are played randomly in this case.