Monster

Parent: build

Functions used for building monsters (obj/monster.lpc). Refer to
http://swlpc.sourceforge.net/doc/build/monster

for the official functions.

Inherits baseobjectfunctions

The following functions are extra functions.

set_roommove
Allows a monster to wonder around a room. 'Dist' is how far the monster will travel at 'freq' time in interval. To add a random distance on top of 'dist' specify 'randist' and will add 0-'randist' to dist. Likewise for 0- 'randfreq' time will be added 'freq'.

set_roommove(dist,freq,randdist, randfreq);

In the following example the monster will move in a random direction 0.3 mud units every 5 seconds:
set_roommove(0.3,5);

set_actionwheninit
Will cause a monster to peform as action randomly between 0-'withintime' seconds when a player walks into the room.

set_actionwheninit(action, withintime)

For example a cat with the following function will 'meow' sometime within 60 seconds.

set_actionwheninit("meow",60);

set_attackresponse
Is how a monster will respond to being attacked. 'Arg' is the action that monster will perform when attacked and 'Arg2' is what the monster will do each attack cycle:

set_attackresponse(arg,arg2);

Arg2 is an array of number between 0 and 5 where
0 is attack
1 is dodge
2 is either
3 attack forever
4 dodge forerver
5 either forerver

In the following example when attacked the monster would say 'You asshole!'. He will then attack in 2 attack cycles but dodge for the remaining and then stop fighting until attacked again:

set_attackresponse("say You asshole!!",(({0,0,1,1,1,1,1})));

Another example is:

set_attackresponse("",(({3})));

which means the monster will attack forever while the attacker is in the room.