SpellEffect.SetPermanent C# (CSharp) Method

SetPermanent() public method

Makes the spell effect permanent.
public SetPermanent ( bool NewVal ) : void
NewVal bool
return void
    public void SetPermanent(bool NewVal)
    {
        Permanent=NewVal;
    }

Usage Example

    public override bool EquipEvent(short slotNo)
    {
        if ((slotNo >= 0) && (slotNo <= 4))      //Gloves, chest,legging,boots and helm
        {
            UpdateQuality();
            if ((objInt().isEnchanted == true) || ((_RES == GAME_UW1) && (item_id == 47)))
            {            //Is magic or the dragonskin boots
                int EffectId = GetActualSpellIndex();
                switch (EffectId)
                {
                case SpellEffect.UW1_Spell_Effect_MinorProtection:
                case SpellEffect.UW1_Spell_Effect_Protection:
                case SpellEffect.UW1_Spell_Effect_AdditionalProtection:
                case SpellEffect.UW1_Spell_Effect_MajorProtection:
                case SpellEffect.UW1_Spell_Effect_GreatProtection:
                case SpellEffect.UW1_Spell_Effect_VeryGreatProtection:
                case SpellEffect.UW1_Spell_Effect_TremendousProtection:
                case SpellEffect.UW1_Spell_Effect_UnsurpassedProtection:
                    //ProtectionBonus=(short)(EffectId-463);
                    break;

                case SpellEffect.UW1_Spell_Effect_MinorToughness:
                case SpellEffect.UW1_Spell_Effect_Toughness:
                case SpellEffect.UW1_Spell_Effect_AdditionalToughness:
                case SpellEffect.UW1_Spell_Effect_MajorToughness:
                case SpellEffect.UW1_Spell_Effect_GreatToughness:
                case SpellEffect.UW1_Spell_Effect_VeryGreatToughness:
                case SpellEffect.UW1_Spell_Effect_TremendousToughness:
                case SpellEffect.UW1_Spell_Effect_UnsurpassedToughness:
                    //ToughnessBonus=(short)(EffectId-471);
                    break;

                default:
                    //cast enchantment.
                    SpellEffectApplied = UWCharacter.Instance.PlayerMagic.CastEnchantment(UWCharacter.Instance.gameObject, null, GetActualSpellIndex(), Magic.SpellRule_TargetSelf, Magic.SpellRule_Equipable);
                    if (SpellEffectApplied != null)
                    {
                        SpellEffectApplied.SetPermanent(true);
                    }
                    else
                    {
                        Debug.Log(this.name + " was unable to apply effect. " + GetActualSpellIndex());
                    }
                    break;
                }
            }
        }
        return(true);
    }
All Usage Examples Of SpellEffect::SetPermanent