enderalse/scripts/source/_00e_phasmalist_trinketsc.psc

49 lines
1.6 KiB
Plaintext

Scriptname _00E_Phasmalist_TrinketSC extends ObjectReference
; script on all phasmalist trinkets
_00E_Phasmalist_ApparationSC Property connectedApparation auto
_FS_Phasmalist_ControlQuest Property controlQuest auto
int Property type auto ; what kind of apparation this one is, used to control arcane fever
{0 = Warrior, 1 = Archer, 2 = Mage, 3 = Hybrid}
Message Property chooseCombatStyle auto
FormList Property combatStyles auto
_00E_Phasmalist_ApparationAlias Property apparationAlias auto
bool hasAskedForCustomization = false
int usedCombatStyle
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
controlQuest.forceInventoryContainerLoad(connectedApparation.inventoryContainer)
If (akNewContainer == Game.GetPlayer() && !hasAskedForCustomization)
controlQuest.OnPlayerTrinketCreated()
hasAskedForCustomization = true
modifyApparation()
EndIf
Endevent
Event OnEquipped(Actor akActor)
apparationAlias.onTrinketEquipped(self)
Endevent
Event OnUnequipped(Actor akActor)
apparationAlias.onTrinketUnequipped(self)
Endevent
function modifyApparation()
usedCombatStyle = chooseCombatStyle.show()
Actor ApparitionActor = (apparationAlias as ReferenceAlias).GetActorReference()
If ApparitionActor != None
ApparitionActor.StopCombat()
ApparitionActor.GetActorBase().setCombatStyle(getUsedCombatStyle())
EndIf
Endfunction
CombatStyle function getUsedCombatStyle()
return combatStyles.getAt(usedCombatStyle) as CombatStyle
Endfunction
bool Function isConfiguredMelee()
return usedCombatStyle == 0 || usedCombatStyle == 1
EndFunction