Jump to content

[LE] custom spell to identify target actor (even leveled actors)


Archny

Recommended Posts

If you like to use non-SKSE papyrus code, you should build a conditions (like a tree) with keywords for the actors race.

 

Something like that:

 

Scriptname xyzRecognizeActorRaceEffectScript extends ActiveMagicEffect
; https://forums.nexusmods.com/index.php?/topic/8323603-custom-spell-to-identify-target-actor-even-leveled-actors/

  Int  iLC        ; value holder of last actor check

; mod load order
; --------------
; 00 Skyrim.esm
; 01 Update.esm
; 02 Dawnguard.esm
; 03 Hearthfires.esm
; 04 Dragonborn.esm
; 0x05 first user mod
; ..
; 0xFE last user mod


; -- EVENTs -- 2

EVENT OnEffectStart(Actor akTarget, Actor akCaster)
    Debug.Trace(" OnEffectStart() - target = " +akTarget+ ", caster = " +akCaster)        ; debug info

    int i = myF_GetRaceNumber(akTarget)
    IF (i > 0)
        myF_Show(i, akTarget)
    ENDIF
ENDEVENT


EVENT OnEffectFinish(Actor akTarget, Actor akCaster)
    Debug.Trace(" OnEffectFinish() - target = " +akTarget+ ", caster = " +akCaster)        ; debug info
ENDEVENT


; -- FUNCTIONs -- 14

;-----------------------------------
FUNCTION myF_Show(Int i, Actor aRef)
;-----------------------------------
    Debug.Notification("RaceNumber is " +i)
ENDFUNCTION

;-----------------------------------------
Bool FUNCTION myF_HasKW(Actor aRef, Int i)  ; helper
;-----------------------------------------
    RETURN aRef.HasKeyword( Game.GetForm(i) as Keyword )
ENDFUNCTION


;----------------------------------------
Bool FUNCTION myF_IsRaceKW(Race r, Int i)  ; helper
;----------------------------------------
    RETURN r.HasKeyword( Game.GetForm(i) as Keyword )
ENDFUNCTION


;------------------------------------------
Bool FUNCTION myF_IsVT(VoiceType VT, Int i)  ; helper
;------------------------------------------
    RETURN (VT == Game.GetForm(i) as VoiceType)
ENDFUNCTION


;-----------------------------------------
Int FUNCTION myF_GetRaceNumber(Actor aRef)
;-----------------------------------------
IF aRef.IsDead()
    RETURN -2        ; actor is dead
ENDIF
;---------

;    int t = aRef.GetFormID()
;    
;; for understanding:
;; "t" is a local integer stack Variable living in this function only
;; "iLC" is a global integer heap Variable with access to the whole script, but invisible for other scripts
;;-------------------
;IF (t == iLC)
;    RETURN 0        ; actor was already checked with last function call
;ENDIF
;;---------
;    iLC = t                                ; update variable for the next call
;; Do never save as actor or objectReference like this "lastRef = aRef", that would make this Ref persistent!!!
;;-------------------------------------------------------------------------------------------------------------

IF aRef.IsGhost()
    RETURN -3        ; actor is ghost
ENDIF
;---------
IF aRef.IsCommandedActor()
    RETURN -4        ; actor is under control
ENDIF
;=========
    race r = aRef.GetRace()

IF ( r )
ELSE
    RETURN -1        ; failsafe, race is <None>
ENDIF
;---------
    int n

IF     myF_IsRaceKW(r, 0x00013797)                ; [KYWD:00013797]  ActorTypeDaedra
    n = myF_Daedra(aRef, r)                ; 800            ; Dremora, Atronach, Seeker

;---------------------------------------
ELSEIF myF_IsRaceKW(r, 0x0001397A)                ; [KYWD:0001397A]  ActorTypeDwarven
    n = myF_Dwemer(aRef, r)                ; 900            ; dwemer robots

;---------------------------------------
ELSEIF myF_IsRaceKW(r, 0x00013796)                ; [KYWD:00013796]  ActorTypeUndead
    IF myF_IsRaceKW(r, 0x000A82BB)                ; [KYWD:000A82BB]  Vampire
        n = myF_Vampire(aRef, r)        ; 100
    ELSE
        n = myF_UnDead(aRef, r)            ; 200            ; Draugr, Skeleton, DragonPriest
    ENDIF

;---------------------------------------
ELSEIF myF_IsRaceKW(r, 0x00013795)                ; [KYWD:00013795]  ActorTypeCreature
    IF     myF_IsRaceKW(r, 0x00035D59)            ; [KYWD:00035D59]  ActorTypeDragon (any type of dragon)
        n = myF_Dragons(aRef, r)        ; 700
    ELSEIF myF_IsRaceKW(r, 0x00013798)            ; [KYWD:00013798]  ActorTypeAnimal
        n = myF_AnimalCreatures(aRef, r); 500            ; chaurus, frostbitespider, bear, chicken, cow, horse, rabbit, goat, ..
    ELSE
        n = myF_Creatures(aRef, r)        ; 300            ; Hagraven, ..
    ENDIF

