Jump to content

[LE] Scrolls req. skill or cost magicka


Recommended Posts

ideally skill req would match the level of spell on scroll. if not, have scrolls seperated by the schools, requiring some skill of the associated school to use. perhaps have scrolls cost magicka to use. would go good with challenging spell learning mod

 

Any help is appreciated. beyond maybe adding a keyword to each scroll to seperate them by the different schools of magic im not sure how to go about this.

 

 

Link to comment
Share on other sites

Because of so many scrolls and you want to make that player specific, it would be a good idea:

1. to create a new quest (before adding an alias save your work)

2. to add a alias inside and "assign to unique player"

3. to attach next script to the player alias (do not forget to compile -> make a pex file)

4. save your mod file

5. make your mod file (esp) active in mod list

6. do not forget to activate ingame debugging to show debug output in "papyrus.0.log"

7. start Skyrim, play a bit with scrolls to find out which event triggers by using scrolls

8. look at the debug output file and now adjust the script to reach your aim

like keywords and/or formlists, manacosts

 

hhhPlayerAliasScrollScript

 

Scriptname hhhPlayerAliasScrollScript extends ReferenceAlias
; https://forums.nexusmods.com/index.php?/topic/8453103-scrolls-req-skill-or-cost-magicka/

; -- properties --

  Keyword PROPERTY mySpecialKeyowrd auto    ; just a sample


; -- EVENTs --

; Event received when a spell is cast by this object
EVENT OnSpellCast(Form akSpell)
    Debug.Trace("hhhScroll: OnSpellCast() - with  akSpell = " +akSpell)
ENDEVENT


; Event received when a magic affect is being applied to this object
EVENT OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect)
; this is only working for scrolls that have a spell which has the caster and target as common
    IF (akCaster == self.GetReference())
        Debug.Trace("hhhScroll: OnMagicEffectApply() - with  akEffect = " +akEffect+ ", IsFriendly == " +!akEffect.IsHostile())
    ENDIF
ENDEVENT


; Event received when this object is hit by a source (weapon, spell, explosion) or projectile attack
EVENT OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
; this is only working for scrolls that have a spell which has the caster and target as common
    IF (akAggressor = self.GetReference())
        Debug.Trace("hhhScroll: OnHit() - with  akSource = " +akSource+ ", akProjectile = " +akProjectile+ ", IsScroll == " +(akSource as Scroll))
    ENDIF
ENDEVENT


; Event received when an item is removed from this objects inventory. If the item is a persistant reference, akItemReference
; will point at it - otherwise the parameter will be None
EVENT OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
    IF (akBaseItem as Scroll) && (aiItemCount == 1)
        Debug.Trace("hhhScroll: OnItemRemove() - with  akBaseItem = " +akBaseItem+ ", akDestContainer = " +akDestContainer)
    ENDIF
ENDEVENT

 

 

Edited by ReDragon2013
Link to comment
Share on other sites

  • Recently Browsing   0 members

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