├── .github └── workflows │ └── testbuild.yaml ├── .gitignore ├── CMakeLists.txt ├── README.md ├── cmake ├── configuration.cmake ├── installation.cmake └── versioning.cmake ├── scripts ├── build.py ├── build_multithread.py ├── generate_cmake.py ├── modified │ ├── ActiveMagicEffect.psc │ ├── Actor.psc │ ├── ActorBase.psc │ ├── ActorValueInfo.psc │ ├── Alias.psc │ ├── Ammo.psc │ ├── Apparatus.psc │ ├── Armor.psc │ ├── ArmorAddon.psc │ ├── Art.psc │ ├── Book.psc │ ├── Camera.psc │ ├── Cell.psc │ ├── ColorComponent.psc │ ├── ColorForm.psc │ ├── CombatStyle.psc │ ├── ConstructibleObject.psc │ ├── DefaultObjectManager.psc │ ├── Enchantment.psc │ ├── EquipSlot.psc │ ├── Faction.psc │ ├── Flora.psc │ ├── Form.psc │ ├── FormList.psc │ ├── FormType.psc │ ├── Game.psc │ ├── GameData.psc │ ├── HeadPart.psc │ ├── Ingredient.psc │ ├── Input.psc │ ├── Keyword.psc │ ├── LeveledActor.psc │ ├── LeveledItem.psc │ ├── LeveledSpell.psc │ ├── Location.psc │ ├── MagicEffect.psc │ ├── Math.psc │ ├── ModEvent.psc │ ├── NetImmerse.psc │ ├── ObjectReference.psc │ ├── Outfit.psc │ ├── Perk.psc │ ├── Potion.psc │ ├── Quest.psc │ ├── Race.psc │ ├── SKSE.psc │ ├── Scroll.psc │ ├── Shout.psc │ ├── SoulGem.psc │ ├── Sound.psc │ ├── SoundDescriptor.psc │ ├── SpawnerTask.psc │ ├── Spell.psc │ ├── StringUtil.psc │ ├── TextureSet.psc │ ├── TreeObject.psc │ ├── UI.psc │ ├── UICallback.psc │ ├── Utility.psc │ ├── Weapon.psc │ ├── Weather.psc │ └── WornObject.psc └── vanilla │ ├── Activator.psc │ ├── ActiveMagicEffect.psc │ ├── Actor.psc │ ├── ActorBase.psc │ ├── Alias.psc │ ├── Ammo.psc │ ├── Apparatus.psc │ ├── Armor.psc │ ├── AssociationType.psc │ ├── Book.psc │ ├── Cell.psc │ ├── Class.psc │ ├── ConstructibleObject.psc │ ├── EffectShader.psc │ ├── Enchantment.psc │ ├── EncounterZone.psc │ ├── Explosion.psc │ ├── Faction.psc │ ├── Flora.psc │ ├── Form.psc │ ├── FormList.psc │ ├── Game.psc │ ├── GlobalVariable.psc │ ├── Idle.psc │ ├── ImageSpaceModifier.psc │ ├── ImpactDataSet.psc │ ├── Ingredient.psc │ ├── Key.psc │ ├── Keyword.psc │ ├── LeveledActor.psc │ ├── LeveledItem.psc │ ├── LeveledSpell.psc │ ├── Light.psc │ ├── Location.psc │ ├── LocationRefType.psc │ ├── MagicEffect.psc │ ├── Math.psc │ ├── MiscObject.psc │ ├── ObjectReference.psc │ ├── Outfit.psc │ ├── Package.psc │ ├── Perk.psc │ ├── Potion.psc │ ├── Projectile.psc │ ├── Quest.psc │ ├── Race.psc │ ├── ReferenceAlias.psc │ ├── Scene.psc │ ├── Scroll.psc │ ├── Shout.psc │ ├── SoulGem.psc │ ├── Sound.psc │ ├── Spell.psc │ ├── Static.psc │ ├── TESV_Papyrus_Flags.flg │ ├── TextureSet.psc │ ├── Topic.psc │ ├── Utility.psc │ ├── VoiceType.psc │ ├── Weapon.psc │ ├── Weather.psc │ ├── WordOfPower.psc │ └── WorldSpace.psc ├── sheets ├── Common.props ├── ForcedInclude.props ├── Postbuild.props └── Runtime.props ├── skse64.sln ├── skse64 ├── BSModelDB.cpp ├── BSModelDB.h ├── CMakeLists.txt ├── Colors.cpp ├── Colors.h ├── CustomMenu.cpp ├── CustomMenu.h ├── GameAPI.cpp ├── GameAPI.h ├── GameBSExtraData.cpp ├── GameBSExtraData.h ├── GameCamera.cpp ├── GameCamera.h ├── GameData.cpp ├── GameData.h ├── GameEvents.cpp ├── GameEvents.h ├── GameExtraData.cpp ├── GameExtraData.h ├── GameFormComponents.cpp ├── GameFormComponents.h ├── GameForms.cpp ├── GameForms.h ├── GameHandlers.cpp ├── GameHandlers.h ├── GameInput.cpp ├── GameInput.h ├── GameMenus.cpp ├── GameMenus.h ├── GameObjects.cpp ├── GameObjects.h ├── GamePathing.cpp ├── GamePathing.h ├── GameRTTI.cpp ├── GameRTTI.h ├── GameRTTI.inl ├── GameReferences.cpp ├── GameReferences.h ├── GameResources.cpp ├── GameResources.h ├── GameSettings.cpp ├── GameSettings.h ├── GameStreams.cpp ├── GameStreams.h ├── GameThreads.cpp ├── GameTypes.cpp ├── GameTypes.h ├── GameUtilities.cpp ├── GameUtilities.h ├── GlobalLocks.cpp ├── GlobalLocks.h ├── HashUtil.cpp ├── HashUtil.h ├── Hooks_Camera.cpp ├── Hooks_Camera.h ├── Hooks_Data.cpp ├── Hooks_Data.h ├── Hooks_Debug.cpp ├── Hooks_Debug.h ├── Hooks_Diagnostics.cpp ├── Hooks_Diagnostics.h ├── Hooks_DirectInput8Create.cpp ├── Hooks_DirectInput8Create.h ├── Hooks_Event.cpp ├── Hooks_Event.h ├── Hooks_Gameplay.cpp ├── Hooks_Gameplay.h ├── Hooks_Handlers.cpp ├── Hooks_Handlers.h ├── Hooks_Memory.cpp ├── Hooks_Memory.h ├── Hooks_NetImmerse.cpp ├── Hooks_NetImmerse.h ├── Hooks_ObScript.cpp ├── Hooks_ObScript.h ├── Hooks_Papyrus.cpp ├── Hooks_Papyrus.h ├── Hooks_SaveLoad.cpp ├── Hooks_SaveLoad.h ├── Hooks_Scaleform.cpp ├── Hooks_Scaleform.h ├── Hooks_Threads.cpp ├── Hooks_Threads.h ├── Hooks_UI.cpp ├── Hooks_UI.h ├── InputMap.cpp ├── InputMap.h ├── InternalSerialization.cpp ├── InternalSerialization.h ├── InternalTasks.cpp ├── InternalTasks.h ├── NiAdditionalGeometryData.cpp ├── NiAdditionalGeometryData.h ├── NiControllers.cpp ├── NiControllers.h ├── NiExtraData.cpp ├── NiExtraData.h ├── NiGeometry.cpp ├── NiGeometry.h ├── NiInterpolators.cpp ├── NiInterpolators.h ├── NiLight.cpp ├── NiLight.h ├── NiMaterial.cpp ├── NiMaterial.h ├── NiNodes.cpp ├── NiNodes.h ├── NiObjects.cpp ├── NiObjects.h ├── NiProperties.cpp ├── NiProperties.h ├── NiRTTI.cpp ├── NiRTTI.h ├── NiRenderer.cpp ├── NiRenderer.h ├── NiSerialization.cpp ├── NiSerialization.h ├── NiTextures.cpp ├── NiTextures.h ├── NiTypes.cpp ├── NiTypes.h ├── ObScript.cpp ├── ObScript.h ├── PapyrusActiveMagicEffect.cpp ├── PapyrusActiveMagicEffect.h ├── PapyrusActor.cpp ├── PapyrusActor.h ├── PapyrusActorBase.cpp ├── PapyrusActorBase.h ├── PapyrusActorValueInfo.cpp ├── PapyrusActorValueInfo.h ├── PapyrusAlias.cpp ├── PapyrusAlias.h ├── PapyrusAmmo.cpp ├── PapyrusAmmo.h ├── PapyrusArgs.cpp ├── PapyrusArgs.h ├── PapyrusArmor.cpp ├── PapyrusArmor.h ├── PapyrusArmorAddon.cpp ├── PapyrusArmorAddon.h ├── PapyrusArt.cpp ├── PapyrusArt.h ├── PapyrusBook.cpp ├── PapyrusBook.h ├── PapyrusCamera.cpp ├── PapyrusCamera.h ├── PapyrusCell.cpp ├── PapyrusCell.h ├── PapyrusClass.cpp ├── PapyrusClass.h ├── PapyrusColorForm.cpp ├── PapyrusColorForm.h ├── PapyrusCombatStyle.cpp ├── PapyrusCombatStyle.h ├── PapyrusConstructibleObject.cpp ├── PapyrusConstructibleObject.h ├── PapyrusDefaultObjectManager.cpp ├── PapyrusDefaultObjectManager.h ├── PapyrusDelayFunctors.cpp ├── PapyrusDelayFunctors.h ├── PapyrusEnchantment.cpp ├── PapyrusEnchantment.h ├── PapyrusEquipSlot.cpp ├── PapyrusEquipSlot.h ├── PapyrusEventFunctor.h ├── PapyrusEvents.cpp ├── PapyrusEvents.h ├── PapyrusFaction.cpp ├── PapyrusFaction.h ├── PapyrusFlora.cpp ├── PapyrusFlora.h ├── PapyrusForm.cpp ├── PapyrusForm.h ├── PapyrusFormList.cpp ├── PapyrusFormList.h ├── PapyrusGame.cpp ├── PapyrusGame.h ├── PapyrusGameData.cpp ├── PapyrusGameData.h ├── PapyrusHeadPart.cpp ├── PapyrusHeadPart.h ├── PapyrusIngredient.cpp ├── PapyrusIngredient.h ├── PapyrusInput.cpp ├── PapyrusInput.h ├── PapyrusInterfaces.cpp ├── PapyrusInterfaces.h ├── PapyrusKeyword.cpp ├── PapyrusKeyword.h ├── PapyrusLeveledActor.cpp ├── PapyrusLeveledActor.h ├── PapyrusLeveledItem.cpp ├── PapyrusLeveledItem.h ├── PapyrusLeveledSpell.cpp ├── PapyrusLeveledSpell.h ├── PapyrusLocation.cpp ├── PapyrusLocation.h ├── PapyrusMagicEffect.cpp ├── PapyrusMagicEffect.h ├── PapyrusMath.cpp ├── PapyrusMath.h ├── PapyrusMisc.cpp ├── PapyrusMisc.h ├── PapyrusModEvent.cpp ├── PapyrusModEvent.h ├── PapyrusNativeFunctionDef.inl ├── PapyrusNativeFunctionDef_Base.inl ├── PapyrusNativeFunctions.cpp ├── PapyrusNativeFunctions.h ├── PapyrusNetImmerse.cpp ├── PapyrusNetImmerse.h ├── PapyrusObjectReference.cpp ├── PapyrusObjectReference.h ├── PapyrusObjects.cpp ├── PapyrusObjects.h ├── PapyrusPerk.cpp ├── PapyrusPerk.h ├── PapyrusPotion.cpp ├── PapyrusPotion.h ├── PapyrusQuest.cpp ├── PapyrusQuest.h ├── PapyrusRace.cpp ├── PapyrusRace.h ├── PapyrusReferenceAlias.cpp ├── PapyrusReferenceAlias.h ├── PapyrusSKSE.cpp ├── PapyrusSKSE.h ├── PapyrusScroll.cpp ├── PapyrusScroll.h ├── PapyrusShout.cpp ├── PapyrusShout.h ├── PapyrusSound.cpp ├── PapyrusSound.h ├── PapyrusSoundDescriptor.cpp ├── PapyrusSoundDescriptor.h ├── PapyrusSpawnerTask.cpp ├── PapyrusSpawnerTask.h ├── PapyrusSpell.cpp ├── PapyrusSpell.h ├── PapyrusStringUtil.cpp ├── PapyrusStringUtil.h ├── PapyrusTextureSet.cpp ├── PapyrusTextureSet.h ├── PapyrusTree.cpp ├── PapyrusTree.h ├── PapyrusUI.cpp ├── PapyrusUI.h ├── PapyrusUICallback.cpp ├── PapyrusUICallback.h ├── PapyrusUtility.cpp ├── PapyrusUtility.h ├── PapyrusVM.cpp ├── PapyrusVM.h ├── PapyrusValue.cpp ├── PapyrusValue.h ├── PapyrusWeapon.cpp ├── PapyrusWeapon.h ├── PapyrusWeather.cpp ├── PapyrusWeather.h ├── PapyrusWornObject.cpp ├── PapyrusWornObject.h ├── PluginAPI.h ├── PluginLoadErrorDialog.rc ├── PluginManager.cpp ├── PluginManager.h ├── ScaleformAPI.cpp ├── ScaleformAPI.h ├── ScaleformCallbacks.cpp ├── ScaleformCallbacks.h ├── ScaleformExtendedData.cpp ├── ScaleformExtendedData.h ├── ScaleformLoader.cpp ├── ScaleformLoader.h ├── ScaleformMovie.cpp ├── ScaleformMovie.h ├── ScaleformState.cpp ├── ScaleformState.h ├── ScaleformTypes.cpp ├── ScaleformTypes.h ├── ScaleformVM.cpp ├── ScaleformVM.h ├── ScaleformValue.cpp ├── ScaleformValue.h ├── Serialization.cpp ├── Serialization.h ├── Translation.cpp ├── Translation.h ├── cmake │ ├── config.cmake.in │ ├── headerlist.cmake │ └── sourcelist.cmake ├── gamethreads.h ├── resource.h ├── skse64.cpp ├── skse64.def ├── skse64.vcxproj └── skse64.vcxproj.filters ├── skse64_common ├── BranchTrampoline.cpp ├── BranchTrampoline.h ├── CMakeLists.txt ├── Relocation.cpp ├── Relocation.h ├── SafeWrite.cpp ├── SafeWrite.h ├── Utilities.cpp ├── Utilities.h ├── cmake │ ├── config.cmake.in │ ├── headerlist.cmake │ └── sourcelist.cmake ├── skse64_common.vcxproj ├── skse64_common.vcxproj.filters ├── skse_version.h └── skse_version.rc ├── skse64_license.txt ├── skse64_loader ├── CMakeLists.txt ├── Options.cpp ├── Options.h ├── cmake │ ├── config.cmake.in │ ├── headerlist.cmake │ └── sourcelist.cmake ├── main.cpp ├── skse64_loader.vcxproj └── skse64_loader.vcxproj.filters ├── skse64_loader_common ├── CMakeLists.txt ├── IdentifyEXE.cpp ├── IdentifyEXE.h ├── Inject.cpp ├── Inject.h ├── LoaderError.cpp ├── LoaderError.h ├── MSSCCPRJ.SCC ├── Steam.cpp ├── Steam.h ├── cmake │ ├── config.cmake.in │ ├── headerlist.cmake │ └── sourcelist.cmake ├── skse64_loader_common.vcxproj └── skse64_loader_common.vcxproj.filters ├── skse64_msstore_loader ├── CMakeLists.txt ├── cmake │ ├── config.cmake.in │ ├── headerlist.cmake │ └── sourcelist.cmake ├── main.cpp └── require_admin.manifest ├── skse64_msstore_stub ├── CMakeLists.txt ├── cmake │ ├── config.cmake.in │ ├── headerlist.cmake │ └── sourcelist.cmake └── main.cpp ├── skse64_readme.txt ├── skse64_steam_loader ├── CMakeLists.txt ├── cmake │ ├── config.cmake.in │ ├── headerlist.cmake │ └── sourcelist.cmake ├── main.cpp ├── skse64_steam_loader.def ├── skse64_steam_loader.vcxproj └── skse64_steam_loader.vcxproj.filters ├── skse64_whatsnew.txt └── xbyak ├── CMakeLists.txt ├── COPYRIGHT ├── cmake └── config.cmake.in ├── xbyak.h ├── xbyak_bin2hex.h ├── xbyak_mnemonic.h └── xbyak_util.h /.github/workflows/testbuild.yaml: -------------------------------------------------------------------------------- 1 | name: testbuild 2 | on: [push] 3 | jobs: 4 | run-testbuild: 5 | runs-on: windows-latest 6 | steps: 7 | - uses: actions/checkout@v2 8 | with: 9 | path: skse64 10 | - uses: actions/checkout@v2 11 | with: 12 | path: common 13 | repository: ianpatt/common 14 | - run: cmake -B common/build -S common -DCMAKE_INSTALL_PREFIX=extern common 15 | - run: cmake --build common/build --config Release --target install 16 | - run: cmake -B skse64/build -S skse64 -DCMAKE_INSTALL_PREFIX=extern skse64 17 | - run: cmake --build skse64/build --config Release -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # visual studio 2 | *.sdf 3 | *.opensdf 4 | *.suo 5 | .vs 6 | *.VC.db 7 | *.VC.opendb 8 | *.ncb 9 | *.user 10 | *.aps 11 | *.vspscc 12 | 13 | # build output 14 | *.tlog 15 | *.lastbuildstate 16 | *.unsuccessfulbuild 17 | *.lib 18 | *.log 19 | *.obj 20 | *.idb 21 | *.pdb 22 | *.res 23 | *.cache 24 | BuildLog.htm 25 | *.exe 26 | *.dll 27 | *.exp 28 | *.ilk 29 | 30 | # scripts 31 | scripts/build_bin 32 | scripts/build_src 33 | scripts/compiler 34 | scripts/merged 35 | 36 | # cmake 37 | build/* 38 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | 3 | # ---- Project ---- 4 | 5 | project( 6 | umbrella 7 | LANGUAGES CXX 8 | ) 9 | 10 | # ---- Include guards ---- 11 | 12 | if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) 13 | message( 14 | FATAL_ERROR 15 | "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there." 16 | ) 17 | endif() 18 | 19 | # ---- Add sub projects ---- 20 | 21 | if (NOT TARGET skse64) 22 | add_subdirectory(skse64) 23 | endif() 24 | 25 | if (NOT TARGET skse64_common) 26 | add_subdirectory(skse64_common) 27 | endif() 28 | 29 | if (NOT TARGET skse64_loader) 30 | add_subdirectory(skse64_loader) 31 | endif() 32 | 33 | if (NOT TARGET skse64_loader_common) 34 | add_subdirectory(skse64_loader_common) 35 | endif() 36 | 37 | if (NOT TARGET skse64_steam_loader) 38 | add_subdirectory(skse64_steam_loader) 39 | endif() 40 | 41 | if (NOT TARGET skse64_msstore_loader) 42 | add_subdirectory(skse64_msstore_loader) 43 | endif() 44 | 45 | if (NOT TARGET skse64_msstore_stub) 46 | add_subdirectory(skse64_msstore_stub) 47 | endif() 48 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![testbuild](https://github.com/ianpatt/skse64/workflows/testbuild/badge.svg) 2 | ## Building 3 | ``` 4 | git clone https://github.com/ianpatt/common 5 | git clone https://github.com/ianpatt/skse64 6 | cmake -B common/build -S common -DCMAKE_INSTALL_PREFIX=extern common 7 | cmake --build common/build --config Release --target install 8 | cmake -B skse64/build -S skse64 -DCMAKE_INSTALL_PREFIX=extern skse64 9 | cmake --build skse64/build --config Release 10 | ``` 11 | Solution will be generated at skse64/build/umbrella.sln. 12 | -------------------------------------------------------------------------------- /cmake/configuration.cmake: -------------------------------------------------------------------------------- 1 | if (MSVC) 2 | set(COMPILE_OPTIONS_DEBUG 3 | /JMC # Just My Code debugging 4 | /ZI # Debug Information Format 5 | ) 6 | 7 | set(COMPILE_OPTIONS_RELEASE 8 | /Oi # Generate Intrinsic Functions 9 | /Zi # Debug Information Format 10 | ) 11 | 12 | target_compile_options( 13 | ${PROJECT_NAME} 14 | PRIVATE 15 | /MP # Build with Multiple Processes 16 | /W3 # Warning level 17 | 18 | "$<$:${COMPILE_OPTIONS_DEBUG}>" 19 | "$<$:${COMPILE_OPTIONS_RELEASE}>" 20 | ) 21 | 22 | set(LINK_OPTIONS_DEBUG 23 | /INCREMENTAL # Link Incrementally 24 | ) 25 | 26 | set(LINK_OPTIONS_RELEASE 27 | /DEBUG:FULL # Generate Debug Info 28 | /INCREMENTAL:NO # Link Incrementally 29 | /OPT:REF # Optimizations (eliminate functions/data never referenced) 30 | /OPT:ICF # Optimizations (perform identical COMDAT folding) 31 | ) 32 | 33 | target_link_options( 34 | ${PROJECT_NAME} 35 | PRIVATE 36 | "$<$:${LINK_OPTIONS_DEBUG}>" 37 | "$<$:${LINK_OPTIONS_RELEASE}>" 38 | ) 39 | endif() 40 | -------------------------------------------------------------------------------- /cmake/installation.cmake: -------------------------------------------------------------------------------- 1 | option(SKSE_COPY_OUTPUT "Copies output files to the skyrim64 directory" OFF) 2 | 3 | if (SKSE_COPY_OUTPUT) 4 | add_custom_command( 5 | TARGET ${PROJECT_NAME} 6 | POST_BUILD 7 | COMMAND ${CMAKE_COMMAND} -E copy $ "$ENV{Skyrim64Path}" 8 | COMMAND ${CMAKE_COMMAND} -E copy $ "$ENV{Skyrim64Path}" 9 | ) 10 | endif() 11 | -------------------------------------------------------------------------------- /cmake/versioning.cmake: -------------------------------------------------------------------------------- 1 | set(SKSE_VERSION_MAJOR 2) 2 | set(SKSE_VERSION_MINOR 2) 3 | set(SKSE_VERSION_PATCH 6) 4 | 5 | set(RUNTIME_VERSION_MAJOR 1) 6 | set(RUNTIME_VERSION_MINOR 6) 7 | set(RUNTIME_VERSION_PATCH 1170) 8 | set(RUNTIME_VERSION_TYPE 0) 9 | 10 | math( 11 | EXPR 12 | RUNTIME_VERSION_PACKED 13 | "((${RUNTIME_VERSION_MAJOR} & 0xFF) << 24) | ((${RUNTIME_VERSION_MINOR} & 0xFF) << 16) | ((${RUNTIME_VERSION_PATCH} & 0xFFF) << 4) | (${RUNTIME_VERSION_TYPE} & 0xF)" 14 | OUTPUT_FORMAT 15 | HEXADECIMAL 16 | ) 17 | -------------------------------------------------------------------------------- /scripts/generate_cmake.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | HEADER_TYPES = (".h", ".hpp", ".hxx", ".inl") 4 | SOURCE_TYPES = (".c", ".cpp", ".cxx") 5 | ALL_TYPES = HEADER_TYPES + SOURCE_TYPES 6 | 7 | def make_cmake(a_directories): 8 | for directory in a_directories: 9 | os.chdir("../" + directory) 10 | 11 | tmp = list() 12 | with os.scandir() as it: 13 | for entry in it: 14 | if not entry.name.startswith('.') and entry.is_file(): 15 | tmp.append(entry.name) 16 | 17 | headers = list() 18 | sources = list() 19 | for file in tmp: 20 | if file.endswith(HEADER_TYPES): 21 | headers.append(file) 22 | elif file.endswith(SOURCE_TYPES): 23 | sources.append(file) 24 | 25 | headers.sort() 26 | sources.sort() 27 | 28 | def do_make(a_filename, a_varname, a_files): 29 | out = open("cmake/" + a_filename + ".cmake", "w", encoding="utf-8") 30 | out.write("set(" + a_varname + "\n") 31 | 32 | for file in a_files: 33 | out.write("\t" + file + "\n") 34 | 35 | out.write(")\n") 36 | 37 | do_make("headerlist", "headers", headers) 38 | do_make("sourcelist", "sources", sources) 39 | 40 | def main(): 41 | cur = os.path.dirname(os.path.realpath(__file__)) 42 | os.chdir(cur) 43 | make_cmake([ "skse64", "skse64_common", "skse64_loader", "skse64_loader_common", "skse64_steam_loader" ]) 44 | 45 | if __name__ == "__main__": 46 | main() 47 | -------------------------------------------------------------------------------- /scripts/modified/Ammo.psc: -------------------------------------------------------------------------------- 1 | 2 | ; Returns whether this ammo is a bolt 3 | bool Function IsBolt() native 4 | 5 | ; Returns the projectile associated with this ammo 6 | Projectile Function GetProjectile() native 7 | 8 | ; Returns the base damage of this ammo 9 | float Function GetDamage() native 10 | -------------------------------------------------------------------------------- /scripts/modified/Apparatus.psc: -------------------------------------------------------------------------------- 1 | 2 | int Function GetQuality() native 3 | Function SetQuality(int quality) native -------------------------------------------------------------------------------- /scripts/modified/ArmorAddon.psc: -------------------------------------------------------------------------------- 1 | Scriptname ArmorAddon extends Form Hidden 2 | 3 | ; returns the model path of the particular model 4 | string Function GetModelPath(bool firstPerson, bool female) native 5 | 6 | ; sets the model path of the particular model 7 | Function SetModelPath(string path, bool firstPerson, bool female) native 8 | 9 | ; returns the number of texturesets for the particular model 10 | int Function GetModelNumTextureSets(bool first, bool female) native 11 | 12 | ; returns the nth textureset for the particular model 13 | TextureSet Function GetModelNthTextureSet(int n, bool first, bool female) native 14 | 15 | ; sets the nth textureset for the particular model 16 | Function SetModelNthTextureSet(TextureSet texture, int n, bool first, bool female) native 17 | 18 | ; returns the number of races this armor addon applies to 19 | int Function GetNumAdditionalRaces() native 20 | 21 | ; returns the nth race this armor addon applies to 22 | Race Function GetNthAdditionalRace(int n) native 23 | 24 | ; Functions and Flags dealing the BipedObject slot values from the CK 25 | ; These are the equivalent of 1 << (SlotMask-30). Basically 26 | ; these are a flags where 30 is the first bit, and 61 is the 31st bit. 27 | 28 | ; returns the slot mask for the armor addon. 29 | int Function GetSlotMask() native 30 | ; sets the slot mask for the armor addon 31 | Function SetSlotMask(int slotMask) native 32 | ; adds the specified slotMask to the armor addon 33 | int Function AddSlotToMask(int slotMask) native 34 | ; removes the specified slot masks from the armor addon 35 | int Function RemoveSlotFromMask(int slotMask) native 36 | 37 | ; calculates the equivalent mask value for the slot 38 | ; This is a global function, use it directly from Armor as it is faster 39 | int Function GetMaskForSlot(int slot) global 40 | return Armor.GetMaskForSlot(slot) 41 | EndFunction -------------------------------------------------------------------------------- /scripts/modified/Art.psc: -------------------------------------------------------------------------------- 1 | Scriptname Art extends Form Hidden 2 | 3 | string Function GetModelPath() native 4 | Function SetModelPath(string path) native -------------------------------------------------------------------------------- /scripts/modified/Book.psc: -------------------------------------------------------------------------------- 1 | ; Returns the spell that this book teaches 2 | Spell Function GetSpell() native 3 | Int Function GetSkill() native 4 | bool Function IsRead() native 5 | bool Function IsTakeable() native -------------------------------------------------------------------------------- /scripts/modified/Camera.psc: -------------------------------------------------------------------------------- 1 | Scriptname Camera Hidden 2 | 3 | 4 | ; Returns the character's current camera state 5 | ; 0 - first person 6 | ; 1 - auto vanity 7 | ; 2 - VATS 8 | ; 3 - free 9 | ; 4 - iron sights 10 | ; 5 - furniture 11 | ; 6 - transition 12 | ; 7 - tweenmenu 13 | ; 8 - third person 1 14 | ; 9 - third person 2 15 | ; 10 - horse 16 | ; 11 - bleedout 17 | ; 12 - dragon 18 | int Function GetCameraState() global native 19 | 20 | ; Updates the camera when changing Shoulder positions 21 | Function UpdateThirdPerson() global native 22 | 23 | ; Returns the player's camera FOV 24 | float Function GetWorldFieldOfView() global native 25 | float Function GetWorldFOV() global 26 | return GetWorldFieldOfView() 27 | EndFunction 28 | 29 | ; Sets the player's camera FOV 30 | Function SetWorldFieldOfView(float fov) global native 31 | Function SetWorldFOV(float fov) global 32 | SetWorldFieldOfView(fov) 33 | EndFunction 34 | 35 | ; Returns the player's camera FOV 36 | float Function GetFirstPersonFieldOfView() global native 37 | float Function GetFirstPersonFOV() global 38 | return GetFirstPersonFieldOfView() 39 | EndFunction 40 | 41 | ; Sets the player's camera FOV 42 | Function SetFirstPersonFieldOfView(float fov) global native 43 | Function SetFirstPersonFOV(float fov) global 44 | SetFirstPersonFieldOfView(fov) 45 | EndFunction -------------------------------------------------------------------------------- /scripts/modified/Cell.psc: -------------------------------------------------------------------------------- 1 | ; Returns the number of refs in the cell 2 | int Function GetNumRefs(int formTypeFilter = 0) native 3 | 4 | ; returns the ref at the specified index 5 | ObjectReference Function GetNthRef(int n, int formTypeFilter = 0) native 6 | 7 | ; Returns the water level of the cell (-2147483648 if no water) 8 | float Function GetWaterLevel() native 9 | 10 | ; Returns water level of the cell, if default returns water level from worldspace 11 | float Function GetActualWaterLevel() native -------------------------------------------------------------------------------- /scripts/modified/ColorComponent.psc: -------------------------------------------------------------------------------- 1 | Scriptname ColorComponent Hidden 2 | 3 | int Function GetAlpha(int argb) global native 4 | int Function GetRed(int argb) global native 5 | int Function GetGreen(int argb) global native 6 | int Function GetBlue(int argb) global native 7 | 8 | float Function GetHue(int argb) global native 9 | float Function GetSaturation(int argb) global native 10 | float Function GetValue(int argb) global native 11 | 12 | int Function SetAlpha(int argb, int a) global native 13 | int Function SetRed(int argb, int r) global native 14 | int Function SetGreen(int argb, int g) global native 15 | int Function SetBlue(int argb, int b) global native 16 | 17 | int Function SetHue(int argb, float h) global native 18 | int Function SetSaturation(int argb, float s) global native 19 | int Function SetValue(int argb, float v) global native -------------------------------------------------------------------------------- /scripts/modified/ColorForm.psc: -------------------------------------------------------------------------------- 1 | Scriptname ColorForm extends Form Hidden 2 | 3 | int Function GetColor() native 4 | Function SetColor(int color) native 5 | 6 | int Function GetRed() 7 | return ColorComponent.GetRed(Self.GetColor()) 8 | EndFunction 9 | 10 | int Function GetGreen() 11 | return ColorComponent.GetGreen(Self.GetColor()) 12 | EndFunction 13 | 14 | int Function GetBlue() 15 | return ColorComponent.GetBlue(Self.GetColor()) 16 | EndFunction 17 | 18 | float Function GetHue() 19 | return ColorComponent.GetHue(Self.GetColor()) 20 | EndFunction 21 | 22 | float Function GetSaturation() 23 | return ColorComponent.GetSaturation(Self.GetColor()) 24 | EndFunction 25 | 26 | float Function GetValue() 27 | return ColorComponent.GetValue(Self.GetColor()) 28 | EndFunction -------------------------------------------------------------------------------- /scripts/modified/ConstructibleObject.psc: -------------------------------------------------------------------------------- 1 | 2 | ; Gets/Sets the result of this recipe 3 | Form Function GetResult() native 4 | Function SetResult(Form result) native 5 | 6 | ; Gets/Sets the amount of results of this recipe 7 | int Function GetResultQuantity() native 8 | Function SetResultQuantity(int quantity) native 9 | 10 | ; Gets the number of ingredients 11 | int Function GetNumIngredients() native 12 | 13 | ; Gets/Sets the Nth ingredient required 14 | Form Function GetNthIngredient(int n) native 15 | Function SetNthIngredient(Form required, int n) native 16 | 17 | ; Gets/Sets the quantity of Nth ingredient required 18 | int Function GetNthIngredientQuantity(int n) native 19 | Function SetNthIngredientQuantity(int value, int n) native 20 | 21 | ; Gets/Sets the Workbench keyword (Which apparatus creates this) 22 | Keyword Function GetWorkbenchKeyword() native 23 | Function SetWorkbenchKeyword(Keyword aKeyword) native -------------------------------------------------------------------------------- /scripts/modified/Enchantment.psc: -------------------------------------------------------------------------------- 1 | ; return the number of the effects 2 | int Function GetNumEffects() native 3 | 4 | ; return the magnitude of the specified effect 5 | float Function GetNthEffectMagnitude(int index) native 6 | 7 | ; return the area of the specified effect 8 | int Function GetNthEffectArea(int index) native 9 | 10 | ; return the duration of the specified effect 11 | int Function GetNthEffectDuration(int index) native 12 | 13 | ; return the magic effect of the specified effect 14 | MagicEffect Function GetNthEffectMagicEffect(int index) native 15 | 16 | ; return the index of the costliest effect 17 | int Function GetCostliestEffectIndex() native 18 | 19 | ; sets the magnitude of the specified effect 20 | Function SetNthEffectMagnitude(int index, float value) native 21 | 22 | ; sets the area of the specified effect 23 | Function SetNthEffectArea(int index, int value) native 24 | 25 | ; sets the duration of the specified effect 26 | Function SetNthEffectDuration(int index, int value) native 27 | 28 | ; returns the base enchantment of this enchantment 29 | Enchantment Function GetBaseEnchantment() native 30 | 31 | ; Returns a Formlist of Keywords 32 | FormList Function GetKeywordRestrictions() native 33 | 34 | ; Sets the FormList of keywords 35 | Function SetKeywordRestrictions(FormList newKeywordList) native -------------------------------------------------------------------------------- /scripts/modified/EquipSlot.psc: -------------------------------------------------------------------------------- 1 | Scriptname EquipSlot extends Form Hidden 2 | 3 | ; Returns the number of parent slots 4 | int Function GetNumParents() native 5 | 6 | ; Returns the Nth parent slot 7 | EquipSlot Function GetNthParent(int n) native -------------------------------------------------------------------------------- /scripts/modified/Flora.psc: -------------------------------------------------------------------------------- 1 | SoundDescriptor Function GetHarvestSound() native 2 | Function SetHarvestSound(SoundDescriptor akSoundDescriptor) native 3 | 4 | Form Function GetIngredient() native 5 | Function SetIngredient(Form akIngredient) native -------------------------------------------------------------------------------- /scripts/modified/FormList.psc: -------------------------------------------------------------------------------- 1 | ; Returns a Form array of this list (Invalid entries will be None) 2 | Form[] Function ToArray() native 3 | 4 | ; Adds an Array of Forms to this list 5 | Function AddForms(Form[] forms) native -------------------------------------------------------------------------------- /scripts/modified/GameData.psc: -------------------------------------------------------------------------------- 1 | Scriptname GameData Hidden 2 | 3 | ; Keywords are AND operations, must have all listed keywords 4 | ; IgnoreTemplates will exclude items that are inherited from other items with slightly altered stats 5 | ; IgnoreEnchantments will exclude any item with an enchantment 6 | ; WeaponTypes are a bitfield, will filter weapons by type 7 | ; Add together to filter by multiple types 8 | int Property WeaponTypeHandToHand = 1 AutoReadOnly 9 | int Property WeaponTypeOneHandSword = 2 AutoReadOnly 10 | int Property WeaponTypeOneHandDagger = 4 AutoReadOnly 11 | int Property WeaponTypeOneHandAxe = 8 AutoReadOnly 12 | int Property WeaponTypeOneHandMace = 16 AutoReadOnly 13 | int Property WeaponTypeTwoHandSword = 32 AutoReadOnly 14 | int Property WeaponTypeTwoHandAxe = 64 AutoReadOnly 15 | int Property WeaponTypeBow = 128 AutoReadOnly 16 | int Property WeaponTypeStaff = 256 AutoReadOnly 17 | int Property WeaponTypeCrossbow = 512 AutoReadOnly 18 | 19 | Form[] Function GetAllWeapons(string modName, Keyword[] keywords = None, bool playable = true, bool ignoreTemplates = true, bool ignoreEnchantments = true, bool onlyEnchanted = false, int weaponTypes = 0xFFFFFFFF) global native 20 | 21 | Form[] Function GetAllArmor(string modName, Keyword[] keywords = None, bool playable = true, bool ignoreTemplates = true, bool ignoreEnchantments = true, bool onlyEnchanted = false, bool ignoreSkin = true) global native 22 | 23 | Form[] Function GetAllAmmo(string modName, Keyword[] keywords = None, bool playable = true) global native 24 | 25 | Form[] Function GetAllBooks(string modName, Keyword[] keywords = None, bool regular = true, bool spell = false, bool skill = false) global native 26 | 27 | Form[] Function GetAllPotions(string modName, Keyword[] keywords = None, bool potions = true, bool food = false, bool poison = false) global native 28 | 29 | Form[] Function GetAllIngredients(string modName, Keyword[] keywords = None) global native 30 | 31 | Form[] Function GetAllScrolls(string modName, Keyword[] keywords = None) global native 32 | 33 | Form[] Function GetAllKeys(string modName, Keyword[] keywords = None) global native 34 | 35 | Form[] Function GetAllMiscItems(string modName, Keyword[] keywords = None) global native -------------------------------------------------------------------------------- /scripts/modified/HeadPart.psc: -------------------------------------------------------------------------------- 1 | Scriptname HeadPart extends Form Hidden 2 | 3 | int Property Type_Misc = 0 AutoReadOnly 4 | int Property Type_Face = 1 AutoReadOnly 5 | int Property Type_Eyes = 2 AutoReadOnly 6 | int Property Type_Hair = 3 AutoReadOnly 7 | int Property Type_FacialHair = 4 AutoReadOnly 8 | int Property Type_Scar = 5 AutoReadOnly 9 | int Property Type_Brows = 6 AutoReadOnly 10 | 11 | HeadPart Function GetHeadPart(string name) native global 12 | 13 | ; Returns the head part type 14 | int Function GetType() native 15 | 16 | int Function GetNumExtraParts() native 17 | HeadPart Function GetNthExtraPart(int n) native 18 | 19 | bool Function HasExtraPart(HeadPart p) native 20 | int Function GetIndexOfExtraPart(HeadPart p) native 21 | 22 | ; Returns a formlist of the valid races for this head part 23 | FormList Function GetValidRaces() native 24 | Function SetValidRaces(FormList vRaces) native 25 | 26 | ; Returns whether the head part is an extra part 27 | bool Function IsExtraPart() native 28 | 29 | ; Returns the EditorID of the HeadPart 30 | string Function GetPartName() native -------------------------------------------------------------------------------- /scripts/modified/Ingredient.psc: -------------------------------------------------------------------------------- 1 | ; return the number of the effects 2 | int Function GetNumEffects() native 3 | 4 | ; return the magnitude of the specified effect 5 | float Function GetNthEffectMagnitude(int index) native 6 | 7 | ; return the area of the specified effect 8 | int Function GetNthEffectArea(int index) native 9 | 10 | ; return the duration of the specified effect 11 | int Function GetNthEffectDuration(int index) native 12 | 13 | ; return the magic effect of the specified effect 14 | MagicEffect Function GetNthEffectMagicEffect(int index) native 15 | 16 | ; return the index of the costliest effect 17 | int Function GetCostliestEffectIndex() native 18 | 19 | ; sets the magnitude of the specified effect 20 | Function SetNthEffectMagnitude(int index, float value) native 21 | 22 | ; sets the area of the specified effect 23 | Function SetNthEffectArea(int index, int value) native 24 | 25 | ; sets the duration of the specified effect 26 | Function SetNthEffectDuration(int index, int value) native 27 | 28 | ; determines whether the player knows this effect 29 | bool Function GetIsNthEffectKnown(int index) native 30 | 31 | ; Returns all the magnitudes of this object in order 32 | float[] Function GetEffectMagnitudes() native 33 | 34 | ; Returns all the areas of this object in order 35 | int[] Function GetEffectAreas() native 36 | 37 | ; Returns all the durations of this object in order 38 | int[] Function GetEffectDurations() native 39 | 40 | ; Returns all the magic effects of this object in order 41 | MagicEffect[] Function GetMagicEffects() native -------------------------------------------------------------------------------- /scripts/modified/Input.psc: -------------------------------------------------------------------------------- 1 | Scriptname Input Hidden 2 | 3 | ; returns whether a key is pressed 4 | bool Function IsKeyPressed(Int dxKeycode) global native 5 | 6 | ; taps the specified key 7 | Function TapKey(Int dxKeycode) global native 8 | 9 | ; holds down the specified key until released 10 | Function HoldKey(Int dxKeycode) global native 11 | 12 | ; releases the specified key 13 | Function ReleaseKey(Int dxKeycode) global native 14 | 15 | ; how many keys are pressed 16 | int Function GetNumKeysPressed() global native 17 | 18 | ; for walking over the pressed keys 19 | int Function GetNthKeyPressed(int n) global native 20 | 21 | ; returns keycode bound to a control for given device 22 | ; 23 | ; Valid controls: 24 | ; "Forward", "Back", "Strafe Left", "Strafe Right", "Move", "Look", "Left Attack/Block", "Right Attack/Block" 25 | ; "Activate", "Ready Weapon", "Tween Menu", "Toggle POV", "Zoom Out", "Zoom In", "Jump", "Sprint", "Shout", 26 | ; "Sneak", "Run", "Toggle Always Run", "Auto-Move", "Favorites", "Hotkey1", "Hotkey2", "Hotkey3", "Hotkey4", 27 | ; "Hotkey5", "Hotkey6", "Hotkey7", "Hotkey8", "Quicksave", "Quickload", "Wait", "Journal", "Pause", "Screenshot", 28 | ; "Multi-Screenshot", "Console", "CameraPath", "Quick Inventory", "Quick Magic", "Quick Stats", "Quick Map" 29 | ; 30 | ; Valid device types: 31 | ; (default) auto detect 32 | ; 0 keyboard 33 | ; 1 mouse 34 | ; 2 gamepad 35 | int Function GetMappedKey(string control, int deviceType = 0xFF) global native 36 | 37 | ; returns name of control bound to given keycode, or "" if unbound 38 | string Function GetMappedControl(int keycode) global native -------------------------------------------------------------------------------- /scripts/modified/Keyword.psc: -------------------------------------------------------------------------------- 1 | ; return the keyword with the specified key 2 | Keyword Function GetKeyword(string key) global native 3 | 4 | ; return the string value of the keyword 5 | string Function GetString() native -------------------------------------------------------------------------------- /scripts/modified/LeveledActor.psc: -------------------------------------------------------------------------------- 1 | int Function GetNumForms() native 2 | Form Function GetNthForm(int n) native 3 | 4 | int Function GetNthLevel(int n) native 5 | Function SetNthLevel(int n, int level) native 6 | 7 | int Function GetNthCount(int n) native 8 | Function SetNthCount(int n, int count) native -------------------------------------------------------------------------------- /scripts/modified/LeveledItem.psc: -------------------------------------------------------------------------------- 1 | int function GetChanceNone() native 2 | Function SetChanceNone(int chance) native 3 | 4 | GlobalVariable Function GetChanceGlobal() native 5 | Function SetChanceGlobal(GlobalVariable glob) native 6 | 7 | int Function GetNumForms() native 8 | Form Function GetNthForm(int n) native 9 | 10 | int Function GetNthLevel(int n) native 11 | Function SetNthLevel(int n, int level) native 12 | 13 | int Function GetNthCount(int n) native 14 | Function SetNthCount(int n, int count) native -------------------------------------------------------------------------------- /scripts/modified/LeveledSpell.psc: -------------------------------------------------------------------------------- 1 | int function GetChanceNone() native 2 | Function SetChanceNone(int chance) native 3 | 4 | int Function GetNumForms() native 5 | Form Function GetNthForm(int n) native 6 | 7 | int Function GetNthLevel(int n) native 8 | Function SetNthLevel(int n, int level) native 9 | -------------------------------------------------------------------------------- /scripts/modified/Location.psc: -------------------------------------------------------------------------------- 1 | Location Function GetParent() native -------------------------------------------------------------------------------- /scripts/modified/Math.psc: -------------------------------------------------------------------------------- 1 | int Function LeftShift(int value, int shiftBy) global native 2 | int Function RightShift(int value, int shiftBy) global native 3 | int Function LogicalAnd(int arg1, int arg2) global native 4 | int Function LogicalOr(int arg1, int arg2) global native 5 | int Function LogicalXor(int arg1, int arg2) global native 6 | int Function LogicalNot(int arg1) global native 7 | float Function Log(float arg1) global native -------------------------------------------------------------------------------- /scripts/modified/ModEvent.psc: -------------------------------------------------------------------------------- 1 | Scriptname ModEvent Hidden 2 | 3 | ; ModEvent allows sending mod events with any number/type of arguments, unlike the more limited Form.SendModEvent. 4 | ; 5 | ; Example: 6 | ; 7 | ; (Sender) 8 | ; 9 | ; int handle = ModEvent.Create("MYPREFIX_myCustomEvent") 10 | ; if (handle) 11 | ; ModEvent.PushForm(handle, self) 12 | ; ModEvent.PushForm(handle, someOtherForm) 13 | ; ModEvent.PushInt(handle, 1000) 14 | ; ModEvent.PushString(handle, "It worked!") 15 | ; UIDelegate.Send(handle) 16 | ; endIf 17 | ; 18 | ; (Receiver) 19 | ; 20 | ; function OnInit() 21 | ; RegisterForModEvent("MYPREFIX_myCustomEvent", "OnMyCustomEvent") 22 | ; endFunction 23 | ; 24 | ; event OnMyCustomEvent(Form sender, Form theForm, int theInt, string theString) 25 | ; ; sender == (Sender) 26 | ; ; theForm == someOtherForm 27 | ; ; theInt == 1000 28 | ; ; theString == "It worked!" 29 | ; endEvent 30 | 31 | ; Creates a new ModEvent and returns the handle. 32 | int Function Create(string eventName) global native 33 | 34 | ; Sends the ModEvent and releases it. 35 | ; Returns true, if it was sent successfully, false if an error happened. 36 | bool Function Send(int handle) global native 37 | 38 | ; Releases the ModEvent without sending it. 39 | Function Release(int handle) global native 40 | 41 | ; Push single parameter. 42 | ; 43 | ; For arguments 1 .. N, the signature of the receiving event callback has to look like this: 44 | ; 45 | ; event MyCallback(TYPE_1 PARAM_1, ... , TYPE_N PARAM_N) 46 | ; 47 | Function PushBool(int handle, bool value) global native 48 | Function PushInt(int handle, int value) global native 49 | Function PushFloat(int handle, float value) global native 50 | Function PushString(int handle, string value) global native 51 | Function PushForm(int handle, Form value) global native 52 | -------------------------------------------------------------------------------- /scripts/modified/Outfit.psc: -------------------------------------------------------------------------------- 1 | 2 | int Function GetNumParts() native 3 | Form Function GetNthPart(int n) native -------------------------------------------------------------------------------- /scripts/modified/Perk.psc: -------------------------------------------------------------------------------- 1 | Perk Function GetNextPerk() native 2 | 3 | int Function GetNumEntries() native 4 | 5 | int Function GetNthEntryRank(int n) native 6 | bool Function SetNthEntryRank(int n, int rank) native 7 | 8 | int Function GetNthEntryPriority(int n) native 9 | bool Function SetNthEntryPriority(int n, int priority) native 10 | 11 | Quest Function GetNthEntryQuest(int n) native 12 | bool Function SetNthEntryQuest(int n, Quest newQuest) native 13 | 14 | int Function GetNthEntryStage(int n) native 15 | bool Function SetNthEntryStage(int n, int stage) native 16 | 17 | Spell Function GetNthEntrySpell(int n) native 18 | bool Function SetNthEntrySpell(int n, Spell newSpell) native 19 | 20 | LeveledItem Function GetNthEntryLeveledList(int n) native 21 | bool Function SetNthEntryLeveledList(int n, LeveledItem lList) native 22 | 23 | string Function GetNthEntryText(int n) native 24 | bool Function SetNthEntryText(int n, string newText) native 25 | 26 | float Function GetNthEntryValue(int n, int i) native 27 | bool Function SetNthEntryValue(int n, int i, float value) native -------------------------------------------------------------------------------- /scripts/modified/Potion.psc: -------------------------------------------------------------------------------- 1 | ; Is this potion classified as Food? 2 | bool Function IsFood() native 3 | 4 | ; Is this potion classified as Poison? 5 | bool Function IsPoison() native 6 | 7 | ; return the number of the effects 8 | int Function GetNumEffects() native 9 | 10 | ; return the magnitude of the specified effect 11 | float Function GetNthEffectMagnitude(int index) native 12 | 13 | ; return the area of the specified effect 14 | int Function GetNthEffectArea(int index) native 15 | 16 | ; return the duration of the specified effect 17 | int Function GetNthEffectDuration(int index) native 18 | 19 | ; return the magic effect of the specified effect 20 | MagicEffect Function GetNthEffectMagicEffect(int index) native 21 | 22 | ; return the index of the costliest effect 23 | int Function GetCostliestEffectIndex() native 24 | 25 | ; sets the magnitude of the specified effect 26 | Function SetNthEffectMagnitude(int index, float value) native 27 | 28 | ; sets the area of the specified effect 29 | Function SetNthEffectArea(int index, int value) native 30 | 31 | ; sets the duration of the specified effect 32 | Function SetNthEffectDuration(int index, int value) native 33 | 34 | ; gets the use sound of this potion 35 | SoundDescriptor Function GetUseSound() native 36 | 37 | ; Returns all the magnitudes of this object in order 38 | float[] Function GetEffectMagnitudes() native 39 | 40 | ; Returns all the areas of this object in order 41 | int[] Function GetEffectAreas() native 42 | 43 | ; Returns all the durations of this object in order 44 | int[] Function GetEffectDurations() native 45 | 46 | ; Returns all the magic effects of this object in order 47 | MagicEffect[] Function GetMagicEffects() native -------------------------------------------------------------------------------- /scripts/modified/Quest.psc: -------------------------------------------------------------------------------- 1 | 2 | ; returns the quest with the specified editor id 3 | Quest Function GetQuest(string editorId) global native 4 | 5 | ; returns the editor ID of the quest 6 | string Function GetID() native 7 | 8 | ; returns the priority of the quest 9 | int Function GetPriority() native 10 | 11 | ; returns the number of aliases associated with the quest 12 | int Function GetNumAliases() native 13 | 14 | ; returns the specified alias associated with the queest 15 | Alias Function GetNthAlias(int index) native 16 | 17 | ; returns the alias associated with the quest by name 18 | Alias Function GetAliasByName(string name) native 19 | 20 | ; returns the alias by AlisID 21 | Alias Function GetAliasById(int aliasId) native 22 | 23 | ; Returns all the aliases of this quest 24 | Alias[] Function GetAliases() native -------------------------------------------------------------------------------- /scripts/modified/SKSE.psc: -------------------------------------------------------------------------------- 1 | Scriptname SKSE Hidden 2 | ; General SKSE-specific information 3 | 4 | ; get the major version of SKSE 5 | int Function GetVersion() global native 6 | ; get the minor version of SKSE 7 | int Function GetVersionMinor() global native 8 | ; get the beta version of SKSE 9 | int Function GetVersionBeta() global native 10 | ; get the release index of SKSE. This number is incremented every time 11 | ; SKSE is released outside of the development team 12 | int Function GetVersionRelease() global native 13 | ; get the release index of this script file. 14 | ; Can be used to detect a script/runtime version mismatch 15 | int Function GetScriptVersionRelease() global 16 | return 72 17 | endFunction 18 | 19 | ; get a plugins version number, -1 if the plugin is not loaded 20 | int Function GetPluginVersion(string name) global native -------------------------------------------------------------------------------- /scripts/modified/Scroll.psc: -------------------------------------------------------------------------------- 1 | ; return the casting time 2 | float Function GetCastTime() native 3 | 4 | ; return the perk associated with the spell 5 | Perk Function GetPerk() native 6 | 7 | ; return the number of the effects 8 | int Function GetNumEffects() native 9 | 10 | ; return the magnitude of the specified effect 11 | float Function GetNthEffectMagnitude(int index) native 12 | 13 | ; return the area of the specified effect 14 | int Function GetNthEffectArea(int index) native 15 | 16 | ; return the duration of the specified effect 17 | int Function GetNthEffectDuration(int index) native 18 | 19 | ; return the magic effect of the specified effect 20 | MagicEffect Function GetNthEffectMagicEffect(int index) native 21 | 22 | ; return the index of the costliest effect 23 | int Function GetCostliestEffectIndex() native 24 | 25 | ; sets the magnitude of the specified effect 26 | Function SetNthEffectMagnitude(int index, float value) native 27 | 28 | ; sets the area of the specified effect 29 | Function SetNthEffectArea(int index, int value) native 30 | 31 | ; sets the duration of the specified effect 32 | Function SetNthEffectDuration(int index, int value) native 33 | 34 | ; Returns the particular equipslot type 35 | EquipSlot Function GetEquipType() native 36 | Function SetEquipType(EquipSlot type) native 37 | 38 | ; Returns all the magnitudes of this object in order 39 | float[] Function GetEffectMagnitudes() native 40 | 41 | ; Returns all the areas of this object in order 42 | int[] Function GetEffectAreas() native 43 | 44 | ; Returns all the durations of this object in order 45 | int[] Function GetEffectDurations() native 46 | 47 | ; Returns all the magic effects of this object in order 48 | MagicEffect[] Function GetMagicEffects() native -------------------------------------------------------------------------------- /scripts/modified/Shout.psc: -------------------------------------------------------------------------------- 1 | WordOfPower Function GetNthWordOfPower(int n) native 2 | Spell Function GetNthSpell(int n) native 3 | float Function GetNthRecoveryTime(int n) native 4 | 5 | Function SetNthWordOfPower(int n, WordOfPower aWoop) native 6 | Function SetNthSpell(int n, Spell aSpell) native 7 | Function SetNthRecoveryTime(int n, float time) native -------------------------------------------------------------------------------- /scripts/modified/SoulGem.psc: -------------------------------------------------------------------------------- 1 | 2 | int Function GetSoulSize() native 3 | int Function GetGemSize() native -------------------------------------------------------------------------------- /scripts/modified/Sound.psc: -------------------------------------------------------------------------------- 1 | SoundDescriptor Function GetDescriptor() native -------------------------------------------------------------------------------- /scripts/modified/SoundDescriptor.psc: -------------------------------------------------------------------------------- 1 | Scriptname SoundDescriptor extends Form Hidden 2 | 3 | float Function GetDecibelAttenuation() native 4 | Function SetDecibelAttenuation(float dbAttenuation) native 5 | 6 | int Function GetDecibelVariance() native 7 | Function SetDecibelVariance(int dbVariance) native 8 | 9 | int Function GetFrequencyVariance() native 10 | Function SetFrequencyVariance(int frequencyVariance) native 11 | 12 | int Function GetFrequencyShift() native 13 | Function SetFrequencyShift(int frequencyShift) native -------------------------------------------------------------------------------- /scripts/modified/Spell.psc: -------------------------------------------------------------------------------- 1 | ; return the casting time 2 | float Function GetCastTime() native 3 | 4 | ; return the perk associated with the spell 5 | Perk Function GetPerk() native 6 | 7 | ; return the number of the effects 8 | int Function GetNumEffects() native 9 | 10 | ; return the magnitude of the specified effect 11 | float Function GetNthEffectMagnitude(int index) native 12 | 13 | ; return the area of the specified effect 14 | int Function GetNthEffectArea(int index) native 15 | 16 | ; return the duration of the specified effect 17 | int Function GetNthEffectDuration(int index) native 18 | 19 | ; return the magic effect of the specified effect 20 | MagicEffect Function GetNthEffectMagicEffect(int index) native 21 | 22 | ; return the index of the costliest effect 23 | int Function GetCostliestEffectIndex() native 24 | 25 | ; return the base magicka cost of the spell 26 | int Function GetMagickaCost() native 27 | 28 | ; return the effective magicka cost of the spell for given caster 29 | int Function GetEffectiveMagickaCost(Actor caster) native 30 | 31 | ; sets the magnitude of the specified effect 32 | Function SetNthEffectMagnitude(int index, float value) native 33 | 34 | ; sets the area of the specified effect 35 | Function SetNthEffectArea(int index, int value) native 36 | 37 | ; sets the duration of the specified effect 38 | Function SetNthEffectDuration(int index, int value) native 39 | 40 | ; Returns the particular equipslot type 41 | EquipSlot Function GetEquipType() native 42 | Function SetEquipType(EquipSlot type) native 43 | 44 | ; Returns all the magnitudes of this object in order 45 | float[] Function GetEffectMagnitudes() native 46 | 47 | ; Returns all the areas of this object in order 48 | int[] Function GetEffectAreas() native 49 | 50 | ; Returns all the durations of this object in order 51 | int[] Function GetEffectDurations() native 52 | 53 | ; Returns all the magic effects of this object in order 54 | MagicEffect[] Function GetMagicEffects() native -------------------------------------------------------------------------------- /scripts/modified/TextureSet.psc: -------------------------------------------------------------------------------- 1 | 2 | ; Returns the number of texture paths 3 | int Function GetNumTexturePaths() native 4 | 5 | ; Returns the path of the texture 6 | string Function GetNthTexturePath(int n) native 7 | 8 | ; Sets the path of the texture 9 | Function SetNthTexturePath(int n, string texturePath) native -------------------------------------------------------------------------------- /scripts/modified/TreeObject.psc: -------------------------------------------------------------------------------- 1 | Scriptname TreeObject extends Form Hidden 2 | 3 | SoundDescriptor Function GetHarvestSound() native 4 | Function SetHarvestSound(SoundDescriptor akSoundDescriptor) native 5 | 6 | Form Function GetIngredient() native 7 | Function SetIngredient(Form akIngredient) native -------------------------------------------------------------------------------- /scripts/modified/UICallback.psc: -------------------------------------------------------------------------------- 1 | Scriptname UICallback Hidden 2 | 3 | ; UICallback allows passing arguments of different types to UI functions, unlike UI.Invoke* 4 | ; 5 | ; Example: 6 | ; int handle = UICallback.Create("InventoryMenu", "_global.MyClass.initData") 7 | ; if (handle) 8 | ; UICallback.PushBool(handle, true) 9 | ; UICallback.PushInt(handle, 1000) 10 | ; UICallback.PushString(handle, "Hello") 11 | ; UICallback.PushFloat(handle, 1.234) 12 | ; UIDelegate.Send(handle) 13 | ; endIf 14 | ; 15 | ; Any UICallback allocated by Create must be released later. 16 | ; That happens automatically when passing it to send. 17 | ; Otherwise the handle must be manually released by passing it to Release. 18 | ; 19 | ; Internally, UICallback objects only persist for the duration of the current 20 | ; game session. They are also cleared after each reload. 21 | ; 22 | ; This means that in very rare cases, the execution sequence of several operations 23 | ; on one UICallback might get interrupted, the handle turns invalid and the final Send 24 | ; will fail. If its necessary to detect this, check the return value of Send. 25 | 26 | ; Creates a new UICallback and returns the handle. 27 | int Function Create(string menuName, string target) global native 28 | 29 | ; Invokes the UICallback and releases it. 30 | ; Returns true, if it was executed, false if an error happened. 31 | bool Function Send(int handle) global native 32 | 33 | ; Releases the UICallback without sending it. 34 | Function Release(int handle) global native 35 | 36 | ; Push single parameter. Maximum number of parameters per callback is 128. 37 | Function PushBool(int handle, bool value) global native 38 | Function PushInt(int handle, int value) global native 39 | Function PushFloat(int handle, float value) global native 40 | Function PushString(int handle, string value) global native 41 | 42 | ; Push parameters from array. Maximum number of parameters per callback is 128. 43 | Function PushBoolA(int handle, bool[] args) global native 44 | Function PushIntA(int handle, int[] args) global native 45 | Function PushFloatA(int handle, float[] args) global native 46 | Function PushStringA(int handle, string[] args) global native -------------------------------------------------------------------------------- /scripts/modified/Utility.psc: -------------------------------------------------------------------------------- 1 | 2 | float Function GetINIFloat(string ini) global native 3 | int Function GetINIInt(string ini) global native 4 | bool Function GetINIBool(string ini) global native 5 | string Function GetINIString(string ini) global native 6 | 7 | 8 | ; Size is treated as unsigned, negative numbers will result 9 | ; extremely large positive numbers, USE WITH CARE 10 | float[] Function CreateFloatArray(int size, float fill = 0.0) global native 11 | int[] Function CreateIntArray(int size, int fill = 0) global native 12 | bool[] Function CreateBoolArray(int size, bool fill = false) global native 13 | string[] Function CreateStringArray(int size, string fill = "") global native 14 | Form[] Function CreateFormArray(int size, Form fill = None) global native 15 | Alias[] Function CreateAliasArray(int size, Alias fill = None) global native 16 | 17 | float[] Function ResizeFloatArray(float[] source, int size, float fill = 0.0) global native 18 | int[] Function ResizeIntArray(int[] source, int size, int fill = 0) global native 19 | bool[] Function ResizeBoolArray(bool[] source, int size, bool fill = false) global native 20 | string[] Function ResizeStringArray(string[] source, int size, string fill = "") global native 21 | Form[] Function ResizeFormArray(Form[] source, int size, Form fill = None) global native 22 | Alias[] Function ResizeAliasArray(Alias[] source, int size, Alias fill = None) global native -------------------------------------------------------------------------------- /scripts/modified/Weather.psc: -------------------------------------------------------------------------------- 1 | 2 | ; Returns the sun glare percentage 3 | float Function GetSunGlare() native 4 | 5 | ; Returns the sun damage percentage 6 | float Function GetSunDamage() native 7 | 8 | ; Returns the wind direction in degrees (0-360) 9 | float Function GetWindDirection() native 10 | 11 | ; Returns the wind direction range in degrees (0-180) 12 | float Function GetWindDirectionRange() native 13 | 14 | ; 0 - Near 15 | ; 1 - Far 16 | ; 2 - Power 17 | ; 3 - Max 18 | float Function GetFogDistance(bool day, int type) native 19 | -------------------------------------------------------------------------------- /scripts/vanilla/Activator.psc: -------------------------------------------------------------------------------- 1 | Scriptname Activator extends Form Hidden 2 | -------------------------------------------------------------------------------- /scripts/vanilla/ActorBase.psc: -------------------------------------------------------------------------------- 1 | Scriptname ActorBase extends Form Hidden 2 | 3 | ; Returns this actor's class 4 | Class Function GetClass() native 5 | 6 | ; Gets the number of actors of this type that have been killed 7 | int Function GetDeadCount() native 8 | 9 | ; Returns this actor's gift filter formlist 10 | FormList Function GetGiftFilter() native 11 | 12 | ; Returns this actor's race 13 | Race Function GetRace() native 14 | 15 | ; Returns this actor's sex. Values for sex are: 16 | ; -1 - None 17 | ; 0 - Male 18 | ; 1 - Female 19 | int Function GetSex() native 20 | 21 | ; Is this actor essential? 22 | bool Function IsEssential() native 23 | 24 | ; Is this actor invulnerable? 25 | bool Function IsInvulnerable() native 26 | 27 | ; Is this actor protected (can only be killed by player)? 28 | bool Function IsProtected() native 29 | 30 | ; Is this actor base unique? 31 | bool Function IsUnique() native 32 | 33 | ; Sets this actor as essential or not - if set as essential, will UNSET protected 34 | Function SetEssential(bool abEssential = true) native 35 | 36 | ; Sets this actor as invulnerable or not 37 | Function SetInvulnerable(bool abInvulnerable = true) native 38 | 39 | ; Sets this actor as protected or not - if set as protected, will UNSET essential 40 | Function SetProtected(bool abProtected = true) native 41 | 42 | ; Sets the actors outfit 43 | Function SetOutfit( Outfit akOutfit, bool abSleepOutfit = false ) native 44 | -------------------------------------------------------------------------------- /scripts/vanilla/Ammo.psc: -------------------------------------------------------------------------------- 1 | Scriptname Ammo extends Form Hidden -------------------------------------------------------------------------------- /scripts/vanilla/Apparatus.psc: -------------------------------------------------------------------------------- 1 | Scriptname Apparatus extends MiscObject Hidden 2 | -------------------------------------------------------------------------------- /scripts/vanilla/Armor.psc: -------------------------------------------------------------------------------- 1 | Scriptname Armor extends Form Hidden 2 | 3 | ; Returns the "warmth rating" for this armor 4 | float Function GetWarmthRating() native -------------------------------------------------------------------------------- /scripts/vanilla/AssociationType.psc: -------------------------------------------------------------------------------- 1 | Scriptname AssociationType extends Form Hidden -------------------------------------------------------------------------------- /scripts/vanilla/Book.psc: -------------------------------------------------------------------------------- 1 | Scriptname Book Extends Form Hidden -------------------------------------------------------------------------------- /scripts/vanilla/Cell.psc: -------------------------------------------------------------------------------- 1 | Scriptname Cell extends Form Hidden 2 | 3 | ; Gets the actor that owns this cell (or none if not owned by an actor) 4 | ActorBase Function GetActorOwner() native 5 | 6 | ; Gets the faction that owns this cell (or none if not owned by a faction) 7 | Faction Function GetFactionOwner() native 8 | 9 | ; Is this cell "attached"? (In the loaded area) 10 | bool Function IsAttached() native 11 | 12 | ; Is this cell an interior cell? 13 | bool Function IsInterior() native 14 | 15 | ; Flags the cell for reset on next load 16 | Function Reset() native 17 | 18 | ; Sets this cell's owner as the specified actor 19 | Function SetActorOwner(ActorBase akActor) native 20 | 21 | ; Sets this cell's owner as the specified faction 22 | Function SetFactionOwner(Faction akFaction) native 23 | 24 | ; Sets the fog color for this cell (interior, non-sky-lit cells only) 25 | Function SetFogColor(int aiNearRed, int aiNearGreen, int aiNearBlue, \ 26 | int aiFarRed, int aiFarGreen, int aiFarBlue) native 27 | 28 | ; Adjusts this cell's fog near and far planes (interior, non-sky-lit cells only) 29 | Function SetFogPlanes(float afNear, float afFar) native 30 | 31 | ; Sets the fog power for this cell (interior, non-sky-lit cells only) 32 | Function SetFogPower(float afPower) native 33 | 34 | ; Sets this cell as public or private 35 | Function SetPublic(bool abPublic = true) native -------------------------------------------------------------------------------- /scripts/vanilla/Class.psc: -------------------------------------------------------------------------------- 1 | Scriptname Class extends Form Hidden -------------------------------------------------------------------------------- /scripts/vanilla/ConstructibleObject.psc: -------------------------------------------------------------------------------- 1 | Scriptname ConstructibleObject extends MiscObject Hidden -------------------------------------------------------------------------------- /scripts/vanilla/EffectShader.psc: -------------------------------------------------------------------------------- 1 | Scriptname EffectShader extends Form Hidden 2 | 3 | ; Starts playing this effect shader on the specified object for the specified length of time in seconds. Negative values indiciate "infinite" 4 | Function Play(ObjectReference akObject, float afDuration = -1.0) native 5 | 6 | ; Stops playing this effect shader on the specified object 7 | Function Stop(ObjectReference akObject) native -------------------------------------------------------------------------------- /scripts/vanilla/Enchantment.psc: -------------------------------------------------------------------------------- 1 | Scriptname Enchantment extends Form Hidden 2 | 3 | ; Is this enchantment classified as hostile? 4 | bool Function IsHostile() native -------------------------------------------------------------------------------- /scripts/vanilla/EncounterZone.psc: -------------------------------------------------------------------------------- 1 | Scriptname EncounterZone extends Form Hidden -------------------------------------------------------------------------------- /scripts/vanilla/Explosion.psc: -------------------------------------------------------------------------------- 1 | Scriptname Explosion extends Form Hidden 2 | -------------------------------------------------------------------------------- /scripts/vanilla/Flora.psc: -------------------------------------------------------------------------------- 1 | Scriptname Flora extends Activator Hidden 2 | -------------------------------------------------------------------------------- /scripts/vanilla/FormList.psc: -------------------------------------------------------------------------------- 1 | Scriptname FormList extends Form 2 | 3 | ; Adds the given form to this form list 4 | Function AddForm(Form apForm) native 5 | 6 | ; Finds the specified form in the form list and returns its index. 7 | ; If not found, returns a negative number 8 | int Function Find(Form apForm) native 9 | 10 | ; Returns the number of forms in the list 11 | int Function GetSize() native 12 | 13 | ; Returns the form at index 'aiIndex' in the list 14 | Form Function GetAt(int aiIndex) native 15 | 16 | ; Queries the form list to see if it contains the passed in form 17 | bool Function HasForm(Form akForm) native 18 | 19 | ; Removes the given added form from this form list 20 | Function RemoveAddedForm(Form apForm) native 21 | 22 | ; Removes all script added forms from this form list 23 | Function Revert() native 24 | -------------------------------------------------------------------------------- /scripts/vanilla/GlobalVariable.psc: -------------------------------------------------------------------------------- 1 | Scriptname GlobalVariable extends Form Hidden 2 | 3 | ; Obtains the global's current value 4 | float Function GetValue() native 5 | 6 | ; Sets the global's current value 7 | Function SetValue(float afNewValue) native 8 | 9 | ; convenience functions for ints 10 | int Function GetValueInt() 11 | return GetValue() as int 12 | endFunction 13 | 14 | ; Sets the global's current value 15 | Function SetValueInt(int aiNewValue) 16 | SetValue(aiNewValue as float) 17 | endFunction 18 | 19 | ; Easy access to the global's value 20 | float Property Value Hidden 21 | float Function get() 22 | return GetValue() 23 | EndFunction 24 | 25 | Function set(float afValue) 26 | SetValue(afValue) 27 | EndFunction 28 | EndProperty 29 | 30 | ; the threadsafe way to modify a global variable 31 | float Function Mod(float afHowMuch) 32 | Value += afHowMuch 33 | Return Value 34 | EndFunction 35 | -------------------------------------------------------------------------------- /scripts/vanilla/Idle.psc: -------------------------------------------------------------------------------- 1 | Scriptname Idle extends Form Hidden 2 | -------------------------------------------------------------------------------- /scripts/vanilla/ImageSpaceModifier.psc: -------------------------------------------------------------------------------- 1 | Scriptname ImageSpaceModifier extends Form Hidden 2 | 3 | ; Applies this modifier with the specified strength (which is not clamped) 4 | Function Apply(float afStrength = 1.0) native 5 | 6 | ; Adds this modifier to the cross-fade chain, removing the previous modifier, and fading over the specified duration (in seconds) 7 | Function ApplyCrossFade(float afFadeDuration = 1.0) native 8 | 9 | ; Disables this modifier and enables the new one, "popping" between the two. Will not interrupt any running cross-fade (if the modifiers aren't the ones fading) 10 | Function PopTo(ImageSpaceModifier akNewModifier, float afStrength = 1.0) native 11 | 12 | ; Removes this modifier 13 | Function Remove() native 14 | 15 | ; Removes whatever modifier is on the cross-fade chain, fading it out 16 | Function RemoveCrossFade(float afFadeDuration = 1.0) native global -------------------------------------------------------------------------------- /scripts/vanilla/ImpactDataSet.psc: -------------------------------------------------------------------------------- 1 | Scriptname ImpactDataSet extends Form Hidden 2 | -------------------------------------------------------------------------------- /scripts/vanilla/Ingredient.psc: -------------------------------------------------------------------------------- 1 | Scriptname Ingredient extends Form 2 | 3 | ; Is this ingredient classified as hostile? 4 | bool Function IsHostile() native 5 | 6 | ; Flags the effect with the given 0 based index as known by the player 7 | Function LearnEffect(int aiIndex) native 8 | 9 | ; Flags the next unknown effect as known by the player, returning index of effect learned 10 | int Function LearnNextEffect() native 11 | 12 | ; Flags the all effects as known by the player 13 | Function LearnAllEffects() native -------------------------------------------------------------------------------- /scripts/vanilla/Key.psc: -------------------------------------------------------------------------------- 1 | Scriptname Key extends MiscObject Hidden -------------------------------------------------------------------------------- /scripts/vanilla/Keyword.psc: -------------------------------------------------------------------------------- 1 | Scriptname Keyword Extends Form Hidden 2 | 3 | ; Sends this keyword as a story event to the story manager 4 | Function SendStoryEvent(Location akLoc = None, ObjectReference akRef1 = None, ObjectReference akRef2 = None, int aiValue1 = 0, \ 5 | int aiValue2 = 0) native 6 | 7 | ; Sends this keyword as a story event to the story manager and waits for it to be processed. Returns true if a quest was started. 8 | bool Function SendStoryEventAndWait(Location akLoc = None, ObjectReference akRef1 = None, ObjectReference akRef2 = None, \ 9 | int aiValue1 = 0, int aiValue2 = 0) native -------------------------------------------------------------------------------- /scripts/vanilla/LeveledActor.psc: -------------------------------------------------------------------------------- 1 | Scriptname LeveledActor extends Form Hidden 2 | 3 | ; Adds the given count of the given form to the under the given level in this leveled list 4 | Function AddForm(Form apForm, int aiLevel) native 5 | 6 | ; Removes all script added forms from this leveled list 7 | Function Revert() native -------------------------------------------------------------------------------- /scripts/vanilla/LeveledItem.psc: -------------------------------------------------------------------------------- 1 | Scriptname LeveledItem extends Form Hidden 2 | 3 | ; Adds the given count of the given form to the under the given level in this leveled list 4 | Function AddForm(Form apForm, int aiLevel, int aiCount) native 5 | 6 | ; Removes all script added forms from this leveled list 7 | Function Revert() native -------------------------------------------------------------------------------- /scripts/vanilla/LeveledSpell.psc: -------------------------------------------------------------------------------- 1 | Scriptname LeveledSpell extends Form Hidden 2 | 3 | ; Adds the given count of the given form to the under the given level in this leveled list 4 | Function AddForm(Form apForm, int aiLevel) native 5 | 6 | ; Removes all script added forms from this leveled list 7 | Function Revert() native -------------------------------------------------------------------------------- /scripts/vanilla/Light.psc: -------------------------------------------------------------------------------- 1 | Scriptname Light extends Form Hidden 2 | 3 | ; Returns the "warmth rating" for this light 4 | float Function GetWarmthRating() native -------------------------------------------------------------------------------- /scripts/vanilla/Location.psc: -------------------------------------------------------------------------------- 1 | Scriptname Location extends Form Hidden 2 | 3 | ; Returns the float value attached to the specified keyword attached to this location 4 | float Function GetKeywordData(Keyword akKeyword) native 5 | 6 | ; Returns the number of alive references matching the specified reference type 7 | int Function GetRefTypeAliveCount(LocationRefType akRefType) native 8 | 9 | ; Returns the number of dead references matching the specified reference type 10 | int Function GetRefTypeDeadCount(LocationRefType akRefType) native 11 | 12 | ; Returns if these two locations have a common parent - filtered with the keyword, if provided 13 | bool Function HasCommonParent(Location akOther, Keyword akFilter = None) native 14 | 15 | ; Returns if this location has the specified reference type 16 | bool Function HasRefType(LocationRefType akRefType) native 17 | 18 | ; Returns whether this location is flagged as "cleared" or not 19 | bool Function IsCleared() native 20 | 21 | ; Returns whether the other location is a child of this one 22 | bool Function IsChild(Location akOther) native 23 | 24 | ; Is this location loaded in game? 25 | bool Function IsLoaded() native 26 | 27 | bool Function IsSameLocation(Location akOtherLocation, Keyword akKeyword = None) 28 | {Returns true if the calling location is the same as the supplied location - if an optional keyword is supplied, it also returns true if the locations share a parent with that keyword, or if either location is a child of the other and the other has that keyword.} 29 | ;jduvall 30 | bool bmatching = self == akOtherLocation 31 | if !bmatching && akKeyword 32 | bmatching = HasCommonParent(akOtherLocation, akKeyword) 33 | 34 | if !bmatching && akOtherLocation.HasKeyword(akKeyword) 35 | bmatching = akOtherLocation.IsChild(self) 36 | elseif !bmatching && self.HasKeyword(akKeyword) 37 | bmatching = self.IsChild(akOtherLocation) 38 | endif 39 | 40 | endif 41 | return bmatching 42 | endFunction 43 | 44 | 45 | ; Sets the specified keyword's data on the location 46 | Function SetKeywordData(Keyword akKeyword, float afData) native 47 | 48 | ; Sets this location as cleared or not 49 | Function SetCleared(bool abCleared = true) native -------------------------------------------------------------------------------- /scripts/vanilla/LocationRefType.psc: -------------------------------------------------------------------------------- 1 | Scriptname LocationRefType extends Keyword Hidden -------------------------------------------------------------------------------- /scripts/vanilla/MagicEffect.psc: -------------------------------------------------------------------------------- 1 | Scriptname MagicEffect extends Form Hidden 2 | ; Get the Associated Skill for this MagicEffect 3 | string Function GetAssociatedSkill() native -------------------------------------------------------------------------------- /scripts/vanilla/Math.psc: -------------------------------------------------------------------------------- 1 | Scriptname Math Hidden 2 | 3 | ; Calculates the absolute value of the passed in value - N for N, and N for (-N) 4 | float Function abs(float afValue) global native 5 | 6 | ; Calculates the arccosine of the passed in value, returning degrees 7 | float Function acos(float afValue) global native 8 | 9 | ; Calculates the arcsine of the passed in value, returning degrees 10 | float Function asin(float afValue) global native 11 | 12 | ; Calculates the arctangent of the passed in value, returning degrees 13 | float Function atan(float afValue) global native 14 | 15 | ; Calculates the ceiling of the passed in value - the smallest integer greater than or equal to the value 16 | int Function Ceiling(float afValue) global native 17 | 18 | ; Calculates the cosine of the passed in value (in degrees) 19 | float Function cos(float afValue) global native 20 | 21 | ; Converts degrees to radians 22 | float Function DegreesToRadians(float afDegrees) global native 23 | 24 | ; Calculates the floor of the passed in value - the largest integer less than or equal to the value 25 | int Function Floor(float afValue) global native 26 | 27 | ; Calculates x raised to the y power 28 | float Function pow(float x, float y) global native 29 | 30 | ; Converts radians to degrees 31 | float Function RadiansToDegrees(float afRadians) global native 32 | 33 | ; Calculates the sine of the passed in value (in degrees) 34 | float Function sin(float afValue) global native 35 | 36 | ; Calculate the square root of the passed in value 37 | float Function sqrt(float afValue) global native 38 | 39 | ; Calculates the tangent of the passed in value (in degrees) 40 | float Function tan(float afValue) global native -------------------------------------------------------------------------------- /scripts/vanilla/MiscObject.psc: -------------------------------------------------------------------------------- 1 | Scriptname MiscObject extends Form Hidden -------------------------------------------------------------------------------- /scripts/vanilla/Outfit.psc: -------------------------------------------------------------------------------- 1 | Scriptname Outfit extends Form Hidden 2 | -------------------------------------------------------------------------------- /scripts/vanilla/Package.psc: -------------------------------------------------------------------------------- 1 | Scriptname Package extends Form Hidden 2 | 3 | ; Returns the quest that owns this package 4 | Quest Function GetOwningQuest() native 5 | 6 | ; Obtains the package that is the parent template of this one (if any) 7 | Package Function GetTemplate() native -------------------------------------------------------------------------------- /scripts/vanilla/Perk.psc: -------------------------------------------------------------------------------- 1 | Scriptname Perk extends Form Hidden 2 | -------------------------------------------------------------------------------- /scripts/vanilla/Potion.psc: -------------------------------------------------------------------------------- 1 | Scriptname Potion extends Form 2 | 3 | ; Is this postion classified as hostile? 4 | bool Function IsHostile() native -------------------------------------------------------------------------------- /scripts/vanilla/Projectile.psc: -------------------------------------------------------------------------------- 1 | Scriptname Projectile extends Form Hidden 2 | -------------------------------------------------------------------------------- /scripts/vanilla/Race.psc: -------------------------------------------------------------------------------- 1 | Scriptname Race extends Form Hidden -------------------------------------------------------------------------------- /scripts/vanilla/Scene.psc: -------------------------------------------------------------------------------- 1 | Scriptname Scene extends Form Hidden 2 | 3 | ; Forces a scene to start and kills the current scenes running on any ref in that scene 4 | Function ForceStart() native 5 | 6 | ; Starts this scene 7 | Function Start() native 8 | 9 | ; Stops the scene 10 | Function Stop() native 11 | 12 | ; Is this scene currently playing? 13 | bool Function IsPlaying() native 14 | 15 | ; Returns the quest that owns this scene 16 | Quest Function GetOwningQuest() native 17 | 18 | ; Returns whether the specified action is complete or not 19 | bool Function IsActionComplete(int aiActionID) native -------------------------------------------------------------------------------- /scripts/vanilla/Scroll.psc: -------------------------------------------------------------------------------- 1 | Scriptname Scroll extends Form Hidden 2 | 3 | ; Cast this scroll from an ObjectReference, optionally toward another. 4 | Function Cast(ObjectReference akSource, ObjectReference akTarget=NONE) native -------------------------------------------------------------------------------- /scripts/vanilla/Shout.psc: -------------------------------------------------------------------------------- 1 | Scriptname Shout extends Form Hidden -------------------------------------------------------------------------------- /scripts/vanilla/SoulGem.psc: -------------------------------------------------------------------------------- 1 | Scriptname SoulGem extends MiscObject Hidden -------------------------------------------------------------------------------- /scripts/vanilla/Sound.psc: -------------------------------------------------------------------------------- 1 | Scriptname Sound extends Form Hidden 2 | import ObjectReference 3 | 4 | ; Play this sound base object from the specified source 5 | int Function Play(ObjectReference akSource) native 6 | 7 | ; Play this sound from the specified source, and wait for it to finish 8 | bool Function PlayAndWait(ObjectReference akSource) native 9 | 10 | ; Stops a given playback instance of a sound 11 | Function StopInstance(int aiPlaybackInstance) native global 12 | 13 | ; Set the volume of a given playback instance of a sound. Clamped between 0 and 1. 14 | Function SetInstanceVolume(int aiPlaybackInstance, float afVolume) native global 15 | 16 | -------------------------------------------------------------------------------- /scripts/vanilla/Spell.psc: -------------------------------------------------------------------------------- 1 | Scriptname Spell extends Form Hidden 2 | 3 | ; Cast this spell from an ObjectReference, optionally toward another. 4 | Function Cast(ObjectReference akSource, ObjectReference akTarget=NONE) native 5 | 6 | ; Cast this spell from an ObjectReference, optionally toward another, and blame it on a particular actor. 7 | Function RemoteCast(ObjectReference akSource, Actor akBlameActor, ObjectReference akTarget=NONE) native 8 | 9 | ; Is this spell classified as hostile? 10 | bool Function IsHostile() native 11 | 12 | ; Preload the art for this spell. Useful for spells you equip & unequip on the player. 13 | ; Warning: Misuse of this function can lead to erroneous behavior as well as excessive 14 | ; memory consumption. It's best to avoid using this. This function will likely be 15 | ; deprecated in the future. 16 | Function Preload() native 17 | 18 | ; Unload the art for this spell. Call this only if you've previously called Preload. 19 | ; Warning: Misuse of this function can lead to erroneous behavior including spell art 20 | ; being unloaded while in use, and excessive memory consumption. It's best to avoid using this. 21 | ; This function will likely be deprecated in the future. 22 | Function Unload() native 23 | -------------------------------------------------------------------------------- /scripts/vanilla/Static.psc: -------------------------------------------------------------------------------- 1 | Scriptname Static Extends Form 2 | -------------------------------------------------------------------------------- /scripts/vanilla/TESV_Papyrus_Flags.flg: -------------------------------------------------------------------------------- 1 | /* 2 | Format is as follows (whitespace is completely ignored, index must be between 0 and 31 inclusive): 3 | Flag // flag is allowed on all types 4 | or: 5 | Flag { } // flag is allowed only on the specified types 6 | */ 7 | 8 | // List of flags for TESV - DO NOT EDIT 9 | 10 | // Flag hides the script or property from the game editor 11 | Flag Hidden 0 12 | { 13 | Script 14 | Property 15 | } 16 | 17 | // Flag on an object designates it as the script the condition system will look at 18 | // Flag on a variable allows the script variable to be examined by the condition system 19 | Flag Conditional 1 20 | { 21 | Script 22 | Variable 23 | } -------------------------------------------------------------------------------- /scripts/vanilla/TextureSet.psc: -------------------------------------------------------------------------------- 1 | Scriptname TextureSet extends Form Hidden 2 | -------------------------------------------------------------------------------- /scripts/vanilla/Topic.psc: -------------------------------------------------------------------------------- 1 | Scriptname Topic extends Form Hidden 2 | 3 | ; Adds this topic to the list the player knows about 4 | Function Add() native -------------------------------------------------------------------------------- /scripts/vanilla/VoiceType.psc: -------------------------------------------------------------------------------- 1 | Scriptname VoiceType extends Form Hidden 2 | -------------------------------------------------------------------------------- /scripts/vanilla/Weapon.psc: -------------------------------------------------------------------------------- 1 | Scriptname Weapon extends Form Hidden 2 | 3 | ; Fire this weapon base object from the specified source 4 | Function Fire(ObjectReference akSource, Ammo akAmmo = None) native 5 | -------------------------------------------------------------------------------- /scripts/vanilla/Weather.psc: -------------------------------------------------------------------------------- 1 | Scriptname Weather extends Form Hidden 2 | 3 | ; Tells the sky to release its overriding weather. 4 | function ReleaseOverride() native global 5 | 6 | ; Forces the active weather on the sky to be this weather. 7 | function ForceActive( bool abOverride=false ) native 8 | 9 | ; Sets the active weather on the sky to be this weather. 10 | function SetActive( bool abOverride=false, bool abAccelerate=false ) native 11 | 12 | ; Finds a weather from the current region/climate whose classification matches the given one. 13 | ; 0 - Pleasant 14 | ; 1 - Cloudy 15 | ; 2 - Rainy 16 | ; 3 - Snow 17 | Weather function FindWeather( int auiType ) native global 18 | 19 | ; Gets this weather's classification 20 | ; -1 - No classification 21 | ; 0 - Pleasant 22 | ; 1 - Cloudy 23 | ; 2 - Rainy 24 | ; 3 - Snow 25 | int function GetClassification() native 26 | 27 | ; Gets the sky's current weather 28 | Weather function GetCurrentWeather() native global 29 | 30 | ; Gets the sky's outgoing weather 31 | Weather function GetOutgoingWeather() native global 32 | 33 | ; Gets the transition percentage of the current weather 34 | float function GetCurrentWeatherTransition() native global 35 | 36 | ; Gets the sky's current mode 37 | ; 0 - No sky (SM_NONE) 38 | ; 1 - Interior (SM_INTERIOR) 39 | ; 2 - Skydome only (SM_SKYDOME_ONLY) 40 | ; 3 - Full sky (SM_FULL) 41 | int function GetSkyMode() native global -------------------------------------------------------------------------------- /scripts/vanilla/WordOfPower.psc: -------------------------------------------------------------------------------- 1 | Scriptname WordOfPower Extends Form Hidden -------------------------------------------------------------------------------- /scripts/vanilla/WorldSpace.psc: -------------------------------------------------------------------------------- 1 | Scriptname WorldSpace extends Form Hidden 2 | -------------------------------------------------------------------------------- /sheets/Common.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $(ProjectName)_1_6_323 7 | 8 | 9 | 10 | $(SolutionDir);$(SolutionDir)\..;%(AdditionalIncludeDirectories) 11 | Level3 12 | _WINDOWS;_USRDLL;SKSE64_EXPORTS;RUNTIME;%(PreprocessorDefinitions) 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /sheets/ForcedInclude.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | common/IPrefix.h 9 | $(ProjectDir)..\;$(ProjectDir)..\..\common;%(AdditionalIncludeDirectories) 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /sheets/Postbuild.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | copy "$(TargetPath)" "$(Skyrim64Path)\$(TargetFileName)" /Y 9 | Installing DLL... 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /sheets/Runtime.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | RUNTIME_VERSION=0x01061430;%(PreprocessorDefinitions) 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /skse64/BSModelDB.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/BSModelDB.h" 2 | 3 | // 206875324DD3C045FB854CB2889AFBCA94C7790B+89 4 | RelocPtr g_TESProcessor(0x020FBB00); 5 | -------------------------------------------------------------------------------- /skse64/BSModelDB.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64_common/Utilities.h" 4 | 5 | class NiAVObject; 6 | 7 | class BSModelDB 8 | { 9 | public: 10 | struct ModelData 11 | { 12 | UInt64 unk00; // 00 13 | 14 | enum 15 | { 16 | kFlag_Unk1 = (1 << 0), 17 | kFlag_Dynamic = (1 << 1), 18 | kFlag_PostProcess = (1 << 3), 19 | kFlag_Unk2 = (1 << 4), 20 | kFlag_Unk3 = (1 << 5) 21 | }; 22 | 23 | UInt8 modelFlags; // 08 24 | // ... 25 | }; 26 | 27 | class BSModelProcessor 28 | { 29 | public: 30 | virtual ~BSModelProcessor() { }; 31 | 32 | virtual void Process(ModelData * modelData, const char * modelName, NiAVObject ** root, UInt32 * typeOut) { }; 33 | }; 34 | 35 | class TESProcessor : public BSModelProcessor 36 | { 37 | public: 38 | TESProcessor() { } 39 | virtual ~TESProcessor() { CALL_MEMBER_FN(this, dtor)(); }; 40 | 41 | virtual void Process(ModelData * modelData, const char * modelName, NiAVObject ** root, UInt32 * typeOut) override { CALL_MEMBER_FN(this, Impl_Process)(modelData, modelName, root, typeOut); } 42 | 43 | MEMBER_FN_PREFIX(TESProcessor); 44 | // find from ??_7BSModelProcessor@BSModelDB@@6B@ 45 | DEFINE_MEMBER_FN(dtor, void, 0x00E03720); 46 | DEFINE_MEMBER_FN(Impl_Process, void, 0x001CC1F0, ModelData * modelData, const char * modelName, NiAVObject ** root, UInt32 * typeOut); 47 | }; 48 | }; 49 | 50 | extern RelocPtr g_TESProcessor; 51 | -------------------------------------------------------------------------------- /skse64/Colors.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common/ITypes.h" 4 | 5 | #define MIN3(x,y,z) ((y) <= (z) ? ((x) <= (y) ? (x) : (y)) : ((x) <= (z) ? (x) : (z))) 6 | #define MAX3(x,y,z) ((y) >= (z) ? ((x) >= (y) ? (x) : (y)) : ((x) >= (z) ? (x) : (z))) 7 | 8 | class ARGBColor 9 | { 10 | public: 11 | ARGBColor(UInt32 argb) { 12 | m_alpha = COLOR_ALPHA(argb); 13 | m_red = COLOR_RED(argb); 14 | m_green = COLOR_GREEN(argb); 15 | m_blue = COLOR_BLUE(argb); 16 | }; 17 | ARGBColor(UInt8 _a, UInt8 _r, UInt8 _g, UInt8 _b) : m_alpha(_a), m_red(_r), m_green(_g), m_blue(_b) {}; 18 | 19 | UInt32 GetColor(); 20 | 21 | void SetARGB(UInt8 alpha, UInt8 red, UInt8 green, UInt8 blue); 22 | void GetARGB(UInt8 & alpha, UInt8 & red, UInt8 & green, UInt8 & blue); 23 | 24 | void SetHSV(double hue, double saturation, double value); 25 | void GetHSV(double & hue, double & saturation, double & value); 26 | 27 | UInt8 GetAlpha(); 28 | UInt8 GetRed(); 29 | UInt8 GetGreen(); 30 | UInt8 GetBlue(); 31 | 32 | void SetAlpha(UInt8 alpha); 33 | void SetRed(UInt8 red); 34 | void SetGreen(UInt8 green); 35 | void SetBlue(UInt8 blue); 36 | 37 | void SetHue(double hue); 38 | void SetSaturation(double saturation); 39 | void SetValue(double value); 40 | 41 | double GetHue(); 42 | double GetSaturation(); 43 | double GetValue(); 44 | 45 | private: 46 | UInt8 m_alpha; 47 | UInt8 m_red; 48 | UInt8 m_green; 49 | UInt8 m_blue; 50 | }; 51 | -------------------------------------------------------------------------------- /skse64/CustomMenu.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/CustomMenu.h" 2 | 3 | std::string CustomMenuCreator::swfPath_; 4 | 5 | IMenu* CustomMenuCreator::Create(void) 6 | { 7 | void* p = ScaleformHeap_Allocate(sizeof(CustomMenu)); 8 | if (p) 9 | { 10 | IMenu* menu = new (p) CustomMenu(swfPath_.c_str()); 11 | return menu; 12 | } 13 | else 14 | { 15 | return NULL; 16 | } 17 | } 18 | 19 | void CustomMenuCreator::SetSwfPath(const char* path) 20 | { 21 | swfPath_ = path; 22 | } 23 | 24 | CustomMenu::CustomMenu(const char* swfPath) 25 | { 26 | CALL_MEMBER_FN(GFxLoader::GetSingleton(), LoadMovie)(this, &view, swfPath, GFxMovieView::ScaleModeType::kNoBorder, 0.0); 27 | 28 | flags = IMenu::kFlag_Modal | IMenu::kFlag_PausesGame; 29 | unk0C = 0xA; 30 | unk14 = 1; 31 | 32 | if(!InputEventDispatcher::GetSingleton()->IsGamepadEnabled()) 33 | flags |= IMenu::kFlag_UpdateUsesCursor | IMenu::kFlag_UsesCursor; // Shows the cursor when no gamepad is enabled 34 | 35 | #ifdef _CUSTOMMENU_ITEMDISPLAY 36 | flags |= IMenu::kFlag_RendersOffscreenTargets; 37 | #endif 38 | } 39 | #ifdef _CUSTOMMENU_ITEMDISPLAY 40 | void UpdateItem3D(const FxDelegateArgs & params) 41 | { 42 | if(params.menu) { 43 | UInt32 formId = (UInt32)params.args->GetNumber(); 44 | if(formId) { 45 | TESForm * form = LookupFormByID(formId); 46 | if(form) { 47 | CALL_MEMBER_FN(Inventory3DManager::GetSingleton(), UpdateMagic3D)(form, 0); 48 | } 49 | } else { 50 | CALL_MEMBER_FN(Inventory3DManager::GetSingleton(), Clear3D)(); 51 | } 52 | } 53 | } 54 | #endif 55 | void CustomMenu::Accept(CallbackProcessor * processor) 56 | { 57 | GString playSound("PlaySound"); 58 | processor->Process(playSound, PlaySoundCallback); 59 | 60 | #ifdef _CUSTOMMENU_ITEMDISPLAY 61 | GString renderItem("UpdateItem3D"); 62 | processor->Process(renderItem, UpdateItem3D); 63 | #endif 64 | } 65 | 66 | 67 | void CustomMenu::Render() 68 | { 69 | if(view) { 70 | view->Render(); 71 | #ifdef _CUSTOMMENU_ITEMDISPLAY 72 | CALL_MEMBER_FN(Inventory3DManager::GetSingleton(), Render)(); 73 | #endif 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /skse64/CustomMenu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64/GameMenus.h" 4 | #include "skse64/ScaleformLoader.h" 5 | 6 | class CustomMenuCreator 7 | { 8 | public: 9 | static IMenu* Create(void); 10 | static void SetSwfPath(const char* path); 11 | 12 | private: 13 | CustomMenuCreator(); 14 | 15 | static std::string swfPath_; 16 | }; 17 | 18 | class CustomMenu : public IMenu 19 | { 20 | public: 21 | CustomMenu(const char* swfPath); 22 | virtual void Accept(CallbackProcessor * processor); 23 | virtual void Render(void); 24 | }; 25 | -------------------------------------------------------------------------------- /skse64/GameAPI.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/GameAPI.h" 2 | 3 | // 4265A365BEE4B4196639CF9FCCF3C445CEC4DBFD+1B 4 | RelocPtr g_main(0x031872C0); 5 | 6 | // B05BDE2B512930D17FC7064CCC201FEE897AA475+44 7 | RelocPtr g_mainHeap(0x035F11E0); 8 | 9 | // 338B95DD01390309C6CF7F96A08D629A564D0A48+5D 10 | RelocPtr g_console(0x03137EE0); 11 | 12 | // 4D7631B98BE6AABD42229719E0D837E677A24FB5+CF 13 | RelocPtr g_consoleHandle(0x031ACD74); 14 | 15 | // 3DD6796A3BFE73B35604DD47E8677156AEBD4360+20 16 | RelocPtr g_TlsIndexPtr(0x035F0878); 17 | 18 | // 14BE6944D5E0E54959DE86FE65045CCEBBC65E31+6 19 | RelocPtr g_thePlayer(0x031874F8); 20 | 21 | void * Heap_Allocate(size_t size) 22 | { 23 | return CALL_MEMBER_FN(g_mainHeap, Allocate)(size, 0, false); 24 | } 25 | 26 | void Heap_Free(void * ptr) 27 | { 28 | CALL_MEMBER_FN(g_mainHeap, Free)(ptr, false); 29 | } 30 | 31 | void Console_Print(const char * fmt, ...) 32 | { 33 | ConsoleManager * mgr = *g_console; 34 | if(mgr) 35 | { 36 | va_list args; 37 | va_start(args, fmt); 38 | 39 | CALL_MEMBER_FN(mgr, VPrint)(fmt, args); 40 | 41 | va_end(args); 42 | } 43 | } 44 | 45 | struct TLSData 46 | { 47 | // thread local storage 48 | 49 | UInt8 unk000[0x600]; // 000 50 | UInt8 consoleMode; // 600 51 | UInt8 pad601[7]; // 601 52 | }; 53 | 54 | static TLSData * GetTLSData() 55 | { 56 | UInt32 TlsIndex = *g_TlsIndexPtr; 57 | TLSData ** data = (TLSData **)__readgsqword(0x58); 58 | 59 | return data[TlsIndex]; 60 | } 61 | 62 | 63 | bool IsConsoleMode(void) 64 | { 65 | return GetTLSData()->consoleMode != 0; 66 | } 67 | 68 | __int64 GetPerfCounter(void) 69 | { 70 | LARGE_INTEGER li; 71 | QueryPerformanceCounter(&li); 72 | return li.QuadPart; 73 | } 74 | -------------------------------------------------------------------------------- /skse64/GameAPI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64_common/Utilities.h" 4 | 5 | class PlayerCharacter; 6 | 7 | class Main 8 | { 9 | public: 10 | virtual ~Main(); 11 | 12 | UInt64 unk08; // 08 13 | UInt64 unk10; // 10 14 | UInt64 unk18; // 18 15 | UInt64 unk20; // 20 16 | UInt32 threadId; // 28 17 | // ... More 18 | }; 19 | extern RelocPtr g_main; 20 | 21 | class Heap 22 | { 23 | public: 24 | MEMBER_FN_PREFIX(Heap); 25 | DEFINE_MEMBER_FN(Allocate, void *, 0x00CC40C0, size_t size, size_t alignment, bool aligned); 26 | DEFINE_MEMBER_FN(Free, void, 0x00CC4510, void * buf, bool aligned); 27 | }; 28 | 29 | extern RelocPtr g_mainHeap; 30 | 31 | void * Heap_Allocate(size_t size); 32 | void Heap_Free(void * ptr); 33 | 34 | class ConsoleManager 35 | { 36 | public: 37 | MEMBER_FN_PREFIX(ConsoleManager); 38 | DEFINE_MEMBER_FN(VPrint, void, 0x008F9220, const char * fmt, va_list args); 39 | // DEFINE_MEMBER_FN(Print, void, 0x001D2050, const char * str); 40 | }; 41 | 42 | extern RelocPtr g_console; 43 | extern RelocPtr g_consoleHandle; 44 | extern RelocPtr g_thePlayer; 45 | 46 | void Console_Print(const char * fmt, ...); 47 | bool IsConsoleMode(void); 48 | __int64 GetPerfCounter(void); 49 | -------------------------------------------------------------------------------- /skse64/GameCamera.cpp: -------------------------------------------------------------------------------- 1 | #include "GameCamera.h" 2 | 3 | void LocalMapCamera::SetDefaultStateMinFrustumDimensions(float width, float height) 4 | { 5 | defaultState->minFrustumWidth = width / 2.0; 6 | defaultState->minFrustumHeight = height / 2.0; 7 | } 8 | 9 | void LocalMapCamera::SetAreaBounds(NiPoint3 * maxBound, NiPoint3 * minBound) 10 | { 11 | areaBoundsMin = *minBound; 12 | areaBoundsMax = *maxBound; 13 | areaBoundsMax.z += (*g_mapLocalHeight); 14 | } 15 | 16 | void LocalMapCamera::SetDefaultStateMaxBound(NiPoint3 * maxBound) 17 | { 18 | defaultState->someBoundMax = *maxBound; 19 | defaultState->someBoundMax.z += (*g_mapLocalHeight); 20 | } 21 | 22 | void LocalMapCamera::SetDefaultStateBounds(float x, float y, float z) 23 | { 24 | defaultState->someBoundMin.x = x - defaultState->someBoundMax.x; 25 | defaultState->someBoundMin.y = y - defaultState->someBoundMax.y; 26 | defaultState->someBoundMin.z = z - defaultState->someBoundMax.z; 27 | } 28 | -------------------------------------------------------------------------------- /skse64/GameHandlers.cpp: -------------------------------------------------------------------------------- 1 | #include "GameHandlers.h" 2 | -------------------------------------------------------------------------------- /skse64/GamePathing.cpp: -------------------------------------------------------------------------------- 1 | #include "GamePathing.h" 2 | -------------------------------------------------------------------------------- /skse64/GameRTTI.cpp: -------------------------------------------------------------------------------- 1 | #include "GameRTTI.h" 2 | #include "skse64_common/Relocation.h" 3 | 4 | typedef void * (* _Runtime_DynamicCast_Internal)(void * srcObj, UInt32 arg1, const void * fromType, const void * toType, UInt32 arg4); 5 | // 09ECDC875A847989BA08B9E8A23656EDFE1F380C+A8 6 | RelocAddr <_Runtime_DynamicCast_Internal> Runtime_DynamicCast_Internal(0x0153CF2A); // __RTDynamicCast 7 | 8 | void * Runtime_DynamicCast(void * srcObj, const void * fromType, const void * toType) 9 | { 10 | uintptr_t fromTypeAddr = uintptr_t(fromType) + RelocationManager::s_baseAddr; 11 | uintptr_t toTypeAddr = uintptr_t(toType) + RelocationManager::s_baseAddr; 12 | 13 | return Runtime_DynamicCast_Internal(srcObj, 0, (void *)fromTypeAddr, (void *)toTypeAddr, 0); 14 | } 15 | 16 | #include "GameRTTI.inl" 17 | -------------------------------------------------------------------------------- /skse64/GameResources.cpp: -------------------------------------------------------------------------------- 1 | #include "GameResources.h" 2 | 3 | FaceGenTriDatabase * FaceGenTriDatabase::GetSingleton(void) 4 | { 5 | // 9FA4657D28964C48501C6FF2E9E8E52D86D2BDEF+3E 6 | static RelocPtr g_FaceGenTriDatabase(0x031394E0); 7 | return *g_FaceGenTriDatabase; 8 | } 9 | 10 | BSFaceGenDB::TRI::DBTraits::Data * FaceGenTriDatabase::GetInvalidEntry(void) 11 | { 12 | // CD3B953DD742EFE4CEFC4ECA602FC9F442434777+A2 13 | static RelocPtr g_FaceGenTriDatabase_InvalidEntry(0x02012FA8); 14 | return g_FaceGenTriDatabase_InvalidEntry.GetPtr(); 15 | } 16 | -------------------------------------------------------------------------------- /skse64/GameSettings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64_common/Utilities.h" 4 | #include "skse64/NiTypes.h" 5 | 6 | // 18 7 | class Setting 8 | { 9 | public: 10 | Setting(); 11 | virtual ~Setting(); 12 | 13 | enum 14 | { 15 | kType_Unknown = 0, 16 | kType_Integer, 17 | kType_Float, 18 | kType_String, 19 | kType_Bool, 20 | kType_ID6, // need to find an example of this 21 | kType_ID, 22 | }; 23 | 24 | union Data 25 | { 26 | UInt32 u32; 27 | SInt32 s32; 28 | float f32; 29 | UInt8 u8; // used for bool 30 | char * s; 31 | }; 32 | 33 | // void ** _vtbl; // 00 34 | Data data; // 08 35 | char * name; // 10 36 | 37 | UInt32 GetType(void) const; 38 | 39 | bool GetDouble(double * out) const; 40 | bool SetDouble(double value); 41 | 42 | bool SetString(const char * value); 43 | }; 44 | 45 | // 128 46 | class SettingCollectionList 47 | { 48 | public: 49 | virtual ~SettingCollectionList(); 50 | 51 | struct Entry 52 | { 53 | Setting * setting; 54 | Entry * next; 55 | }; 56 | 57 | // void ** _vtbl; // 000 58 | UInt64 pad008[(0x118 - 0x008) >> 3]; 59 | Entry items; // 118 60 | 61 | MEMBER_FN_PREFIX(SettingCollectionList); 62 | DEFINE_MEMBER_FN(Get_Internal, Setting *, 0x00367270, const char * name); 63 | 64 | Setting * Get(const char * name); 65 | }; 66 | STATIC_ASSERT(offsetof(SettingCollectionList, items) == 0x118); 67 | 68 | // 138 69 | class SettingCollectionMap 70 | { 71 | public: 72 | virtual ~SettingCollectionMap(); 73 | 74 | Setting * Get(const char * name); 75 | 76 | // void ** _vtbl; // 000 77 | UInt64 pad008[(0x118 - 0x008) >> 3]; 78 | NiTMap items; // 118 - actually BSTCaseInsensitiveStringMap but that only changes the virtual functions 79 | }; 80 | STATIC_ASSERT(offsetof(SettingCollectionMap, items) == 0x118); 81 | 82 | Setting * GetINISetting(const char * name); 83 | 84 | extern RelocPtr g_iniSettingCollection; 85 | extern RelocPtr g_iniPrefSettingCollection; 86 | extern RelocPtr g_gameSettingCollection; 87 | 88 | extern RelocPtr g_mapLocalHeight; 89 | extern RelocPtr g_localMapMinFrustumWidth; 90 | -------------------------------------------------------------------------------- /skse64/GameThreads.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/GameThreads.h" 2 | 3 | BSTaskPool * BSTaskPool::GetSingleton(void) 4 | { 5 | // 7D1E14E40FFCA18609B3FAAD0A5750A26162D096+90 6 | static RelocPtr g_taskPool(0x031993A0); 7 | return *g_taskPool; 8 | } 9 | -------------------------------------------------------------------------------- /skse64/GameUtilities.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/GameUtilities.h" 2 | 3 | RelocAddr <_CalculateCRC32_64> CalculateCRC32_64(0x00CC8460); 4 | RelocAddr <_CalculateCRC32_32> CalculateCRC32_32(0x00CC83E0); 5 | -------------------------------------------------------------------------------- /skse64/GameUtilities.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64_common/Relocation.h" 4 | 5 | typedef void(*_CalculateCRC32_64)(UInt32 * out, UInt64 data); 6 | extern RelocAddr <_CalculateCRC32_64> CalculateCRC32_64; 7 | 8 | typedef void(*_CalculateCRC32_32)(UInt32 * out, UInt32 data); 9 | extern RelocAddr <_CalculateCRC32_32> CalculateCRC32_32; 10 | -------------------------------------------------------------------------------- /skse64/GlobalLocks.cpp: -------------------------------------------------------------------------------- 1 | #include "GlobalLocks.h" 2 | #include "common/ICriticalSection.h" 3 | 4 | ICriticalSection g_loadGameLock; 5 | -------------------------------------------------------------------------------- /skse64/GlobalLocks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common/ICriticalSection.h" 4 | 5 | extern ICriticalSection g_loadGameLock; 6 | -------------------------------------------------------------------------------- /skse64/HashUtil.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace HashUtil 4 | { 5 | // Calc CRC32 of null terminated string 6 | UInt32 CRC32(const char* str, UInt32 start = 0); 7 | } 8 | -------------------------------------------------------------------------------- /skse64/Hooks_Camera.cpp: -------------------------------------------------------------------------------- 1 | #include "Hooks_Camera.h" 2 | #include "GameCamera.h" 3 | #include "PapyrusEvents.h" 4 | #include "skse64_common/BranchTrampoline.h" 5 | #include "skse64_common/SafeWrite.h" 6 | #include "xbyak/xbyak.h" 7 | #include 8 | 9 | RelocAddr kInstallCameraHook_Base(0x005511C0); 10 | 11 | void InstallCameraHook(TESCameraState * oldState, TESCameraState * newState) 12 | { 13 | SKSECameraEvent evn(oldState, newState); 14 | g_cameraEventDispatcher.SendEvent(&evn); 15 | } 16 | 17 | void Hooks_Camera_Commit(void) 18 | { 19 | struct InstallHookCamera_Code : Xbyak::CodeGenerator { 20 | InstallHookCamera_Code(void * buf) : Xbyak::CodeGenerator(4096, buf) 21 | { 22 | Xbyak::Label origFunctionP5; 23 | 24 | push(r12); 25 | push(r13); 26 | sub(rsp, 0x28); // Remainder that stack must keep 16 bytes alignment or bad things will happen 27 | 28 | mov(r12, rcx); 29 | mov(r13, ptr[rcx + 0x28]); 30 | 31 | // Original code 32 | mov(ptr[rsp], rbx); // Using rsp+0 instead of rsp+8 of original instruction, because call will decrement rsp 33 | call(ptr[rip + origFunctionP5]); 34 | 35 | mov(rcx, r13); // oldState 36 | mov(rdx, ptr[r12 + 0x28]); // newState 37 | mov(rax, (uintptr_t)InstallCameraHook); 38 | call(rax); 39 | 40 | add(rsp, 0x28); 41 | pop(r13); 42 | pop(r12); 43 | ret(); 44 | 45 | L(origFunctionP5); 46 | dq(kInstallCameraHook_Base.GetUIntPtr() + 0x5); 47 | } 48 | }; 49 | 50 | void * codeBuf = g_localTrampoline.StartAlloc(); 51 | InstallHookCamera_Code code(codeBuf); 52 | g_localTrampoline.EndAlloc(code.getCurr()); 53 | 54 | g_branchTrampoline.Write5Branch(kInstallCameraHook_Base.GetUIntPtr(), uintptr_t(code.getCode())); 55 | } 56 | -------------------------------------------------------------------------------- /skse64/Hooks_Camera.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void Hooks_Camera_Commit(void); 4 | -------------------------------------------------------------------------------- /skse64/Hooks_Data.cpp: -------------------------------------------------------------------------------- 1 | #include "Hooks_Data.h" 2 | #include "GameData.h" 3 | #include "PluginManager.h" 4 | #include "skse64_common/BranchTrampoline.h" 5 | 6 | UInt32 DataHandler::LoadScripts_Hook() 7 | { 8 | UInt32 ret = CALL_MEMBER_FN(this, LoadScripts)(); 9 | PluginManager::Dispatch_Message(0, SKSEMessagingInterface::kMessage_DataLoaded, (void*)NULL, 0, NULL); 10 | return ret; 11 | } 12 | 13 | RelocAddr LoadScripts_Enter(0x00642BD0 + 0x3F7); 14 | 15 | void Hooks_Data_Commit(void) 16 | { 17 | g_branchTrampoline.Write5Call(LoadScripts_Enter.GetUIntPtr(), GetFnAddr(&DataHandler::LoadScripts_Hook)); 18 | } 19 | -------------------------------------------------------------------------------- /skse64/Hooks_Data.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void Hooks_Data_Commit(void); -------------------------------------------------------------------------------- /skse64/Hooks_Debug.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void Hooks_Debug_Init(void); 4 | void Hooks_Debug_Commit(void); 5 | -------------------------------------------------------------------------------- /skse64/Hooks_Diagnostics.cpp: -------------------------------------------------------------------------------- 1 | #include "Hooks_Diagnostics.h" 2 | #include "skse64_common/SafeWrite.h" 3 | #include "skse64_common/Utilities.h" 4 | #include 5 | #include 6 | 7 | // not really needed, bethesda does this now 8 | 9 | void Hooks_Diagnostics_Commit(void) 10 | { 11 | UInt32 enableDiagnostics = 0; 12 | if (GetConfigOption_UInt32("General", "EnableDiagnostics", &enableDiagnostics)) 13 | { 14 | if (enableDiagnostics) 15 | { 16 | // 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /skse64/Hooks_Diagnostics.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void Hooks_Diagnostics_Commit(void); -------------------------------------------------------------------------------- /skse64/Hooks_Event.cpp: -------------------------------------------------------------------------------- 1 | #include "Hooks_Event.h" 2 | 3 | #include "skse64_common/Utilities.h" 4 | #include "skse64/GameInput.h" 5 | #include "skse64/GameMenus.h" 6 | #include "skse64/PapyrusEvents.h" 7 | #include "skse64/PluginManager.h" 8 | #include "skse64_common/BranchTrampoline.h" 9 | 10 | RelocAddr PlayerControls_ctor_Call(0x0063EB50 + 0xD7A); 11 | 12 | PlayerControls * PlayerControls::ctor_Hook(void) 13 | { 14 | PlayerControls * result = CALL_MEMBER_FN(this, ctor)(); 15 | 16 | MenuManager * mm = MenuManager::GetSingleton(); 17 | if (mm) { 18 | mm->MenuOpenCloseEventDispatcher()->AddEventSink(&g_menuEventHandler); 19 | } else { 20 | _MESSAGE("Failed to register SKSE menuEventHandler!"); 21 | } 22 | 23 | g_modCallbackEventDispatcher.AddEventSink(&g_modCallbackEventHandler); 24 | g_cameraEventDispatcher.AddEventSink(&g_cameraEventHandler); 25 | g_crosshairRefEventDispatcher.AddEventSink(&g_crosshairRefEventHandler); 26 | g_actionEventDispatcher.AddEventSink(&g_actionEventHandler); 27 | g_ninodeUpdateEventDispatcher.AddEventSink(&g_ninodeUpdateEventHandler); 28 | 29 | InputEventDispatcher *inputEventDispatcher = InputEventDispatcher::GetSingleton(); 30 | if (inputEventDispatcher) { 31 | inputEventDispatcher->AddEventSink(&g_inputEventHandler); 32 | } else { 33 | _MESSAGE("Failed to register SKSE inputEventHandler"); 34 | } 35 | 36 | PluginManager::Dispatch_Message(0, SKSEMessagingInterface::kMessage_InputLoaded, NULL, 0, NULL); 37 | 38 | return result; 39 | } 40 | 41 | void Hooks_Event_Commit(void) 42 | { 43 | g_branchTrampoline.Write5Call(PlayerControls_ctor_Call, GetFnAddr(&PlayerControls::ctor_Hook)); 44 | } 45 | -------------------------------------------------------------------------------- /skse64/Hooks_Event.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void Hooks_Event_Commit(void); 4 | -------------------------------------------------------------------------------- /skse64/Hooks_Gameplay.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TESObjectREFR; 4 | 5 | void Hooks_Gameplay_EnableForceContainerCategorization(bool enable); 6 | void Hooks_Gameplay_EnableMapMenuMouseWheel(bool enable); 7 | 8 | TESObjectREFR* Hooks_Gameplay_GetCrosshairRef(); 9 | 10 | void Hooks_Gameplay_Commit(void); 11 | -------------------------------------------------------------------------------- /skse64/Hooks_Handlers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void Hooks_Handlers_Init(void); 4 | void Hooks_Handlers_Commit(void); 5 | -------------------------------------------------------------------------------- /skse64/Hooks_Memory.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianpatt/skse64/072c0de6b15cf6afefa179e4d09a4ff6b573e5c2/skse64/Hooks_Memory.cpp -------------------------------------------------------------------------------- /skse64/Hooks_Memory.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianpatt/skse64/072c0de6b15cf6afefa179e4d09a4ff6b573e5c2/skse64/Hooks_Memory.h -------------------------------------------------------------------------------- /skse64/Hooks_NetImmerse.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64_common/Relocation.h" 4 | #include "skse64/NiRenderer.h" 5 | 6 | void Hooks_NetImmerse_Init(void); 7 | void Hooks_NetImmerse_Commit(void); 8 | 9 | -------------------------------------------------------------------------------- /skse64/Hooks_ObScript.cpp: -------------------------------------------------------------------------------- 1 | #include "Hooks_ObScript.h" 2 | #include "ObScript.h" 3 | #include "GameAPI.h" 4 | //#include "GameReferences.h" 5 | #include "skse64_common/SafeWrite.h" 6 | #include "skse64_common/skse_version.h" 7 | #include "GameData.h" 8 | #include "GameObjects.h" 9 | #include "GameReferences.h" 10 | #include "Hooks_Gameplay.h" 11 | #include "GameInput.h" 12 | 13 | // currently ForceRSXCrash, could also use ToggleESRAM and several others 14 | static ObScriptCommand * s_hijackedCommand = nullptr; 15 | 16 | void Hooks_ObScript_Init() 17 | { 18 | // instead of hooking the entire classic scripting system, we're just hijacking some unused commands 19 | 20 | for(ObScriptCommand * iter = g_firstConsoleCommand; iter->opcode < kObScript_NumConsoleCommands + kObScript_ConsoleOpBase; ++iter) 21 | { 22 | if(!strcmp(iter->longName, "ForceRSXCrash")) 23 | { 24 | s_hijackedCommand = iter; 25 | break; 26 | } 27 | } 28 | } 29 | 30 | bool GetSKSEVersion_Execute(const ObScriptParam * paramInfo, ScriptData * scriptData, TESObjectREFR * thisObj, TESObjectREFR* containingObj, Script* scriptObj, ScriptLocals* locals, double& result, UInt32& opcodeOffsetPtr) 31 | { 32 | _MESSAGE("GetSKSEVersion_Execute"); 33 | 34 | Console_Print("SKSE64 version: %d.%d.%d, release idx %d, runtime %08X", 35 | SKSE_VERSION_INTEGER, SKSE_VERSION_INTEGER_MINOR, SKSE_VERSION_INTEGER_BETA, 36 | SKSE_VERSION_RELEASEIDX, RUNTIME_VERSION); 37 | 38 | return true; 39 | } 40 | 41 | void Hooks_ObScript_Commit() 42 | { 43 | ObScriptCommand cmd = *s_hijackedCommand; 44 | 45 | cmd.longName = "GetSKSEVersion"; 46 | cmd.shortName = "skse"; 47 | cmd.helpText = ""; 48 | cmd.needsParent = 0; 49 | cmd.numParams = 0; 50 | cmd.execute = GetSKSEVersion_Execute; 51 | cmd.flags = 0; 52 | 53 | SafeWriteBuf((uintptr_t)s_hijackedCommand, &cmd, sizeof(cmd)); 54 | } 55 | -------------------------------------------------------------------------------- /skse64/Hooks_ObScript.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void Hooks_ObScript_Init(); 4 | void Hooks_ObScript_Commit(); 5 | -------------------------------------------------------------------------------- /skse64/Hooks_Papyrus.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64/PluginAPI.h" 4 | 5 | void Hooks_Papyrus_Init(); 6 | void Hooks_Papyrus_Commit(); 7 | 8 | bool RegisterPapyrusPlugin(SKSEPapyrusInterface::RegisterFunctions); 9 | -------------------------------------------------------------------------------- /skse64/Hooks_SaveLoad.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void Hooks_SaveLoad_Commit(void); 4 | -------------------------------------------------------------------------------- /skse64/Hooks_Scaleform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64/PluginAPI.h" 4 | 5 | void SetLastControlDown(const char * control, UInt32 keycode); 6 | void SetLastControlUp(const char * control, UInt32 keycode); 7 | 8 | void Hooks_Scaleform_Commit(void); 9 | 10 | bool RegisterScaleformPlugin(const char * name, SKSEScaleformInterface::RegisterCallback callback); 11 | void RegisterScaleformInventory(SKSEScaleformInterface::RegisterInventoryCallback callback); 12 | -------------------------------------------------------------------------------- /skse64/Hooks_Threads.cpp: -------------------------------------------------------------------------------- 1 | #include "Hooks_Threads.h" 2 | #include "skse64_common/SafeWrite.h" 3 | #include "skse64_common/Utilities.h" 4 | #include "skse64_common/BranchTrampoline.h" 5 | #include "GameThreads.h" 6 | 7 | #include "common/ICriticalSection.h" 8 | #include 9 | 10 | ICriticalSection s_taskQueueLock; 11 | std::queue s_tasks; 12 | 13 | static bool IsTaskQueueEmpty() 14 | { 15 | IScopedCriticalSection scoped(&s_taskQueueLock); 16 | return s_tasks.empty(); 17 | } 18 | 19 | void BSTaskPool::ProcessTasks() 20 | { 21 | CALL_MEMBER_FN(this, ProcessTaskQueue_HookTarget)(); 22 | 23 | while (!IsTaskQueueEmpty()) 24 | { 25 | s_taskQueueLock.Enter(); 26 | TaskDelegate * cmd = s_tasks.front(); 27 | s_tasks.pop(); 28 | s_taskQueueLock.Leave(); 29 | 30 | cmd->Run(); 31 | cmd->Dispose(); 32 | } 33 | } 34 | 35 | void TaskInterface::AddTask(TaskDelegate * cmd) 36 | { 37 | s_taskQueueLock.Enter(); 38 | s_tasks.push(cmd); 39 | s_taskQueueLock.Leave(); 40 | } 41 | 42 | void Hooks_Threads_Init(void) 43 | { 44 | 45 | } 46 | 47 | // 691ACD40B8430FBDA081477DEB2A9948ACC235F1+11F 48 | RelocAddr ProcessTasks_HookTarget_Enter(0x00645EA0 + 0xB9C); 49 | RelocAddr ProcessTasks_HookTarget_Enter2(0x006479E0 + 0x1C); 50 | 51 | void Hooks_Threads_Commit(void) 52 | { 53 | g_branchTrampoline.Write5Call(ProcessTasks_HookTarget_Enter, GetFnAddr(&BSTaskPool::ProcessTasks)); 54 | g_branchTrampoline.Write5Call(ProcessTasks_HookTarget_Enter2, GetFnAddr(&BSTaskPool::ProcessTasks)); 55 | } 56 | -------------------------------------------------------------------------------- /skse64/Hooks_Threads.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TaskDelegate; 4 | class UIDelegate_v1; 5 | 6 | void Hooks_Threads_Init(void); 7 | void Hooks_Threads_Commit(void); 8 | 9 | namespace TaskInterface 10 | { 11 | void AddTask(TaskDelegate * task); 12 | void AddUITask(UIDelegate_v1 * task); 13 | } 14 | -------------------------------------------------------------------------------- /skse64/Hooks_UI.cpp: -------------------------------------------------------------------------------- 1 | #include "Hooks_UI.h" 2 | #include "Hooks_Threads.h" 3 | #include "skse64_common/SafeWrite.h" 4 | #include "skse64_common/Utilities.h" 5 | #include "skse64_common/BranchTrampoline.h" 6 | #include "GameMenus.h" 7 | #include "common/ICriticalSection.h" 8 | #include 9 | 10 | #include "PapyrusUI.h" 11 | 12 | namespace 13 | { 14 | struct QueueEntry 15 | { 16 | // Allow implicit construction 17 | QueueEntry(UIDelegate* cmd) : bIsV1(false) { data.cmd = cmd; } 18 | QueueEntry(UIDelegate_v1* cmd) : bIsV1(true) { data.cmd_v1 = cmd; } 19 | 20 | bool bIsV1; 21 | 22 | union { 23 | UIDelegate* cmd; 24 | UIDelegate_v1* cmd_v1; 25 | } data; 26 | }; 27 | } 28 | 29 | ICriticalSection g_uiQueueLock; 30 | std::queue g_uiQueue; 31 | 32 | void UIManager::QueueCommand(UIDelegate* cmd) 33 | { 34 | g_uiQueueLock.Enter(); 35 | g_uiQueue.push(cmd); 36 | g_uiQueueLock.Leave(); 37 | } 38 | 39 | void UIManager::QueueCommand(UIDelegate_v1* cmd) 40 | { 41 | g_uiQueueLock.Enter(); 42 | g_uiQueue.push(cmd); 43 | g_uiQueueLock.Leave(); 44 | } 45 | 46 | void UIManager::ProcessCommands(void) 47 | { 48 | CALL_MEMBER_FN(this, ProcessEventQueue_HookTarget)(); 49 | 50 | g_uiQueueLock.Enter(); 51 | while (!g_uiQueue.empty()) 52 | { 53 | QueueEntry e = g_uiQueue.front(); 54 | g_uiQueue.pop(); 55 | 56 | // Old interface 57 | if (e.bIsV1) 58 | { 59 | UIDelegate_v1* cmd = e.data.cmd_v1; 60 | cmd->Run(); 61 | cmd->Dispose(); 62 | } 63 | // New interface 64 | else 65 | { 66 | UIDelegate* cmd = e.data.cmd; 67 | cmd->Run(); 68 | delete cmd; 69 | } 70 | } 71 | g_uiQueueLock.Leave(); 72 | } 73 | 74 | void TaskInterface::AddUITask(UIDelegate_v1* task) 75 | { 76 | UIManager * uiManager = UIManager::GetSingleton(); 77 | if(uiManager) { 78 | uiManager->QueueCommand(task); 79 | } 80 | } 81 | 82 | RelocAddr ProcessEventQueue_HookTarget_Enter(0x00FA3FA0 + 0xAB5); 83 | 84 | void Hooks_UI_Commit(void) 85 | { 86 | g_branchTrampoline.Write5Call(ProcessEventQueue_HookTarget_Enter, GetFnAddr(&UIManager::ProcessCommands)); 87 | } 88 | -------------------------------------------------------------------------------- /skse64/Hooks_UI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Old interface for compatibility with plugins 4 | class UIDelegate_v1 5 | { 6 | public: 7 | virtual void Run(void) = 0; 8 | virtual void Dispose(void) = 0; 9 | }; 10 | 11 | void Hooks_UI_Commit(void); 12 | -------------------------------------------------------------------------------- /skse64/InputMap.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace InputMap 4 | { 5 | 6 | enum 7 | { 8 | // first 256 for keyboard, then 8 mouse buttons, then mouse wheel up, wheel down, then 16 gamepad buttons 9 | kMacro_KeyboardOffset = 0, // not actually used, just for self-documentation 10 | kMacro_NumKeyboardKeys = 256, 11 | 12 | kMacro_MouseButtonOffset = kMacro_NumKeyboardKeys, // 256 13 | kMacro_NumMouseButtons = 8, 14 | 15 | kMacro_MouseWheelOffset = kMacro_MouseButtonOffset + kMacro_NumMouseButtons, // 264 16 | kMacro_MouseWheelDirections = 2, 17 | 18 | kMacro_GamepadOffset = kMacro_MouseWheelOffset + kMacro_MouseWheelDirections, // 266 19 | kMacro_NumGamepadButtons = 16, 20 | 21 | kMaxMacros = kMacro_GamepadOffset + kMacro_NumGamepadButtons // 282 22 | }; 23 | 24 | enum 25 | { 26 | kGamepadButtonOffset_DPAD_UP = kMacro_GamepadOffset, // 266 27 | kGamepadButtonOffset_DPAD_DOWN, 28 | kGamepadButtonOffset_DPAD_LEFT, 29 | kGamepadButtonOffset_DPAD_RIGHT, 30 | kGamepadButtonOffset_START, 31 | kGamepadButtonOffset_BACK, 32 | kGamepadButtonOffset_LEFT_THUMB, 33 | kGamepadButtonOffset_RIGHT_THUMB, 34 | kGamepadButtonOffset_LEFT_SHOULDER, 35 | kGamepadButtonOffset_RIGHT_SHOULDER, 36 | kGamepadButtonOffset_A, 37 | kGamepadButtonOffset_B, 38 | kGamepadButtonOffset_X, 39 | kGamepadButtonOffset_Y, 40 | kGamepadButtonOffset_LT, 41 | kGamepadButtonOffset_RT // 281 42 | }; 43 | 44 | UInt32 GamepadMaskToKeycode(UInt32 keyMask); 45 | UInt32 GamepadKeycodeToMask(UInt32 keyCode); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /skse64/InternalSerialization.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | UInt32 ResolveModIndex(UInt32 modIndex); 4 | void Init_CoreSerialization_Callbacks(); 5 | -------------------------------------------------------------------------------- /skse64/NiAdditionalGeometryData.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/NiAdditionalGeometryData.h" 2 | -------------------------------------------------------------------------------- /skse64/NiAdditionalGeometryData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64/NiObjects.h" 4 | #include "skse64/NiTypes.h" 5 | 6 | class NiAdditionalGeometryData : public NiObject 7 | { 8 | public: 9 | UInt32 m_uiRevID; // 08 10 | UInt16 m_usVertexCount; // 0C 11 | UInt8 m_ucNumStreams; // 0E 12 | UInt8 unk0F; // 0F 13 | void * m_pkStreamEntries; // 10 14 | UInt32 unk14; // 14 15 | void * m_pkBlocks; // 18 16 | UInt8 m_ucNumBlocks; // 1C 17 | UInt8 unk1D; // 1D 18 | UInt8 unk1E; // 1E 19 | UInt8 unk1F; // 1F 20 | }; 21 | -------------------------------------------------------------------------------- /skse64/NiControllers.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/NiControllers.h" 2 | -------------------------------------------------------------------------------- /skse64/NiInterpolators.cpp: -------------------------------------------------------------------------------- 1 | #include "NiInterpolators.h" 2 | -------------------------------------------------------------------------------- /skse64/NiLight.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/NiLight.h" 2 | -------------------------------------------------------------------------------- /skse64/NiLight.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64/NiTypes.h" 4 | #include "skse64/NiObjects.h" 5 | 6 | // D4 7 | class NiLight : public NiAVObject 8 | { 9 | public: 10 | virtual ~NiLight(); 11 | 12 | float unkA8; 13 | float unkAC; 14 | float unkB0; 15 | float unkB4; 16 | float unkB8; 17 | float unkBC; 18 | float unkC0; 19 | float unkC4; 20 | float unkC8; 21 | float unkCC; 22 | UInt32 unkD0; 23 | }; 24 | 25 | // D4 26 | class NiAmbientLight : public NiLight 27 | { 28 | public: 29 | virtual ~NiAmbientLight(); 30 | }; 31 | 32 | // E0 33 | class NiPointLight : public NiLight 34 | { 35 | public: 36 | virtual ~NiPointLight(); 37 | 38 | float unkD4; 39 | float unkD8; 40 | float unkDC; 41 | }; 42 | 43 | // EC 44 | class NiDirectionalLight : public NiLight 45 | { 46 | public: 47 | virtual ~NiDirectionalLight(); 48 | 49 | float unkD4; 50 | float unkD8; 51 | float unkDC; 52 | float unkE0; 53 | float unkE4; 54 | float unkE8; 55 | }; 56 | -------------------------------------------------------------------------------- /skse64/NiMaterial.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/NiMaterial.h" 2 | #include "skse64/GameAPI.h" 3 | #include "skse64/GameObjects.h" 4 | 5 | // 96D2EFF152717F366F7EAAA62CAD7EB12855423D+47 6 | RelocAddr<_CreateShaderMaterial> CreateShaderMaterial(0x014B7F70); 7 | 8 | RelocAddr<_CreateFacegenTintMaterial> CreateFacegenTintMaterial(0x014BAA70); 9 | 10 | void BSLightingShaderMaterial::SetTextureSet(BSTextureSet * newSet) 11 | { 12 | textureSet = newSet; 13 | } 14 | -------------------------------------------------------------------------------- /skse64/NiNodes.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/NiNodes.h" 2 | #include "skse64/GameObjects.h" 3 | 4 | NiBoneNames * NiBoneNames::GetSingleton(void) 5 | { 6 | // 33EBA690BF2A27ACE16840951CA740822F8A4756+9A 7 | static RelocAddr addr(0x020F6370); 8 | return addr; 9 | } 10 | 11 | NiNode * NiNode::Create(UInt16 arrBufLen) 12 | { 13 | void* memory = Heap_Allocate(sizeof(NiNode)); 14 | memset(memory, 0, sizeof(NiNode)); 15 | NiNode* xData = (NiNode*)memory; 16 | xData->ctor(arrBufLen); 17 | return xData; 18 | } 19 | 20 | BSFadeNode * BSFadeNode::Create() 21 | { 22 | void* memory = Heap_Allocate(sizeof(BSFadeNode)); 23 | memset(memory, 0, sizeof(BSFadeNode)); 24 | BSFadeNode* xData = (BSFadeNode*)memory; 25 | xData->ctor(); 26 | return xData; 27 | } 28 | -------------------------------------------------------------------------------- /skse64/NiProperties.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/NiProperties.h" 2 | -------------------------------------------------------------------------------- /skse64/NiRenderer.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/NiRenderer.h" 2 | 3 | // 984B8D46444288152A10744FB7226DC9943D175E+57 4 | RelocPtr g_renderManager(0x032887C0); 5 | 6 | BSRenderManager * BSRenderManager::GetSingleton() 7 | { 8 | return g_renderManager; 9 | } 10 | 11 | // 56C98A6AC471728E145A8629B087CE2BE81252C1+CC 12 | RelocPtr g_shaderResourceManager(0x03274040); 13 | -------------------------------------------------------------------------------- /skse64/NiRenderer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64/NiObjects.h" 4 | #include "skse64/NiTextures.h" 5 | 6 | #include "skse64/GameTypes.h" 7 | 8 | struct ID3D11Device; 9 | struct ID3D11DeviceContext; 10 | struct IDXGISwapChain4; 11 | struct ID3D11RenderTargetView1; 12 | struct ID3D11ShaderResourceView1; 13 | 14 | // Unknown class name, No RTTI 15 | class BSRenderManager 16 | { 17 | public: 18 | static BSRenderManager * GetSingleton(); 19 | 20 | UInt64 unk00[0x48 >> 3]; // 00 21 | ID3D11Device * forwarder; // 48 - Actually CID3D11Forwarder 22 | ID3D11DeviceContext * context; // 50 - ID3D11DeviceContext4 23 | UInt64 unk58; // 58 24 | UInt64 unk60; // 60 25 | UInt64 unk68; // 68 26 | IDXGISwapChain4 * swapChain; // 70 27 | UInt64 unk78; // 78 28 | UInt64 unk80; // 80 29 | ID3D11RenderTargetView1 * renderView; // 88 30 | ID3D11ShaderResourceView1 * resourceView; // 90 31 | UInt64 unk27E8[(0x27E8 - 0x90) >> 3]; 32 | CRITICAL_SECTION lock; // 27F0 - Moved in 1.6.1130 33 | 34 | // 141415050 - CreateRenderTargets 35 | 36 | DEFINE_MEMBER_FN_2(CreateRenderTexture, NiTexture::RendererData *, 0x00E48190, UInt32 width, UInt32 height); 37 | }; 38 | 39 | extern RelocPtr g_renderManager; 40 | 41 | class BSShaderResourceManager 42 | { 43 | public: 44 | virtual ~BSShaderResourceManager(); 45 | }; 46 | extern RelocPtr g_shaderResourceManager; 47 | -------------------------------------------------------------------------------- /skse64/NiSerialization.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/NiSerialization.h" 2 | -------------------------------------------------------------------------------- /skse64/NiTextures.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/NiTextures.h" 2 | 3 | RelocAddr<_CreateSourceTexture> CreateSourceTexture(0x00D2F140); 4 | RelocAddr<_LoadTexture> LoadTexture(0x01480030); 5 | -------------------------------------------------------------------------------- /skse64/ObScript.cpp: -------------------------------------------------------------------------------- 1 | #include "ObScript.h" 2 | #include "skse64_common\Relocation.h" 3 | 4 | // 3FF8B913C886A91CB5E3914CFDDBA88B8E5DAE2C+36 5 | RelocPtr g_firstObScriptCommand(0x01FDBA10); 6 | // CDE0D58F1D66B4840461CEB02F9187153F3308DF+F 7 | RelocPtr g_firstConsoleCommand(0x01FEA0B0); 8 | 9 | // 42E5B9018CCF84B813403067F1D963D8C753ED8D+4C 10 | RelocAddr <_ObScript_ExtractArgs> ObScript_ExtractArgs(0x0033E640); 11 | -------------------------------------------------------------------------------- /skse64/PapyrusActiveMagicEffect.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64/GameTypes.h" 4 | 5 | class ActiveEffect; 6 | class VMClassRegistry; 7 | class TESForm; 8 | 9 | namespace papyrusActiveMagicEffect 10 | { 11 | void RegisterFuncs(VMClassRegistry* registry); 12 | 13 | float GetTimeElapsed(ActiveEffect* effect); 14 | float GetDuration(ActiveEffect* effect); 15 | float GetMagnitude(ActiveEffect* effect); 16 | 17 | void RegisterForKey(ActiveEffect * effect, UInt32 key); 18 | void UnregisterForKey(ActiveEffect * effect, UInt32 key); 19 | void UnregisterForAllKeys(ActiveEffect * effect); 20 | 21 | void RegisterForControl(ActiveEffect * effect, BSFixedString control); 22 | void UnregisterForControl(ActiveEffect * effect, BSFixedString control); 23 | void UnregisterForAllControls(ActiveEffect * effect); 24 | 25 | void RegisterForMenu(ActiveEffect * effect, BSFixedString menuName); 26 | void UnregisterForMenu(ActiveEffect * effect, BSFixedString menuName); 27 | void UnregisterForAllMenus(ActiveEffect * effect); 28 | 29 | void RegisterForModEvent(ActiveEffect * effect, BSFixedString eventName, BSFixedString callbackName); 30 | void UnregisterForModEvent(ActiveEffect * effect, BSFixedString eventName); 31 | void UnregisterForAllModEvents(ActiveEffect * effect); 32 | 33 | void SendModEvent(ActiveEffect * thisForm, BSFixedString eventName, BSFixedString strArg, float numArg); 34 | 35 | void RegisterForCameraState(ActiveEffect * thisForm); 36 | void UnregisterForCameraState(ActiveEffect * thisForm); 37 | 38 | void RegisterForCrosshairRef(ActiveEffect * thisForm); 39 | void UnregisterForCrosshairRef(ActiveEffect * thisForm); 40 | } 41 | -------------------------------------------------------------------------------- /skse64/PapyrusActor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TESForm; 4 | class TESObjectWEAP; 5 | class Actor; 6 | class SpellItem; 7 | class ActiveEffect; 8 | class VMClassRegistry; 9 | class BGSHeadPart; 10 | class TESObjectREFR; 11 | 12 | namespace papyrusActor 13 | { 14 | void RegisterFuncs(VMClassRegistry* registry); 15 | 16 | TESForm* GetWornForm(Actor* thisActor, UInt32 slot); 17 | void QueueNiNodeUpdate(Actor* thisActor); 18 | UInt32 GetSpellCount(Actor* thisActor); 19 | SpellItem* GetNthSpell(Actor* thisActor, UInt32 n); 20 | 21 | #ifdef _AEFFECTS 22 | UInt32 GetNumActiveEffects(Actor* thisActor); 23 | ActiveEffect* GetNthActiveEffect(Actor* thisActor, UInt32 n); 24 | #endif 25 | 26 | void EquipItemEx(Actor* thisActor, TESForm* item, SInt32 slotId, bool preventUnequip, bool equipSound); 27 | void UnequipItemEx(Actor* thisActor, TESForm* item, SInt32 slotId, bool preventEquip); 28 | 29 | //void ReplaceHeadPart(Actor * thisActor, BGSHeadPart * oldPart, BGSHeadPart* newPart); 30 | //void ChangeHeadPart(Actor * thisActor, BGSHeadPart * newPart); 31 | //void RegenerateHead(Actor * thisActor); 32 | //void UpdateWeight(Actor * thisActor, float neckDelta); 33 | 34 | bool IsAIEnabled(Actor * thisActor); 35 | bool IsSwimming(Actor * thisActor); 36 | void SheatheWeapon(Actor * thisActor); 37 | 38 | void EquipItemById(Actor* thisActor, TESForm* item, SInt32 itemId, SInt32 slotId, bool preventUnequip, bool equipSound); 39 | TESObjectREFR * GetFurnitureReference(Actor * thisActor); 40 | } 41 | -------------------------------------------------------------------------------- /skse64/PapyrusActorBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class VMClassRegistry; 4 | class TESForm; 5 | class TESNPC; 6 | class TESCombatStyle; 7 | class BGSOutfit; 8 | class TESClass; 9 | class SpellItem; 10 | class BGSHeadPart; 11 | class BGSTextureSet; 12 | class TESObjectARMO; 13 | 14 | namespace papyrusActorBase { 15 | void RegisterFuncs(VMClassRegistry* registry); 16 | 17 | TESCombatStyle* GetCombatStyle(TESNPC* thisNPC); 18 | void SetCombatStyle(TESNPC* thisNPC, TESCombatStyle* cs); 19 | 20 | BGSOutfit* GetOutfit(TESNPC* thisNPC, bool bSleepOutfit = false); 21 | 22 | void SetClass(TESNPC* thisNPC, TESClass* nuClass); 23 | 24 | float GetHeight(TESNPC* thisNPC); 25 | void SetHeight(TESNPC* thisNPC, float height); 26 | float GetWeight(TESNPC* thisNPC); 27 | void SetWeight(TESNPC* thisNPC, float weight); 28 | 29 | UInt32 GetNumHeadParts(TESNPC* thisNPC); 30 | BGSHeadPart* GetNthHeadPart(TESNPC* thisNPC, UInt32 n); 31 | void SetNthHeadPart(TESNPC* thisNPC, BGSHeadPart* headPart, UInt32 n ); 32 | SInt32 GetIndexOfHeadPartByType(TESNPC* thisNPC, UInt32 type); 33 | 34 | UInt32 GetNumOverlayHeadParts(TESNPC* thisNPC); 35 | BGSHeadPart* GetNthOverlayHeadPart(TESNPC* thisNPC, UInt32 n); 36 | SInt32 GetIndexOfOverlayHeadPartByType(TESNPC* thisNPC, UInt32 type); 37 | 38 | float GetFaceMorph(TESNPC* thisNPC, UInt32 index); 39 | void SetFaceMorph(TESNPC* thisNPC, float value, UInt32 index); 40 | BGSTextureSet * GetFaceTextureSet(TESNPC* thisNPC); 41 | void SetFaceTextureSet(TESNPC* thisNPC, BGSTextureSet * textureSet); 42 | 43 | UInt32 GetSpellCount(TESNPC* thisNPC); 44 | SpellItem* GetNthSpell(TESNPC* thisNPC, UInt32 n); 45 | 46 | TESObjectARMO * GetSkin(TESNPC* thisNPC); 47 | void SetSkin(TESNPC* thisNPC, TESObjectARMO * skin); 48 | TESObjectARMO * GetSkinFar(TESNPC* thisNPC); 49 | void SetSkinFar(TESNPC* thisNPC, TESObjectARMO * skin); 50 | TESNPC* GetTemplate(TESNPC* thisNPC); 51 | }; 52 | -------------------------------------------------------------------------------- /skse64/PapyrusActorValueInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class VMClassRegistry; 4 | class ActorValueInfo; 5 | struct StaticFunctionTag; 6 | class BGSListForm; 7 | class Actor; 8 | 9 | #include "GameTypes.h" 10 | 11 | namespace papyrusActorValueInfo 12 | { 13 | void RegisterFuncs(VMClassRegistry* registry); 14 | 15 | ActorValueInfo * GetActorValueInfoByName(StaticFunctionTag * base, BSFixedString avName); 16 | ActorValueInfo * GetActorValueInfoByID(StaticFunctionTag * base, UInt32 actorValue); 17 | 18 | bool IsSkill(ActorValueInfo * info); 19 | 20 | float GetSkillUseMult(ActorValueInfo * info); 21 | void SetSkillUseMult(ActorValueInfo * info, float value); 22 | 23 | float GetSkillOffsetMult(ActorValueInfo * info); 24 | void SetSkillOffsetMult(ActorValueInfo * info, float value); 25 | 26 | float GetSkillImproveMult(ActorValueInfo * info); 27 | void SetSkillImproveMult(ActorValueInfo * info, float value); 28 | 29 | float GetSkillImproveOffset(ActorValueInfo * info); 30 | void SetSkillImproveOffset(ActorValueInfo * info, float value); 31 | 32 | float GetSkillExperience(ActorValueInfo * info); 33 | void SetSkillExperience(ActorValueInfo * info, float points); 34 | void AddSkillExperience(ActorValueInfo * info, float points); 35 | float GetExperienceForLevel(ActorValueInfo * info, UInt32 level); 36 | 37 | SInt32 GetSkillLegendaryLevel(ActorValueInfo * info); 38 | void SetSkillLegendaryLevel(ActorValueInfo * info, UInt32 level); 39 | 40 | 41 | 42 | void GetPerkTree(ActorValueInfo * info, BGSListForm * formList, Actor * actor, bool unowned, bool allRanks); 43 | }; 44 | -------------------------------------------------------------------------------- /skse64/PapyrusAlias.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameTypes.h" 4 | 5 | class BGSBaseAlias; 6 | class VMClassRegistry; 7 | 8 | namespace papyrusAlias 9 | { 10 | void RegisterFuncs(VMClassRegistry* registry); 11 | 12 | BSFixedString GetName(BGSBaseAlias* thisAlias); 13 | UInt32 GetId(BGSBaseAlias* thisAlias); 14 | 15 | void RegisterForKey(BGSBaseAlias * thisAlias, UInt32 key); 16 | void UnregisterForKey(BGSBaseAlias * thisAlias, UInt32 key); 17 | void UnregisterForAllKeys(BGSBaseAlias * thisAlias); 18 | 19 | void RegisterForControl(BGSBaseAlias * thisAlias, BSFixedString control); 20 | void UnregisterForControl(BGSBaseAlias * thisAlias, BSFixedString control); 21 | void UnregisterForAllControls(BGSBaseAlias * thisAlias); 22 | 23 | void RegisterForMenu(BGSBaseAlias * thisAlias, BSFixedString menuName); 24 | void UnregisterForMenu(BGSBaseAlias * thisAlias, BSFixedString menuName); 25 | void UnregisterForAllMenus(BGSBaseAlias * thisAlias); 26 | 27 | void RegisterForModEvent(BGSBaseAlias * thisAlias, BSFixedString eventName, BSFixedString callbackName); 28 | void UnregisterForModEvent(BGSBaseAlias * thisAlias, BSFixedString eventName); 29 | void UnregisterForAllModEvents(BGSBaseAlias * thisAlias); 30 | 31 | void SendModEvent(BGSBaseAlias * thisAlias, BSFixedString eventName, BSFixedString strArg, float numArg); 32 | 33 | void RegisterForCameraState(BGSBaseAlias * thisForm); 34 | void UnregisterForCameraState(BGSBaseAlias * thisForm); 35 | 36 | void RegisterForCrosshairRef(BGSBaseAlias * thisForm); 37 | void UnregisterForCrosshairRef(BGSBaseAlias * thisForm); 38 | } 39 | -------------------------------------------------------------------------------- /skse64/PapyrusAmmo.cpp: -------------------------------------------------------------------------------- 1 | #include "PapyrusAmmo.h" 2 | #include "GameObjects.h" 3 | 4 | namespace papyrusAmmo 5 | { 6 | bool IsBolt(TESAmmo * thisAmmo) 7 | { 8 | return (thisAmmo) ? thisAmmo->isBolt() : false; 9 | } 10 | 11 | BGSProjectile * GetProjectile(TESAmmo * thisAmmo) 12 | { 13 | return (thisAmmo) ? thisAmmo->settings.projectile : NULL; 14 | } 15 | 16 | float GetDamage(TESAmmo * thisAmmo) 17 | { 18 | return (thisAmmo) ? thisAmmo->settings.damage : 0.0f; 19 | } 20 | } 21 | 22 | #include "PapyrusVM.h" 23 | #include "PapyrusNativeFunctions.h" 24 | 25 | void papyrusAmmo::RegisterFuncs(VMClassRegistry* registry) 26 | { 27 | registry->RegisterFunction( 28 | new NativeFunction0("IsBolt", "Ammo", papyrusAmmo::IsBolt, registry)); 29 | 30 | registry->RegisterFunction( 31 | new NativeFunction0("GetProjectile", "Ammo", papyrusAmmo::GetProjectile, registry)); 32 | 33 | registry->RegisterFunction( 34 | new NativeFunction0("GetDamage", "Ammo", papyrusAmmo::GetDamage, registry)); 35 | } 36 | -------------------------------------------------------------------------------- /skse64/PapyrusAmmo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class VMClassRegistry; 4 | class BGSSoundDescriptorForm; 5 | class TESAmmo; 6 | class BGSProjectile; 7 | 8 | namespace papyrusAmmo 9 | { 10 | void RegisterFuncs(VMClassRegistry* registry); 11 | 12 | bool IsPlayable(TESAmmo * thisAmmo); 13 | bool IsBolt(TESAmmo * thisAmmo); 14 | BGSProjectile * GetProjectile(TESAmmo * thisAmmo); 15 | float GetDamage(TESAmmo * thisAmmo); 16 | }; 17 | -------------------------------------------------------------------------------- /skse64/PapyrusArmor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameTypes.h" 4 | class TESObjectARMO; 5 | struct StaticFunctionTag; 6 | class VMClassRegistry; 7 | class EnchantmentItem; 8 | class TESObjectARMA; 9 | 10 | 11 | namespace papyrusArmor 12 | { 13 | void RegisterFuncs(VMClassRegistry* registry); 14 | 15 | UInt32 GetArmorRating(TESObjectARMO* thisArmor); 16 | void SetArmorRating(TESObjectARMO* thisArmor, UInt32 nuAR); 17 | void ModArmorRating(TESObjectARMO* thisArmor, SInt32 modBy); 18 | 19 | UInt32 GetSlotMask(TESObjectARMO* thisArmor); 20 | void SetSlotMask(TESObjectARMO* thisArmor, UInt32 slotMask); 21 | UInt32 AddToSlotMask(TESObjectARMO* thisArmor, UInt32 slotMask); 22 | UInt32 RemoveFromSlotMask(TESObjectARMO* thisArmor, UInt32 slotMask); 23 | 24 | UInt32 GetMaskForSlot(StaticFunctionTag*, UInt32 slot); 25 | 26 | BSFixedString GetModelPath(TESObjectARMO* thisArmor, bool bFemale); 27 | void SetModelPath(TESObjectARMO* thisArmor, BSFixedString nuPath, bool bFemale); 28 | 29 | BSFixedString GetIconPath(TESObjectARMO* thisArmor, bool bFemale); 30 | void SetIconPath(TESObjectARMO* thisArmor, BSFixedString nuPath, bool bFemale); 31 | 32 | BSFixedString GetMessageIconPath(TESObjectARMO* thisArmor, bool bFemale); 33 | void SetMessageIconPath(TESObjectARMO* thisArmor, BSFixedString nuPath, bool bFemale); 34 | 35 | UInt32 GetWeightClass(TESObjectARMO* thisArmor); 36 | void SetWeightClass(TESObjectARMO* thisArmor, UInt32 nuWeightClass); 37 | 38 | EnchantmentItem* GetEnchantment(TESObjectARMO* thisArmor); 39 | void SetEnchantment(TESObjectARMO* thisArmor, EnchantmentItem* enchantment); 40 | 41 | UInt32 GetNumArmorAddons(TESObjectARMO* thisArmor); 42 | TESObjectARMA* GetNthArmorAddon(TESObjectARMO* thisArmor, UInt32 n); 43 | } 44 | -------------------------------------------------------------------------------- /skse64/PapyrusArmorAddon.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameTypes.h" 4 | class TESObjectARMA; 5 | class VMClassRegistry; 6 | class TESRace; 7 | class BGSTextureSet; 8 | 9 | namespace papyrusArmorAddon 10 | { 11 | void RegisterFuncs(VMClassRegistry* registry); 12 | 13 | BSFixedString GetModelPath(TESObjectARMA* thisArmorAddon, bool bFirst, bool bFemale); 14 | void SetModelPath(TESObjectARMA* thisArmorAddon, BSFixedString nuPath, bool bFirst, bool bFemale); 15 | 16 | UInt32 GetModelNumTextureSets(TESObjectARMA* thisArmorAddon, bool bFirst, bool bFemale); 17 | BGSTextureSet* GetModelNthTextureSet(TESObjectARMA* thisArmorAddon, UInt32 n, bool bFirst, bool bFemale); 18 | 19 | UInt32 GetNumAdditionalRaces(TESObjectARMA* thisArmorAddon); 20 | TESRace* GetNthAdditionalRace(TESObjectARMA* thisArmorAddon, UInt32 n); 21 | 22 | UInt32 GetSlotMask(TESObjectARMA* thisArmorAddon); 23 | void SetSlotMask(TESObjectARMA* thisArmorAddon, UInt32 slotMask); 24 | UInt32 AddSlotToMask(TESObjectARMA* thisArmorAddon, UInt32 slot); 25 | UInt32 RemoveSlotFromMask(TESObjectARMA* thisArmorAddon, UInt32 slot); 26 | } 27 | -------------------------------------------------------------------------------- /skse64/PapyrusArt.cpp: -------------------------------------------------------------------------------- 1 | #include "PapyrusArt.h" 2 | 3 | #include "GameObjects.h" 4 | #include "GameData.h" 5 | 6 | namespace papyrusArt 7 | { 8 | BSFixedString GetModelPath(BGSArtObject* thisArt) 9 | { 10 | return (thisArt) ? thisArt->texSwap.GetModelName() : NULL; 11 | } 12 | 13 | void SetModelPath(BGSArtObject* thisArt, BSFixedString nuPath) 14 | { 15 | if(thisArt) { 16 | thisArt->texSwap.SetModelName(nuPath.data); 17 | } 18 | } 19 | } 20 | 21 | #include "PapyrusVM.h" 22 | #include "PapyrusNativeFunctions.h" 23 | 24 | void papyrusArt::RegisterFuncs(VMClassRegistry* registry) 25 | { 26 | registry->RegisterForm(BGSArtObject::kTypeID, "Art"); 27 | 28 | registry->RegisterFunction( 29 | new NativeFunction0 ("GetModelPath", "Art", papyrusArt::GetModelPath, registry)); 30 | 31 | registry->RegisterFunction( 32 | new NativeFunction1 ("SetModelPath", "Art", papyrusArt::SetModelPath, registry)); 33 | } -------------------------------------------------------------------------------- /skse64/PapyrusArt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameTypes.h" 4 | 5 | class VMClassRegistry; 6 | 7 | namespace papyrusArt 8 | { 9 | void RegisterFuncs(VMClassRegistry* registry); 10 | }; 11 | -------------------------------------------------------------------------------- /skse64/PapyrusBook.cpp: -------------------------------------------------------------------------------- 1 | #include "PapyrusBook.h" 2 | 3 | #include "GameObjects.h" 4 | 5 | namespace papyrusBook 6 | { 7 | UInt32 GetSkill(TESObjectBOOK * thisBook) 8 | { 9 | if(thisBook && thisBook->data.GetSanitizedType() == TESObjectBOOK::Data::kType_Skill) 10 | return thisBook->data.teaches.skill; 11 | 12 | return 0; 13 | } 14 | 15 | SpellItem * GetSpell(TESObjectBOOK * thisBook) 16 | { 17 | if(thisBook && thisBook->data.GetSanitizedType() == TESObjectBOOK::Data::kType_Spell) 18 | return thisBook->data.teaches.spell; 19 | 20 | return NULL; 21 | } 22 | 23 | bool IsRead(TESObjectBOOK * thisBook) 24 | { 25 | return (thisBook) ? ((thisBook->data.flags & TESObjectBOOK::Data::kType_Read) == TESObjectBOOK::Data::kType_Read) : false; 26 | } 27 | 28 | bool IsTakeable(TESObjectBOOK * thisBook) 29 | { 30 | return (thisBook) ? ((thisBook->data.flags & TESObjectBOOK::Data::kType_CantBeTaken) == 0) : false; 31 | } 32 | } 33 | 34 | #include "PapyrusVM.h" 35 | #include "PapyrusNativeFunctions.h" 36 | 37 | void papyrusBook::RegisterFuncs(VMClassRegistry* registry) 38 | { 39 | registry->RegisterFunction( 40 | new NativeFunction0("GetSkill", "Book", papyrusBook::GetSkill, registry)); 41 | 42 | registry->RegisterFunction( 43 | new NativeFunction0("GetSpell", "Book", papyrusBook::GetSpell, registry)); 44 | 45 | registry->RegisterFunction( 46 | new NativeFunction0("IsRead", "Book", papyrusBook::IsRead, registry)); 47 | 48 | registry->RegisterFunction( 49 | new NativeFunction0("IsTakeable", "Book", papyrusBook::IsTakeable, registry)); 50 | } -------------------------------------------------------------------------------- /skse64/PapyrusBook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TESObjectBOOK; 4 | class SpellItem; 5 | class VMClassRegistry; 6 | 7 | namespace papyrusBook 8 | { 9 | void RegisterFuncs(VMClassRegistry * registry); 10 | 11 | UInt32 GetSkill(TESObjectBOOK * thisBook); 12 | SpellItem * GetSpell(TESObjectBOOK * thisBook); 13 | bool IsRead(TESObjectBOOK * thisBook); 14 | bool IsTakeable(TESObjectBOOK * thisBook); 15 | }; 16 | -------------------------------------------------------------------------------- /skse64/PapyrusCamera.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct StaticFunctionTag; 4 | class VMClassRegistry; 5 | 6 | namespace papyrusCamera 7 | { 8 | void RegisterFuncs(VMClassRegistry* registry); 9 | 10 | SInt32 GetCameraState(StaticFunctionTag * base); 11 | void UpdateThirdPerson(StaticFunctionTag * base); 12 | } 13 | -------------------------------------------------------------------------------- /skse64/PapyrusCell.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TESObjectCELL; 4 | class TESObjectREFR; 5 | class VMClassRegistry; 6 | 7 | namespace papyrusCell 8 | { 9 | void RegisterFuncs(VMClassRegistry* registry); 10 | UInt32 GetNumRefs(TESObjectCELL* thisCell, UInt32 formType); 11 | TESObjectREFR* GetNthRef(TESObjectCELL* thisCell, UInt32 index, UInt32 formType); 12 | } 13 | -------------------------------------------------------------------------------- /skse64/PapyrusClass.cpp: -------------------------------------------------------------------------------- 1 | #include "PapyrusClass.h" 2 | -------------------------------------------------------------------------------- /skse64/PapyrusColorForm.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class BGSColorForm; 4 | struct StaticFunctionTag; 5 | class VMClassRegistry; 6 | 7 | namespace papyrusColorComponent 8 | { 9 | void RegisterFuncs(VMClassRegistry* registry); 10 | 11 | UInt32 GetAlpha(StaticFunctionTag* base, UInt32 argb); 12 | UInt32 GetRed(StaticFunctionTag* base, UInt32 argb); 13 | UInt32 GetGreen(StaticFunctionTag* base, UInt32 argb); 14 | UInt32 GetBlue(StaticFunctionTag* base, UInt32 argb); 15 | 16 | float GetHue(StaticFunctionTag* base, UInt32 argb); 17 | float GetSaturation(StaticFunctionTag* base, UInt32 argb); 18 | float GetValue(StaticFunctionTag* base, UInt32 argb); 19 | 20 | UInt32 SetColor(StaticFunctionTag* base, UInt32 red, UInt32 green, UInt32 blue, UInt32 alpha); 21 | UInt32 SetAlpha(StaticFunctionTag* base, UInt32 argb, UInt32 alpha); 22 | UInt32 SetRed(StaticFunctionTag* base, UInt32 argb, UInt32 red); 23 | UInt32 SetGreen(StaticFunctionTag* base, UInt32 argb, UInt32 green); 24 | UInt32 SetBlue(StaticFunctionTag* base, UInt32 argb, UInt32 blue); 25 | UInt32 SetHue(StaticFunctionTag* base, UInt32 argb, float hue); 26 | UInt32 SetSaturation(StaticFunctionTag* base, UInt32 argb, float sat); 27 | UInt32 SetValue(StaticFunctionTag* base, UInt32 argb, float val); 28 | } 29 | 30 | namespace papyrusColorForm 31 | { 32 | void RegisterFuncs(VMClassRegistry* registry); 33 | 34 | UInt32 GetColor(BGSColorForm* colorForm); 35 | } 36 | -------------------------------------------------------------------------------- /skse64/PapyrusConstructibleObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TESForm; 4 | class BGSConstructibleObject; 5 | class BGSKeyword; 6 | class VMClassRegistry; 7 | 8 | namespace papyrusConstructibleObject 9 | { 10 | void RegisterFuncs(VMClassRegistry* registry); 11 | 12 | TESForm* GetResult(BGSConstructibleObject* recipe); 13 | void SetResult(BGSConstructibleObject* recipe, TESForm* result); 14 | UInt32 GetResultQuantity(BGSConstructibleObject* recipe); 15 | void SetResultQuantity(BGSConstructibleObject* recipe, UInt32 quantity); 16 | UInt32 GetNumIngredients(BGSConstructibleObject* recipe); 17 | TESForm* GetNthIngredient(BGSConstructibleObject* recipe, UInt32 n); 18 | void SetNthIngredient(BGSConstructibleObject* recipe, TESForm* form, UInt32 n); 19 | UInt32 GetNthIngredientQuantity(BGSConstructibleObject* recipe, UInt32 n); 20 | void SetNthIngredientQuantity(BGSConstructibleObject* recipe, UInt32 value, UInt32 n); 21 | BGSKeyword* GetWorkbenchKeyword(BGSConstructibleObject* recipe); 22 | void SetWorkbenchKeyword(BGSConstructibleObject* recipe, BGSKeyword* keyword); 23 | } 24 | -------------------------------------------------------------------------------- /skse64/PapyrusDefaultObjectManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class VMClassRegistry; 4 | class TESForm; 5 | class BGSDefaultObjectManager; 6 | 7 | #include "skse64/GameTypes.h" 8 | 9 | namespace papyrusDefaultObjectManager 10 | { 11 | void RegisterFuncs(VMClassRegistry* registry); 12 | 13 | void SetForm(BGSDefaultObjectManager * objectManager, BSFixedString keySearch, TESForm * form); 14 | TESForm * GetForm(BGSDefaultObjectManager * objectManager, BSFixedString keySearch); 15 | }; 16 | -------------------------------------------------------------------------------- /skse64/PapyrusEnchantment.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class EnchantmentItem; 4 | class MagicItem; 5 | class EffectSetting; 6 | class VMClassRegistry; 7 | 8 | namespace papyrusEnchantment 9 | { 10 | void RegisterFuncs(VMClassRegistry* registry); 11 | 12 | // MagicItem funcs 13 | UInt32 GetNumEffects(EnchantmentItem* thisMagic); 14 | float GetNthEffectMagnitude(EnchantmentItem* thisMagic, UInt32 index); 15 | UInt32 GetNthEffectArea(EnchantmentItem* thisMagic, UInt32 index); 16 | UInt32 GetNthEffectDuration(EnchantmentItem* thisMagic, UInt32 index); 17 | EffectSetting* GetNthEffectMagicEffect(EnchantmentItem* thisMagic, UInt32 index); 18 | //UInt32 GetCostliestEffectIndex(EnchantmentItem* thisMagic); 19 | EnchantmentItem * GetBaseEnchantment(EnchantmentItem* thisMagic); 20 | 21 | void SetNthEffectMagnitude(EnchantmentItem* thisSpell, UInt32 index, float value); 22 | void SetNthEffectArea(EnchantmentItem* thisSpell, UInt32 index, UInt32 value); 23 | void SetNthEffectDuration(EnchantmentItem* thisSpell, UInt32 index, UInt32 value); 24 | }; 25 | -------------------------------------------------------------------------------- /skse64/PapyrusEquipSlot.cpp: -------------------------------------------------------------------------------- 1 | #include "PapyrusEquipSlot.h" 2 | 3 | #include "GameForms.h" 4 | #include "GameObjects.h" 5 | #include "GameRTTI.h" 6 | 7 | namespace papyrusEquipSlot 8 | { 9 | UInt32 GetNumParents(BGSEquipSlot* equipSlot) 10 | { 11 | return (equipSlot) ? equipSlot->parentSlots.count : 0; 12 | } 13 | 14 | BGSEquipSlot* GetNthParent(BGSEquipSlot* equipSlot, UInt32 n) 15 | { 16 | if(equipSlot) { 17 | BGSEquipSlot* nthSlot = NULL; 18 | equipSlot->parentSlots.GetNthItem(n, nthSlot); 19 | if(nthSlot) 20 | return nthSlot; 21 | } 22 | 23 | return NULL; 24 | } 25 | } 26 | 27 | #include "PapyrusVM.h" 28 | #include "PapyrusNativeFunctions.h" 29 | 30 | void papyrusEquipSlot::RegisterFuncs(VMClassRegistry* registry) 31 | { 32 | registry->RegisterForm(BGSEquipSlot::kTypeID, "EquipSlot"); 33 | 34 | registry->RegisterFunction( 35 | new NativeFunction0 ("GetNumParents", "EquipSlot", papyrusEquipSlot::GetNumParents, registry)); 36 | 37 | registry->RegisterFunction( 38 | new NativeFunction1 ("GetNthParent", "EquipSlot", papyrusEquipSlot::GetNthParent, registry)); 39 | } 40 | -------------------------------------------------------------------------------- /skse64/PapyrusEquipSlot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class BGSEquipSlot; 4 | struct StaticFunctionTag; 5 | class VMClassRegistry; 6 | 7 | namespace papyrusEquipSlot 8 | { 9 | void RegisterFuncs(VMClassRegistry* registry); 10 | 11 | UInt32 GetNumParents(BGSEquipSlot* equipSlot); 12 | BGSEquipSlot* GetNthParent(BGSEquipSlot* equipSlot, UInt32 n); 13 | } 14 | -------------------------------------------------------------------------------- /skse64/PapyrusEventFunctor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "skse64/PapyrusVM.h" 6 | #include "skse64/PapyrusArgs.h" 7 | 8 | template 9 | class EventQueueFunctor : public IFunctionArguments 10 | { 11 | static const UInt32 size = sizeof...(T_values); 12 | public: 13 | EventQueueFunctor(BSFixedString & a_eventName, T_values... args) 14 | : m_eventName(a_eventName.data), m_args(args...) {} 15 | 16 | template 17 | void SendEvent(T_Base* base) 18 | { 19 | VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry(); 20 | IObjectHandlePolicy* policy = registry->GetHandlePolicy(); 21 | UInt64 handle = policy->Create(T_Base::kTypeID, base); 22 | 23 | registry->QueueEvent(handle, &m_eventName, this); 24 | } 25 | 26 | virtual bool Copy(Output * dst) 27 | { 28 | dst->Resize(size); 29 | for_each_in_tuple(dst, m_args); 30 | return true; 31 | } 32 | 33 | private: 34 | template 35 | typename std::enable_if::type 36 | for_each_in_tuple(Output * dst, std::tuple & parts) 37 | { 38 | 39 | } 40 | 41 | template 42 | typename std::enable_if::type 43 | for_each_in_tuple(Output * dst, std::tuple & parts) 44 | { 45 | PackValue(dst->Get(I), &std::get(parts), (*g_skyrimVM)->GetClassRegistry()); 46 | for_each_in_tuple(dst, parts); 47 | } 48 | 49 | BSFixedString m_eventName; 50 | std::tuple m_args; 51 | }; 52 | -------------------------------------------------------------------------------- /skse64/PapyrusFaction.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameTypes.h" 4 | 5 | class TESFaction; 6 | class TESObjectREFR; 7 | class BGSListForm; 8 | 9 | class VMClassRegistry; 10 | 11 | namespace papyrusFaction 12 | { 13 | void RegisterFuncs(VMClassRegistry* registry); 14 | 15 | bool OnlyBuysStolenItems(TESFaction* thisFaction); 16 | void SetOnlyBuysStolenItems(TESFaction* thisFaction, bool buystolen); 17 | 18 | UInt32 GetVendorStartHour(TESFaction* thisFaction); 19 | void SetVendorStartHour(TESFaction* thisFaction, UInt32 hour); 20 | 21 | UInt32 GetVendorEndHour(TESFaction* thisFaction); 22 | void SetVendorEndHour(TESFaction* thisFaction, UInt32 hour); 23 | 24 | UInt32 GetVendorRadius(TESFaction* thisFaction); 25 | void SetVendorRadius(TESFaction* thisFaction, UInt32 radius); 26 | 27 | TESObjectREFR * GetMerchantContainer(TESFaction* thisFaction); 28 | void SetMerchantContainer(TESFaction* thisFaction, TESObjectREFR * reference); 29 | 30 | 31 | bool IsNotSellBuy(TESFaction* thisFaction); 32 | void SetNotSellBuy(TESFaction* thisFaction, bool notSellBuy); 33 | 34 | BGSListForm * GetBuySellList(TESFaction* thisFaction); 35 | void SetBuySellList(TESFaction* thisFaction, BGSListForm * vendorList); 36 | }; 37 | -------------------------------------------------------------------------------- /skse64/PapyrusFlora.cpp: -------------------------------------------------------------------------------- 1 | #include "PapyrusFlora.h" 2 | #include "GameObjects.h" 3 | 4 | namespace papyrusFlora 5 | { 6 | TESForm * GetIngredient(TESFlora* thisFlora) 7 | { 8 | return (thisFlora) ? thisFlora->produce.produce : NULL; 9 | } 10 | 11 | void SetIngredient(TESFlora* thisFlora, TESForm* ingredient) 12 | { 13 | if (thisFlora) { 14 | thisFlora->produce.produce = ingredient; 15 | } 16 | } 17 | 18 | BGSSoundDescriptorForm * GetHarvestSound(TESFlora* thisFlora) 19 | { 20 | return (thisFlora) ? thisFlora->produce.harvestSound : NULL; 21 | } 22 | 23 | void SetHarvestSound(TESFlora* thisFlora, BGSSoundDescriptorForm * sound) 24 | { 25 | if (thisFlora) { 26 | thisFlora->produce.harvestSound = sound; 27 | } 28 | } 29 | } 30 | 31 | #include "PapyrusVM.h" 32 | #include "PapyrusNativeFunctions.h" 33 | 34 | void papyrusFlora::RegisterFuncs(VMClassRegistry* registry) 35 | { 36 | registry->RegisterFunction( 37 | new NativeFunction0("GetIngredient", "Flora", papyrusFlora::GetIngredient, registry)); 38 | 39 | registry->RegisterFunction( 40 | new NativeFunction1("SetIngredient", "Flora", papyrusFlora::SetIngredient, registry)); 41 | 42 | registry->RegisterFunction( 43 | new NativeFunction0("GetHarvestSound", "Flora", papyrusFlora::GetHarvestSound, registry)); 44 | 45 | registry->RegisterFunction( 46 | new NativeFunction1("SetHarvestSound", "Flora", papyrusFlora::SetHarvestSound, registry)); 47 | } 48 | -------------------------------------------------------------------------------- /skse64/PapyrusFlora.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class VMClassRegistry; 4 | class BGSSoundDescriptorForm; 5 | class TESFlora; 6 | class TESForm; 7 | 8 | namespace papyrusFlora 9 | { 10 | void RegisterFuncs(VMClassRegistry* registry); 11 | 12 | TESForm * GetIngredient(TESFlora* thisFlora); 13 | void SetIngredient(TESFlora* thisFlora, TESForm* ingredient); 14 | 15 | BGSSoundDescriptorForm * GetHarvestSound(TESFlora* thisFlora); 16 | void SetHarvestSound(TESFlora* thisFlora, BGSSoundDescriptorForm * sound); 17 | }; 18 | -------------------------------------------------------------------------------- /skse64/PapyrusFormList.cpp: -------------------------------------------------------------------------------- 1 | #include "PapyrusFormList.h" 2 | #include "PapyrusArgs.h" 3 | 4 | #include "GameForms.h" 5 | 6 | class FormListArray : public BGSListForm::Visitor 7 | { 8 | public: 9 | FormListArray(VMResultArray * result) : m_result(result) { } 10 | 11 | virtual bool Accept(TESForm * form) 12 | { 13 | m_result->push_back(form); 14 | return false; 15 | } 16 | 17 | private: 18 | VMResultArray * m_result; 19 | }; 20 | 21 | namespace papyrusFormList 22 | { 23 | VMResultArray ToArray(BGSListForm * list) 24 | { 25 | VMResultArray result; 26 | if(!list) 27 | return result; 28 | 29 | FormListArray visitor(&result); 30 | list->Visit(visitor); 31 | return result; 32 | } 33 | 34 | void AddForms(BGSListForm * list, VMArray forms) 35 | { 36 | if(list) 37 | { 38 | for(UInt32 i = 0; i < forms.Length(); i++) 39 | { 40 | TESForm * form = NULL; 41 | forms.Get(&form, i); 42 | if(form) 43 | CALL_MEMBER_FN(list, AddFormToList)(form); 44 | } 45 | } 46 | } 47 | } 48 | 49 | #include "PapyrusVM.h" 50 | #include "PapyrusNativeFunctions.h" 51 | 52 | void papyrusFormList::RegisterFuncs(VMClassRegistry* registry) 53 | { 54 | registry->RegisterFunction( 55 | new NativeFunction0 > ("ToArray", "FormList", papyrusFormList::ToArray, registry)); 56 | 57 | registry->RegisterFunction( 58 | new NativeFunction1 > ("AddForms", "FormList", papyrusFormList::AddForms, registry)); 59 | 60 | registry->SetFunctionFlags("FormList", "ToArray", VMClassRegistry::kFunctionFlag_NoWait); 61 | registry->SetFunctionFlags("FormList", "AddForms", VMClassRegistry::kFunctionFlag_NoWait); 62 | } 63 | -------------------------------------------------------------------------------- /skse64/PapyrusFormList.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64/GameTypes.h" 4 | #include "skse64/PapyrusArgs.h" 5 | 6 | class BGSListForm; 7 | class VMClassRegistry; 8 | 9 | namespace papyrusFormList 10 | { 11 | void RegisterFuncs(VMClassRegistry* registry); 12 | 13 | VMResultArray ToArray(BGSListForm * list); 14 | } -------------------------------------------------------------------------------- /skse64/PapyrusGameData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class VMClassRegistry; 4 | struct StaticFunctionTag; 5 | 6 | #include "skse64/GameTypes.h" 7 | 8 | namespace papyrusGameData 9 | { 10 | void RegisterFuncs(VMClassRegistry* registry); 11 | } -------------------------------------------------------------------------------- /skse64/PapyrusHeadPart.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameTypes.h" 4 | 5 | class BGSHeadPart; 6 | class BGSListForm; 7 | class VMClassRegistry; 8 | struct StaticFunctionTag; 9 | 10 | namespace papyrusHeadPart 11 | { 12 | void RegisterFuncs(VMClassRegistry* registry); 13 | 14 | BGSHeadPart* GetHeadPart(StaticFunctionTag*, BSFixedString editorID); 15 | UInt32 GetType(BGSHeadPart* thisPart); 16 | UInt32 GetNumExtraParts(BGSHeadPart* thisPart); 17 | BGSHeadPart* GetNthExtraPart(BGSHeadPart* thisPart, UInt32 n); 18 | bool HasExtraPart(BGSHeadPart* thisPart, BGSHeadPart* extraPart); 19 | UInt32 GetIndexOfExtraPart(BGSHeadPart* thisPart, BGSHeadPart* extraPart); 20 | BGSListForm* GetValidRaces(BGSHeadPart* thisPart); 21 | void SetValidRaces(BGSHeadPart* thisPart, BGSListForm* raceList); 22 | }; 23 | -------------------------------------------------------------------------------- /skse64/PapyrusIngredient.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IngredientItem; 4 | class MagicItem; 5 | class EffectSetting; 6 | class VMClassRegistry; 7 | 8 | namespace papyrusIngredient 9 | { 10 | void RegisterFuncs(VMClassRegistry* registry); 11 | 12 | // MagicItem funcs 13 | UInt32 GetNumEffects(IngredientItem* thisMagic); 14 | float GetNthEffectMagnitude(IngredientItem* thisMagic, UInt32 index); 15 | UInt32 GetNthEffectArea(IngredientItem* thisMagic, UInt32 index); 16 | UInt32 GetNthEffectDuration(IngredientItem* thisMagic, UInt32 index); 17 | EffectSetting* GetNthEffectMagicEffect(IngredientItem* thisMagic, UInt32 index); 18 | UInt32 GetCostliestEffectIndex(IngredientItem* thisMagic); 19 | bool GetIsNthEffectKnown(IngredientItem* thisMagic, UInt32 index); 20 | 21 | void SetNthEffectMagnitude(IngredientItem* thisMagic, UInt32 index, float value); 22 | void SetNthEffectArea(IngredientItem* thisMagic, UInt32 index, UInt32 value); 23 | void SetNthEffectDuration(IngredientItem* thisMagic, UInt32 index, UInt32 value); 24 | }; 25 | -------------------------------------------------------------------------------- /skse64/PapyrusInput.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameTypes.h" 4 | 5 | struct StaticFunctionTag; 6 | 7 | class VMClassRegistry; 8 | 9 | namespace papyrusInput 10 | { 11 | void RegisterFuncs(VMClassRegistry* registry); 12 | 13 | bool IsKeyPressed(StaticFunctionTag* thisInput, UInt32 dxKeycode); 14 | 15 | void TapKey(StaticFunctionTag* thisInput, UInt32 dxKeycode); 16 | 17 | void HoldKey(StaticFunctionTag* thisInput, UInt32 dxKeycode); 18 | void ReleaseKey(StaticFunctionTag* thisInput, UInt32 dxKeycode); 19 | bool IsKeyHeld(StaticFunctionTag* thisInput, UInt32 dxKeycode); 20 | 21 | void DisableKey(StaticFunctionTag* thisInput, UInt32 dxKeyode); 22 | void EnableKey(StaticFunctionTag* thisInput, UInt32 dxKeycode); 23 | bool IsKeyDisabled(StaticFunctionTag* thisInput, UInt32 dxKeycode); 24 | 25 | UInt32 GetNumKeysPressed(StaticFunctionTag* thisInput); 26 | SInt32 GetNthKeyPressed(StaticFunctionTag* thisInput, UInt32 which); 27 | 28 | //UInt32 GetNumMouseButtonsPressed(Input* thisInput); 29 | //UInt32 GetMouseButtonPressed(Input* thisInput, UInt32 which); 30 | 31 | //void DisableMouse(Input* thisInput); 32 | //void EnableMouse(Input* thisInput); 33 | //bool IsMouseDisabled(Input* thisInput); 34 | 35 | SInt32 GetMappedKey(StaticFunctionTag* thisInput, BSFixedString name, UInt32 deviceType); 36 | BSFixedString GetMappedControl(StaticFunctionTag* thisInput, SInt32 keyCode); 37 | } 38 | -------------------------------------------------------------------------------- /skse64/PapyrusInterfaces.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/PapyrusInterfaces.h" 2 | 3 | // B085C9577FC3BACF4719EF79E3613E2327537C10+4F 4 | RelocPtr g_objectHandlePolicy(0x03329D50); 5 | -------------------------------------------------------------------------------- /skse64/PapyrusInterfaces.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64_common/Relocation.h" 4 | #include "skse64_common/Utilities.h" 5 | 6 | class VMIdentifier; 7 | 8 | class IObjectHandlePolicy 9 | { 10 | public: 11 | IObjectHandlePolicy(); 12 | virtual ~IObjectHandlePolicy(); 13 | 14 | // this code heavily uses 64-bit values, so many of these arguments may be paired 64-bit (eax/edx) 15 | virtual bool IsType(UInt32 typeID, UInt64 handle); 16 | virtual bool Unk_02(UInt64 handle); 17 | virtual UInt64 GetInvalidHandle(void); 18 | virtual UInt64 Create(UInt32 typeID, void * srcData); 19 | virtual bool IsREFR(UInt64 handle); // return IsType(TESObjectREFR::kTypeID, handle); 20 | virtual UInt64 Unk_06(UInt32 unk0, UInt32 unk1); 21 | virtual UInt64 Unk_07(UInt32 unk0, UInt32 unk1); 22 | virtual void * Resolve(UInt32 typeID, UInt64 handle); 23 | virtual void AddRef(UInt64 handle); 24 | virtual void Release(UInt64 handle); 25 | virtual void GetName(UInt64 handle, void * outStr); 26 | 27 | // void ** _vtbl; // 00 28 | }; 29 | 30 | extern RelocPtr g_objectHandlePolicy; 31 | 32 | class ObjectBindPolicy 33 | { 34 | public: 35 | ObjectBindPolicy(); 36 | virtual ~ObjectBindPolicy(); 37 | 38 | virtual void Unk_01(UInt64 unk); 39 | virtual void Unk_02(UInt64 unk); 40 | virtual void Unk_03(UInt64 unk); 41 | virtual void Unk_04(void); 42 | virtual UInt32 Unk_05(UInt32 unk0, UInt32 unk1); 43 | virtual void Unk_06(UInt32 unk0, UInt32 unk1, UInt32 unk2, UInt32 unk3); 44 | virtual void Unk_07(UInt32 unk0, UInt32 unk1, UInt32 unk2, UInt32 unk3, UInt32 unk4, UInt32 unk5); 45 | virtual bool Unk_08(void); 46 | virtual void Unk_09(UInt32 unk0, UInt32 unk1, UInt32 unk2, UInt32 unk3); 47 | virtual void Unk_0A(UInt32 unk0, UInt32 unk1, UInt32 unk2, UInt32 unk3); 48 | virtual void Unk_0B(UInt32 unk0, UInt32 unk1, UInt32 unk2, UInt32 unk3, UInt32 unk4); 49 | virtual void Unk_0C(UInt32 unk0, UInt32 unk1, UInt32 unk2, UInt32 unk3, UInt32 unk4); 50 | 51 | // void ** _vtbl; // 00 52 | 53 | MEMBER_FN_PREFIX(ObjectBindPolicy); 54 | DEFINE_MEMBER_FN(BindObject, void, 0x0141DB30, VMIdentifier ** identifier, UInt64 handle); 55 | }; 56 | -------------------------------------------------------------------------------- /skse64/PapyrusKeyword.cpp: -------------------------------------------------------------------------------- 1 | #include "PapyrusKeyword.h" 2 | 3 | #include "GameForms.h" 4 | #include "GameObjects.h" 5 | #include "GameData.h" 6 | 7 | #include "common/ICriticalSection.h" 8 | 9 | //extern UInt32 g_invalidateKeywordCache; 10 | 11 | namespace papyrusKeyword 12 | { 13 | typedef std::map KeywordCache; 14 | 15 | static ICriticalSection s_keywordCacheLock; 16 | static KeywordCache s_keywordCache; 17 | 18 | BGSKeyword* GetKeyword(StaticFunctionTag*, BSFixedString keyword) 19 | { 20 | s_keywordCacheLock.Enter(); 21 | 22 | //if(g_invalidateKeywordCache == 1) { 23 | //s_keywordCache.clear(); 24 | //g_invalidateKeywordCache = 0; 25 | //} 26 | 27 | if (s_keywordCache.empty()) { 28 | DataHandler* pDataHandler = DataHandler::GetSingleton(); 29 | tArray& keywords = pDataHandler->keywords; 30 | for (UInt32 n = 0; n < keywords.count; n++) { 31 | BGSKeyword* pKeyword = NULL; 32 | keywords.GetNthItem(n, pKeyword); 33 | if (pKeyword) { 34 | s_keywordCache.insert(KeywordCache::value_type(BSFixedString(pKeyword->keyword.Get()), pKeyword)); 35 | } 36 | } 37 | } 38 | 39 | s_keywordCacheLock.Leave(); 40 | 41 | KeywordCache::iterator it = s_keywordCache.find(keyword); 42 | BGSKeyword* pKeyword = (it != s_keywordCache.end()) ? it->second : NULL; 43 | return pKeyword; 44 | } 45 | 46 | 47 | BSFixedString GetString(BGSKeyword* thisKeyword) 48 | { 49 | return (thisKeyword) ? thisKeyword->keyword.Get() : NULL; 50 | } 51 | } 52 | 53 | #include "PapyrusVM.h" 54 | #include "PapyrusNativeFunctions.h" 55 | 56 | void papyrusKeyword::RegisterFuncs(VMClassRegistry* registry) 57 | { 58 | registry->RegisterFunction( 59 | new NativeFunction0 ("GetString", "Keyword", papyrusKeyword::GetString, registry)); 60 | 61 | registry->RegisterFunction( 62 | new NativeFunction1 ("GetKeyword", "Keyword", papyrusKeyword::GetKeyword, registry)); 63 | 64 | } 65 | -------------------------------------------------------------------------------- /skse64/PapyrusKeyword.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameTypes.h" 4 | 5 | class BGSKeyword; 6 | struct StaticFunctionTag; 7 | class VMClassRegistry; 8 | 9 | namespace papyrusKeyword 10 | { 11 | void RegisterFuncs(VMClassRegistry* registry); 12 | 13 | BGSKeyword* GetKeyword(StaticFunctionTag*, BSFixedString keyword); 14 | BSFixedString GetString(BGSKeyword* thisKeyword); 15 | } 16 | -------------------------------------------------------------------------------- /skse64/PapyrusLeveledActor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class VMClassRegistry; 4 | class TESLevCharacter; 5 | class TESGlobal; 6 | class TESForm; 7 | 8 | namespace papyrusLeveledActor 9 | { 10 | void RegisterFuncs(VMClassRegistry* registry); 11 | 12 | UInt32 GetChanceNone(TESLevCharacter * leveledItem); 13 | void SetChanceNone(TESLevCharacter * leveledItem, UInt32 chanceNone); 14 | 15 | UInt32 GetNumForms(TESLevCharacter * leveledItem); 16 | TESForm * GetNthForm(TESLevCharacter * leveledItem, UInt32 n); 17 | UInt32 GetNthLevel(TESLevCharacter * leveledItem, UInt32 n); 18 | void SetNthLevel(TESLevCharacter * leveledItem, UInt32 n, UInt32 level); 19 | }; -------------------------------------------------------------------------------- /skse64/PapyrusLeveledItem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class VMClassRegistry; 4 | class TESLeveledList; 5 | class TESLevItem; 6 | class TESGlobal; 7 | class TESForm; 8 | 9 | namespace papyrusLeveledItem 10 | { 11 | void RegisterFuncs(VMClassRegistry* registry); 12 | 13 | UInt32 GetChanceNone(TESLevItem * leveledItem); 14 | void SetChanceNone(TESLevItem * leveledItem, UInt32 chanceNone); 15 | 16 | TESGlobal * GetChanceGlobal(TESLevItem * leveledItem); 17 | void SetChanceGlobal(TESLevItem * leveledItem, TESGlobal * globalVar); 18 | 19 | UInt32 GetNumForms(TESLevItem * leveledItem); 20 | TESForm * GetNthForm(TESLevItem * leveledItem, UInt32 n); 21 | UInt32 GetNthLevel(TESLevItem * leveledItem, UInt32 n); 22 | void SetNthLevel(TESLevItem * leveledItem, UInt32 n, UInt32 level); 23 | UInt32 GetNthCount(TESLevItem * leveledItem, UInt32 n); 24 | void SetNthCount(TESLevItem * leveledItem, UInt32 n, UInt32 count); 25 | }; 26 | 27 | namespace leveledItemUtils { 28 | UInt32 GetChanceNone(TESLeveledList * leveledList); 29 | void SetChanceNone(TESLeveledList * leveledList, UInt32 chanceNone); 30 | TESGlobal * GetChanceGlobal(TESLeveledList * leveledList); 31 | void SetChanceGlobal(TESLeveledList * leveledList, TESGlobal * globalVar); 32 | UInt32 GetNumForms(TESLeveledList * leveledList); 33 | TESForm * GetNthForm(TESLeveledList * leveledList, UInt32 n); 34 | UInt32 GetNthLevel(TESLeveledList * leveledList, UInt32 n); 35 | void SetNthLevel(TESLeveledList * leveledList, UInt32 n, UInt32 level); 36 | UInt32 GetNthCount(TESLeveledList * leveledList, UInt32 n); 37 | void SetNthCount(TESLeveledList * leveledList, UInt32 n, UInt32 count); 38 | } 39 | -------------------------------------------------------------------------------- /skse64/PapyrusLeveledSpell.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class VMClassRegistry; 4 | class TESLevSpell; 5 | class TESGlobal; 6 | class TESForm; 7 | 8 | namespace papyrusLeveledSpell 9 | { 10 | void RegisterFuncs(VMClassRegistry* registry); 11 | 12 | UInt32 GetChanceNone(TESLevSpell * leveledItem); 13 | void SetChanceNone(TESLevSpell * leveledItem, UInt32 chanceNone); 14 | 15 | UInt32 GetNumForms(TESLevSpell * leveledItem); 16 | TESForm * GetNthForm(TESLevSpell * leveledItem, UInt32 n); 17 | UInt32 GetNthLevel(TESLevSpell * leveledItem, UInt32 n); 18 | void SetNthLevel(TESLevSpell * leveledItem, UInt32 n, UInt32 level); 19 | }; -------------------------------------------------------------------------------- /skse64/PapyrusLocation.cpp: -------------------------------------------------------------------------------- 1 | #include "PapyrusLocation.h" 2 | 3 | #include "GameForms.h" 4 | 5 | namespace papyrusLocation 6 | { 7 | BGSLocation * GetParent(BGSLocation* thisLocation) 8 | { 9 | return thisLocation ? thisLocation->parentLoc : NULL; 10 | } 11 | } 12 | 13 | #include "PapyrusVM.h" 14 | #include "PapyrusNativeFunctions.h" 15 | 16 | void papyrusLocation::RegisterFuncs(VMClassRegistry* registry) 17 | { 18 | registry->RegisterFunction( 19 | new NativeFunction0("GetParent", "Location", papyrusLocation::GetParent, registry)); 20 | } -------------------------------------------------------------------------------- /skse64/PapyrusLocation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class VMClassRegistry; 4 | class BGSLocation; 5 | 6 | namespace papyrusLocation 7 | { 8 | BGSLocation * GetParent(BGSLocation* thisLocation); 9 | void RegisterFuncs(VMClassRegistry* registry); 10 | }; -------------------------------------------------------------------------------- /skse64/PapyrusMath.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct StaticFunctionTag; 4 | class VMClassRegistry; 5 | 6 | namespace papyrusMath 7 | { 8 | void RegisterFuncs(VMClassRegistry* registry); 9 | 10 | UInt32 LeftShift(StaticFunctionTag* base, UInt32 value, UInt32 shiftBy); 11 | UInt32 RightShift(StaticFunctionTag* base, UInt32 value, UInt32 shiftBy); 12 | UInt32 LogicalAnd(StaticFunctionTag* base, UInt32 arg1, UInt32 arg2); 13 | UInt32 LogicalOr(StaticFunctionTag* base, UInt32 arg1, UInt32 arg2); 14 | UInt32 LogicalXor(StaticFunctionTag* base, UInt32 arg1, UInt32 arg2); 15 | UInt32 LogicalNot(StaticFunctionTag* base, UInt32 arg1); 16 | float Log(StaticFunctionTag* base, float arg1); 17 | } 18 | -------------------------------------------------------------------------------- /skse64/PapyrusMisc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TESSoulGem; 4 | class BGSApparatus; 5 | class BGSOutfit; 6 | class TESForm; 7 | class VMClassRegistry; 8 | class BGSKeyword; 9 | 10 | #include "GameTypes.h" 11 | 12 | namespace papyrusSoulGem 13 | { 14 | void RegisterFuncs(VMClassRegistry* registry); 15 | UInt32 GetSoulSize(TESSoulGem* thisGem); 16 | UInt32 GetGemSize(TESSoulGem* thisGem); 17 | } 18 | 19 | namespace papyrusApparatus 20 | { 21 | void RegisterFuncs(VMClassRegistry* registry); 22 | UInt32 GetQuality(BGSApparatus* thisApparatus); 23 | void SetQuality(BGSApparatus* thisApparatus, UInt32 nuQuality); 24 | } 25 | 26 | namespace papyrusOutfit 27 | { 28 | void RegisterFuncs(VMClassRegistry* registry); 29 | 30 | UInt32 GetNumParts(BGSOutfit* thisOutfit); 31 | TESForm* GetNthPart(BGSOutfit* thisOutfit, UInt32 n); 32 | } 33 | -------------------------------------------------------------------------------- /skse64/PapyrusModEvent.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameTypes.h" 4 | 5 | struct StaticFunctionTag; 6 | class VMClassRegistry; 7 | 8 | namespace papyrusModEvent 9 | { 10 | SInt32 Create(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, BSFixedString eventName); 11 | bool Send(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle); 12 | void Release(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle); 13 | 14 | template 15 | void Push(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle, T arg); 16 | 17 | void RegisterFuncs(VMClassRegistry* registry); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /skse64/PapyrusNativeFunctionDef.inl: -------------------------------------------------------------------------------- 1 | // Native 2 | 3 | #define CLASS_NAME __MACRO_JOIN__(NativeFunction, NUM_PARAMS) 4 | #define LATENT_SPEC 0 5 | 6 | #define VOID_SPEC 0 7 | #include "skse64/PapyrusNativeFunctionDef_Base.inl" 8 | 9 | #define VOID_SPEC 1 10 | #include "skse64/PapyrusNativeFunctionDef_Base.inl" 11 | 12 | #undef LATENT_SPEC 13 | #undef CLASS_NAME 14 | 15 | // Latent native 16 | 17 | #define CLASS_NAME __MACRO_JOIN__(LatentNativeFunction, NUM_PARAMS) 18 | #define LATENT_SPEC 1 19 | 20 | #define VOID_SPEC 0 21 | #include "skse64/PapyrusNativeFunctionDef_Base.inl" 22 | 23 | #define VOID_SPEC 1 24 | #include "skse64/PapyrusNativeFunctionDef_Base.inl" 25 | 26 | #undef LATENT_SPEC 27 | #undef CLASS_NAME 28 | 29 | #undef NUM_PARAMS 30 | -------------------------------------------------------------------------------- /skse64/PapyrusNativeFunctions.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/PapyrusNativeFunctions.h" 2 | 3 | void NativeFunction::DebugRunHook(VMValue * baseValue, VMClassRegistry * registry, UInt32 arg2, VMValue * resultValue, VMState * state) 4 | { 5 | // 6 | } 7 | -------------------------------------------------------------------------------- /skse64/PapyrusNetImmerse.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameTypes.h" 4 | 5 | class VMClassRegistry; 6 | struct StaticFunctionTag; 7 | class TESObjectREFR; 8 | class TESForm; 9 | class BGSTextureSet; 10 | 11 | namespace papyrusNetImmerse 12 | { 13 | void RegisterFuncs(VMClassRegistry* registry); 14 | 15 | bool HasNode(StaticFunctionTag * base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson); 16 | float GetNodePositionX(StaticFunctionTag * base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson); 17 | float GetNodePositionY(StaticFunctionTag * base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson); 18 | float GetNodePositionZ(StaticFunctionTag * base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson); 19 | float GetNodeScale(StaticFunctionTag * base, TESObjectREFR * obj, BSFixedString nodeName, bool firstPerson); 20 | void SetNodeScale(StaticFunctionTag * base, TESObjectREFR * obj, BSFixedString nodeName, float value, bool firstPerson); 21 | void SetNodeTextureSet(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, BGSTextureSet * textureSet, bool firstPerson); 22 | } 23 | -------------------------------------------------------------------------------- /skse64/PapyrusObjectReference.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameTypes.h" 4 | #include "PapyrusArgs.h" 5 | 6 | class TESObjectREFR; 7 | class TESForm; 8 | class EnchantmentItem; 9 | class VMClassRegistry; 10 | class EffectSetting; 11 | class BGSListForm; 12 | 13 | namespace papyrusObjectReference 14 | { 15 | void RegisterFuncs(VMClassRegistry* registry); 16 | UInt32 GetNumItems(TESObjectREFR* pContainerRef); 17 | TESForm* GetNthForm(TESObjectREFR* pContainerRef, UInt32 n); 18 | float GetTotalItemWeight(TESObjectREFR* pContainerRef); 19 | float GetTotalArmorWeight(TESObjectREFR* pContainerRef); 20 | 21 | void SetItemHealthPercent(TESObjectREFR* object, float value); 22 | float GetItemCharge(TESObjectREFR* object); 23 | float GetItemMaxCharge(TESObjectREFR* object); 24 | void SetItemCharge(TESObjectREFR* object, float value); 25 | EnchantmentItem * GetEnchantment(TESObjectREFR* object); 26 | 27 | void CreateEnchantment(TESObjectREFR* object, float maxCharge, VMArray effects, VMArray magnitudes, VMArray areas, VMArray durations); 28 | void SetEnchantment(TESObjectREFR* object, EnchantmentItem * form, float maxCharge); 29 | 30 | void ResetInventory(TESObjectREFR * obj); 31 | bool IsOffLimits(TESObjectREFR * obj); 32 | BSFixedString GetDisplayName(TESObjectREFR* object); 33 | bool SetDisplayName(TESObjectREFR* object, BSFixedString value, bool force); 34 | TESObjectREFR * GetEnableParent(TESObjectREFR* object); 35 | 36 | bool IsHarvested(TESObjectREFR* pProduceRef); 37 | 38 | bool HasNiNode(TESObjectREFR * obj, BSFixedString nodeName); 39 | float GetNiNodePositionX(TESObjectREFR * obj, BSFixedString nodeName); 40 | float GetNiNodePositionY(TESObjectREFR * obj, BSFixedString nodeName); 41 | float GetNiNodePositionZ(TESObjectREFR * obj, BSFixedString nodeName); 42 | float GetNiNodeScale(TESObjectREFR * obj, BSFixedString nodeName); 43 | void SetNiNodeScale(TESObjectREFR * obj, BSFixedString nodeName, float value); 44 | 45 | void GetAllForms(TESObjectREFR* pContainerRef, BGSListForm * list); 46 | } 47 | -------------------------------------------------------------------------------- /skse64/PapyrusPerk.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class SpellItem; 4 | class TESQuest; 5 | class TESLevItem; 6 | class BGSPerk; 7 | class VMClassRegistry; 8 | 9 | #include "GameTypes.h" 10 | 11 | namespace papyrusPerk 12 | { 13 | void RegisterFuncs(VMClassRegistry* registry); 14 | 15 | BGSPerk * GetNextPerk(BGSPerk * perk); 16 | UInt32 GetNumEntries(BGSPerk * perk); 17 | UInt32 GetNthEntryRank(BGSPerk * perk, UInt32 n); 18 | UInt32 GetNthEntryPriority(BGSPerk * perk, UInt32 n); 19 | TESQuest * GetNthEntryQuest(BGSPerk * perk, UInt32 n); 20 | UInt32 GetNthEntryStage(BGSPerk * perk, UInt32 n); 21 | SpellItem * GetNthEntrySpell(BGSPerk * perk, UInt32 n); 22 | TESLevItem * GetNthEntryLeveledList(BGSPerk * perk, UInt32 n); 23 | BSFixedString GetNthEntryText(BGSPerk * perk, UInt32 n); 24 | float GetNthEntryValue(BGSPerk * perk, UInt32 n, UInt32 i); 25 | 26 | bool SetNthEntryRank(BGSPerk * perk, UInt32 n, UInt32 value); 27 | bool SetNthEntryPriority(BGSPerk * perk, UInt32 n, UInt32 value); 28 | bool SetNthEntryQuest(BGSPerk * perk, UInt32 n, TESQuest * quest); 29 | bool SetNthEntryStage(BGSPerk * perk, UInt32 n, UInt32 stage); 30 | bool SetNthEntrySpell(BGSPerk * perk, UInt32 n, SpellItem * spell); 31 | bool SetNthEntryLeveledList(BGSPerk * perk, UInt32 n, TESLevItem * leveledList); 32 | bool SetNthEntryText(BGSPerk * perk, UInt32 n, BSFixedString str); 33 | bool SetNthEntryValue(BGSPerk * perk, UInt32 n, UInt32 i, float value); 34 | }; 35 | -------------------------------------------------------------------------------- /skse64/PapyrusPotion.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class AlchemyItem; 4 | class BGSPerk; 5 | class EffectSetting; 6 | class BGSSoundDescriptorForm; 7 | class VMClassRegistry; 8 | 9 | namespace papyrusPotion 10 | { 11 | void RegisterFuncs(VMClassRegistry* registry); 12 | 13 | bool IsFood(AlchemyItem* thisPotion); 14 | bool IsPoison(AlchemyItem* thisPotion); 15 | UInt32 GetNumEffects(AlchemyItem* thisMagic); 16 | float GetNthEffectMagnitude(AlchemyItem* thisMagic, UInt32 index); 17 | UInt32 GetNthEffectArea(AlchemyItem* thisMagic, UInt32 index); 18 | UInt32 GetNthEffectDuration(AlchemyItem* thisMagic, UInt32 index); 19 | EffectSetting* GetNthEffectMagicEffect(AlchemyItem* thisMagic, UInt32 index); 20 | UInt32 GetCostliestEffectIndex(AlchemyItem* thisMagic); 21 | BGSSoundDescriptorForm* GetUseSound(AlchemyItem* thisPotion); 22 | 23 | void SetNthEffectMagnitude(AlchemyItem* thisMagic, UInt32 index, float value); 24 | void SetNthEffectArea(AlchemyItem* thisMagic, UInt32 index, UInt32 value); 25 | void SetNthEffectDuration(AlchemyItem* thisMagic, UInt32 index, UInt32 value); 26 | }; 27 | -------------------------------------------------------------------------------- /skse64/PapyrusQuest.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameTypes.h" 4 | 5 | class TESQuest; 6 | class BGSBaseAlias; 7 | class VMClassRegistry; 8 | struct StaticFunctionTag; 9 | 10 | namespace papyrusQuest 11 | { 12 | void RegisterFuncs(VMClassRegistry* registry); 13 | 14 | TESQuest* GetQuest(StaticFunctionTag* thisInput, BSFixedString editorID); 15 | 16 | BSFixedString GetId(TESQuest* thisQuest); 17 | UInt32 GetPriority(TESQuest* thisQuest); 18 | UInt32 GetNumAliases(TESQuest* thisQuest); 19 | BGSBaseAlias* GetNthAlias(TESQuest* thisQuest, UInt32 n); 20 | BGSBaseAlias* GetAliasByName(TESQuest* thisQuest, BSFixedString s); 21 | } 22 | -------------------------------------------------------------------------------- /skse64/PapyrusRace.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TESRace; 4 | class SpellItem; 5 | class BGSVoiceType; 6 | class VMClassRegistry; 7 | struct StaticFunctionTag; 8 | class TESObjectARMO; 9 | 10 | namespace papyrusRace 11 | { 12 | void RegisterFuncs(VMClassRegistry* registry); 13 | 14 | UInt32 GetSpellCount(TESRace* thisRace); 15 | SpellItem* GetNthSpell(TESRace* thisRace, UInt32 n); 16 | 17 | bool IsRaceFlagSet(TESRace* thisRace, UInt32 flag); 18 | void SetRaceFlag(TESRace* thisRace, UInt32 flag); 19 | void ClearRaceFlag(TESRace* thisRace, UInt32 flag); 20 | 21 | UInt32 GetNumPlayableRaces(StaticFunctionTag * base); 22 | TESRace * GetNthPlayableRace(StaticFunctionTag * base, UInt32 n); 23 | 24 | BGSVoiceType* GetDefaultVoiceType(TESRace* thisRace, bool female); 25 | void SetDefaultVoiceType(TESRace* thisRace, bool female, BGSVoiceType* voiceType); 26 | 27 | TESObjectARMO * GetSkin(TESRace* thisRace); 28 | void SetSkin(TESRace* thisRace, TESObjectARMO * skin); 29 | } -------------------------------------------------------------------------------- /skse64/PapyrusReferenceAlias.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameTypes.h" 4 | 5 | class BGSRefAlias; 6 | class TESObjectREFR; 7 | class VMClassRegistry; 8 | 9 | namespace papyrusReferenceAlias 10 | { 11 | void RegisterFuncs(VMClassRegistry* registry); 12 | 13 | bool ForceRefToWornItem(BGSRefAlias * alias, TESObjectREFR * reference, UInt32 mask); 14 | } 15 | -------------------------------------------------------------------------------- /skse64/PapyrusSKSE.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class VMClassRegistry; 4 | struct StaticFunctionTag; 5 | 6 | #include "skse64/GameTypes.h" 7 | 8 | namespace papyrusSKSE 9 | { 10 | void RegisterFuncs(VMClassRegistry* registry); 11 | 12 | UInt32 GetVersion(StaticFunctionTag* base); 13 | UInt32 GetVersionMinor(StaticFunctionTag* base); 14 | UInt32 GetVersionBeta(StaticFunctionTag* base); 15 | UInt32 GetVersionRelease(StaticFunctionTag* base); 16 | } 17 | -------------------------------------------------------------------------------- /skse64/PapyrusScroll.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class ScrollItem; 4 | class BGSPerk; 5 | class EffectSetting; 6 | class VMClassRegistry; 7 | class BGSEquipSlot; 8 | 9 | namespace papyrusScroll 10 | { 11 | void RegisterFuncs(VMClassRegistry* registry); 12 | 13 | float GetCastTime(ScrollItem* thisSpell); 14 | BGSPerk* GetPerk(ScrollItem* thisSpell); 15 | 16 | UInt32 GetNumEffects(ScrollItem* thisMagic); 17 | float GetNthEffectMagnitude(ScrollItem* thisMagic, UInt32 index); 18 | UInt32 GetNthEffectArea(ScrollItem* thisMagic, UInt32 index); 19 | UInt32 GetNthEffectDuration(ScrollItem* thisMagic, UInt32 index); 20 | EffectSetting* GetNthEffectMagicEffect(ScrollItem* thisMagic, UInt32 index); 21 | UInt32 GetCostliestEffectIndex(ScrollItem* thisMagic); 22 | 23 | void SetNthEffectMagnitude(ScrollItem* thisMagic, UInt32 index, float value); 24 | void SetNthEffectArea(ScrollItem* thisMagic, UInt32 index, UInt32 value); 25 | void SetNthEffectDuration(ScrollItem* thisMagic, UInt32 index, UInt32 value); 26 | 27 | BGSEquipSlot * GetEquipType(ScrollItem* thisMagic); 28 | void SetEquipType(ScrollItem* thisMagic, BGSEquipSlot * slot); 29 | }; 30 | -------------------------------------------------------------------------------- /skse64/PapyrusShout.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TESShout; 4 | class SpellItem; 5 | class TESWordOfPower; 6 | class VMClassRegistry; 7 | 8 | namespace papyrusShout 9 | { 10 | void RegisterFuncs(VMClassRegistry* registry); 11 | 12 | TESWordOfPower * GetNthWordOfPower(TESShout * thisShout, UInt32 n); 13 | SpellItem * GetNthSpell(TESShout * thisShout, UInt32 n); 14 | float GetNthRecoveryTime(TESShout * thisShout, UInt32 n); 15 | 16 | void SetNthWordOfPower(TESShout * thisShout, UInt32 n, TESWordOfPower * woop); 17 | void SetNthSpell(TESShout * thisShout, UInt32 n, SpellItem * spell); 18 | void SetNthRecoveryTime(TESShout * thisShout, UInt32 n, float time); 19 | }; 20 | -------------------------------------------------------------------------------- /skse64/PapyrusSound.cpp: -------------------------------------------------------------------------------- 1 | #include "PapyrusSound.h" 2 | 3 | #include "GameFormComponents.h" 4 | #include "GameForms.h" 5 | #include "GameObjects.h" 6 | 7 | namespace papyrusSound 8 | { 9 | BGSSoundDescriptorForm * GetDescriptor(TESSound* thisSound) 10 | { 11 | return (thisSound) ? thisSound->descriptor : NULL; 12 | } 13 | } 14 | 15 | #include "PapyrusVM.h" 16 | #include "PapyrusNativeFunctions.h" 17 | 18 | void papyrusSound::RegisterFuncs(VMClassRegistry* registry) 19 | { 20 | registry->RegisterFunction( 21 | new NativeFunction0("GetDescriptor", "Sound", papyrusSound::GetDescriptor, registry)); 22 | } -------------------------------------------------------------------------------- /skse64/PapyrusSound.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class VMClassRegistry; 4 | class TESSound; 5 | class BGSSoundDescriptorForm; 6 | 7 | namespace papyrusSound 8 | { 9 | BGSSoundDescriptorForm * GetDescriptor(TESSound* thisSound); 10 | void RegisterFuncs(VMClassRegistry* registry); 11 | }; -------------------------------------------------------------------------------- /skse64/PapyrusSoundDescriptor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class VMClassRegistry; 4 | class BGSSoundDescriptorForm; 5 | 6 | namespace papyrusSoundDescriptor 7 | { 8 | float GetDecibelAttenuation(BGSSoundDescriptorForm* thisDescriptor); 9 | void SetDecibelAttenuation(BGSSoundDescriptorForm* thisDescriptor, float dbAttenuation); 10 | 11 | UInt32 GetDecibelVariance(BGSSoundDescriptorForm* thisDescriptor); 12 | void SetDecibelVariance(BGSSoundDescriptorForm* thisDescriptor, UInt32 dbVariance); 13 | 14 | UInt32 GetFrequencyVariance(BGSSoundDescriptorForm* thisDescriptor); 15 | void SetFrequencyVariance(BGSSoundDescriptorForm* thisDescriptor, UInt32 freqVariance); 16 | 17 | UInt32 GetFrequencyShift(BGSSoundDescriptorForm* thisDescriptor); 18 | void SetFrequencyShift(BGSSoundDescriptorForm* thisDescriptor, UInt32 freqShift); 19 | 20 | void RegisterFuncs(VMClassRegistry* registry); 21 | }; -------------------------------------------------------------------------------- /skse64/PapyrusSpawnerTask.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct StaticFunctionTag; 4 | class TESForm; 5 | class TESObjectREFR; 6 | class VMClassRegistry; 7 | template class VMArray; 8 | 9 | namespace papyrusSpawnerTask 10 | { 11 | SInt32 Create(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag*); 12 | 13 | void AddSpawn(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag*, SInt32 handle, TESForm* form, TESObjectREFR* target, 14 | VMArray offset, VMArray rotation, SInt32 count, bool bForcePersist, bool bInitiallyDisabled); 15 | 16 | // Latent - returns VMResultArray 17 | bool Run(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag*, SInt32 handle); 18 | 19 | void RegisterFuncs(VMClassRegistry* registry); 20 | } -------------------------------------------------------------------------------- /skse64/PapyrusStringUtil.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "GameTypes.h" 3 | 4 | struct StaticFunctionTag; 5 | class VMClassRegistry; 6 | 7 | 8 | namespace papyrusStringUtil 9 | { 10 | void RegisterFuncs(VMClassRegistry* registry); 11 | 12 | 13 | UInt32 GetLength(StaticFunctionTag* thisInput, BSFixedString s); 14 | BSFixedString GetNthChar(StaticFunctionTag* thisInput, BSFixedString s, UInt32 index); 15 | 16 | bool IsUppercase(StaticFunctionTag* thisInput, BSFixedString s); 17 | bool IsLowercase(StaticFunctionTag* thisInput, BSFixedString s); 18 | bool IsLetter(StaticFunctionTag* thisInput, BSFixedString s); 19 | bool IsDigit(StaticFunctionTag* thisInput, BSFixedString s); 20 | bool IsPunctuation(StaticFunctionTag* thisInput, BSFixedString s); 21 | bool IsPrintable(StaticFunctionTag* thisInput, BSFixedString s); 22 | BSFixedString ToUpper(StaticFunctionTag* thisInput, BSFixedString s); 23 | BSFixedString ToLower(StaticFunctionTag* thisInput, BSFixedString s); 24 | 25 | SInt32 Find(StaticFunctionTag* thisInput, BSFixedString theString, BSFixedString toFind, UInt32 startIndex = 0); 26 | BSFixedString Substring(StaticFunctionTag* thisInput, BSFixedString s, UInt32 startIndex, UInt32 len = 0); 27 | 28 | UInt32 AsOrd(StaticFunctionTag* thisInput, BSFixedString s); 29 | BSFixedString AsChar(StaticFunctionTag* thisInput, UInt32 c); 30 | } 31 | -------------------------------------------------------------------------------- /skse64/PapyrusTextureSet.cpp: -------------------------------------------------------------------------------- 1 | #include "PapyrusTextureSet.h" 2 | 3 | #include "GameObjects.h" 4 | 5 | namespace papyrusTextureSet 6 | { 7 | UInt32 GetNumTexturePaths(BGSTextureSet * thisTextureSet) 8 | { 9 | return thisTextureSet ? BGSTextureSet::kNumTextures : NULL; 10 | } 11 | 12 | BSFixedString GetNthTexturePath(BGSTextureSet * thisTextureSet, UInt32 n) 13 | { 14 | return (thisTextureSet && n < BGSTextureSet::kNumTextures) ? thisTextureSet->texturePaths[n].str : NULL; 15 | } 16 | 17 | void SetNthTexturePath(BGSTextureSet * thisTextureSet, UInt32 n, BSFixedString texturePath) 18 | { 19 | if(thisTextureSet && n < BGSTextureSet::kNumTextures) { 20 | thisTextureSet->texturePaths[n].str = texturePath; 21 | } 22 | } 23 | } 24 | 25 | #include "PapyrusVM.h" 26 | #include "PapyrusNativeFunctions.h" 27 | 28 | void papyrusTextureSet::RegisterFuncs(VMClassRegistry* registry) 29 | { 30 | registry->RegisterFunction( 31 | new NativeFunction0("GetNumTexturePaths", "TextureSet", papyrusTextureSet::GetNumTexturePaths, registry)); 32 | 33 | registry->RegisterFunction( 34 | new NativeFunction1("GetNthTexturePath", "TextureSet", papyrusTextureSet::GetNthTexturePath, registry)); 35 | 36 | registry->RegisterFunction( 37 | new NativeFunction2("SetNthTexturePath", "TextureSet", papyrusTextureSet::SetNthTexturePath, registry)); 38 | } -------------------------------------------------------------------------------- /skse64/PapyrusTextureSet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameTypes.h" 4 | 5 | class BGSTextureSet; 6 | class VMClassRegistry; 7 | 8 | namespace papyrusTextureSet 9 | { 10 | void RegisterFuncs(VMClassRegistry * registry); 11 | 12 | UInt32 GetNumTexturePaths(BGSTextureSet * thisTextureSet); 13 | BSFixedString GetNthTexturePath(BGSTextureSet * thisTextureSet, UInt32 n); 14 | void SetNthTexturePath(BGSTextureSet * thisTextureSet, UInt32 n, BSFixedString texturePath); 15 | }; 16 | -------------------------------------------------------------------------------- /skse64/PapyrusTree.cpp: -------------------------------------------------------------------------------- 1 | #include "PapyrusTree.h" 2 | #include "GameObjects.h" 3 | 4 | namespace papyrusTree 5 | { 6 | TESForm * GetIngredient(TESObjectTREE* thisTree) 7 | { 8 | return (thisTree) ? thisTree->produce.produce : NULL; 9 | } 10 | 11 | void SetIngredient(TESObjectTREE* thisTree, TESForm* ingredient) 12 | { 13 | if (thisTree) { 14 | thisTree->produce.produce = ingredient; 15 | } 16 | } 17 | 18 | BGSSoundDescriptorForm * GetHarvestSound(TESObjectTREE* thisTree) 19 | { 20 | return (thisTree) ? thisTree->produce.harvestSound : NULL; 21 | } 22 | 23 | void SetHarvestSound(TESObjectTREE* thisTree, BGSSoundDescriptorForm * sound) 24 | { 25 | if (thisTree) { 26 | thisTree->produce.harvestSound = sound; 27 | } 28 | } 29 | } 30 | 31 | #include "PapyrusVM.h" 32 | #include "PapyrusNativeFunctions.h" 33 | 34 | void papyrusTree::RegisterFuncs(VMClassRegistry* registry) 35 | { 36 | registry->RegisterForm(TESObjectTREE::kTypeID, "TreeObject"); 37 | 38 | registry->RegisterFunction( 39 | new NativeFunction0("GetIngredient", "TreeObject", papyrusTree::GetIngredient, registry)); 40 | 41 | registry->RegisterFunction( 42 | new NativeFunction1("SetIngredient", "TreeObject", papyrusTree::SetIngredient, registry)); 43 | 44 | registry->RegisterFunction( 45 | new NativeFunction0("GetHarvestSound", "TreeObject", papyrusTree::GetHarvestSound, registry)); 46 | 47 | registry->RegisterFunction( 48 | new NativeFunction1("SetHarvestSound", "TreeObject", papyrusTree::SetHarvestSound, registry)); 49 | } 50 | -------------------------------------------------------------------------------- /skse64/PapyrusTree.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class VMClassRegistry; 4 | class BGSSoundDescriptorForm; 5 | class TESObjectTREE; 6 | class TESForm; 7 | 8 | namespace papyrusTree 9 | { 10 | void RegisterFuncs(VMClassRegistry* registry); 11 | 12 | TESForm * GetIngredient(TESObjectTREE* thisTree); 13 | void SetIngredient(TESObjectTREE* thisTree, TESForm* ingredient); 14 | 15 | BGSSoundDescriptorForm * GetHarvestSound(TESObjectTREE* thisTree); 16 | void SetHarvestSound(TESObjectTREE* thisTree, BGSSoundDescriptorForm * sound); 17 | }; 18 | -------------------------------------------------------------------------------- /skse64/PapyrusUICallback.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameTypes.h" 4 | 5 | struct StaticFunctionTag; 6 | class VMClassRegistry; 7 | template class VMArray; 8 | 9 | namespace papyrusUICallback 10 | { 11 | SInt32 Create(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, BSFixedString menuName, BSFixedString targetStr); 12 | bool Send(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle); 13 | void Release(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle); 14 | 15 | template 16 | void Push(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle, T arg); 17 | 18 | template 19 | void PushArray(VMClassRegistry* registry, UInt32 stackId, StaticFunctionTag* thisInput, SInt32 handle, VMArray args); 20 | 21 | void RegisterFuncs(VMClassRegistry* registry); 22 | } -------------------------------------------------------------------------------- /skse64/PapyrusUtility.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "GameTypes.h" 3 | 4 | struct StaticFunctionTag; 5 | 6 | class VMClassRegistry; 7 | 8 | namespace papyrusUtility { 9 | 10 | void RegisterFuncs(VMClassRegistry* registry); 11 | 12 | float GetINIFloat(StaticFunctionTag* base, BSFixedString ini); 13 | UInt32 GetINIInt(StaticFunctionTag* base, BSFixedString ini); 14 | bool GetINIBool(StaticFunctionTag* base, BSFixedString ini); 15 | BSFixedString GetINIString(StaticFunctionTag* base, BSFixedString ini); 16 | } 17 | -------------------------------------------------------------------------------- /skse64/PapyrusValue.cpp: -------------------------------------------------------------------------------- 1 | #include "skse64/PapyrusValue.h" 2 | -------------------------------------------------------------------------------- /skse64/PapyrusWeather.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class VMClassRegistry; 4 | 5 | class TESWeather; 6 | 7 | namespace papyrusWeather 8 | { 9 | float GetSunGlare(TESWeather* thisWeather); 10 | float GetSunDamage(TESWeather* thisWeather); 11 | float GetWindDirection(TESWeather* thisWeather); 12 | float GetWindDirectionRange(TESWeather* thisWeather); 13 | float GetFogDistance(TESWeather* thisWeather, bool day, UInt32 fdType); 14 | 15 | void RegisterFuncs(VMClassRegistry* registry); 16 | } -------------------------------------------------------------------------------- /skse64/PluginLoadErrorDialog.rc: -------------------------------------------------------------------------------- 1 | #include "resource.h" 2 | #include "winres.h" 3 | 4 | IDD_PLUGINERROR DIALOGEX 0, 0, 310, 177 5 | STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME 6 | CAPTION "SKSE Plugin Manager" 7 | FONT 8, "MS Shell Dlg", 400, 0, 0x1 8 | BEGIN 9 | DEFPUSHBUTTON "Exit",IDCANCEL,252,156,50,14 10 | PUSHBUTTON "Continue",IDOK,6,156,50,14 11 | LTEXT "A DLL plugin has failed to load correctly.",IDC_STATIC,6,6,132,8 12 | LISTBOX IDC_PLUGINERROR_ERRORLIST,6,18,294,120,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP 13 | LTEXT "Continuing to load may result in lost save data or other undesired behavior.",IDC_STATIC,6,144,294,8 14 | END 15 | -------------------------------------------------------------------------------- /skse64/ScaleformAPI.cpp: -------------------------------------------------------------------------------- 1 | #include "ScaleformAPI.h" 2 | 3 | class ScaleformHeap 4 | { 5 | public: 6 | virtual void Fn_00(void); 7 | virtual void Fn_01(void); 8 | virtual void Fn_02(void); 9 | virtual void Fn_03(void); 10 | virtual void Fn_04(void); 11 | virtual void Fn_05(void); 12 | virtual void Fn_06(void); 13 | virtual void Fn_07(void); 14 | virtual void Fn_08(void); 15 | virtual void Fn_09(void); 16 | virtual void * Allocate(size_t size, UInt32 unk = 0); // unk is probably align, maybe flags (haven't traced) 17 | virtual void Fn_0B(void); 18 | virtual void Free(void * ptr); 19 | }; 20 | 21 | // 2868BB28215776CF08A8F2A297F7911CA4DE127B+1F 22 | RelocPtr g_scaleformHeap(0x03292490); 23 | 24 | void * ScaleformHeap_Allocate(UInt32 size) 25 | { 26 | return (*(g_scaleformHeap))->Allocate(size); 27 | } 28 | 29 | void ScaleformHeap_Free(void * ptr) 30 | { 31 | (*(g_scaleformHeap))->Free(ptr); 32 | } 33 | 34 | RelocAddr<_InvokeFunction> InvokeFunction(0x00FBE900); 35 | RelocAddr<_GFxAllocateHeap> GFxAllocateHeap(0x0102FBD0); 36 | -------------------------------------------------------------------------------- /skse64/ScaleformAPI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64_common/Relocation.h" 4 | 5 | class GFxMovieView; 6 | class FxResponseArgsBase; 7 | class ScaleformAllocator; 8 | 9 | void * ScaleformHeap_Allocate(UInt32 size); 10 | void ScaleformHeap_Free(void * ptr); 11 | 12 | typedef void * (* _InvokeFunction)(GFxMovieView * movie, const char * fnName, FxResponseArgsBase * arguments); 13 | extern RelocAddr<_InvokeFunction> InvokeFunction; 14 | 15 | struct HeapDesc 16 | { 17 | enum 18 | { 19 | kHeap_ThreadUnsafe = (1 << 0), 20 | kHeap_FastTinyBlocks = (1 << 1), 21 | kHeap_FixedGranularity = (1 << 2), 22 | kHeap_Root = (1 << 3), 23 | kHeap_NoDebugInfo = (1 << 4), 24 | kHeap_UserDebug = (1 << 12) 25 | }; 26 | UInt32 flags; 27 | UInt32 granularity; 28 | UInt32 reserve; 29 | UInt32 threshold; 30 | UInt32 limit; 31 | UInt32 heapId; 32 | UInt32 arena; 33 | }; 34 | 35 | typedef void * (* _GFxAllocateHeap)(HeapDesc * heap, ScaleformAllocator * allocator); 36 | extern RelocAddr<_GFxAllocateHeap> GFxAllocateHeap; 37 | -------------------------------------------------------------------------------- /skse64/ScaleformCallbacks.cpp: -------------------------------------------------------------------------------- 1 | #include "ScaleformCallbacks.h" 2 | #include 3 | 4 | UInt32 g_GFxFunctionHandler_count = 0; 5 | 6 | GFxFunctionHandler::GFxFunctionHandler() 7 | { 8 | g_GFxFunctionHandler_count++; 9 | } 10 | 11 | GFxFunctionHandler::~GFxFunctionHandler() 12 | { 13 | g_GFxFunctionHandler_count--; 14 | } 15 | 16 | FunctionHandlerCache g_functionHandlerCache; 17 | 18 | RelocAddr PlaySoundCallback(0x0097A9B0); 19 | 20 | FxResponseArgsList::FxResponseArgsList() 21 | { 22 | args.values = nullptr; 23 | args.size = 0; 24 | args.capacity = 0; 25 | } 26 | FxResponseArgsList::~FxResponseArgsList() 27 | { 28 | Clear(); 29 | } 30 | 31 | void FxResponseArgsList::Clear() 32 | { 33 | if (args.values) { 34 | for (UInt32 i = 0; i < args.size; i++) 35 | args.values[i].CleanManaged(); 36 | ScaleformHeap_Free(args.values); 37 | args.values = NULL; 38 | args.size = 0; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /skse64/ScaleformExtendedData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TESForm; 4 | class ActiveEffect; 5 | class GFxMovieView; 6 | class GFxValue; 7 | class BGSKeywordForm; 8 | class InventoryEntryData; 9 | struct AlchemyEffectCategory; 10 | 11 | #include "GameReferences.h" 12 | 13 | void RegisterNumber(GFxValue * dst, const char * name, double value); 14 | void RegisterBool(GFxValue * dst, const char * name, bool value); 15 | void RegisterString(GFxValue * dst, GFxMovieView * view, const char * name, const char * str); 16 | void RegisterKeywords(GFxValue * pFxVal, GFxMovieView * view, BGSKeywordForm * keywordForm); 17 | 18 | // Item Card Extensions 19 | namespace scaleformExtend 20 | { 21 | void CommonItemData(GFxValue* pFxVal, TESForm * pForm); 22 | void StandardItemData(GFxValue* pFxVal, TESForm * pForm, InventoryEntryData * pEntry = NULL); 23 | void MagicItemData(GFxValue * pFxVal, GFxMovieView * movieView, TESForm * pForm, bool bExtra, bool bRecursive); 24 | void ActorData(GFxValue * pFxVal, GFxMovieView * movieView, TESForm * pForm, bool bExtra, bool bRecursive); 25 | void FormListData(GFxValue * pFxVal, GFxMovieView * movieView, TESForm * pForm, bool bExtra, bool bRecursive); 26 | void MiscData(GFxValue * pFxVal, GFxMovieView * movieView, TESForm * pForm, bool bExtra, bool bRecursive); 27 | void FormData(GFxValue * pFxVal, GFxMovieView * movieView, TESForm * pForm, bool bExtra, bool bRecursive); 28 | void InventoryData(GFxValue * pFxVal, GFxMovieView * movieView, InventoryEntryData * objDesc); 29 | 30 | void ItemInfoData(GFxValue* pFxVal, InventoryEntryData * pEntry); 31 | 32 | void CraftDisenchantData(GFxValue * pFxVal, GFxMovieView * movieView, InventoryEntryData * pEntry); 33 | void AlchemyCategoryArgs(AlchemyEffectCategory* effectArray, GFxValue * args, UInt32 numArgs); 34 | }; 35 | -------------------------------------------------------------------------------- /skse64/ScaleformLoader.cpp: -------------------------------------------------------------------------------- 1 | #include "ScaleformLoader.h" 2 | 3 | #include "skse64_common/Relocation.h" 4 | 5 | GFxLoader * GFxLoader::GetSingleton() 6 | { 7 | // D73FE972523296E269125B9E6F076AD967D7970C+F9 8 | RelocPtr g_GFxLoader(0x035F11C8); 9 | return *g_GFxLoader; 10 | } 11 | -------------------------------------------------------------------------------- /skse64/ScaleformLoader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64/ScaleformState.h" 4 | 5 | class NiTexture; 6 | class IMenu; 7 | class GImageInfoBase; 8 | 9 | class GFxImageLoader : public GFxState 10 | { 11 | public: 12 | virtual GImageInfoBase* LoadImage(const char * url) = 0; 13 | }; 14 | 15 | class BSScaleformImageLoader : public GFxImageLoader 16 | { 17 | public: 18 | virtual ~BSScaleformImageLoader(); 19 | virtual GImageInfoBase* LoadImage(const char * url); 20 | 21 | DEFINE_MEMBER_FN_1(AddVirtualImage, UInt8, 0x00FB3320, NiTexture ** texture); 22 | DEFINE_MEMBER_FN_1(ReleaseVirtualImage, UInt8, 0x00FB37A0, NiTexture ** texture); 23 | }; 24 | 25 | class GFxLoader 26 | { 27 | public: 28 | UInt64 unk00; // 00 29 | GFxStateBag * stateBag; // 08 30 | UInt64 unk08; // 10 31 | UInt64 unk10; // 18 32 | BSScaleformImageLoader * imageLoader; // 20 33 | 34 | static GFxLoader * GetSingleton(); 35 | 36 | MEMBER_FN_PREFIX(GFxLoader); 37 | DEFINE_MEMBER_FN(ctor, GFxLoader *, 0x00FAF9E0); 38 | 39 | DEFINE_MEMBER_FN(LoadMovie, bool, 0x00FB0110, IMenu* menu, GFxMovieView** viewOut, const char* name, int scaleMode, float backGroundAlpha); // probably in subclass 40 | }; 41 | -------------------------------------------------------------------------------- /skse64/ScaleformMovie.cpp: -------------------------------------------------------------------------------- 1 | #include "ScaleformMovie.h" 2 | -------------------------------------------------------------------------------- /skse64/ScaleformState.cpp: -------------------------------------------------------------------------------- 1 | #include "ScaleformState.h" 2 | #include "skse64/GameAPI.h" 3 | 4 | RelocAddr BSScaleformTranslator::GetCachedString(0x00CED360); 5 | 6 | void SKSEGFxLogger::LogMessageVarg(UInt32 messageType, const char* fmt, va_list args) 7 | { 8 | gLog.Log(IDebugLog::kLevel_Message, fmt, args); 9 | } 10 | -------------------------------------------------------------------------------- /skse64/ScaleformTypes.cpp: -------------------------------------------------------------------------------- 1 | #include "ScaleformTypes.h" 2 | #include "ScaleformAPI.h" 3 | 4 | GString::Data * GString::GetData(void) 5 | { 6 | return (Data *)(data.heapInfo & ~kHeapInfoMask); 7 | } 8 | 9 | UInt32 GString::GetHeapInfo(void) 10 | { 11 | return data.heapInfo & kHeapInfoMask; 12 | } 13 | 14 | void GString::Destroy(void) 15 | { 16 | GString::Data * data = GetData(); 17 | 18 | data->Release(); 19 | } 20 | 21 | void GString::Data::IncRef(void) 22 | { 23 | InterlockedExchangeAdd(&refCount, 1); 24 | } 25 | 26 | void GString::Data::Release(void) 27 | { 28 | SInt32 oldRefCount = InterlockedExchangeAdd(&refCount, -1); // decref 29 | 30 | // all references gone? 31 | if(oldRefCount == 1) 32 | { 33 | ScaleformHeap_Free(this); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /skse64/ScaleformVM.cpp: -------------------------------------------------------------------------------- 1 | #include "ScaleformVM.h" 2 | -------------------------------------------------------------------------------- /skse64/ScaleformVM.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64/ScaleformTypes.h" 4 | -------------------------------------------------------------------------------- /skse64/Translation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class BSScaleformTranslator; 4 | 5 | namespace Translation 6 | { 7 | void ImportTranslationFiles(BSScaleformTranslator * translator); 8 | } 9 | -------------------------------------------------------------------------------- /skse64/cmake/config.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") 2 | include(CMakeFindDependencyMacro) 3 | 4 | find_dependency(common) 5 | -------------------------------------------------------------------------------- /skse64/gamethreads.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64_common/Utilities.h" 4 | #include "GameAPI.h" 5 | 6 | class Actor; 7 | class BGSHeadPart; 8 | class NiAVObject; 9 | class BGSTextureSet; 10 | class NiAVObject; 11 | class TESObjectREFR; 12 | 13 | class TaskDelegate 14 | { 15 | public: 16 | virtual void Run() = 0; 17 | virtual void Dispose() = 0; 18 | }; 19 | 20 | class BSTaskPool 21 | { 22 | public: 23 | MEMBER_FN_PREFIX(BSTaskPool); 24 | DEFINE_MEMBER_FN(SetNiGeometryTexture, UInt32, 0x00656D40, NiAVObject * geometry, BGSTextureSet * textureSet); 25 | 26 | void ProcessTasks(void); 27 | 28 | DEFINE_MEMBER_FN(ProcessTaskQueue_HookTarget, void, 0x00654880); 29 | 30 | static BSTaskPool * GetSingleton(void); 31 | }; 32 | -------------------------------------------------------------------------------- /skse64/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by PluginLoadErrorDialog.rc 4 | // 5 | #define VS_VERSION_INFO 1 6 | #define IDD_PLUGINERROR 2 7 | #define IDC_PLUGINERROR_ERRORLIST 1001 8 | #define IDC_STATIC -1 9 | 10 | // Next default values for new objects 11 | // 12 | #ifdef APSTUDIO_INVOKED 13 | #ifndef APSTUDIO_READONLY_SYMBOLS 14 | #define _APS_NEXT_RESOURCE_VALUE 102 15 | #define _APS_NEXT_COMMAND_VALUE 40001 16 | #define _APS_NEXT_CONTROL_VALUE 1002 17 | #define _APS_NEXT_SYMED_VALUE 101 18 | #endif 19 | #endif 20 | -------------------------------------------------------------------------------- /skse64/skse64.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | StartSKSE @1 -------------------------------------------------------------------------------- /skse64_common/BranchTrampoline.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class BranchTrampoline 4 | { 5 | public: 6 | BranchTrampoline(); 7 | ~BranchTrampoline(); 8 | 9 | bool Create(size_t len, void * module = NULL); 10 | void Destroy(); 11 | void SetBase(size_t len, void* base); 12 | 13 | // allocate unsized 14 | void * StartAlloc(); 15 | void EndAlloc(const void * end); 16 | 17 | void * Allocate(size_t size = sizeof(void *)); 18 | 19 | size_t Remain() { return m_len - m_allocated; } 20 | 21 | // takes 6 bytes of space at src, 8 bytes in trampoline 22 | bool Write6Branch(uintptr_t src, uintptr_t dst); 23 | bool Write6Call(uintptr_t src, uintptr_t dst); 24 | 25 | // takes 5 bytes of space at src, 14 bytes in trampoline 26 | bool Write5Branch(uintptr_t src, uintptr_t dst); 27 | bool Write5Call(uintptr_t src, uintptr_t dst); 28 | 29 | private: 30 | // takes 6 bytes of space at src, 8 bytes in trampoline 31 | bool Write6Branch_Internal(uintptr_t src, uintptr_t dst, UInt8 op); 32 | 33 | // takes 5 bytes of space at src, 14 bytes in trampoline 34 | bool Write5Branch_Internal(uintptr_t src, uintptr_t dst, UInt8 op); 35 | 36 | void * m_base; 37 | size_t m_len; // bytes 38 | size_t m_allocated; // bytes 39 | 40 | void * m_curAlloc; // currently active StartAlloc base 41 | }; 42 | 43 | extern BranchTrampoline g_branchTrampoline; 44 | extern BranchTrampoline g_localTrampoline; 45 | -------------------------------------------------------------------------------- /skse64_common/Relocation.cpp: -------------------------------------------------------------------------------- 1 | #include "Relocation.h" 2 | 3 | // the goal of this file is to support pointers in to a relocated binary with as little runtime overhead, code bloat, and hassle as possible 4 | // 5 | // since the main executable will always be loaded before the dll, the easiest solution is to perform the relocation in the constructor of 6 | // a pointer class that supports conversion to T*. however, since we can't control anything about initialization order, each constructor 7 | // must call GetModuleHandle(NULL) locally, which sucks. each pointer will need an entry in the static init table, and nothing can be done 8 | // with the pointers in any other static constructors. 9 | // 10 | // one solution to this problem is init_seg(lib). any objects constructed in a file containing this pragma will be constructed before standard 11 | // 'user' level code. this means we can use the constructor of that object to call GetModuleHandle once and initialize a global with the load 12 | // address, which the pointer class constructor then references to fix up the addresses. this still creates an entry in the static init table 13 | // for each pointer, but only calls GetModuleHandle once. pointers are not fixed up until all static init has finished, so other static ctors 14 | // can't safely use pointers. 15 | // 16 | // the problem can't be solved further without moving the RelocPtr constructors in to init_seg(lib), which doesn't appear to be possible 17 | // without forcing all pointers to be defined in a file with init_seg(lib). that is really ugly and doesn't seem like a good idea. 18 | 19 | // anything in this file will initialized after the crt but before any user code 20 | #pragma warning(disable: 4073) // yes this is intentional 21 | #pragma init_seg(lib) 22 | 23 | static RelocationManager s_relocMgr; 24 | 25 | uintptr_t RelocationManager::s_baseAddr = 0; 26 | 27 | RelocationManager::RelocationManager() 28 | { 29 | s_baseAddr = reinterpret_cast(GetModuleHandle(NULL)); 30 | } 31 | -------------------------------------------------------------------------------- /skse64_common/Relocation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class RelocationManager 4 | { 5 | public: 6 | RelocationManager(); 7 | 8 | static uintptr_t s_baseAddr; 9 | }; 10 | 11 | // use this for addresses that represent pointers to a type T 12 | template 13 | class RelocPtr 14 | { 15 | public: 16 | RelocPtr(uintptr_t offset) 17 | :m_offset(offset + RelocationManager::s_baseAddr) 18 | { 19 | // 20 | } 21 | 22 | operator T *() const 23 | { 24 | return GetPtr(); 25 | } 26 | 27 | T * operator->() const 28 | { 29 | return GetPtr(); 30 | } 31 | 32 | T * GetPtr() const 33 | { 34 | return reinterpret_cast (m_offset); 35 | } 36 | 37 | const T * GetConst() const 38 | { 39 | return reinterpret_cast (m_offset); 40 | } 41 | 42 | uintptr_t GetUIntPtr() const 43 | { 44 | return m_offset; 45 | } 46 | 47 | private: 48 | uintptr_t m_offset; 49 | 50 | // hide 51 | RelocPtr(); 52 | RelocPtr(RelocPtr & rhs); 53 | RelocPtr & operator=(RelocPtr & rhs); 54 | }; 55 | 56 | // use this for direct addresses to types T. needed to avoid ambiguity 57 | template 58 | class RelocAddr 59 | { 60 | public: 61 | RelocAddr(uintptr_t offset) 62 | :m_offset(reinterpret_cast (offset + RelocationManager::s_baseAddr)) 63 | { 64 | // 65 | } 66 | 67 | operator T() 68 | { 69 | return reinterpret_cast (m_offset); 70 | } 71 | 72 | uintptr_t GetUIntPtr() const 73 | { 74 | return reinterpret_cast (m_offset); 75 | } 76 | 77 | private: 78 | // apparently you can't reinterpret_cast from a type to the same type 79 | // that's kind of stupid and makes it impossible to use this for uintptr_ts if I use the same type 80 | // so we make a new type by storing the data in a pointer to this useless struct 81 | // at least this is hidden by a wrapper 82 | struct BlockConversionType { }; 83 | BlockConversionType * m_offset; 84 | 85 | // hide 86 | RelocAddr(); 87 | RelocAddr(RelocAddr & rhs); 88 | RelocAddr & operator=(RelocAddr & rhs); 89 | }; 90 | -------------------------------------------------------------------------------- /skse64_common/SafeWrite.cpp: -------------------------------------------------------------------------------- 1 | #include "SafeWrite.h" 2 | 3 | void SafeWriteBuf(uintptr_t addr, void * data, size_t len) 4 | { 5 | UInt32 oldProtect; 6 | 7 | VirtualProtect((void *)addr, len, PAGE_EXECUTE_READWRITE, &oldProtect); 8 | memcpy((void *)addr, data, len); 9 | VirtualProtect((void *)addr, len, oldProtect, &oldProtect); 10 | } 11 | 12 | void SafeWrite8(uintptr_t addr, UInt8 data) 13 | { 14 | SafeWriteBuf(addr, &data, sizeof(data)); 15 | } 16 | 17 | void SafeWrite16(uintptr_t addr, UInt16 data) 18 | { 19 | SafeWriteBuf(addr, &data, sizeof(data)); 20 | } 21 | 22 | void SafeWrite32(uintptr_t addr, UInt32 data) 23 | { 24 | SafeWriteBuf(addr, &data, sizeof(data)); 25 | } 26 | 27 | void SafeWrite64(uintptr_t addr, UInt64 data) 28 | { 29 | SafeWriteBuf(addr, &data, sizeof(data)); 30 | } 31 | 32 | static bool SafeWriteJump_Internal(uintptr_t src, uintptr_t dst, UInt8 op) 33 | { 34 | #pragma pack(push, 1) 35 | struct Code 36 | { 37 | UInt8 op; 38 | SInt32 displ; 39 | }; 40 | #pragma pack(pop) 41 | 42 | STATIC_ASSERT(sizeof(Code) == 5); 43 | 44 | ptrdiff_t delta = dst - (src + sizeof(Code)); 45 | if((delta < INT_MIN) || (delta > INT_MAX)) 46 | return false; 47 | 48 | Code code; 49 | 50 | code.op = op; 51 | code.displ = delta; 52 | 53 | SafeWriteBuf(src, &code, sizeof(code)); 54 | 55 | return true; 56 | } 57 | 58 | bool SafeWriteJump(uintptr_t src, uintptr_t dst) 59 | { 60 | return SafeWriteJump_Internal(src, dst, 0xE9); 61 | } 62 | 63 | bool SafeWriteCall(uintptr_t src, uintptr_t dst) 64 | { 65 | return SafeWriteJump_Internal(src, dst, 0xE8); 66 | } 67 | -------------------------------------------------------------------------------- /skse64_common/SafeWrite.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void SafeWriteBuf(uintptr_t addr, void * data, size_t len); 4 | void SafeWrite8(uintptr_t addr, UInt8 data); 5 | void SafeWrite16(uintptr_t addr, UInt16 data); 6 | void SafeWrite32(uintptr_t addr, UInt32 data); 7 | void SafeWrite64(uintptr_t addr, UInt64 data); 8 | 9 | // ### warning: if you try to branch more than +/- 2GB with these, they will fail and return false 10 | // ### this is a limitation of the 'jmp' instruction and more generally the x64 ISA 11 | // 5 bytes written to src 12 | bool SafeWriteJump(uintptr_t src, uintptr_t dst); 13 | bool SafeWriteCall(uintptr_t src, uintptr_t dst); 14 | -------------------------------------------------------------------------------- /skse64_common/cmake/config.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") 2 | include(CMakeFindDependencyMacro) 3 | 4 | find_dependency(common) 5 | -------------------------------------------------------------------------------- /skse64_common/cmake/headerlist.cmake: -------------------------------------------------------------------------------- 1 | set(headers 2 | BranchTrampoline.h 3 | Relocation.h 4 | SafeWrite.h 5 | Utilities.h 6 | skse_version.h 7 | ) 8 | -------------------------------------------------------------------------------- /skse64_common/cmake/sourcelist.cmake: -------------------------------------------------------------------------------- 1 | set(sources 2 | BranchTrampoline.cpp 3 | Relocation.cpp 4 | SafeWrite.cpp 5 | Utilities.cpp 6 | ) 7 | -------------------------------------------------------------------------------- /skse64_common/skse64_common.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /skse64_common/skse_version.rc: -------------------------------------------------------------------------------- 1 | #include "skse_version.h" 2 | 3 | 1 VERSIONINFO 4 | FILEVERSION 0,SKSE_VERSION_INTEGER,SKSE_VERSION_INTEGER_MINOR,SKSE_VERSION_INTEGER_BETA 5 | PRODUCTVERSION 0,SKSE_VERSION_INTEGER,SKSE_VERSION_INTEGER_MINOR,SKSE_VERSION_INTEGER_BETA 6 | FILEFLAGSMASK 0x17L 7 | #ifdef _DEBUG 8 | FILEFLAGS 0x1L 9 | #else 10 | FILEFLAGS 0x0L 11 | #endif 12 | FILEOS 0x4L 13 | FILETYPE 0x1L 14 | FILESUBTYPE 0x0L 15 | BEGIN 16 | BLOCK "StringFileInfo" 17 | BEGIN 18 | BLOCK "040904b0" 19 | BEGIN 20 | VALUE "FileDescription", "A component of the Skyrim SE Script Extender" 21 | VALUE "FileVersion", SKSE_VERSION_VERSTRING 22 | VALUE "InternalName", "SKSE64" 23 | VALUE "LegalCopyright", "Copyright (C) 2006-2022" 24 | VALUE "ProductName", "SKSE64" 25 | VALUE "ProductVersion", SKSE_VERSION_VERSTRING 26 | END 27 | END 28 | BLOCK "VarFileInfo" 29 | BEGIN 30 | VALUE "Translation", 0x409, 1200 31 | END 32 | END 33 | -------------------------------------------------------------------------------- /skse64_license.txt: -------------------------------------------------------------------------------- 1 | These notes apply to all of the files in src/skse64: 2 | 3 | Due to continued intentional copyright infringement and total disrespect for modder etiquette, the Skyrim Online/Skyrim Together team is explicitly disallowed from using any of these files for any purpose. -------------------------------------------------------------------------------- /skse64_loader/Options.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Options 4 | { 5 | public: 6 | Options(); 7 | ~Options(); 8 | 9 | bool Read(int argc, char ** argv); 10 | 11 | void PrintUsage(void); 12 | 13 | bool m_launchCS; 14 | 15 | bool m_setPriority; 16 | DWORD m_priority; 17 | 18 | bool m_optionsOnly; 19 | bool m_crcOnly; 20 | bool m_waitForClose; 21 | bool m_verbose; 22 | bool m_moduleInfo; 23 | bool m_skipLauncher; 24 | bool m_launchSteam; 25 | bool m_noTimeout; 26 | bool m_forceSteamLoader; 27 | 28 | UInt64 m_affinity; 29 | 30 | std::string m_altEXE; 31 | std::string m_altDLL; 32 | 33 | private: 34 | bool Verify(void); 35 | }; 36 | 37 | extern Options g_options; 38 | -------------------------------------------------------------------------------- /skse64_loader/cmake/config.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") 2 | include(CMakeFindDependencyMacro) 3 | 4 | find_dependency(common) 5 | -------------------------------------------------------------------------------- /skse64_loader/cmake/headerlist.cmake: -------------------------------------------------------------------------------- 1 | set(headers 2 | Options.h 3 | ) 4 | -------------------------------------------------------------------------------- /skse64_loader/cmake/sourcelist.cmake: -------------------------------------------------------------------------------- 1 | set(sources 2 | Options.cpp 3 | main.cpp 4 | ) 5 | -------------------------------------------------------------------------------- /skse64_loader/skse64_loader.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /skse64_loader_common/IdentifyEXE.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum 4 | { 5 | kProcType_Steam, 6 | kProcType_Normal, 7 | kProcType_WinStore, 8 | kProcType_GOG, 9 | kProcType_Epic, 10 | 11 | kProcType_Packed, 12 | 13 | kProcType_Unknown 14 | }; 15 | 16 | struct ProcHookInfo 17 | { 18 | UInt64 version; 19 | UInt32 procType; 20 | }; 21 | 22 | bool IdentifyEXE(const char * procName, bool isEditor, std::string * dllSuffix, ProcHookInfo * hookInfo); 23 | -------------------------------------------------------------------------------- /skse64_loader_common/Inject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skse64_loader_common/IdentifyEXE.h" 4 | 5 | bool InjectDLL(PROCESS_INFORMATION * info, const char * dllPath, ProcHookInfo * hookInfo); 6 | bool InjectDLLThread(PROCESS_INFORMATION * info, const char * dllPath, bool sync, bool noTimeout); 7 | -------------------------------------------------------------------------------- /skse64_loader_common/LoaderError.cpp: -------------------------------------------------------------------------------- 1 | #include "LoaderError.h" 2 | #include 3 | 4 | void PrintLoaderError(const char * fmt, ...) 5 | { 6 | char buf[4096]; 7 | 8 | va_list args; 9 | 10 | va_start(args, fmt); 11 | gLog.Log(IDebugLog::kLevel_FatalError, fmt, args); 12 | va_end(args); 13 | 14 | va_start(args, fmt); 15 | vsprintf_s(buf, sizeof(buf), fmt, args); 16 | va_end(args); 17 | 18 | MessageBox(NULL, buf, "SKSE64 Loader", MB_OK | MB_ICONEXCLAMATION); 19 | } 20 | -------------------------------------------------------------------------------- /skse64_loader_common/LoaderError.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void PrintLoaderError(const char * fmt, ...); 4 | -------------------------------------------------------------------------------- /skse64_loader_common/MSSCCPRJ.SCC: -------------------------------------------------------------------------------- 1 | SCC = This is a source code control file 2 | 3 | [skse64_loader_common.vcxproj] 4 | SCC_Aux_Path = "P4SCC#1667#shiftjis#ianpatt##ARGAMA" 5 | SCC_Project_Name = Perforce Project 6 | -------------------------------------------------------------------------------- /skse64_loader_common/Steam.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | bool SteamCheckPassive(void); 4 | bool SteamLaunch(void); 5 | -------------------------------------------------------------------------------- /skse64_loader_common/cmake/config.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") 2 | include(CMakeFindDependencyMacro) 3 | 4 | find_dependency(common) 5 | -------------------------------------------------------------------------------- /skse64_loader_common/cmake/headerlist.cmake: -------------------------------------------------------------------------------- 1 | set(headers 2 | IdentifyEXE.h 3 | Inject.h 4 | LoaderError.h 5 | Steam.h 6 | ) 7 | -------------------------------------------------------------------------------- /skse64_loader_common/cmake/sourcelist.cmake: -------------------------------------------------------------------------------- 1 | set(sources 2 | IdentifyEXE.cpp 3 | Inject.cpp 4 | LoaderError.cpp 5 | Steam.cpp 6 | ) 7 | -------------------------------------------------------------------------------- /skse64_loader_common/skse64_loader_common.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /skse64_msstore_loader/cmake/config.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") 2 | include(CMakeFindDependencyMacro) 3 | 4 | find_dependency(common) 5 | -------------------------------------------------------------------------------- /skse64_msstore_loader/cmake/headerlist.cmake: -------------------------------------------------------------------------------- 1 | set(headers 2 | ) 3 | -------------------------------------------------------------------------------- /skse64_msstore_loader/cmake/sourcelist.cmake: -------------------------------------------------------------------------------- 1 | set(sources 2 | main.cpp 3 | ) 4 | -------------------------------------------------------------------------------- /skse64_msstore_loader/require_admin.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /skse64_msstore_stub/cmake/config.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") 2 | include(CMakeFindDependencyMacro) 3 | 4 | find_dependency(common) 5 | -------------------------------------------------------------------------------- /skse64_msstore_stub/cmake/headerlist.cmake: -------------------------------------------------------------------------------- 1 | set(headers 2 | ) 3 | -------------------------------------------------------------------------------- /skse64_msstore_stub/cmake/sourcelist.cmake: -------------------------------------------------------------------------------- 1 | set(sources 2 | main.cpp 3 | ) 4 | -------------------------------------------------------------------------------- /skse64_steam_loader/cmake/config.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") 2 | include(CMakeFindDependencyMacro) 3 | 4 | find_dependency(common) 5 | -------------------------------------------------------------------------------- /skse64_steam_loader/cmake/headerlist.cmake: -------------------------------------------------------------------------------- 1 | set(headers 2 | ) 3 | -------------------------------------------------------------------------------- /skse64_steam_loader/cmake/sourcelist.cmake: -------------------------------------------------------------------------------- 1 | set(sources 2 | main.cpp 3 | ) 4 | -------------------------------------------------------------------------------- /skse64_steam_loader/skse64_steam_loader.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | InitSKSESteamLoader @1 -------------------------------------------------------------------------------- /skse64_steam_loader/skse64_steam_loader.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /xbyak/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | 3 | # ---- Project ---- 4 | 5 | project( 6 | xbyak 7 | VERSION 4.87 8 | LANGUAGES CXX 9 | ) 10 | 11 | # ---- Include guards ---- 12 | 13 | if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) 14 | message( 15 | FATAL_ERROR 16 | "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there." 17 | ) 18 | endif() 19 | 20 | # ---- Create library ---- 21 | 22 | include(GNUInstallDirs) 23 | 24 | add_library(${PROJECT_NAME} INTERFACE) 25 | add_library(Xbyak::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) 26 | 27 | target_include_directories( 28 | ${PROJECT_NAME} 29 | INTERFACE 30 | $ 31 | $ 32 | ) 33 | 34 | install( 35 | TARGETS ${PROJECT_NAME} 36 | EXPORT ${PROJECT_NAME}_Targets 37 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 38 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 39 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 40 | ) 41 | 42 | include(CMakePackageConfigHelpers) 43 | write_basic_package_version_file( 44 | "${PROJECT_NAME}ConfigVersion.cmake" 45 | VERSION ${PROJECT_VERSION} 46 | COMPATIBILITY AnyNewerVersion 47 | ) 48 | 49 | configure_package_config_file( 50 | "${PROJECT_SOURCE_DIR}/cmake/config.cmake.in" 51 | "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" 52 | INSTALL_DESTINATION 53 | ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake 54 | ) 55 | 56 | install( 57 | EXPORT ${PROJECT_NAME}_Targets 58 | FILE ${PROJECT_NAME}-targets.cmake 59 | NAMESPACE Xbyak:: 60 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake 61 | ) 62 | 63 | install( 64 | FILES 65 | "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" 66 | "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" 67 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake 68 | ) 69 | 70 | install( 71 | FILES 72 | xbyak.h 73 | xbyak_bin2hex.h 74 | xbyak_mnemonic.h 75 | xbyak_util.h 76 | DESTINATION 77 | ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} 78 | ) 79 | -------------------------------------------------------------------------------- /xbyak/cmake/config.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") 2 | include(CMakeFindDependencyMacro) 3 | --------------------------------------------------------------------------------