And here we are!
Well, it won't do anything about "three-fingered hands", as those aren't part of my mod, the dragons in my vision have 5 fingers

... but it should now remove any dragon bodyparts from non-dragons.
Also there's a regular check for your race, just in case you somehow manage to change it, which will react accordingly when you end your draconic existance and clean up after itself, but it's still not doing any rather complex tests each run.
Combined-slot items now should work properly as well... or so I hope... tell me, if they still aren't.
Here's the quest script:
scn DrakeDragonRaceQuestScriptlong adaptedItemsArraylong itemsDCpartcArraylong itemsDCpartfArraylong itemsDCpartcfArraylong itemsDCpartArraylong itemsDCpartfoArraylong itemsDCpartfcArrayshort showclawsshort showfeetshort showtailshort showwingsshort showhelmetshort forcehelmetshort forceuppershort forcelowershort forcehandsshort forcefeetshort forcetailshort forcecombinedshort initshort debugshort debugShowRaceTokenshort debugShowRevTokenshort doConfigshort choicearray_var confArrayarray_var itemArrayarray_var defaultItemArrayarray_var replacerTemplateArrayarray_var tempArrayarray_var itemstring_var raceIdlong framesToSkiplong itemsRevertPerFrameref sourcefloat timerfloat playerXfloat playerYfloat playerZfloat fQuestDelayTimebegin gameMode set fQuestDelayTime to 0.5 if(init == 0) if(getOBSEVersion < 17) MessageBoxEX "Dragon Race:%rCurrent release requires OBSE v0017 or higher to run.%rYou don't have a proper version of OBSE!" set init to -1 return endif set showhelmet to 1 set showclaws to 1 set showfeet to 1 set showtail to 1 set showwings to 1 set forcehelmet to 0 set forceupper to 0 set forcelower to 1 set forcehands to 1 set forcefeet to 1 set forcetail to 1 set forcecombined to 0 let confArray := ar_Construct StringMap let confArray["races"] := ar_Construct StringMap let confArray["races"]["dragon"] := DrakeDragon let confArray["races"]["dragonblack"] := DrakeDragonBlack let confArray["races"]["dragonredgold"] := DrakeDragonRedGold foreach item <- confArray["races"] let raceId := item["key"] let confArray[raceId] := ar_Construct StringMap let confArray[raceId]["hair"] := ar_Construct StringMap let confArray[raceId]["hair"]["slotmask"] := 2 let confArray[raceId]["hair"]["combinations"] := ar_Construct Array let confArray[raceId]["hair"]["combinations"][0] := ar_Construct StringMap let confArray[raceId]["hair"]["combinations"][0]["tag"] := "dcpart" let confArray[raceId]["hair"]["combinations"][0]["req"] := showhelmet let confArray[raceId]["hair"]["forced"] := forcehelmet let confArray[raceId]["upperbody"] := ar_Construct StringMap let confArray[raceId]["upperbody"]["slotmask"] := 4 let confArray[raceId]["upperbody"]["combinations"] := ar_Construct Array let confArray[raceId]["upperbody"]["combinations"][0] := ar_Construct StringMap let confArray[raceId]["upperbody"]["combinations"][0]["tag"] := "dcpartc" let confArray[raceId]["upperbody"]["combinations"][0]["req"] := eval (showclaws == 1 && showfeet == 0) let confArray[raceId]["upperbody"]["combinations"][1] := ar_Construct StringMap let confArray[raceId]["upperbody"]["combinations"][1]["tag"] := "dcpartf" let confArray[raceId]["upperbody"]["combinations"][1]["req"] := eval (showclaws == 0 && showfeet == 1) let confArray[raceId]["upperbody"]["combinations"][2] := ar_Construct StringMap let confArray[raceId]["upperbody"]["combinations"][2]["tag"] := "dcpartcf" let confArray[raceId]["upperbody"]["combinations"][2]["req"] := eval (showclaws == 1 && showfeet == 1) let confArray[raceId]["upperbody"]["combinations"][3] := ar_Construct StringMap let confArray[raceId]["upperbody"]["combinations"][3]["tag"] := "dcpart" let confArray[raceId]["upperbody"]["combinations"][3]["req"] := showclaws let confArray[raceId]["upperbody"]["forced"] := forceupper let confArray[raceId]["lowerbody"] := ar_Construct StringMap let confArray[raceId]["lowerbody"]["slotmask"] := 8 let confArray[raceId]["lowerbody"]["combinations"] := ar_Construct Array let confArray[raceId]["lowerbody"]["combinations"][0] := ar_Construct StringMap let confArray[raceId]["lowerbody"]["combinations"][0]["tag"] := "dcpart" let confArray[raceId]["lowerbody"]["combinations"][0]["req"] := showfeet let confArray[raceId]["lowerbody"]["forced"] := forcelower let confArray[raceId]["hands"] := ar_Construct StringMap let confArray[raceId]["hands"]["slotmask"] := 16 let confArray[raceId]["hands"]["combinations"] := ar_Construct Array let confArray[raceId]["hands"]["combinations"][0] := ar_Construct StringMap let confArray[raceId]["hands"]["combinations"][0]["tag"] := "dcpart" let confArray[raceId]["hands"]["combinations"][0]["req"] := showclaws let confArray[raceId]["hands"]["forced"] := forcehands let confArray[raceId]["feet"] := ar_Construct StringMap let confArray[raceId]["feet"]["slotmask"] := 32 let confArray[raceId]["feet"]["combinations"] := ar_Construct Array let confArray[raceId]["feet"]["combinations"][0] := ar_Construct StringMap let confArray[raceId]["feet"]["combinations"][0]["tag"] := "dcpart" let confArray[raceId]["feet"]["combinations"][0]["req"] := showfeet let confArray[raceId]["feet"]["forced"] := forcefeet let confArray[raceId]["tail"] := ar_Construct StringMap let confArray[raceId]["tail"]["slotmask"] := 32768 let confArray[raceId]["tail"]["combinations"] := ar_Construct Array let confArray[raceId]["tail"]["combinations"][0] := ar_Construct StringMap let confArray[raceId]["tail"]["combinations"][0]["tag"] := "dcpartt" let confArray[raceId]["tail"]["combinations"][0]["req"] := eval (showtail == 1 && showwings == 0) let confArray[raceId]["tail"]["combinations"][1] := ar_Construct StringMap let confArray[raceId]["tail"]["combinations"][1]["tag"] := "dcpartw" let confArray[raceId]["tail"]["combinations"][1]["req"] := eval (showtail == 0 && showwings == 1) let confArray[raceId]["tail"]["combinations"][2] := ar_Construct StringMap let confArray[raceId]["tail"]["combinations"][2]["tag"] := "dcpartwt" let confArray[raceId]["tail"]["combinations"][2]["req"] := eval (showtail == 1 && showwings == 1) let confArray[raceId]["tail"]["combinations"][3] := ar_Construct StringMap let confArray[raceId]["tail"]["combinations"][3]["tag"] := "dcpart" let confArray[raceId]["tail"]["combinations"][3]["req"] := eval (showtail == 1 && showwings == 1) let confArray[raceId]["tail"]["forced"] := forcetail Loop let itemArray := ar_Construct StringMap let itemArray["original"] := ar_Construct StringMap ;let itemArray["original"][x] := original_BaseId let itemArray["dcpartc"] := ar_Construct StringMap let itemArray["dcpartf"] := ar_Construct StringMap let itemArray["dcpartcf"] := ar_Construct StringMap let itemArray["dcpartw"] := ar_Construct StringMap let itemArray["dcpartt"] := ar_Construct StringMap let itemArray["dcpartwt"] := ar_Construct StringMap let itemArray["dcpart"] := ar_Construct StringMap ;let itemArray[tagCode][x] := adapted_BaseId ;matching indices "x"! let defaultItemArray := ar_Construct StringMap let defaultItemArray["hair"] := ar_Construct StringMap let defaultItemArray["hair"]["dcpart"] := 0 let defaultItemArray["upperbody"] := ar_Construct StringMap let defaultItemArray["upperbody"]["dcpartc"] := DrakeEmptyItem ;no default item needed for upperbody let defaultItemArray["upperbody"]["dcpartf"] := DrakeEmptyItem let defaultItemArray["upperbody"]["dcpartcf"] := DrakeEmptyItem let defaultItemArray["upperbody"]["dcpart"] := DrakeEmptyItem let defaultItemArray["lowerbody"] := ar_Construct StringMap let defaultItemArray["lowerbody"]["dcpart"] := DrakeDragonLegs let defaultItemArray["hands"] := ar_Construct StringMap let defaultItemArray["hands"]["dcpart"] := DrakeDragonClaws let defaultItemArray["feet"] := ar_Construct StringMap let defaultItemArray["feet"]["dcpart"] := DrakeDragonFeet let defaultItemArray["tail"] := ar_Construct StringMap let defaultItemArray["tail"]["dcpartt"] := DrakeDragonTail let defaultItemArray["tail"]["dcpartw"] := DrakeDragonWings let defaultItemArray["tail"]["dcpartwt"] := DrakeDragonWingsTail let defaultItemArray["tail"]["dcpart"] := DrakeEmptyItem ;replacer templates let replacerTemplateArray := ar_Construct StringMap let replacerTemplateArray["hair"] := ar_Construct StringMap let replacerTemplateArray["hair"]["dcpart"] := DrakeEmptyItem let replacerTemplateArray["upperbody"] := ar_Construct StringMap let replacerTemplateArray["upperbody"]["dcpartc"] := DrakeEmptyItem ;no replacer templates needed for upperbody let replacerTemplateArray["upperbody"]["dcpartf"] := DrakeEmptyItem let replacerTemplateArray["upperbody"]["dcpartcf"] := DrakeEmptyItem let replacerTemplateArray["upperbody"]["dcpart"] := DrakeEmptyItem let replacerTemplateArray["lowerbody"] := ar_Construct StringMap let replacerTemplateArray["lowerbody"]["dcpart"] := DrakeDragonLegWraps let replacerTemplateArray["hands"] := ar_Construct StringMap let replacerTemplateArray["hands"]["dcpart"] := DrakeDragonHandWraps let replacerTemplateArray["feet"] := ar_Construct StringMap let replacerTemplateArray["feet"]["dcpart"] := DrakeDragonFootWraps let replacerTemplateArray["tail"] := ar_Construct StringMap let replacerTemplateArray["tail"]["dcpartt"] := DrakeEmptyItem let replacerTemplateArray["tail"]["dcpartw"] := DrakeEmptyItem let replacerTemplateArray["tail"]["dcpartwt"] := DrakeEmptyItem let replacerTemplateArray["tail"]["dcpart"] := DrakeEmptyItem let tempArray := ar_Construct StringMap set framesToSkip to 10 set itemsRevertPerFrame to 100 MessageBoxEX "Dragon Race:%rAll requirements met. Arrays initialized successfully." set doConfig to -1 set init to 1 endif if(doConfig == 1) MessageBoxEX "Dragon Race > Do You want to keep all default settings?|Yes|No" set doConfig to -2 return elseif(doConfig == -2) set choice to getButtonPressed if(choice == 0) ;stick to defaults MessageBoxEX "Dragon Race > Forced unequipping:%rBy default this will also affect items%rcovering more than 1 slot at once,%r(e.g. The Arena Raiments or DB Armor)%rleaving actors running around naked,%rif they weren't adapted yet.%rDo You wish to make an exception%rto allow non-fitting combined-slot items?|Yes|No" set doConfig to 12 elseif(choice == 1) ;customize MessageBoxEX "Dragon Race > Select Your shape:%rDo You want to be Full-Dragon shape?|Yes|No" set doConfig to 2 endif return elseif(doConfig == 2) ;full-dragon or custom? set choice to getButtonPressed if(choice == 0) ;stay full-dragon set showclaws to 1 set showfeet to 1 set showtail to 1 set showwings to 1 MessageBoxEX "Dragon Race > Select Your shape:%rDo You want controlled helmet slot,%rnot actually force-equipping anything%rbut keeping non-fitting helmets unequipped?|Yes|No" set doConfig to 5 elseif(choice == 1) ;further customize MessageBoxEX "Dragon Race > Select Your shape:%rWhich wings & tail combination do You prefer?|Wings and tail|Only wings|Only tail|None at all" set doConfig to 3 endif return elseif(doConfig == 3) ;tail & wings options set choice to getButtonPressed if(choice > -1) if(choice == 0) ;both set showtail to 1 set showwings to 1 elseif(choice == 1) ;only wings set showtail to 0 set showwings to 1 elseif(choice == 2) ;only tail set showtail to 1 set showwings to 0 elseif(choice == 3) ;neither wings nor tail set showtail to 0 set showwings to 0 endif MessageBoxEX "Dragon Race > Select Your shape:%rWhich hands & feet/legs combination do You prefer?|Dragon hands and feet/legs|Dragon hands but human feet/legs|Human hands but dragon feet/legs|Human hands and human feet/legs" set doConfig to 4 endif return elseif(doConfig == 4) ;hands & feet options set choice to getButtonPressed if(choice > -1) if(choice == 0) ;both set showclaws to 1 set showfeet to 1 elseif(choice == 1) ;dragon hands, human feet set showclaws to 1 set showfeet to 0 elseif(choice == 2) ;humand hands, dragon feet set showclaws to 0 set showfeet to 1 elseif(choice == 3) ;all human set showclaws to 0 set showfeet to 0 endif MessageBoxEX "Dragon Race > Select Your shape:%rDo You want controlled helmet slot,%rnot actually force-equipping anything%rbut keeping non-fitting helmets unequipped?|Yes|No" set doConfig to 5 endif return elseif(doConfig == 5) ;helmet options set choice to getButtonPressed if(choice > -1) if(choice == 0) ;controlled helmet set showhelmet to 1 elseif(choice == 1) ;keep hairstyles set showhelmet to 0 endif MessageBoxEX "Dragon Race > Forced unequipping:%rBy default unequipping of non-fitting items%ris forced for all slots but upperbody.%rThis includes visual replacement while keeping stats.%rWhich settings do You prefer?|Keep default (All)|None at all|Customize..." set doConfig to 6 endif return elseif(doConfig == 6) set choice to getButtonPressed if(choice > -1) if(choice == 0); all slots set forcehelmet to 1 set forceupper to 0 set forcehands to 1 set forcelower to 1 set forcefeet to 1 set forcetail to 1 MessageBoxEX "Dragon Race > Forced unequipping:%rBy default this will also affect items%rcovering more than 1 slot at once,%r(e.g. The Arena Raiments or DB Armor)%rleaving actors running around naked,%rif they weren't adapted yet.%rDo You wish to make an exception%rto allow non-fitting combined-slot items?|Yes|No" set doConfig to 12 elseif(choice == 1) ;none at all set forcehelmet to 0 set forceupper to 0 set forcehands to 0 set forcelower to 0 set forcefeet to 0 set forcetail to 0 MessageBoxEX "Dragon Race > Forced unequipping:%rBy default this will also affect items%rcovering more than 1 slot at once,%r(e.g. The Arena Raiments or DB Armor)%rleaving actors running around naked,%rif they weren't adapted yet.%rDo You wish to make an exception%rto allow non-fitting combined-slot items?|Yes|No" set doConfig to 12 elseif(choice == 2) ;customize MessageBoxEX "Dragon Race > Forced unequipping:%rDo You want the helmet/hair slot to be forced?%r(Only relevant, if it is controlled.)|Yes|No" set doConfig to 7 endif endif return elseif(doConfig == 7) set choice to getButtonPressed if(choice > -1) if(choice == 0) ;yes set forcehelmet to 1 elseif(choice == 1) ;no set forcehelmet to 0 endif MessageBoxEX "Dragon Race > Forced unequipping:%rDo You want the lowerbody/legs slot to be forced?%r(Only relevant, if it is in Dragon shape.)|Yes|No" set doConfig to 8 endif return elseif(doConfig == 8) ;lowerbody set choice to getButtonPressed if(choice > -1) if(choice == 0) ;yes set forcelower to 1 elseif(choice == 1) ;no set forcelower to 0 endif MessageBoxEX "Dragon Race > Forced unequipping:%rDo You want the hands slot to be forced?%r(Only relevant, if it is in Dragon shape.)|Yes|No" set doConfig to 9 endif return elseif(doConfig == 9) ;hands set choice to getButtonPressed if(choice > -1) if(choice == 0) ;yes set forcehands to 1 elseif(choice == 1) ;no set forcehands to 0 endif MessageBoxEX "Dragon Race > Forced unequipping:%rDo You want the feet slot to be forced?%r(Only relevant, if it is in Dragon shape.)|Yes|No" set doConfig to 10 endif return elseif(doConfig == 10) ;feet set choice to getButtonPressed if(choice > -1) if(choice == 0) ;yes set forcefeet to 1 elseif(choice == 1) ;no set forcefeet to 0 endif MessageBoxEX "Dragon Race > Forced unequipping:%rDo You want the tail slot to be forced?%r(Only relevant, if tail or wings were selected.)|Yes|No" set doConfig to 11 endif return elseif(doConfig == 11) ;tail set choice to getButtonPressed if(choice > -1) if(choice == 0) ;yes set forcetail to 1 elseif(choice == 1) ;no set forcetail to 0 endif MessageBoxEX "Dragon Race > Forced unequipping:%rBy default this will also affect items%rcovering more than 1 slot at once,%r(e.g. The Arena Raiments or DB Armor)%rleaving actors running around naked,%rif they weren't adapted yet.%rDo You wish to make an exception%rto allow non-fitting combined-slot items?|Yes|No" set doConfig to 12 endif return elseif(doConfig == 12) ;combined-slot items exception set choice to getButtonPressed if(choice > -1) if(choice == 0) ;yes set forcecombined to 0 elseif(choice == 1) ;no set forcecombined to 1 endif set doConfig to 13 endif return elseif(doConfig == 13) ;finish MessageBoxEX "Dragon Race: Thank You for your time.%rYour Dragon race should now be successfully configured.%rIf You wish to do this again, just type%r'set DragonStartQuest.doConfig to 1'%rinto the console.%rIf You called this in the middle of a game,%rYou might need to reequip your clothing,%rfor the changes to take effect!" set doConfig to 0 elseif(doConfig == -1) ;prepare for next frame set doConfig to 1 return endif foreach item <- confArray["races"] let raceId := item["key"] ;update shape shift settings, just in case let confArray[raceId]["hair"]["combinations"][0]["req"] := showhelmet let confArray[raceId]["upperbody"]["combinations"][0]["req"] := eval (showclaws == 1 && showfeet == 0) let confArray[raceId]["upperbody"]["combinations"][1]["req"] := eval (showclaws == 0 && showfeet == 1) let confArray[raceId]["upperbody"]["combinations"][2]["req"] := eval (showclaws == 1 && showfeet == 1) let confArray[raceId]["upperbody"]["combinations"][3]["req"] := showclaws let confArray[raceId]["lowerbody"]["combinations"][0]["req"] := showfeet let confArray[raceId]["hands"]["combinations"][0]["req"] := showclaws let confArray[raceId]["feet"]["combinations"][0]["req"] := showfeet let confArray[raceId]["tail"]["combinations"][0]["req"] := eval (showtail == 1 && showwings == 0) let confArray[raceId]["tail"]["combinations"][1]["req"] := eval (showtail == 0 && showwings == 1) let confArray[raceId]["tail"]["combinations"][2]["req"] := eval (showtail == 1 && showwings == 1) ;update forced unequipping, just in case let confArray[raceId]["hair"]["forced"] := forcehelmet let confArray[raceId]["upperbody"]["forced"] := forceupper let confArray[raceId]["lowerbody"]["forced"] := forcelower let confArray[raceId]["hands"]["forced"] := forcehands let confArray[raceId]["feet"]["forced"] := forcefeet let confArray[raceId]["tail"]["forced"] := forcetail Loop let raceId := ar_Find (player.getRace) confArray["races"] if eval (raceId != "") if(player.getItemCount DrakeDragonRaceToken < 1) player.addItemNS DrakeDragonRaceToken 1 endif else if(player.getItemCount DrakeDragonRaceReverterToken < 1) player.addItemNS DrakeDragonRaceReverterToken 1 endif endif set source to DrakeDragonRaceScanner ;move into new cell with player and reset count so spell is cast immediately if(source.getInSameCell player != 1) source.moveTo player set timer to 0 endif if(timer <= 0) set playerX to player.getPos X source.setPos X playerX set playerY to player.getPos Y source.setPos Y playerY set playerZ to player.getPos Z source.setPos Z playerZ source.cast DrakeDragonRaceScannerAura player set timer to 1 else set timer to (timer - getSecondsPassed) endifend
Here's the token script:
scn DrakeDragonRaceTokenScriptref actorRefref actorRaceref actslotContentref oldslotContentref tempItemshort initshort actorFemaleshort switchItemsshort wearsAdaptedshort foundAdaptedshort requirementshort foundRequirementshort currentRequirementshort slotCodeshort index2long frameNumlong slotMaskarray_var confArrayarray_var itemArrayarray_var defaultItemArrayarray_var replacerTemplateArrayarray_var slotArrayarray_var repeatArrayarray_var keysArrayarray_var itemarray_var item2string_var indexstring_var tagIdstring_var tagCodestring_var currentlyWearingstring_var shouldBeWearingstring_var slotIdstring_var raceIdfloat healthBufferbegin gameMode if eval(-1 == ar_Size confArray) set init to 0 endif if(init != 1) set actorRef to 0 if(DrakeDragonRaceQuest.init != 1) return endif let confArray := DrakeDragonRaceQuest.confArray let itemArray := DrakeDragonRaceQuest.itemArray let defaultItemArray := DrakeDragonRaceQuest.defaultItemArray let replacerTemplateArray := DrakeDragonRaceQuest.replacerTemplateArray let slotArray := ar_Construct StringMap let repeatArray := ar_Construct StringMap set frameNum to 0 set actorFemale to -1 set init to 1 endif if(actorRef == 0) set actorRef to getContainer return endif if(actorRace != actorRef.getRace) set actorRace to actorRef.getRace let confArray := DrakeDragonRaceQuest.confArray let raceId := ar_Find (actorRef.getRace) confArray["races"] if eval (raceId != "") let confArray := confArray[raceId] ;race-specific part of confArray let keysArray := ar_Keys confArray ForEach item <- keysArray let slotId := item["value"] let slotArray[slotId] := DrakeEmptyItem ;initialize empty let repeatArray[slotId] := 0 Loop else ;is not a dragon, remove bodyparts, if present! ForEach item <- defaultItemArray ForEach item2 <- item["value"] let tempItem := item2["value"] if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem > 0) actorRef.removeItemNS tempItem (actorRef.getItemCount tempItem) endif Loop Loop removeMe ;is not a dragon, should not have this! endif endif if(actorFemale == -1) set actorFemale to actorRef.isFemale endif if(frameNum < DrakeDragonRaceQuest.framesToSkip) set frameNum to (frameNum + 1) return ;dont run every frame else set frameNum to 0 endif if(actorRef.getInSameCell player != 1) if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRaceToken == 1) actorRef.stopMagicShaderVisuals DrakeDEFriendlyDetectedXR endif set init to 0 removeMe endif if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRaceToken == 1) actorRef.playMagicShaderVisuals DrakeDEFriendlyDetectedXR else actorRef.stopMagicShaderVisuals DrakeDEFriendlyDetectedXR endif ;provide with bodyparts ForEach item <- defaultItemArray ForEach item2 <- item["value"] let tempItem := item2["value"] if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem < 1) actorRef.addItemNS tempItem 1 endif Loop Loop ForEach item <- confArray let slotId := item["key"] let oldslotContent := slotArray[slotId] ;check slot for changes let slotMask := confArray[slotId]["slotmask"] set actslotContent to (actorRef.getEquipmentSlotMask slotMask) if eval (actslotContent != oldslotContent || repeatArray[slotId] == 1) let index := "" let index2 := ar_First confArray[slotId]["combinations"] While eval ((index == "") && (index2 != ar_BadNumericIndex)) let tagId := confArray[slotId]["combinations"][index2]["tag"] let index := ar_Find oldslotContent itemArray[tagId] let index2 := ar_Next confArray[slotId]["combinations"] index2 Loop if eval (index != "") ;needs exchange if(actorRef.getItemCount oldslotContent > 0) let tempItem := itemArray["original"][index] actorRef.removeItemNS oldslotContent 1 actorRef.addItemNS tempItem 1 endif endif let shouldBeWearing := "original" set foundAdapted to 0 set foundRequirement to 0 ForEach item2 <- confArray[slotId]["combinations"] let tagId := item2["value"]["tag"] if eval (item2["key"] == ar_Last confArray[slotId]["combinations"]) let tagCode := "_" + tagId else let tagCode := "_" + tagId + ".nif" endif let requirement := item2["value"]["req"] if(actorFemale == 1 && isBipedModelPathValid 1 actslotContent == 1) set wearsAdapted to compareFemaleBipedPath $tagCode actslotContent else set wearsAdapted to compareMaleBipedPath $tagCode actslotContent endif if(wearsAdapted == 1 && foundAdapted != 1) ;always take the 1st one set foundAdapted to 1 let currentlyWearing := tagId set currentRequirement to requirement endif if(requirement == 1 && foundRequirement != 1) ;always take the 1st one set foundRequirement to 1 let shouldBeWearing := tagId endif Loop set switchItems to 0 if(foundAdapted == 1) ;is wearing an adapted item if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape if(currentRequirement == 0) ;in case of shape shifting races and worn adapted item not fitting selected shape let index := ar_Find actslotContent itemArray[currentlyWearing] if eval (index != "") ;safety check let tempItem := itemArray[shouldBeWearing][index] set switchItems to 1 endif endif else ;is wearing adapted item or bodypart but should not let index := ar_Find actslotContent itemArray[currentlyWearing] if eval (index != "") ;no bodypart let tempItem := itemArray["original"][index] set switchItems to 1 else ;bodypart set tempItem to 0 set switchItems to 2 endif endif else ;not wearing any adapted item if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape if(actslotContent != 0) ;normal clothing let index := ar_Find actslotContent itemArray["original"] if eval (index != "") ;already an adapted present if eval (ar_HasKey itemArray[shouldBeWearing] index) let tempItem := itemArray[shouldBeWearing][index] else let tempItem := itemArray[(ar_Last itemArray)][index] endif set switchItems to 1 else ;try to find adapted item set switchItems to 3 endif else ;empty let tempItem := defaultItemArray[slotId][shouldBeWearing] set switchItems to 2 endif endif endif ;handle updates let repeatArray[slotId] := 0 if(switchItems == 1 && tempItem != 0) ;just swap set slotCode to getEquipmentSlot actslotContent set healthBuffer to actorRef.getEquippedCurrentHealth slotCode actorRef.addItemNS tempItem 1 actorRef.equipItemNS tempItem actorRef.removeItemNS actslotContent 1 actorRef.setEquippedCurrentHealth healthBuffer slotCode elseif(switchItems == 2) ;equip bodyparts if(tempItem == 0) actorRef.unequipItemNS actslotContent else actorRef.equipItemNS tempItem endif elseif(switchItems == 3) ;check for presence of alternatives let index := $(ar_Size itemArray["original"]) ;prepare this outside of foreach ForEach item2 <- confArray[slotId]["combinations"] let tagId := item2["value"]["tag"] let tagCode := ".nif|_" + tagId + ".nif" if(isBipedModelPathValid 0 actslotContent == 1) copyMaleBipedPath actslotContent DrakeTempItem else setMaleBipedPath "empty" DrakeTempItem endif modMaleBipedPath $tagCode DrakeTempItem if(isBipedModelPathValid 1 actslotContent == 1) copyFemaleBipedPath actslotContent DrakeTempItem else setFemaleBipedPath "empty" DrakeTempItem endif modFemaleBipedPath $tagCode DrakeTempItem if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;adapted clothing exists for at least one gender if eval ((ar_HasKey itemArray["original"] index) == 0) let itemArray["original"][index] := actslotContent ;do this only once endif set tempItem to cloneForm actslotContent if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist copyMaleBipedPath DrakeTempItem tempItem endif if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist copyFemaleBipedPath DrakeTempItem tempItem endif let itemArray[tagId][index] := tempItem else ;use replacer templates instead if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off let tempItem := replacerTemplateArray[slotId][tagId] if(tempItem != DrakeEmptyItem) if(isBipedModelPathValid 0 tempItem == 1) copyMaleBipedPath tempItem DrakeTempItem else setMaleBipedPath "empty" DrakeTempItem endif if(isBipedModelPathValid 1 tempItem == 1) copyFemaleBipedPath tempItem DrakeTempItem else setFemaleBipedPath "empty" DrakeTempItem endif if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;replacer template exists for at least one gender if eval ((ar_HasKey itemArray["original"] index) == 0) let itemArray["original"][index] := actslotContent ;do this only once endif set tempItem to cloneForm actslotContent if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist copyMaleBipedPath DrakeTempItem tempItem endif if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist copyFemaleBipedPath DrakeTempItem tempItem endif let itemArray[tagId][index] := tempItem endif endif endif endif endif Loop if eval (ar_HasKey itemArray["original"] index) ;at least 1 adapted clothing was found during foreach let repeatArray[slotId] := 1 ;do exchange next frame else ;no adapted clothing found if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off let tempItem := defaultItemArray[slotId][shouldBeWearing] if(tempItem == 0) actorRef.unequipItemNS actslotContent else actorRef.equipItemNS tempItem endif endif endif endif endif endif set oldslotContent to (actorRef.getEquipmentSlotMask slotMask) let slotArray[slotId] := oldslotContent Loopendbegin menuMode 1002 || 1008 if eval(-1 == ar_Size confArray) set init to 0 endif if(init != 1) set actorRef to 0 if(DrakeDragonRaceQuest.init != 1) return endif let confArray := DrakeDragonRaceQuest.confArray let itemArray := DrakeDragonRaceQuest.itemArray let defaultItemArray := DrakeDragonRaceQuest.defaultItemArray let replacerTemplateArray := DrakeDragonRaceQuest.replacerTemplateArray let slotArray := ar_Construct StringMap let repeatArray := ar_Construct StringMap set frameNum to 0 set actorFemale to -1 set init to 1 endif if(actorRef == 0) set actorRef to getContainer return endif if(actorRace != actorRef.getRace) set actorRace to actorRef.getRace let confArray := DrakeDragonRaceQuest.confArray let raceId := ar_Find (actorRef.getRace) confArray["races"] if eval (raceId != "") let confArray := confArray[raceId] ;race-specific part of confArray let keysArray := ar_Keys confArray ForEach item <- keysArray let slotId := item["value"] let slotArray[slotId] := DrakeEmptyItem ;initialize empty let repeatArray[slotId] := 0 Loop else ;is not a dragon, remove bodyparts, if present! ForEach item <- defaultItemArray ForEach item2 <- item["value"] let tempItem := item2["value"] if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem > 0) actorRef.removeItemNS tempItem (actorRef.getItemCount tempItem) endif Loop Loop removeMe ;is not a dragon, should not have this! endif endif if(actorRef.getIsReference player != 1) return ;NPCs don't need control during MenuMode endif if(actorFemale == -1) set actorFemale to actorRef.isFemale endif if(frameNum < DrakeDragonRaceQuest.framesToSkip) set frameNum to (frameNum + 1) return ;dont run every frame else set frameNum to 0 endif if(actorRef.getInSameCell player != 1) if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRaceToken == 1) actorRef.stopMagicShaderVisuals DrakeDEFriendlyDetectedXR endif set init to 0 removeMe endif ;provide with bodyparts ForEach item <- defaultItemArray ForEach item2 <- item["value"] let tempItem := item2["value"] if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem < 1) actorRef.addItemNS tempItem 1 endif Loop Loop ForEach item <- confArray let slotId := item["key"] let oldslotContent := slotArray[slotId] ;check slot for changes let slotMask := confArray[slotId]["slotmask"] set actslotContent to (actorRef.getEquipmentSlotMask slotMask) if eval (actslotContent != oldslotContent || repeatArray[slotId] == 1) let index := "" let index2 := ar_First confArray[slotId]["combinations"] While eval ((index == "") && (index2 != ar_BadNumericIndex)) let tagId := confArray[slotId]["combinations"][index2]["tag"] let index := ar_Find oldslotContent itemArray[tagId] let index2 := ar_Next confArray[slotId]["combinations"] index2 Loop if eval (index != "") ;needs exchange if(actorRef.getItemCount oldslotContent > 0) let tempItem := itemArray["original"][index] actorRef.removeItemNS oldslotContent 1 actorRef.addItemNS tempItem 1 endif endif let shouldBeWearing := "original" set foundAdapted to 0 set foundRequirement to 0 ForEach item2 <- confArray[slotId]["combinations"] let tagId := item2["value"]["tag"] if eval (item2["key"] == ar_Last confArray[slotId]["combinations"]) let tagCode := "_" + tagId else let tagCode := "_" + tagId + ".nif" endif let requirement := item2["value"]["req"] if(actorFemale == 1 && isBipedModelPathValid 1 actslotContent == 1) set wearsAdapted to compareFemaleBipedPath $tagCode actslotContent else set wearsAdapted to compareMaleBipedPath $tagCode actslotContent endif if(wearsAdapted == 1 && foundAdapted != 1) ;always take the 1st one set foundAdapted to 1 let currentlyWearing := tagId set currentRequirement to requirement endif if(requirement == 1 && foundRequirement != 1) ;always take the 1st one set foundRequirement to 1 let shouldBeWearing := tagId endif Loop set switchItems to 0 if(foundAdapted == 1) ;is wearing an adapted item if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape if(currentRequirement == 0) ;in case of shape shifting races and worn adapted item not fitting selected shape let index := ar_Find actslotContent itemArray[currentlyWearing] if eval (index != "") ;safety check let tempItem := itemArray[shouldBeWearing][index] set switchItems to 1 endif endif else ;is wearing adapted item or bodypart but should not let index := ar_Find actslotContent itemArray[currentlyWearing] if eval (index != "") ;no bodypart let tempItem := itemArray["original"][index] set switchItems to 1 else ;bodypart set tempItem to 0 set switchItems to 2 endif endif else ;not wearing any adapted item if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape if(actslotContent != 0) ;normal clothing let index := ar_Find actslotContent itemArray["original"] if eval (index != "") ;already an adapted present if eval (ar_HasKey itemArray[shouldBeWearing] index) let tempItem := itemArray[shouldBeWearing][index] else let tempItem := itemArray[(ar_Last itemArray)][index] endif set switchItems to 1 else ;try to find adapted item set switchItems to 3 endif else ;empty let tempItem := defaultItemArray[slotId][shouldBeWearing] set switchItems to 2 endif endif endif ;handle updates let repeatArray[slotId] := 0 if(switchItems == 1 && tempItem != 0) ;just swap set slotCode to getEquipmentSlot actslotContent set healthBuffer to actorRef.getEquippedCurrentHealth slotCode actorRef.addItemNS tempItem 1 actorRef.equipItemNS tempItem actorRef.removeItemNS actslotContent 1 actorRef.setEquippedCurrentHealth healthBuffer slotCode elseif(switchItems == 2) ;equip bodyparts if(tempItem == 0) actorRef.unequipItemNS actslotContent else actorRef.equipItemNS tempItem endif elseif(switchItems == 3) ;check for presence of alternatives let index := $(ar_Size itemArray["original"]) ;prepare this outside of foreach ForEach item2 <- confArray[slotId]["combinations"] let tagId := item2["value"]["tag"] let tagCode := ".nif|_" + tagId + ".nif" if(isBipedModelPathValid 0 actslotContent == 1) copyMaleBipedPath actslotContent DrakeTempItem else setMaleBipedPath "empty" DrakeTempItem endif modMaleBipedPath $tagCode DrakeTempItem if(isBipedModelPathValid 1 actslotContent == 1) copyFemaleBipedPath actslotContent DrakeTempItem else setFemaleBipedPath "empty" DrakeTempItem endif modFemaleBipedPath $tagCode DrakeTempItem if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;adapted clothing exists for at least one gender if eval ((ar_HasKey itemArray["original"] index) == 0) let itemArray["original"][index] := actslotContent ;do this only once endif set tempItem to cloneForm actslotContent if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist copyMaleBipedPath DrakeTempItem tempItem endif if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist copyFemaleBipedPath DrakeTempItem tempItem endif let itemArray[tagId][index] := tempItem else ;use replacer templates instead if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off let tempItem := replacerTemplateArray[slotId][tagId] if(tempItem != DrakeEmptyItem) if(isBipedModelPathValid 0 tempItem == 1) copyMaleBipedPath tempItem DrakeTempItem else setMaleBipedPath "empty" DrakeTempItem endif if(isBipedModelPathValid 1 tempItem == 1) copyFemaleBipedPath tempItem DrakeTempItem else setFemaleBipedPath "empty" DrakeTempItem endif if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;replacer template exists for at least one gender if eval ((ar_HasKey itemArray["original"] index) == 0) let itemArray["original"][index] := actslotContent ;do this only once endif set tempItem to cloneForm actslotContent if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist copyMaleBipedPath DrakeTempItem tempItem endif if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist copyFemaleBipedPath DrakeTempItem tempItem endif let itemArray[tagId][index] := tempItem endif endif endif endif endif Loop if eval (ar_HasKey itemArray["original"] index) ;at least 1 adapted clothing was found during foreach let repeatArray[slotId] := 1 ;do exchange next frame else ;no adapted clothing found if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off let tempItem := defaultItemArray[slotId][shouldBeWearing] if(tempItem == 0) actorRef.unequipItemNS actslotContent else actorRef.equipItemNS tempItem endif endif endif endif endif endif set oldslotContent to (actorRef.getEquipmentSlotMask slotMask) let slotArray[slotId] := oldslotContent Loopend
And this one's for the reverter token:
scn DrakeDragonRaceReverterTokenScriptref actorRefref tempItemref tempItem2array_var itemarray_var item2long numItemslong endilong istring_var tagIdstring_var indexlong frameNumarray_var itemArrayarray_var defaultItemArrayshort equippedshort initshort init2float healthBuffershort slotCodebegin menuMode 1002 || 1008 if(init != 1) set actorRef to 0 if(DrakeDragonRaceQuest.init != 1) return endif let itemArray := DrakeDragonRaceQuest.itemArray let defaultItemArray := DrakeDragonRaceQuest.defaultItemArray set frameNum to 0 set init2 to 0 set init to 1 endif if eval (-1 == ar_Size itemArray) ;shouldn't happen, but just in case if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRevToken == 1) actorRef.stopMagicShaderVisuals DrakeDEHostileDetectedXR endif removeMe endif if(actorRef == 0) set actorRef to getContainer return endif if(init2 != 1) set numItems to actorRef.getNumItems set i to (numItems - 1) set init2 to 1 endif if(frameNum < DrakeDragonRaceQuest.framesToSkip) set frameNum to (frameNum + 1) return ;dont run every frame else set frameNum to 0 set endi to (i - DrakeDragonRaceQuest.itemsRevertPerFrame) endif label if(i >= endi && i >= 0) set tempItem to actorRef.getInventoryObject i if((isArmor tempItem == 1) || (isClothing tempItem == 1)) ForEach item <- itemArray if eval (item["key"] == "original") Continue endif let tagId := item["key"] let index := ar_Find tempItem itemArray[tagId] if eval (index != "") ;needs exchange let tempItem2 := itemArray["original"][index] set equipped to (actorRef.getEquipped tempItem) if(equipped == 1) set slotCode to getEquipmentSlot tempItem set healthBuffer to actorRef.getEquippedCurrentHealth slotCode endif actorRef.removeItemNS tempItem 1 actorRef.addItemNS tempItem2 1 if(equipped == 1) actorRef.equipItemNS tempItem2 actorRef.setEquippedCurrentHealth healthBuffer slotCode endif endif Loop endif set i to (i - 1) goto endif if(i < 0) set init to 0 if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRevToken == 1) actorRef.stopMagicShaderVisuals DrakeDEHostileDetectedXR endif ;remove bodyparts, if present! ForEach item <- defaultItemArray ForEach item2 <- item["value"] let tempItem := item2["value"] if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem > 0) actorRef.removeItemNS tempItem (actorRef.getItemCount tempItem) endif Loop Loop removeMe ;we're done, remove us endifendbegin gameMode if(init != 1) set actorRef to 0 if(DrakeDragonRaceQuest.init != 1) return endif let itemArray := DrakeDragonRaceQuest.itemArray let defaultItemArray := DrakeDragonRaceQuest.defaultItemArray set frameNum to 0 set init2 to 0 set init to 1 endif if eval (-1 == ar_Size itemArray) ;shouldn't happen, but just in case if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRevToken == 1) actorRef.stopMagicShaderVisuals DrakeDEHostileDetectedXR endif removeMe endif if(actorRef == 0) set actorRef to getContainer return endif if(init2 != 1) set numItems to actorRef.getNumItems set i to (numItems - 1) set init2 to 1 endif if(frameNum < DrakeDragonRaceQuest.framesToSkip) set frameNum to (frameNum + 1) return ;dont run every frame else set frameNum to 0 set endi to (i - DrakeDragonRaceQuest.itemsRevertPerFrame) endif if(DrakeDragonRaceQuest.debug == 1) if(DrakeDragonRaceQuest.debugShowRevToken == 1) actorRef.playMagicShaderVisuals DrakeDEHostileDetectedXR else actorRef.stopMagicShaderVisuals DrakeDEHostileDetectedXR endif endif label if(i >= endi && i >= 0) set tempItem to actorRef.getInventoryObject i if((isArmor tempItem == 1) || (isClothing tempItem == 1)) ForEach item <- itemArray if eval (item["key"] == "original") Continue endif let tagId := item["key"] let index := ar_Find tempItem itemArray[tagId] if eval (index != "") ;needs exchange let tempItem2 := itemArray["original"][index] set equipped to (actorRef.getEquipped tempItem) if(equipped == 1) set slotCode to getEquipmentSlot tempItem set healthBuffer to actorRef.getEquippedCurrentHealth slotCode endif actorRef.removeItemNS tempItem 1 actorRef.addItemNS tempItem2 1 if(equipped == 1) actorRef.equipItemNS tempItem2 actorRef.setEquippedCurrentHealth healthBuffer slotCode endif endif Loop endif set i to (i - 1) goto endif if(i < 0) set init to 0 if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRevToken == 1) actorRef.stopMagicShaderVisuals DrakeDEHostileDetectedXR endif ;remove bodyparts, if present! ForEach item <- defaultItemArray ForEach item2 <- item["value"] let tempItem := item2["value"] if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem > 0) actorRef.removeItemNS tempItem (actorRef.getItemCount tempItem) endif Loop Loop removeMe ;we're done, remove us endifend
I'll take another look into the token providing spell script and see if it needs any attention as well, but I think these should do already.
Whoever wants to put them into the ESP and try them out for me, feel free to upload the updated ESP somewhere and provide a link in here.
I can't do it myself until my laptop gets repaired unfortunately. :nope:
However, please give me feedback... especially if I made some silly compiler errors in there... I don't have any means to syntax-check these at hand right now.