Jump to content

Light emitting shields


MercerMeka

Recommended Posts

Yes, the "shieldgiven" variable is to prevent adding a shield everytime you start a dialog. For adding more shields use the second parameter of AddItem function.

 

And for script which uses OnEquip event and timer the answer is also yes, as long it's attached.

Link to comment
Share on other sites

Oh yeah good you said that. 2 shops adds more than 1 shield. So would the script look like this:

scn VendorShieldScript

ref vendor
short shieldgiven

begin MenuMode 1009
   if shieldgiven == 0
      set vendor to GetMerchantContainer
      if vendor != 0 && player.GetLevel >= 15
         vendor.AddItem DaedricShield 1
      if vendor != 0 && player.GetLevel >= 20
         vendor.AddItem DaedricShield2 1
         set shieldgiven to 1
       endif
      endif
   endif
end

 

Link to comment
Share on other sites

No, for every new type you will need its own "flag":

scn VendorShieldScript

ref vendor
short shieldgiven
short shieldgiven2

begin MenuMode 1009
   if shieldgiven == 0 || shieldgiven2 == 0
      set vendor to GetMerchantContainer
      if vendor != 0
         if shieldgiven == 0 && player.GetLevel >= 15
            vendor.AddItem DaedricShield 1 ;one shield
            set shieldgiven to 1
         endif
         if shieldgiven2 == 0 && player.GetLevel >= 20
            vendor.AddItem DaedricShield2 2 ;two shields (example)
            set shieldgiven2 to 1
         endif
      endif
   endif
end
Link to comment
Share on other sites

Oh okay. So 3 shields from the same vendor would be:

scn VendorShieldScript

ref vendor
short shieldgiven
short shieldgiven2
short shieldgiven3

begin MenuMode 1009
   if shieldgiven == 0 || shieldgiven2 == 0 || shieldgiven3 == 0
      set vendor to GetMerchantContainer
      if vendor != 0
         if shieldgiven == 0 && player.GetLevel >= 15
            vendor.AddItem DaedricShield 1 ;one shield
            set shieldgiven to 1
         endif
         if shieldgiven2 == 0 && player.GetLevel >= 20
            vendor.AddItem DaedricShield2 1
            set shieldgiven2 to 1
         if shieldgiven3 == 0 && player.GetLevel >= 25
          vendor.AddItem DaedricShield3 1 
           set shieldgiven3 to 1
             endif
         endif
      endif
   endif
end

 

Link to comment
Share on other sites

Oh I see it. So it's...

scn VendorShieldScript

ref vendor
short shieldgiven
short shieldgiven2
short shieldgiven3

begin MenuMode 1009
   if shieldgiven == 0 || shieldgiven2 == 0 || shieldgiven3 == 0
      set vendor to GetMerchantContainer
      if vendor != 0
         if shieldgiven == 0 && player.GetLevel >= 15
            vendor.AddItem DaedricShield 1 ;one shield
            set shieldgiven to 1
         endif
         if shieldgiven2 == 0 && player.GetLevel >= 20
            vendor.AddItem DaedricShield2 1
            set shieldgiven2 to 1
          endif
         if shieldgiven3 == 0 && player.GetLevel >= 25
          vendor.AddItem DaedricShield3 1 
           set shieldgiven3 to 1
             endif
         endif
      endif
 
end

Also, while testing my shields I found that it would be nice from a gameplay perspective if the Light ability was "on" when using the shield (the whole fight) while the other ability would only be active when actually blocking (player.IsBlocking).

I was thinking if the script with 3 second delay could have 2 abilities in it instead of one. One with delay and one which activates only when player.IsBlocking.

I'm starting to feel like I've probably asked for too much by now :tongue: I've gotten more than I could hope for already, so this is the last request :whistling:

Here's the script:

scn ShieldOfLightScript

short nospell
short equipped
float timer

begin OnEquip player
   set equipped to 1
end

begin OnUnequip player
   set equipped to 0
end

