UNPKG

fxr-reloader

Version:

Reload, respawn, and extract FXRs in Elden Ring while the game is running.

825 lines 46.4 kB
export var Weapon; (function (Weapon) { Weapon[Weapon["Unarmed"] = 110000] = "Unarmed"; Weapon[Weapon["Dagger"] = 1000000] = "Dagger"; Weapon[Weapon["BlackKnife"] = 1010000] = "BlackKnife"; Weapon[Weapon["ParryingDagger"] = 1020000] = "ParryingDagger"; Weapon[Weapon["Misericorde"] = 1030000] = "Misericorde"; Weapon[Weapon["Reduvia"] = 1040000] = "Reduvia"; Weapon[Weapon["CrystalKnife"] = 1050000] = "CrystalKnife"; Weapon[Weapon["CelebrantsSickle"] = 1060000] = "CelebrantsSickle"; Weapon[Weapon["GlintstoneKris"] = 1070000] = "GlintstoneKris"; Weapon[Weapon["ScorpionsStinger"] = 1080000] = "ScorpionsStinger"; Weapon[Weapon["GreatKnife"] = 1090000] = "GreatKnife"; Weapon[Weapon["Wakizashi"] = 1100000] = "Wakizashi"; Weapon[Weapon["Cinquedea"] = 1110000] = "Cinquedea"; Weapon[Weapon["IvorySickle"] = 1130000] = "IvorySickle"; Weapon[Weapon["BloodstainedDagger"] = 1140000] = "BloodstainedDagger"; Weapon[Weapon["ErdsteelDagger"] = 1150000] = "ErdsteelDagger"; Weapon[Weapon["BladeOfCalling"] = 1160000] = "BladeOfCalling"; Weapon[Weapon["Longsword"] = 2000000] = "Longsword"; Weapon[Weapon["ShortSword"] = 2010000] = "ShortSword"; Weapon[Weapon["Broadsword"] = 2020000] = "Broadsword"; Weapon[Weapon["RoyalSoldierStraightSword"] = 2030000] = "RoyalSoldierStraightSword"; Weapon[Weapon["LordswornsStraightSword"] = 2040000] = "LordswornsStraightSword"; Weapon[Weapon["WeatheredStraightSword"] = 2050000] = "WeatheredStraightSword"; Weapon[Weapon["OrnamentalStraightSword"] = 2060000] = "OrnamentalStraightSword"; Weapon[Weapon["GoldenEpitaph"] = 2070000] = "GoldenEpitaph"; Weapon[Weapon["NoxFlowingSword"] = 2080000] = "NoxFlowingSword"; Weapon[Weapon["InseparableSword"] = 2090000] = "InseparableSword"; Weapon[Weapon["CodedSword"] = 2110000] = "CodedSword"; Weapon[Weapon["SwordOfNightAndFlame"] = 2140000] = "SwordOfNightAndFlame"; Weapon[Weapon["CrystalSword"] = 2150000] = "CrystalSword"; Weapon[Weapon["CarianKnightsSword"] = 2180000] = "CarianKnightsSword"; Weapon[Weapon["SwordOfStTrina"] = 2190000] = "SwordOfStTrina"; Weapon[Weapon["MiquellanKnightsSword"] = 2200000] = "MiquellanKnightsSword"; Weapon[Weapon["CaneSword"] = 2210000] = "CaneSword"; Weapon[Weapon["RegaliaOfEochaid"] = 2220000] = "RegaliaOfEochaid"; Weapon[Weapon["NoblesSlenderSword"] = 2230000] = "NoblesSlenderSword"; Weapon[Weapon["WarhawksTalon"] = 2240000] = "WarhawksTalon"; Weapon[Weapon["LazuliGlintstoneSword"] = 2250000] = "LazuliGlintstoneSword"; Weapon[Weapon["RottenCrystalSword"] = 2260000] = "RottenCrystalSword"; Weapon[Weapon["BastardSword"] = 3000000] = "BastardSword"; Weapon[Weapon["ForkedGreatsword"] = 3010000] = "ForkedGreatsword"; Weapon[Weapon["IronGreatsword"] = 3020000] = "IronGreatsword"; Weapon[Weapon["LordswornsGreatsword"] = 3030000] = "LordswornsGreatsword"; Weapon[Weapon["KnightsGreatsword"] = 3040000] = "KnightsGreatsword"; Weapon[Weapon["Flamberge"] = 3050000] = "Flamberge"; Weapon[Weapon["OrdovissGreatsword"] = 3060000] = "OrdovissGreatsword"; Weapon[Weapon["AlabasterLordsSword"] = 3070000] = "AlabasterLordsSword"; Weapon[Weapon["BanishedKnightsGreatsword"] = 3080000] = "BanishedKnightsGreatsword"; Weapon[Weapon["DarkMoonGreatsword"] = 3090000] = "DarkMoonGreatsword"; Weapon[Weapon["SacredRelicSword"] = 3100000] = "SacredRelicSword"; Weapon[Weapon["HelphensSteeple"] = 3130000] = "HelphensSteeple"; Weapon[Weapon["BlasphemousBlade"] = 3140000] = "BlasphemousBlade"; Weapon[Weapon["MaraisExecutionersSword"] = 3150000] = "MaraisExecutionersSword"; Weapon[Weapon["SwordOfMilos"] = 3160000] = "SwordOfMilos"; Weapon[Weapon["GoldenOrderGreatsword"] = 3170000] = "GoldenOrderGreatsword"; Weapon[Weapon["Claymore"] = 3180000] = "Claymore"; Weapon[Weapon["GargoylesGreatsword"] = 3190000] = "GargoylesGreatsword"; Weapon[Weapon["DeathsPoker"] = 3200000] = "DeathsPoker"; Weapon[Weapon["GargoylesBlackblade"] = 3210000] = "GargoylesBlackblade"; Weapon[Weapon["Greatsword"] = 4000000] = "Greatsword"; Weapon[Weapon["WatchdogsGreatsword"] = 4010000] = "WatchdogsGreatsword"; Weapon[Weapon["MalikethsBlackBlade"] = 4020000] = "MalikethsBlackBlade"; Weapon[Weapon["TrollsGoldenSword"] = 4030000] = "TrollsGoldenSword"; Weapon[Weapon["Zweihander"] = 4040000] = "Zweihander"; Weapon[Weapon["StarscourgeGreatsword"] = 4050000] = "StarscourgeGreatsword"; Weapon[Weapon["RoyalGreatsword"] = 4060000] = "RoyalGreatsword"; Weapon[Weapon["GodslayersGreatsword"] = 4070000] = "GodslayersGreatsword"; Weapon[Weapon["RuinsGreatsword"] = 4080000] = "RuinsGreatsword"; Weapon[Weapon["GraftedBladeGreatsword"] = 4100000] = "GraftedBladeGreatsword"; Weapon[Weapon["TrollKnightsSword"] = 4110000] = "TrollKnightsSword"; Weapon[Weapon["Estoc"] = 5000000] = "Estoc"; Weapon[Weapon["CleanrotKnightsSword"] = 5010000] = "CleanrotKnightsSword"; Weapon[Weapon["Rapier"] = 5020000] = "Rapier"; Weapon[Weapon["RogiersRapier"] = 5030000] = "RogiersRapier"; Weapon[Weapon["AntspurRapier"] = 5040000] = "AntspurRapier"; Weapon[Weapon["FrozenNeedle"] = 5050000] = "FrozenNeedle"; Weapon[Weapon["NoblesEstoc"] = 5060000] = "NoblesEstoc"; Weapon[Weapon["BloodyHelice"] = 6000000] = "BloodyHelice"; Weapon[Weapon["GodskinStitcher"] = 6010000] = "GodskinStitcher"; Weapon[Weapon["GreatEpee"] = 6020000] = "GreatEpee"; Weapon[Weapon["DragonKingsCragblade"] = 6040000] = "DragonKingsCragblade"; Weapon[Weapon["Falchion"] = 7000000] = "Falchion"; Weapon[Weapon["BeastmansCurvedSword"] = 7010000] = "BeastmansCurvedSword"; Weapon[Weapon["Shotel"] = 7020000] = "Shotel"; Weapon[Weapon["Shamshir"] = 7030000] = "Shamshir"; Weapon[Weapon["BanditsCurvedSword"] = 7040000] = "BanditsCurvedSword"; Weapon[Weapon["MagmaBlade"] = 7050000] = "MagmaBlade"; Weapon[Weapon["FlowingCurvedSword"] = 7060000] = "FlowingCurvedSword"; Weapon[Weapon["WingOfAstel"] = 7070000] = "WingOfAstel"; Weapon[Weapon["ScavengersCurvedSword"] = 7080000] = "ScavengersCurvedSword"; Weapon[Weapon["SharktoothCurvedSword"] = 7090000] = "SharktoothCurvedSword"; Weapon[Weapon["EclipseShotel"] = 7100000] = "EclipseShotel"; Weapon[Weapon["SerpentGodsCurvedSword"] = 7110000] = "SerpentGodsCurvedSword"; Weapon[Weapon["MantisBlade"] = 7120000] = "MantisBlade"; Weapon[Weapon["Scimitar"] = 7140000] = "Scimitar"; Weapon[Weapon["Grossmesser"] = 7150000] = "Grossmesser"; Weapon[Weapon["OnyxLordsGreatsword"] = 8010000] = "OnyxLordsGreatsword"; Weapon[Weapon["Dismounter"] = 8020000] = "Dismounter"; Weapon[Weapon["BloodhoundsFang"] = 8030000] = "BloodhoundsFang"; Weapon[Weapon["MagmaWyrmsScalesword"] = 8040000] = "MagmaWyrmsScalesword"; Weapon[Weapon["ZamorCurvedSword"] = 8050000] = "ZamorCurvedSword"; Weapon[Weapon["OmenCleaver"] = 8060000] = "OmenCleaver"; Weapon[Weapon["MonksFlameblade"] = 8070000] = "MonksFlameblade"; Weapon[Weapon["BeastmansCleaver"] = 8080000] = "BeastmansCleaver"; Weapon[Weapon["MorgottsCursedSword"] = 8100000] = "MorgottsCursedSword"; Weapon[Weapon["HolyInfernoGreatsword"] = 8110000] = "HolyInfernoGreatsword"; Weapon[Weapon["Uchigatana"] = 9000000] = "Uchigatana"; Weapon[Weapon["Nagakiba"] = 9010000] = "Nagakiba"; Weapon[Weapon["HandOfMalenia"] = 9020000] = "HandOfMalenia"; Weapon[Weapon["MeteoricOreBlade"] = 9030000] = "MeteoricOreBlade"; Weapon[Weapon["RiversOfBlood"] = 9040000] = "RiversOfBlood"; Weapon[Weapon["Moonveil"] = 9060000] = "Moonveil"; Weapon[Weapon["DragonscaleBlade"] = 9070000] = "DragonscaleBlade"; Weapon[Weapon["SerpentboneBlade"] = 9080000] = "SerpentboneBlade"; Weapon[Weapon["Twinblade"] = 10000000] = "Twinblade"; Weapon[Weapon["GodskinPeeler"] = 10010000] = "GodskinPeeler"; Weapon[Weapon["TwinnedKnightSwords"] = 10030000] = "TwinnedKnightSwords"; Weapon[Weapon["EleonorasPoleblade"] = 10050000] = "EleonorasPoleblade"; Weapon[Weapon["AbundanceAndDecayTwinblade"] = 10060000] = "AbundanceAndDecayTwinblade"; Weapon[Weapon["AbundanceTwinblade"] = 10070000] = "AbundanceTwinblade"; Weapon[Weapon["GargoylesTwinblade"] = 10080000] = "GargoylesTwinblade"; Weapon[Weapon["GargoylesBlackBlades"] = 10090000] = "GargoylesBlackBlades"; Weapon[Weapon["Mace"] = 11000000] = "Mace"; Weapon[Weapon["Club"] = 11010000] = "Club"; Weapon[Weapon["CurvedClub"] = 11030000] = "CurvedClub"; Weapon[Weapon["Warpick"] = 11040000] = "Warpick"; Weapon[Weapon["MorningStar"] = 11050000] = "MorningStar"; Weapon[Weapon["VarresBouquet"] = 11060000] = "VarresBouquet"; Weapon[Weapon["SpikedClub"] = 11070000] = "SpikedClub"; Weapon[Weapon["Hammer"] = 11080000] = "Hammer"; Weapon[Weapon["MonksFlamemace"] = 11090000] = "MonksFlamemace"; Weapon[Weapon["EnvoysHorn"] = 11100000] = "EnvoysHorn"; Weapon[Weapon["ScepterOfTheAllKnowing"] = 11110000] = "ScepterOfTheAllKnowing"; Weapon[Weapon["NoxFlowingHammer"] = 11120000] = "NoxFlowingHammer"; Weapon[Weapon["RingedFinger"] = 11130000] = "RingedFinger"; Weapon[Weapon["StoneClub"] = 11140000] = "StoneClub"; Weapon[Weapon["MarikasHammer"] = 11150000] = "MarikasHammer"; Weapon[Weapon["FatherMarikasHammer"] = 11160000] = "FatherMarikasHammer"; Weapon[Weapon["LargeClub"] = 12000000] = "LargeClub"; Weapon[Weapon["GreathornHammer"] = 12010000] = "GreathornHammer"; Weapon[Weapon["BattleHammer"] = 12020000] = "BattleHammer"; Weapon[Weapon["GreatMace"] = 12060000] = "GreatMace"; Weapon[Weapon["CurvedGreatClub"] = 12080000] = "CurvedGreatClub"; Weapon[Weapon["CelebrantsSkull"] = 12130000] = "CelebrantsSkull"; Weapon[Weapon["Pickaxe"] = 12140000] = "Pickaxe"; Weapon[Weapon["BeastclawGreathammer"] = 12150000] = "BeastclawGreathammer"; Weapon[Weapon["EnvoysLongHorn"] = 12160000] = "EnvoysLongHorn"; Weapon[Weapon["CranialVesselCandlestand"] = 12170000] = "CranialVesselCandlestand"; Weapon[Weapon["GreatStars"] = 12180000] = "GreatStars"; Weapon[Weapon["BrickHammer"] = 12190000] = "BrickHammer"; Weapon[Weapon["DevourersScepter"] = 12200000] = "DevourersScepter"; Weapon[Weapon["RottenBattleHammer"] = 12210000] = "RottenBattleHammer"; Weapon[Weapon["NightriderFlail"] = 13000000] = "NightriderFlail"; Weapon[Weapon["Flail"] = 13010000] = "Flail"; Weapon[Weapon["FamilyHeads"] = 13020000] = "FamilyHeads"; Weapon[Weapon["BastardsStars"] = 13030000] = "BastardsStars"; Weapon[Weapon["ChainlinkFlail"] = 13040000] = "ChainlinkFlail"; Weapon[Weapon["BattleAxe"] = 14000000] = "BattleAxe"; Weapon[Weapon["ForkedHatchet"] = 14010000] = "ForkedHatchet"; Weapon[Weapon["HandAxe"] = 14020000] = "HandAxe"; Weapon[Weapon["JawboneAxe"] = 14030000] = "JawboneAxe"; Weapon[Weapon["IronCleaver"] = 14040000] = "IronCleaver"; Weapon[Weapon["RippleBlade"] = 14050000] = "RippleBlade"; Weapon[Weapon["CelebrantsCleaver"] = 14060000] = "CelebrantsCleaver"; Weapon[Weapon["IcerindHatchet"] = 14080000] = "IcerindHatchet"; Weapon[Weapon["HighlandAxe"] = 14100000] = "HighlandAxe"; Weapon[Weapon["SacrificialAxe"] = 14110000] = "SacrificialAxe"; Weapon[Weapon["RosusAxe"] = 14120000] = "RosusAxe"; Weapon[Weapon["BurialAxe"] = 14130000] = "BurialAxe"; Weapon[Weapon["StormhawkAxe"] = 14140000] = "StormhawkAxe"; Weapon[Weapon["Greataxe"] = 15000000] = "Greataxe"; Weapon[Weapon["WarpedAxe"] = 15010000] = "WarpedAxe"; Weapon[Weapon["GreatOmenkillerCleaver"] = 15020000] = "GreatOmenkillerCleaver"; Weapon[Weapon["CrescentMoonAxe"] = 15030000] = "CrescentMoonAxe"; Weapon[Weapon["AxeOfGodrick"] = 15040000] = "AxeOfGodrick"; Weapon[Weapon["LonghaftAxe"] = 15050000] = "LonghaftAxe"; Weapon[Weapon["RustedAnchor"] = 15060000] = "RustedAnchor"; Weapon[Weapon["ExecutionersGreataxe"] = 15080000] = "ExecutionersGreataxe"; Weapon[Weapon["WingedGreathorn"] = 15110000] = "WingedGreathorn"; Weapon[Weapon["ButcheringKnife"] = 15120000] = "ButcheringKnife"; Weapon[Weapon["GargoylesGreatAxe"] = 15130000] = "GargoylesGreatAxe"; Weapon[Weapon["GargoylesBlackAxe"] = 15140000] = "GargoylesBlackAxe"; Weapon[Weapon["ShortSpear"] = 16000000] = "ShortSpear"; Weapon[Weapon["Spear"] = 16010000] = "Spear"; Weapon[Weapon["CrystalSpear"] = 16020000] = "CrystalSpear"; Weapon[Weapon["ClaymansHarpoon"] = 16030000] = "ClaymansHarpoon"; Weapon[Weapon["CleanrotSpear"] = 16040000] = "CleanrotSpear"; Weapon[Weapon["Partisan"] = 16050000] = "Partisan"; Weapon[Weapon["CelebrantsRibRake"] = 16060000] = "CelebrantsRibRake"; Weapon[Weapon["Pike"] = 16070000] = "Pike"; Weapon[Weapon["Torchpole"] = 16080000] = "Torchpole"; Weapon[Weapon["BoltOfGransax"] = 16090000] = "BoltOfGransax"; Weapon[Weapon["CrossNaginata"] = 16110000] = "CrossNaginata"; Weapon[Weapon["DeathRitualSpear"] = 16120000] = "DeathRitualSpear"; Weapon[Weapon["InquisitorsGirandole"] = 16130000] = "InquisitorsGirandole"; Weapon[Weapon["SpikedSpear"] = 16140000] = "SpikedSpear"; Weapon[Weapon["IronSpear"] = 16150000] = "IronSpear"; Weapon[Weapon["RottenCrystalSpear"] = 16160000] = "RottenCrystalSpear"; Weapon[Weapon["MohgwynsSacredSpear"] = 17010000] = "MohgwynsSacredSpear"; Weapon[Weapon["SiluriasTree"] = 17020000] = "SiluriasTree"; Weapon[Weapon["SerpentHunter"] = 17030000] = "SerpentHunter"; Weapon[Weapon["VykesWarSpear"] = 17050000] = "VykesWarSpear"; Weapon[Weapon["Lance"] = 17060000] = "Lance"; Weapon[Weapon["Treespear"] = 17070000] = "Treespear"; Weapon[Weapon["Halberd"] = 18000000] = "Halberd"; Weapon[Weapon["PestsGlaive"] = 18010000] = "PestsGlaive"; Weapon[Weapon["Lucerne"] = 18020000] = "Lucerne"; Weapon[Weapon["BanishedKnightsHalberd"] = 18030000] = "BanishedKnightsHalberd"; Weapon[Weapon["CommandersStandard"] = 18040000] = "CommandersStandard"; Weapon[Weapon["NightriderGlaive"] = 18050000] = "NightriderGlaive"; Weapon[Weapon["RippleCrescentHalberd"] = 18060000] = "RippleCrescentHalberd"; Weapon[Weapon["VulgarMilitiaSaw"] = 18070000] = "VulgarMilitiaSaw"; Weapon[Weapon["GoldenHalberd"] = 18080000] = "GoldenHalberd"; Weapon[Weapon["Glaive"] = 18090000] = "Glaive"; Weapon[Weapon["LorettasWarSickle"] = 18100000] = "LorettasWarSickle"; Weapon[Weapon["GuardiansSwordspear"] = 18110000] = "GuardiansSwordspear"; Weapon[Weapon["VulgarMilitiaShotel"] = 18130000] = "VulgarMilitiaShotel"; Weapon[Weapon["DragonHalberd"] = 18140000] = "DragonHalberd"; Weapon[Weapon["GargoylesHalberd"] = 18150000] = "GargoylesHalberd"; Weapon[Weapon["GargoylesBlackHalberd"] = 18160000] = "GargoylesBlackHalberd"; Weapon[Weapon["Scythe"] = 19000000] = "Scythe"; Weapon[Weapon["GraveScythe"] = 19010000] = "GraveScythe"; Weapon[Weapon["HaloScythe"] = 19020000] = "HaloScythe"; Weapon[Weapon["HereticsHook"] = 19050000] = "HereticsHook"; Weapon[Weapon["WingedScythe"] = 19060000] = "WingedScythe"; Weapon[Weapon["Whip"] = 20000000] = "Whip"; Weapon[Weapon["ThornedWhip"] = 20020000] = "ThornedWhip"; Weapon[Weapon["MagmaWhipCandlestick"] = 20030000] = "MagmaWhipCandlestick"; Weapon[Weapon["HoslowsPetalWhip"] = 20050000] = "HoslowsPetalWhip"; Weapon[Weapon["GiantsRedBraid"] = 20060000] = "GiantsRedBraid"; Weapon[Weapon["Urumi"] = 20070000] = "Urumi"; Weapon[Weapon["Caestus"] = 21000000] = "Caestus"; Weapon[Weapon["SpikedCaestus"] = 21010000] = "SpikedCaestus"; Weapon[Weapon["GraftedDragon"] = 21060000] = "GraftedDragon"; Weapon[Weapon["IronBall"] = 21070000] = "IronBall"; Weapon[Weapon["StarFist"] = 21080000] = "StarFist"; Weapon[Weapon["Katar"] = 21100000] = "Katar"; Weapon[Weapon["ClingingBone"] = 21110000] = "ClingingBone"; Weapon[Weapon["VeteransProsthesis"] = 21120000] = "VeteransProsthesis"; Weapon[Weapon["CipherPata"] = 21130000] = "CipherPata"; Weapon[Weapon["Hookclaws"] = 22000000] = "Hookclaws"; Weapon[Weapon["VenomousFang"] = 22010000] = "VenomousFang"; Weapon[Weapon["BloodhoundClaws"] = 22020000] = "BloodhoundClaws"; Weapon[Weapon["RaptorTalons"] = 22030000] = "RaptorTalons"; Weapon[Weapon["PrelatesInfernoCrozier"] = 23000000] = "PrelatesInfernoCrozier"; Weapon[Weapon["WatchdogsStaff"] = 23010000] = "WatchdogsStaff"; Weapon[Weapon["GreatClub"] = 23020000] = "GreatClub"; Weapon[Weapon["EnvoysGreathorn"] = 23030000] = "EnvoysGreathorn"; Weapon[Weapon["DuelistGreataxe"] = 23040000] = "DuelistGreataxe"; Weapon[Weapon["AxeOfGodfrey"] = 23050000] = "AxeOfGodfrey"; Weapon[Weapon["DragonGreatclaw"] = 23060000] = "DragonGreatclaw"; Weapon[Weapon["StaffOfTheAvatar"] = 23070000] = "StaffOfTheAvatar"; Weapon[Weapon["FallingstarBeastJaw"] = 23080000] = "FallingstarBeastJaw"; Weapon[Weapon["GhizasWheel"] = 23100000] = "GhizasWheel"; Weapon[Weapon["GiantCrusher"] = 23110000] = "GiantCrusher"; Weapon[Weapon["GolemsHalberd"] = 23120000] = "GolemsHalberd"; Weapon[Weapon["TrollsHammer"] = 23130000] = "TrollsHammer"; Weapon[Weapon["RottenStaff"] = 23140000] = "RottenStaff"; Weapon[Weapon["RottenGreataxe"] = 23150000] = "RottenGreataxe"; Weapon[Weapon["Torch"] = 24000000] = "Torch"; Weapon[Weapon["SteelWireTorch"] = 24020000] = "SteelWireTorch"; Weapon[Weapon["StTrinasTorch"] = 24040000] = "StTrinasTorch"; Weapon[Weapon["GhostflameTorch"] = 24050000] = "GhostflameTorch"; Weapon[Weapon["BeastRepellentTorch"] = 24060000] = "BeastRepellentTorch"; Weapon[Weapon["SentrysTorch"] = 24070000] = "SentrysTorch"; Weapon[Weapon["Buckler"] = 30000000] = "Buckler"; Weapon[Weapon["PerfumersShield"] = 30010000] = "PerfumersShield"; Weapon[Weapon["ManSerpentsShield"] = 30020000] = "ManSerpentsShield"; Weapon[Weapon["RicketyShield"] = 30030000] = "RicketyShield"; Weapon[Weapon["PilloryShield"] = 30040000] = "PilloryShield"; Weapon[Weapon["BeastmansJarShield"] = 30060000] = "BeastmansJarShield"; Weapon[Weapon["RedThornRoundshield"] = 30070000] = "RedThornRoundshield"; Weapon[Weapon["ScriptureWoodenShield"] = 30080000] = "ScriptureWoodenShield"; Weapon[Weapon["RivetedWoodenShield"] = 30090000] = "RivetedWoodenShield"; Weapon[Weapon["BlueWhiteWoodenShield"] = 30100000] = "BlueWhiteWoodenShield"; Weapon[Weapon["RiftShield"] = 30110000] = "RiftShield"; Weapon[Weapon["IronRoundshield"] = 30120000] = "IronRoundshield"; Weapon[Weapon["GildedIronShield"] = 30130000] = "GildedIronShield"; Weapon[Weapon["IceCrestShield"] = 30140000] = "IceCrestShield"; Weapon[Weapon["SmolderingShield"] = 30150000] = "SmolderingShield"; Weapon[Weapon["SpiralhornShield"] = 30190000] = "SpiralhornShield"; Weapon[Weapon["CoilShield"] = 30200000] = "CoilShield"; Weapon[Weapon["KiteShield"] = 31000000] = "KiteShield"; Weapon[Weapon["MarredLeatherShield"] = 31010000] = "MarredLeatherShield"; Weapon[Weapon["MarredWoodenShield"] = 31020000] = "MarredWoodenShield"; Weapon[Weapon["BanishedKnightsShield"] = 31030000] = "BanishedKnightsShield"; Weapon[Weapon["AlbinauricShield"] = 31040000] = "AlbinauricShield"; Weapon[Weapon["SunRealmShield"] = 31050000] = "SunRealmShield"; Weapon[Weapon["SilverMirrorshield"] = 31060000] = "SilverMirrorshield"; Weapon[Weapon["RoundShield"] = 31070000] = "RoundShield"; Weapon[Weapon["ScorpionKiteShield"] = 31080000] = "ScorpionKiteShield"; Weapon[Weapon["TwinbirdKiteShield"] = 31090000] = "TwinbirdKiteShield"; Weapon[Weapon["BlueGoldKiteShield"] = 31100000] = "BlueGoldKiteShield"; Weapon[Weapon["BrassShield"] = 31130000] = "BrassShield"; Weapon[Weapon["GreatTurtleShell"] = 31140000] = "GreatTurtleShell"; Weapon[Weapon["ShieldOfTheGuilty"] = 31170000] = "ShieldOfTheGuilty"; Weapon[Weapon["CarianKnightsShield"] = 31190000] = "CarianKnightsShield"; Weapon[Weapon["LargeLeatherShield"] = 31230000] = "LargeLeatherShield"; Weapon[Weapon["HorseCrestWoodenShield"] = 31240000] = "HorseCrestWoodenShield"; Weapon[Weapon["CandletreeWoodenShield"] = 31250000] = "CandletreeWoodenShield"; Weapon[Weapon["FlameCrestWoodenShield"] = 31260000] = "FlameCrestWoodenShield"; Weapon[Weapon["HawkCrestWoodenShield"] = 31270000] = "HawkCrestWoodenShield"; Weapon[Weapon["BeastCrestHeaterShield"] = 31280000] = "BeastCrestHeaterShield"; Weapon[Weapon["RedCrestHeaterShield"] = 31290000] = "RedCrestHeaterShield"; Weapon[Weapon["BlueCrestHeaterShield"] = 31300000] = "BlueCrestHeaterShield"; Weapon[Weapon["EclipseCrestHeaterShield"] = 31310000] = "EclipseCrestHeaterShield"; Weapon[Weapon["InvertedHawkHeaterShield"] = 31320000] = "InvertedHawkHeaterShield"; Weapon[Weapon["HeaterShield"] = 31330000] = "HeaterShield"; Weapon[Weapon["BlackLeatherShield"] = 31340000] = "BlackLeatherShield"; Weapon[Weapon["DragonTowershield"] = 32000000] = "DragonTowershield"; Weapon[Weapon["DistinguishedGreatshield"] = 32020000] = "DistinguishedGreatshield"; Weapon[Weapon["CrucibleHornshield"] = 32030000] = "CrucibleHornshield"; Weapon[Weapon["DragonclawShield"] = 32040000] = "DragonclawShield"; Weapon[Weapon["BriarGreatshield"] = 32050000] = "BriarGreatshield"; Weapon[Weapon["ErdtreeGreatshield"] = 32080000] = "ErdtreeGreatshield"; Weapon[Weapon["GoldenBeastCrestShield"] = 32090000] = "GoldenBeastCrestShield"; Weapon[Weapon["JellyfishShield"] = 32120000] = "JellyfishShield"; Weapon[Weapon["FingerprintStoneShield"] = 32130000] = "FingerprintStoneShield"; Weapon[Weapon["IconShield"] = 32140000] = "IconShield"; Weapon[Weapon["OneEyedShield"] = 32150000] = "OneEyedShield"; Weapon[Weapon["VisageShield"] = 32160000] = "VisageShield"; Weapon[Weapon["SpikedPalisadeShield"] = 32170000] = "SpikedPalisadeShield"; Weapon[Weapon["ManorTowershield"] = 32190000] = "ManorTowershield"; Weapon[Weapon["CrossedTreeTowershield"] = 32200000] = "CrossedTreeTowershield"; Weapon[Weapon["InvertedHawkTowershield"] = 32210000] = "InvertedHawkTowershield"; Weapon[Weapon["AntsSkullPlate"] = 32220000] = "AntsSkullPlate"; Weapon[Weapon["RedmaneGreatshield"] = 32230000] = "RedmaneGreatshield"; Weapon[Weapon["EclipseCrestGreatshield"] = 32240000] = "EclipseCrestGreatshield"; Weapon[Weapon["CuckooGreatshield"] = 32250000] = "CuckooGreatshield"; Weapon[Weapon["GoldenGreatshield"] = 32260000] = "GoldenGreatshield"; Weapon[Weapon["GildedGreatshield"] = 32270000] = "GildedGreatshield"; Weapon[Weapon["HaligtreeCrestGreatshield"] = 32280000] = "HaligtreeCrestGreatshield"; Weapon[Weapon["WoodenGreatshield"] = 32290000] = "WoodenGreatshield"; Weapon[Weapon["LordswornsShield"] = 32300000] = "LordswornsShield"; Weapon[Weapon["GlintstoneStaff"] = 33000000] = "GlintstoneStaff"; Weapon[Weapon["CrystalStaff"] = 33040000] = "CrystalStaff"; Weapon[Weapon["GelmirGlintstoneStaff"] = 33050000] = "GelmirGlintstoneStaff"; Weapon[Weapon["DemiHumanQueensStaff"] = 33060000] = "DemiHumanQueensStaff"; Weapon[Weapon["CarianRegalScepter"] = 33090000] = "CarianRegalScepter"; Weapon[Weapon["DiggersStaff"] = 33120000] = "DiggersStaff"; Weapon[Weapon["AstrologersStaff"] = 33130000] = "AstrologersStaff"; Weapon[Weapon["CarianGlintbladeStaff"] = 33170000] = "CarianGlintbladeStaff"; Weapon[Weapon["PrinceOfDeathsStaff"] = 33180000] = "PrinceOfDeathsStaff"; Weapon[Weapon["AlbinauricStaff"] = 33190000] = "AlbinauricStaff"; Weapon[Weapon["AcademyGlintstoneStaff"] = 33200000] = "AcademyGlintstoneStaff"; Weapon[Weapon["CarianGlintstoneStaff"] = 33210000] = "CarianGlintstoneStaff"; Weapon[Weapon["AzursGlintstoneStaff"] = 33230000] = "AzursGlintstoneStaff"; Weapon[Weapon["LusatsGlintstoneStaff"] = 33240000] = "LusatsGlintstoneStaff"; Weapon[Weapon["MeteoriteStaff"] = 33250000] = "MeteoriteStaff"; Weapon[Weapon["StaffOfTheGuilty"] = 33260000] = "StaffOfTheGuilty"; Weapon[Weapon["RottenCrystalStaff"] = 33270000] = "RottenCrystalStaff"; Weapon[Weapon["StaffOfLoss"] = 33280000] = "StaffOfLoss"; Weapon[Weapon["FingerSeal"] = 34000000] = "FingerSeal"; Weapon[Weapon["GodslayersSeal"] = 34010000] = "GodslayersSeal"; Weapon[Weapon["GiantsSeal"] = 34020000] = "GiantsSeal"; Weapon[Weapon["GravelStoneSeal"] = 34030000] = "GravelStoneSeal"; Weapon[Weapon["ClawmarkSeal"] = 34040000] = "ClawmarkSeal"; Weapon[Weapon["GoldenOrderSeal"] = 34060000] = "GoldenOrderSeal"; Weapon[Weapon["ErdtreeSeal"] = 34070000] = "ErdtreeSeal"; Weapon[Weapon["DragonCommunionSeal"] = 34080000] = "DragonCommunionSeal"; Weapon[Weapon["FrenziedFlameSeal"] = 34090000] = "FrenziedFlameSeal"; Weapon[Weapon["Shortbow"] = 40000000] = "Shortbow"; Weapon[Weapon["MisbegottenShortbow"] = 40010000] = "MisbegottenShortbow"; Weapon[Weapon["RedBranchShortbow"] = 40020000] = "RedBranchShortbow"; Weapon[Weapon["HarpBow"] = 40030000] = "HarpBow"; Weapon[Weapon["CompositeBow"] = 40050000] = "CompositeBow"; Weapon[Weapon["Longbow"] = 41000000] = "Longbow"; Weapon[Weapon["AlbinauricBow"] = 41010000] = "AlbinauricBow"; Weapon[Weapon["HornBow"] = 41020000] = "HornBow"; Weapon[Weapon["ErdtreeBow"] = 41030000] = "ErdtreeBow"; Weapon[Weapon["SerpentBow"] = 41040000] = "SerpentBow"; Weapon[Weapon["PulleyBow"] = 41060000] = "PulleyBow"; Weapon[Weapon["BlackBow"] = 41070000] = "BlackBow"; Weapon[Weapon["LionGreatbow"] = 42000000] = "LionGreatbow"; Weapon[Weapon["GolemGreatbow"] = 42010000] = "GolemGreatbow"; Weapon[Weapon["ErdtreeGreatbow"] = 42030000] = "ErdtreeGreatbow"; Weapon[Weapon["Greatbow"] = 42040000] = "Greatbow"; Weapon[Weapon["SoldiersCrossbow"] = 43000000] = "SoldiersCrossbow"; Weapon[Weapon["LightCrossbow"] = 43020000] = "LightCrossbow"; Weapon[Weapon["HeavyCrossbow"] = 43030000] = "HeavyCrossbow"; Weapon[Weapon["PulleyCrossbow"] = 43050000] = "PulleyCrossbow"; Weapon[Weapon["FullMoonCrossbow"] = 43060000] = "FullMoonCrossbow"; Weapon[Weapon["Arbalest"] = 43080000] = "Arbalest"; Weapon[Weapon["BuckshotCrossbow"] = 43100000] = "BuckshotCrossbow"; Weapon[Weapon["CrepussBlackKeyCrossbow"] = 43110000] = "CrepussBlackKeyCrossbow"; Weapon[Weapon["HandBallista"] = 44000000] = "HandBallista"; Weapon[Weapon["JarCannon"] = 44010000] = "JarCannon"; Weapon[Weapon["Maingauche"] = 1500000] = "Maingauche"; Weapon[Weapon["FireKnightsShortsword"] = 1510000] = "FireKnightsShortsword"; Weapon[Weapon["VelvetSwordOfStTrina"] = 2510000] = "VelvetSwordOfStTrina"; Weapon[Weapon["StarLinedSword"] = 2520000] = "StarLinedSword"; Weapon[Weapon["CarianSorcerySword"] = 2530000] = "CarianSorcerySword"; Weapon[Weapon["StoneSheathedSword"] = 2540000] = "StoneSheathedSword"; Weapon[Weapon["SwordOfLight"] = 2550000] = "SwordOfLight"; Weapon[Weapon["SwordOfDarkness"] = 2560000] = "SwordOfDarkness"; Weapon[Weapon["SwordLance"] = 3500000] = "SwordLance"; Weapon[Weapon["GreatswordOfDamnation"] = 3510000] = "GreatswordOfDamnation"; Weapon[Weapon["LizardGreatsword"] = 3520000] = "LizardGreatsword"; Weapon[Weapon["GreatswordOfSolitude"] = 3550000] = "GreatswordOfSolitude"; Weapon[Weapon["AncientMeteoricOreGreatsword"] = 4500000] = "AncientMeteoricOreGreatsword"; Weapon[Weapon["FireKnightsGreatsword"] = 4520000] = "FireKnightsGreatsword"; Weapon[Weapon["GreatswordOfRadahnLord"] = 4530000] = "GreatswordOfRadahnLord"; Weapon[Weapon["MoonrithyllsKnightSword"] = 4540000] = "MoonrithyllsKnightSword"; Weapon[Weapon["GreatswordOfRadahnLight"] = 4550000] = "GreatswordOfRadahnLight"; Weapon[Weapon["QueelignsGreatsword"] = 6500000] = "QueelignsGreatsword"; Weapon[Weapon["SpiritSword"] = 7500000] = "SpiritSword"; Weapon[Weapon["Falx"] = 7510000] = "Falx"; Weapon[Weapon["DancingBladeOfRanah"] = 7520000] = "DancingBladeOfRanah"; Weapon[Weapon["HornedWarriorsSword"] = 7530000] = "HornedWarriorsSword"; Weapon[Weapon["PutrescenceCleaver"] = 8500000] = "PutrescenceCleaver"; Weapon[Weapon["FreyjasGreatsword"] = 8510000] = "FreyjasGreatsword"; Weapon[Weapon["HornedWarriorsGreatsword"] = 8520000] = "HornedWarriorsGreatsword"; Weapon[Weapon["SwordOfNight"] = 9500000] = "SwordOfNight"; Weapon[Weapon["Euporia"] = 10500000] = "Euporia"; Weapon[Weapon["BlackSteelTwinblade"] = 10510000] = "BlackSteelTwinblade"; Weapon[Weapon["FlowerstoneGavel"] = 11500000] = "FlowerstoneGavel"; Weapon[Weapon["SmithscriptGreathammer"] = 12500000] = "SmithscriptGreathammer"; Weapon[Weapon["AnvilHammer"] = 12510000] = "AnvilHammer"; Weapon[Weapon["BlackSteelGreathammer"] = 12520000] = "BlackSteelGreathammer"; Weapon[Weapon["BloodfiendsArm"] = 12530000] = "BloodfiendsArm"; Weapon[Weapon["SerpentFlail"] = 13500000] = "SerpentFlail"; Weapon[Weapon["SmithscriptAxe"] = 14500000] = "SmithscriptAxe"; Weapon[Weapon["DeathKnightsTwinAxes"] = 14510000] = "DeathKnightsTwinAxes"; Weapon[Weapon["MessmerSoldiersAxe"] = 14520000] = "MessmerSoldiersAxe"; Weapon[Weapon["ForkedTongueHatchet"] = 14540000] = "ForkedTongueHatchet"; Weapon[Weapon["DeathKnightsLonghaftAxe"] = 15500000] = "DeathKnightsLonghaftAxe"; Weapon[Weapon["BonnyButcheringKnife"] = 15510000] = "BonnyButcheringKnife"; Weapon[Weapon["SmithscriptSpear"] = 16500000] = "SmithscriptSpear"; Weapon[Weapon["SwiftSpear"] = 16520000] = "SwiftSpear"; Weapon[Weapon["BloodfiendsFork"] = 16540000] = "BloodfiendsFork"; Weapon[Weapon["BloodfiendsSacredSpear"] = 16550000] = "BloodfiendsSacredSpear"; Weapon[Weapon["SpearOfTheImpaler"] = 17500000] = "SpearOfTheImpaler"; Weapon[Weapon["MessmerSoldiersSpear"] = 17510000] = "MessmerSoldiersSpear"; Weapon[Weapon["BarbedStaffSpear"] = 17520000] = "BarbedStaffSpear"; Weapon[Weapon["SpiritGlaive"] = 18500000] = "SpiritGlaive"; Weapon[Weapon["PolebladeOfTheBud"] = 18510000] = "PolebladeOfTheBud"; Weapon[Weapon["ObsidianLamina"] = 19500000] = "ObsidianLamina"; Weapon[Weapon["ToothWhip"] = 20500000] = "ToothWhip"; Weapon[Weapon["ThiolliersHiddenNeedle"] = 21500000] = "ThiolliersHiddenNeedle"; Weapon[Weapon["Pata"] = 21510000] = "Pata"; Weapon[Weapon["PoisonedHand"] = 21520000] = "PoisonedHand"; Weapon[Weapon["MaddingHand"] = 21530000] = "MaddingHand"; Weapon[Weapon["GolemFist"] = 21540000] = "GolemFist"; Weapon[Weapon["ShieldOfNight"] = 21550000] = "ShieldOfNight"; Weapon[Weapon["ClawsOfNight"] = 22500000] = "ClawsOfNight"; Weapon[Weapon["DevoniasHammer"] = 23500000] = "DevoniasHammer"; Weapon[Weapon["ShadowSunflowerBlossom"] = 23510000] = "ShadowSunflowerBlossom"; Weapon[Weapon["GazingFinger"] = 23520000] = "GazingFinger"; Weapon[Weapon["NanayasTorch"] = 24500000] = "NanayasTorch"; Weapon[Weapon["LamentingVisage"] = 24510000] = "LamentingVisage"; Weapon[Weapon["SmithscriptShield"] = 30510000] = "SmithscriptShield"; Weapon[Weapon["MessmerSoldierShield"] = 31500000] = "MessmerSoldierShield"; Weapon[Weapon["WolfCrestShield"] = 31510000] = "WolfCrestShield"; Weapon[Weapon["SerpentCrestShield"] = 31520000] = "SerpentCrestShield"; Weapon[Weapon["GoldenLionShield"] = 31530000] = "GoldenLionShield"; Weapon[Weapon["BlackSteelGreatshield"] = 32500000] = "BlackSteelGreatshield"; Weapon[Weapon["VerdigrisGreatshield"] = 32520000] = "VerdigrisGreatshield"; Weapon[Weapon["StaffOfTheGreatBeyond"] = 33510000] = "StaffOfTheGreatBeyond"; Weapon[Weapon["MaternalStaff"] = 33520000] = "MaternalStaff"; Weapon[Weapon["DryleafSeal"] = 34500000] = "DryleafSeal"; Weapon[Weapon["FireKnightsSeal"] = 34510000] = "FireKnightsSeal"; Weapon[Weapon["SpiraltreeSeal"] = 34520000] = "SpiraltreeSeal"; Weapon[Weapon["BoneBow"] = 40500000] = "BoneBow"; Weapon[Weapon["AnsbachsLongbow"] = 41510000] = "AnsbachsLongbow"; Weapon[Weapon["IgonsGreatbow"] = 42500000] = "IgonsGreatbow"; Weapon[Weapon["RepeatingCrossbow"] = 43500000] = "RepeatingCrossbow"; Weapon[Weapon["SpreadCrossbow"] = 43510000] = "SpreadCrossbow"; Weapon[Weapon["RabbathsCannon"] = 44500000] = "RabbathsCannon"; Weapon[Weapon["PiqueboneArrowFletched"] = 50540000] = "PiqueboneArrowFletched"; Weapon[Weapon["PiqueboneArrow"] = 50550000] = "PiqueboneArrow"; Weapon[Weapon["IgonsHarpoon"] = 51500000] = "IgonsHarpoon"; Weapon[Weapon["PiqueboneBolt"] = 52520000] = "PiqueboneBolt"; Weapon[Weapon["RabbathsGreatbolt"] = 53500000] = "RabbathsGreatbolt"; Weapon[Weapon["DryleafArts"] = 60500000] = "DryleafArts"; Weapon[Weapon["DanesFootwork"] = 60510000] = "DanesFootwork"; Weapon[Weapon["FiresparkPerfumeBottle"] = 61500000] = "FiresparkPerfumeBottle"; Weapon[Weapon["ChillingPerfumeBottle"] = 61510000] = "ChillingPerfumeBottle"; Weapon[Weapon["FrenzyflamePerfumeBottle"] = 61520000] = "FrenzyflamePerfumeBottle"; Weapon[Weapon["LightningPerfumeBottle"] = 61530000] = "LightningPerfumeBottle"; Weapon[Weapon["DeadlyPoisonPerfumeBottle"] = 61540000] = "DeadlyPoisonPerfumeBottle"; Weapon[Weapon["DuelingShield"] = 62500000] = "DuelingShield"; Weapon[Weapon["CarianThrustingShield"] = 62510000] = "CarianThrustingShield"; Weapon[Weapon["SmithscriptDagger"] = 63500000] = "SmithscriptDagger"; Weapon[Weapon["BackhandBlade"] = 64500000] = "BackhandBlade"; Weapon[Weapon["SmithscriptCirque"] = 64510000] = "SmithscriptCirque"; Weapon[Weapon["CursebladesCirque"] = 64520000] = "CursebladesCirque"; Weapon[Weapon["GreatKatana"] = 66500000] = "GreatKatana"; Weapon[Weapon["DragonHuntersGreatKatana"] = 66510000] = "DragonHuntersGreatKatana"; Weapon[Weapon["RakshasasGreatKatana"] = 66520000] = "RakshasasGreatKatana"; Weapon[Weapon["Milady"] = 67500000] = "Milady"; Weapon[Weapon["LedasSword"] = 67510000] = "LedasSword"; Weapon[Weapon["RellanasTwinBlades"] = 67520000] = "RellanasTwinBlades"; Weapon[Weapon["BeastClaw"] = 68500000] = "BeastClaw"; Weapon[Weapon["RedBearsClaw"] = 68510000] = "RedBearsClaw"; })(Weapon || (Weapon = {})); export var Affinity; (function (Affinity) { Affinity[Affinity["Standard"] = 0] = "Standard"; Affinity[Affinity["Heavy"] = 100] = "Heavy"; Affinity[Affinity["Keen"] = 200] = "Keen"; Affinity[Affinity["Quality"] = 300] = "Quality"; Affinity[Affinity["Fire"] = 400] = "Fire"; Affinity[Affinity["FlameArt"] = 500] = "FlameArt"; Affinity[Affinity["Lightning"] = 600] = "Lightning"; Affinity[Affinity["Sacred"] = 700] = "Sacred"; Affinity[Affinity["Magic"] = 800] = "Magic"; Affinity[Affinity["Cold"] = 900] = "Cold"; Affinity[Affinity["Poison"] = 1000] = "Poison"; Affinity[Affinity["Blood"] = 1100] = "Blood"; Affinity[Affinity["Occult"] = 1200] = "Occult"; })(Affinity || (Affinity = {})); export var RequestType; (function (RequestType) { RequestType[RequestType["ReloadFXRs"] = 0] = "ReloadFXRs"; RequestType[RequestType["SetResidentSFX"] = 1] = "SetResidentSFX"; RequestType[RequestType["SetSpEffectSFX"] = 2] = "SetSpEffectSFX"; RequestType[RequestType["GetFXR"] = 3] = "GetFXR"; RequestType[RequestType["GetFXRs"] = 4] = "GetFXRs"; RequestType[RequestType["ListFXRs"] = 5] = "ListFXRs"; })(RequestType || (RequestType = {})); const reqTypeMap = { [RequestType.ReloadFXRs]: 'reload_fxrs', [RequestType.SetResidentSFX]: 'set_resident_sfx', [RequestType.SetSpEffectSFX]: 'set_sp_effect_sfx', [RequestType.GetFXR]: 'get_fxr', [RequestType.GetFXRs]: 'get_fxrs', [RequestType.ListFXRs]: 'list_fxrs', }; export class ReloaderError extends Error { type; constructor(type, message) { super(message); this.type = type; } } class WS extends WebSocket { constructor(url) { super(url); } on(type, listener) { this.addEventListener(type, (event) => { if ('data' in event) { listener(event.data); } else { listener(event); } }); } } const requestMap = new Map; /** * Connects to a WebSocket server and sets up the necessary event handlers for * reloading FXRs. * @param endpoint The port number or URL string to connect to. By default, it * will try to connect to `ws://localhost:24621`, and setting only the port * will just replace the port number. */ export function connect(endpoint = 24621) { const url = typeof endpoint === 'number' ? `ws://localhost:${endpoint}` : endpoint; const ws = new WS(url); return new Promise(async (fulfil, reject) => { ws.on('error', (err) => { reject(new ReloaderError('connection', [ 'Failed to connect to WebSocket server!', 'Is the game running, and is the DLL mod installed?' ].join(' '))); }); const { promise: siPromise, resolve: siFulfil, reject: siReject } = Promise.withResolvers(); let hasReceivedInfo = false; ws.on('message', (data) => { try { const res = JSON.parse(data); if (!hasReceivedInfo && res.type !== 'server_info') { siReject(new ReloaderError('response', `Server did not send server information first.`)); return; } else if (!hasReceivedInfo && res.type === 'server_info' && 'error' in res) { siReject(new ReloaderError('response', `Connected, but the server reported an error: ${res.error}`)); return; } if (!('request_id' in res)) { if (!hasReceivedInfo && res.type === 'server_info') { hasReceivedInfo = true; siFulfil(res); return; } reject(new ReloaderError('response', `Response missing request ID: ${data}`)); } else if (requestMap.has(res.request_id)) { ; requestMap.get(res.request_id)(res); requestMap.delete(res.request_id); } } catch (err) { reject(new ReloaderError('response', `Failed to parse response: ${data}`)); } }); ws.on('open', async () => { const { version, game, features } = await siPromise; Object.freeze(features); async function reload(fxrs, options) { if (isSingleFXR(fxrs)) { const buffer = toBuffer(fxrs, game); await request(ws, { type: RequestType.ReloadFXRs, fxrs: [await bufferToBase64(buffer)] }); if (options?.respawn) { await request(ws, { type: RequestType.SetResidentSFX, weapon: options.weapon ?? Weapon.ShortSword, sfx: getFXRID(buffer), dmy: options.dummyPoly ?? 120, }); } } else { await request(ws, { type: RequestType.ReloadFXRs, fxrs: await Promise.all(fxrs.map(async (fxr) => bufferToBase64(toBuffer(fxr, game)))) }); } } async function fetch(ids) { if (typeof ids === 'number') { const res = await request(ws, { type: RequestType.GetFXR, id: ids, }); return bufferFromBase64(res.data.fxr); } else { const res = await request(ws, { type: RequestType.GetFXRs, ids, }); return Promise.all(res.data.fxrs.map((b64) => b64 === null ? null : bufferFromBase64(b64))); } } fulfil({ get ws() { return ws; }, get version() { return version; }, get game() { return game; }, get features() { return features; }, disconnect() { ws.close(); }, request(obj) { return request(ws, obj); }, reload, setResidentSFX(weapon, sfx, dmy) { return request(ws, { type: RequestType.SetResidentSFX, weapon, sfx, dmy, }); }, setSpEffectSFX(spEffect, sfx, dmy, vfx) { return request(ws, { type: RequestType.SetSpEffectSFX, spEffect, sfx, dmy, vfx, }); }, fetch, async list() { const res = await request(ws, { type: RequestType.ListFXRs }); return res.data.fxrs; }, }); }); }); } function request(ws, obj) { let id = crypto.randomUUID(); while (requestMap.has(id)) { id = crypto.randomUUID(); } ws.send(JSON.stringify(Object.assign({}, obj, { request_id: id, type: reqTypeMap[obj.type] }))); return new Promise((fulfil, reject) => requestMap.set(id, (res) => { if (res.success) { fulfil(res); } else { reject(new ReloaderError('request', res.message)); } })); } async function bufferToBase64(buffer) { if ('toBase64' in Uint8Array.prototype && typeof Uint8Array.prototype.toBase64 === 'function') { return new Uint8Array(ArrayBuffer.isView(buffer) ? buffer.buffer : buffer).toBase64(); } if (typeof Buffer !== 'undefined') { if (ArrayBuffer.isView(buffer)) { return Buffer.from(buffer.buffer).toString('base64'); } return Buffer.from(buffer).toString('base64'); } else { const base64url = await new Promise(fulfil => { const reader = new FileReader(); reader.onload = () => fulfil(reader.result); reader.readAsDataURL(new Blob([buffer])); }); return base64url.slice(base64url.indexOf(',') + 1); } } async function bufferFromBase64(base64) { if ('fromBase64' in Uint8Array && typeof Uint8Array.fromBase64 === 'function') { return Uint8Array.fromBase64(base64); } if (typeof Buffer !== 'undefined') { const buf = Buffer.from(base64, 'base64'); const arr = new Uint8Array(buf.length); arr.set(buf); return arr; } else { return new Uint8Array(await fetch(`data:application/octet-stream;base64,${base64}`).then(e => e.arrayBuffer())); } } function getFXRID(buffer) { const dv = new DataView(buffer instanceof ArrayBuffer ? buffer : buffer.buffer); return dv.getInt32(12, true); } const games = { DarkSouls3: 0, Sekiro: 1, EldenRing: 2, ArmoredCore6: 3, Nightreign: 4, }; function toBuffer(fxr, game) { if (fxr instanceof ArrayBuffer || ArrayBuffer.isView(fxr)) { return fxr; } else { return fxr.toArrayBuffer(games[game]); } } function isSingleFXR(fxr) { return fxr instanceof ArrayBuffer || ArrayBuffer.isView(fxr) || !Array.isArray(fxr); } /** * Reloads an FXR and respawns the lantern SpEffectVfx and updates its * midstSfxId. * @param fxr An FXR object, or an ArrayBuffer or ArrayBufferView containing * the contents of the FXR file. * @param dummyPoly The ID of the dummy poly to attach the SFX to. * * **Default**: 160 * @param endpoint The port number or URL string to connect to. By default, it * will try to connect to `ws://localhost:24621`, and setting only the port * will just replace the port number. */ export async function reloadLanternFXR(fxr, dummyPoly = 160, endpoint) { const reloader = await connect(endpoint); const buffer = toBuffer(fxr, reloader.game); await reloader.request({ type: RequestType.ReloadFXRs, fxrs: [await bufferToBase64(buffer)] }); await reloader.setSpEffectSFX(3245, getFXRID(buffer), dummyPoly); reloader.ws.close(); } /** * Fetch a loaded FXR from the game's memory. * @param id The ID of the FXR to fetch. * @param endpoint The port number or URL string to connect to. By default, it * will try to connect to `ws://localhost:24621`, and setting only the port * will just replace the port number. */ export async function fetchFXR(id, endpoint) { const reloader = await connect(endpoint); const fxr = await reloader.fetch(id); reloader.ws.close(); return fxr; } /** * Fetch a list of loaded FXRs from the game's memory. * @param id The IDs of the FXRs to fetch. * @param endpoint The port number or URL string to connect to. By default, it * will try to connect to `ws://localhost:24621`, and setting only the port * will just replace the port number. */ export async function fetchFXRs(ids, endpoint) { const reloader = await connect(endpoint); const fxr = await reloader.fetch(ids); reloader.ws.close(); return fxr; } /** * List all loaded FXRs in the game by their IDs. * @param endpoint The port number or URL string to connect to. By default, it * will try to connect to `ws://localhost:24621`, and setting only the port * will just replace the port number. */ export async function listFXRs(endpoint) { const reloader = await connect(endpoint); const ids = await reloader.list(); reloader.ws.close(); return ids; } export async function reloadFXR(fxrs, options) { const reloader = await connect(options?.endpoint); if (isSingleFXR(fxrs)) { await reloader.reload(fxrs, options); } else { await reloader.reload(fxrs); } reloader.ws.close(); } export default reloadFXR; //# sourceMappingURL=reloader.js.map