×
Меню
Индекс

MSFD Managing and testing for spells

 
GetSpell, "Spell_ID"     (returns Boolean/short)
 
     If ( Player->GetSpell, "heal companion" == 1 )
 
Returns true if object has Spell_ID in inventory. However, this does not work for abilities or powers associated with race or birthsign. Sample script see below.
 
GetSpellEffects, "Spell_ID"     (returns Boolean/short)    
 
     if ( Player->GetSpellEffects, "flame" == 1 )
 
Returns true if Spell_ID is affecting calling object. The following could be added to the "trap_script" discussed under "casting spells" above:
 
 
if ( Player->GetSpellEffects, "flame" == 1 )
     MessageBox "You have been flamed"
endif
 
This is the favorite possibility of adding new "spell effects". A dummy spell is created that does some minimal effect, e.g. raising luck by 1 point for 1 second. The GetSpellEffects function is used to detect if that spell has been cast on the player, and the script handles everything else. Sample script see below.
 
GetSpellEffects does work for race or birthsign abilities and powers (with of course the proviso that the power is currently affecting the calling object).
 
RemoveSpellEffects, "Spell_ID"
 
Player->RemoveSpellEffects, "flame"
 
Removes the effects of Spell_ID from the player. This makes it even more useful for scripted spells.
 
if ( Player->GetSpellEffects, "flame" == 1 )
     player->RemoveSpellEffects, "flame"
     ;do what you want here
endif