;---------------------------------------
ELSEIF myF_IsRaceKW(r, 0x00013794)                ; [KYWD:00013794]  ActorTypeNPC
    n = myF_Humans(aRef, r)                ; 1000

;---------------------------------------
ELSE
    n = myF_Special(aRef, r)            ; 1 .. 99
ENDIF

    RETURN n
ENDFUNCTION


;/**  ???
; giantMudCrab; venomfangSkeever; valeSabreCat; Bristleback; Fire wyrm
; corruptedShade; corruptedShadeImperial; corruptedShadeStormCloak
; The Reaper; pectralDog; HollowedDead
**/;


;-------------------------------------------
Int FUNCTION myF_Special(Actor aRef, Race r)
;-------------------------------------------
;     IF ((i % 0x00100000) == 0x00015136)

    int i = r.GetFormID()
    int n = 99

    IF     (i == 0x00000019)        ; [RACE:00000019]  DefaultRace "Default Race"
        n = 1

    ELSEIF (i == 0x0403CA97)        ; [RACE:0403CA97]  DLC2MiraakRace "Nord"            **Dragonborn
        n = 2

    ELSEIF (i == 0x0403CECB)        ; [RACE:0403CECB]  DLC2RigidSkeletonRace "Skeleton"    **Dragonborn
        n = 3

    ELSEIF (i == 0x040179CF)        ; [RACE:040179CF]  DLC2MountedRieklingRace            **Dragonborn
        n = 4

    ELSEIF (i == 0x0401FEB8)        ; [RACE:0401FEB8]  DLC2NetchRace ""Netch"            **Dragonborn
        n = 5        ; Netch

    ELSEIF (i == 0x04028580)        ; [RACE:04028580]  DLC2NetchCalfRace "Netch"        **Dragonborn
        n = 6        ; NetchCalf
    ENDIF

    RETURN n
ENDFUNCTION


;------------------------------------------
Int FUNCTION myF_Daedra(Actor aRef, Race r)
;------------------------------------------
    int i = r.GetFormID()
    int n = 800

; ancientStormAtronach

    IF     (i == 0x000131F0)        ; [RACE:000131F0]  DremoraRace "Dremora"
        n = 801

    ELSEIF (i == 0x000131F5)        ; [RACE:000131F5]  AtronachFlameRace "Flame Atronach"
        n = 802        ; flameAtronach

    ELSEIF (i == 0x000131F6)        ; [RACE:000131F6]  AtronachFrostRace "Frost Atronach"
        n = 803        ; frostAtronach

    ELSEIF (i == 0x000131F7)        ; [RACE:000131F7]  AtronachStormRace "Storm Atronach"
        n = 804        ; stormAtronach

    ELSEIF (i == 0x04027BFC)        ; [RACE:04027BFC]  dlc2AshGuardianRace "Storm Atronach"        **Dragonborn
        n = 805        ; ashAtronach

    ELSEIF (i == 0x0401DCB9)        ; [RACE:0401DCB9]  DLC2SeekerRace "HMDaedra"    **Dragonborn
        n = 806        ; Seeker

    ELSEIF (i == 0x0401F98F)        ; [RACE:0401F98F]  dlc2SpectralDragonRace "Spectral Dragon"    **Dragonborn
        n = 807

    ELSEIF (i == 0x04035538)        ; [RACE:04035538]  DLC2DremoraRace "Dremora"    **Dragonborn
        n = 808
    ENDIF

    RETURN n
ENDFUNCTION


;------------------------------------------
Int FUNCTION myF_Dwemer(Actor aRef, Race r)
;------------------------------------------
    int i = r.GetFormID()
    int n = 900

    IF     (i == 0x000131F1)        ; [RACE:000131F1]  DwarvenCenturionRace "Dwemer Centurion"
        n = 901        ; DwarvenCenturion
    
    ELSEIF (i == 0x000131F2)        ; [RACE:000131F2]  DwarvenSphereRace "Dwemer Sphere"
        n = 902        ; DwarvenSphere

    ELSEIF (i == 0x000131F3)        ; [RACE:000131F3]  DwarvenSpiderRace "Dwemer Spider"
        n = 903        ; DwarvenSpider

    ELSEIF (i == 0x0402B014)        ; [RACE:0402B014]  DLC2DwarvenBallistaRace "Dwemer Sphere"    **Dragonborn
        n = 904        ; DwarvenBallista

    ELSEIF (i == 0x02015C34)        ; [RACE:02015C34]  DLC1LD_ForgemasterRace "The Forgemaster"        *Dawnguard
        n = 905        ; ForgeMaster

    ELSEIF (i == 0x0401B637)        ; [RACE:0401B637]  DLC2AshSpawnRace "Draugr"        **Dragonborn
        n = 906        ; AshSpawn
    ENDIF

    RETURN n
