Atrinik Server  4.0


Monsters, or sometimes referred to as mobiles (mobs), are objects of type monster. They can be both NPCs in town if they have friendly flag set, or just monsters in dungeons.

Monsters are what makes the game fun and enjoyable to play. Enemy monsters will chase a player if they detect his presence, and if the player kills them, they will drop a corpse with loot, if they were high enough level to give experience to the player.

Experience from monsters

When player kills an enemy monster, they give experience based on their experience value and whether they were high enough level for the player.

This is determined by their color level, which is determined by the difference of levels between the monster and the player.

Enemy detection

The monster code uses some functions to find enemy creatures, including:

The monster will also check if the enemy it has found with the above functions can be seen using obj_in_line_of_sight() function, which makes use of Bresenham's line algorithm.

Movement and attack types

A monster can have different movement and/or attack types. Those are used to give different behavior to monsters when moving or attacking.

Movement type of monster is stored in object::move_type, while attack type is stored in object::attack_move_type.

See Also
Monster movements