Advertisement
Tonycubed

genesis activator code

Jun 3rd, 2022
2,978
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ScriptName SOT_Genesis Extends ObjectReference  
  2.  
  3.  
  4. ObjectReference SpawnAtObject
  5. Float StaminaResult
  6. Float StaminaResultHundred
  7. Float HealthResult
  8. Float HealthResultHundred
  9. Float MagickaResult
  10. Float MagickaResultHundred
  11. Int Property RanCounter = 0 Auto
  12. float Property GameDayRan Auto
  13. FormList DudeList
  14. FormList ObjectsList
  15. FormList workinglist
  16. ActorBase HostileNPC
  17. Actor dude
  18. Int GenDist
  19. Int iindex3
  20. String Tenant
  21. Int foundtype
  22. ; FTravelAmbush Property Checker  Auto  
  23. GlobalVariable Property GiveMePotion  Auto  
  24. import utility
  25. FormList Property PotionsWell  Auto
  26. GlobalVariable Property SOT_Stamina  Auto  
  27.  
  28. GlobalVariable Property SOT_Health  Auto  
  29.  
  30. GlobalVariable Property SOT_Magicka  Auto  
  31.  
  32. GlobalVariable Property SOT_StaminaHigh  Auto  
  33.  
  34. GlobalVariable Property SOT_HealthHigh  Auto  
  35.  
  36. GlobalVariable Property SOT_MagickaHigh  Auto
  37. GlobalVariable Property SOT_AllowUnlevelledNPC  Auto  
  38. potion elixir
  39. Actor dudeactor
  40.  
  41.  
  42. Event OnLoad()
  43.   Int iMajor = SKSE.GetVersion()
  44.   if iMajor > 0
  45.     If testgen.GetValueInt() == 5
  46.   Debug.Notification("SKSE major version: " + iMajor)
  47.   endif
  48.   SKSEYes.setvalueint(5)
  49.   else
  50.   SKSEYes.setvalueint(0)  
  51. endif
  52.     If testgen.GetValueInt() == 5
  53.         Debug.Notification("Fired On Load!")
  54.     EndIf
  55. EndEvent
  56.  
  57.  
  58. int Function attackercount ()
  59. ;randomizing number if toggled yes
  60.         if sotrandom.getvalueint() == 5
  61.        
  62.         int badboys = Utility.RandomInt(1, GenesisPotentialSpawns.getvalueint())
  63.        
  64.         If testgen.GetValueInt() == 5
  65.         Debug.Notification("Random Number of Bad Guys: "+badboys)
  66.     EndIf
  67.        
  68.         return badboys
  69.         else
  70.         If testgen.GetValueInt() == 5
  71.         Debug.Notification("Using player set spawn numnber")
  72.     EndIf
  73.     int badboys = GenesisPotentialSpawns.getvalueint()
  74.         return badboys
  75.         endif
  76.         ;;
  77. endfunction
  78.  
  79. bool Function OkToSpawn(ObjectReference placetospawn)
  80.  
  81.  
  82.  
  83. If game.getplayer().haslos(placetospawn) || Game.GetPlayer().GetDistance(placetospawn) < 512
  84. If testgen.GetValueInt() == 5
  85. Debug.Notification("LOS check forbids spawn")
  86. endif
  87.  
  88. return false
  89.  
  90.  
  91. else
  92.  
  93. If testgen.GetValueInt() == 5
  94. Debug.Notification("LOS check allows spawn")
  95. endif
  96.  
  97. return true
  98.  
  99. endif
  100.  
  101. endfunction
  102.  
  103.  
  104.  
  105.  
  106. Event OnInit()
  107.  
  108. if GenesisCounter.getvalueint() == 0 && kill35.getvalueint() == 1
  109. genesiscounter.setvalueint(5)
  110. Int iMajor = SKSE.GetVersion()
  111.  if iMajor > 0
  112.     If testgen.GetValueInt() == 5
  113.   Debug.Notification("SKSE major version: " + iMajor)
  114.   endif
  115.   SKSEYes.setvalueint(5)
  116.   else
  117.   SKSEYes.setvalueint(0)  
  118. endif
  119.  
  120.  
  121. If Utility.GetCurrentRealTime() > 60
  122. utility.wait(5.0)
  123. if RanCounter == 0
  124. RanCounter = 5
  125. Actor TempActor = None
  126.     If testgen.GetValueInt() == 5
  127.                 Debug.Notification("On Init Fired!")
  128.             EndIf
  129. utility.wait(1.0)          
  130. Actor PlayerRef = Game.GetPlayer()
  131. positionholder.MoveTo(Game.GetPlayer())
  132. utility.wait(1.0)      
  133. if Game.GetPlayer().GetDistance(positionholder) < 200000 && (Game.GetPlayer().GetParentCell()).IsInterior()    
  134. utility.wait(5.0)
  135. If testgen.GetValueInt() == 5
  136.                 Debug.Notification("Wait Over!")
  137.             EndIf
  138.     If kill35.GetValueInt() == 1
  139.         If GameDayRan == 0 || (GameDaysPassed.GetValue() - GamedayRan) > GenesisDaysToReset.GetValue() ; || testgen.GetValueInt() == 5
  140.         ; if toggled check for present hostiles
  141.         TempActor = None
  142.         BadGuysFound.Revert()
  143.         int checkhostiles = GenesisClear.getvalueint()
  144.    
  145.         int count = 0
  146.         actor hero = game.GetPlayer()
  147.                                 While (Count < 10); && foundtype == 0  TempActor == None &&
  148.                                             TempActor = Game.FindRandomActorFromRef(hero, 8000.0)
  149.                                             objectreference TempACtor2 ;= TempActor.get
  150.                                             if SKSEYes.getvalueint() == 5
  151.                                             ;string stuff = TempActor.GetLeveledActorBase() as form
  152.                                         if StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Draugr" ) != -1
  153.                                             ;;;;;;;;;;;;;;;;;;;;;its draugr!
  154.                                             foundtype = 5
  155.                                             Dudelist = GenesisDraugr
  156.                                            
  157.                 ObjectsList = GenesisDraugrObjects
  158.                 If testgen.GetValueInt() == 5
  159.                     Debug.Notification("Draugr Found!")
  160.                 EndIf
  161.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Bandit" ) != -1
  162.                                             ;;Bandit
  163.                                             foundtype = 5
  164.                                             Dudelist = GenesisBandits
  165.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  166.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  167.                 ObjectsList = GenesisBanditObjects
  168.                 If testgen.GetValueInt() == 5
  169.                     Debug.Notification("Bandit Found!")
  170.                 EndIf
  171.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Falmer" ) != -1
  172.                                             ;;Falmer
  173.                                             foundtype = 5
  174.                                             Dudelist = GenesisFalmer
  175.                                            
  176.                 ObjectsList = GenesisFalmerObjects
  177.                 If testgen.GetValueInt() == 5
  178.                     Debug.Notification("Falmer Found!")
  179.                 EndIf
  180.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Forsworn" ) != -1
  181.                                             ;;Forsworn
  182.                                             foundtype = 5
  183.                                                 Dudelist = GenesisForsworn
  184.                                                
  185.                 ObjectsList = GenesisForswornObjects
  186.                 If testgen.GetValueInt() == 5
  187.                     Debug.Notification("Forsworn Found!")
  188.                 EndIf
  189.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Vampire" ) != -1
  190.                                             ;;Vampire
  191.                                             foundtype = 5
  192.                                             Dudelist = GenesisVampire
  193.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  194.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  195.                 ObjectsList = GenesisVampireObjects2
  196.                 If testgen.GetValueInt() == 5
  197.                     Debug.Notification("Vampire Found!")
  198.                 EndIf
  199.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Warlock" ) != -1
  200.                                             ;;warlock
  201.                                             foundtype = 5
  202.                                             Dudelist = GenesisWarlock
  203.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  204.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  205.                 ObjectsList = GenesisWarlockObjects
  206.                 If testgen.GetValueInt() == 5
  207.                     Debug.Notification("Warlock Found!")
  208.                 EndIf
  209.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Dragon Priest" ) != -1
  210.                                             ;;Bandit
  211.                                             foundtype = 5
  212.                                                 Dudelist = GenesisDragonPriest
  213.                                                
  214.                 ObjectsList = GenesisDragonPriestObjects
  215.                 If testgen.GetValueInt() == 5
  216.                     Debug.Notification("Dragon Priest Found!")
  217.                 EndIf
  218.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Dwarven" ) != -1
  219.                                             ;;Dwarven
  220.                                             foundtype = 5
  221.                                             Dudelist = GenesisDwarven
  222.                                            
  223.                 ObjectsList = GenesisDwarvenObjects
  224.                 If testgen.GetValueInt() == 5
  225.                     Debug.Notification("Dwarven Found!")
  226.                 EndIf
  227.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Alik'r" ) != -1
  228.                                             ;;Alik'r
  229.                                             foundtype = 5
  230.                                             ObjectsList = GenesisBanditObjects
  231.                                             Dudelist = GenesisAlikr
  232.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  233.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  234.                 If testgen.GetValueInt() == 5
  235.                     Debug.Notification("Alik'r Found!")
  236.                     endif
  237.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Conjurer" ) != -1
  238.                                             ;;Conjurer
  239.                                             foundtype = 5
  240.                                             ObjectsList = GenesisDraugrObjects
  241.                                             Dudelist = GenesisMageandMancers
  242.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  243.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  244.                 If testgen.GetValueInt() == 5
  245.                     Debug.Notification("Conjurer Found!")
  246.                     endif
  247.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Mage" ) != -1
  248.                                             ;;Mage
  249.                                             foundtype = 5
  250.                                             ObjectsList = GenesisDraugrObjects
  251.                                             Dudelist = GenesisMageandMancers
  252.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  253.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  254.                 If testgen.GetValueInt() == 5
  255.                     Debug.Notification("Mage Found!")
  256.                     endif
  257.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "mancer" ) != -1
  258.                                             ;Electromancer, others with mancer
  259.                                             foundtype = 5
  260.                                             ObjectsList = GenesisDraugrObjects
  261.                                             Dudelist = GenesisMageandMancers
  262.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  263.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  264.                 If testgen.GetValueInt() == 5
  265.                     Debug.Notification("Mancer Found!")
  266.                     endif
  267.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Witch" ) != -1
  268.                                             ;;withc
  269.                                             foundtype = 5
  270.                                                                     ObjectsList = GenesisDraugrObjects
  271.                                             Dudelist = GenesisMageandMancers
  272.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  273.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  274.                 If testgen.GetValueInt() == 5
  275.                     Debug.Notification("Witch Found!")
  276.                     endif
  277.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Ghost" ) != -1
  278.                                             ;;Ghost
  279.                                             foundtype = 5
  280.                                                                     ObjectsList = GenesisDraugrObjects
  281.                                             Dudelist = GenesisGhostShadeSkelie
  282.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  283.                                             BadGuysFound.AddForm(TempActor.GetActorBase())
  284.                 If testgen.GetValueInt() == 5
  285.                     Debug.Notification("Ghost Found!")
  286.                     endif
  287.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Shade" ) != -1
  288.                                             ;;Shade
  289.                                             foundtype = 5
  290.                                             ObjectsList = GenesisDraugrObjects
  291.                                             Dudelist = GenesisGhostShadeSkelie
  292.                                            
  293.                 If testgen.GetValueInt() == 5
  294.                     Debug.Notification("Shade Found!")
  295.                     endif
  296.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Skeleton" ) != -1
  297.                                             ;;skeleton
  298.                                             foundtype = 5
  299.                                             ObjectsList = GenesisDraugrObjects
  300.                                             Dudelist = GenesisGhostShadeSkelie
  301.                                            
  302.                 If testgen.GetValueInt() == 5
  303.                     Debug.Notification("Skeleton Found!")
  304.                     endif
  305.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Werewolf" ) != -1
  306.                                             ;;Werewolf
  307.                                             foundtype = 5
  308.                                             ObjectsList = GenesisDraugrObjects
  309.                                             Dudelist = GenesisWerewolf
  310.                                            
  311.                 If testgen.GetValueInt() == 5
  312.                     Debug.Notification("Ghost Found!")
  313.                     endif
  314.                                             else
  315.                                            
  316.                                             foundtype = 0
  317.                                            
  318.                                             endif
  319.                                             endif
  320.                                             ;;;;;;;;;;;;;;;;;;;;;
  321.                                            
  322.                                            
  323.                                            
  324.                                            
  325.                                             ;;;;
  326.                                             ;if checkhostiles == 0 
  327.                                                 If Tempactor != None
  328.                                                 If (TempActor == hero)  || (TempActor.IsDead()) || !(TempActor.IsHostileToActor(Game.GetPlayer()))
  329.                            
  330.                                                     TempActor = None
  331.                                                     Elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Boss" ) != -1
  332.                                                     TempActor = None
  333.                                                     Else
  334.         if testgen.GetValueInt() == 5
  335.         Debug.Notification("Hostile Found!")
  336.         endif
  337.         checkhostiles = 100
  338.         ;BadGuysFound.AddForm(TempActor.GetActorBase())
  339.         ;BadGuysFound.AddForm(TempActor.GetActorBase() )
  340.             endif
  341.            
  342.                
  343.        
  344.            
  345.                                                 EndIf
  346.        
  347.         ;EndIf
  348.                                            
  349.                                             Count += 1
  350.                                         EndWhile
  351.        
  352.        
  353.        
  354.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  355.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  356.        
  357.        
  358.         ;The NEXT three lines are to see how many npcs in the area.  For future use.
  359.         cell kcell = game.getplayer().getparentcell()
  360.         Int NPCIndex = kcell.GetNumRefs(43)
  361.         If testgen.GetValueInt() == 5
  362.         Debug.Notification("NPC in cell: "+NPCIndex)   
  363.          Debug.Notification("bad guys found total: "+ BadGuysFound.getsize())
  364.          endif
  365.     if BadGuysFound.getsize() > 2 && NPCIndex < 15
  366.       dudelist = badguysfound
  367.        If testgen.GetValueInt() == 5
  368.        Debug.Notification("Using badguysfound!!!")
  369.        endif
  370.    endif
  371.  
  372.    
  373.        
  374.        
  375.        
  376.         if checkhostiles != 100 || checkhostiles > 0
  377.             GameDayRan = GameDaysPassed.GetValue()
  378.             ;;;;loot loot loot
  379.             GenesisLoot.stop()
  380.             GENESISloot.Reset()
  381.             utility.wait(1.0)
  382.             GenesisLoot.Start()
  383.             utility.wait(2.0)
  384.             ; type of Place
  385.             If FoundType == 0
  386.             If Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDraugrCrypt)
  387.                 Dudelist = GenesisDraugr
  388.                 ObjectsList = GenesisDraugrObjects
  389.                 If testgen.GetValueInt() == 5
  390.                     Debug.Notification("Draugr Keyword!")
  391.                 EndIf
  392.             ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeBanditCamp) || Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeMine)
  393.                 Dudelist = GenesisBandits
  394.                 ObjectsList = GenesisBanditObjects
  395.                 If testgen.GetValueInt() == 5
  396.                     Debug.Notification("Bandit Keyword!")
  397.                 EndIf
  398.             ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeFalmerHive)
  399.                 Dudelist = GenesisFalmer
  400.                 ObjectsList = GenesisFalmerObjects
  401.                 If testgen.GetValueInt() == 5
  402.                     Debug.Notification("Falmer Keyword!")
  403.                 EndIf
  404.             ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocSetDwarvenRuin) || Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDwarvenAutomatons)
  405.                 Dudelist = GenesisDwarven
  406.                 ObjectsList = GenesisDwarvenObjects
  407.                 If testgen.GetValueInt() == 5
  408.                     Debug.Notification("Dwarven Keyword!")
  409.                 EndIf
  410.                         ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeForswornCamp)
  411.                 Dudelist = GenesisForsworn
  412.                 ObjectsList = GenesisForswornObjects
  413.                 If testgen.GetValueInt() == 5
  414.                     Debug.Notification("Forsworn Keyword!")
  415.                 EndIf
  416.             ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeVampireLair)
  417.                 Dudelist = GenesisVampire
  418.                 ObjectsList = GenesisVampireObjects2
  419.                 If testgen.GetValueInt() == 5
  420.                     Debug.Notification("Vampire Keyword!")
  421.                 EndIf
  422.             ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeWarlockLair)
  423.                 Dudelist = GenesisWarlock
  424.                 ObjectsList = GenesisWarlockObjects
  425.                 If testgen.GetValueInt() == 5
  426.                     Debug.Notification("Warlock Keyword!")
  427.                 EndIf
  428.             ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocSetNordicRuin)
  429.                 Dudelist = GenesisBandits
  430.                 ObjectsList = GenesisBanditObjects
  431.                 If testgen.GetValueInt() == 5
  432.                     Debug.Notification("NordicRuin Keyword!")
  433.                 EndIf
  434.             ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDungeon)
  435.                 Dudelist = GenesisSkeletons
  436.                 ObjectsList = GenesisSkeletonsObjects
  437.                 If testgen.GetValueInt() == 5
  438.                     Debug.Notification("Skeleton/Dungeon Keyword!")
  439.                 EndIf
  440.                 ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDragonPriestLair)
  441.                 Dudelist = GenesisDragonPriest
  442.                 ObjectsList = GenesisDragonPriestObjects
  443.                 If testgen.GetValueInt() == 5
  444.                     Debug.Notification("Dragon Priest Keyword!")
  445.                 EndIf
  446.             Else
  447.            
  448.             ;indoor or outdoor
  449.             if  !(game.GetPlayer().GetParentCell().IsInterior() )
  450.             ; outdoors
  451.             Dudelist = GenesisBandits
  452.                 ObjectsList = GenesisBanditObjects
  453.                 If testgen.GetValueInt() == 5
  454.                     Debug.Notification("Bandit Keyword! if outdoors")
  455.                 EndIf
  456.            
  457.             Else
  458.             ;indoors
  459.             Dudelist = GenesisSpiders
  460.                 ObjectsList = GenesisSpiderObjects
  461.                 If testgen.GetValueInt() == 5
  462.                     Debug.Notification("Spiders by Default if indoors!")
  463.                         EndIf
  464.            
  465.             EndIf
  466.            
  467.             EndIf
  468.             endif
  469.            
  470.             endif
  471.             ;look for spawn Places
  472.            
  473.            
  474.             ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  475.            
  476.            
  477.             ;;;;;;;; next section spawns npcs
  478.            
  479.            
  480.            
  481.            
  482.             If testgen.GetValueInt() == 5
  483.                     Debug.Notification("Looking for Objects!")
  484.                 EndIf
  485.             ;objectslist.Revert()
  486.             if ObjectsList != None && ObjectsList.GetSize() > 0
  487.                         Int iIndex = ObjectsList.GetSize() ; Indices are offset by 1 relative to size
  488.                         utility.Wait(0.50)
  489.                         If testgen.GetValueInt() == 5
  490.                     Debug.Notification("size of objects list: "+iIndex)
  491.                 EndIf
  492.    
  493.             ;
  494.             If testgen.GetValueInt() == 5
  495.                     Debug.Notification("Try to Spawn At Found Object Location!")
  496.                 EndIf
  497.             ;
  498.             ; surface or dungeon?
  499.             if   !((game.GetPlayer().GetParentCell()).IsInterior())
  500.                      ; outdoors
  501.                  iindex3 = GenesisOutsideSpawns.GetValueInt()
  502.             Else
  503.                        ; dungeon
  504.                  iindex3 = attackercount()
  505.             EndIf
  506.            
  507.            
  508.            
  509.            
  510.             While iIndex3
  511.                 Iindex3 -= 1
  512.                 if Game.GetPlayer().GetDistance(positionholder) < 200000    
  513.                 GenDist = GenesisDistance.GetValueInt()
  514.                 ObjectReference p = game.getPlayer() as ObjectReference
  515.                 SpawnAtObject = Game.FindRandomReferenceOfAnyTypeInListFromRef(objectslist, p, GenDist)
  516.                 Utility.Wait(Utility.RandomFloat(1.0,2.50))
  517.                 if iIndex > 200
  518.                 Utility.Wait(Utility.RandomFloat(1.0,2.50))
  519.                 EndIf
  520.                 If SpawnAtObject != None       
  521.                     ;objectslist.RemoveAddedForm(SpawnAtObject)
  522.                     ;spawn npc
  523.                     Int iIndex2 = DudeList.GetSize() ; Indices are offset by 1 relative to size
  524.                     HostileNPC = DudeList.GetAt(Utility.RandomInt(0, (iIndex2 - 1))) As ActorBase
  525. ;check if close to player if GenesisAtPlayerAllow is = to 5 - if zero default then it ok                   
  526. ;
  527.                     if GenesisAtPlayerAllow.getvalueint() == 0 ||  Game.GetPlayer().GetDistance(SpawnAtObject) > HowFarToSpawn.getvalueint()
  528.                     If OkToSpawn(SpawnAtObject) == True
  529.                     ;dude = SpawnAtObject.PlaceActorAtMe (HostileNPC, 2)   dude.EnableNoWait(True)
  530.                 dude = SpawnAtObject.PlaceAtMe(HostileNPC, 1, abInitiallyDisabled = True) as Actor
  531.                     ;dude.RemoveFromAllFactions()
  532.                     dude.addtofaction(weplayerenemy)
  533.                            
  534.                     ;;;;;;;;;;;;;los check
  535.                    
  536.                    
  537.                    
  538.                    
  539. ;              
  540. If testgen.GetValueInt() == 10         
  541.                 Debug.Notification("Health before: "+ dude.GetActorValue("Health"))
  542.                     Debug.Notification("Magicka before: "+ dude.GetActorValue("Magicka"))  
  543.                     Debug.Notification("Stamina beforfe: "+ dude.GetActorValue("Stamina")) 
  544. EndIf
  545.                     UnlevelNPC(dude)
  546.                    
  547.                     Utility.wait(0.5)
  548.                    
  549.                     GivePotions(dude)
  550. If testgen.GetValueInt() == 10
  551.                                
  552.                     Debug.Notification("Health after: "+ dude.GetActorValue("Health")) 
  553.                     Debug.Notification("Magicka after: "+ dude.GetActorValue("Magicka"))   
  554.                     Debug.Notification("Stamina after: "+ dude.GetActorValue("Stamina"))   
  555.                                        
  556.                     EndIf                  
  557.                    
  558.                     ;dude.StartCombat(Game.GetPlayer())
  559.                    
  560.                    
  561.                     dude.SetRelationshipRank(Game.GetPlayer(), -4)
  562.                     Utility.Wait(Utility.RandomFloat(0.5,1.50))
  563.                     dude.EnableNoWait(True)
  564.                     gettingalong.stop()
  565.             gettingalong.reset()
  566.             gettingalong.start()
  567.             If testgen.GetValueInt() == 5
  568.                         Debug.Notification("Spawned and ran quest!")
  569.                     EndIf
  570.                     If testgen.GetValueInt() == 5
  571.                         Debug.Notification("Spawned! on index #: "+ Iindex3)
  572.                     EndIf
  573.                     else
  574.                                     EndIf
  575.                 Else
  576.                     If testgen.GetValueInt() == 5
  577.                         Debug.Notification("Nothing Found!")
  578.                     EndIf
  579.                 EndIf
  580.                 Endif
  581.                 Else
  582.                 If testgen.GetValueInt() == 5
  583.                         Debug.Notification("Left Original Skull Area, Cannot Spawn!")
  584.                     EndIf
  585.                     RanCounter = 0
  586.                 EndIf
  587.             EndWhile
  588.                 If testgen.GetValueInt() == 5
  589.                         Debug.Notification("Getting ready for quest event!")
  590.                     EndIf
  591.             utility.wait(5.0)
  592.             gettingalong.stop()
  593.             gettingalong.reset()
  594.             gettingalong.start()
  595.             If testgen.GetValueInt() == 5
  596.                         Debug.Notification("firing quest event!")
  597.                     EndIf
  598.             ;;;
  599.         EndIf
  600.         objectslist.Revert()
  601.         ;EndIf
  602.        
  603.        
  604.     EndIf
  605.     EndIf
  606. EndIf
  607. ;RanCounter = 0
  608. EndIf
  609. genesiscounter.setvalueint(0)
  610. else
  611. genesiscounter.setvalueint(0)
  612. Endif
  613.  
  614. endif
  615. EndEvent
  616.  
  617.  
  618.  
  619.  
  620.  
  621. Event OnCellAttach()
  622.  
  623. if GenesisCounter.getvalueint() == 0
  624. genesiscounter.setvalueint(5)
  625. If Utility.GetCurrentRealTime() > 60
  626. utility.wait(1.0)
  627. if RanCounter == 0
  628. RanCounter = 5
  629. Actor TempActor = None
  630.     If testgen.GetValueInt() == 5
  631.                 Debug.Notification("On Init Fired!")
  632.             EndIf
  633. utility.wait(1.0)          
  634. Actor PlayerRef = Game.GetPlayer()
  635. positionholder.MoveTo(Game.GetPlayer())
  636. utility.wait(1.0)      
  637. if Game.GetPlayer().GetDistance(positionholder) < 200000  && (Game.GetPlayer().GetParentCell()).IsInterior()
  638. utility.wait(5.0)
  639. If testgen.GetValueInt() == 5
  640.                 Debug.Notification("Wait Over!")
  641.             EndIf
  642.     If kill35.GetValueInt() == 1
  643.         If GameDayRan == 0 || (GameDaysPassed.GetValue() - GamedayRan) > GenesisDaysToReset.GetValue() ;|| testgen.GetValueInt() == 5
  644.         ; if toggled check for present hostiles
  645.         TempActor = None
  646.         BadGuysFound.Revert()
  647.         int checkhostiles = GenesisClear.getvalueint()
  648.    
  649.         int count = 0
  650.         actor hero = game.GetPlayer()
  651.                                 While (Count < 10) ;&& foundtype == 0  TempActor == None &&
  652.                                             TempActor = Game.FindRandomActorFromRef(hero, 8000.0)
  653.                                             ;;;; - type of dweller     Draugr  Bandit   Afflicted Alik'r Vampire Conjurer  Mage  Necromancer  Electromancer
  654.                                             ;;;;  Argonian  Boethiah  ghost  shade  "Mistwatch Bandit"   Skeleton  Werewolf  
  655.                                             if SKSEYes.getvalueint() == 5
  656.                                             if StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Draugr" ) != -1
  657.                                             ;;its draugr!
  658.                                             foundtype = 5
  659.                                             Dudelist = GenesisDraugr
  660.                 ObjectsList = GenesisDraugrObjects
  661.                 If testgen.GetValueInt() == 5
  662.                     Debug.Notification("Draugr Found!")
  663.                 EndIf
  664.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Bandit" ) != -1
  665.                                             ;;Bandit
  666.                                             foundtype = 5
  667.                                             Dudelist = GenesisBandits
  668.                 ObjectsList = GenesisBanditObjects
  669.                 If testgen.GetValueInt() == 5
  670.                     Debug.Notification("Bandit Found!")
  671.                 EndIf
  672.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Falmer" ) != -1
  673.                                             ;;Falmer
  674.                                             foundtype = 5
  675.                                             Dudelist = GenesisFalmer
  676.                 ObjectsList = GenesisFalmerObjects
  677.                 If testgen.GetValueInt() == 5
  678.                     Debug.Notification("Falmer Found!")
  679.                 EndIf
  680.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Forsworn" ) != -1
  681.                                             ;;Forsworn
  682.                                             foundtype = 5
  683.                                                 Dudelist = GenesisForsworn
  684.                 ObjectsList = GenesisForswornObjects
  685.                 If testgen.GetValueInt() == 5
  686.                     Debug.Notification("Forsworn Found!")
  687.                 EndIf
  688.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Vampire" ) != -1
  689.                                             ;;Vampire
  690.                                             foundtype = 5
  691.                                             Dudelist = GenesisVampire
  692.                 ObjectsList = GenesisVampireObjects2
  693.                 If testgen.GetValueInt() == 5
  694.                     Debug.Notification("Vampire Found!")
  695.                 EndIf
  696.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Warlock" ) != -1
  697.                                             ;;warlock
  698.                                             foundtype = 5
  699.                                             Dudelist = GenesisWarlock
  700.                 ObjectsList = GenesisWarlockObjects
  701.                 If testgen.GetValueInt() == 5
  702.                     Debug.Notification("Warlock Found!")
  703.                 EndIf
  704.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Dragon Priest" ) != -1
  705.                                             ;;Bandit
  706.                                             foundtype = 5
  707.                                                 Dudelist = GenesisDragonPriest
  708.                 ObjectsList = GenesisDragonPriestObjects
  709.                 If testgen.GetValueInt() == 5
  710.                     Debug.Notification("Dragon Priest Found!")
  711.                 EndIf
  712.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Dwarven" ) != -1
  713.                                             ;;Dwarven
  714.                                             foundtype = 5
  715.                                             Dudelist = GenesisDwarven
  716.                 ObjectsList = GenesisDwarvenObjects
  717.                 If testgen.GetValueInt() == 5
  718.                     Debug.Notification("Dwarven Found!")
  719.                 EndIf
  720.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Alik'r" ) != -1
  721.                                             ;;Alik'r
  722.                                             foundtype = 5
  723.                                             ObjectsList = GenesisBanditObjects
  724.                                             Dudelist = GenesisAlikr
  725.                 If testgen.GetValueInt() == 5
  726.                     Debug.Notification("Alik'r Found!")
  727.                     endif
  728.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Conjurer" ) != -1
  729.                                             ;;Conjurer
  730.                                             foundtype = 5
  731.                                             ObjectsList = GenesisDraugrObjects
  732.                                             Dudelist = GenesisMageandMancers
  733.                 If testgen.GetValueInt() == 5
  734.                     Debug.Notification("Conjurer Found!")
  735.                     endif
  736.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Mage" ) != -1
  737.                                             ;;Mage
  738.                                             foundtype = 5
  739.                                             ObjectsList = GenesisDraugrObjects
  740.                                             Dudelist = GenesisMageandMancers
  741.                 If testgen.GetValueInt() == 5
  742.                     Debug.Notification("Mage Found!")
  743.                     endif
  744.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "mancer" ) != -1
  745.                                             ;Electromancer, others with mancer
  746.                                             foundtype = 5
  747.                                             ObjectsList = GenesisDraugrObjects
  748.                                             Dudelist = GenesisMageandMancers
  749.                 If testgen.GetValueInt() == 5
  750.                     Debug.Notification("Mancer Found!")
  751.                     endif
  752.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Witch" ) != -1
  753.                                             ;;withc
  754.                                             foundtype = 5
  755.                                                                     ObjectsList = GenesisDraugrObjects
  756.                                             Dudelist = GenesisMageandMancers
  757.                 If testgen.GetValueInt() == 5
  758.                     Debug.Notification("Witch Found!")
  759.                     endif
  760.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Ghost" ) != -1
  761.                                             ;;Ghost
  762.                                             foundtype = 5
  763.                                                                     ObjectsList = GenesisDraugrObjects
  764.                                             Dudelist = GenesisGhostShadeSkelie
  765.                 If testgen.GetValueInt() == 5
  766.                     Debug.Notification("Ghost Found!")
  767.                     endif
  768.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Shade" ) != -1
  769.                                             ;;Shade
  770.                                             foundtype = 5
  771.                                             ObjectsList = GenesisDraugrObjects
  772.                                             Dudelist = GenesisGhostShadeSkelie
  773.                 If testgen.GetValueInt() == 5
  774.                     Debug.Notification("Shade Found!")
  775.                     endif
  776.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Skeleton" ) != -1
  777.                                             ;;skeleton
  778.                                             foundtype = 5
  779.                                             ObjectsList = GenesisDraugrObjects
  780.                                             Dudelist = GenesisGhostShadeSkelie
  781.                 If testgen.GetValueInt() == 5
  782.                     Debug.Notification("Skeleton Found!")
  783.                     endif
  784.                                             elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Werewolf" ) != -1
  785.                                             ;;Werewolf
  786.                                             foundtype = 5
  787.                                             ObjectsList = GenesisDraugrObjects
  788.                                             Dudelist = GenesisWerewolf
  789.                 If testgen.GetValueInt() == 5
  790.                     Debug.Notification("Ghost Found!")
  791.                     endif
  792.                                             else
  793.                                            
  794.                                             foundtype = 0
  795.                                            
  796.                                             endif
  797.                                             endif
  798.                                             ;;;;
  799.                                             ;if checkhostiles == 0 
  800.                                                 If Tempactor != None
  801.                                                 If (TempActor == hero)  || (TempActor.IsDead()) || !(TempActor.IsHostileToActor(Game.GetPlayer()))
  802.                                                     TempActor = None
  803.                                                     Elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Boss" ) != -1
  804.                                                     TempActor = None
  805.                                                     Else
  806.                                                     if testgen.GetValueInt() == 5
  807.         Debug.Notification("Hostile Found!")
  808.         endif
  809.         checkhostiles = 100
  810.         BadGuysFound.AddForm(TempActor.GetActorBase())
  811.         BadGuysFound.AddForm(TempActor.GetActorBase())
  812.             endif
  813.                                                 EndIf
  814.        
  815.         ;EndIf
  816.                                            
  817.                                             Count += 1
  818.                                         EndWhile
  819.        
  820.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  821.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  822.        
  823.                 ;The NEXT three lines are to see how many npcs in the area.  For future use.
  824.         cell kcell = game.getplayer().getparentcell()
  825.         Int NPCIndex = kcell.GetNumRefs(43)
  826.         If testgen.GetValueInt() == 5
  827.         Debug.Notification("NPC in cell: "+NPCIndex)   
  828.          Debug.Notification("bad guys found total: "+ BadGuysFound.getsize())
  829.          endif
  830.     if BadGuysFound.getsize() > 0 && NPCIndex < 15
  831.       dudelist = badguysfound
  832.        If testgen.GetValueInt() == 5
  833.        Debug.Notification("Using badguysfound!!!")
  834.        endif
  835.    endif
  836.  
  837.    
  838.        
  839.        
  840.        
  841.         if checkhostiles != 100 || checkhostiles > 0
  842.             GameDayRan = GameDaysPassed.GetValue()
  843.             ;;;;loot loot loot
  844.             GenesisLoot.stop()
  845.             GENESISloot.Reset()
  846.             utility.wait(1.0)
  847.             GenesisLoot.Start()
  848.             utility.wait(2.0)
  849.             ; type of Place
  850.             If FoundType == 0
  851.             If Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDraugrCrypt)
  852.                 Dudelist = GenesisDraugr
  853.                 ObjectsList = GenesisDraugrObjects
  854.                 If testgen.GetValueInt() == 5
  855.                     Debug.Notification("Draugr Keyword!")
  856.                 EndIf
  857.             ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeBanditCamp) || Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeMine)
  858.                 Dudelist = GenesisBandits
  859.                 ObjectsList = GenesisBanditObjects
  860.                 If testgen.GetValueInt() == 5
  861.                     Debug.Notification("Bandit Keyword!")
  862.                 EndIf
  863.             ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeFalmerHive)
  864.                 Dudelist = GenesisFalmer
  865.                 ObjectsList = GenesisFalmerObjects
  866.                 If testgen.GetValueInt() == 5
  867.                     Debug.Notification("Falmer Keyword!")
  868.                 EndIf
  869.             ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocSetDwarvenRuin) || Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDwarvenAutomatons)
  870.                 Dudelist = GenesisDwarven
  871.                 ObjectsList = GenesisDwarvenObjects
  872.                 If testgen.GetValueInt() == 5
  873.                     Debug.Notification("Dwarven Keyword!")
  874.                 EndIf
  875.                         ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeForswornCamp)
  876.                 Dudelist = GenesisForsworn
  877.                 ObjectsList = GenesisForswornObjects
  878.                 If testgen.GetValueInt() == 5
  879.                     Debug.Notification("Forsworn Keyword!")
  880.                 EndIf
  881.             ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeVampireLair)
  882.                 Dudelist = GenesisVampire
  883.                 ObjectsList = GenesisVampireObjects2
  884.                 If testgen.GetValueInt() == 5
  885.                     Debug.Notification("Vampire Keyword!")
  886.                 EndIf
  887.             ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeWarlockLair)
  888.                 Dudelist = GenesisWarlock
  889.                 ObjectsList = GenesisWarlockObjects
  890.                 If testgen.GetValueInt() == 5
  891.                     Debug.Notification("Warlock Keyword!")
  892.                 EndIf
  893.             ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocSetNordicRuin)
  894.                 Dudelist = GenesisBandits
  895.                 ObjectsList = GenesisBanditObjects
  896.                 If testgen.GetValueInt() == 5
  897.                     Debug.Notification("NordicRuin Keyword!")
  898.                 EndIf
  899.             ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDungeon)
  900.                 Dudelist = GenesisSkeletons
  901.                 ObjectsList = GenesisSkeletonsObjects
  902.                 If testgen.GetValueInt() == 5
  903.                     Debug.Notification("Skeleton/Dungeon Keyword!")
  904.                 EndIf
  905.                 ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDragonPriestLair)
  906.                 Dudelist = GenesisDragonPriest
  907.                 ObjectsList = GenesisDragonPriestObjects
  908.                 If testgen.GetValueInt() == 5
  909.                     Debug.Notification("Dragon Priest Keyword!")
  910.                 EndIf
  911.             Else
  912.            
  913.             ;indoor or outdoor
  914.             if  !(game.GetPlayer().GetParentCell().IsInterior() )
  915.             ; outdoors
  916.             Dudelist = GenesisBandits
  917.                 ObjectsList = GenesisBanditObjects
  918.                 If testgen.GetValueInt() == 5
  919.                     Debug.Notification("Bandit Keyword! if outdoors")
  920.                 EndIf
  921.            
  922.             Else
  923.             ;indoors
  924.             Dudelist = GenesisSpiders
  925.                 ObjectsList = GenesisSpiderObjects
  926.                 If testgen.GetValueInt() == 5
  927.                     Debug.Notification("Spiders by Default if indoors!")
  928.                         EndIf
  929.            
  930.             EndIf
  931.            
  932.             EndIf
  933.             endif
  934.            
  935.             endif
  936.             ;look for spawn Places
  937.             If testgen.GetValueInt() == 5
  938.                     Debug.Notification("Looking for Objects!")
  939.                 EndIf
  940.             ;objectslist.Revert()
  941.             if ObjectsList != None && ObjectsList.GetSize() > 0
  942.                         Int iIndex = ObjectsList.GetSize() ; Indices are offset by 1 relative to size
  943.                         utility.Wait(0.50)
  944.                         If testgen.GetValueInt() == 5
  945.                     Debug.Notification("size of objects list: "+iIndex)
  946.                 EndIf
  947.    
  948.             ;
  949.             If testgen.GetValueInt() == 5
  950.                     Debug.Notification("Try to Spawn At Found Object Location!")
  951.                 EndIf
  952.             ;
  953.             ; surface or dungeon?
  954.             if   !((game.GetPlayer().GetParentCell()).IsInterior())
  955.                      ; outdoors
  956.                  iindex3 = GenesisOutsideSpawns.GetValueInt()
  957.             Else
  958.                        ; dungeon
  959.                  iindex3 = attackercount()
  960.             EndIf
  961.            
  962.            
  963.            
  964.            
  965.             While iIndex3
  966.                 Iindex3 -= 1
  967.                 if Game.GetPlayer().GetDistance(positionholder) < 200000    
  968.                 GenDist = GenesisDistance.GetValueInt()
  969.                 ObjectReference p = game.getPlayer() as ObjectReference
  970.                 SpawnAtObject = Game.FindRandomReferenceOfAnyTypeInListFromRef(objectslist, p, GenDist)
  971.                 Utility.Wait(Utility.RandomFloat(1.0,2.50))
  972.                 if iIndex > 200
  973.                 Utility.Wait(Utility.RandomFloat(1.0,2.50))
  974.                 EndIf
  975.                 If SpawnAtObject != None       
  976.                     ;objectslist.RemoveAddedForm(SpawnAtObject)
  977.                     ;spawn npc
  978.                     Int iIndex2 = DudeList.GetSize() ; Indices are offset by 1 relative to size
  979.                     HostileNPC = DudeList.GetAt(Utility.RandomInt(0, (iIndex2 - 1))) As ActorBase
  980. ;check if close to player if GenesisAtPlayerAllow is = to 5 - if zero default then it ok                   
  981. ;
  982.                     if GenesisAtPlayerAllow.getvalueint() == 0 ||  Game.GetPlayer().GetDistance(SpawnAtObject) > HowFarToSpawn.getvalueint()
  983.                         If OkToSpawn(SpawnAtObject) == True
  984.                     ;dude = SpawnAtObject.PlaceActorAtMe (HostileNPC, 2)   dude.EnableNoWait(True)
  985.                     dude = SpawnAtObject.PlaceAtMe(HostileNPC, 1, abInitiallyDisabled = True) as Actor
  986.                     ;dude.RemoveFromAllFactions()
  987.                     dude.addtofaction(weplayerenemy)
  988.                    
  989.                     ;;;;;;;;;;;;;los check
  990.                    
  991.                
  992.                    
  993.                    
  994. ;              
  995. If testgen.GetValueInt() == 10         
  996.                 Debug.Notification("Health before: "+ dude.GetActorValue("Health"))
  997.                     Debug.Notification("Magicka before: "+ dude.GetActorValue("Magicka"))  
  998.                     Debug.Notification("Stamina beforfe: "+ dude.GetActorValue("Stamina")) 
  999. EndIf
  1000.                     UnlevelNPC(dude)
  1001.                    
  1002.                     Utility.wait(0.5)
  1003.                    
  1004.                     GivePotions(dude)
  1005. If testgen.GetValueInt() == 10
  1006.                                
  1007.                     Debug.Notification("Health after: "+ dude.GetActorValue("Health")) 
  1008.                     Debug.Notification("Magicka after: "+ dude.GetActorValue("Magicka"))   
  1009.                     Debug.Notification("Stamina after: "+ dude.GetActorValue("Stamina"))   
  1010.                                        
  1011.                     EndIf                  
  1012.                    
  1013.                     ;dude.StartCombat(Game.GetPlayer())
  1014.                    
  1015.                    
  1016.                     dude.SetRelationshipRank(Game.GetPlayer(), -4)
  1017.                     Utility.Wait(Utility.RandomFloat(0.5,1.50))
  1018.                     dude.EnableNoWait(True)
  1019.                     gettingalong.stop()
  1020.                         gettingalong.reset()
  1021.             gettingalong.start()
  1022.             If testgen.GetValueInt() == 5
  1023.                         Debug.Notification("Spawned and ran quest!")
  1024.                     EndIf
  1025.                     If testgen.GetValueInt() == 5
  1026.                         Debug.Notification("Spawned! on index #: "+ Iindex3)
  1027.                     EndIf
  1028.                     EndIf
  1029.                 Else
  1030.                     If testgen.GetValueInt() == 5
  1031.                         Debug.Notification("Nothing Found!")
  1032.                     EndIf
  1033.                 EndIf
  1034.                 Endif
  1035.                 Else
  1036.                 If testgen.GetValueInt() == 5
  1037.                         Debug.Notification("Left Original Skull Area, Cannot Spawn!")
  1038.                     EndIf
  1039.                     RanCounter = 0
  1040.                 EndIf
  1041.             EndWhile
  1042.             If testgen.GetValueInt() == 5
  1043.                         Debug.Notification("Getting ready for quest event!")
  1044.                     EndIf
  1045.             utility.wait(5.0)
  1046.             gettingalong.stop()
  1047.             gettingalong.reset()
  1048.             gettingalong.start()
  1049.             If testgen.GetValueInt() == 5
  1050.                         Debug.Notification("firing quest event!")
  1051.                     EndIf
  1052.             ;;;
  1053.         EndIf
  1054.         objectslist.Revert()
  1055.         ;EndIf
  1056.        
  1057.        
  1058.     EndIf
  1059.     EndIf
  1060. EndIf
  1061. RanCounter = 0
  1062. EndIf
  1063. genesiscounter.setvalueint(0)
  1064. else
  1065. genesiscounter.setvalueint(0)
  1066. Endif
  1067.  
  1068. Endif
  1069.  
  1070.  
  1071. EndEvent
  1072.  
  1073.  
  1074.    
  1075.        
  1076. Function UnLevelNPC (Actor Dude2)
  1077.  
  1078.     If SOT_AllowUnlevelledNPC.GetValueInt() == 1
  1079.         StaminaResult = Utility.RandomFloat(SOT_Stamina.GetValueInt(), SOT_StaminaHigh.GetValueInt())
  1080.         StaminaResultHundred = StaminaResult / 100
  1081.         StaminaResultHundred = Game.GetPlayer().GetBaseActorValue("Stamina") * StaminaResultHundred
  1082.         HealthResult = Utility.RandomFloat(SOT_Health.GetValue(), SOT_HealthHigh.GetValue())
  1083.         HealthResultHundred = HealthResult / 100
  1084.         HealthResultHundred = Game.GetPlayer().GetBaseActorValue("health") * HealthResultHundred
  1085.         MagickaResult = Utility.RandomFloat(SOT_Magicka.GetValue(), SOT_MagickaHigh.GetValue())
  1086.         MagickaResultHundred = MagickaResult / 100
  1087.         MagickaResultHundred = Game.GetPlayer().GetBaseActorValue("magicka") * MagickaResultHundred
  1088.         dude2.SetActorValue("Health", HealthResultHundred)
  1089.         dude2.SetActorValue("Magicka", MagickaResultHundred)
  1090.         dude2.SetActorValue("Stamina", StaminaResultHundred)
  1091.         ;;;;;;;;; add potion if not toggled off
  1092.        
  1093.         ;;;;;;;;;
  1094.     EndIf
  1095.     ;EndIf
  1096.    
  1097. EndFunction
  1098.  
  1099.  
  1100. Function GivePotions(Actor aDrinker)
  1101.     ;if(givepotion!=None && potionchance!=None && PotionsWell!=None)
  1102.         if givemepotion.getvalueint() == 0
  1103.             if utility.RandomInt() < oddsofpotion.getvalueint()
  1104.             int iIndex = PotionsWell.getsize()
  1105.                 int myloop = Utility.randomint(1, 4)
  1106.                 While myloop > 0
  1107.                     myloop = myloop - 1                    
  1108.                 int irandom = utility.randomint(0, iindex - 1)
  1109.                 potion  bottle = PotionsWell.GetAt(irandom) as Potion
  1110.                     aDrinker.AddItem(bottle, 1)
  1111.                     ;Debug.Notification("potion added: "+bottle)
  1112.                 EndWhile
  1113.             EndIf
  1114.         EndIf
  1115.     ;EndIf
  1116.     return
  1117. EndFunction
  1118.  
  1119. GlobalVariable Property GenesisAllow  Auto  
  1120.  
  1121. GlobalVariable Property GenesisDaysToReset  Auto  
  1122.  
  1123. GlobalVariable Property GameDaysPassed  Auto  
  1124.  
  1125. GlobalVariable Property GenesisOddsToSpawnDraugr  Auto  
  1126.  
  1127. GlobalVariable Property GenesisOddsToSpawn  Auto  
  1128.  
  1129. GlobalVariable Property GenesisOddsToSpawnBandits  Auto  
  1130.  
  1131. GlobalVariable Property GenesisOddsToSpawnSpiders  Auto  
  1132.  
  1133. GlobalVariable Property GenesisOddsToSpawnSkels  Auto  
  1134.  
  1135. GlobalVariable Property GenesisOddsToSpawnBoss  Auto  
  1136.  
  1137. FormList Property GenesisDraugr  Auto  
  1138.  
  1139. FormList Property GenesisDraugrObjects  Auto  
  1140.  
  1141. GlobalVariable Property GenesisOddsToSpawnFalmer  Auto  
  1142.  
  1143. FormList Property GenesisBandits  Auto  
  1144.  
  1145. FormList Property GenesisBanditsObjects  Auto  
  1146.  
  1147. FormList Property GenesisSpiders  Auto  
  1148.  
  1149. FormList Property GenesisSpidersObjects  Auto  
  1150.  
  1151.  
  1152. FormList Property GenesisSkeletons  Auto  
  1153.  
  1154. FormList Property GenesisSkeletonsObjects  Auto  
  1155.  
  1156. FormList Property GenesisFalmer  Auto  
  1157.  
  1158. FormList Property GenesisFalmerObjects  Auto  
  1159. GlobalVariable Property OddsOfPotion  Auto
  1160. Keyword Property LocSetNordicRuin  Auto  
  1161. Keyword Property LocTypeDraugrCrypt Auto
  1162. Keyword Property LocTypeDungeon Auto
  1163. Keyword Property LocSetCave Auto
  1164. Keyword Property LocSetCaveIce Auto
  1165. Keyword Property LocSetDwarvenRuin Auto
  1166. Keyword Property LocSetMilitaryCamp Auto
  1167. Keyword Property LocSetMilitaryFort Auto
  1168. Keyword Property LocTypeAnimalDen Auto
  1169. Keyword Property LocTypeBanditCamp Auto
  1170. Keyword Property LocTypeDragonLair Auto
  1171. Keyword Property LocTypeDragonPriestLair Auto
  1172. Keyword Property LocTypeDwarvenAutomatons Auto
  1173. Keyword Property LocTypeFalmerHive Auto
  1174. Keyword Property LocTypeForswornCamp Auto
  1175. Keyword Property LocTypeGiantCamp Auto
  1176. Keyword Property LocTypeHagravenNest Auto
  1177. Keyword Property LocTypeHold Auto
  1178. Keyword Property LocTypeHoldMajor Auto
  1179. Keyword Property LocTypeHoldMinor Auto
  1180. Keyword Property LocTypeMilitaryCamp Auto
  1181. Keyword Property LocTypeMilitaryFort Auto
  1182. Keyword Property LocTypeMine Auto
  1183. Keyword Property LocTypeOrcStronghold Auto
  1184. Keyword Property LocTypeVampireLair Auto
  1185. Keyword Property LocTypeWarlockLair Auto
  1186. ;Keyword Property LocTypeWerebearLair Auto
  1187. Keyword Property LocTypeWerewolfLair Auto
  1188.  
  1189. GlobalVariable Property testgen  Auto  
  1190. GlobalVariable Property kill35  Auto
  1191. GlobalVariable Property GenesisDistance  Auto  
  1192.  
  1193. GlobalVariable Property GenesisPotentialSpawns  Auto  
  1194.  
  1195. FormList Property GenesisBlank  Auto  
  1196.  
  1197. FormList Property GenesisDragonPriest  Auto  
  1198.  
  1199. FormList Property GenesisDragonPriestObjects  Auto  
  1200.  
  1201. FormList Property GenesisDwarven  Auto  
  1202.  
  1203. FormList Property GenesisDwarvenObjects  Auto  
  1204.  
  1205. FormList Property GenesisForsworn  Auto  
  1206.  
  1207. FormList Property GenesisForswornObjects  Auto  
  1208.  
  1209. FormList Property GenesisVampire  Auto  
  1210.  
  1211. FormList Property GenesisVampireObjects2  Auto  
  1212.  
  1213. FormList Property GenesisWarlock  Auto  
  1214.  
  1215. FormList Property GenesisWarlockObjects  Auto  
  1216.  
  1217. FormList Property GenesisBanditObjects  Auto
  1218.  
  1219. FormList Property GenesisSpiderObjects Auto
  1220.  
  1221. Quest Property GenesisLoot  Auto  
  1222.  
  1223.  
  1224.  
  1225. GlobalVariable Property SOT_BeefierLoot  Auto  
  1226.  
  1227. ;Quest Property FastTravelAmbushes2012  Auto  
  1228.  
  1229. GlobalVariable Property GenesisClear  Auto  
  1230.  
  1231. GlobalVariable Property GenesisAtPlayerAllow  Auto  
  1232.  
  1233. ObjectReference Property skulltomeasure  Auto
  1234.  
  1235.  
  1236.  
  1237. ObjectReference Property PositionHolder  Auto  
  1238.  
  1239. GlobalVariable Property GenesisOutsideSpawns  Auto  
  1240.  
  1241. GlobalVariable Property SKSEYes  Auto  
  1242.  
  1243. FormList Property GenesisAlikr  Auto  
  1244.  
  1245. FormList Property GenesisMageandMancers  Auto  
  1246.  
  1247. FormList Property GenesisGhostShadeSkelie  Auto  
  1248.  
  1249. FormList Property GenesisWerewolf  Auto  
  1250.  
  1251. GlobalVariable Property HowFarToSpawn  Auto  
  1252.  
  1253.  
  1254.  
  1255. GlobalVariable Property GenesisCounter  Auto  
  1256.  
  1257. GlobalVariable Property SpawnNoCloser  Auto  
  1258.  
  1259. FormList Property BadGuysFound  Auto  
  1260.  
  1261. Quest Property GettingAlong  Auto  
  1262.  
  1263. Faction Property WEPlayerEnemy  Auto  
  1264.  
  1265. GlobalVariable Property SOTRandom  Auto  
  1266.  
  1267. GlobalVariable Property genunltest  Auto  
  1268.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement