Atrinik Server 4.0
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.
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.
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.
A monster can have different movement and/or attack types. Those are used to give different behavior to monsters when moving or attacking.