Active Effect - powerof3/PapyrusExtenderSSE GitHub Wiki

Functions

GetActiveEffectSpell

  • Returns the spell or form responsible for this active effect
Form Function GetActiveEffectSpell(ActiveMagicEffect akActiveEffect)  global native

GetScriptsAttachedToActiveEffect

  • Returns all scripts attached to this active effect.
String[] Function GetScriptsAttachedToActiveEffect(ActiveMagicEffect akActiveEffect) global native

IsScriptAttachedToActiveEffect

  • Returns whether the activeEffect has script attached. If scriptName is empty, it will return if the activeEffect has any non-base scripts attached
bool Function IsScriptAttachedToActiveEffect(ActiveMagicEffect akActiveEffect, String asScriptName) global native

Events

Called from PO3_Events_AME script. Script using these events must extend ActiveMagicEffect

Actor Fall Long Distance

  • Fires when the actor falls enough distance to take fall damage
Function RegisterForActorFallLongDistance(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForActorFallLongDistance(ActiveMagicEffect akActiveEffect) global native

Event OnActorFallLongDistance(Actor akTarget, float afFallDistance, float afFallDamage)
EndEvent

Actor Kill

Function RegisterForActorKilled(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForActorKilled(ActiveMagicEffect akActiveEffect) global native

Event OnActorKilled(Actor akVictim, Actor akKiller)
EndEvent

Actor Reanimate

  • Start fires when actor is reanimated and Stop when the reanimate effect is dispelled
Function RegisterForActorReanimateStart(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForActorReanimateStart(ActiveMagicEffect akActiveEffect) global native

Function RegisterForActorReanimateStop(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForActorReanimateStop(ActiveMagicEffect akActiveEffect) global native

Event OnActorReanimateStart(Actor akTarget, Actor akCaster)
EndEvent

Event OnActorReanimateStop(Actor akTarget, Actor akCaster)
EndEvent

Actor Resurrect

  • Fires when the target has been resurrected via script or console command
Function RegisterForActorResurrected(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForActorResurrected(ActiveMagicEffect akActiveEffect) global native

Event OnActorResurrected(Actor akTarget, bool abResetInventory)
EndEvent

Books Read

Function RegisterForBookRead(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForBookRead(ActiveMagicEffect akActiveEffect) global native

Event OnBookRead(Book akBook)
EndEvent

Cell Fully Loaded

  • Can fire multiple times in exteriors, for each cell that is fully loaded.
Function RegisterForCellFullyLoaded(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForCellFullyLoaded(ActiveMagicEffect akActiveEffect) global native

Event OnCellFullyLoaded(Cell akCell)
EndEvent

Critical Hit

  • Player only event
Function RegisterForCriticalHit(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForCriticalHit(ActiveMagicEffect akActiveEffect) global native

Event OnCriticalHit(Actor akAggressor, Weapon akWeapon, bool abSneakHit)
EndEvent

Disarmed

Function RegisterForDisarmed(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForDisarmed(ActiveMagicEffect akActiveEffect) global native

Event OnDisarmed(Actor akSource, Weapon akTarget)
EndEvent

Dragon Soul Absorb

Function RegisterForDragonSoulGained(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForDragonSoulGained(ActiveMagicEffect akActiveEffect) global native

Event OnDragonSoulGained(float afSouls)
EndEvent

On Hit Ex

  • Registers for hit events provided they match the filters (or not)
  • See Fallout 4's RegisterForHitEvent for parameter definitions (Aliases are not allowed, only forms)
  • akAggressorFilter also accepts race
Function RegisterForHitEventEx(ActiveMagicEffect akActiveEffect, Form akAggressorFilter = None, Form akSourceFilter = None, Form akProjectileFilter = None, int aiPowerFilter = -1, int aiSneakFilter = -1, int aiBashFilter = -1, int aiBlockFilter = -1, bool abMatch = true) global native	

Function UnregisterForHitEventEx(ActiveMagicEffect akActiveEffect, Form akAggressorFilter = None, Form akSourceFilter = None, Form akProjectileFilter = None, int aiPowerFilter = -1, int aiSneakFilter = -1, int aiBashFilter = -1, int aiBlockFilter = -1, bool abMatch = true) global native

Function UnregisterForAllHitEventsEx(ActiveMagicEffect akActiveEffect) global native
	
Event OnHitEx(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
EndEvent

Item Crafted

  • Player only event
Function RegisterForItemCrafted(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForItemCrafted(ActiveMagicEffect akActiveEffect) global native

Event OnItemCrafted(ObjectReference akBench, Location akLocation, Form akCreatedItem)
EndEvent

Item Harvested

  • Player only event
Function RegisterForItemHarvested(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForItemHarvested(ActiveMagicEffect akActiveEffect) global native

Event OnItemHarvested(Form akProduce)
EndEvent

Level Increase

Function RegisterForLevelIncrease(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForLevelIncrease(ActiveMagicEffect akActiveEffect) global native

Event OnLevelIncrease(int aiLevel)
EndEvent

Location Discovery

Function RegisterForLocationDiscovery(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForLocationDiscovery(ActiveMagicEffect akActiveEffect) global native

Event OnLocationDiscovery(String asRegionName, String asWorldspaceName)
EndEvent

Magic Effect Apply Ex

  • akEffectFilter : matching magic effect, keyword, or a formlist containing keywords/magic effects. Filter can be NONE (but then it'll be the same as a regular OnMagicApply event)
  • abMatch : if true, the filter must match the hit, if false it must NOT match it (inverted filter)
  • bApplied will return if the magic effect was successfully applied or not
Function RegisterForMagicEffectApplyEx(ActiveMagicEffect akActiveEffect, Form akEffectFilter, bool abMatch) global native	
Function UnregisterForMagicEffectApplyEx(ActiveMagicEffect akActiveEffect, Form akEffectFilter, bool abMatch) global native
Function UnregisterForAllMagicEffectApplyEx(ActiveMagicEffect akActiveEffect) global native
	
Event OnMagicEffectApplyEx(ObjectReference akCaster, MagicEffect akEffect, Form akSource, bool abApplied)
EndEvent

Object Grab/Release

  • Doesn't work with telekinesis and when the player grabs the same object in a row
Function RegisterForObjectGrab(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForObjectGrab(ActiveMagicEffect akActiveEffect) global native

Event OnObjectGrab(ObjectReference akObjectRef)
EndEvent

Event OnObjectRelease(ObjectReference akObjectRef)
EndEvent

Object Loaded/Unloaded

  • Not all objects fire this event. It is somewhat inconsistent.
Function RegisterForObjectLoaded(ActiveMagicEffect akActiveEffect, int formType) global native	
Function UnregisterForObjectLoaded(ActiveMagicEffect akActiveEffect, int formType) global native
Function UnregisterForAllObjectsLoaded(ActiveMagicEffect akActiveEffect) global native
	
Event OnObjectLoaded(ObjectReference akRef, int aiFormType)
EndEvent

Event OnObjectUnloaded(ObjectReference akRef, int aiFormType)
EndEvent

On Weapon Hit

  • Event OnHit except weapons only AND the aggressor receives this event for each target hit by it
  • Use SKSE's LogicalAnd to check if hit flag is set
  • Statics have no hit flags (0)
Hit Flags Values
kBlocked 1
kBlockWithWeapon 2
kBlockCandidate 4
kCritical 8
kCriticalOnDeath 16
kFatal 32
kDismemberLimb 64
kExplodeLimb 128
kCrippleLimb 256
kDisarm 512
kDisableWeapon 1024
kSneakAttack 2048
kIgnoreCritical 4096
kPredictDamage 8192
kBash 16384
kTimedBash 32768
kPowerAttack 65536
kMeleeAttack 262144
kRicochet 524288
kExplosion 1048576
Function RegisterForWeaponHit(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForWeaponHit(ActiveMagicEffect akActiveEffect) global native
	
Event OnWeaponHit(ObjectReference akTarget, Form akSource, Projectile akProjectile, Int aiHitFlagMask)
EndEvent

On Magic Hit

  • Event OnHit except for magic AND aggressor recieves this event for each target hit by it
Function RegisterForMagicHit(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForMagicHit(ActiveMagicEffect akActiveEffect) global native
	
Event OnMagicHit(ObjectReference akTarget, Form akSource, Projectile akProjectile)
EndEvent

On Projectile Hit

  • Event OnHit except for projectiles AND the aggressor recieves this event for each target hit by it
Function RegisterForProjectileHit(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForProjectileHit(ActiveMagicEffect akActiveEffect) global native
	
Event OnProjectileHit(ObjectReference akTarget, Form akSource, Projectile akProjectile)
EndEvent

Quest Start/Stop

Function RegisterForQuest(ActiveMagicEffect akActiveEffect, Quest akQuest) global native	
Function UnregisterForQuest(ActiveMagicEffect akActiveEffect, Quest akQuest) global native
Function UnregisterForAllQuests(ActiveMagicEffect akActiveEffect) global native

Event OnQuestStart(Quest akQuest)
EndEvent

Event OnQuestStop(Quest akQuest)
EndEvent

Quest Stage Change

Function RegisterForQuestStage(ActiveMagicEffect akActiveEffect, Quest akQuest) global native	
Function UnregisterForQuestStage(ActiveMagicEffect akActiveEffect, Quest akQuest) global native
Function UnregisterForAllQuestStages(ActiveMagicEffect akActiveEffect) global native

Event OnQuestStageChange(Quest akQuest, Int aiNewStage)
EndEvent

Shout Attack

  • Player only event
Function RegisterForShoutAttack(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForShoutAttack(ActiveMagicEffect akActiveEffect) global native

Event OnPlayerShoutAttack(Shout akShout)
EndEvent

Skill Increase

  • 4.5.6 - Event had its params changed from String to Int as a workaround for only the first registered event recieving any events
  • See Actor Values for list of skills
Function RegisterForSkillIncrease(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForSkillIncrease(ActiveMagicEffect akActiveEffect) global native

Event OnSkillIncrease(Int aiSkill)
EndEvent

Soul Trap

  • Event will fire after OnDying/OnDeath
  • Will not fire if using mods that bypass vanilla soul trap method
Function RegisterForSoulTrapped(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForSoulTrapped(ActiveMagicEffect akActiveEffect) global native
	
Event OnSoulTrapped(Actor akVictim, Actor akKiller)
EndEvent

Spell Learned

  • Event is disabled in AE due to crashes
Function RegisterForSpellLearned(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForSpellLearned(ActiveMagicEffect akActiveEffect) global native
	
Event OnSpellLearned(Spell akSpell)
EndEvent

Weather Change

Function RegisterForWeatherChange(ActiveMagicEffect akActiveEffect) global native	
Function UnregisterForWeatherChange(ActiveMagicEffect akActiveEffect) global native
	
Event OnWeatherChange(Weather akOldWeather, Weather akNewWeather)
EndEvent