×
Меню
Индекс

MSFD Adding and removing spells and cursing 

 
AddSpell, "SpellID"         
RemoveSpell, "SpellID"         
 
     "Actor_ID"->AddSpell "Absorb Speed"
 
The AddSpell function will add the spell to the calling object. This can mean two things: normal spells are added to the actor's spell list. Curses, diseases etc, however will affect the calling object. The same is true for the RemoveSpell function: Normal spells are removed from the list, curses or diseases are removed as effects.
 
Note:
When you add a spell to a generic NPC, it is added to all NPCs of that ID - unlike items, which are just added to the one NPC.
 
Some general notes:
You can not remove racial abilities with the RemoveSpell function (forum info). You can remove birthsign abilities, but if the ability was added by the player's birthsign (i.e. during character generation, not later by script), the ability cannot be re-added afterwards (forum info / Rocket).
 
(Mainly relevant for companions:) Any type of constant magical effect (e.g. abilities, CE enchanted items, etc) on an NPC is reapplied when the NPC changes cells, and when it gets high enough it "wraps around" and usually starts working in reverse. Much of the time this is not noticeable, but if necessary the problem can be avoided by removing and re-adding the effect on CellChanged. In the case of some effects, e.g. water breathing, the game may remove the effect too many times: in this case SetWaterBreathing can be used (note that it must be reset after 72 game hours).  (Forum info / CdCooley).
 
Abilities may sometimes not work as expected. If an ability is removed by script, it may sometimes reappear after reloading a save, or later in the game. Effects on the character's stats may also reappear or not be removed properly on occasion (forum info / exclusiveor77). The other problem with abilities is that damage abilities do permanent damage (i.e. a damage health ability damages maximum health: curses do not have this problem). This does not seem to be true of drain or fortify effects, where it would make a lot more sense. (Forum info / ManaUser)
 
Curses do, however, have the problem that they can be removed by "Remove Curse" spells.
 
On the Remove Curse effect, in my tests it worked but somewhat strangely. It's percentile (like dispel rather than cure paralysis) but the percent seemed to be cumulative or something. For example a 1% remove curse spell never worked (as many times as I tested it) unless I first cast something like a 100% remove curse spell. -(ManaUser)