Skip to content

Commit

Permalink
v2.0.0 - Add MCM
Browse files Browse the repository at this point in the history
  • Loading branch information
markekraus committed Jan 31, 2022
1 parent 7d7e8fc commit 1ae9c77
Show file tree
Hide file tree
Showing 12 changed files with 243 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"problemMatcher":"$PapyrusCompiler",
"args": [
"${relativeFile}",
"-i=Source\\Scripts;..\\Creation Kit Scripts\\Source\\Scripts",
"-i=Source\\Scripts;..\\SkyUI SDK\\source\\scripts;..\\Creation Kit Scripts\\Source\\Scripts",
"-o=Scripts",
"-f=TESV_Papyrus_Flags.flg"
],
Expand Down
Binary file modified MarkekrausSummonCorpses.bsa
Binary file not shown.
Binary file modified MarkekrausSummonCorpses.esp
Binary file not shown.
1 change: 1 addition & 0 deletions MarkekrausSummonCorpses.ppj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
</Variables>
<Imports>
<Import>.\Source\Scripts</Import>
<Import>..\SkyUI SDK\source\scripts</Import>
<Import>..\Creation Kit Scripts\Source\Scripts</Import>
</Imports>
<Folders>
Expand Down
49 changes: 46 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ My mods:

## About Summon Corpses Power

Adds a power that summons a coffin once a day to dump 1 to 25 fresh corpses on the targeted area. The number of corpses is based on your Conjuration skill.
Adds a power that summons a coffin once a day to dump 1 to 25 fresh corpses on the targeted area. The number of corpses is based on your Conjuration skill and can be configured in the Mod Configuration Menu.

You may be wondering why this mod exists. It was an idea I had while working on another silly mod. I made this only because I thought it was interesting. Maybe this is useful for a Necromancer play-through? I don't know; I didn't make it with any purpose in mind other than thinking it would be cool in a macabre sort of way.

Expand All @@ -32,9 +32,50 @@ The power can be learned through a spell tome in the Whiterun Hall of the Dead C

The corpses can be looted, reanimated, or just left for decoration.

The summoned corpses are not persistent so they will de-spawn like most hostile NPCs.

### Number of Corpses

The number corpses summoned scales with your Conjuration skill.
The number corpses summoned scales with your Conjuration skill. The maximum number of corpses can be set in the Mod Configuration Menu. Consider toggling this down if you suffer performance issues with the default setting.

Max 1: Only 1 corpse will be spawned regardless of skill level.

Max 5:

* Skill level 1-29: 1 corpse
* Skill level 30-39: 2 corpses
* Skill level 40-49: 3 corpses
* Skill level 50-59: 4 corpses
* Skill level 60+: 5 corpses

Max 10:

* Skill level 1-19: 1 corpse
* Skill level 20-29: 2 corpses
* Skill level 30-39: 4 corpses
* Skill level 40-49: 6 corpses
* Skill level 50-59: 8 corpses
* Skill level 60+: 10 corpses

Max 15:

* Skill level 1-19: 1 corpse
* Skill level 20-29: 3 corpses
* Skill level 30-39: 5 corpses
* Skill level 40-49: 7 corpses
* Skill level 50-59: 10 corpses
* Skill level 60+: 15 corpses

Max 20:

* Skill level 1-19: 1 corpse
* Skill level 20-29: 5 corpses
* Skill level 30-39: 8 corpses
* Skill level 40-49: 10 corpses
* Skill level 50-59: 15 corpses
* Skill level 60+: 20 corpses

Max 25 (Default):

* Skill level 1-19: 1 corpse
* Skill level 20-29: 5 corpses
Expand All @@ -53,7 +94,7 @@ The level of corpses scales with your player level.

### Requirements