ENDFUNCTION


;------------------------------------------
Int FUNCTION myF_UnDead(Actor aRef, Race r)
;------------------------------------------
    int i = r.GetFormID()
    int n = 200

; draugrOverlord_restlesDraugr
; draugrWight_Lord
; draugrScourge_Lord
; draugrDeathLord_draugrDeathOverLord

    IF     (i == 0x00000D53)        ; [RACE:00000D53]  DraugrRace "Draugr"
        n = 201        ; Draugr

    ELSEIF (i == 0x000F71DC)        ; [RACE:000F71DC]  DraugrMagicRace "Draugr"
        n = 202

    ELSEIF (i == 0x02007AF3)        ; [RACE:02007AF3]  DLC1SoulCairnKeeperRace "Draugr"        *Dawnguard
        n = 203        ; soulCairnKeeper

    ELSEIF (i == 0x0200894D)        ; [RACE:0200894D]  DLC1SoulCairnSkeletonArmorRace "Draugr"    *Dawnguard
        n = 204        ; wrathman

    ELSEIF (i == 0x020023E2)        ; [RACE:020023E2]  SkeletonArmorRace "Draugr"    *Dawnguard
        n = 205

    ELSEIF (i == 0x0402A6FD)        ; [RACE:0402A6FD]  DLC2HulkingDraugrRace "Draugr"        **Dragonborn
        n = 206        ; hulkingDraugr

;---------
    ELSEIF (i == 0x000B7998)        ; [RACE:000B7998]  SkeletonRace "Skeleton"
        n = 210        ; skeleton

    ELSEIF (i == 0x000EB872)        ; [RACE:000EB872]  SkeletonNecroRace "Skeleton"
        n = 211        ; skeletonPriest

    ELSEIF (i == 0x000B9FD7)        ; [RACE:000B9FD7]  RigidSkeletonRace "Skeleton"
        n = 212

    ELSEIF (i == 0x02006AFA)        ; [RACE:02006AFA]  DLC1SoulCairnSkeletonNecroRace "Skeleton"    *Dawnguard
        n = 213        ; mistman

    ELSEIF (i == 0x0200A94B)        ; [RACE:0200A94B]  DLC01SoulCairnBonemanRace "Skeleton"        *Dawnguard
        n = 214        ; boneman

    ELSEIF (i == 0x02019FD3)        ; [RACE:02019FD3]  DLC1BlackSkeletonRace "Skeleton"    *Dawnguard
        n = 215

    ELSEIF (i == 0x000EBE18)        ; [RACE:000EBE18]  SkeletonNecroPriestRace "Dragon Priest"
        n = 216        ; dragon priest

    ELSEIF (i == 0x0403911A)        ; [RACE:0403911A]  DLC2AcolyteDragonPriestRace "Dragon Priest"    **Dragonborn
        n = 217

;---------
    ELSEIF (i == 0x02002AE0)        ; [RACE:02002AE0]  DLC1SoulCairnSoulWispRace "Witchlight"    *Dawnguard
        n = 220

    ELSEIF (i == 0x0200C5F0)        ; [RACE:0200C5F0]  DLC1DeathHoundRace "Death Hound"      *Dawnguard.esm
        n = 221        ; deathHound

    ELSEIF (i == 0x02003D02)        ; [RACE:02003D02]  DLC1DeathHoundCompanionRace "Death Hound Companion"    *Dawnguard
        n = 222
    ENDIF

    RETURN n
ENDFUNCTION


;-------------------------------------------
Int FUNCTION myF_Dragons(Actor aRef, Race r)
;-------------------------------------------
    int i = r.GetFormID()
    int n = 700

; bloodDragon
; frostDragon
; elderDragon
; ancientDragon
; reveredDragon
; legendaryDragon
; serpentineDragon

    IF     (i == 0x000E7713)        ; [RACE:000E7713]  AlduinRace "Dragon Race"
        n = 701

    ELSEIF (i == 0x001052A3)        ; [RACE:001052A3]  UndeadDragonRace "Dragon Race"    
        n = 702        ; skeletalDragon

    ELSEIF (i == 0x020117DE)        ; [RACE:020117DE]  DLC1UndeadDragonRace "Dragon Race"  *Dawnguard
        n = 703

    ELSEIF (i == 0x0402C88B)        ; [RACE:0402C88B]  DragonBlackRace "Dragon Race"    **Dragonborn
        n = 704

    ELSEIF (i == 0x0402C88C)        ; [RACE:0402C88C]  DLC2DragonBlackRace ""Dragon Race"    **Dragonborn
        n = 705

    ELSEIF (i == 0x00012E82)        ; [RACE:00012E82]  DragonRace "Dragon Race"
        i = aRef.GetFormID()

        IF     (i == 0x0001CA03)        ; [NPC_:0001CA03]  EncDragon01Fire "Dragon"
            n = 711

