From 3b96413c6ade79809cb0200fead2b9d6544368e3 Mon Sep 17 00:00:00 2001 From: Chomp Date: Tue, 16 Nov 2021 21:43:28 +0000 Subject: [PATCH] add code --- License | 31 +++++++++++++++++++++++++++++++ modloader.js | 2 ++ package.json | 9 +++++++++ src/mod.js | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+) create mode 100644 License create mode 100644 modloader.js create mode 100644 package.json create mode 100644 src/mod.js diff --git a/License b/License new file mode 100644 index 0000000..2c7bc7e --- /dev/null +++ b/License @@ -0,0 +1,31 @@ +Copyright (c) 2021 Lua. All rights reserved. + +Developed by: SPT-Aki + Lua + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation files +(the "Software"), to deal with the Software without restriction, +including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + +* Neither the names of Lua, SPT-Aki nor the names of its + contributors may be used to endorse or promote products derived from + this Software without specific prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH +THE SOFTWARE. \ No newline at end of file diff --git a/modloader.js b/modloader.js new file mode 100644 index 0000000..acfe313 --- /dev/null +++ b/modloader.js @@ -0,0 +1,2 @@ +const { Mod } = require("./src/mod.js"); +module.exports.mod = new Mod(); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..83f47c5 --- /dev/null +++ b/package.json @@ -0,0 +1,9 @@ +{ + "name": "RaiderSpawnFix", + "author": "Chomp", + "version": "1.0.0", + "akiVersion": "2.1.0", + "license": "N/A", + "main": "modloader.js", + "contributors": ["StealthSuit", "CWX", "ThatGuyXIV"] +} \ No newline at end of file diff --git a/src/mod.js b/src/mod.js new file mode 100644 index 0000000..9196d9e --- /dev/null +++ b/src/mod.js @@ -0,0 +1,46 @@ +"use strict"; +const modName = "Chomp-LabsRaiderSpawnFix"; + +class Mod +{ + constructor() + { + Logger.info(`Loading: ${modName} 1.0.0`); + let changeCount = 0; + + const labsBosses = DatabaseServer.tables.locations.laboratory.base.BossLocationSpawn; + const reserveBosses = DatabaseServer.tables.locations.rezervbase.base.BossLocationSpawn; + + const spawn1 = labsBosses.find(x => x.TriggerId === "autoId_00008_EXFIL"); + if (spawn1) + { + spawn1.TriggerId = "00404"; + changeCount++; + } + + const spawn2 = labsBosses.find(x => x.TriggerId === "autoId_00010_EXFIL"); + if (spawn2) + { + spawn2.TriggerId = "00409"; + changeCount++; + } + + const spawn3 = reserveBosses.find(x => x.TriggerId === "00457"); + if (spawn3) + { + spawn3.TriggerId = "autoId_00632_EXFIL"; + changeCount++; + } + + const spawn4 = reserveBosses.find(x => x.TriggerId === "00452"); + if (spawn4) + { + spawn4.TriggerId = "autoId_00000_D2_LEVER"; + changeCount++; + } + + Logger.info(`${changeCount} spawn triggers fixed`); + } +} + +module.exports.Mod = Mod; \ No newline at end of file