Jump to content

Remove shield enchantment with a two handed weapon


AngEviL

Recommended Posts

I'm working on rebalancing Oblivion and I want to either:

1) Remove the enchantment provided by the shield when it's not used, like with a two handed weapon. In this case the armor rating of the shield is gone, but the enchantment on it is still active, so i want to remove the enchantment as well.

or

2) Detect when the shield is used, like with a one handed weapon, and active, and give the player something like 5% magic boost. When the shield is taken off, like when the weapon is unequipped, or when it is switched to a two-handed weapon, then that bonus dissapears.

 

EDIT: fixed it myself by creating a global script. I know it can be made more efficient and compact but it's good enough for me.

 

ref Weapon

set Weapon to player.GetEquippedObject 16

set WeaponType to GetWeaponType Weapon

set ShieldPresent to Player.IsShieldOut

Set BlockSkill to player.getav Block

 

if (WeaponType != PrevWeaponType ) || (BlockSkill != PrevBlockSkill ) || (ShieldPresent != PrevShieldPresent)

 

if (WeaponType == 0) || (WeaponType == 2)

player.RemoveSpell ShieldWeakness1

if (ShieldPresent == 1)

if (BlockSkill == 100)

player.RemoveSpell ShieldResists00

player.RemoveSpell ShieldResists25

player.RemoveSpell ShieldResists50

player.RemoveSpell ShieldResists75

player.AddSpell ShieldResists100

elseif (BlockSkill > 74)

player.RemoveSpell ShieldResists00

player.RemoveSpell ShieldResists25

player.RemoveSpell ShieldResists50

player.RemoveSpell ShieldResists100

player.AddSpell ShieldResists75

elseif (BlockSkill > 49)

player.RemoveSpell ShieldResists00

player.RemoveSpell ShieldResists25

player.RemoveSpell ShieldResists75

player.RemoveSpell ShieldResists100

player.AddSpell ShieldResists50

elseif (BlockSkill > 24)

player.RemoveSpell ShieldResists00

player.RemoveSpell ShieldResists50

player.RemoveSpell ShieldResists75

player.RemoveSpell ShieldResists100

player.AddSpell ShieldResists25

elseif (BlockSkill > 0)

player.RemoveSpell ShieldResists25

player.RemoveSpell ShieldResists50

player.RemoveSpell ShieldResists75

player.RemoveSpell ShieldResists100

player.AddSpell ShieldResists00

else

player.RemoveSpell ShieldResists00

player.RemoveSpell ShieldResists25

player.RemoveSpell ShieldResists50

player.RemoveSpell ShieldResists75

player.RemoveSpell ShieldResists100

endif

elseif (WeaponType == 1) || (WeaponType == 3) || (WeaponType == 4) || (WeaponType == 5)

player.RemoveSpell ShieldResists00

player.RemoveSpell ShieldResists25

player.RemoveSpell ShieldResists50

player.RemoveSpell ShieldResists75

player.RemoveSpell ShieldResists100

player.AddSpell ShieldWeakness1

else

player.RemoveSpell ShieldResists00

player.RemoveSpell ShieldResists25

player.RemoveSpell ShieldResists50

player.RemoveSpell ShieldResists75

player.RemoveSpell ShieldResists100

player.RemoveSpell ShieldWeakness1

endif

 

Set PrevWeaponType to WeaponType

Set PrevBlockSkill to BlockSkill

Set PrevShieldPresent to ShieldPresent

endif

Edited by AngEviL
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...