; [NPC_:000F8115]  EncDragon01FireNoScript
; [NPC_:000F80FA]  EncDragon01Frost
; [NPC_:000F8116]  EncDragon01FrostNoScript
; [NPC_:000F80FD]  EncDragon02Fire             "Blood Dragon"
; [NPC_:000F8117]  EncDragon02FireNoScript
; [NPC_:000F77F8]  EncDragon02Frost
; [NPC_:000F8118]  EncDragon02FrostNoScript
; [NPC_:000FEA9B]  EncDragon03FireNoScript
; [NPC_:000351C3]  EncDragon03Frost         "Frost Dragon"
; [NPC_:000F8119]  EncDragon03FrostNoScript
; [NPC_:000F811B]  EncDragon04Fire             "Elder Dragon"
; [NPC_:000F8103]  EncDragon04FireNoScript
; [NPC_:000F811A]  EncDragon04Frost         "Elder Dragon"
; [NPC_:000F8102]  EncDragon04FrostNoScript
; [NPC_:000F811C]  EncDragon05Fire             "Ancient Dragon"
; [NPC_:000F811D]  EncDragon05FireNoScript
; [NPC_:000F811E]  EncDragon05Frost         "Ancient Dragon"
; [NPC_:000F811F]  EncDragon05FrostNoScript
; [NPC_:0008BC7F]  EncDragonSnow
; [NPC_:000E8710]  EncDragonSnowNoScript
; [NPC_:0008BC7E]  EncDragonTundra

;;;        ELSEIF (i == 0x)

        ELSE
            n = 710        ; any other real dragon
        ENDIF

    ENDIF

    RETURN n
ENDFUNCTION


;---------------------------------------------------
Int FUNCTION myF_AnimalCreatures(Actor aRef, Race r)  ; 500 .. 699
;---------------------------------------------------
    int i = r.GetFormID()
    int n = 500

; Udefrykte

    IF myF_IsRaceKW(r, 0x000F5D16)    ; [KYWD:000F5D16]  ActorTypeTroll
        IF     (i == 0x00013205)        ; [RACE:00013205]  TrollRace "Troll"
            n = 601        ; troll

        ELSEIF (i == 0x00013206)        ; [RACE:00013206]  TrollFrostRace "Snow Troll"
            n = 602        ; iceTroll

        ELSEIF (i == 0x020117F5)        ; [RACE:020117F5]  DLC1TrollRaceArmored "Troll"        *Dawnguard
            n = 603        ; armoredTroll

        ELSEIF (i == 0x020117F4)        ; [RACE:020117F4]  DLC1TrollFrostRaceArmored "Snow Troll"    *Dawnguard
            n = 604        ; armoredIceTroll
        ELSE
            n = 600
        ENDIF

;---------
    ELSEIF (i == 0x0001320A)        ; [RACE:0001320A]  WolfRace "Wolf"
        i = aRef.GetFormID()

        IF     (i == 0x00023ABE)        ; [NPC_:00023ABE]  EncWolf "Wolf"
            n = 611        ; wolf

        ELSEIF (i == 0x00023ABF)        ; [NPC_:00023ABF]  EncWolfIce "Ice Wolf"
            n = 612        ; iceWolf

        ELSEIF (i == 0x0010FE05)        ; [NPC_:0010FE05]  EncWolfRed
            n = 613        ; redWolf

        ELSEIF (i == 0x000753CE)        ; [NPC_:000753CE]  EncWolfDead "Timberwolf"
            n = 614        ; Timberwolf
        ELSE
            n = 610        ; any other wolf
        ENDIF        

    ELSEIF (i == 0x00106C10)        ; [RACE:00106C10]  C06WolfSpiritRace "Wolf"
        n = 619

;---------
    ELSEIF (i == 0x00109C7C)        ; [RACE:00109C7C]  FoxRace "Fox"
        i = aRef.GetFormID()

        IF     (i == 0x000829B3)        ; [NPC_:000829B3]  EncFox "Fox"
            n = 621        ; fox

        ELSEIF (i == 0x000829B6)        ; [NPC_:000829B6]  EncFoxArctic "Snow Fox"
            n = 622        ; iceFox
        ELSE
            n = 620        ; any other fox
        ENDIF