begin GameMode
   if equipped != 0 && IsControlPressed 6 != 0 && player.HasSpell AbShieldLight == 0
      player.AddSpellNS AbShieldLight
      set nospell to 0
      set timer to 3
   endif
   if eval (equipped == 0 || IsControlPressed 6 == 0) && player.HasSpell AbShieldLight != 0
      set nospell to 1
   endif
   if nospell != 0
      if timer <= 0
        player.RemoveSpellNS AbShieldLight
        set nospell to 0
      else 
        if equipped != 0 && IsControlPressed 6 != 0 ;shield equipped and block is pressed again
           set nospell to 0 ;reset spell removal
           set timer to 3
        else
           set timer to timer - GetSecondsPassed
        endif
      endif
   endif
end
Edited by MercerMeka
Link to comment
Share on other sites

Propably most practical solution would be checking, if weapon is also out. What about this:

scn ShieldOfLightScript

short nospell
short equipped
float timer

begin OnEquip player
   set equipped to 1
end

begin OnUnequip player
   set equipped to 0
end

begin GameMode
   ;triggering abilities	
   if equipped != 0 && IsControlPressed 6 != 0 && player.HasSpell AbShieldLight == 0
      player.AddSpellNS AbShieldLight
      set nospell to 0
      set timer to 3
   endif
   if equipped != 0 && player.IsBlocking && player.HasSpell AbAnimalResistFrost == 0
      player.AddSpellNS AbAnimalResistFrost
      Message "Battle ability added."
   endif
   ;remove light
   if player.IsWeaponOut == 0 && IsControlPressed 6 == 0 && player.HasSpell AbShieldLight != 0
      set nospell to 1
   endif
   if equipped == 0 && player.HasSpell AbShieldLight != 0
      set nospell to 1
   endif
   if nospell != 0
      if timer <= 0
        player.RemoveSpellNS AbShieldLight
        set nospell to 0
      else 
        if equipped != 0 && IsControlPressed 6 != 0 ;shield equipped and block is pressed again
           set nospell to 0 ;reset spell removal
           set timer to 3
        else
           set timer to timer - GetSecondsPassed
        endif
      endif
   endif
   ;remove battle ability
   if eval (equipped == 0 || player.IsBlocking == 0) && player.HasSpell AbAnimalResistFrost != 0
      player.RemoveSpellNS AbAnimalResistFrost
      Message "Battle ability removed."
   endif
end

This time the light will prevail until you sheathe weapon and then disappear after 3s. And while you actively blocking with shield or weapon, you will be also 20% resistant to frost (I used already defined ability in Oblivion). Unequipping a shield will also remove the light after 3s and "battle" ability.

Edited by RomanR
Link to comment
Share on other sites

I like the idea of checking if the weapon is out. I just tested it and If I block just once I get a lot of "Battle ability added" & "Battle ability Removed" messages flickering at the top of the screen.

I tried switching both abilities to my own ones and got same result.

I tried having weapon and shield out and hitting with and without holding block.

Edited by MercerMeka
Link to comment
Share on other sites

They are only test messages, you can remove them. I used them because that ability used have no visual effect and I was lazy to go into active magic effects list everytime to check it. Flickering is because messages go into a queue and Oblivion is trying to show them all.

Link to comment
Share on other sites

Well. I've been at it for a couple of hours and your script works. However, whenever I change the 2 abilities to my own custom abilities the script doesn't work. Nothing happens in-game when I test it.

I really cannot understand what I'm missing. I use the CS function to replace the abilities so I don't make typos.

I should be able to use any abilities right? And call the script anything?

The only time I got the script to work was when creating a new shield and new ability and keeping the "AbAnimalResistFrost" ability in the script.

Any ideas of dumb mistakes I could be making?

 

EDIT: OK it seems if I make all new shields all new abilities and all new scripts then it works. Hours of work ahead :pinch:

Edited by MercerMeka
Link to comment
Share on other sites

  • Recently Browsing   0 members

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