CyborgArmGun

Skyrim - KL Swap Starsight Eyes.pas

Sep 10th, 2020
943
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.   Edited Starsight Eyes Script by CyborgArmGun frankenstein'd from "KL Swap eyesparts" by KouLeifoh.
  3.   Swap vanilla eyes for their Starsight versions.
  4.  
  5.   VanillaStarsightEyes.esp needs to be in the load order.
  6. }
  7. unit UserScript;
  8.  
  9. const
  10.   EnableLog = false;
  11.   NumRaces   = 25;
  12.   NumEyesF  = 50;
  13.   NumEyesM  = 57;
  14.   SNone = 'none';
  15.  
  16. var
  17.   kwda: IInterface;
  18.   LoadOrder: string;
  19.   HasMaster: boolean;
  20.   FoundMaster: boolean;
  21.  
  22.   Races: Array[1..25] of string;
  23.  
  24.  
  25.   EyesF1: Array[1..50] of string;
  26.   EyesF2: Array[1..50] of string;
  27.  
  28.   EyesM1: Array[1..57] of string;
  29.   EyesM2: Array[1..57] of string;
  30.  
  31. function buildList(): Boolean;
  32. var
  33.   i: integer;
  34. begin
  35.   i := 1;
  36.   Races[i] := 'BretonRace "Breton" [RACE:00013741]'; i := i + 1;
  37.   Races[i] := 'DarkElfRace "Dark Elf" [RACE:00013742]'; i := i + 1;
  38.   Races[i] := 'HighElfRace "High Elf" [RACE:00013743]'; i := i + 1;
  39.   Races[i] := 'ImperialRace "Imperial" [RACE:00013744]'; i := i + 1;
  40.   Races[i] := 'NordRace "Nord" [RACE:00013746]'; i := i + 1;
  41.   Races[i] := 'OrcRace "Orc" [RACE:00013747]'; i := i + 1;
  42.   Races[i] := 'RedguardRace "Redguard" [RACE:00013748]'; i := i + 1;
  43.   Races[i] := 'WoodElfRace "Wood Elf" [RACE:00013749]'; i := i + 1;
  44.   Races[i] := 'ArgonianRace "Argonian" [RACE:00013740]'; i := i + 1;
  45.   Races[i] := 'KhajiitRace "Khajiit" [RACE:00013745]'; i := i + 1;
  46.   Races[i] := 'DA13AfflictedRace "Breton" [RACE:00097A3D]'; i := i + 1;
  47.   Races[i] := 'DremoraRace "Dremora" [RACE:000131F0]'; i := i + 1;
  48.   Races[i] := 'ElderRace "Old People Race" [RACE:00067CD8]'; i := i + 1;
  49.   Races[i] := 'ElderRaceVampire "Old People Race" [RACE:000A82BA]'; i := i + 1;
  50.   Races[i] := 'NordRaceAstrid "Nord" [RACE:0007EAF3]'; i := i + 1;
  51.   Races[i] := 'BretonRaceVampire "Breton" [RACE:0008883C]'; i := i + 1;
  52.   Races[i] := 'DarkElfRaceVampire "Dark Elf" [RACE:0008883D]'; i := i + 1;
  53.   Races[i] := 'HighElfRaceVampire "High Elf" [RACE:00088840]'; i := i + 1;
  54.   Races[i] := 'ImperialRaceVampire "Imperial" [RACE:00088844]'; i := i + 1;
  55.   Races[i] := 'NordRaceVampire "Nord" [RACE:00088794]'; i := i + 1;
  56.   Races[i] := 'OrcRaceVampire "Orc" [RACE:000A82B9]'; i := i + 1;
  57.   Races[i] := 'RedguardRaceVampire "Redguard" [RACE:00088846]'; i := i + 1;
  58.   Races[i] := 'WoodElfRaceVampire "Wood Elf" [RACE:00088884]'; i := i + 1;
  59.   Races[i] := 'ArgonianRaceVampire "Argonian" [RACE:0008883A]'; i := i + 1;
  60.   Races[i] := 'KhajiitRaceVampire "Khajiit" [RACE:00088845]'; i := i + 1;
  61.  
  62.   i := 1;
  63.   EyesM1[i] := 'MaleEyesDarkElfBlind "MaleEyesDarkElfBlind" [HDPT:00053998]'; i := i + 1;
  64.   EyesM1[i] := 'MaleEyesDarkElfDeepRed "MaleEyesDarkElfDeepRed" [HDPT:00053927]'; i := i + 1;
  65.   EyesM1[i] := 'MaleEyesDarkElfDeepRed2 "MaleEyesDarkElfDeepRed2" [HDPT:00053929]'; i := i + 1;
  66.   EyesM1[i] := 'MaleEyesDarkElfDeepRed2BlindRight "MaleEyesDarkElfDeepRed2BlindRight" [HDPT:000F6F7C]'; i := i + 1;
  67.   EyesM1[i] := 'MaleEyesDarkElfDeepRedBlindLeft "MaleEyesDarkElfDeepRedBlindLeft" [HDPT:000F6F7D]'; i := i + 1;
  68.   EyesM1[i] := 'MaleEyesDarkElfRed "MaleEyesDarkElfRed" [HDPT:00051625]'; i := i + 1;
  69.   EyesM1[i] := 'MaleEyesElfBlind "MaleEyesElfBlind" [HDPT:00040219]'; i := i + 1;
  70.   EyesM1[i] := 'MaleEyesHighElfDarkYellow "MaleEyesHighElfDarkYellow" [HDPT:00040190]'; i := i + 1;
  71.   EyesM1[i] := 'MaleEyesHighElfDarkYellowBlindLeft "MaleEyesHighElfDarkYellowBlindLeft" [HDPT:000F6F7F]'; i := i + 1;
  72.   EyesM1[i] := 'MaleEyesHighElfOrange "MaleEyesHighElfOrange" [HDPT:0004020F]'; i := i + 1;
  73.   EyesM1[i] := 'MaleEyesHighElfOrangeBlindRight "MaleEyesHighElfOrangeBlindRight" [HDPT:000F6F80]'; i := i + 1;
  74.   EyesM1[i] := 'MaleEyesHighElfYellow "MaleEyesHighElfYellow" [HDPT:00051627]'; i := i + 1;
  75.   EyesM1[i] := 'MaleEyesHighElfYellowBlindRight "MaleEyesHighElfYellowBlindRight" [HDPT:00040218]'; i := i + 1;
  76.   EyesM1[i] := 'MaleEyesHumanAmber "MaleEyesHumanAmber" [HDPT:000E7AEC]'; i := i + 1;
  77.   EyesM1[i] := 'MaleEyesHumanAmberBlindRight "MaleEyesHumanAmberBlindRight" [HDPT:000F6F85]'; i := i + 1;
  78.   EyesM1[i] := 'MaleEyesHumanBlind "MaleEyesHumanBlind" [HDPT:00023FB7]'; i := i + 1;
  79.   EyesM1[i] := 'MaleEyesHumanBrightGreen "MaleEyesHumanBrightGreen" [HDPT:000E7AED]'; i := i + 1;
  80.   EyesM1[i] := 'MaleEyesHumanBrightGreenBlindRight "MaleEyesHumanBrightGreenBlindRight" [HDPT:000F6F83]'; i := i + 1;
  81.   EyesM1[i] := 'MaleEyesHumanBrown "MaleEyesHumanBrown" [HDPT:00051632]'; i := i + 1;
  82.   EyesM1[i] := 'MaleEyesHumanBrownBlindLeft "MaleEyesHumanBrownBlindLeft" [HDPT:00024242]'; i := i + 1;
  83.   EyesM1[i] := 'MaleEyesHumanBrownBlindRight "MaleEyesHumanBrownBlindRight" [HDPT:0009F08F]'; i := i + 1;
  84.   EyesM1[i] := 'MaleEyesHumanBrownBloodShot "MaleEyesHumanBrownBloodShot" [HDPT:000F81D2]'; i := i + 1;
  85.   EyesM1[i] := 'MaleEyesHumanDarkBlue "MaleEyesHumanDarkBlue" [HDPT:00024259]'; i := i + 1;
  86.   EyesM1[i] := 'MaleEyesHumanDemon "MaleEyesHumanDemon" [HDPT:0002425E]'; i := i + 1;
  87.   EyesM1[i] := 'MaleEyesHumanGreenHazelLeft "MaleEyesHumanGreenHazelLeft" [HDPT:00023FE1]K'; i := i + 1;
  88.   EyesM1[i] := 'MaleEyesHumanGrey "MaleEyesHumanGrey" [HDPT:0002425C]'; i := i + 1;
  89.   EyesM1[i] := 'MaleEyesHumanHazel "MaleEyesHumanHazel" [HDPT:00024250]'; i := i + 1;
  90.   EyesM1[i] := 'MaleEyesHumanHazelBrown "MaleEyesHumanHazelBrown" [HDPT:0002424F]'; i := i + 1;
  91.   EyesM1[i] := 'MaleEyesHumanIceBlue "MaleEyesHumanIceBlue" [HDPT:00024244]'; i := i + 1;
  92.   EyesM1[i] := 'MaleEyesHumanLightBlue "MaleEyesHumanLightBlue" [HDPT:000E7AEE]'; i := i + 1;
  93.   EyesM1[i] := 'MaleEyesHumanLightBlueBlindLeft "MaleEyesHumanLightBlueBlindLeft" [HDPT:000F6F86]'; i := i + 1;
  94.   EyesM1[i] := 'MaleEyesHumanLightBlueBloodShot "MaleEyesHumanLightBlueBloodShot" [HDPT:000F81D3]'; i := i + 1;
  95.   EyesM1[i] := 'MaleEyesHumanLightGrey "MaleEyesHumanLightGrey" [HDPT:0002425B]'; i := i + 1;
  96.   EyesM1[i] := 'MaleEyesHumanLightIceGreyBlindLeft "MaleEyesHumanLightIceGreyBlindLeft" [HDPT:000F6F84]'; i := i + 1;
  97.   EyesM1[i] := 'MaleEyesHumanVampire "MaleEyesHumanVampire" [HDPT:000E7AEB]'; i := i + 1;
  98.   EyesM1[i] := 'MaleEyesHumanVampire01 "MaleEyesHumanVampire01" [HDPT:02006F88]'; i := i + 1;
  99.   EyesM1[i] := 'MaleEyesHumanVampire01Nord "MaleEyesHumanVampire01Nord" [HDPT:0200D6D6]'; i := i + 1;
  100.   EyesM1[i] := 'MaleEyesHumanVampireNord "MaleEyesHumanVampireNord" [HDPT:0200D6D5]'; i := i + 1;
  101.   EyesM1[i] := 'MaleEyesHumanYellow "MaleEyesHumanYellow" [HDPT:00024245]'; i := i + 1;
  102.   EyesM1[i] := 'MaleEyesOrcBlind "MaleEyesOrcBlind" [HDPT:0004020D]'; i := i + 1;
  103.   EyesM1[i] := 'MaleEyesOrcDarkGrey "MaleEyesOrcDarkGrey" [HDPT:00040229]'; i := i + 1;
  104.   EyesM1[i] := 'MaleEyesOrcIceBlue "MaleEyesOrcIceBlue" [HDPT:0004022A]'; i := i + 1;
  105.   EyesM1[i] := 'MaleEyesOrcIceBlueBlindRight "MaleEyesOrcIceBlueBlindRight" [HDPT:000F6F75]'; i := i + 1;
  106.   EyesM1[i] := 'MaleEyesOrcRed "MaleEyesOrcRed" [HDPT:00040226]'; i := i + 1;
  107.   EyesM1[i] := 'MaleEyesOrcRedBlindRight "MaleEyesOrcRedBlindRight" [HDPT:0004020B]'; i := i + 1;
  108.   EyesM1[i] := 'MaleEyesOrcVampire "MaleEyesOrcVampire" [HDPT:0004020E]'; i := i + 1;
  109.   EyesM1[i] := 'MaleEyesOrcYellow "MaleEyesOrcYellow" [HDPT:0009250A]'; i := i + 1;
  110.   EyesM1[i] := 'MaleEyesOrcYellowBlindLeft "MaleEyesOrcYellowBlindLeft" [HDPT:000F6F76]'; i := i + 1;
  111.   EyesM1[i] := 'MaleEyesSnowElf "MaleEyesSnowElf" [HDPT:02003786]'; i := i + 1;
  112.   EyesM1[i] := 'MaleEyesSnowElfVampire "MaleEyesSnowElfVampire" [HDPT:020029E0]'; i := i + 1;
  113.   EyesM1[i] := 'MaleEyesWoodElfBlind "MaleEyesWoodElfBlind" [HDPT:00053922]'; i := i + 1;
  114.   EyesM1[i] := 'MaleEyesWoodElfBrown "MaleEyesWoodElfBrown" [HDPT:00051626]'; i := i + 1;
  115.   EyesM1[i] := 'MaleEyesWoodElfDeepBrown "MaleEyesWoodElfDeepBrown" [HDPT:00053917]'; i := i + 1;
  116.   EyesM1[i] := 'MaleEyesWoodElfDeepBrownBlindRight "MaleEyesWoodElfDeepBrownBlindRight" [HDPT:000F6F79]'; i := i + 1;
  117.   EyesM1[i] := 'MaleEyesWoodElfDeepViolet "MaleEyesWoodElfDeepViolet" [HDPT:0005391F]'; i := i + 1;
  118.   EyesM1[i] := 'MaleEyesWoodElfLightBrown "MaleEyesWoodElfLightBrown" [HDPT:00053921]'; i := i + 1;
  119.   EyesM1[i] := 'MaleEyesWoodElfLightBrownBlindLeft "MaleEyesWoodElfLightBrownBlindLeft" [HDPT:000F6F78]';
  120.  
  121.   i := 1;
  122.   EyesF1[i] := 'FemaleEyesDarkElfBlind "FemaleEyesDarkElfBlind" [HDPT:00053997]'; i := i + 1;
  123.   EyesF1[i] := 'FemaleEyesDarkElfDeepRed "FemaleEyesDarkElfDeepRed" [HDPT:0005392A]'; i := i + 1;
  124.   EyesF1[i] := 'FemaleEyesDarkElfDeepRed2 "FemaleEyesDarkElfDeepRed2" [HDPT:0005392B]'; i := i + 1;
  125.   EyesF1[i] := 'FemaleEyesDarkElfDeepRed2BlindRight "FemaleEyesDarkElfDeepRed2BlindRight" [HDPT:00108E24]'; i := i + 1;
  126.   EyesF1[i] := 'FemaleEyesDarkElfDeepRedBlindLeft "FemaleEyesDarkElfDeepRedBlindLeft" [HDPT:00108E21]'; i := i + 1;
  127.   EyesF1[i] := 'FemaleEyesDarkElfRed "FemaleEyesDarkElfRed" [HDPT:00051540]'; i := i + 1;
  128.   EyesF1[i] := 'FemaleEyesDarkElfUnique "FemaleEyesDarkElfUnique" [HDPT:001010B7]'; i := i + 1;
  129.   EyesF1[i] := 'FemaleEyesElfBlind "FemaleEyesElfBlind" [HDPT:0004021D]'; i := i + 1;
  130.   EyesF1[i] := 'FemaleEyesHighElfDarkYellow "FemaleEyesHighElfDarkYellow" [HDPT:0004021C]'; i := i + 1;
  131.   EyesF1[i] := 'FemaleEyesHighElfOrange "FemaleEyesHighElfOrange" [HDPT:0005153F]'; i := i + 1;
  132.   EyesF1[i] := 'FemaleEyesHighElfOrangeBlindRight "FemaleEyesHighElfOrangeBlindRight" [HDPT:00108E25]'; i := i + 1;
  133.   EyesF1[i] := 'FemaleEyesHighElfYellow "FemaleEyesHighElfYellow" [HDPT:00040209]'; i := i + 1;
  134.   EyesF1[i] := 'FemaleEyesHighElfYellowBlindLeft "FemaleEyesHighElfYellowBlindLeft" [HDPT:00108E26]'; i := i + 1;
  135.   EyesF1[i] := 'FemaleEyesHumanAmber "FemaleEyesHumanAmber" [HDPT:0007291B]'; i := i + 1;
  136.   EyesF1[i] := 'FemaleEyesHumanAmberBlindLeft "FemaleEyesHumanAmberBlindLeft" [HDPT:000F81D7]'; i := i + 1;
  137.   EyesF1[i] := 'FemaleEyesHumanBlind "FemaleEyesHumanBlind" [HDPT:0004018F]'; i := i + 1;
  138.   EyesF1[i] := 'FemaleEyesHumanBrightGreen "FemaleEyesHumanBrightGreen" [HDPT:0007291A]'; i := i + 1;
  139.   EyesF1[i] := 'FemaleEyesHumanBrown "FemaleEyesHumanBrown" [HDPT:00072917]'; i := i + 1;
  140.   EyesF1[i] := 'FemaleEyesHumanBrownBlindRight "FemaleEyesHumanBrownBlindRight" [HDPT:0004020C]'; i := i + 1;
  141.   EyesF1[i] := 'FemaleEyesHumanBrownBloodShot "FemaleEyesHumanBrownBloodShot" [HDPT:000F81D4]'; i := i + 1;
  142.   EyesF1[i] := 'FemaleEyesHumanDarkBlue "FemaleEyesHumanDarkBlue" [HDPT:00040208]'; i := i + 1;
  143.   EyesF1[i] := 'FemaleEyesHumanDarkBlueBlindRight "FemaleEyesHumanDarkBlueBlindRight" [HDPT:000F81CF]'; i := i + 1;
  144.   EyesF1[i] := 'FemaleEyesHumanDemon "FemaleEyesHumanDemon" [HDPT:000401A7]'; i := i + 1;
  145.   EyesF1[i] := 'FemaleEyesHumanGreenHazel "FemaleEyesHumanGreenHazel" [HDPT:00040210]'; i := i + 1;
  146.   EyesF1[i] := 'FemaleEyesHumanGrey "FemaleEyesHumanGrey" [HDPT:00040211]'; i := i + 1;
  147.   EyesF1[i] := 'FemaleEyesHumanGreyBlindLeft "FemaleEyesHumanGreyBlindLeft" [HDPT:000F81D6]'; i := i + 1;
  148.   EyesF1[i] := 'FemaleEyesHumanHazel "FemaleEyesHumanHazel" [HDPT:00040225]'; i := i + 1;
  149.   EyesF1[i] := 'FemaleEyesHumanHazelBrown "FemaleEyesHumanHazelBrown" [HDPT:00051548]'; i := i + 1;
  150.   EyesF1[i] := 'FemaleEyesHumanIceBlue "FemaleEyesHumanIceBlue" [HDPT:00040228]'; i := i + 1;
  151.   EyesF1[i] := 'FemaleEyesHumanLightBlue "FemaleEyesHumanLightBlue" [HDPT:0007291C]'; i := i + 1;
  152.   EyesF1[i] := 'FemaleEyesHumanLightBlueBloodShot "FemaleEyesHumanLightBlueBloodShot" [HDPT:000F81D5]'; i := i + 1;
  153.   EyesF1[i] := 'FemaleEyesHumanLightGrey "FemaleEyesHumanLightGrey" [HDPT:00040227]'; i := i + 1;
  154.   EyesF1[i] := 'FemaleEyesHumanVampire "FemaleEyesHumanVampire" [HDPT:0007291E]'; i := i + 1;
  155.   EyesF1[i] := 'FemaleEyesHumanVampire01 "FemaleEyesHumanVampire01" [HDPT:02006F90]'; i := i + 1;
  156.   EyesF1[i] := 'FemaleEyesHumanVampire01Nord "FemaleEyesHumanVampire01Nord" [HDPT:0200D6D4]'; i := i + 1;
  157.   EyesF1[i] := 'FemaleEyesHumanVampireNord "FemaleEyesHumanVampireNord" [HDPT:0200D6D3]'; i := i + 1;
  158.   EyesF1[i] := 'FemaleEyesHumanYellow "FemaleEyesHumanYellow" [HDPT:00040224]'; i := i + 1;
  159.   EyesF1[i] := 'FemaleEyesOrcBlind "FemaleEyesOrcBlind" [HDPT:0004021E]'; i := i + 1;
  160.   EyesF1[i] := 'FemaleEyesOrcDarkGrey "FemaleEyesOrcDarkGrey" [HDPT:0004021F]'; i := i + 1;
  161.   EyesF1[i] := 'FemaleEyesOrcIceBlue "FemaleEyesOrcIceBlue" [HDPT:00040220]'; i := i + 1;
  162.   EyesF1[i] := 'FemaleEyesOrcIceBlueBlindRight "FemaleEyesOrcIceBlueBlindRight" [HDPT:00105B52]'; i := i + 1;
  163.   EyesF1[i] := 'FemaleEyesOrcRed "FemaleEyesOrcRed" [HDPT:00040221]'; i := i + 1;
  164.   EyesF1[i] := 'FemaleEyesOrcVampire "FemaleEyesOrcVampire" [HDPT:00107B98]'; i := i + 1;
  165.   EyesF1[i] := 'FemaleEyesOrcYellow "FemaleEyesOrcYellow" [HDPT:00040222]'; i := i + 1;
  166.   EyesF1[i] := 'FemaleEyesWoodElfBlind "FemaleEyesWoodElfBlind" [HDPT:00053995]'; i := i + 1;
  167.   EyesF1[i] := 'FemaleEyesWoodElfBrown "FemaleEyesWoodElfBrown" [HDPT:00051510]'; i := i + 1;
  168.   EyesF1[i] := 'FemaleEyesWoodElfDeepBrown "FemaleEyesWoodElfDeepBrown" [HDPT:0005392C]'; i := i + 1;
  169.   EyesF1[i] := 'FemaleEyesWoodElfDeepViolet "FemaleEyesWoodElfDeepViolet" [HDPT:0005392D]'; i := i + 1;
  170.   EyesF1[i] := 'FemaleEyesWoodElfDeepVioletBlindRight "FemaleEyesWoodElfDeepVioletBlindRight" [HDPT:00108E27]'; i := i + 1;
  171.   EyesF1[i] := 'FemaleEyesWoodElfLightBrown "FemaleEyesWoodElfLightBrown" [HDPT:00053959]';
  172.  
  173.   i := 1;
  174.   EyesM2[i] := 'MaleEyesDarkElfBlind_NEW "MaleEyesDarkElfBlind_NEW" [HDPT:' + LoadOrder + '00084E]'; i := i + 1;
  175.   EyesM2[i] := 'MaleEyesDarkElfDeepRed_NEW "MaleEyesDarkElfDeepRed_NEW" [HDPT:' + LoadOrder + '00084F]'; i := i + 1;
  176.   EyesM2[i] := 'MaleEyesDarkElfDeepRed2_New "MaleEyesDarkElfDeepRed2_New" [HDPT:' + LoadOrder + '000850]'; i := i + 1;
  177.   EyesM2[i] := 'MaleEyesDarkElfDeepRed2BlindRight_NEW "MaleEyesDarkElfDeepRed2BlindRight_NEW" [HDPT:' + LoadOrder + '000851]'; i := i + 1;
  178.   EyesM2[i] := 'MaleEyesDarkElfDeepRedBlindLeft_New "MaleEyesDarkElfDeepRedBlindLeft_New" [HDPT:' + LoadOrder + '000852]'; i := i + 1;
  179.   EyesM2[i] := 'MaleEyesDarkElfRed_New "MaleEyesDarkElfRed_New" [HDPT:' + LoadOrder + '000854]'; i := i + 1;
  180.   EyesM2[i] := 'MaleEyesElfBlind_New "MaleEyesElfBlind_New" [HDPT:' + LoadOrder + '000856]'; i := i + 1;
  181.   EyesM2[i] := 'MaleEyesHighElfDarkYellow_New "MaleEyesHighElfDarkYellow_New [HDPT:' + LoadOrder + '000859]'; i := i + 1;
  182.   EyesM2[i] := 'MaleEyesHighElfDarkYellowBlindLeft_New "MaleEyesHighElfDarkYellowBlindLeft_New" [HDPT:' + LoadOrder + '00085A]'; i := i + 1;
  183.   EyesM2[i] := 'MaleEyesHighElfOrange_New "MaleEyesHighElfOrange_New" [HDPT:' + LoadOrder + '00085B]'; i := i + 1;
  184.   EyesM2[i] := 'MaleEyesHighElfOrangeBlindRight_New "MaleEyesHighElfOrangeBlindRight_New" [HDPT:' + LoadOrder + '00085C]'; i := i + 1;
  185.   EyesM2[i] := 'MaleEyesHighElfYellow_New "MaleEyesHighElfYellow_New" [HDPT:' + LoadOrder + '00085D]'; i := i + 1;
  186.   EyesM2[i] := 'MaleEyesHighElfYellowBlindRight_New "MaleEyesHighElfYellowBlindRight_New" [HDPT:' + LoadOrder + '00085E]'; i := i + 1;
  187.   EyesM2[i] := 'MaleEyesHumanAmber_New "MaleEyesHumanAmber_New" [HDPT:' + LoadOrder + '00085F]'; i := i + 1;
  188.   EyesM2[i] := 'MaleEyesHumanAmberBlindRight_New "MaleEyesHumanAmberBlindRight_New" [HDPT:' + LoadOrder + '000860]'; i := i + 1;
  189.   EyesM2[i] := 'MaleEyesHumanBlind_New "MaleEyesHumanBlind_New" [HDPT:' + LoadOrder + '000861]'; i := i + 1;
  190.   EyesM2[i] := 'MaleEyesHumanBrightGreen_New "MaleEyesHumanBrightGreen_New" [HDPT:' + LoadOrder + '000862]'; i := i + 1;
  191.   EyesM2[i] := 'MaleEyesHumanBrightGreenBlindRight_New "MaleEyesHumanBrightGreenBlindRight_New" [HDPT:' + LoadOrder + '000863]'; i := i + 1;
  192.   EyesM2[i] := 'MaleEyesHumanBrown_New "MaleEyesHumanBrown_New" [HDPT:' + LoadOrder + '000864]'; i := i + 1;
  193.   EyesM2[i] := 'MaleEyesHumanBrownBlindLeft_New "MaleEyesHumanBrownBlindLeft_New" [HDPT:' + LoadOrder + '000865]'; i := i + 1;
  194.   EyesM2[i] := 'MaleEyesHumanBrownBlindRight_New "MaleEyesHumanBrownBlindRight_New" [HDPT:' + LoadOrder + '000866]'; i := i + 1;
  195.   EyesM2[i] := 'MaleEyesHumanBrownBloodShot_New "MaleEyesHumanBrownBloodShot_New" [HDPT:' + LoadOrder + '000867]'; i := i + 1;
  196.   EyesM2[i] := 'MaleEyesHumanDarkBlue_New "MaleEyesHumanDarkBlue_New" [HDPT:' + LoadOrder + '000868]'; i := i + 1;
  197.   EyesM2[i] := 'MaleEyesHumanDemon_New "MaleEyesHumanDemon_New" [HDPT:' + LoadOrder + '000869]'; i := i + 1;
  198.   EyesM2[i] := 'MaleEyesHumanGreenHazelLeft_New "MaleEyesHumanGreenHazelLeft_New" [HDPT:' + LoadOrder + '00086A]'; i := i + 1;
  199.   EyesM2[i] := 'MaleEyesHumanGrey_New "MaleEyesHumanGrey_New" [HDPT:' + LoadOrder + '00086B]'; i := i + 1;
  200.   EyesM2[i] := 'MaleEyesHumanHazel_New "MaleEyesHumanHazel_New" [HDPT:' + LoadOrder + '00086C]'; i := i + 1;
  201.   EyesM2[i] := 'MaleEyesHumanHazelBrown_New "MaleEyesHumanHazelBrown_New" [HDPT:' + LoadOrder + '00086D]'; i := i + 1;
  202.   EyesM2[i] := 'MaleEyesHumanIceBlue_New "MaleEyesHumanIceBlue_New" [HDPT:' + LoadOrder + '00086E]'; i := i + 1;
  203.   EyesM2[i] := 'MaleEyesHumanLightBlue_New "MaleEyesHumanLightBlue_New" [HDPT:' + LoadOrder + '000870]'; i := i + 1;
  204.   EyesM2[i] := 'MaleEyesHumanLightBlueBlindLeft_New "MaleEyesHumanLightBlueBlindLeft_New" [HDPT:' + LoadOrder + '000871]'; i := i + 1;
  205.   EyesM2[i] := 'MaleEyesHumanLightBlueBloodShot_New "MaleEyesHumanLightBlueBloodShot_New" [HDPT:' + LoadOrder + '000872]'; i := i + 1;
  206.   EyesM2[i] := 'MaleEyesHumanLightGrey_New "MaleEyesHumanLightGrey_New" [HDPT:' + LoadOrder + '000873]'; i := i + 1;
  207.   EyesM2[i] := 'MaleEyesHumanLightIceGreyBlindLeft_New "MaleEyesHumanLightIceGreyBlindLeft_New" [HDPT:' + LoadOrder + '000874]'; i := i + 1;
  208.   EyesM2[i] := 'MaleEyesHumanVampire_NEW "MaleEyesHumanVampire_NEW" [HDPT:' + LoadOrder + '000877]'; i := i + 1;
  209.   EyesM2[i] := 'MaleEyesHumanVampire01_NEW "MaleEyesHumanVampire01_NEW" [HDPT:' + LoadOrder + '0008F4]'; i := i + 1;
  210.   EyesM2[i] := 'MaleEyesHumanVampire01Nord_NEW "MaleEyesHumanVampire01Nord_NEW" [HDPT:' + LoadOrder + '0008F5]'; i := i + 1;
  211.   EyesM2[i] := 'MaleEyesHumanVampireNord_NEW "MaleEyesHumanVampireNord_NEW" [HDPT:' + LoadOrder + '0008F6]'; i := i + 1;
  212.   EyesM2[i] := 'MaleEyesHumanYellow_NEW "MaleEyesHumanYellow_NEW" [HDPT:' + LoadOrder + '0008CA]'; i := i + 1;
  213.   EyesM2[i] := 'MaleEyesOrcBlind_New "MaleEyesOrcBlind_New" [HDPT:' + LoadOrder + '000878]'; i := i + 1;
  214.   EyesM2[i] := 'MaleEyesOrcDarkGrey_New "MaleEyesOrcDarkGrey_New" [HDPT:' + LoadOrder + '00087B]'; i := i + 1;
  215.   EyesM2[i] := 'MaleEyesOrcIceBlue_New "MaleEyesOrcIceBlue_New" [HDPT:' + LoadOrder + '00087C]'; i := i + 1;
  216.   EyesM2[i] := 'MaleEyesOrcIceBlueBlindRight_New "MaleEyesOrcIceBlueBlindRight_New" [HDPT:' + LoadOrder + '00087D]'; i := i + 1;
  217.   EyesM2[i] := 'MaleEyesOrcRed_New "MaleEyesOrcRed_New" [HDPT:' + LoadOrder + '00087E]'; i := i + 1;
  218.   EyesM2[i] := 'MaleEyesOrcRedBlindRight_New "MaleEyesOrcRedBlindRight_New" [HDPT:' + LoadOrder + '00087F]'; i := i + 1;
  219.   EyesM2[i] := 'MaleEyesOrcVampire_New "MaleEyesOrcVampire_New" [HDPT:' + LoadOrder + '000880]'; i := i + 1;
  220.   EyesM2[i] := 'MaleEyesOrcYellow_New "MaleEyesOrcYellow_New" [HDPT:' + LoadOrder + '000881]'; i := i + 1;
  221.   EyesM2[i] := 'MaleEyesOrcYellowBlindLeft_New "MaleEyesOrcYellowBlindLeft_New" [HDPT:' + LoadOrder + '000882]'; i := i + 1;
  222.   EyesM2[i] := 'MaleEyesSnowElf_New "MaleEyesSnowElf_New" [HDPT:' + LoadOrder + '00900]'; i := i + 1;
  223.   EyesM2[i] := 'MaleEyesSnowElfVampire_New "MaleEyesSnowElfVampire_New" [HDPT:' + LoadOrder + '000901]'; i := i + 1;
  224.   EyesM2[i] := 'MaleEyesWoodElfBlind_New "MaleEyesWoodElfBlind_New" [HDPT:' + LoadOrder + '000883]'; i := i + 1;
  225.   EyesM2[i] := 'MaleEyesWoodElfBrown_New "MaleEyesWoodElfBrown_New" [HDPT:' + LoadOrder + '000884]'; i := i + 1;
  226.   EyesM2[i] := 'MaleEyesWoodElfDeepBrown_New "MaleEyesWoodElfDeepBrown_New" [HDPT:' + LoadOrder + '000885]'; i := i + 1;
  227.   EyesM2[i] := 'MaleEyesWoodElfDeepBrownBlindRight_New "MaleEyesWoodElfDeepBrownBlindRight_New" [HDPT:' + LoadOrder + '000886]'; i := i + 1;
  228.   EyesM2[i] := 'MaleEyesWoodElfDeepViolet_New "MaleEyesWoodElfDeepViolet_New" [HDPT:' + LoadOrder + '000887]'; i := i + 1;
  229.   EyesM2[i] := 'MaleEyesWoodElfLightBrown_New "MaleEyesWoodElfLightBrown_New" [HDPT:' + LoadOrder + '000889]]'; i := i + 1;
  230.   EyesM2[i] := 'MaleEyesWoodElfLightBrownBlindLeft_New "MaleEyesWoodElfLightBrownBlindLeft_New" [HDPT:' + LoadOrder + '00088A]';
  231.  
  232.  
  233.  i := 1;
  234.   EyesF2[i] := 'FemaleEyesDarkElfBlind_NEW "FemaleEyesDarkElfBlind_NEW" [HDPT:' + LoadOrder + '000843]'; i := i + 1;
  235.   EyesF2[i] := 'FemaleEyesDarkElfDeepRed_NEW "FemaleEyesDarkElfDeepRed_NEW" [HDPT:' + LoadOrder + '00083D]'; i := i + 1;
  236.   EyesF2[i] := 'FemaleEyesDarkElfDeepRed2_NEW "FemaleEyesDarkElfDeepRed2_NEW" [HDPT:FE]  [HDPT:' + LoadOrder + '00083E]'; i := i + 1;
  237.   EyesF2[i] := 'FemaleEyesDarkElfDeepRed2BlindRight_NEW "FemaleEyesDarkElfDeepRed2BlindRight_NEW" [HDPT:' + LoadOrder + '0008DA]'; i := i + 1;
  238.   EyesF2[i] := 'FemaleEyesDarkElfDeepRedBlindLeft_NEW "FemaleEyesDarkElfDeepRedBlindLeft_NEW" [HDP00083AT:' + LoadOrder + '0008D7]'; i := i + 1;
  239.   EyesF2[i] := 'FemaleEyesDarkElfRed_NEW "FemaleEyesDarkElfRed_NEW" [HDPT:' + LoadOrder + '00083A]'; i := i + 1;
  240.   EyesF2[i] := 'FemaleEyesDarkElfUnique_NEW "FemaleEyesDarkElfUnique_NEW" [HDPT:' + LoadOrder + '00084C]'; i := i + 1;
  241.   EyesF2[i] := 'FemaleEyesElfBlind_NEW "FemaleEyesElfBlind_NEW" [HDPT:' + LoadOrder + '00082E]'; i := i + 1;
  242.   EyesF2[i] := 'FemaleEyesHighElfDarkYellow_NEW "FemaleEyesHighElfDarkYellow_NEW" [HDPT:' + LoadOrder + '00082D]'; i := i + 1;
  243.   EyesF2[i] := 'FemaleEyesHighElfOrange_NEW "FemaleEyesHighElfOrange_NEW" [HDPT:' + LoadOrder + '000839]'; i := i + 1;
  244.   EyesF2[i] := 'FemaleEyesHighElfOrangeBlindRight_New "FemaleEyesHighElfOrangeBlindRight_New" [HDPT:' + LoadOrder + '0008DB]'; i := i + 1;
  245.   EyesF2[i] := 'FemaleEyesHighElfYellow_NEW "FemaleEyesHighElfYellow_NEW" [HDPT:' + LoadOrder + '00082A]'; i := i + 1;
  246.   EyesF2[i] := 'FemaleEyesHighElfYellowBlindLeft_New "FemaleEyesHighElfYellowBlindLeft_New" [HDPT:' + LoadOrder + '0008DC]'; i := i + 1;
  247.   EyesF2[i] := 'FemaleEyesHumanAmber_NEW "FemaleEyesHumanAmber_NEW" [HDPT:' + LoadOrder + '000846]'; i := i + 1;
  248.   EyesF2[i] := 'FemaleEyesHumanAmberBlindLeft_NEW "FemaleEyesHumanAmberBlindLeft_NEW" [HDPT:' + LoadOrder + '0008D1]'; i := i + 1;
  249.   EyesF2[i] := 'FemaleEyesHumanBlind_NEW "FemaleEyesHumanBlind_NEW" [HDPT:' + LoadOrder + '000827]'; i := i + 1;
  250.   EyesF2[i] := 'FemaleEyesHumanBrightGreen_NEW "FemaleEyesHumanBrightGreen_NEW" [HDPT:' + LoadOrder + '000845]'; i := i + 1;
  251.   EyesF2[i] := 'FemaleEyesHumanBrown_NEW "FemaleEyesHumanBrown_NEW" [HDPT:' + LoadOrder + '000844]'; i := i + 1;
  252.   EyesF2[i] := 'FemaleEyesHumanBrownBlindRight_NEW "FemaleEyesHumanBrownBlindRight_NEW" [HDPT:' + LoadOrder + '0008CB]'; i := i + 1;
  253.   EyesF2[i] := 'FemaleEyesHumanBrownBloodShot_NEW "FemaleEyesHumanBrownBloodShot_NEW" [HDPT:' + LoadOrder + '00084A]'; i := i + 1;
  254.   EyesF2[i] := 'FemaleEyesHumanDarkBlue_NEW "FemaleEyesHumanDarkBlue_NEW" [HDPT:' + LoadOrder + '000829]'; i := i + 1;
  255.   EyesF2[i] := 'FemaleEyesHumanDarkBlueBlindRight_NEW "FemaleEyesHumanDarkBlueBlindRight_NEW" [HDPT:' + LoadOrder + '0008CF]'; i := i + 1;
  256.   EyesF2[i] := 'FemaleEyesHumanDemon_NEW "FemaleEyesHumanDemon_NEW" [HDPT:' + LoadOrder + '000828]'; i := i + 1;
  257.   EyesF2[i] := 'FemaleEyesHumanGreenHazel_NEW "FemaleEyesHumanGreenHazel_NEW" [HDPT:' + LoadOrder + '00082B]'; i := i + 1;
  258.   EyesF2[i] := 'FemaleEyesHumanGrey_NEW "FemaleEyesHumanGrey_NEW" [HDPT:' + LoadOrder + '00082C]'; i := i + 1;
  259.   EyesF2[i] := 'FemaleEyesHumanGreyBlindLeft_NEW "FemaleEyesHumanGreyBlindLeft_NEW" [HDPT:' + LoadOrder + '0008D0]'; i := i + 1;
  260.   EyesF2[i] := 'FemaleEyesHumanHazel_NEW "FemaleEyesHumanHazel_NEW" [HDPT:' + LoadOrder + '000835]'; i := i + 1;
  261.   EyesF2[i] := 'FemaleEyesHumanHazelBrown_NEW "FemaleEyesHumanHazelBrown_NEW" [HDPT:' + LoadOrder + '00083B]'; i := i + 1;
  262.   EyesF2[i] := 'FemaleEyesHumanIceBlue_NEW "FemaleEyesHumanIceBlue_NEW" [HDPT:' + LoadOrder + '000837]'; i := i + 1;
  263.   EyesF2[i] := 'FemaleEyesHumanLightBlue_NEW "FemaleEyesHumanLightBlue_NEW" [HDPT:' + LoadOrder + 'E000847]'; i := i + 1;
  264.   EyesF2[i] := 'FemaleEyesHumanLightBlueBloodShot_NEW "FemaleEyesHumanLightBlueBloodShot_NEW" [HDPT:' + LoadOrder + '00084B]'; i := i + 1;
  265.   EyesF2[i] := 'FemaleEyesHumanLightGrey_NEW "FemaleEyesHumanLightGrey_NEW" [HDPT:' + LoadOrder + '000836]'; i := i + 1;
  266.   EyesF2[i] := 'FemaleEyesHumanVampire_NEW "FemaleEyesHumanVampire_NEW" [HDPT:' + LoadOrder + '000848]'; i := i + 1;
  267.   EyesF2[i] := 'FemaleEyesHumanVampire01_NEW "FemaleEyesHumanVampire01_NEW" [HDPT:' + LoadOrder + '0008F7]'; i := i + 1;
  268.   EyesF2[i] := 'FemaleEyesHumanVampire01Nord_NEW "FemaleEyesHumanVampire01Nord_NEW" [HDPT:' + LoadOrder + '0008F8]'; i := i + 1;
  269.   EyesF2[i] := 'FemaleEyesHumanVampireNord_NEW "FemaleEyesHumanVampireNord_NEW" [HDPT:' + LoadOrder + '0008F9]'; i := i + 1;
  270.   EyesF2[i] := 'FemaleEyesHumanYellow_NEW "FemaleEyesHumanYellow_NEW" [HDPT:' + LoadOrder + '000834]'; i := i + 1;
  271.   EyesF2[i] := 'FemaleEyesOrcBlind_NEW "FemaleEyesOrcBlind_NEW" [HDPT:' + LoadOrder + '00082F]'; i := i + 1;
  272.   EyesF2[i] := 'FemaleEyesOrcDarkGrey_NEW "FemaleEyesOrcDarkGrey_NEW" [HDPT:' + LoadOrder + '000830]'; i := i + 1;
  273.   EyesF2[i] := 'FemaleEyesOrcIceBlue_NEW "FemaleEyesOrcIceBlue_NEW" [HDPT:' + LoadOrder + '000831]'; i := i + 1;
  274.   EyesF2[i] := 'FemaleEyesOrcIceBlueBlindRight_NEW "FemaleEyesOrcIceBlueBlindRight_NEW" [HDPT:' + LoadOrder + '0008D3]'; i := i + 1;
  275.   EyesF2[i] := 'FemaleEyesOrcRed_NEW "FemaleEyesOrcRed_NEW" [HDPT:' + LoadOrder + '000832]'; i := i + 1;
  276.   EyesF2[i] := 'FemaleEyesOrcVampire_NEW "FemaleEyesOrcVampire_NEW" [HDPT:' + LoadOrder + '00084D]'; i := i + 1;
  277.   EyesF2[i] := 'FemaleEyesOrcYellow_NEW "FemaleEyesOrcYellow_NEW" [HDPT:' + LoadOrder + '000833]'; i := i + 1;
  278.   EyesF2[i] := 'FemaleEyesWoodElfBlind_NEW "FemaleEyesWoodElfBlind_NEW" [HDPT:' + LoadOrder + '000842]'; i := i + 1;
  279.   EyesF2[i] := 'FemaleEyesWoodElfBrown_NEW "FemaleEyesWoodElfBrown_NEW" [HDPT:' + LoadOrder + '000838]'; i := i + 1;
  280.   EyesF2[i] := 'FemaleEyesWoodElfDeepBrown_NEW "FemaleEyesWoodElfDeepBrown_NEW" [HDPT:' + LoadOrder + '00083F]'; i := i + 1;
  281.   EyesF2[i] := 'FemaleEyesWoodElfDeepViolet_NEW "FemaleEyesWoodElfDeepViolet_NEW" [HDPT:' + LoadOrder + '000840]'; i := i + 1;
  282.   EyesF2[i] := 'FemaleEyesWoodElfDeepVioletBlindRight_NEW "FemaleEyesWoodElfDeepVioletBlindRight_NEW" [HDPT:' + LoadOrder + '0008DD]'; i := i + 1;
  283.   EyesF2[i] := 'FemaleEyesWoodElfLightBrown_NEW "FemaleEyesWoodElfLightBrown_NEW" [HDPT:' + LoadOrder + '000841]';
  284.  
  285. end;
  286.  
  287. function swapPart(hPart1: string; hPart2: string): Boolean;
  288. var
  289.   k: IInterface;
  290.   j: integer;
  291.   exists: boolean;
  292. begin
  293.     Result := false;
  294.    
  295.     if (hPart1 = SNone) OR (hPart2 = SNone) then exit;
  296.     if (hPart1 = hPart2) then exit;
  297.    
  298.     // check if hPart1 exists
  299.     exists := false;
  300.     for j := 0 to ElementCount(kwda) - 1 do
  301.         if (GetEditValue(ElementByIndex(kwda, j))= hPart1) then begin
  302.             exists := true;
  303.             RemovebyIndex(kwda, j, False);
  304.             break;
  305.         end;
  306.    
  307.     if exists then begin
  308.         // CK likes to save empty KWDA with only a single NULL form, use it if so
  309.         if (ElementCount(kwda) = 1) and (GetNativeValue(ElementByIndex(kwda, 0)) = 0) then
  310.             SetEditValue(ElementByIndex(kwda, 0), hPart2)
  311.         else begin
  312.             // add a new keyword at the end of list
  313.             // container, index, element, aOnlySK
  314.             k := ElementAssign(kwda, HighInteger, nil, False);
  315.             if not Assigned(k) then begin
  316.                 AddMessage('Can''t add keyword to ' + Name(e));
  317.                 Exit;
  318.             end;
  319.         end;
  320.     Result := true;
  321.     end;
  322. end;
  323.  
  324. function addMaster(e: IInterface): Boolean;
  325. var
  326.   j: integer;
  327.   sFileName: string;
  328.   plugin: IInterface;
  329. begin
  330.     Result := false;
  331.     sFileName := GetFileName(GetFile(e));
  332.     for j := 0 to FileCount - 1 do begin
  333.         plugin := FileByIndex(j);
  334.         if (GetFileName(plugin) <> sFileName) then
  335.             continue;
  336.         AddMasterIfMissing(plugin, 'VanillaStarsightEyes.esp');
  337.         HasMaster := true;
  338.         Result := true;
  339.         Break;
  340.     end;
  341. end;
  342.  
  343. function Initialize: integer;
  344. var
  345.   j: integer;
  346.   plugin: IInterface;
  347. begin
  348.     FoundMaster := false;
  349.  
  350.     for j := 0 to FileCount - 2 do begin
  351.         plugin := FileByIndex(j);
  352.         if (GetFileName(plugin) <> 'VanillaStarsightEyes.esp') then
  353.             continue;
  354.         LoadOrder := IntToHex(j-1,2);
  355.         FoundMaster := true;
  356.         Break;
  357.     end;
  358.  
  359.     if FoundMaster then
  360.         buildList()
  361.     else
  362.         AddMessage('ERROR:  VanillaStarsightEyes.esp not found in load order');
  363. end;
  364.  
  365. function Process(e: IInterface): integer;
  366. var
  367.   sRace: string;
  368.   iRacePos, j: integer;
  369.   isFemale: Boolean;
  370. begin
  371.     Result := 0;
  372.    
  373.     if NOT FoundMaster then Exit;
  374.     if NOT HasMaster then addMaster(e);
  375.  
  376.     // apply only to NPC
  377.     if Signature(e) <> 'NPC_' then Exit;
  378.  
  379.     // get existing keywords list or add a new
  380.     kwda := ElementBySignature(e, 'PNAM');
  381.     if not Assigned(kwda) then
  382.         kwda := Add(e, 'PNAM', True);
  383.    
  384.     // no keywords subrecord (it must exist) - terminate script
  385.     if not Assigned(kwda) then begin
  386.         AddMessage('No head parts subrecord in ' + Name(e));
  387.         Result := 1;
  388.         Exit;
  389.     end;
  390.  
  391.     // setup
  392.  
  393.     isFemale := ElementExists(e, 'ACBS - Configuration\Flags\Female');
  394.    
  395.     // swap eyes
  396.     if isFemale then begin
  397.         for j := 1 to NumEyesF do begin
  398.         swapPart(EyesF1[j], EyesF2[j]);
  399.         end;
  400.  
  401.     end else begin
  402.         for j := 1 to NumEyesM do begin
  403.         swapPart(EyesM1[j], EyesM2[j]);
  404.         end;
  405.     end;
  406.  
  407. end;
  408.  
  409. end.
RAW Paste Data