;---------
    ELSEIF (i == 0x000DE505)        ; [RACE:000DE505]  CartHorseRace "Horse"
        n = 501

    ELSEIF (i == 0x000131FD)        ; [RACE:000131FD]  HorseRace ""Horse"
        n = 502

    ELSEIF (i == 0x000A919D)        ; [RACE:000A919D]  ChickenRace "Chicken"
        n = 503

    ELSEIF (i == 0x0004E785)        ; [RACE:0004E785]  CowRace "Highland Cow"
        n = 504

    ELSEIF (i == 0x000CF89B)        ; [RACE:000CF89B]  DeerRace "Deer"
        n = 505

    ELSEIF (i == 0x0200D0B2)        ; [RACE:0200D0B2]  DLC1DeerGlowRace "Deer"    *Dawnguard
        n = 506

    ELSEIF (i == 0x000131ED)        ; [RACE:000131ED]  ElkRace "Deer"
        n = 507

    ELSEIF (i == 0x00104F45)        ; [RACE:00104F45]  WhiteStagRace "Deer"
        n = 508

    ELSEIF (i == 0x000131FA)        ; [RACE:000131FA]  GoatRace "Goat"
        n = 509

    ELSEIF (i == 0x0006FC4A)        ; [RACE:0006FC4A]  GoatDomesticsRace "Goat"
        n = 510

    ELSEIF (i == 0x0006DC99)        ; [RACE:0006DC99]  HareRace "Rabbit"
        n = 511

    ELSEIF (i == 0x000131FC)        ; [RACE:000131FC]  HorkerRace "Horker"
        n = 512        ; horker

    ELSEIF (i == 0x000131FF)        ; [RACE:000131FF]  MammothRace "Mammoth"
        n = 513        ; mamoth

    ELSEIF (i == 0x000BA545)        ; [RACE:000BA545]  MudcrabRace "Mudcrab"
        n = 514        ; mudCrab

    ELSEIF (i == 0x0401B647)        ; [RACE:0401B647]  DLC2MudcrabSolstheimRace "MudCrab"    **Dragonborn
        n = 515        ; mudcrabSolstheim

    ELSEIF (i == 0x00013201)        ; [RACE:00013201]  SkeeverRace "Skeever"
        n = 516        ; skeever

    ELSEIF (i == 0x000C3EDF)        ; [RACE:000C3EDF]  SkeeverWhiteRace "Skeever"
        n = 517

    ELSEIF (i == 0x00013203)        ; [RACE:00013203]  SlaughterfishRace "Slaughterfish"
        n = 518

    ELSEIF (i == 0x0401B658)        ; [RACE:0401B658]  DLC2AshHopperRace "Scrib"    **Dragonborn
        n = 519        ; AshHopper

    ELSEIF (i == 0x04024038)        ; [RACE:04024038]  DLC2BoarRace        **Dragonborn
        n = 520

;---------
    ELSEIF (i == 0x000131E7)        ; [RACE:000131E7]  BearBrownRace "Bear"
        n = 531        ; bear

    ELSEIF (i == 0x000131E8)        ; [RACE:000131E8]  BearBlackRace "Cave Bear"
        n = 532        ; caveBear

    ELSEIF (i == 0x000131E9)        ; [RACE:000131E9]  BearSnowRace "Snow Bear"
        n = 533        ; iceBear

;---------
    ELSEIF (i == 0x00013200)        ; [RACE:00013200]  SabreCatRace "Sabre Cat"
        n = 541        ; sabreCat

    ELSEIF (i == 0x00013202)        ; [RACE:00013202]  SabreCatSnowyRace "Snowy Sabre Cat"
        n = 542        ; iceSabreCat

    ELSEIF (i == 0x0200D0B6)        ; [RACE:0200D0B6]  DLC1SabreCatGlowRace "Sabre Cat"        *Dawnguard
        n = 543

;---------
    ELSEIF (i == 0x000131EE)        ; [RACE:000131EE]  DogRace "Dog"
        n = 551        ; dog

    ELSEIF (i == 0x000F1AC4)        ; [RACE:000F1AC4]  DogCompanionRace "Dog"
        n = 552

    ELSEIF (i == 0x000F905F)        ; [RACE:000F905F]  MG07DogRace "Dog"
        n = 553

    ELSEIF (i == 0x000CD657)        ; [RACE:000CD657]  DA03BarbasDogRace "Dog"
        n = 554

    ELSEIF (i == 0x02018B36)        ; [RACE:02018B36]  DLC1HuskyBareRace "Husky"        *Dawnguard
        n = 555        ; huskie

    ELSEIF (i == 0x02018B33)        ; [RACE:02018B33]  DLC1HuskyArmoredRace "Armoured Husky"    *Dawnguard
        n = 556

    ELSEIF (i == 0x020122B7)        ; [RACE:020122B7]  DLC1HuskyBareCompanionRace "Husky Companion"    *Dawnguard
        n = 557

    ELSEIF (i == 0x02003D01)        ; [RACE:02003D01]  DLC1HuskyArmoredCompanionRace "Armoured Husky Companion"  *Dawnguard
        n = 558


