Removing Memorized spells
vonstorm
Member Posts: 66
Is there a function for removing memorized spells of a PC? I've taken a look through the functions and it doesn't seem that there is. I'm trying to remove all memorized spells from a PC so they cannot cast again until they have rested. Any pointers much appreciated.
0
Comments
// Decrement the remaining uses per day for this creature by one.
// - oCreature: creature to modify
// - nSpell: constant SPELL_*
void DecrementRemainingSpellUses(object oCreature, int nSpell)
I haven't used it yet though.
I like @NeverwinterWights idea, except for trying to decrement each spell by ID and only by one. Maybe that would be okay if you only have a few spells that you don't want them to be able to use until next rest.
// visual effect eVFX; // Apply a visual effect. eVFX = EffectVisualEffect(VFX_FNF_DECK); ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oPC); // Apply some effects. eEffect = ExtraordinaryEffect(EffectAbilityDecrease(ABILITY_INTELLIGENCE, 12)); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oPC, 60.0); eEffect = ExtraordinaryEffect(EffectAbilityDecrease(ABILITY_STRENGTH, 12)); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oPC, 60.0); eEffect = ExtraordinaryEffect(EffectAbilityDecrease(ABILITY_WISDOM, 12)); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oPC, 60.0); eEffect = ExtraordinaryEffect(EffectAbilityDecrease(ABILITY_CHARISMA, 12)); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oPC, 60.0); }If I use DURATION_TYPE_PERMANENT does this reset on rest?
//Remove all spells void main() { //0 to 698? Need to further narrow down spells. This does not include epic spells. object oPC = GetLastUsedBy();//Define PC. I just used a test placeable if (!GetIsPC(oPC)) return; int iCheck; int iSpell = 0; while (iSpell <= 698) { iCheck = GetHasSpell(iSpell, oPC); if (iCheck) { SendMessageToPC(oPC, "You have spell #" + IntToString(iSpell)); while (iCheck) { DecrementRemainingSpellUses(oPC, iSpell); iCheck--; } } iSpell++; } }Quick tested. Removes most spells. Not epic though. Need to nail down the spell numbers a bit. I just grabbed a range from "nwscript".