I'm trying to change the damage resistance of all creatures and NPC. I'm new to scripts, and I tried to tweak an existent xedit script health normalizer to make it change DR instead. The script should change every creature by applying a formula to the existing DR, which is different for each race.
But it seems some creatures are not selected by the script, and I can't really figure out why (as an exemple, most of fog crawlers are not taken by the script).
Here is a part of the script:
function Process(e: IInterface): integer; var race, DamageResist, newDR: integer; sig: String;
begin sig := Signature(e); if (sig <> 'NPC_') then Exit; if not IsMaster(e) then Exit; //if isLegendary(e) then Exit;
// patch the last overriding record from the current load order e := WinningOverride(e);
DamageResist := getDR(e); if DamageResist = -9999 then Exit; race := GetElementNativeValues(e, 'RNAM');
//AlienRace "" [RACE:00184C4D] // // // // if race = $00184C4D then begin if (DamageResist > 0) then begin newDR := 5 + (Sqrt(Abs(DamageResist)*2)); e := setDR(e, newDR); end; end;
Has someone a better way for a script that could do what I'm looking for ?
Question
johncdp
Hello everyone,
I'm trying to change the damage resistance of all creatures and NPC. I'm new to scripts, and I tried to tweak an existent xedit script health normalizer to make it change DR instead. The script should change every creature by applying a formula to the existing DR, which is different for each race.
But it seems some creatures are not selected by the script, and I can't really figure out why (as an exemple, most of fog crawlers are not taken by the script).
Here is a part of the script:
Has someone a better way for a script that could do what I'm looking for ?
Thank you.
0 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now