Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ScriptName SOT_Genesis Extends ObjectReference
- ObjectReference SpawnAtObject
- Float StaminaResult
- Float StaminaResultHundred
- Float HealthResult
- Float HealthResultHundred
- Float MagickaResult
- Float MagickaResultHundred
- Int Property RanCounter = 0 Auto
- float Property GameDayRan Auto
- FormList DudeList
- FormList ObjectsList
- FormList workinglist
- ActorBase HostileNPC
- Actor dude
- Int GenDist
- Int iindex3
- String Tenant
- Int foundtype
- ; FTravelAmbush Property Checker Auto
- GlobalVariable Property GiveMePotion Auto
- import utility
- FormList Property PotionsWell Auto
- GlobalVariable Property SOT_Stamina Auto
- GlobalVariable Property SOT_Health Auto
- GlobalVariable Property SOT_Magicka Auto
- GlobalVariable Property SOT_StaminaHigh Auto
- GlobalVariable Property SOT_HealthHigh Auto
- GlobalVariable Property SOT_MagickaHigh Auto
- GlobalVariable Property SOT_AllowUnlevelledNPC Auto
- potion elixir
- Actor dudeactor
- Event OnLoad()
- Int iMajor = SKSE.GetVersion()
- if iMajor > 0
- If testgen.GetValueInt() == 5
- Debug.Notification("SKSE major version: " + iMajor)
- endif
- SKSEYes.setvalueint(5)
- else
- SKSEYes.setvalueint(0)
- endif
- If testgen.GetValueInt() == 5
- Debug.Notification("Fired On Load!")
- EndIf
- EndEvent
- int Function attackercount ()
- ;randomizing number if toggled yes
- if sotrandom.getvalueint() == 5
- int badboys = Utility.RandomInt(1, GenesisPotentialSpawns.getvalueint())
- If testgen.GetValueInt() == 5
- Debug.Notification("Random Number of Bad Guys: "+badboys)
- EndIf
- return badboys
- else
- If testgen.GetValueInt() == 5
- Debug.Notification("Using player set spawn numnber")
- EndIf
- int badboys = GenesisPotentialSpawns.getvalueint()
- return badboys
- endif
- ;;
- endfunction
- bool Function OkToSpawn(ObjectReference placetospawn)
- If game.getplayer().haslos(placetospawn) || Game.GetPlayer().GetDistance(placetospawn) < 512
- If testgen.GetValueInt() == 5
- Debug.Notification("LOS check forbids spawn")
- endif
- return false
- else
- If testgen.GetValueInt() == 5
- Debug.Notification("LOS check allows spawn")
- endif
- return true
- endif
- endfunction
- Event OnInit()
- if GenesisCounter.getvalueint() == 0 && kill35.getvalueint() == 1
- genesiscounter.setvalueint(5)
- Int iMajor = SKSE.GetVersion()
- if iMajor > 0
- If testgen.GetValueInt() == 5
- Debug.Notification("SKSE major version: " + iMajor)
- endif
- SKSEYes.setvalueint(5)
- else
- SKSEYes.setvalueint(0)
- endif
- If Utility.GetCurrentRealTime() > 60
- utility.wait(5.0)
- if RanCounter == 0
- RanCounter = 5
- Actor TempActor = None
- If testgen.GetValueInt() == 5
- Debug.Notification("On Init Fired!")
- EndIf
- utility.wait(1.0)
- Actor PlayerRef = Game.GetPlayer()
- positionholder.MoveTo(Game.GetPlayer())
- utility.wait(1.0)
- if Game.GetPlayer().GetDistance(positionholder) < 200000 && (Game.GetPlayer().GetParentCell()).IsInterior()
- utility.wait(5.0)
- If testgen.GetValueInt() == 5
- Debug.Notification("Wait Over!")
- EndIf
- If kill35.GetValueInt() == 1
- If GameDayRan == 0 || (GameDaysPassed.GetValue() - GamedayRan) > GenesisDaysToReset.GetValue() ; || testgen.GetValueInt() == 5
- ; if toggled check for present hostiles
- TempActor = None
- BadGuysFound.Revert()
- int checkhostiles = GenesisClear.getvalueint()
- int count = 0
- actor hero = game.GetPlayer()
- While (Count < 10); && foundtype == 0 TempActor == None &&
- TempActor = Game.FindRandomActorFromRef(hero, 8000.0)
- objectreference TempACtor2 ;= TempActor.get
- if SKSEYes.getvalueint() == 5
- ;string stuff = TempActor.GetLeveledActorBase() as form
- if StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Draugr" ) != -1
- ;;;;;;;;;;;;;;;;;;;;;its draugr!
- foundtype = 5
- Dudelist = GenesisDraugr
- ObjectsList = GenesisDraugrObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Draugr Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Bandit" ) != -1
- ;;Bandit
- foundtype = 5
- Dudelist = GenesisBandits
- BadGuysFound.AddForm(TempActor.GetActorBase())
- BadGuysFound.AddForm(TempActor.GetActorBase())
- ObjectsList = GenesisBanditObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Bandit Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Falmer" ) != -1
- ;;Falmer
- foundtype = 5
- Dudelist = GenesisFalmer
- ObjectsList = GenesisFalmerObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Falmer Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Forsworn" ) != -1
- ;;Forsworn
- foundtype = 5
- Dudelist = GenesisForsworn
- ObjectsList = GenesisForswornObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Forsworn Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Vampire" ) != -1
- ;;Vampire
- foundtype = 5
- Dudelist = GenesisVampire
- BadGuysFound.AddForm(TempActor.GetActorBase())
- BadGuysFound.AddForm(TempActor.GetActorBase())
- ObjectsList = GenesisVampireObjects2
- If testgen.GetValueInt() == 5
- Debug.Notification("Vampire Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Warlock" ) != -1
- ;;warlock
- foundtype = 5
- Dudelist = GenesisWarlock
- BadGuysFound.AddForm(TempActor.GetActorBase())
- BadGuysFound.AddForm(TempActor.GetActorBase())
- ObjectsList = GenesisWarlockObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Warlock Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Dragon Priest" ) != -1
- ;;Bandit
- foundtype = 5
- Dudelist = GenesisDragonPriest
- ObjectsList = GenesisDragonPriestObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Dragon Priest Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Dwarven" ) != -1
- ;;Dwarven
- foundtype = 5
- Dudelist = GenesisDwarven
- ObjectsList = GenesisDwarvenObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Dwarven Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Alik'r" ) != -1
- ;;Alik'r
- foundtype = 5
- ObjectsList = GenesisBanditObjects
- Dudelist = GenesisAlikr
- BadGuysFound.AddForm(TempActor.GetActorBase())
- BadGuysFound.AddForm(TempActor.GetActorBase())
- If testgen.GetValueInt() == 5
- Debug.Notification("Alik'r Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Conjurer" ) != -1
- ;;Conjurer
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisMageandMancers
- BadGuysFound.AddForm(TempActor.GetActorBase())
- BadGuysFound.AddForm(TempActor.GetActorBase())
- If testgen.GetValueInt() == 5
- Debug.Notification("Conjurer Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Mage" ) != -1
- ;;Mage
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisMageandMancers
- BadGuysFound.AddForm(TempActor.GetActorBase())
- BadGuysFound.AddForm(TempActor.GetActorBase())
- If testgen.GetValueInt() == 5
- Debug.Notification("Mage Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "mancer" ) != -1
- ;Electromancer, others with mancer
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisMageandMancers
- BadGuysFound.AddForm(TempActor.GetActorBase())
- BadGuysFound.AddForm(TempActor.GetActorBase())
- If testgen.GetValueInt() == 5
- Debug.Notification("Mancer Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Witch" ) != -1
- ;;withc
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisMageandMancers
- BadGuysFound.AddForm(TempActor.GetActorBase())
- BadGuysFound.AddForm(TempActor.GetActorBase())
- If testgen.GetValueInt() == 5
- Debug.Notification("Witch Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Ghost" ) != -1
- ;;Ghost
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisGhostShadeSkelie
- BadGuysFound.AddForm(TempActor.GetActorBase())
- BadGuysFound.AddForm(TempActor.GetActorBase())
- If testgen.GetValueInt() == 5
- Debug.Notification("Ghost Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Shade" ) != -1
- ;;Shade
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisGhostShadeSkelie
- If testgen.GetValueInt() == 5
- Debug.Notification("Shade Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Skeleton" ) != -1
- ;;skeleton
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisGhostShadeSkelie
- If testgen.GetValueInt() == 5
- Debug.Notification("Skeleton Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Werewolf" ) != -1
- ;;Werewolf
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisWerewolf
- If testgen.GetValueInt() == 5
- Debug.Notification("Ghost Found!")
- endif
- else
- foundtype = 0
- endif
- endif
- ;;;;;;;;;;;;;;;;;;;;;
- ;;;;
- ;if checkhostiles == 0
- If Tempactor != None
- If (TempActor == hero) || (TempActor.IsDead()) || !(TempActor.IsHostileToActor(Game.GetPlayer()))
- TempActor = None
- Elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Boss" ) != -1
- TempActor = None
- Else
- if testgen.GetValueInt() == 5
- Debug.Notification("Hostile Found!")
- endif
- checkhostiles = 100
- ;BadGuysFound.AddForm(TempActor.GetActorBase())
- ;BadGuysFound.AddForm(TempActor.GetActorBase() )
- endif
- EndIf
- ;EndIf
- Count += 1
- EndWhile
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;The NEXT three lines are to see how many npcs in the area. For future use.
- cell kcell = game.getplayer().getparentcell()
- Int NPCIndex = kcell.GetNumRefs(43)
- If testgen.GetValueInt() == 5
- Debug.Notification("NPC in cell: "+NPCIndex)
- Debug.Notification("bad guys found total: "+ BadGuysFound.getsize())
- endif
- if BadGuysFound.getsize() > 2 && NPCIndex < 15
- dudelist = badguysfound
- If testgen.GetValueInt() == 5
- Debug.Notification("Using badguysfound!!!")
- endif
- endif
- if checkhostiles != 100 || checkhostiles > 0
- GameDayRan = GameDaysPassed.GetValue()
- ;;;;loot loot loot
- GenesisLoot.stop()
- GENESISloot.Reset()
- utility.wait(1.0)
- GenesisLoot.Start()
- utility.wait(2.0)
- ; type of Place
- If FoundType == 0
- If Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDraugrCrypt)
- Dudelist = GenesisDraugr
- ObjectsList = GenesisDraugrObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Draugr Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeBanditCamp) || Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeMine)
- Dudelist = GenesisBandits
- ObjectsList = GenesisBanditObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Bandit Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeFalmerHive)
- Dudelist = GenesisFalmer
- ObjectsList = GenesisFalmerObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Falmer Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocSetDwarvenRuin) || Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDwarvenAutomatons)
- Dudelist = GenesisDwarven
- ObjectsList = GenesisDwarvenObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Dwarven Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeForswornCamp)
- Dudelist = GenesisForsworn
- ObjectsList = GenesisForswornObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Forsworn Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeVampireLair)
- Dudelist = GenesisVampire
- ObjectsList = GenesisVampireObjects2
- If testgen.GetValueInt() == 5
- Debug.Notification("Vampire Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeWarlockLair)
- Dudelist = GenesisWarlock
- ObjectsList = GenesisWarlockObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Warlock Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocSetNordicRuin)
- Dudelist = GenesisBandits
- ObjectsList = GenesisBanditObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("NordicRuin Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDungeon)
- Dudelist = GenesisSkeletons
- ObjectsList = GenesisSkeletonsObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Skeleton/Dungeon Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDragonPriestLair)
- Dudelist = GenesisDragonPriest
- ObjectsList = GenesisDragonPriestObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Dragon Priest Keyword!")
- EndIf
- Else
- ;indoor or outdoor
- if !(game.GetPlayer().GetParentCell().IsInterior() )
- ; outdoors
- Dudelist = GenesisBandits
- ObjectsList = GenesisBanditObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Bandit Keyword! if outdoors")
- EndIf
- Else
- ;indoors
- Dudelist = GenesisSpiders
- ObjectsList = GenesisSpiderObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Spiders by Default if indoors!")
- EndIf
- EndIf
- EndIf
- endif
- endif
- ;look for spawn Places
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;; next section spawns npcs
- If testgen.GetValueInt() == 5
- Debug.Notification("Looking for Objects!")
- EndIf
- ;objectslist.Revert()
- if ObjectsList != None && ObjectsList.GetSize() > 0
- Int iIndex = ObjectsList.GetSize() ; Indices are offset by 1 relative to size
- utility.Wait(0.50)
- If testgen.GetValueInt() == 5
- Debug.Notification("size of objects list: "+iIndex)
- EndIf
- ;
- If testgen.GetValueInt() == 5
- Debug.Notification("Try to Spawn At Found Object Location!")
- EndIf
- ;
- ; surface or dungeon?
- if !((game.GetPlayer().GetParentCell()).IsInterior())
- ; outdoors
- iindex3 = GenesisOutsideSpawns.GetValueInt()
- Else
- ; dungeon
- iindex3 = attackercount()
- EndIf
- While iIndex3
- Iindex3 -= 1
- if Game.GetPlayer().GetDistance(positionholder) < 200000
- GenDist = GenesisDistance.GetValueInt()
- ObjectReference p = game.getPlayer() as ObjectReference
- SpawnAtObject = Game.FindRandomReferenceOfAnyTypeInListFromRef(objectslist, p, GenDist)
- Utility.Wait(Utility.RandomFloat(1.0,2.50))
- if iIndex > 200
- Utility.Wait(Utility.RandomFloat(1.0,2.50))
- EndIf
- If SpawnAtObject != None
- ;objectslist.RemoveAddedForm(SpawnAtObject)
- ;spawn npc
- Int iIndex2 = DudeList.GetSize() ; Indices are offset by 1 relative to size
- HostileNPC = DudeList.GetAt(Utility.RandomInt(0, (iIndex2 - 1))) As ActorBase
- ;check if close to player if GenesisAtPlayerAllow is = to 5 - if zero default then it ok
- ;
- if GenesisAtPlayerAllow.getvalueint() == 0 || Game.GetPlayer().GetDistance(SpawnAtObject) > HowFarToSpawn.getvalueint()
- If OkToSpawn(SpawnAtObject) == True
- ;dude = SpawnAtObject.PlaceActorAtMe (HostileNPC, 2) dude.EnableNoWait(True)
- dude = SpawnAtObject.PlaceAtMe(HostileNPC, 1, abInitiallyDisabled = True) as Actor
- ;dude.RemoveFromAllFactions()
- dude.addtofaction(weplayerenemy)
- ;;;;;;;;;;;;;los check
- ;
- If testgen.GetValueInt() == 10
- Debug.Notification("Health before: "+ dude.GetActorValue("Health"))
- Debug.Notification("Magicka before: "+ dude.GetActorValue("Magicka"))
- Debug.Notification("Stamina beforfe: "+ dude.GetActorValue("Stamina"))
- EndIf
- UnlevelNPC(dude)
- Utility.wait(0.5)
- GivePotions(dude)
- If testgen.GetValueInt() == 10
- Debug.Notification("Health after: "+ dude.GetActorValue("Health"))
- Debug.Notification("Magicka after: "+ dude.GetActorValue("Magicka"))
- Debug.Notification("Stamina after: "+ dude.GetActorValue("Stamina"))
- EndIf
- ;dude.StartCombat(Game.GetPlayer())
- dude.SetRelationshipRank(Game.GetPlayer(), -4)
- Utility.Wait(Utility.RandomFloat(0.5,1.50))
- dude.EnableNoWait(True)
- gettingalong.stop()
- gettingalong.reset()
- gettingalong.start()
- If testgen.GetValueInt() == 5
- Debug.Notification("Spawned and ran quest!")
- EndIf
- If testgen.GetValueInt() == 5
- Debug.Notification("Spawned! on index #: "+ Iindex3)
- EndIf
- else
- EndIf
- Else
- If testgen.GetValueInt() == 5
- Debug.Notification("Nothing Found!")
- EndIf
- EndIf
- Endif
- Else
- If testgen.GetValueInt() == 5
- Debug.Notification("Left Original Skull Area, Cannot Spawn!")
- EndIf
- RanCounter = 0
- EndIf
- EndWhile
- If testgen.GetValueInt() == 5
- Debug.Notification("Getting ready for quest event!")
- EndIf
- utility.wait(5.0)
- gettingalong.stop()
- gettingalong.reset()
- gettingalong.start()
- If testgen.GetValueInt() == 5
- Debug.Notification("firing quest event!")
- EndIf
- ;;;
- EndIf
- objectslist.Revert()
- ;EndIf
- EndIf
- EndIf
- EndIf
- ;RanCounter = 0
- EndIf
- genesiscounter.setvalueint(0)
- else
- genesiscounter.setvalueint(0)
- Endif
- endif
- EndEvent
- Event OnCellAttach()
- if GenesisCounter.getvalueint() == 0
- genesiscounter.setvalueint(5)
- If Utility.GetCurrentRealTime() > 60
- utility.wait(1.0)
- if RanCounter == 0
- RanCounter = 5
- Actor TempActor = None
- If testgen.GetValueInt() == 5
- Debug.Notification("On Init Fired!")
- EndIf
- utility.wait(1.0)
- Actor PlayerRef = Game.GetPlayer()
- positionholder.MoveTo(Game.GetPlayer())
- utility.wait(1.0)
- if Game.GetPlayer().GetDistance(positionholder) < 200000 && (Game.GetPlayer().GetParentCell()).IsInterior()
- utility.wait(5.0)
- If testgen.GetValueInt() == 5
- Debug.Notification("Wait Over!")
- EndIf
- If kill35.GetValueInt() == 1
- If GameDayRan == 0 || (GameDaysPassed.GetValue() - GamedayRan) > GenesisDaysToReset.GetValue() ;|| testgen.GetValueInt() == 5
- ; if toggled check for present hostiles
- TempActor = None
- BadGuysFound.Revert()
- int checkhostiles = GenesisClear.getvalueint()
- int count = 0
- actor hero = game.GetPlayer()
- While (Count < 10) ;&& foundtype == 0 TempActor == None &&
- TempActor = Game.FindRandomActorFromRef(hero, 8000.0)
- ;;;; - type of dweller Draugr Bandit Afflicted Alik'r Vampire Conjurer Mage Necromancer Electromancer
- ;;;; Argonian Boethiah ghost shade "Mistwatch Bandit" Skeleton Werewolf
- if SKSEYes.getvalueint() == 5
- if StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Draugr" ) != -1
- ;;its draugr!
- foundtype = 5
- Dudelist = GenesisDraugr
- ObjectsList = GenesisDraugrObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Draugr Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Bandit" ) != -1
- ;;Bandit
- foundtype = 5
- Dudelist = GenesisBandits
- ObjectsList = GenesisBanditObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Bandit Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Falmer" ) != -1
- ;;Falmer
- foundtype = 5
- Dudelist = GenesisFalmer
- ObjectsList = GenesisFalmerObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Falmer Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Forsworn" ) != -1
- ;;Forsworn
- foundtype = 5
- Dudelist = GenesisForsworn
- ObjectsList = GenesisForswornObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Forsworn Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Vampire" ) != -1
- ;;Vampire
- foundtype = 5
- Dudelist = GenesisVampire
- ObjectsList = GenesisVampireObjects2
- If testgen.GetValueInt() == 5
- Debug.Notification("Vampire Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Warlock" ) != -1
- ;;warlock
- foundtype = 5
- Dudelist = GenesisWarlock
- ObjectsList = GenesisWarlockObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Warlock Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Dragon Priest" ) != -1
- ;;Bandit
- foundtype = 5
- Dudelist = GenesisDragonPriest
- ObjectsList = GenesisDragonPriestObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Dragon Priest Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Dwarven" ) != -1
- ;;Dwarven
- foundtype = 5
- Dudelist = GenesisDwarven
- ObjectsList = GenesisDwarvenObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Dwarven Found!")
- EndIf
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Alik'r" ) != -1
- ;;Alik'r
- foundtype = 5
- ObjectsList = GenesisBanditObjects
- Dudelist = GenesisAlikr
- If testgen.GetValueInt() == 5
- Debug.Notification("Alik'r Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Conjurer" ) != -1
- ;;Conjurer
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisMageandMancers
- If testgen.GetValueInt() == 5
- Debug.Notification("Conjurer Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Mage" ) != -1
- ;;Mage
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisMageandMancers
- If testgen.GetValueInt() == 5
- Debug.Notification("Mage Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "mancer" ) != -1
- ;Electromancer, others with mancer
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisMageandMancers
- If testgen.GetValueInt() == 5
- Debug.Notification("Mancer Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Witch" ) != -1
- ;;withc
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisMageandMancers
- If testgen.GetValueInt() == 5
- Debug.Notification("Witch Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Ghost" ) != -1
- ;;Ghost
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisGhostShadeSkelie
- If testgen.GetValueInt() == 5
- Debug.Notification("Ghost Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Shade" ) != -1
- ;;Shade
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisGhostShadeSkelie
- If testgen.GetValueInt() == 5
- Debug.Notification("Shade Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Skeleton" ) != -1
- ;;skeleton
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisGhostShadeSkelie
- If testgen.GetValueInt() == 5
- Debug.Notification("Skeleton Found!")
- endif
- elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Werewolf" ) != -1
- ;;Werewolf
- foundtype = 5
- ObjectsList = GenesisDraugrObjects
- Dudelist = GenesisWerewolf
- If testgen.GetValueInt() == 5
- Debug.Notification("Ghost Found!")
- endif
- else
- foundtype = 0
- endif
- endif
- ;;;;
- ;if checkhostiles == 0
- If Tempactor != None
- If (TempActor == hero) || (TempActor.IsDead()) || !(TempActor.IsHostileToActor(Game.GetPlayer()))
- TempActor = None
- Elseif StringUtil.Find((TempActor.GetLeveledActorBase()as form).GetName(), "Boss" ) != -1
- TempActor = None
- Else
- if testgen.GetValueInt() == 5
- Debug.Notification("Hostile Found!")
- endif
- checkhostiles = 100
- BadGuysFound.AddForm(TempActor.GetActorBase())
- BadGuysFound.AddForm(TempActor.GetActorBase())
- endif
- EndIf
- ;EndIf
- Count += 1
- EndWhile
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;The NEXT three lines are to see how many npcs in the area. For future use.
- cell kcell = game.getplayer().getparentcell()
- Int NPCIndex = kcell.GetNumRefs(43)
- If testgen.GetValueInt() == 5
- Debug.Notification("NPC in cell: "+NPCIndex)
- Debug.Notification("bad guys found total: "+ BadGuysFound.getsize())
- endif
- if BadGuysFound.getsize() > 0 && NPCIndex < 15
- dudelist = badguysfound
- If testgen.GetValueInt() == 5
- Debug.Notification("Using badguysfound!!!")
- endif
- endif
- if checkhostiles != 100 || checkhostiles > 0
- GameDayRan = GameDaysPassed.GetValue()
- ;;;;loot loot loot
- GenesisLoot.stop()
- GENESISloot.Reset()
- utility.wait(1.0)
- GenesisLoot.Start()
- utility.wait(2.0)
- ; type of Place
- If FoundType == 0
- If Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDraugrCrypt)
- Dudelist = GenesisDraugr
- ObjectsList = GenesisDraugrObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Draugr Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeBanditCamp) || Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeMine)
- Dudelist = GenesisBandits
- ObjectsList = GenesisBanditObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Bandit Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeFalmerHive)
- Dudelist = GenesisFalmer
- ObjectsList = GenesisFalmerObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Falmer Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocSetDwarvenRuin) || Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDwarvenAutomatons)
- Dudelist = GenesisDwarven
- ObjectsList = GenesisDwarvenObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Dwarven Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeForswornCamp)
- Dudelist = GenesisForsworn
- ObjectsList = GenesisForswornObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Forsworn Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeVampireLair)
- Dudelist = GenesisVampire
- ObjectsList = GenesisVampireObjects2
- If testgen.GetValueInt() == 5
- Debug.Notification("Vampire Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeWarlockLair)
- Dudelist = GenesisWarlock
- ObjectsList = GenesisWarlockObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Warlock Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocSetNordicRuin)
- Dudelist = GenesisBandits
- ObjectsList = GenesisBanditObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("NordicRuin Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDungeon)
- Dudelist = GenesisSkeletons
- ObjectsList = GenesisSkeletonsObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Skeleton/Dungeon Keyword!")
- EndIf
- ElseIf Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeDragonPriestLair)
- Dudelist = GenesisDragonPriest
- ObjectsList = GenesisDragonPriestObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Dragon Priest Keyword!")
- EndIf
- Else
- ;indoor or outdoor
- if !(game.GetPlayer().GetParentCell().IsInterior() )
- ; outdoors
- Dudelist = GenesisBandits
- ObjectsList = GenesisBanditObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Bandit Keyword! if outdoors")
- EndIf
- Else
- ;indoors
- Dudelist = GenesisSpiders
- ObjectsList = GenesisSpiderObjects
- If testgen.GetValueInt() == 5
- Debug.Notification("Spiders by Default if indoors!")
- EndIf
- EndIf
- EndIf
- endif
- endif
- ;look for spawn Places
- If testgen.GetValueInt() == 5
- Debug.Notification("Looking for Objects!")
- EndIf
- ;objectslist.Revert()
- if ObjectsList != None && ObjectsList.GetSize() > 0
- Int iIndex = ObjectsList.GetSize() ; Indices are offset by 1 relative to size
- utility.Wait(0.50)
- If testgen.GetValueInt() == 5
- Debug.Notification("size of objects list: "+iIndex)
- EndIf
- ;
- If testgen.GetValueInt() == 5
- Debug.Notification("Try to Spawn At Found Object Location!")
- EndIf
- ;
- ; surface or dungeon?
- if !((game.GetPlayer().GetParentCell()).IsInterior())
- ; outdoors
- iindex3 = GenesisOutsideSpawns.GetValueInt()
- Else
- ; dungeon
- iindex3 = attackercount()
- EndIf
- While iIndex3
- Iindex3 -= 1
- if Game.GetPlayer().GetDistance(positionholder) < 200000
- GenDist = GenesisDistance.GetValueInt()
- ObjectReference p = game.getPlayer() as ObjectReference
- SpawnAtObject = Game.FindRandomReferenceOfAnyTypeInListFromRef(objectslist, p, GenDist)
- Utility.Wait(Utility.RandomFloat(1.0,2.50))
- if iIndex > 200
- Utility.Wait(Utility.RandomFloat(1.0,2.50))
- EndIf
- If SpawnAtObject != None
- ;objectslist.RemoveAddedForm(SpawnAtObject)
- ;spawn npc
- Int iIndex2 = DudeList.GetSize() ; Indices are offset by 1 relative to size
- HostileNPC = DudeList.GetAt(Utility.RandomInt(0, (iIndex2 - 1))) As ActorBase
- ;check if close to player if GenesisAtPlayerAllow is = to 5 - if zero default then it ok
- ;
- if GenesisAtPlayerAllow.getvalueint() == 0 || Game.GetPlayer().GetDistance(SpawnAtObject) > HowFarToSpawn.getvalueint()
- If OkToSpawn(SpawnAtObject) == True
- ;dude = SpawnAtObject.PlaceActorAtMe (HostileNPC, 2) dude.EnableNoWait(True)
- dude = SpawnAtObject.PlaceAtMe(HostileNPC, 1, abInitiallyDisabled = True) as Actor
- ;dude.RemoveFromAllFactions()
- dude.addtofaction(weplayerenemy)
- ;;;;;;;;;;;;;los check
- ;
- If testgen.GetValueInt() == 10
- Debug.Notification("Health before: "+ dude.GetActorValue("Health"))
- Debug.Notification("Magicka before: "+ dude.GetActorValue("Magicka"))
- Debug.Notification("Stamina beforfe: "+ dude.GetActorValue("Stamina"))
- EndIf
- UnlevelNPC(dude)
- Utility.wait(0.5)
- GivePotions(dude)
- If testgen.GetValueInt() == 10
- Debug.Notification("Health after: "+ dude.GetActorValue("Health"))
- Debug.Notification("Magicka after: "+ dude.GetActorValue("Magicka"))
- Debug.Notification("Stamina after: "+ dude.GetActorValue("Stamina"))
- EndIf
- ;dude.StartCombat(Game.GetPlayer())
- dude.SetRelationshipRank(Game.GetPlayer(), -4)
- Utility.Wait(Utility.RandomFloat(0.5,1.50))
- dude.EnableNoWait(True)
- gettingalong.stop()
- gettingalong.reset()
- gettingalong.start()
- If testgen.GetValueInt() == 5
- Debug.Notification("Spawned and ran quest!")
- EndIf
- If testgen.GetValueInt() == 5
- Debug.Notification("Spawned! on index #: "+ Iindex3)
- EndIf
- EndIf
- Else
- If testgen.GetValueInt() == 5
- Debug.Notification("Nothing Found!")
- EndIf
- EndIf
- Endif
- Else
- If testgen.GetValueInt() == 5
- Debug.Notification("Left Original Skull Area, Cannot Spawn!")
- EndIf
- RanCounter = 0
- EndIf
- EndWhile
- If testgen.GetValueInt() == 5
- Debug.Notification("Getting ready for quest event!")
- EndIf
- utility.wait(5.0)
- gettingalong.stop()
- gettingalong.reset()
- gettingalong.start()
- If testgen.GetValueInt() == 5
- Debug.Notification("firing quest event!")
- EndIf
- ;;;
- EndIf
- objectslist.Revert()
- ;EndIf
- EndIf
- EndIf
- EndIf
- RanCounter = 0
- EndIf
- genesiscounter.setvalueint(0)
- else
- genesiscounter.setvalueint(0)
- Endif
- Endif
- EndEvent
- Function UnLevelNPC (Actor Dude2)
- If SOT_AllowUnlevelledNPC.GetValueInt() == 1
- StaminaResult = Utility.RandomFloat(SOT_Stamina.GetValueInt(), SOT_StaminaHigh.GetValueInt())
- StaminaResultHundred = StaminaResult / 100
- StaminaResultHundred = Game.GetPlayer().GetBaseActorValue("Stamina") * StaminaResultHundred
- HealthResult = Utility.RandomFloat(SOT_Health.GetValue(), SOT_HealthHigh.GetValue())
- HealthResultHundred = HealthResult / 100
- HealthResultHundred = Game.GetPlayer().GetBaseActorValue("health") * HealthResultHundred
- MagickaResult = Utility.RandomFloat(SOT_Magicka.GetValue(), SOT_MagickaHigh.GetValue())
- MagickaResultHundred = MagickaResult / 100
- MagickaResultHundred = Game.GetPlayer().GetBaseActorValue("magicka") * MagickaResultHundred
- dude2.SetActorValue("Health", HealthResultHundred)
- dude2.SetActorValue("Magicka", MagickaResultHundred)
- dude2.SetActorValue("Stamina", StaminaResultHundred)
- ;;;;;;;;; add potion if not toggled off
- ;;;;;;;;;
- EndIf
- ;EndIf
- EndFunction
- Function GivePotions(Actor aDrinker)
- ;if(givepotion!=None && potionchance!=None && PotionsWell!=None)
- if givemepotion.getvalueint() == 0
- if utility.RandomInt() < oddsofpotion.getvalueint()
- int iIndex = PotionsWell.getsize()
- int myloop = Utility.randomint(1, 4)
- While myloop > 0
- myloop = myloop - 1
- int irandom = utility.randomint(0, iindex - 1)
- potion bottle = PotionsWell.GetAt(irandom) as Potion
- aDrinker.AddItem(bottle, 1)
- ;Debug.Notification("potion added: "+bottle)
- EndWhile
- EndIf
- EndIf
- ;EndIf
- return
- EndFunction
- GlobalVariable Property GenesisAllow Auto
- GlobalVariable Property GenesisDaysToReset Auto
- GlobalVariable Property GameDaysPassed Auto
- GlobalVariable Property GenesisOddsToSpawnDraugr Auto
- GlobalVariable Property GenesisOddsToSpawn Auto
- GlobalVariable Property GenesisOddsToSpawnBandits Auto
- GlobalVariable Property GenesisOddsToSpawnSpiders Auto
- GlobalVariable Property GenesisOddsToSpawnSkels Auto
- GlobalVariable Property GenesisOddsToSpawnBoss Auto
- FormList Property GenesisDraugr Auto
- FormList Property GenesisDraugrObjects Auto
- GlobalVariable Property GenesisOddsToSpawnFalmer Auto
- FormList Property GenesisBandits Auto
- FormList Property GenesisBanditsObjects Auto
- FormList Property GenesisSpiders Auto
- FormList Property GenesisSpidersObjects Auto
- FormList Property GenesisSkeletons Auto
- FormList Property GenesisSkeletonsObjects Auto
- FormList Property GenesisFalmer Auto
- FormList Property GenesisFalmerObjects Auto
- GlobalVariable Property OddsOfPotion Auto
- Keyword Property LocSetNordicRuin Auto
- Keyword Property LocTypeDraugrCrypt Auto
- Keyword Property LocTypeDungeon Auto
- Keyword Property LocSetCave Auto
- Keyword Property LocSetCaveIce Auto
- Keyword Property LocSetDwarvenRuin Auto
- Keyword Property LocSetMilitaryCamp Auto
- Keyword Property LocSetMilitaryFort Auto
- Keyword Property LocTypeAnimalDen Auto
- Keyword Property LocTypeBanditCamp Auto
- Keyword Property LocTypeDragonLair Auto
- Keyword Property LocTypeDragonPriestLair Auto
- Keyword Property LocTypeDwarvenAutomatons Auto
- Keyword Property LocTypeFalmerHive Auto
- Keyword Property LocTypeForswornCamp Auto
- Keyword Property LocTypeGiantCamp Auto
- Keyword Property LocTypeHagravenNest Auto
- Keyword Property LocTypeHold Auto
- Keyword Property LocTypeHoldMajor Auto
- Keyword Property LocTypeHoldMinor Auto
- Keyword Property LocTypeMilitaryCamp Auto
- Keyword Property LocTypeMilitaryFort Auto
- Keyword Property LocTypeMine Auto
- Keyword Property LocTypeOrcStronghold Auto
- Keyword Property LocTypeVampireLair Auto
- Keyword Property LocTypeWarlockLair Auto
- ;Keyword Property LocTypeWerebearLair Auto
- Keyword Property LocTypeWerewolfLair Auto
- GlobalVariable Property testgen Auto
- GlobalVariable Property kill35 Auto
- GlobalVariable Property GenesisDistance Auto
- GlobalVariable Property GenesisPotentialSpawns Auto
- FormList Property GenesisBlank Auto
- FormList Property GenesisDragonPriest Auto
- FormList Property GenesisDragonPriestObjects Auto
- FormList Property GenesisDwarven Auto
- FormList Property GenesisDwarvenObjects Auto
- FormList Property GenesisForsworn Auto
- FormList Property GenesisForswornObjects Auto
- FormList Property GenesisVampire Auto
- FormList Property GenesisVampireObjects2 Auto
- FormList Property GenesisWarlock Auto
- FormList Property GenesisWarlockObjects Auto
- FormList Property GenesisBanditObjects Auto
- FormList Property GenesisSpiderObjects Auto
- Quest Property GenesisLoot Auto
- GlobalVariable Property SOT_BeefierLoot Auto
- ;Quest Property FastTravelAmbushes2012 Auto
- GlobalVariable Property GenesisClear Auto
- GlobalVariable Property GenesisAtPlayerAllow Auto
- ObjectReference Property skulltomeasure Auto
- ObjectReference Property PositionHolder Auto
- GlobalVariable Property GenesisOutsideSpawns Auto
- GlobalVariable Property SKSEYes Auto
- FormList Property GenesisAlikr Auto
- FormList Property GenesisMageandMancers Auto
- FormList Property GenesisGhostShadeSkelie Auto
- FormList Property GenesisWerewolf Auto
- GlobalVariable Property HowFarToSpawn Auto
- GlobalVariable Property GenesisCounter Auto
- GlobalVariable Property SpawnNoCloser Auto
- FormList Property BadGuysFound Auto
- Quest Property GettingAlong Auto
- Faction Property WEPlayerEnemy Auto
- GlobalVariable Property SOTRandom Auto
- GlobalVariable Property genunltest Auto
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement