MUDL:Every round

From WikiName
Revision as of 17:35, 11 March 2016 by Teker (talk | contribs)
Jump to: navigation, search

Overview

This MUDL function gets called each combat round for mobiles in combat.


Command Syntax

addproc <room|mobile|object> mudl
setproc <room|mobile|object> ## every_round


Global Variables

The following global variables are available:

Name Type Description
 %c Character The mobile that the MUDL script is attached to.


Return Values

The return value from this function is ignored.


Triggered Scripts

Only mobile scripts are triggered by this event. They are triggered after the mobile has made its normal attacks for the round.


Example

addproc <mobile> mudl
setproc <mobile> 0 every_round

foreach(pc_in_room(room(%c)), %1,
    if(position(%c) = 'fighting' AND 1d100 < 35),
    (
        msg_character(%1, ''+short(%c)+' growls and scratches you with its claws!'),
        msg_character(%1, 'You feel unlucky.'),
        msg_everyone_else(%1, ''+short(%c)+' growls and scratches '+short(%1)+' with its claws!'),
        affect(%1,'curse','level=42 location=hitroll modifier=-2 duration=2'),
        affect(%1,'curse','level=42 location=dex modifier=-1 duration=2'),

        if(affected_by_spell(%1, 'disease'),(),
            affect(%1,'disease','level=42 location=disease_clumsy duration=10')),
            set(hp(%1), hp(%1) - 3d3 + 25)
        )
    )
)
@


setproc <mobile> 0 PROC_ENABLED 1
compile