This mod has no requirements
This mod requires [SkyUI](https://www.nexusmods.com/skyrimspecialedition/mods/12604) for the Mod Configuration Menu.

### NMM/Vortex/MO2

Expand All @@ -73,6 +114,8 @@ This mod can be installed in any order.

Enter the Whiterun Hall of the Dead Catacombs and read the "Spell Tome: Summon Corpses" book. Equip the power in your Magick menu. Aim at the location you wish to have corpses dumped. Activate the power. Wait 1 in-game day to use the power again.

You can change the maximum number of corpses and scaling with Conjuration in the Mod Configuration menu.

## Compatibility

This mod should be compatible with everything. Any mod that significantly modifies the Hall of the Dead Catacombs in Whiterun may make the spell tome inaccessible.
Binary file added Scripts/MEKSCSMenuConfig.pex
Binary file not shown.
Binary file modified Scripts/MEKSCSSummonCorpsesScript.pex
Binary file not shown.
114 changes: 114 additions & 0 deletions Source/Scripts/MEKSCSMenuConfig.psc
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
Scriptname MEKSCSMenuConfig extends SKI_ConfigBase

GlobalVariable Property MEKSCSMaxSummonedCorpseSetting Auto

int maxCorpsesMenuOID
string[] maxCorpsesOptions
string PageTitle01 = "Settings"
int curMaxCorpsesOption = 5

int function GetVersion()
return 1
endFunction

event OnConfigInit()
{Called when this config menu is initialized}
;Pages = new String[1]
;Pages[0] = PageTitle01

int globalSetting = MEKSCSMaxSummonedCorpseSetting.GetValue() as int
If (globalSetting > 5)
globalSetting = 5
EndIf
If (globalSetting < 0)
globalSetting = 0
EndIf
curMaxCorpsesOption = globalSetting

maxCorpsesOptions = new String[6]
maxCorpsesOptions[0] = "1"
maxCorpsesOptions[1] = "5"
maxCorpsesOptions[2] = "10"
maxCorpsesOptions[3] = "15"
maxCorpsesOptions[4] = "20"
maxCorpsesOptions[5] = "25"
endEvent

event OnPageReset(string a_page)
{Called when a new page is selected, including the initial empty page}

If (a_page == "")
SetCursorFillMode(TOP_TO_BOTTOM)
maxCorpsesMenuOID = AddMenuOption("Max Summoned Corpses", maxCorpsesOptions[curMaxCorpsesOption])
EndIf
endEvent

event OnOptionHighlight(int a_option)
{Called when highlighting an option}

if (a_option == maxCorpsesMenuOID)
SetInfoText("Sets the maximum corpses suommoned and changes the scaling with the Conjuration skill.")
EndIf
endEvent

event OnOptionMenuOpen(int a_option)
{Called when a menu option has been selected}

if (a_option == maxCorpsesMenuOID)
SetMenuDialogStartIndex(curMaxCorpsesOption)
SetMenuDialogDefaultIndex(5)
SetMenuDialogOptions(maxCorpsesOptions)
endIf
endEvent

event OnOptionMenuAccept(int a_option, int a_index)
{Called when a menu entry has been accepted}

if (a_option == maxCorpsesMenuOID)
curMaxCorpsesOption = a_index
MEKSCSMaxSummonedCorpseSetting.SetValue(a_index)
SetMenuOptionValue(a_option, maxCorpsesOptions[curMaxCorpsesOption])
EndIf
endEvent

; Not Implimented:

event OnVersionUpdate(int a_version)
{Called when a version update of this script has been detected}
endEvent

event OnOptionSelect(int a_option)
{Called when a non-interactive option has been selected}
endEvent

event OnOptionDefault(int a_option)
{Called when resetting an option to its default value}
endEvent

event OnOptionSliderOpen(int a_option)
{Called when a slider option has been selected}
endEvent

event OnOptionSliderAccept(int a_option, float a_value)
{Called when a new slider value has been accepted}
endEvent

event OnOptionColorOpen(int a_option)
{Called when a color option has been selected}
endEvent

event OnOptionColorAccept(int a_option, int a_color)
{Called when a new color has been accepted}
endEvent

event OnOptionKeyMapChange(int a_option, int a_keyCode, string a_conflictControl, string a_conflictName)
{Called when a key has been remapped}
endEvent

event OnOptionInputOpen(int a_option)
{Called when a text input option has been selected}
endEvent

event OnOptionInputAccept(int a_option, string a_input)
{Called when a new text input has been accepted}
endEvent
86 changes: 78 additions & 8 deletions Source/Scripts/MEKSCSSummonCorpsesScript.psc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ Scriptname MEKSCSSummonCorpsesScript extends ObjectReference
ActorBase Property MEKSCSSummonedCorpse Auto
Static Property MEKSCSNordicCoffinStatic04 Auto
EffectShader Property DA02ArmorShadow Auto
GlobalVariable Property MEKSCSMaxSummonedCorpseSetting Auto

float dropHeight = 100.0
float spawnDelay = 0.1
float coffinOffset = 155.0
float coffinDespawnDelay = 0.5
float coffinDespawnDelay = 1.0

Event OnLoad()
SummonCorpses(GetCorpseCount())
Expand All @@ -24,9 +25,9 @@ EndEvent

Function SummonCorpses(int corpseCount)
ObjectReference coffiinRef = self.PlaceAtMe(MEKSCSNordicCoffinStatic04)
DA02ArmorShadow.Play(coffiinRef, -1)
coffiinRef.MoveTo(self, 0.0, 0.0, dropHeight + coffinOffset)
coffiinRef.SetAngle(0, 180, 0)
DA02ArmorShadow.Play(coffiinRef, -1)
Utility.Wait(spawnDelay)
int index = 0
While (index < corpseCount)
Expand All @@ -43,21 +44,90 @@ Function SummonCorpses(int corpseCount)
EndFunction

int Function GetCorpseCount()
int [] distribution = GetDistribution()

float playerConjurationLevel = Game.GetPlayer().GetActorValue("Conjuration")

If (playerConjurationLevel < 20)
return 1
return distribution[0]
EndIf
If (playerConjurationLevel < 30)
return 5
return distribution[1]
EndIf
If (playerConjurationLevel < 40)
return 10
return distribution[2]
EndIf
If (playerConjurationLevel < 50)
return 15
return distribution[3]
EndIf
If (playerConjurationLevel < 60)
return 20
return distribution[4]
EndIf
return distribution[5]
EndFunction

int[] Function GetDistribution()
int maxCorpsesSetting = MEKSCSMaxSummonedCorpseSetting.GetValue() as int
If (maxCorpsesSetting > 5)
maxCorpsesSetting = 5
EndIf
If (maxCorpsesSetting < 0)
maxCorpsesSetting = 0
EndIf

int[] distribution = new int[6]
If (maxCorpsesSetting == 0)
distribution[0] = 1
distribution[1] = 1
distribution[2] = 1
distribution[3] = 1
distribution[4] = 1
distribution[5] = 1
return distribution
EndIf
If (maxCorpsesSetting == 1)
distribution[0] = 1
distribution[1] = 1
distribution[2] = 2
distribution[3] = 3
distribution[4] = 4
distribution[5] = 5
return distribution
EndIf
If (maxCorpsesSetting == 2)
distribution[0] = 1
distribution[1] = 2
distribution[2] = 4
distribution[3] = 6
distribution[4] = 8
distribution[5] = 10
return distribution
EndIf
If (maxCorpsesSetting == 3)
distribution[0] = 1
distribution[1] = 3
distribution[2] = 5
distribution[3] = 7
distribution[4] = 10
distribution[5] = 15
return distribution
EndIf
If (maxCorpsesSetting == 4)
distribution[0] = 1
distribution[1] = 5
distribution[2] = 8
distribution[3] = 10
distribution[4] = 15
distribution[5] = 20
return distribution
EndIf
If (maxCorpsesSetting == 5)
distribution[0] = 1
distribution[1] = 5
distribution[2] = 10
distribution[3] = 15
distribution[4] = 10
distribution[5] = 25
return distribution
EndIf
return 25
EndFunction
2 changes: 1 addition & 1 deletion buildConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"UnfuzerPath": "..\\..\\Game Root\\Tools\\unfuzer",
"ModInfo": {
"Name": "Summon Corpses Power",
"Version": "1.0.0",
"Version": "2.0.0",
"Author": "Mark E. Kraus",
"Description": "Adds a power that summons a coffin once a day to dump 1 to 25 fresh corpses on the targeted area.",
"Website": "https://www.nexusmods.com/skyrimspecialedition/mods/62857",
Expand Down
1 change: 1 addition & 0 deletions fomod/ModuleConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<description>Installs script sources.</description>
<image path="logo.png" />
<files>
<file source="Source\Scripts\MEKSCSMenuConfig.psc" destination="Source\Scripts\MEKSCSMenuConfig.psc" priority="0" />
<file source="Source\Scripts\MEKSCSSummonCorpsesScript.psc" destination="Source\Scripts\MEKSCSSummonCorpsesScript.psc" priority="0" />
</files>
<typeDescriptor>
Expand Down
2 changes: 1 addition & 1 deletion fomod/info.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<fomod>
<Name>Summon Corpses Power</Name>
<Author>Mark E. Kraus</Author>
<Version>1.0.0</Version>
<Version>2.0.0</Version>
<Website>https://www.nexusmods.com/skyrimspecialedition/mods/62857</Website>
<Description>Adds a power that summons a coffin once a day to dump 1 to 25 fresh corpses on the targeted area.</Description>
<Groups>
Expand Down

0 comments on commit 1ae9c77

Please sign in to comment.