SetPermanent() public method

Makes the spell effect permanent.
public SetPermanent ( bool NewVal ) : void
NewVal bool
return void
Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
 public override bool EquipEvent(int slotNo)
 {
     if ((slotNo == 9) || (slotNo == 10))
     {
         if (objInt.isEnchanted == true)
         {
             //cast enchantment.
             SpellEffectApplied = playerUW.PlayerMagic.CastEnchantment(playerUW.gameObject, null, GetActualSpellIndex(), Magic.SpellRule_TargetSelf);
             if (SpellEffectApplied != null)
             {
                 SpellEffectApplied.SetPermanent(true);
             }
         }
     }
     return(true);
 }
Exemplo n.º 3
0
 public override bool EquipEvent(int slotNo)
 {
     if ((slotNo ==9) || (slotNo ==10))
     {
         if (objInt().isEnchanted==true)
         {
             //cast enchantment.
             SpellEffectApplied = GameWorldController.instance.playerUW.PlayerMagic.CastEnchantment(GameWorldController.instance.playerUW.gameObject,null,GetActualSpellIndex(),Magic.SpellRule_TargetSelf);
             if (SpellEffectApplied!=null)
             {
                 SpellEffectApplied.SetPermanent(true);
             }
         }
     }
     return true;
 }
Exemplo n.º 4
0
    public override bool EquipEvent(short slotNo)
    {
        if ((slotNo == 9) || (slotNo == 10))
        {
            if (objInt().isEnchanted == true)
            {
                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);
                    }
                    break;
                }
                }
            }
        }
        return(true);
    }
Exemplo n.º 5
0
    public override bool EquipEvent(int slotNo)
    {
        if ((slotNo >= 0) && (slotNo <= 4))      //Gloves, chest,legging,boots and helm
        {
            UpdateQuality();
            if (objInt.isEnchanted == true)
            {
                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 = 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 = EffectId - 471;
                    break;

                default:
                    //cast enchantment.
                    SpellEffectApplied = playerUW.PlayerMagic.CastEnchantment(playerUW.gameObject, null, GetActualSpellIndex(), Magic.SpellRule_TargetSelf);
                    if (SpellEffectApplied != null)
                    {
                        SpellEffectApplied.SetPermanent(true);
                    }
                    break;
                }
            }
        }
        return(true);
    }
Exemplo n.º 6
0
    public override bool EquipEvent(int slotNo)
    {
        if (((slotNo ==7) && (GameWorldController.instance.playerUW.isLefty==true)) || ((slotNo ==8) && (GameWorldController.instance.playerUW.isLefty==false)))//Only on off hand
        {
            UpdateQuality();
            if (objInt().isEnchanted==true)
            {
                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=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=EffectId-471;
                    break;

                default:
                    //cast enchantment.
                    SpellEffectApplied = GameWorldController.instance.playerUW.PlayerMagic.CastEnchantment(GameWorldController.instance.playerUW.gameObject,null,GetActualSpellIndex(),Magic.SpellRule_TargetSelf);
                    if (SpellEffectApplied!=null)
                    {
                        SpellEffectApplied.SetPermanent(true);
                    }
                    break;
                }
            }
        }
        return true;
    }
Exemplo n.º 7
0
    public override bool EquipEvent(short slotNo)
    {
        if (((slotNo == 7) && (UWCharacter.Instance.isLefty == true)) || ((slotNo == 8) && (UWCharacter.Instance.isLefty == false)))  //Only on off hand
        {
            UpdateQuality();
            if (objInt().isEnchanted() == true)
            {
                switch (_RES)
                {
                case GAME_UW2:
                {
                    int EffectId = GetActualSpellIndex();
                    switch (EffectId)
                    {
                    case SpellEffect.UW2_Spell_Effect_MinorProtection:
                    case SpellEffect.UW2_Spell_Effect_Protection:
                    case SpellEffect.UW2_Spell_Effect_AdditionalProtection:
                    case SpellEffect.UW2_Spell_Effect_MajorProtection:
                    case SpellEffect.UW2_Spell_Effect_GreatProtection:
                    case SpellEffect.UW2_Spell_Effect_VeryGreatProtection:
                    case SpellEffect.UW2_Spell_Effect_TremendousProtection:
                    case SpellEffect.UW2_Spell_Effect_UnsurpassedProtection:
                        break;

                    case SpellEffect.UW2_Spell_Effect_MinorToughness:
                    case SpellEffect.UW2_Spell_Effect_Toughness:
                    case SpellEffect.UW2_Spell_Effect_AdditionalToughness:
                    case SpellEffect.UW2_Spell_Effect_MajorToughness:
                    case SpellEffect.UW2_Spell_Effect_GreatToughness:
                    case SpellEffect.UW2_Spell_Effect_VeryGreatToughness:
                    case SpellEffect.UW2_Spell_Effect_TremendousToughness:
                    case SpellEffect.UW2_Spell_Effect_UnsurpassedToughness:
                        break;

                    default:
                        //cast enchantment.
                        SpellEffectApplied = UWCharacter.Instance.PlayerMagic.CastEnchantment(UWCharacter.Instance.gameObject, null, GetActualSpellIndex(), Magic.SpellRule_TargetSelf);
                        if (SpellEffectApplied != null)
                        {
                            SpellEffectApplied.SetPermanent(true);
                        }
                        break;
                    }
                    break;
                }


                default:
                {
                    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);
                        if (SpellEffectApplied != null)
                        {
                            SpellEffectApplied.SetPermanent(true);
                        }
                        break;
                    }
                    break;
                }
                }
            }
        }
        return(true);
    }