Difference between revisions of "MUDL:Every round"

From SlothMUD Wiki
Jump to: navigation, search
(Command Syntax)
Line 10: Line 10:
  
 
<pre>
 
<pre>
addproc &lt;room|mobile|object&gt; mudl
+
addproc &lt;mobile&gt; mudl
setproc &lt;room|mobile|object&gt; ## every_round
+
setproc &lt;mobile&gt; ## every_round
 
</pre>
 
</pre>
 
  
 
= Global Variables =
 
= Global Variables =

Revision as of 18:11, 11 March 2016

Overview

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


Command Syntax

addproc <mobile> mudl
setproc <mobile> ## 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