; chaurusHunterFledgling
; frostbiteSpiderSnow
; giantFrostbitSpiderSnow

    ELSEIF (i == 0x000131EB)        ; [RACE:000131EB]  ChaurusRace "Chaurus"
        n = 571        ; chaurus

    ELSEIF (i == 0x000A5601)        ; [RACE:000A5601]  ChaurusReaperRace "Chaurus"
        n = 572        ; chaurusReaper

    ELSEIF (i == 0x020051FB)        ; [RACE:020051FB]  DLC1ChaurusHunterRace "Chaurus Flyer"        *Dawnguard
        n = 573        ; chaurusHunter

    ELSEIF (i == 0x02015136)        ; [RACE:02015136] *** frozen chaurus *** DLC1_BF_ChaurusRace
        n = 574        ; frozenChaurus

    ELSEIF myF_IsVT(aRef.GetVoiceType(), 0x0001F152)        ; [VTYP:0001F152] CrChaurusVoice
        n = 570        ; unknown type of chaurus

;---------
    ELSEIF (i == 0x000131F8)        ; [RACE:000131F8]  FrostbiteSpiderRace "Frostbite Spider"
        n = 581        ; frostbiteSpider

    ELSEIF (i == 0x0004E507)        ; [RACE:0004E507]  FrostbiteSpiderRaceGiant ""Frostbite Spider"
        n = 582        ; giantFrostbiteSpider

    ELSEIF (i == 0x00053477)        ; [RACE:00053477]  FrostbiteSpiderRaceLarge "Frostbite Spider"
        n = 583

    ELSEIF (i == 0x04014449)        ; [RACE:04014449]  DLC2ExpSpiderBaseRace "Frostbite Spider"        **Dragonborn
        n = 584

    ELSEIF (i == 0x04027483)        ; [RACE:04027483]  DLC2ExpSpiderPackmuleRace "Frostbite Spider"        **Dragonborn
        n = 585

    ELSEIF myF_IsVT(aRef.GetVoiceType(), 0x0001F21D)        ; [VTYP:0001F21D] CrFrostbiteSpiderVoice
        n = 580        ; unknown frostbitespider

    ELSEIF myF_IsVT(aRef.GetVoiceType(), 0x0002AFD9)        ; [VTYP:0002AFD9] CrFrostbiteSpiderGiantVoice
        n = 589        ; unknown frostbitespidergiant
    ENDIF

    RETURN n
ENDFUNCTION


;---------------------------------------------
Int FUNCTION myF_Creatures(Actor aRef, Race r)
;---------------------------------------------
    int i = r.GetFormID()
    int n = 300

    IF     (i == 0x000131FB)        ; [RACE:000131FB] HagravenRace "Hagraven"
        n = 301        ; Hagraven

    ELSEIF (i == 0x000B6F95)        ; [RACE:000B6F95]  MagicAnomalyRace "Essence of Magicka"
        n = 302        ; MagicAnomaly

    ELSEIF (i == 0x04017F44)        ; [RACE:04017F44] DLC2RieklingRace              **Dragonborn
        n = 303

    ELSEIF (i == 0x0401A50A)        ; [RACE:0401A50A] DLC2ThirskRieklingRace        **Dragonborn
        n = 304

; gargoyleBrute
; gargoyleSentinel
; darkGargoyle
; StoneGargoyle
; whispMother

    ELSEIF (i == 0x0200A2C6)        ; [RACE:0200A2C6]  DLC1GargoyleRace "Gargoyle"        *Dawnguard
        n = 310        ; gargoyle

    ELSEIF (i == 0x02010D00)        ; [RACE:02010D00]  DLC1GargoyleVariantBossRace "Gargoyle"  *Dawnguard
        n = 311

    ELSEIF (i == 0x02019D86)        ; [RACE:02019D86]  DLC1GargoyleVariantGreenRace "Gargoyle"  *Dawnguard
        n = 312

;---------
    ELSEIF (i == 0x000CDD84)        ; [RACE:000CDD84] WerewolfBeastRace "Werewolf"
        n = 321        ; werewolf

    ELSEIF (i == 0x0401E17B)        ; [RACE:0401E17B] DLC2WerebearBeastRace "Werewolf" **Dragonborn
        n = 322        ; werebear

;---------
    ELSEIF (i == 0x000131FE)        ; [RACE:000131FE]  IceWraithRace "Ice Wraith"        
        n = 330        ; Ice Wraith

    ELSEIF (i == 0x04029EE7)        ; [RACE:04029EE7]  DLC2dunKarstaagIceWraithRace "Ice Wraith"    **Dragonborn
        n = 331        ; Karstaag

    ELSEIF (i == 0x00013208)        ; [RACE:00013208]  WispRace "Wisp"
        n = 335

    ELSEIF (i == 0x000F1182)        ; [RACE:000F1182]  WispShadeRace "Wisp"
        n = 336

