Jump to content

Geck Scripting Formula


senterpat

Recommended Posts

So having some trouble with the following script. The math checks out, so I think I may be scripting it wrong... The stat boosts function, but they come out way higher then they should. I've tested a lot and cannot get it to function properly. Am I messing up something in the script?

begin ScriptEffectStart
if SUPERCritterLeveling == 1 && doonce == 0
set iRare to getrandompercent / 10
if iRare >= getrandompercent
set iRand to getrandompercent
set Var1 to player.getlevel / 50 ; comes out to "1" at level 50
set Var2 to iRand / 200 ; comes out to "0.2" if random is 100
set nScale to 1 + GetRandomPercent / 1999 ; This part comes out fine
else
set iRand to getrandompercent
set Var1 to player.getlevel / 100
set Var2 to iRand / 500
set nScale to .95000 + GetRandomPercent / 1999
endif
if GetLevel < Player.GetLevel
;get stat boosts
set LevelBoost to (GetLevel) * (Var1 + Var2)
set LevelBoost to (GetLevel + LevelBoost)
set HealthBoost to (GetAV Health) * (Var1 + Var2)
set StrBoost to (GetAV Strength) * (Var1 + Var2)
set AgiBoost to (GetAV Agility) * (Var1 + Var2)
set PerBoost to (GetAV Perception) * (Var1 + Var2)
set EndBoost to (GetAV Endurance) * (Var1 + Var2)
set ChrBoost to (GetAV Charisma) * (Var1 + Var2)
set IntBoost to (GetAV Intelligence) * (Var1 + Var2)
set LckBoost to (GetAV Luck) * (Var1 + Var2)
set MeleeBoost to (GetAV MeleeWeapons) * (Var1 + Var2)
set UnarmedBoost to (GetAV Unarmed) * (Var1 + Var2)
set EnergyBoost to (GetAV EnergyWeapons) * (Var1 + Var2)
set GunsBoost to (GetAV Guns) * (Var1 + Var2)
set ExplosiveBoost to (GetAV Explosives) * (Var1 + Var2)
set MDmgBoost to (GetAV MeleeDamage) * (Var1 + Var2)
set UDmgBoost to (GetAV UnarmedDamage) * (Var1 + Var2)
set CritBoost to (GetAV CritChance) * (Var1 + Var2)
set DRBoost to (GetAV DamageResist) * (Var1 + Var2)
;apply new stats
SetLevel LevelBoost
ModAv Health HealthBoost
ModAv Strength StrBoost
ModAv Agility AgiBoost
ModAv Perception PerBoost
ModAv Endurance EndBoost
ModAv Charisma ChrBoost
ModAv Intelligence IntBoost
ModAv Luck LckBoost
ModAv Meleeweapons MeleeBoost
ModAv Unarmed UnarmedBoost
ModAv EnergyWeapons EnergyBoost
ModAv Guns GunsBoost
ModAv Explosives ExplosiveBoost
ModAv MeleeDamage MDmgBoost
ModAv UnarmedDamage UDmgBoost
ModAv CritChance CritBoost
ModAv DamageResist DRBoost
setScale nScale
set doonce to 1
endif
endif
end

So the level for example, should come out to the level * 1.2 at the most, but it's coming out as level * 3 or higher

Edited by senterpat
Link to comment
Share on other sites

in which case, when the creature is rare or when it's not rare?

 

-when creature is level 10, is considered rare and player is lv 50:

set LevelBoost to (10) * (1 + 0)
set LevelBoost to (10 + 10) = 20
-When creature is level 10, is not considered rare and player is lv 50:
set LevelBoost to (10) * (0.5 + 0)
set LevelBoost to (10+5) = 15

 

I ignored var2.

 

I would try to PrintC the levelboost and the two vars

Link to comment
Share on other sites

Thanks alot, but I got it working, didn't change anything from last night, just added the printc and went to check it out and it was working fine :/ maybe I didnt save or something before going in to test last. Either way, I appreciate the help!

 

While your here do you know of a way to check the players maximum level? I know mods can change it, so I want the script to scale with the players max level

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...