Complete Example Scripts: Difference between revisions

Jump to navigation Jump to search
Added DServant's example of adding abilities through shouting.
imported>Qqqbbb
imported>Terra Nova2
(Added DServant's example of adding abilities through shouting.)
Line 767: Line 767:
EndFunction</source>
EndFunction</source>


== Adding a spell when you shout ==
[http://forums.bethsoft.com/topic/1507702-adding-a-spell-when-you-shout/#entry23774668 Created by a modder named DServant]. The way this works, is when you use a shout, an ability is added. This will work while in combat or outside of it.
<source lang=papyrus>
Scriptname DSerFireBreathMonitorScript extends activemagiceffect 
Spell Property YourAbility Auto
Event OnEffectStart(Actor akTarget, Actor akCaster)
RegisterForAnimationEvent(Game.GetPlayer(), "BeginCastVoice")
Debug.Notification("Waiting on Shout")
EndEvent
Event OnAnimationEvent(ObjectReference akSource, string asEventName)
if (akSource == Game.GetPlayer()) && (asEventName == "BeginCastVoice")
Debug.Notification("Fire Breath Shout Cast")
Game.GetPlayer().AddSpell(YourAbility,false)
Utility.Wait(10)
Game.GetPlayer().RemoveSpell(YourAbility)
EndIf
EndEvent
</source>
{{Languages}}
{{Languages}}
[[Category: Papyrus]]
[[Category: Papyrus]]
Anonymous user

Navigation menu