;---------
    ELSEIF (i == 0x00013204)        ; [RACE:00013204]  SprigganRace "Spriggan"
        n = 340        ; spriggan

    ELSEIF (i == 0x000F3903)        ; [RACE:000F3903]  SprigganMatronRace "Spriggan"
        n = 341        ; sprigganMatron

    ELSEIF (i == 0x02013B77)        ; [RACE:02013B77]  SprigganEarthMotherRace "Spriggan"        *Dawnguard
        n = 342        ; sprigganEarthMother

    ELSEIF (i == 0x0401B644)        ; [RACE:0401B644]  DLC2SprigganBurntRace "Spriggan"        **Dragonborn
        n = 343        ; BurntSpriggan

    ELSEIF (i == 0x0009AA44)        ; [RACE:0009AA44]  SprigganSwarmRace "Witchlight"
        n = 344

    ELSEIF (i == 0x0009AA3C)        ; [RACE:0009AA3C]  SwarmRace "Witchlight"
        n = 345

    ELSEIF (i == 0x00013209)        ; [RACE:00013209]  WitchlightRace "Witchlight"
        n = 346

    ELSEIF (i == 0x04029EFC)        ; [RACE:04029EFC]  DLC2dunInstrumentsRace "Witchlight"        **Dragonborn
        n = 347


; ++ Giants ++
    ELSEIF myF_IsVT(aRef.GetVoiceType(), 0x0001F225)    ; [VTYP:0001F225]  CrGiantVoice
        n = 360
        i = i % 0x00100000                ; convert to FormId without load order position

        IF     (i == 0x000131F9)    ; [RACE:000131F9] GiantRace "Giant"
            n = 361        ; giant

        ELSEIF (i == 0x000CAE13)    ; [RACE:000CAE13] C00GiantOutsideWhiterunRace  on quest "C00GiantAttack" (000C97D9) as [Actor < (000C97D2)>]
            n = 362

        ELSEIF (i == 0x0001CAD8)    ; [RACE:0401CAD8]  DLC2GhostFrostGiantRace "Ghost Giant" **Dragonborn
            n = 363        ; frostGiant

        ELSEIF (i == 0x00068C10)    ; [RACE:0?068C10] 00GiantFrostRace  *** SkyMoMod.esm // Immersive Creatures
            n = 364

        ELSEIF (i == 0x00046613)    ; [RACE:0?046613] 00GianttreantRace *** SkyMoMod.esm // Immersive Creatures
            n = 365

        ELSEIF (i == 0x0006813E)    ; [RACE:0?06813E] 00FireGiantrace   *** SkyMoMod.esm // Immersive Creatures
            n = 366

        ELSEIF (i == 0x000280CD)    ; [RACE:0?0280CD] 00GiantbruteRace  *** SkyMoMod.esm // Immersive Creatures
            n = 367
        ENDIF

;---------
    ELSEIF (i == 0x000131F4)        ; [RACE:000131F4] FalmerRace "Falmer"
        n = 380

    ELSEIF (i == 0x0201AACC)        ; [RACE:0201AACC] *** NOT *** FalmerFrozenVampRace "Falmer"
        n = 381

;---------
    ELSEIF (i == 0x04014495)        ; [RACE:04014495] DLC2LurkerRace "Giant"        **Dragonborn
        n = 390        ; Lurker

    ELSE
        i = i % 0x00100000

        IF     (i == 0x0001C358)    ; [RACE:0?01C358] 00FalmerRaceHulk    *** SkyMoMod.esm // Immersive Creatures
            n = 382

        ELSEIF (i == 0x000876CB)    ; [RACE:0?0876CB] 00LurkerRace        *** SkyMoMod.esm // Immersive Creatures
            n = 391

        ELSEIF (i == 0x0005EA5E)    ; [RACE:0?05EA5E] 00guarrace          *** SkyMoMod.esm // Immersive Creatures
            n = 392
        ENDIF
    ENDIF

    RETURN n
ENDFUNCTION


;------------------------------------------
Int FUNCTION myF_Humans(Actor aRef, Race r)
;------------------------------------------
    int i = r.GetFormID()
    int n = 1000

    IF myF_IsRaceKW(r, 0x000D61D1)    ; [KYWD:000D61D1]  IsBeastRace
        n = 1019            ; ### unknown beast race ###

        IF     (i == 0x00013740)    ; [RACE:00013740]  ArgonianRace "Argonian"
            n = 1001
        ELSEIF (i == 0x00013745)    ; [RACE:00013745]  KhajiitRace "Khajiit"
            n = 1011
        ENDIF

    ELSEIF (i == 0x00067CD8)        ; [RACE:00067CD8]  ElderRace "Old People Race"
        n = 1020

    ELSEIF (i == 0x00013747)        ; [RACE:00013747]  OrcRace "Orsimer"
        n = 1021

    ELSEIF (i == 0x00013744)        ; [RACE:00013744]  ImperialRace "Imperial"
        n = 1022

    ELSEIF (i == 0x0002C659)        ; [RACE:0002C659]  ImperialRaceChild "Imperial"
        n = 1023

    ELSEIF (i == 0x00013748)        ; [RACE:00013748]  RedguardRace "Redguard"
        n = 1024

    ELSEIF (i == 0x0002C65A)        ; [RACE:0002C65A]  RedguardRaceChild "Redguard"
        n = 1025

