Alias - powerof3/PapyrusExtenderSSE GitHub Wiki

Functions

Getters

IsScriptAttachedToAlias

  • Returns whether the form has script attached. If scriptName is empty, it will return if the alias has any non-base scripts attached
bool Function IsScriptAttachedToAlias(Alias akAlias, String asScriptName) global native

Events

  • Called from PO3_Events_Alias script.
  • Scripts using these events must extend Alias or ReferenceAlias

Actor Fall Long Distance

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

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

Actor Kill

Function RegisterForActorKilled(ReferenceAlias akRefAlias) global native	
Function UnregisterForActorKilled(ReferenceAlias akRefAlias) 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(ReferenceAlias akRefAlias) global native	
Function UnregisterForActorReanimateStart(ReferenceAlias akRefAlias) global native

Function RegisterForActorReanimateStop(ReferenceAlias akRefAlias) global native	
Function UnregisterForActorReanimateStop(ReferenceAlias akRefAlias) 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(ReferenceAlias akRefAlias) global native	
Function UnregisterForActorResurrected(ReferenceAlias akRefAlias) global native

Event OnActorResurrected(Actor akTarget, bool abResetInventory)
EndEvent

Books Read

Function RegisterForBookRead(Alias akAlias) global native	
Function UnregisterForBookRead(Alias akAlias) 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(Alias akAlias) global native	
Function UnregisterForCellFullyLoaded(Alias akAlias) global native

Event OnCellFullyLoaded(Cell akCell)
EndEvent

Critical Hit

Function RegisterForCriticalHit(Alias akAlias) global native	
Function UnregisterForCriticalHit(Alias akAlias) global native

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

Disarmed

Function RegisterForDisarmed(Alias akAlias) global native	
Function UnregisterForDisarmed(Alias akAlias) global native

Event OnDisarmed(Actor akSource, Weapon akTarget)
EndEvent

Dragon Soul Absorb

Function RegisterForDragonSoulGained(Alias akAlias) global native	
Function UnregisterForDragonSoulGained(Alias akAlias) global native

Event OnDragonSoulGained(float afSouls)
EndEvent

OnHitEx

  • 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(ReferenceAlias akRefAlias, 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(ReferenceAlias akRefAlias, 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(ReferenceAlias akRefAlias) global native
	
Event OnHitEx(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
EndEvent

Item Crafted

Function RegisterForItemCrafted(Alias akAlias) global native	
Function UnregisterForItemCrafted(Alias akAlias) global native

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

Item Harvested

Function RegisterForItemHarvested(Alias akAlias) global native	
Function UnregisterForItemHarvested(Alias akAlias) global native

Event OnItemHarvested(Form akProduce)
EndEvent

Level Increase

Function RegisterForLevelIncrease(Alias akAlias) global native	
Function UnregisterForLevelIncrease(Alias akAlias) global native

Event OnLevelIncrease(int aiLevel)
EndEvent

Location Discovery

Function RegisterForLocationDiscovery(Alias akAlias) global native	
Function UnregisterForLocationDiscovery(Alias akAlias) global native

Event OnLocationDiscovery(String asRegionName, String asWorldspaceName)
EndEvent

MagicEffectApplyEx

  • 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(ReferenceAlias akRefAlias, Form akEffectFilter, bool abMatch) global native	
Function UnregisterForMagicEffectApplyEx(ReferenceAlias akRefAlias, Form akEffectFilter, bool abMatch) global native
Function UnregisterForAllMagicEffectApplyEx(ReferenceAlias akRefAlias) 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(Alias akAlias) global native	
Function UnregisterForObjectGrab(Alias akAlias) 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(Alias akAlias, int formType) global native	
Function UnregisterForObjectLoaded(Alias akAlias, int formType) global native
Function UnregisterForAllObjectsLoaded(Alias akAlias) global native
	
Event OnObjectLoaded(ObjectReference akRef, int aiFormType)
EndEvent

Event OnObjectUnloaded(ObjectReference akRef, int aiFormType)
EndEvent

OnWeaponHit

  • Event OnHit except weapons only AND the aggressor recieves this event for each target hit by it
  • Use SKSE's LogicalAnd to check if 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(ReferenceAlias akRefAlias) global native	
Function UnregisterForWeaponHit(ReferenceAlias akRefAlias) 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(ReferenceAlias akRefAlias) global native	
Function UnregisterForMagicHit(ReferenceAlias akRefAlias) 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(ReferenceAlias akRefAlias) global native	
Function UnregisterForProjectileHit(ReferenceAlias akRefAlias) global native
	
Event OnProjectileHit(ObjectReference akTarget, Form akSource, Projectile akProjectile)
EndEvent

Quest Start/Stop

Function RegisterForQuest(Alias akAlias, Quest akQuest) global native	
Function UnregisterForQuest(Alias akAlias, Quest akQuest) global native
Function UnregisterForAllQuests(Alias akAlias) global native

Event OnQuestStart(Quest akQuest)
EndEvent

Event OnQuestStop(Quest akQuest)
EndEvent

Quest Stage Change

Function RegisterForQuestStage(Alias akAlias, Quest akQuest) global native	
Function UnregisterForQuestStage(Alias akAlias, Quest akQuest) global native
Function UnregisterForAllQuestStages(Alias akAlias) global native

Event OnQuestStageChange(Quest akQuest, Int aiNewStage)
EndEvent

Shout Attack

  • Player only event
Function RegisterForShoutAttack(Alias akAlias) global native	
Function UnregisterForShoutAttack(Alias akAlias) 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(Alias akAlias) global native	
Function UnregisterForSkillIncrease(Alias akAlias) global native

Event OnSkillIncrease(Int aiSkill)
EndEvent

Soul Trap

  • Event will fire after OnDying/OnDeath
Function RegisterForSoulTrapped(Alias akAlias) global native	
Function UnregisterForSoulTrapped(Alias akAlias) global native
	
Event OnSoulTrapped(Actor akVictim, Actor akKiller)
EndEvent

Spell Learned

Function RegisterForSpellLearned(Alias akAlias) global native	
Function UnregisterForSpellLearned(Alias akAlias) global native
	
Event OnSpellLearned(Spell akSpell)
EndEvent

Weather Change

Function RegisterForWeatherChange(Alias akAlias) global native	
Function UnregisterForWeatherChange(Alias akAlias) global native
	
Event OnWeatherChange(Weather akOldWeather, Weather akNewWeather)
EndEvent