valheimvibes-Deathsquito_Lightning_Tower icon

Deathsquito Lightning Tower

A defensive deathsquito nuking lightning tower, that can recharge from storms or thunderstones. Enemies, range, damage, etc are all configurable.

Last updated 15 hours ago
Total downloads 21
Total rating 1 
Categories Mods Server-side Building
Dependency string valheimvibes-Deathsquito_Lightning_Tower-0.3.7
Dependants 0 other packages depend on this package

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2351 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2351
ValheimModding-Jotunn-2.30.2 icon
ValheimModding-Jotunn

Jötunn (/ˈjɔːtʊn/, 'giant'), the Valheim Library was created with the goal of making the lives of mod developers easier. It enables you to create mods for Valheim using an abstracted API so you can focus on the actual content creation.

Preferred version: 2.30.2

README

Deathsquito Lightning Tower

A storm-powered defense against Deathsquitos.

0.3.7 is a beta. Tested locally on Valheim 1.0.16 with BepInExPack 5.4.2351 and Jötunn 2.30.2. Multiplayer still needs testing with connected players.

Build and charge

Find Lightning Tower in the Hammer's Misc category. An Artisan Table is required.

Material Amount
Thunder Stone 5
Copper 15
Black Metal 15
Crystal 10

New towers start empty. Interact with a tower while carrying a Thunder Stone to restore all 30 charges. Thunderstorms replenish one charge every two seconds while the area is loaded.

Each lightning attack spends one charge and deals 50 lightning damage by default. Default range is 40 m with a two-second cooldown. The target list defaults to Deathsquitos and can include other creatures.

Ready towers coordinate their shots: for example, three towers with three reachable bugs can hit three different bugs. With one shared bug, the closest eligible tower gets the shot. With several bugs, assignment favors hitting as many different bugs as possible, then minimizes total distance.

Configuration

Launch the game once to generate BepInEx/config/valheim.lightningtower.cfg. Close the game before editing, then restart.

The plugin now uses the neutral ID valheim.lightningtower. When replacing an earlier development build, rename its Lightning Tower config to valheim.lightningtower.cfg before launching to preserve settings. Remove the old plugin DLL so only one copy is installed. Placed towers and their saved charge keys are unchanged. All multiplayer participants must use the new build.

Settings include attack range, capacity, damage, cooldown, target list, scan interval, line of sight, storm recharge rate, recipe, tower height, lightning width and jaggedness, charged halo size, attack volume, and hum range/volume. TowerHeightMeters defaults to 6 and measures the placement point to the highest branch; an additional 0.45 m of base extends into the ground at default scale. ChargedHumVolume defaults to 0.3 and ChargedHumRangeMeters to 3. Gameplay settings are synchronized from the host/server.

The [Crafting] settings are ThunderstoneCost = 5, CopperCost = 15, BlackMetalCost = 15, and CrystalCost = 10. Every enabled ingredient is recoverable. If all four are set to zero, the default recipe is used.

Example combat configuration:

[Combat]
TargetPrefabs = Deathsquito, Seeker, Gjall
LightningDamage = 50
BluntDamage = 0
SlashDamage = 0
PierceDamage = 0
FireDamage = 0
FrostDamage = 0
PoisonDamage = 0
SpiritDamage = 0

Use exact, case-sensitive creature prefab names. Spaces and duplicate entries are ignored; unknown names are logged and skipped. An empty list disables targeting. Players, dead and tamed creatures are always excluded. The one-to-one assignment also applies to mixed creature types.

Damage types add together, before the game's resistances, weaknesses and damage-over-time rules. Each accepts 0–10,000; zero disables that type. All types at zero prevents attacks and charge consumption. Existing LightningDamage values are preserved when updating.

For console testing, the prefab name is piece_lightningtower:

spawn piece_lightningtower

Current limitations

  • Use with trusted multiplayer participants. Refill payment is client-controlled, and sender authentication and RPC flood protection need hardening before treating this mod as safe against malicious clients.
  • Recharging from weather requires the tower's area to be loaded.
  • The model is original geometry; its native materials, effects and audio depend on the installed Valheim version.

The mod references game assets at runtime. No Valheim models, textures, or sound files are included in this package. This mod was developed with AI assistance (some vibing and lots of reading).