From The Mana World
Revision as of 03:47, 9 January 2008 by Crush (talk | contribs) (draft for new monster.xml)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This article is currently only a proposal

The features or design guidelines described in this article are only a proposal made by one or some persons. It has not been evaluated or accepted by the core development team yet. Feel free to add your personal opinion about them or make counter proposals.

Outdated template, please use Template:Status Under Construction to mark pages as unfinished. TODO: Create complete examle entry

This is a draft for the new XML-based monster database which is shared between the new server and the new client.

    <monster id="1" name="Maggot" targetCursor="small">
        <sprite>monster-maggot.xml</sprite>
        <sound event="hit">maggot-hit1.ogg</sound>
        <sound event="hit">maggot-hit2.ogg</sound>
        <sound event="die">maggot-dying1.ogg</sound>
        <drop item="505" percent="8"/>
        <drop item="518" percent="4"/>
        <drop item="501" percent="1.5"/>
        <drop item="533" percent="1.5"/>
        <drop item="502" percent="0.7"/>
        <drop item="522" percent="0.1"/>
    </monster>

"required" means that the tag/attribute MUST be defined. "recommended" means that the tag/attribute can be omitted but it is usually not advisable to do so. "optional" means that the tag/attribute is not necessary in every case.

"Client" means that the tag/attribute is client-sided and can be omitted from the server file. "Server" means that it is server-sided and should be omitted from the client file to avoid spoilers. "Client+Server" means that the information is used by both the server and the client and has to be identical.

monster

One monster entry in the database.

id
(Client+Server, required) Unique monster type ID used to identify the monster type in the netcode.
name
(Client, recommended) Name that is displayed when the monster is targeted.
targetCursor
(Client, recommended) Size of the target cursor.

sprite

(Client, recommended) The sprite definition file which is used as a graphical representation of the sprite (relative to data/graphics/sprites). There should only be one sprite tag for each monster.

sound

(Client, optional)

event
(required) The situation in which the sound is played. Possible values are "hit" (the monster attacks), "hurt" (the monster is hit by an attack) and "die" (the monster dies).

A sound file relative to data/sfx which is played at various events related to the monster. There may be any number of effect tags. When there are multiple sound tags for the same event a random one of them is played.

drop

(Server, optional)

item
(required) ID number of the dropped item as listed in items.xml
percent
(required) Probability of item drop in percent.

An item the monster can drop when it is defeated. Every monster can have an infinite amount of drops.

attributes

(Server, required) The character attributes of the monster. The basic attributes like strength, vitality and so on are derived from these attributes instead of the other way around like it is done for player characters. It is easier for the server administrator to assign reasonable attributes to the monsters when doing it this way. All properties are required.

hp
Initial and maximum hit points of the monster.
size
Radius of the bounding circle of the monster in pixels.
speed
Movement speed of the monster.
attack-min
Minimal damage of attacks with a damage factor ot "1"
attack-delta
Difference between minimal and maximal damage of attacks with a damage factor ot "1"
hit
Hit accuracy of physical attacks
evade
Evade accuracy against physical attacks
physical-defence
Defence against physical attacks
magical-defence
Defence against magical attacks

element-damage

(server, optional) Damage factors for elemental damage. All elements are optional. When an element is omitted it is assumed to be 1.0 (normal damage):

fire
water
earth
air

exp

(Server, recommended) Experience reward for defeating the monster.

behavior

(Server, required) General behavior of the monster AI

script
(optional) Filename of a Lua script that controls the monsters behavior. Should only be used for rare monsters to reduce server load. (makes all other tags unnecessary)
aggressive
(required) Does the monster attack without being provoked? Values are "true" or "false".
aggression-range
(required when aggressive="true") Distance the monster tracks enemies in in tiles.
cowardly
(required) Does the monster flee when attacked? Values are "true" or "false". Combining aggressive="true" with cowardly="true" results in a monster that uses hit&run tactics (attacks unprovoked and flees when the target fights back).
attack-distance
Prefered distance to the enemy the monster tries to reach when in combat (horizontal or vertical)

attack

(Client+Server, optional) An attack the monster can perform. A monster can have multiple different attacks.

id
(client+server, required) Id number of the attack (unique for each monster) used to identify the monster type in the netcode.
priority
(server, optional) How likely the monster is to perform this attack when it got multiple attacks.
type
(server, required) Type of attack. Values are "physical" and "magical".
pre-delay
(server, required) Delay in game ticks between the decision to perform this attack and performing it.
aft-delay
(server, required) Delay in game ticks after the attack until the monster can act again.
damage-factor
(server, required) Multiplier applied to minimal and maximal damage as they have been calculated by using the monster attributes.
range
(server, required) Range of the attack.
angle
(server, required) Angle of effect of the attack.
animation
(client, recommended) Animation that is played when the monster uses this attack.
particle-effect
(client, optional) Particle effect that is initialized when the monster uses this attack.