enderalse/source/scripts/_00e_heromenualias.psc

232 lines
10 KiB
Plaintext
Raw Normal View History

Scriptname _00E_HeroMenuAlias extends ReferenceAlias Hidden
{This script is unused, hero menu handling has been moved to DLL in 2.1+.}
int function _GetScriptVersion() Global
return 1
endFunction
Event OnInit()
InitializeActorValueInfos()
RegisterForModEvent("Enderal_OpenHeroMenu", "OnHeroMenuRequest")
EndEvent
Event OnPlayerLoadGame()
if GetState() != ""
GotoState("")
endif
RegisterForModEvent("Enderal_OpenHeroMenu", "OnHeroMenuRequest")
EndEvent
Event OnHeroMenuRequest(string eventName, string strArg = "", float numArg = 0.0, Form sender = None)
; OnHeroMenuRequest refuses to compile in other states
if GetState() == ""
GotoState("TryToOpen")
endif
EndEvent
state TryToOpen
Event OnBeginState()
If (! Utility.IsInMenuMode() || UI.IsMenuOpen("TweenMenu")) && ! UI.IsTextInputEnabled()
GotoState("Active")
else
GotoState("")
endif
EndEvent
endstate
state Active
Event OnBeginState()
_00E_Game_MenuIMOD.Apply()
RegisterForControl("Cancel")
RegisterForControl("Quick Stats")
if ! UI.IsMenuOpen("CustomMenu")
UI.OpenCustomMenu("00E_heromenu")
endif
UI.InvokeStringA("CustomMenu", "_root.heromenu_mc.SetStringValues", GetStrings())
UI.InvokeFloatA("CustomMenu", "_root.heromenu_mc.SetIntValues", GetFloats())
UI.InvokeFloatA("CustomMenu", "_root.heromenu_mc.SetModifier", GetMods())
EndEvent
Event OnControlDown(string sControl)
GotoState("")
EndEvent
Event OnEndState()
UnregisterForAllControls()
UI.CloseCustomMenu()
_00E_Game_MenuIMOD.Remove()
EndEvent
endstate
Function InitializeActorValueInfos()
AiHealth = ActorValueInfo.GetActorValueInfoByID(24)
AiStamina = ActorValueInfo.GetActorValueInfoByID(26)
AiMagicka = ActorValueInfo.GetActorValueInfoByID(25)
AiRanged = ActorValueInfo.GetActorValueInfoByID(8)
AiLightArmor = ActorValueInfo.GetActorValueInfoByID(12)
AiPsionics = ActorValueInfo.GetActorValueInfoByID(21) ; Vanilla - Illusion
AiElementarism = ActorValueInfo.GetActorValueInfoByID(20); Vanilla - Destruction
AiManipulation = ActorValueInfo.GetActorValueInfoByID(18); Vanilla - Alteration
AiOneHanded = ActorValueInfo.GetActorValueInfoByID(6) ; Vanilla - OneHanded
AiTwoHanded = ActorValueInfo.GetActorValueInfoByID(7) ; Vanilla - TwoHanded
AiParry = ActorValueInfo.GetActorValueInfoByID(9) ; Vanilla - Block
AiLightMagic = ActorValueInfo.GetActorValueInfoByID(22) ; Vanilla - Restoration
AiEntrophy = ActorValueInfo.GetActorValueInfoByID(19) ; Vanilla - Conjuration
AiHeavyArmor = ActorValueInfo.GetActorValueInfoByID(11) ; Vanilla - HeavyArmor
AiSneak = ActorValueInfo.GetActorValueInfoByID(15) ; Vanilla - Sneak
AiAlchemy = ActorValueInfo.GetActorValueInfoByID(16) ; Vanilla - Alchemy
AiPickpocket = ActorValueInfo.GetActorValueInfoByID(13) ; Vanilla - Pickpocket
AiEnchanting = ActorValueInfo.GetActorValueInfoByID(23) ; Vanilla - Enchanting
AiLockpicking = ActorValueInfo.GetActorValueInfoByID(14) ; Vanilla - Lockpicking
AiSmithing = ActorValueInfo.GetActorValueInfoByID(10) ; Vanilla - Smithing
AiSpeechcraft = ActorValueInfo.GetActorValueInfoByID(17) ; Vanilla - Speechcraft
EndFunction
Float[] Function GetFloats()
Actor PlayerREF = GetReference() as Actor
Float[] SkillmenuFloats = New Float[33]
; float fNeededEXP = ((pow((PlayerLevel.GetValueInt() + 1), EXPMultSlope.GetValue()) * EXPMult.GetValue()) - (pow(PlayerLevel.GetValueInt(), EXPMultSlope.GetValue()) * EXPMult.GetValue()))
int iPlayerLevel = PlayerLevel.GetValueInt()
float fEXPMultSlope = EXPMultSlope.GetValue()
float fEXPMult = EXPMult.GetValue()
float fEXPNeededForCurrentLevel = _00E_Func_ComputeNeededExp.Run(iPlayerLevel - 1, fEXPMultSlope, fEXPMult)
float fEXPNeededForNextLevel = _00E_Func_ComputeNeededExp.Run(iPlayerLevel, fEXPMultSlope, fEXPMult)
int iPlayerExp = PlayerExp.GetValueInt()
SkillmenuFloats[0] = (AiHealth.GetBaseValue(PlayerREF)) as Int
SkillmenuFloats[1] = AiHealth.GetCurrentValue(PlayerREF) as Int
SkillmenuFloats[2] = aiMagicka.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[3] = aiMagicka.GetCurrentValue(PlayerREF) as Int
SkillmenuFloats[4] = aiStamina.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[5] = aiStamina.GetCurrentValue(PlayerREF) as Int
SkillmenuFloats[6] = (-1*(PlayerREF.GetActorValue("LastFlattered"))) as Int
SkillmenuFloats[7] = fEXPNeededForNextLevel
; (pow(PlayerLevel.GetValueInt(), EXPMultSlope.GetValue()) * (EXPMult.GetValue()*fEXPAcceleration))
;SkillmenuFloats[7] = ((pow((PlayerLevel.GetValueInt()), EXPMultSlope.GetValue()) * EXPMult.GetValue()) - (pow(PlayerLevel.GetValueInt() - 1, EXPMultSlope.GetValue()) * EXPMult.GetValue())) as Float
SkillmenuFloats[8] = iPlayerExp
SkillmenuFloats[9] = iPlayerLevel
SkillmenuFloats[10] = Lernpunkte.GetValueInt()
SkillmenuFloats[11] = Handwerkspunkte.GetValueInt()
SkillmenuFloats[12] = TalentPoints.GetValueInt()
SkillmenuFloats[13] = aiPsionics.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[14] = aiElementarism.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[15] = aiManipulation.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[16] = aiOneHanded.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[17] = aiParry.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[18] = aiRanged.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[19] = aiEntrophy.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[20] = aiLightMagic.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[21] = aiTwoHanded.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[22] = aiLightArmor.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[23] = aiHeavyArmor.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[24] = aiSneak.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[25] = aiAlchemy.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[26] = aiPickpocket.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[27] = aiLockpicking.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[28] = aiEnchanting.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[29] = aiSmithing.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[30] = aiSpeechcraft.GetBaseValue(PlayerREF) as Int
SkillmenuFloats[31] = iPlayerExp - fEXPNeededForCurrentLevel
SkillmenuFloats[32] = fEXPNeededForNextLevel - fEXPNeededForCurrentLevel
Return SkillmenuFloats
EndFunction
Float[] Function GetMods()
; Gets all modifiers applied to stats and skills
Actor PlayerREF = GetReference() as Actor
Float[] SkillmenuMods = New Float[21]
SkillmenuMods[0] = ((aiHealth.GetMaximumValue(PlayerREF) as Int) - (aiHealth.GetBaseValue(PlayerREF) as Int))
SkillmenuMods[1] = ((aiMagicka.GetMaximumValue(PlayerREF) as Int) - aiMagicka.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[2] = ((aiStamina.GetMaximumValue(PlayerREF) as Int) - aiStamina.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[3] = ((aiPsionics.GetCurrentValue(PlayerREF) as Int) - aiPsionics.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[4] = ((aiElementarism.GetCurrentValue(PlayerREF) as Int) - aiElementarism.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[5] = ((aiManipulation.GetCurrentValue(PlayerREF) as Int) - aiManipulation.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[6] = ((aiOneHanded.GetCurrentValue(PlayerREF) as Int) - aiOneHanded.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[7] = ((aiParry.GetCurrentValue(PlayerREF) as Int) - aiParry.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[8] = ((aiRanged.GetCurrentValue(PlayerREF) as Int) - aiRanged.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[9] = ((aiEntrophy.GetCurrentValue(PlayerREF) as Int) - aiEntrophy.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[10] = ((aiLightMagic.GetCurrentValue(PlayerREF) as Int) - aiLightMagic.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[11] = ((aiTwoHanded.GetCurrentValue(PlayerREF) as Int) - aiTwoHanded.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[12] = ((aiLightArmor.GetCurrentValue(PlayerREF) as Int) - aiLightArmor.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[13] = ((aiHeavyArmor.GetCurrentValue(PlayerREF) as Int) - aiHeavyArmor.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[14] = ((aiSneak.GetCurrentValue(PlayerREF) as Int) - aiSneak.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[15] = ((aiAlchemy.GetCurrentValue(PlayerREF) as Int) - aiAlchemy.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[16] = ((aiPickpocket.GetCurrentValue(PlayerREF) as Int) - aiPickpocket.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[17] = ((aiLockpicking.GetCurrentValue(PlayerREF) as Int) - aiLockpicking.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[18] = ((aiEnchanting.GetCurrentValue(PlayerREF) as Int) - aiEnchanting.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[19] = ((aiSmithing.GetCurrentValue(PlayerREF) as Int) - aiSmithing.GetBaseValue(PlayerREF) as Int)
SkillmenuMods[20] = ((aiSpeechcraft.GetCurrentValue(PlayerREF) as Int) - aiSpeechcraft.GetBaseValue(PlayerREF) as Int)
Return SkillmenuMods
EndFunction
String[] Function GetStrings()
String[] SkillmenuStrings = new string[2]
SkillmenuStrings[0] = Player.GetName()
SkillmenuStrings[1] = AffinityAlias.GetPlayerClassName()
Return SkillmenuStrings
EndFunction
ImageSpaceModifier Property _00E_Game_MenuIMOD Auto
Location Property _00E_Dreamworld_Location Auto
GlobalVariable Property PlayerLevel Auto
GlobalVariable Property PlayerExp Auto
GlobalVariable Property EXPMultSlope Auto
GlobalVariable Property EXPMult Auto
GlobalVariable Property Lernpunkte Auto
GlobalVariable Property Handwerkspunkte Auto
GlobalVariable Property TalentPoints Auto
ActorBase Property Player Auto
ActorValueInfo AiHealth
ActorValueInfo AiStamina
ActorValueInfo AiMagicka
ActorValueInfo AiRanged ; Vanilla - Marksman
ActorValueInfo AiLightArmor ; Vanilla - Light Armor
ActorValueInfo AiPsionics ; Vanilla - Illusion
ActorValueInfo AiElementarism ; Vanilla - Destruction
ActorValueInfo AiManipulation ; Vanilla - Alteration
ActorValueInfo AiOneHanded ; Vanilla - OneHanded
ActorValueInfo AiTwoHanded ; Vanilla - TwoHanded
ActorValueInfo AiParry ; Vanilla - Block
ActorValueInfo AiLightMagic ; Vanilla - Restoration
ActorValueInfo AiEntrophy ; Vanilla - Conjuration
ActorValueInfo AiHeavyArmor ; Vanilla - HeavyArmor
ActorValueInfo AiSneak ; Vanilla - Sneak
ActorValueInfo AiAlchemy ; Vanilla - Alchemy
ActorValueInfo AiPickpocket ; Vanilla - Pickpocket
ActorValueInfo AiEnchanting ; Vanilla - Enchanting
ActorValueInfo AiLockpicking ; Vanilla - Lockpicking
ActorValueInfo AiSmithing ; Vanilla - Smithing
ActorValueInfo AiSpeechcraft ; Vanilla - Speechcraft
_00E_AffinityControl Property AffinityAlias Auto