Наручите на еКњижари

Skyrim Creation Kit Scripts.zip

Scriptname EnchantedChestScript extends ObjectReference

;============== PROPERTIES ============== CHEST PROPERTIES String Property ChestID = "Chest01" Auto
Unique ID for this chest (e.g., "DragonkeepChest")

Form Property RequiredKey Auto
If set, player needs this key to open chest

Sound Property ChestOpenSound Auto
Custom open sound

Sound Property ChestCloseSound Auto
Custom close sound

MAGIC LOOT PROPERTIES LeveledItem Property MagicLootList Auto
Leveled list for random magical items

Int Property MinItems = 1 Auto
Minimum number of magic items

Int Property MaxItems = 3 Auto
Maximum number of magic items

DAILY RESET PROPERTIES Float Property ResetHour = 0.0 Auto
Game hour when chest resets (default 0 = midnight)

Bool Property RequirePreviousLootTaken = True Auto
Only reset if player took previous loot

TIMER PROPERTIES Float Property ResetDelay = 24.0 Auto
Hours until chest can reset again skyrim creation kit scripts.zip

;============== VARIABLES ============== ObjectReference Property LinkToContainer Auto hidden
Bool Property bIsLocked = True Auto
Bool Property bIsLooted = False Auto
Float Property LastResetTime Auto
Int ResetTimerID = 1
Float LastActionTime

;============== EVENTS ============== Event OnActivate(ObjectReference akActionRef)
Actor PlayerActor = Game.GetPlayer()

if akActionRef == PlayerActor  
	if bIsLocked  
		; Checkkey requirement  
		if RequiredKey != None && !PlayerActor.GetItemCount(RequiredKey)  
			Debug.Notification("This chest requires a special key")  
			PlayLockedSound()  
			Return  
		Else  
			bIsLocked = False  
			Debug.Notification("The chest unlocks with a magical click")  
		Endif  
	Endif
if !bIsLocked  
		OpenChest(PlayerActor)  
		LastActionTime = Utility.GetCurrentGameTime()  
	Endif  
Endif  

EndEvent

Event OnClose(ObjectReference akActionRef)
if ChestCloseSound
ChestCloseSound.Play(Self)
Endif

; Check for daily reset
if !bIsLocked && ShouldResetChest()  
	StartResetTimer()  
Endif
LastActionTime = Utility.GetCurrentGameTime()  

EndEvent

;============== FUNCTIONS ============== Function OpenChest(Actor PlayerActor)
if ChestOpenSound
ChestOpenSound.Play(Self)
Endif

if bIsLooted  
	Debug.Notification("The chest feels empty... maybe it will refill later")  
	; Force vanilla container menu  
	Self.Activate(PlayerActor, True)  
Else  
	; Populate with magical loot  
	PopulateMagicalLoot()  
	bIsLooted = True  
	Debug.Notification("Magical energy emanates from the chest!")
; Open container with custom items  
	Self.Activate(PlayerActor, True)  
Endif  

EndFunction

Function PopulateMagicalLoot()
Int ItemCount = Utility.RandomInt(MinItems, MaxItems)

While ItemCount > 0  
	If MagicLootList != None  
		Form RandomItem = MagicLootList.GetLeveledActorBase()  
		If RandomItem as Armor || RandomItem as Weapon || RandomItem as Scroll  
			Self.AddItem(RandomItem, 1, False)  
		Endif  
	Endif  
	ItemCount -= 1  
EndWhile
; Add extra enchantment chance (25%)  
If Utility.RandomInt(1, 100) <= 25  
	Form ExtraEnchantedItem = MagicLootList.GetLeveledActorBase()  
	Self.AddItem(ExtraEnchantedItem, 1, False)  
	Debug.Notification("A glowing item appears inside!")  
Endif  

EndFunction

Bool Function ShouldResetChest()
Float CurrentTime = Utility.GetCurrentGameTime()
Float DaysSinceLastReset = CurrentTime - LastResetTime

If RequirePreviousLootTaken  
	Return (bIsLooted && DaysSinceLastReset >= ResetDelay)  
Else  
	Return (DaysSinceLastReset >= ResetDelay)  
Endif  

EndFunction

Function StartResetTimer()
Float GameHour = GetCurrentGameHour()
Float HoursUntilReset

If GameHour < ResetHour  
	HoursUntilReset = ResetHour - GameHour  
Else  
	HoursUntilReset = (24.0 - GameHour) + ResetHour  
Endif
If HoursUntilReset > 0  
	StartTimerGameTime(HoursUntilReset, ResetTimerID)  
	Debug.Notification("You sense the chest will reset at " + ResetHour + ":00")  
Endif  

EndFunction

Event OnTimerGameTime(int aiTimerID)
If aiTimerID == ResetTimerID
ResetChest()
Endif
EndEvent

Function ResetChest()
; Clear all items
Self.RemoveAllItems()

; Reset flags  
bIsLocked = True  
bIsLooted = False  
LastResetTime = Utility.GetCurrentGameTime()
; Visual effect  
Self.PlaceAtMe(Game.GetForm(0x000FEA9B) as EffectShader) ; Magelight effect  
Debug.Notification("The chest magically resets and locks itself")  

EndFunction

Float Function GetCurrentGameHour()
Float CurrentTime = Utility.GetCurrentGameTime()
Int DaysPassed = CurrentTime as Int
Float Hours = (CurrentTime - DaysPassed) * 24
Return Hours
EndFunction

Function PlayLockedSound()
Sound LockedSound = Game.GetForm(0x00036547) as Sound ; Standard lock sound
If LockedSound
LockedSound.Play(Self)
Endif
EndFunction
for the modding community

Scriptname ChestTrackingQuestScript extends Quest

Attach to a starter quest for persistent chest tracking

ObjectReference[] Property TrackedChests Auto
Fill with all enchanted chest references

Bool[] Property ChestsFound Auto

Event OnInit()
RegisterForSingleUpdateGameTime(0.1)
EndEvent

Event OnUpdateGameTime()
Int i = 0
While i < TrackedChests.Length
If TrackedChests[i] != None && !ChestsFound[i]
If TrackedChests[i].GetDistance(Game.GetPlayer()) < 500
ChestsFound[i] = True
Debug.Notification("You sense magical energy nearby...")
Endif
Endif
i += 1
EndWhile
RegisterForSingleUpdateGameTime(0.5)
EndEvent


In the vast ecosystem of The Elder Scrolls V: Skyrim, few files are as unassuming yet fundamentally transformative as Skyrim Creation Kit Scripts.zip. Nestled within the toolkit provided by Bethesda Softworks, this compressed folder is often overlooked by the average player. However, for the modding community, it is nothing short of a Rosetta Stone. This archive, containing the raw Portable Document Format (Papyrus) source files for the game’s logic, represents the thin line between a static game world and a dynamic, player-driven universe. By exposing the inner workings of Whiterun’s guards, dragon flight patterns, and quest triggers, this zip file serves as the primary catalyst for the game’s legendary longevity.

Before fiddling with scripts, navigate to: \Steam\steamapps\common\Skyrim Special Edition\Data\Scripts\ Copy the entire Scripts folder to your desktop. If something breaks, you can restore it. dragon flight patterns

Skyrim runs on a proprietary scripting language called Papyrus. Every time a quest updates, a trap triggers, or a dragon shouts, Papyrus code is executed. Modders write these scripts using the Creation Kit.

Bethesda distributes these source scripts as a .zip archive because they are development files. The average player does not need them; only creators do. By packaging them separately, Bethesda reduces the base game’s file size. It is your job as a modder to extract them into the right place.