;---------
    ELSEIF (i == 0x0002C65C)        ; [RACE:0002C65C]  BretonRaceChild "Breton"
        n = 1031

    ELSEIF (i == 0x00013741)        ; [RACE:00013741]  BretonRace "Breton"
        n = 1030
        IF (aRef.GetFactionRank(Game.GetForm(0x00043599) as Faction) > -1)                        ; [FACT:00043599]  ForswornFaction "Forsworn Faction"                
            n = 1032            ; Forsworn
            IF (aRef.GetItemCount( Game.GetForm(0x0003AD61) ) > 0)    ; [INGR:0003AD61]  BriarHeart "Briar Heart"
                n = 1033        ; Forsworn Briarheart
            ENDIF
        ENDIF

;---------
    ELSEIF (i == 0x00013746)        ; [RACE:00013746]  NordRace "Nord"
        n = 1040

    ELSEIF (i == 0x0002C65B)        ; [RACE:0002C65B]  NordRaceChild "Nord"
        n = 1041

    ELSEIF (i == 0x0007EAF3)        ; [RACE:0007EAF3]  NordRaceAstrid "Nord"
        n = 1042

    ELSEIF (i == 0x0200E88A)        ; [RACE:0200E88A]  DLC1NordRace "Nord"      *Dawnguard
        n = 1043

    ELSEIF (i == 0x0010760A)        ; [RACE:0010760A]  ManakinRace "Nord"  (Mannequins)
        n = 1044

;---------
    ELSEIF (i == 0x00013742)        ; [RACE:00013742]  DarkElfRace "Dunmer"    
        n = 1050

    ELSEIF (i == 0x00013743)        ; [RACE:00013743]  HighElfRace "Altmer"    
        n = 1060

    ELSEIF (i == 0x00013749)        ; [RACE:00013749]  WoodElfRace "Bosmer"
        n = 1070

    ELSEIF (i == 0x0200377D)        ; [RACE:0200377D]  SnowElfRace "Snow Elf"        *Dawnguard
        n = 1080

    ELSEIF (i == 0x00071E6A)        ; [RACE:00071E6A]  InvisibleRace "Invisible Race"
        n = 1099
    ENDIF

    RETURN n
ENDFUNCTION


;-------------------------------------------
Int FUNCTION myF_Vampire(Actor aRef, Race r)
;-------------------------------------------
    int i = r.GetFormID()
    int n = 100

IF myF_IsRaceKW(r, 0x00013794)        ; [KYWD:00013794]  ActorTypeNPC
    IF     (i == 0x0008883A)        ; [RACE:0008883A]  ArgonianRaceVampire "Argonian"    
        n = 101

    ELSEIF (i == 0x0008883C)        ; [RACE:0008883C]  BretonRaceVampire "Breton"    
        n = 102

    ELSEIF (i == 0x00108272)        ; [RACE:00108272]  BretonRaceChildVampire "Breton"
        n = 103

    ELSEIF (i == 0x0008883D)        ; [RACE:0008883D]  DarkElfRaceVampire "Dunmer"
        n = 104

    ELSEIF (i == 0x000A82BA)        ; [RACE:000A82BA]  ElderRaceVampire "Old People Race"
        n = 105

    ELSEIF (i == 0x00088840)        ; [RACE:00088840]  HighElfRaceVampire "Altmer"
        n = 106

    ELSEIF (i == 0x00088844)        ; [RACE:00088844]  ImperialRaceVampire "Imperial"
        n = 107

    ELSEIF (i == 0x00088845)        ; [RACE:00088845]  KhajiitRaceVampire "Khajiit"
        n = 108

    ELSEIF (i == 0x00088794)        ; [RACE:00088794]  NordRaceVampire "Nord"
        n = 109

    ELSEIF (i == 0x000A82B9)        ; [RACE:000A82B9]  OrcRaceVampire "Orsimer"
        n = 110

    ELSEIF (i == 0x00088846)        ; [RACE:00088846]  RedguardRaceVampire "Redguard"
        n = 111    

    ELSEIF (i == 0x00088884)        ; [RACE:00088884]  WoodElfRaceVampire "Bosmer"
        n = 112
    ENDIF

ELSE
        n = 120
    IF     (i == 0x0200283A)        ; [RACE:0200283A]  DLC1VampireBeastRace "Vampire Lord"
        n = 121    ; VampireLord
    ENDIF

ENDIF

    RETURN n
ENDFUNCTION

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...