A little about what this script does in particular:
The old Ctr stat, beloved by plotscript junkies everywhere, has been renamed Threat.
There are eight "elements" to represent HP, MP, Attack, Accuracy, Defense, Dodge, Magic, and Will. Each enemy's "resistance" to these elements is set to their base stats (for example, if damage from the HP element is 15%, the base stat is 15). (Side Note: My first attempt used the normal enemy stats, but unfortunately the script would stack each successive time the same enemy was encountered, ad TPK.)
Speed is not scaled due to maths; Hits and MP~ are unused.
The main loop is "EnemyScaling" and is triggered Instead of Battle.
Code:
include, plotscr.hsd
plotscript, EnemyScaling, formation, formset, begin
variable (slot)
for( slot,0,7,1
)
do (if( (FormationSlotEnemy (formation, slot))>=0
)
then( SetEnemyStats(FormationSlotEnemy(formation,slot))
slot += 1
)
else( slot +=1)
)
fight formation (formation)
end
script, GetThreat, begin
variable (CatCT, HeroCT, Threat)
Threat :=0
CatCT :=0
HeroCT :=0
for (CatCT,0,4,1)
do (if (HeroBySlot (CatCT)>=0)
then (threat+=(GetHeroStat(CatCT,9))
CatCT+=1
HeroCT+=1)
else (CatCT+=1))
for( CatCT,4,5,1
)
do( (threat:=threat/HeroCT)
CatCT+=1
)
if( CatCT>>5
)
then( return (threat)
)
end
script, SetEnemyStats, EID, begin
variable (Floor, Cap, StatCT, threat, ethreat, statmod, base)
threat:=GetThreat
ethreat:=getenemystat(EID,9)
statmod :=(threat+ethreat)/2
Floor := (statmod/4)*3
Cap := statmod+(statmod/4)
#Below: Enemy stats = stat base (stored as elemental resistance)
for (StatCT,0,7,1) #times the average of Hero Threat and Enemy Threat divided by 100
do (
base :=EnemyElementalResistAsInt(EID,StatCT+8)
if (StatCT==5)
then (
)
else (
set enemy stat(EID,StatCT,(base+random(Floor, Cap)))
)
)
if (StatCT>0)
then (write enemy data (EID, enemy:experience, random(Floor,Cap)))
end
plotscript, EnemyScaling, formation, formset, begin
variable (slot)
for( slot,0,7,1
)
do (if( (FormationSlotEnemy (formation, slot))>=0
)
then( SetEnemyStats(FormationSlotEnemy(formation,slot))
slot += 1
)
else( slot +=1)
)
fight formation (formation)
end
script, GetThreat, begin
variable (CatCT, HeroCT, Threat)
Threat :=0
CatCT :=0
HeroCT :=0
for (CatCT,0,4,1)
do (if (HeroBySlot (CatCT)>=0)
then (threat+=(GetHeroStat(CatCT,9))
CatCT+=1
HeroCT+=1)
else (CatCT+=1))
for( CatCT,4,5,1
)
do( (threat:=threat/HeroCT)
CatCT+=1
)
if( CatCT>>5
)
then( return (threat)
)
end
script, SetEnemyStats, EID, begin
variable (Floor, Cap, StatCT, threat, ethreat, statmod, base)
threat:=GetThreat
ethreat:=getenemystat(EID,9)
statmod :=(threat+ethreat)/2
Floor := (statmod/4)*3
Cap := statmod+(statmod/4)
#Below: Enemy stats = stat base (stored as elemental resistance)
for (StatCT,0,7,1) #times the average of Hero Threat and Enemy Threat divided by 100
do (
base :=EnemyElementalResistAsInt(EID,StatCT+8)
if (StatCT==5)
then (
)
else (
set enemy stat(EID,StatCT,(base+random(Floor, Cap)))
)
)
if (StatCT>0)
then (write enemy data (EID, enemy:experience, random(Floor,Cap)))
end
Basically, the script first gets the party's average Threat, then gets the average of that number and the enemy's threat, then adds the result to the enemy's base stats. Crude, but effective.
This is somewhat difficult to balance (to say the least) but seems to be working properly. Has anyone experimented with this sort of thing before? Thoughts? Advice? Glaring flaws? Input of any kind is very much appreciated!
EDIT: The comment is a lie.
DISCLAIMER: Contents may be offensive or inappropriate. Viewer discretion is advised.



