mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-01-17 00:05:07 -05:00
Prevent over-capped powerups
Higher than possible RE chance can lead to powerups created outside the possible realm. With the formula: ( ( (skillMod * rand(randomRollMin, 1.25f) ) / 100) + rand(1.0f, 1.25f)) * power; skillMod is a possible max of 169: 100 level 90 10 expertise 5 arm 11 pup 11 pup 11 pup 4 wep 4 chest 3 shirt 10 tool 169 total rolling the max for both randoms (1.25 and 1.25), we end up with ( ( (169 * 1.25) / 100) + 1.25) * 35 (where power = the power bit = 35 max) = a max of 117.6875 power
This commit is contained in:
@@ -491,6 +491,8 @@ public class reverse_engineering_tool extends script.base_script
|
||||
obj_id powerup = static_item.createNewItemFunction(getGemTemplateByClass(player, ratio, 1), inventory);
|
||||
if (isIdValid(powerup))
|
||||
{
|
||||
if(power > 117)
|
||||
power = 117;
|
||||
setObjVar(powerup, "reverse_engineering.reverse_engineering_power", power);
|
||||
setObjVar(powerup, "reverse_engineering.reverse_engineering_modifier", mod);
|
||||
setObjVar(powerup, "reverse_engineering.reverse_engineering_ratio", ratio);
|
||||
|
||||
Reference in New Issue
Block a user