enderalse/source/scripts/playerhorsescript.psc

32 lines
836 B
Plaintext
Raw Normal View History

Scriptname PlayerHorseScript extends ReferenceAlias
Event OnDeath(Actor akKiller)
MySelf = GetActorReference()
2024-01-23 15:16:40 +00:00
_00E_HorseOwned.SetValue(0 as float)
EndEvent
Event OnUnload()
If MySelf.IsDead()
; disable the dead horse if it is unloaded
MySelf.Disable()
MySelf.Delete()
(GetOwningQuest() as _00E_NQ06_Functions).sHorseName = ""
; added a new horse that can be bought at the stables
Myself = StablesPosition.PlaceActorAtMe(LvlHorseSaddled)
Alias_HorseRef.ForceRefTo(MySelf)
2024-01-23 15:16:40 +00:00
Alias_HorseRef.GetReference().SetFactionOwner(StablesFaction)
EndIf
EndEvent
Actor Property MySelf Auto
ObjectReference Property StablesPosition Auto
ActorBase Property LvlHorseSaddled Auto
ReferenceAlias Property Alias_HorseRef Auto
Faction Property StablesFaction Auto
GlobalVariable Property _00E_HorseOwned Auto