%scriptUsurp()

Aliases%scriptUsurp( )
Parametersmixed @owner, string @name [, @param1 [, @param2 [, ...]]]

    This function is "almost" exactly like the %scriptCall() function with one
extremely useful difference. This runs the script owned by the owner
entity which has the given name BUT when the script is run all commands
are processed as though the entity calling the script were the actual
owner of the script. This is useful because you could share an entire
combat system in a script which is then invoked via %scriptUsurp() and
thus processed as though the script had been defined for the entity
itself. The parameters are passed to the script and assume the variable
names the script itself sets out for them. This function is used in
conjunction with the catch_call_script trigger type which is described in
the triggers documentation. This combination is powerful but you may be
looking for the solution provided by the %scriptCall() function which your
are STRONGLY advised to read about now. Note that if the script returns a
value you can retrieve it by assigning the value of the running the
function.

Example:

%scriptUsurp( @n, "guardCombat" )