ErikRedbeard Posted March 22, 2012 Share Posted March 22, 2012 I've been working on a little addon that makes some spells a toggle.I've managed to make spells toggleable but the problem arises when the Mage Armor perk gets involved as it uses different magic effects. My question is how do I enable the Mage Armor perks to apply and remove when an armor spell is toggled? It seems it always applies when the spell is cast and I've managed to create a script that checks the togglemagearmorglobal if it's a specific number and else dispell the effect (script down below for those that are interested). Status so far:Candlelight - WorkingWaterBreathing - WorkingFlame Cloak - WorkingFrost Cloak - WorkingLightning Cloak - WorkingMuffle - WorkingInvisibility - WorkingMage Armors - WorkingMage Armor Perk - Not Working What I did:Create global in Miscellaneous/GlobalAdd script togglespell to magiceffectAdd properties example:togglespellglobal - GlobalVariable - togglemagearmorglobaltogglespelleffect - MagicEffect - ArmorFFSelf0 Other Info:The Mage Armors spells (Oakflesh and such) all use togglemagearmorglobal as their togglespellglobal Scripts:togglespell - added to the magiceffects of Oak-, Stone-, Iron- and Ebonyflesh.import GlobalVariable Event OnEffectStart(Actor akTarget, Actor akCaster) if (togglespellglobal.getValue() == 0.0) togglespellglobal.setValue(1.0) elseif (togglespellglobal.getValue() == 1.0) togglespellglobal.setValue(2.0) self.dispel() endif EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) if (togglespellglobal.getValue() == 2.0) togglespellglobal.setValue(0.0) endif if (Game.getPlayer().hasMagicEffect(togglespelleffect)!=1) togglespellglobal.setValue(0.0) endif EndEvent MagicEffect Property togglespelleffect Auto GlobalVariable Property togglespellglobal Auto togglespellperk - added to the magiceffects of the Mage Armor Perk.import GlobalVariable Event OnEffectStart(Actor akTarget, Actor akCaster) if (togglespellglobal.getValue() != 1.0) self.dispel() endif EndEvent GlobalVariable Property togglespellglobal Auto Link to comment Share on other sites More sharing options...
Recommended Posts