Difference between revisions of "MUDL:is spell damage cold"
From SlothMUD Wiki
					
										
					
					|  (Created page with " __TOC__   = Summary =  {|class="abilitiestable" border="0" cellspacing="0" cellpadding="0" ! Function Name | is_spell_damage_cold |- ! Settable | No |- ! Returns | Boolean |}...") | |||
| Line 30: | Line 30: | ||
| <pre> | <pre> | ||
| setproc <parent> # intercept_cast_i | setproc <parent> # intercept_cast_i | ||
| − | # If not  | + | # If not cold, fail the spell | 
| if (is_pc(%a) AND !is_spell_damage_cold(%1), | if (is_pc(%a) AND !is_spell_damage_cold(%1), | ||
| ( | ( | ||
Latest revision as of 23:54, 7 November 2018
Summary
| Function Name | is_spell_damage_cold | 
|---|---|
| Settable | No | 
| Returns | Boolean | 
| Parameter Options | 
|---|
| Spell (integer or string) | 
This function returns True if the specified spell deals fire damage that can be reduced via the 'resist cold' spell and False otherwise.
Example
setproc <parent> # intercept_cast_i
# If not cold, fail the spell
if (is_pc(%a) AND !is_spell_damage_cold(%1),
(
    msg_character(%a, 'Your spell fizzles!'),
    # Stop future processing of this command
    set(flag(%f, 'procedure-flags', 'overrode-command'), true),
    return(true)
)),
return(false)
@
setproc <parent> # PROC_ENABLED 1
