From 58ede47580479b07ce9e08da39066bde7143eb37 Mon Sep 17 00:00:00 2001 From: kanym Date: Fri, 7 Aug 2026 19:43:42 +0200 Subject: [PATCH 001/297] Aggiorna README.md --- README.md | 506 +++++++++++++++++++++++++----------------------------- 1 file changed, 231 insertions(+), 275 deletions(-) diff --git a/README.md b/README.md index 98cd072..d1113d1 100644 --- a/README.md +++ b/README.md @@ -1,331 +1,287 @@ # RacesOfValheim -A comprehensive Valheim mod that allows you to play as different unique races, each offering distinct mechanics, visual transformations, and a deep progression system tailored to your journey in Valheim. +A comprehensive Valheim mod allowing you to play as unique races, each providing new mechanics, visual forms, and a progression system for your journey. ## Features -This mod currently introduces 9 custom races: +**Races of Valheim introduces 9 custom playable races:** ### 1. Skeleton -- **Stamina-less Combat**: Skeletons do not consume stamina and do not use the stamina bar. -- **Undead Diet**: You cannot eat standard food. Instead, you gain maximum health automatically as you defeat Valheim's bosses to compensate for the lack of food buffs. +![Skeleton](https://wiki.aledanidev.ovh/assets/images/corna_scheletro.gif){height=350px} +- **Stamina-less Combat:** Skeletons use no stamina and do not have a stamina bar. +- **Undead Diet:** Cannot eat normal food. Max health increases automatically as you defeat bosses to make up for lack of food buffs. ### 2. Skadi -- **Ice Affinity**: Gain unique resistance and affinity to the cold. -- **Drake Form**: Transform into a frost Drake, taking to the skies and attacking from above. -- **Dragon Form**: Evolve your form into the mighty Moder and, eventually, unleash the terrifying power of the Skeleton Dragon. +![Skadi1](https://wiki.aledanidev.ovh/assets/images/skadi1.gif) +![Skadi2](https://wiki.aledanidev.ovh/assets/images/skadi2.gif) +![Skadi3](https://wiki.aledanidev.ovh/assets/images/skadi3.gif) +- **Ice Affinity:** Resistant to cold, with unique frost mechanics. +- **Drake Form:** Can transform into a frost Drake, letting you fly. +- **Dragon Form:** Evolve into Moder and later even the Skeleton Dragon. ### 3. Fenrir -- **Beast Form**: Transform into a powerful wolf-like beast. -- **Cultist Form**: Transform into a Cultist to wield fire abilities. -- **Progression**: The beast and cultist forms evolve as you defeat Valheim's bosses, granting new abilities, cooldown reductions, and power scaling. Immune to fall damage in both forms. +![Fenrir1](https://wiki.aledanidev.ovh/assets/images/fenrir1.gif) +![Fenrir3](https://wiki.aledanidev.ovh/assets/images/fenrir3.gif) +- **Beast Form:** Transform into a wolf-like beast. +- **Cultist Form:** Transform into a Cultist to use fire abilities. +- **Progression:** Forms grow as you defeat bosses, unlocking new powers and reducing cooldowns. Immune to fall damage. ### 4. Aswid -- **The Vampire**: A creature of the night with powerful life-draining abilities. -- **Like a Bat out of Hell**: Press G to transform into a bat, allowing you to fly over obstacles and travel quickly. -- **Blood Magic**: Block to channel a life-draining aura that saps the life of enemies in an area around you (doubled radius at night). **Only available while in Bat or Mist form.** -- **Blood Magic Mastery**: You can cast Blood Magic items with infinite Eitr, relying purely on their health costs. -- **Benedictus et Afflictus**: Your passive speed and jump bonuses double during the night. -- **Undead Vigor**: Like the skeleton, the Aswid has infinite stamina. You consume the lifeforce of fallen foes directly instead of eating standard food. +![Aswid](https://wiki.aledanidev.ovh/assets/images/aswidchallenge.gif) +- **The Vampire:** Life-draining abilities. +- **Bat Form:** Press G to become a bat and fly. +- **Blood Magic:** Block to activate a life-draining aura (radius doubled at night, only in Bat or Mist Form). +- **Blood Magic Mastery:** Cast Blood Magic items with infinite Eitr (health cost only). +- **Benedictus et Afflictus:** Passive speed/jump bonuses double at night. +- **Undead Vigor:** Infinite stamina. Consume the lifeforce of enemies instead of eating normal food. ### 5. Furling -- **Goblin Heritage**: You play as a Goblin (Fuling). No beard, no hair (for males). -- **Combat Mastery**: All weapon and combat skills gain 2x XP permanently. -- **Boss-Driven Progression**: Each major boss defeat unlocks a new passive ability. +- **Goblin Heritage:** Play as a Goblin (Fuling). Males have no beard/hair. +- **Combat Mastery:** All combat skills gain 2x XP permanently. +- **Boss-Driven Progression:** Every boss unlocks a new racial ability. ### 6. Trol -- **Trol Heritage**: Play as a massive Trol! You are natively 20% larger than a human. -- **Immense Strength**: Your carry weight is vastly increased and your armor naturally scales as you defeat bosses. -- **Rock Throwing**: You can hurl boulders at your enemies for massive physical damage. -- **Tree Weaponry**: At higher levels, transform into your True Form to rip logs directly out of trees and wield them as devastating weapons or throw them! +- **Trol Heritage:** 20% larger than a human. +- **Immense Strength:** Increased carry weight; armor scales up as you defeat bosses. +- **Rock Throwing:** Hurl huge boulders at enemies. +- **Tree Weaponry:** At higher tiers, True Form lets you rip logs and wield them as weapons or throw them. ### 7. Draugh -- **Born Dead, Buried Alive**: An undead warrior of the swamps. Resistant to physical damage and poison, but weak to fire and spirit. -- **Rotten Diet**: You cannot stomach cooked food. Raw meat, eyes, entrails and blood are your entire menu, and they nourish you longer than they would the living. -- **At Home in the Swamp**: The undead of the swamps do not consider you an enemy, and water stops slowing you down entirely. -- **Zombie Ritual**: In the late game a fatal blow no longer kills you outright. +- **Born Dead, Buried Alive:** Undead warrior: resistant to physical/poison, weak to fire/spirit. +- **Rotten Diet:** Eats only raw meat, eyes, entrails or blood—nourishes you for longer. +- **At Home in the Swamp:** Swamp undead ignore you; water no longer slows you. +- **Zombie Ritual:** At endgame, a fatal blow does not kill you outright. ### 8. Dvergar -- **Small and Stubborn**: Play as one of the deep folk. You stand 22% shorter than a human and carry less health for it. -- **The Hood Never Comes Off**: The dvergr hood is permanently on your head. Wear whatever helm you like and keep every point of its protection - only the mesh is swapped. -- **Master of Metal and Mine**: Weapons you are at home with hit harder for less stamina, veins break faster and give up more ore, and the forge wastes nothing. -- **Kin of the Traders**: Haldor and Hildir know their own, and price accordingly. -- **Runes**: In the late game, spend eitr to read the stone around you or to load a single devastating blow. +- **Small and Stubborn:** 22% shorter than a human, less max health. +- **Hood Never Comes Off:** Cosmetic dvergr hood always on, but keep all helm protection. +- **Master of Metal/Mine:** Favoured weapons hit harder for less stamina, mining improves, forges are more efficient. +- **Kin of the Traders:** Haldor/Hildir give you better prices. +- **Runes:** Late game, spend Eitr for powerful effects. ### 9. Trenta -- **Tree-Born**: Kin to root and leaf. Your skin is green, a crown of branches grows from your head, you eat what grows, and every meal lasts twice as long. -- **Photosynthesis**: Stand still in daylight, out from under a roof, and you put down roots - healing steadily and standing up Rested. -- **Awakened Seeds**: Once Eikthyr falls, every seed, cone and acorn wakes up. Eat one where you stand and it becomes the best dish its biome has to offer. -- **The Forest Does Not See You**: Greylings, greydwarves, fulings, trolls, leeches and deathsquitos never treat you as an enemy. -- **Root and Rot**: In the late game you spray healing pollen, open a portal home, carry a nest of hornets, and finally take The Elder's own shape. -## Installation (manual) +![Trenta](https://wiki.aledanidev.ovh/assets/images/trentecheers.gif) +- **Tree-Born:** Green skin, branch crown. Eats only what grows; food lasts twice as long. +- **Photosynthesis:** Stand motionless in daylight to heal and get Rested buff. +- **Awakened Seeds:** After Eikthyr, seeds can be used for strong food buffs. +- **Forest Camouflage:** Animals/monsters do not see you as an enemy. +- **Root and Rot:** Late game: emit healing pollen, open portals, summon hornet companions, take Elder’s shape. + +--- + +## Installation + 1. Install BepInExPack Valheim. 2. Install Jotunn. -3. Extract the contents of this mod into your BepInEx/plugins folder. +3. Extract this mod's contents into your BepInEx/plugins folder. + +--- ## Race Progressions (Level-by-Level) -### Aswid Progression -- **Base (No Bosses)**: Benedictus et Afflictus. Progressive stats (+1 Armor, +2 Damage, +1% Speed, +1% Jump per boss killed). All passive bonuses are doubled at night! You can cast Blood Magic items with infinite Eitr, and your Blood Magic skill increases twice as fast. Physical kills automatically consume enemies (Vae Victis), granting Blood Magic XP. -- **Eikthyr**: Like a Bat out of Hell (Night only). Vampiric Aura (heal 20% on magic AoE damage). -- **The Elder**: Like a Bat out of Hell (Always active). -- **Bonemass**: Auspex (Aura reveals untamed creatures). -- **Moder**: Freezing Blood (Permanent immunity to Freezing and Poison). -- **Yagluth**: Dominate (U Key - Dominate non-tameable enemies). Eclipse (J Key - force night for 60s, daytime only, 15 min cooldown). -- **The Queen**: Weight of Shadows (H Key - Immune to physical/poison, double aura damage, weak to fire/frost/spirit. Breaks at sunrise). -- **Fader**: Asmund (Passive). Your hair and beard turn as dark as the abyss. You become 10% taller and gain a flat +30 to Physical Damage. +
+Aswid Progression -### Draugh Progression -- **Base (No Bosses)**: Born Dead, Buried Alive. -20% Slash/Pierce/Blunt damage taken, +50% Fire/Spirit damage taken. Poison resistance. You can only eat raw flesh, eyes, entrails and blood, and it lasts 50% longer. Swamp undead ignore you. -- **Eikthyr**: Slowly We Rot - immune to Wet, greatly increased swim speed, and passive health regeneration while wet or swimming. -- **The Elder**: Toxic Trace - your physical attacks apply poison damage over time. -- **Bonemass**: Flesh and the Power It Holds - humanoid enemies drop Human Meat, which grants powerful buffs. Corpse Run buff permanently. -- **Moder**: At the Heart of Winter - a successful parry unleashes a freezing nova around you (20 second cooldown). -- **Yagluth**: Zombie Ritual - fatal damage no longer kills you. You enter a ghostly state, immune to all damage, while your Eitr drains rapidly. If it hits zero, you die for real. Raw food also starts providing Eitr. -- **The Queen**: Swarm of Terror - being struck in melee spawns 2 Seeker Broods to fight for you (9.5s lifetime, 10s cooldown). -- **Fader**: Steal Their Breath - landing a killing blow while in the Zombie Ritual ghost state restores 25% of your max health, stops the Eitr drain and brings you back to life. +- **Base:** Benedictus et Afflictus. Progressive stats (+1 Armor, +2 Damage, +1% Speed, +1% Jump per boss). Passives are doubled at night. Blood magic items are free (health cost only). Physical kills auto-devour enemies for Blood Magic XP. +- **Eikthyr:** Bat Form (night only). Vampiric Aura (heal 20% on magic AoE). +- **The Elder:** Bat Form always. +- **Bonemass:** Auspex (Aura reveals wild creatures). +- **Moder:** Freezing Blood (immune to Freezing/Poison). +- **Yagluth:** Dominate (U) - Dominate enemies; Eclipse (J) - force night for 60s, 15 min cooldown. +- **The Queen:** Weight of Shadows (H) - immune to physical/poison, double aura, weak to fire/frost/spirit, breaks at sunrise. +- **Fader:** Asmund (passive): Hair/beard black, +10% height, +30 physical damage. -### Dvergar Progression -- **Base (No Bosses)**: Small and Stubborn. 22% shorter than a human, slate blue-grey skin, white hair, permanent cosmetic dvergr hood (your helm keeps all of its stats). -10 Max Health. Weapon Affinity: Hammers land 15% harder and refund 20% of their stamina. The affinity bonus never grows - a tier only ever adds another weapon - and skill XP is untouched. -- **Eikthyr**: Bows join your Weapon Affinity. Mining Affinity - veins break 20% faster, cost 40% less stamina, and have a 25% chance to give up an extra unit of ore. -- **The Elder**: Axes join your Weapon Affinity. -- **Bonemass**: -13 Max Health. Smithing and Jewelry - metal and gems cost 20% less to craft and upgrade. Kin of the Traders - Haldor and Hildir charge you 10% less and pay 10% more for trophies and hunting rewards. -- **Moder**: -15 Max Health. Smithing discount rises to 40% (cap). Trader prices -15% / rewards +20%. -- **Yagluth**: -17.5 Max Health. Crossbows join your Weapon Affinity. Trader prices -20% / rewards +30%. Unlock Runic Ping ('G' Key - spend 25 Eitr to light every ore vein and hostile within 40m for 10 seconds, 20 second cooldown). -- **The Queen**: -20 Max Health. Trader prices -25% / rewards +40% (full). -- **Fader**: Unlock Runic Overcharge ('H' Key - spend 60 Eitr to load the runes; your next blow with a favoured weapon lands with 4x its weight. The charge bleeds away after 15 seconds. 60 second cooldown). +
-### Fenrir Progression -- **Base (No Bosses)**: Progressive stats (+3 Armor, +5 Damage, -10% Fall Damage, +3% Speed, +3% Jump per boss killed). -- **The Elder**: Wolf Form (Night). -- **Bonemass**: Wolf Form (Day/Night). Ulv Form (Night). -- **Moder**: Ulv Form (Day/Night). Fenring Form (Night). -- **Yagluth**: Cultist Form (Night - 1 min duration, 10 min cooldown). -- **The Queen**: Fenring Form (Day/Night). Cultist Form (Night - 1 min duration, 5 min cooldown). -- **Fader**: Cultist Form (Day/Night). +
+Draugh Progression -### Furling Progression -- **Base (No Bosses)**: Goblin head model. All weapon & combat skills gain 2x XP permanently. -- **Eikthyr**: Master of Shadows - sounds -15m are suppressed (near-silent movement). -- **The Elder**: The Wickerman - -50% Fire & Poison damage; arrows gain bonus fire damage. -- **Bonemass**: Dance of the Dead - Crafting meads, bombs, and ammo yields double quantity. -- **Moder**: The Man/Woman on the Silver Mountain - doubles trophy drops from normal enemies within 25m, drops bonus gold from starred enemies, doubles ore mining yield. -- **Yagluth**: The King is Dead, Hail to the King/Queen - while in the Plains biome, ALL skills gain 2x XP (including magic). HUD status icon shown. -- **The Queen**: In the Mist He/She Was Standing - blue (Eitr) foods last twice as long. -- **Fader**: Through Fire and Flames - permanently on fire (visual only), immune to fire damage, physical attacks set targets on fire. +- **Base:** Born Dead, Buried Alive. -20% Slash/Pierce/Blunt; +50% Fire/Spirit taken. Poison resistant. Eats only raw flesh, eyes, entrails, blood. Swamp undead ignore you. +- **Eikthyr:** Immune to Wet, swim faster, regen when wet/swimming. +- **Elder:** Toxic Trace – attacks poison over time. +- **Bonemass:** Flesh and the Power It Holds – humanoids drop Human Meat food. Corpse Run permanently active. +- **Moder:** Parrying unleashes freezing nova (20s CD). +- **Yagluth:** Zombie Ritual – fatal damage = ghost state, immune to damage, Eitr drains, die if Eitr hits 0. Raw food gives Eitr. +- **Queen:** Swarm of Terror – being hit summons 2 Seeker Broods to fight for you. +- **Fader:** Steal Their Breath – kill in ghost form restores 25% max health, ends Eitr drain, revives you. -### Skadi Progression -- **Base (No Bosses)**: Immune to Cold, Bonus Frost Damage, 50% Frost Resistance. -- **Eikthyr**: Cold Spell (Middle Mouse). -- **The Elder**: Drake Form ('G' Key) (Cannot attack). -- **Bonemass**: Freezing to Cold. Drake Form ('G' Key) (Can attack). -- **Moder**: Moder Form ('H' Key) (1 min duration, 10 min cooldown). -- **Yagluth**: +50% Eitr Regen. Improved Cold Spell. Moder Form ('H' Key) (1 min duration, 5 min cooldown). -- **The Queen**: Moder Form ('H' Key) (Unlimited duration, no cooldown). -- **Fader**: Skeleton Dragon Form ('J' Key). +
-While transformed, Right Mouse toggles flight. You glide toward wherever you are aiming; hold W -to power forward and climb, and add Shift to spend stamina on a burst of speed. S beats backwards -along your aim - look down and press it to rise away from whatever you are watching, without -turning to face away from it. Let go of everything and the form holds level for five seconds -before settling into a gentle descent. Water is no obstacle: a flying form beats its way back -out of the sea instead of being stuck paddling on the surface. Timed forms show their remaining -seconds, and their cooldown, as a Moder trophy icon beside the minimap. +
+Dvergar Progression -### Skeleton Progression -- **Base (No Bosses)**: +50 Max Health. Undead Diet (Cannot eat mortal food, no stamina bar). -- **Eikthyr**: Poison Skeleton Model, Poison Immunity, 5% Lifesteal, +80 Max Health. -- **The Elder**: 10% Lifesteal, Auto-Stun on First Hit, +110 Max Health. -- **Bonemass**: 15% Lifesteal, Poison Attacks, +140 Max Health. -- **Moder**: Fire Skeleton Model, 20% Lifesteal, Fire Aura, Enhanced Regen, +170 Max Health. -- **Yagluth**: 25% Lifesteal, Auto Resurrect, +200 Max Health. -- **The Queen**: 30% Lifesteal, Summon on Kill (Max 3 Skeletons), +230 Max Health. -- **Fader**: 35% Lifesteal, Max 5 Summons, +275 Max Health. +- **Base:** Small/Stubborn. -10 Max Health. Hammers hit 15% harder, use 20% less stamina. +- **Eikthyr:** Bows join weapon affinity. Mining Affinity – break veins 20% faster, 40% less stamina, chance for bonus ore. +- **Elder:** Axes join weapon affinity. +- **Bonemass:** -13 Max Health. Smithing/gem crafting 20% cheaper. Trader prices -10%/rewards +10%. +- **Moder:** -15 Max Health. Smithing cap -40%. Trader -15%/+20%. +- **Yagluth:** -17.5 Max Health. Crossbows added. Trader -20%/+30%. Runic Ping (G, 25 Eitr): highlight ore/enemies nearby; 20s CD. +- **Queen:** -20 Max Health. Trader -25%/+40%. +- **Fader:** Runic Overcharge (H, 60 Eitr): next favoured hit is 4x damage; lasts 15s, 60s CD. -### Trenta Progression -- **Base (No Bosses)**: Tree-Born. Green skin, a crown of branches on your head, a diet of what grows, and every food lasts twice as long. Photosynthesis - stand motionless in daylight and out from under a roof for 10 seconds to put down roots, healing 10% of max health a second for 8 seconds and standing up Rested for 5 minutes (+1 minute per boss already defeated). Greylings, greydwarves, fulings, trolls, leeches and deathsquitos never treat you as an enemy. -- **Eikthyr**: Awakened Seeds - every seed, cone, acorn and self-seeding mushroom wakes up. Eating one on the spot consumes it and grants the strongest health or eitr dish of the biome it comes from. -- **The Elder**: Purple Rain ('G' Key) - a spray of toxic pollen over 8m that heals everything that does not fight you for 40 and poisons everything that does for 40. 20 second cooldown. -- **Bonemass**: Swimming costs no stamina, and neither Poison nor Wet can touch you any more. -- **Moder**: Last Stand - armour rises as your health falls, up to +50% at the edge of death. Thorns - 20% of every hit you take is reflected back at whoever landed it. -- **Yagluth**: Homecoming Portal ('H' Key) - opens a linked pair of portals, one where you stand and one at your respawn point, for 30 seconds. Anyone may walk through, carrying anything - there is no ore restriction. 5 minute cooldown. -- **The Queen**: Hornet's Nest - a permanent companion hovering over you. Anything hostile that comes within 6m is stung for 10 poison damage every 4 seconds. -- **Fader**: Muspell ('J' Key) - take the shape of a half-size Elder. Press again to revert. -### Trol Progression -- **Base (No Bosses)**: +20% Size. +200 Max Carry Weight. Gain +3 Armor per boss defeated. -- **Eikthyr**: Increased XP gain for physical labor and blunt combat (Clubs, Unarmed, Axes, Pickaxes, WoodCutting). -- **The Elder**: Unlock Rock Throwing ability. +10% passive health regeneration. -- **Bonemass**: +5% Size. +50 Carry Weight. +10 Damage to Clubs/Unarmed. +10 Rock Throwing Damage. Unlocks a **4th Food Slot**. -- **Moder**: Unlock True Form (Transformation ability). -- **Yagluth**: +5% Size. +50 Carry Weight. +10 Damage to Clubs/Unarmed. +5 Rock Throwing Damage. Unlocks a **5th Food Slot**. -- **The Queen**: Unlock Log Weapon (in True Form, interact with trees to wield them as weapons). True Form size is massively increased (2.5x). -- **Fader**: Your wielded trees can now instantly smash through the toughest materials in the Ashlands. +
+
+Fenrir Progression + +- **Base:** +3 Armor, +5 Damage, -10% Fall Damage, +3% Speed/Jump per boss killed. +- **Elder:** Wolf Form (night). +- **Bonemass:** Wolf Form (anytime). Ulv Form (night). +- **Moder:** Ulv Form (anytime). Fenring Form (night). +- **Yagluth:** Cultist Form (night, 1min, 10min CD). +- **Queen:** Fenring Form (anytime). Cultist Form (night, 1min, 5min CD). +- **Fader:** Cultist Form (anytime). + +
+ +
+Furling Progression + +- **Base:** Goblin head. Weapon/combat skills gain 2x XP. +- **Eikthyr:** Master of Shadows – near-silent movement. +- **Elder:** The Wickerman – -50% Fire & Poison; arrows gain fire effect. +- **Bonemass:** Dance of the Dead – crafting meads, bombs, ammo yields double amount. +- **Moder:** Man/Woman on Silver Mountain – double trophy drops (within 25m), bonus gold from stars, double ore yield. +- **Yagluth:** King is Dead (Plains biome): all skills 2x XP. +- **Queen:** In the Mist – Eitr foods last 2x. +- **Fader:** Through Fire/Flames – always wreathed in fire (visual only), fire immune, attacks set enemies on fire. + +
+ +
+Skadi Progression + +- **Base:** Immune to Cold, bonus frost damage, 50% frost resistance. +- **Eikthyr:** Cold Spell (Middle Mouse). +- **Elder:** Drake Form (G) (cannot attack). +- **Bonemass:** Freezing to Cold, Drake Form (G) (can attack). +- **Moder:** Moder Form (H) (1min, 10min CD). +- **Yagluth:** +50% Eitr regen. Upgraded Cold Spell. Moder Form (H) (1min, 5min CD). +- **Queen:** Moder Form (H) (unlimited, no CD). +- **Fader:** Skeleton Dragon Form (J). + +**Transformation Tutorial:** +Right Mouse toggles flight. Glide towards aim, W = forward/climb, Shift+W = use stamina for speed burst, S = back/up. If idle for 5s, gently descend. Can exit water easily. Timed forms: see duration/cooldown as Moder trophy near minimap. + +
+ +
+Skeleton Progression + +- **Base:** +50 Max Health. Undead Diet (cannot eat normal food, no stamina bar). +- **Eikthyr:** Poison Skeleton model, poison immunity, 5% lifesteal, +80 Max Health. +- **Elder:** 10% lifesteal, auto-stun first hit, +110 Max Health. +- **Bonemass:** 15% lifesteal, poison attacks, +140 Max Health. +- **Moder:** Fire Skeleton model, 20% lifesteal, fire aura, enhanced regen, +170 Max Health. +- **Yagluth:** 25% lifesteal, auto-resurrect, +200 Max Health. +- **Queen:** 30% lifesteal, summon on kill (max 3 skeletons), +230 Max Health. +- **Fader:** 35% lifesteal, max 5 summons, +275 Max Health. + +
+ +
+Trenta Progression + +- **Base:** Tree-Born. Green skin/branches, plant diet, food lasts 2x. Photosynthesis: stand still in daylight for 10s = heal 10% max HP/sec for 8s, Rested buff (5 min +1min per boss). Animals/monsters ignore you. +- **Eikthyr:** Awakened Seeds – eat seeds/cones/acorns/mushrooms for strong food buffs. +- **Elder:** Purple Rain (G): 8m toxic pollen heals allies, poisons enemies, 20s CD. +- **Bonemass:** Swim uses no stamina, immune to Poison/Wet. +- **Moder:** Last Stand – armor rises as health falls (up to +50%), Thorns (reflects 20% damage). +- **Yagluth:** Homecoming Portal (H): portal to respawn point, anyone can use, 5min CD. +- **Queen:** Hornet's Nest – permanent hornet companion stings hostiles. +- **Fader:** Muspell (J): shapechange to half-size Elder, press again to revert. + +
+ +
+Trol Progression + +- **Base:** +20% size, +200 carry weight, +3 armor per boss. +- **Eikthyr:** Increased XP for physical labor and blunt combat. +- **Elder:** Rock Throwing unlocked, +10% passive regen. +- **Bonemass:** +5% size, +50 carry, +10 club/unarmed damage, +10 rock throw, unlocks 4th food slot. +- **Moder:** Unlock True Form. +- **Yagluth:** +5% size, +50 carry, +10 club/unarmed, +5 rock throw, unlocks 5th food slot. +- **Queen:** Log Weapon (True Form): interact with trees to wield/throw. True Form is massive (2.5x size). +- **Fader:** Trees you wield instantly destroy any material in Ashlands. + +
+ +--- ## The Race Menu Ward -A buildable ward (2 Wood, Hammer / Misc, no crafting station needed) that manages your race -without the console. A first one is placed near the sacrificial stones of every new world. +- Build (2 Wood, Hammer/Misc, no crafting station). First placed near Sacrificial Stones in every new world. -Interact with it to reset your race, or to switch between **World progression** (your tier -comes from the bosses this world has defeated) and **Personal progression** (your tier is -stored on your character and travels with you between servers). In personal mode, offer a -boss's secondary drop to the ward - Hard Antler, Crypt Key, Wishbone, Dragon Tear, -Yagluth's thing, the Queen's carapace, Fader's relic - to claim that boss's tier. +Interact to reset race, or switch between: +- **World progression:** tier follows world’s bosses. +- **Personal progression:** tier saved to character (server independent). + +In personal mode, offer boss’s secondary drop to the Ward (Hard Antler, Crypt Key, Wishbone, Dragon Tear, Yagluth’s thing, Queen’s carapace, Fader’s relic) to claim boss tier. + +--- ## Factions -Every race is grouped into one of three factions, alongside a handful of vanilla creatures. -None of your faction's mobs will attack you first, and several of them go a step further: -approach one and press **E** to trade. Buy price and sell price are always the same, so -nothing is a loss to sell back. +Races are grouped in 3 factions (with vanilla creatures): -- **Black Forest** - Trenta, Trol, Furling: at peace with Greydwarves (and their Elite and - Shaman kin), Fuling, Goblin Brute, Goblin Shaman, and Troll. -- **Mountain** - Skadi, Fenrir, Dvergar: at peace with the Drake, Wolf, Ulv, Fenring (and its - Cultists), and every Dverger. -- **Swamp** - Aswid, Draugh, Skeleton: at peace with Ghosts, Skeletons, Draugr, Wraiths, - Leeches, Abominations, and Blobs. +- Your faction's mobs will not attack you, and some offer trading (press E). +- Buy/sell prices are always equal. + +**Black Forest:** +Trenta, Trol, Furling / at peace with Greydwarves, Fuling (Goblin), Goblin Brute/Shaman, Troll. + +**Mountain:** +Skadi, Fenrir, Dvergar / at peace with Drake, Wolf, Ulv, Fenring/Cultist, Dverger. + +**Swamp:** +Aswid, Draugh, Skeleton / at peace with Ghost, Skeleton, Draugr, Wraith, Leech, Abomination, Blob. + +--- ## Development & Feedback -This is a stable release of Races of Valheim, but the mod is actively in development! We plan to add more races, gameplay elements, and refine the mechanics in future updates. -Any feedback, bug reports, or suggestions for new features are more than welcome. -Please write to us on my Discord server: **https://discord.gg/gbBEK2VTE** +This is a stable release, but more races and refinements are planned! +Bug reports, feedback, ideas: [https://discord.gg/gbBEK2VTE](https://discord.gg/gbBEK2VTE) + +--- ## Changelog -**v1.4.0** -- **NEW - Factions**: Every race now has peace with a slice of vanilla's hostile roster, grouped into three factions - Black Forest (Trenta, Trol, Furling: Greydwarves, Fuling, Goblin Brute/Shaman, Troll), Mountain (Skadi, Fenrir, Dvergar: Drake, Wolf, Ulv, Fenring/Cultist, Dverger), and Swamp (Aswid, Draugh, Skeleton: Ghost, Skeleton, Draugr, Wraith, Leech, Abomination, Blob). Several of those mobs also talk and trade now - approach one with your matching race and it opens a shop instead of attacking, buying and selling at the same price. -- **NEW - Configuration Manager for every race**: every ability number, cooldown and keybind across all nine races can now be retuned from BepInEx's Configuration Manager, organized into per-topic sections (Keybinds first, then Passive Combat, then the rest), or by hand-editing the .cfg file it generates. -- **Trol**: Grabbing a felled log as a True Form weapon (tier 7+) has its own keybind now (default **E**) instead of piggybacking on the True Form key a second time, and shows a proper crosshair prompt - **[E] Grab Log** - so it's no longer a hidden mechanic with no on-screen hint. -- **Dvergar**: Eyes finally glow - a cold teal-blue that shifts to a starred creature's own colours once you're strong enough to earn them. -- **Aswid**: Eyes glow an evil red, the way the compendium always described them. -- **Skeleton**: Fixed a bug where a helmet or beard could stay visible even while the race's own head-hiding was active. -- **Skeleton**: Your chosen race now shows correctly on the main-menu character preview. -- **Skeleton**: The burning skull (Moder tier+) no longer sheds a lit torch that falls to the ground - the flame's clone is stripped down to just the particles and light it actually needs. -- **Factions**: The base Goblin (in-game display name "Fuling") wasn't actually covered by Black Forest peace or trading for any race - the code used the display name "Fuling" instead of the real prefab id "Goblin". Trenta, Trol and Furling now get real peace with it, and it trades like every other Black Forest mob. -- **Aswid**: The same "Fuling" mix-up meant the Goblin family's food never got its intended values - it silently fell back to generic nutrition instead of a Goblin-scaled amount and the promised 20-minute humanoid-prey burn time. Fixed for the Goblin, the Goblin Shaman and the Goblin Brute alike. +### v1.4.0 +- **NEW - Factions:** Each race is at peace with a faction of vanilla mobs; many now trade with you if you match. Goblins (Fuling) peace/trade now works properly. +- **NEW - Config Manager:** All abilities, cooldowns and keybinds now configurable for each race. +- **Trol:** Log weapon in True Form now has its own key ([E]), with an on-screen prompt. +- **Dvergar:** Eyes now glow; gain color if starred. +- **Aswid:** Eyes glow red. +- **Skeleton:** Fixed head/helmet/beard bugs; correct preview in main menu; burning skull visual updated; correct max health and progression behavior; progression info in compendium now tier-accurate. +- **Factions:** Fixed Goblin (Fuling) peace/trade logic across all Black Forest races. +- **Aswid:** Proper Goblin food scaling and duration. -**v1.3.12** -- **Skadi**: Dragon flight reworked. The stasis that holds a form level after you stop powering now lasts 5 seconds instead of 2. Hold Shift with W to spend 15 stamina a second on a burst of speed - the only part of flight that costs anything, since the drake arrives at The Elder long before you could pay just to stay airborne, and running dry drops you back to normal speed rather than out of the sky. S beats backwards along your aim, pitch included: look down and press it to rise away from whatever you are watching, without turning to face away from it. -- **Skadi**: Water is no longer a trap. A flying form beats its way back out of the sea instead of paddling on the surface until it finds land. Valheim hands a swimming character to its swimming code before it ever asks whether they are flying, which is why the Aswid's bat could always take off from water and Moder never could. -- **Fenrir**: The human body no longer stands inside the wolf. Every form hid you by shrinking your body to nothing, and the reset that keeps a non-Trol player at normal size put it straight back a frame later. Wolf, Ulv, Fenring and Cultist are all fixed, and so is the copy other players see. -- **Trenta**: A crown of horns and dead branches now grows from your head - a greydwarf shaman's, sunk into the skull until only the branches clear it. -- **Draugh**: The rot is visible to everyone. The drifting smoke and the cloud of flies only ever existed on your own screen, so in multiplayer every other player saw an ordinary, unrotted Viking. -- **Skeleton**: The progression finally does what its description says. Poison immunity arrived at Bonemass instead of Eikthyr, auto-stun at The Queen instead of The Elder, and lifesteal jumped 20/30/40% where the list promises a climb in fives from 5% to 35%. Every tier now matches, boss for boss. -- **Skeleton**: Poison immunity - and the physical resistances alongside it - never survived a death or a login. Undead Fortitude was applied once, the moment you picked the race from the menu, and status effects are not saved with a character, so from your next respawn onward you had none of it. It is kept on you now, and a boss killed mid-session takes effect immediately instead of waiting for a respawn. -- **Skeleton**: Max health is exactly what the tier promises. A Skeleton cannot eat, so the race feeds you three permanent invisible meals to carry the bonus - good for keeping regeneration alive, bad for landing an exact number, and a Bonemass Skeleton could find itself at 95 health where the table promises 165. The meals stay; the total no longer depends on them. -- **Skeleton**: The Moder regeneration bonus now applies at all. -- **Skeleton**: Skeleton Secrets unfolds tier by tier with the real numbers, instead of the same "will be revealed soon" line at every standing. It opens by naming the standing you are on, so when a boss falls and nothing seems to change you can tell at a glance whether the tier failed to advance or the unlock failed to fire. -- **Skeleton**: From Moder on you wear Hildir's bones with your skull alight, and the flames are visible to other players. At Fader you stand 15% taller. -- **Skeleton**: Fader no longer loses its lower jaw, and returning to Human no longer leaves you with a burning skull and an invisible one. +### v1.3.12 +- **Skadi:** Flight overhaul: 5s stasis, Shift+W for speed, S for back/up, works from water. All controls and cooldowns visible on HUD. Dragon forms behave for observers. Keybinds clarified. +- **Fenrir:** Body hiding fixed; correct multiplayer visuals. +- **Trenta:** Branch crown added. +- **Draugh:** Rot visuals multiplayer-synced. +- **Skeleton:** Tier unlocks and stat progression fixed; poison/fire immunities now persist through death; health bonus matches progression (not invisible foods); Moder regen fixed; visual unlocks at right tiers; no leftover burning skull glitches. +- **General:** Log spam eliminated for Trol in main menu. -**v1.3.11** -- **NEW RACE - Trenta**: Added the ninth playable race, the Trenta. Tree-born folk, kin to root and leaf: green-skinned, fed on what grows, and digesting it twice as slowly as anyone else. Stand still in daylight and you put down roots, healing and standing up Rested. The forest does not see you as prey - greylings, greydwarves, fulings, trolls, leeches and deathsquitos leave you alone from the very first tier. Later comes healing pollen that poisons whatever fights you, a portal home that ignores the ore restriction, a nest of hornets that stings anything that comes near, and finally The Elder's own shape. Full progression across all 8 tiers - see Trenta Progression above. -- **Dvergur is now the Dvergar**: The race has been renamed. Characters created as a Dvergur are migrated automatically on your next spawn - you keep your race, your tier and your progress, and nothing needs re-picking. -- **Dvergar**: Runic Spark - every blow you land now carries Lightning damage, starting at +2 with no bosses down and growing by +2 per boss to +16 after Fader. Modelled on Skadi's frost affinity, which works the same way. -- **Aswid**: Blood Magic Mastery finally does what it says. Casting a blood magic item with no eitr food eaten was refused outright, because the game checks your *maximum* eitr before it ever asks whether the cost can be waived - and a maximum of zero fails that check on its own. Blood magic now costs exactly what it always claimed to: health, and nothing else. -- **Aswid**: Vampiric Aura now lands on what is around you, and runs passively in every form. -- **All races**: "No skill loss" world modifier now means no skill loss. Dying on such a world still wiped the progress banked toward your next level in every skill - the level itself was safe, but everything earned since it was not, which on a skill sitting just short of the next level was indistinguishable from losing one. Nothing is lost now. -- **General**: The Trol's remote-sync tracing no longer fills the log while you sit in the main menu. +### v1.3.11 +- **Trenta Race added.** +- **Dvergur renamed to Dvergar.** Existing characters auto-migrate. +- **Dvergar:** Runic Spark: all attacks do scaling lightning damage. +- **Aswid:** Blood Magic Mastery works fully; Vampiric Aura is now passive; correct world "no skill loss" logic. +- **General:** No skill progress lost on death in "no skill loss" worlds. -**v1.3.10** -- **NEW RACE - Dvergur**: Added the eighth playable race, the Dvergur. Small, stubborn smiths of the deep: 22% shorter than a human, frail of frame, and wearing the dvergr hood permanently - your helm keeps all of its protection, only the mesh is swapped. Masters of metal, mine and market: favoured weapons hit harder for less stamina, veins break faster and yield more, the forge wastes nothing, and Haldor and Hildir price for their own. In the late game the runes answer, lighting the ore and enemies around you or loading a single devastating blow. Full progression across all 8 tiers - see Dvergur Progression above. -- **Aswid**: Vampiric Aura is now centered on you instead of 2m in front, so it actually covers what's around you rather than a patch of ground ahead. Damage rescaled from 2 + Blood Magic (max +1 at level 100) to 1 + Blood Magic scaled up to +5 at level 100, so the skill carries real weight on the aura's damage again. -- **Aswid / Skadi / Fenrir**: Transforming (Bat Form, Wolf Form, Cold Spell, Drake/Moder Form) no longer occasionally casts your real Guardian Power for you. All four borrow the game's own "arms raised" casting animation for the visual, but that animation carries a hidden trigger for the real power - if it wasn't on cooldown, borrowing the animation quietly cast it too and burned the cooldown. None of the four trigger it anymore. +### v1.3.10 +- **Dvergur Race added.** +- **Aswid:** Vampiric Aura origin and scaling fixed. +- **Form transforms** (Aswid/Skadi/Fenrir): no longer trigger guardian power by accident. -**v1.3.9** -- **Skadi / Aswid**: Returning to human form no longer replays the spawn animation. Every dragon form, Bat Form and Mist Form used to drop you back into the get-up-off-the-ground clip you see when joining a world, because hiding the human body also switched off its animator - and Unity restarts an animator from its first state when it comes back. The body is now hidden without ever being switched off, so you return standing, mid-stride, in whatever pose you were already in. -- **Multiplayer**: A transformed Skadi's dragon now *moves* for everyone else. Other players saw the right model frozen in its idle pose, gliding around without ever beating a wing or taking a step; the remote copy now follows the flying, grounded and running states of the player it belongs to. -- **Multiplayer**: Remote Skadi flight works. A flying dragon used to be dragged down to the terrain on everyone else's screen no matter what altitude was actually being sent; other players now see you in the air where you really are. This and the Trol sizing below were the two known issues left open in 1.3.8. -- **Multiplayer**: Remote Trol sizing is fixed - the 1.3.8 known issue. Other players now see a Trol at the size their progression and True Form actually call for, easing smoothly between sizes instead of never updating at all. -- **Aswid**: Food buffs now survive death. Feeding is the whole of the Aswid diet, and losing every buff on a corpse run hit them far harder than a race that eats bread. Bukeperries still clear food normally when you want the slots back. -- **General**: Removed the `[AswidDebug]` logging that shipped in 1.3.8. It wrote a line for every aura tick on every enemy in radius, four times a second while channelling, and filled the BepInEx log for anyone playing an Aswid. Genuine failure warnings are kept. -- **Aswid**: Surtlings and Bears joined the menu, and the Greydwarf family finally has real nutrition - Greylings 20 HP, Greydwarves 25, Shamans 30 and Brutes 60, the last for a full 30 minutes. Health regeneration from prey now scales with how nourishing it was instead of being a flat trickle from everything. - -**v1.3.8** -- **NEW RACE - Draugh**: Added the seventh playable race, the Draugh. An undead warrior of the swamps: -20% physical damage taken, +50% from fire and spirit, and a diet of raw flesh, eyes, entrails and blood that lasts 50% longer than cooked food would. Swamp undead do not attack you. Full progression across all 8 tiers, ending with Zombie Ritual and Steal Their Breath. -- **NEW - Race Menu Ward**: A cheap buildable ward (2 Wood) that manages your race without the console. Reset your race, or switch between the world's boss progression and a **personal progression** stored on your character, advanced by offering boss relics to the ward. One is placed near the sacrificial stones of every new world. -- **Aswid**: Fixed a bug where the Vampiric Aura's Mist Form modifier *halved* its damage instead of doubling it. Base aura damage also doubled, and Blood Magic scaling is now a flat bonus rather than a multiplier, so the skill adds up to +1 damage at level 100 regardless of the base. -- **Aswid**: The Greydwarf family is now edible - Greylings, Greydwarves, Brutes and Shamans all count as prey. Wood is back on the menu, boys. -- **Aswid**: The Auspex aura is far more visible. It now uses a real green light on each revealed creature instead of a repurposed green groundtorch, which was unreliable and often invisible. -- **Aswid**: Dominate/Taming moved from `K` to `U`. -- **Aswid**: Humanoid prey (Cultists, Fenrings, Fulings) now nourishes you for 20 minutes. -- **Skadi**: Dragon melee never dealt any damage at all - bite, claw and spin played an animation, charged eitr and did nothing. Melee now sweeps for targets properly and costs nothing, since it is the baseline attack that has to work at every tier. -- **Skadi**: Everything Skadi casts now runs on **stamina instead of eitr**. Eitr food only exists from the Mistlands on, while the Cold Spell unlocks at Eikthyr and the Drake at The Elder, so the old costs were either unpayable or silently ignored. Ranged volleys are charged per projectile - the sixty-shard breath no longer costs the same as a three-shard spit - and capped so the widest one stays castable. -- **Skadi**: The Cold Spell stopped borrowing the Staff of Frost's damage, which handed out Mistlands numbers from Eikthyr and multiplied them by every shard. It now scales with progression, and the improved cast spreads one damage budget across its shards: wider, not stronger. -- **Skadi**: Suppressed the kick that played over every cast - it was Valheim's own secondary attack, bound to the same Middle Mouse button. -- **Skadi**: Airborne Moder keeps its ranged attack on Middle Mouse just as on the ground, with no left-hand attack in the air. The Skeleton Dragon's airborne branch is gone, since that form cannot fly. -- **Skadi**: Ability cooldowns now show on the HUD, each with its own icon and a live countdown. -- **Skadi**: Rebalanced the tiers. Eikthyr was carrying three unlocks while later tiers carried little, so the Freezing-to-Cold conversion moves to **Bonemass** (alongside the Drake's attack) and eitr regeneration first appears at **Yagluth** with the improved Cold Spell. Eikthyr's old +20% eitr regen is dropped rather than relocated, since Yagluth already granted an undocumented +50%. -- **Skadi**: Filled in the compendium entry, which was still a placeholder. It now unfolds tier by tier with the real numbers, the form keybinds and the flight controls. -- **General**: The plugin version reported to BepInEx had been stuck at 1.3.2 for several releases. It now matches the packaged version. -- **Known issue**: Remote Trol sizing and remote Skadi flight are still wrong for other players in multiplayer. Instrumentation is in place but the fix is not done - your own view is unaffected. - -**v1.3.6** -- **Skadi**: Complete overhaul of dragon flight! Your form now flies wherever you aim, pitch included, instead of the old free-camera noclip that needed Space and Ctrl to change altitude. Hold W to power forward and climb; let go and you hold level for a couple of seconds before settling into a natural glide. -- **Skadi**: Dragon forms now turn to face the direction they are actually flying, and touching down mid-flight no longer leaves you sliding forward forever. -- **Skadi**: Timed dragon forms finally expire on their own! Moder Form now honours its duration, and the cooldown that could never trigger before now works properly. Both the remaining seconds and the cooldown appear as a Moder trophy icon with a live countdown beside the minimap. -- **Skadi**: Fixed 'Freezing to Cold' (Eikthyr tier), which never did anything at all: Skadi's own frost resistance made Valheim skip the cold check entirely. Mountains now correctly leave you with Cold instead of Freezing. -- **Skadi**: The Cold Spell is now cast from chest height with a proper spellcasting gesture, instead of a kick aimed at the ground. -- **Skadi**: Drake Form attacks unlock the moment you reach the Bonemass tier, rather than only after transforming again. -- **Skadi**: `resetrace` now clears Skadi's Aura and its frost bonuses when switching away from the race. -- **Multiplayer**: Fixed a severe bug where other players saw a transformed Skadi's dragon model respawn every single frame, stacking thousands of copies and causing lag that only got worse and never cleared on its own. The transformed player saw nothing wrong on their own screen. -- **General**: Race abilities no longer fire while the map, inventory, a chest, the chat or a menu is open, so clicking an item inside a container no longer swings your transformed attack. -- **Documentation**: The Skadi progression list now states the keybind for each form, along with the flight controls. - -**v1.3.5** -- **Aswid**: Added an Execution mechanic to Blood Magic (Vampiric Aura): Non-boss enemies that fall below 20% health while inside the aura are instantly killed and automatically devoured! -- **Aswid**: The Vampiric Aura's devour execution now flawlessly respects the Aswid's custom stomach limitations, including the ability to silently refresh duplicate blinking buffs when slots are fully occupied. -- **Aswid**: The Taming ability has been moved from the generic Interact key (E) to a dedicated keybind (K) to prevent accidental taming while interacting with the world. -- **Skeleton**: Finally removed the 'you could eat another bite' message! It now only appears occasionally to remind you of what the food of the living was like. - -**v1.3.4** -- **Aswid**: Refined the Aswid's diet. Restored Ashlands creatures (except undead like Charred and Morgen) and enabled a 4th stomach slot exclusively for Aswid prey. -- **Aswid**: Added a keybind (I) to toggle the automatic devour on/off. -- **Aswid**: Fixed a bug where devouring a mob would fail if the player was still in an attack or movement animation. -- **Aswid**: Added a passive lifesteal scaling mechanic! You now heal for 2% of the physical damage dealt per boss defeated (up to 14% at endgame). This amount is doubled during the night! - -**v1.3.2** -- **Aswid**: Blood Magic (Vampiric Aura) is now only active when blocking in Bat or Mist form. Base damage reduced by 50%. -- **Aswid**: Added thematic day/night transition messages ("what a horrible night to have a curse"). -- **Bugfix**: Fixed an issue where the new automatic food consumption logic for Aswid physical kills failed to find the correct prefabs for basic animals like Deer and Boars. - -**v1.3.1** -- **NEW RACE - Trol**: Added the sixth playable race, the Trol. Huge size, immense strength, rock throwing, and the ability to wield trees as weapons! -- **Trol Combat**: The Trol starts with increased size and carry weight, scaling stats as bosses are killed, and unlocking the ability to throw massive rocks at The Elder tier. -- **Trol True Form**: Unlocked at Moder, allowing you to transform. Once you defeat The Queen, you can look at trees while in True Form to rip a log out and use it as a massive 2-handed weapon! -- **Trol Stomachs**: As you progress, you unlock a 4th (Bonemass) and a 5th (Yagluth) stomach slot, allowing you to consume up to 5 foods simultaneously! -- **Bugfixes**: Fixed various item/food duplication bugs and polished the new eating logic to perfectly integrate with the native UI. - -**v1.3.0** -- **NEW RACE - Furling**: Added the fifth playable race, the Furling (Goblin). Unique goblin head model, full progression tied to all 7 bosses. -- **Furling - Eikthyr (Master of Shadows)**: Sounds below 15m range are suppressed, making you nearly silent at night or in dungeons. -- **Furling - The Elder (The Wickerman)**: Gain -50% Fire and Poison damage resistance. Arrows gain bonus fire damage. -- **Furling - Bonemass (Dance of the Dead)**: Crafting meads, bombs, and ammo yields double the quantity. -- **Furling - Moder (The Man/Woman on the Silver Mountain)**: Trophy drops from normal enemies are doubled, starred enemies drop bonus coins, and ore mining yields are doubled. -- **Furling - Yagluth (The King is Dead, Hail to the King/Queen)**: In the Plains biome, the 2x XP multiplier extends to ALL skills (including Elemental and Blood Magic). A HUD status icon appears in the top-right when active. -- **Furling - The Queen (In the Mist He/She Was Standing)**: Eitr (blue) foods last twice as long for you. -- **Furling - Fader (Through Fire and Flames)**: You are permanently wreathed in native fire flames (SE_Burning visual, no damage, no HUD warning). Full fire immunity. All physical attacks set targets on fire. -- **Bugfix**: Fixed MineRock.RPC_Damage - MineRock.RPC_Hit Harmony patch after a Valheim update renamed the method. - -**v1.2.0** -- **Multiplayer Sync**: Fully implemented visual syncing for Aswid forms (Bat, Mist) and Skadi forms (Bear, Wolf, Hatchling, Fader) so other players can see your transformations in multiplayer! -- **Aswid**: Scrapped the Fader (Surtling) visual override; reaching the final progression state now makes the player 10% taller and adds a flat +30 physical damage bonus. -- **Aswid**: Defeating enemies with physical attacks in the final state now automatically consumes them if you have food slots available. -- **General**: Eradicated remaining localizations of the old "Strigoi" name. - -**v1.1.0** -- **Aswid**: Passive abilities (Speed and Jump) are now properly doubled during the night. -- **Aswid**: New Enslavement Power (Yagluth tier)! Press E on non-tameable, non-boss enemies to enslave them for 60 seconds (15-min cooldown). Enslaved thralls fight alongside you and drop standard loot. -- **Aswid**: Edible thralls are automatically consumed upon death, granting you their lifeforce (Fader tier). -- **Aswid**: Complete overhaul of the Food system. Added Mistlands and Ashlands creatures to the consumption map. Accurately scaled food stats based on creature health. -- **Aswid**: Excluded undead and inorganic creatures (Skeletons, Draugrs, Golems, etc.) from being edible. -- **Aswid**: Added a dynamic green light effect to all forms (Bonemass tier). - -**v1.0.0** -- Initial release with 4 distinct races. -- Added Aswid life-draining and night transformations. -- Complete progression system tied to Valheim's bosses. +### v1.3.9 +- **Transforming** to/from forms: no more forced spawn animation. +- **Multiplayer:** Skadi flight sync and Trol sizing fixed. +- **Aswid:** Food buffs survive death; prey nutrition scaling fixed. +- **General:** Logging cleanup. +![Furling](https://wiki.aledanidev.ovh/assets/images/fur.gif) \ No newline at end of file From 4976ef66aa9edfe9ffe886f657b489ce71e30528 Mon Sep 17 00:00:00 2001 From: kanym Date: Fri, 7 Aug 2026 19:44:46 +0200 Subject: [PATCH 002/297] Aggiorna README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d1113d1..41fb9d0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A comprehensive Valheim mod allowing you to play as unique races, each providing **Races of Valheim introduces 9 custom playable races:** ### 1. Skeleton -![Skeleton](https://wiki.aledanidev.ovh/assets/images/corna_scheletro.gif){height=350px} +![Skeleton](https://wiki.aledanidev.ovh/assets/images/corna_scheletro.gif) - **Stamina-less Combat:** Skeletons use no stamina and do not have a stamina bar. - **Undead Diet:** Cannot eat normal food. Max health increases automatically as you defeat bosses to make up for lack of food buffs. From 5c5b8c34d2c9ef1707963fd5232dad3c402f7b07 Mon Sep 17 00:00:00 2001 From: Ferdinando Date: Sat, 8 Aug 2026 14:58:43 +0200 Subject: [PATCH 003/297] feat(races): Skadi hollow chain, plus the pending Dvergar and Fenrir ones Three per-race item chains had accumulated uncommitted. They land together because FactionMerchantCatalog.cs carries hunks from all three and cannot be split without interactive staging. Skadi (new this session): - SkadiNokkel - "Skadis Nokkel", a StaffSkeleton clone recoloured to ice, stripped of its eitr and health costs and of the skeleton summon, opening an ice-blue portal to a troll cave the player claims as their own. Crafted at the forge after Moder from a 1500-coin Greater Frost Heart, a DragonTear and a TrophySkeleton. - SkadiFrostHeart - the bought leg of that recipe, sold by the Cultist bench. - SkadiHollow / SkadiHollowPortal - claims one existing TrollCave02 in the Black Forest, half a world radius out and south of the equator, and opens a linked local portal pair to it. - RaceCaveBuilding - Skadi and Trol may build inside any troll cave. Two facts worth keeping, both paid for the hard way: - a troll cave counts as a DUNGEON, so the flag that refuses a piece there is the per-piece Piece.m_allowedInDungeons, not the per-location Location.m_noBuild. Player.m_placementStatus names the exact refusal reason and is now logged. - Object.DestroyImmediate is forbidden inside an animation event callback, and a staff cast runs in one - it fails silently there. Also carried in, from earlier sessions and unverified in game: - Dvergar contract bank and barrel (DvergarBanco*, DvergarBotte*) - Fenrir Ulvsblod trough (FenrirMangiatoia*) - the Wolf -> Ulv merchant bench move, so tameable wolves stop answering the E key with a shop window Status: compiles clean with no new warnings. The Skadi chain has NOT been confirmed working in game - the most recent fix to the troll cave detection is still untested. Co-Authored-By: Claude Opus 5 --- JotunnModStub/Dvergar/DvergarBanco.cs | 455 +++++++++++++++ .../Dvergar/DvergarBancoBehaviour.cs | 290 ++++++++++ JotunnModStub/Dvergar/DvergarBancoStore.cs | 211 +++++++ JotunnModStub/Dvergar/DvergarBotte.cs | 309 +++++++++++ .../Dvergar/DvergarBotteBehaviour.cs | 267 +++++++++ JotunnModStub/Dvergar/DvergarRace.cs | 8 + .../Factions/FactionMerchantCatalog.cs | 39 +- JotunnModStub/Fenrir/FenrirMangiatoia.cs | 516 ++++++++++++++++++ .../Fenrir/FenrirMangiatoiaBehaviour.cs | 468 ++++++++++++++++ JotunnModStub/Fenrir/FenrirRace.cs | 5 + JotunnModStub/PieceDensityLimit.cs | 21 + JotunnModStub/RaceCaveBuilding.cs | 212 +++++++ JotunnModStub/RacesOfValheim.cs | 5 + JotunnModStub/RacesOfValheim.csproj | 6 + JotunnModStub/Skadi/SkadiConfig.cs | 16 + JotunnModStub/Skadi/SkadiFrostHeart.cs | 57 ++ JotunnModStub/Skadi/SkadiHollow.cs | 256 +++++++++ JotunnModStub/Skadi/SkadiHollowPortal.cs | 234 ++++++++ JotunnModStub/Skadi/SkadiNokkel.cs | 396 ++++++++++++++ JotunnModStub/Skadi/SkadiRace.cs | 30 +- 20 files changed, 3784 insertions(+), 17 deletions(-) create mode 100644 JotunnModStub/Dvergar/DvergarBanco.cs create mode 100644 JotunnModStub/Dvergar/DvergarBancoBehaviour.cs create mode 100644 JotunnModStub/Dvergar/DvergarBancoStore.cs create mode 100644 JotunnModStub/Dvergar/DvergarBotte.cs create mode 100644 JotunnModStub/Dvergar/DvergarBotteBehaviour.cs create mode 100644 JotunnModStub/Fenrir/FenrirMangiatoia.cs create mode 100644 JotunnModStub/Fenrir/FenrirMangiatoiaBehaviour.cs create mode 100644 JotunnModStub/RaceCaveBuilding.cs create mode 100644 JotunnModStub/Skadi/SkadiFrostHeart.cs create mode 100644 JotunnModStub/Skadi/SkadiHollow.cs create mode 100644 JotunnModStub/Skadi/SkadiHollowPortal.cs create mode 100644 JotunnModStub/Skadi/SkadiNokkel.cs diff --git a/JotunnModStub/Dvergar/DvergarBanco.cs b/JotunnModStub/Dvergar/DvergarBanco.cs new file mode 100644 index 0000000..2b519aa --- /dev/null +++ b/JotunnModStub/Dvergar/DvergarBanco.cs @@ -0,0 +1,455 @@ +using System.Collections.Generic; +using HarmonyLib; +using Jotunn.Configs; +using Jotunn.Entities; +using Jotunn.Managers; +using UnityEngine; + +namespace RacesOfValheim +{ + /// + /// The Dvergar's station: a contract bank. Coin goes on the table, a crew signs on. + /// + /// The Trol's war totem is the twin of this file and the two should be read together - same five + /// group slots, same empty Trader driving vanilla's store window, same "a dead band is money spent". + /// What is NOT shared is deliberate: the dvergr are hired professionals rather than a shouted-for + /// warband, and everything different here follows from that one sentence. + /// + /// - they are TAMED and answer the follow command, like every servant in this mod (RaisedThrall); + /// - they knit their own wounds shut, the sentry's regeneration reused whole; + /// - they are NOT merchants, which costs no code at all: FactionMerchantSetupPatch matches the + /// exact prefab name and these clones are DvergarMerc_*. This is the same mechanism that made + /// every tameable wolf in the world a shop window until the catalogue stopped listing "Wolf", + /// read from the other side; + /// - they keep their race's truce. A hired crew walking into a dvergr outpost does not start a + /// war with the shopkeeper - see DvergarMercenaryTrucePatch at the bottom, which is the one + /// rule in this file that has no counterpart on the totem; + /// - they can be given drink, later. Nothing here is needed for that: a rune barrel will buff + /// whatever RaisedThrall is bound to this bank's anchor, so the mercenaries need no hook of + /// their own and this file does not have to be reopened to add one. + /// + /// The seekers in the low bands are not allies, they are LEASHED. A dvergr contract sends you two + /// workers and their beasts, which is also why the truce has to cover them: wild dvergr shoot + /// seekers on sight, and a firefight started by a brood at your heel would be retaliation damage, + /// which IsEnemy has no say over once it has begun. + /// + public static class DvergarBanco + { + public const string PieceName = "DvergarContractBank"; + public const string PieceDisplayName = "Contract Bank"; + public const string RaceId = DvergarConfig.RaceId; + + /// The Queen's drop, mapped to state 7 in BossProgressionManager. Mistlands money for + /// a mistlands station: the dvergr do not take Yagluth's leavings seriously. + public const string UpgradeItem = "QueenDrop"; + public const int UpgradeProgressionState = 7; // The Queen + + public const int MaxTroops = 5; + + /// Written into each hired creature's ZDO so the bank can tell its crews apart - + /// five slots means counting contracts, not bodies. + public const string KeyGroup = "RoV_dvergarGroup"; + + public const float LeashRange = 12f; + public const float WitherSeconds = 60f; + public const float HomeCheckRange = 25f; + + /// No cap: a signed contract walks out as a contract. + public const int MaxFollowers = -1; + + // One per square kilometre. Looser than the Fenrir's pen (2.59 km2) because a bank does not + // grow anything on its own, stricter than the Trol's totem, which has no limit at all and + // should probably get one once it is out of test. + public const int MaxBanksInRange = 1; + public const float DensityAreaKm2 = 1f; + + // ---------------------------------------------------------------- the look, in metres + /// A cartography table, slightly cut down. The dvergr write smaller than we do. + private const float TableScale = 0.8f; + + /// + /// How high the coin pile sits, in the piece's own space and BEFORE TableScale is applied. + /// Unlike the totem's head this is not measured: the table keeps its own vanilla mesh, so + /// there is no borrowed holder to call ModelBorrow.HeightOf on. If the pile floats or sinks, + /// this is the ONE number to touch. + /// + private const float PileHeight = 1.05f; + private const float PileSize = 0.45f; + + public class Troop + { + public string Id; + public string Display; + public int Price; + public bool NeedsUpgrade; + /// Trophy of whoever leads the crew - the face it wears in the rack. + public string Icon; + /// Vanilla creature prefab -> how many of it. + public KeyValuePair[] Members; + } + + // Anchored at the same 400-2000 as the Trol's totem, and laddered against ITS bands rather + // than against head count: one Dverger is worth rather more than six greydwarves, so the + // bodies come down as the coin goes up and the seekers make up the difference at the bottom. + // + // The top band is knowingly stronger than the totem's two thousand coin fuling war band. It + // sits behind the Queen and it dies for good; if it proves too much in play, the lever is to + // drop the support mage out of it before touching the price. + public static readonly Troop[] Troops = + { + new Troop + { + Id = "escort", Display = "Escort", Price = 400, NeedsUpgrade = false, Icon = "TrophyDvergr", + Members = new[] + { + new KeyValuePair("Dverger", 1), + new KeyValuePair("SeekerBrood", 2), + } + }, + new Troop + { + Id = "yard_patrol", Display = "Yard Patrol", Price = 700, NeedsUpgrade = false, Icon = "TrophyDvergr", + Members = new[] + { + new KeyValuePair("Dverger", 2), + new KeyValuePair("SeekerBrood", 2), + } + }, + new Troop + { + Id = "fire_crew", Display = "Fire Crew", Price = 1000, NeedsUpgrade = false, Icon = "TrophyDvergr", + Members = new[] + { + new KeyValuePair("Dverger", 1), + new KeyValuePair("DvergerMageFire", 1), + new KeyValuePair("SeekerBrood", 3), + } + }, + new Troop + { + Id = "runic_crew", Display = "Runic Crew", Price = 1500, NeedsUpgrade = true, Icon = "TrophyDvergr", + Members = new[] + { + new KeyValuePair("Dverger", 2), + new KeyValuePair("DvergerMageIce", 1), + new KeyValuePair("DvergerMageSupport", 1), + } + }, + new Troop + { + Id = "ash_guard", Display = "Ash Guard", Price = 2000, NeedsUpgrade = true, Icon = "TrophySeekerBrute", + Members = new[] + { + new KeyValuePair("DvergerAshlands", 2), + new KeyValuePair("DvergerMageSupport", 1), + new KeyValuePair("SeekerBrute", 1), + } + }, + }; + + public static Troop Find(string id) + { + foreach (Troop troop in Troops) if (troop.Id == id) return troop; + return null; + } + + /// + /// What this player actually pays, after the Dvergar's own trader discount. + /// + /// It reads the LOCAL player's tier, which is correct rather than convenient: the coin comes + /// out of that player's own inventory, on that player's own client, and a contract bank is not + /// a shared till. The discount table stops at 25% at state 7 (DvergarConfig.cs), which is the + /// same state that unlocks the two upgraded bands - so the top of the list can never be + /// discounted before it can be bought, and no separate ceiling is needed. + /// + public static int PriceFor(Troop troop) + { + if (troop == null) return 0; + + float discount = Mathf.Clamp01(DvergarProgression.Current.TraderBuyDiscount); + return Mathf.Max(1, Mathf.RoundToInt(troop.Price * (1f - discount))); + } + + /// Every distinct creature the bank can hire, so their clones exist before anyone signs. + private static readonly Dictionary HiredPrefabs = new Dictionary(); + + public static string HiredNameFor(string vanillaPrefab) => + HiredPrefabs.TryGetValue(vanillaPrefab, out string name) ? name : null; + + /// The mercenary prefabs, by name, so the truce can recognise its own cheaply. + private static readonly HashSet HiredNames = new HashSet(); + + public static bool IsHiredName(string prefabName) => + !string.IsNullOrEmpty(prefabName) && HiredNames.Contains(prefabName); + + public static void Register() + { + HashSet sources = new HashSet(); + foreach (Troop troop in Troops) + { + foreach (KeyValuePair member in troop.Members) sources.Add(member.Key); + } + foreach (string source in sources) RegisterHired(source); + + RegisterPiece(); + + PieceDensityLimit.Register(PieceName, + PieceDensityLimit.RadiusForArea(DensityAreaKm2), MaxBanksInRange, + "There is already {0} contract bank within a day's walk. One ledger per valley."); + } + + // ---------------------------------------------------------------- the hired + + /// + /// One signed mercenary: the vanilla creature, tamed, leashed, healing, and worth nothing dead. + /// + /// CharacterDrop is destroyed for the reason it always is here, and it matters more on this + /// chain than on any other: dvergr and seekers both carry loot that SELLS. A mercenary that + /// dropped its own parts would make the bank a way of turning coin into more coin. + /// + private static void RegisterHired(string source) + { + string prefabName = "DvergarMerc_" + source; + + GameObject prefab = PrefabManager.Instance.CreateClonedPrefab(prefabName, source); + if (prefab == null) + { + Jotunn.Logger.LogWarning($"[Dvergar] Could not clone {source}; that crew member cannot be hired. " + + "The rest of its band still signs on without it."); + return; + } + + BaseAI ai = prefab.GetComponent(); + if (ai != null) ai.m_randomMoveRange = LeashRange; + + foreach (CharacterDrop drops in prefab.GetComponentsInChildren(true)) + { + if (drops != null) Object.DestroyImmediate(drops); + } + + RaisedThrall thrall = prefab.AddComponent(); + thrall.m_kind = prefabName; + thrall.m_commandingRace = RaceId; + thrall.m_maxFollowers = MaxFollowers; + thrall.m_witherSeconds = WitherSeconds; + thrall.m_homeCheckRange = HomeCheckRange; + thrall.m_refusalMessage = "Your name is not on the contract."; + + // Ten seconds unhurt, then two percent a second - the sentry's regeneration, shared with + // the Trol's troops and the Fenrir's pack. A dead mercenary still stays dead. + prefab.AddComponent(); + + PrefabManager.Instance.AddPrefab(prefab); + HiredPrefabs[source] = prefabName; + HiredNames.Add(prefabName); + } + + // ---------------------------------------------------------------- the bank + + private static void RegisterPiece() + { + GameObject prefab = PrefabManager.Instance.CreateClonedPrefab(PieceName, "piece_cartographytable"); + if (prefab == null) + { + Jotunn.Logger.LogWarning("[Dvergar] Could not clone piece_cartographytable; the contract bank " + + "is not registered."); + return; + } + + // EVERY behaviour goes except the three that make it a building, and the blanket sweep is + // the point rather than laziness: the cartography table's MapTable is Interactable AND + // Hoverable, so it takes the E key before our own Switch ever sees it and opens the shared + // map instead of the ledger. That is the same bug as the barrel's Container on the Fenrir + // trough and the Trader on the vanilla wolf, and stripping by capability instead of by + // type name means it cannot come back if a future patch renames or adds a component. + // + // Unlike the Trol's totem the renderers are KEPT: the table is the look, there is nothing + // borrowed underneath it. + foreach (MonoBehaviour behaviour in prefab.GetComponentsInChildren(true)) + { + if (behaviour == null) continue; + if (behaviour is Piece || behaviour is ZNetView || behaviour is WearNTear) continue; + Object.DestroyImmediate(behaviour); + } + + AswidBloodRefinery.StripOffensive(prefab, PieceName); + + prefab.transform.localScale = Vector3.one * TableScale; + + DvergarBancoBehaviour bank = prefab.AddComponent(); + + foreach (Switch existing in prefab.GetComponentsInChildren(true)) + { + if (existing != null) Object.DestroyImmediate(existing); + } + bank.m_switch = prefab.AddComponent(); + bank.m_switch.m_name = PieceDisplayName; + + // An empty catalogue IS the design: the bank sells crews and buys nothing. Every list is + // filled in even though this trader never talks, because a Trader added with AddComponent + // comes up with all of them null and Trader.Interact walks into Say(m_randomStartTrade) + // if the player's E happens to reach it instead of our Switch. + // + // The empty list would also throw out of StoreGui.FillList on its last instruction - that + // is fixed once and for everyone by StoreGuiEmptyCatalogueGuardPatch over in + // Trol/TrolTotemStore.cs, which is generic and is deliberately NOT copied here. + Trader trader = prefab.GetComponent() ?? prefab.AddComponent(); + trader.m_name = PieceDisplayName; + trader.m_items = new List(); + trader.m_useItems = new List(); + trader.m_randomTalk = new List(); + trader.m_randomGreets = new List(); + trader.m_randomGoodbye = new List(); + trader.m_randomStartTrade = new List(); + trader.m_randomBuy = new List(); + trader.m_randomSell = new List(); + trader.m_randomGiveItemNo = new List(); + trader.m_randomUseItemAlreadyRecieved = new List(); + trader.m_randomTalkConditionals = new List(); + + // The mark of a bank that has been paid: a heap of coin on the table, hidden until the + // Queen has fallen and the ledger has been rewritten. + // + // 'treasure_pile' is the player's own choice of prop and is NOT verified against this + // build - nothing else in the project references it. ModelBorrow is null-safe by + // construction, so a wrong name costs exactly one warning in the log and an empty holder; + // if that warning appears, 'Coins' is the fallback and this is a one-string change. + bank.m_coinPile = ModelBorrow.Attach(prefab.transform, "BankCoinPile", "treasure_pile", + new Vector3(0f, PileHeight, 0f), Quaternion.identity, + PileSize, "Dvergar"); + bank.m_coinPile.SetActive(false); + + Piece piece = prefab.GetComponent() ?? prefab.AddComponent(); + piece.m_craftingStation = null; // a bank is built where the work is, not at a bench + piece.m_resources = new Piece.Requirement[0]; + piece.m_name = PieceDisplayName; + piece.m_canBeRemoved = true; + piece.m_groundPiece = true; + piece.m_groundOnly = true; + piece.m_icon = BorrowIcon("TrophyDvergr"); + + Piece template = PrefabManager.Cache.GetPrefab("piece_workbench"); + if (template != null && template.m_placeEffect != null) piece.m_placeEffect = template.m_placeEffect; + + // Coin in the RECIPE, and that is the whole reason this chain needs no gate item bought + // from a merchant the way the other three do: the Dvergar pay for everything, so the + // station opens by being paid for rather than by being unlocked. + PieceManager.Instance.AddPiece(new CustomPiece(prefab, fixReference: false, new PieceConfig + { + Name = PieceDisplayName, + Description = "A ledger, a seal and a heap of coin. Sign here and someone else does the dying.", + PieceTable = PieceTables.Hammer, + Category = PieceCategories.Crafting, + Icon = BorrowIcon("TrophyDvergr"), + Requirements = new[] + { + new RequirementConfig("BlackMarble", 10, 0, true), + new RequirementConfig("YggdrasilWood", 5, 0, true), + new RequirementConfig("Sap", 2, 0, true), + new RequirementConfig("Coins", 100, 0, true), + } + })); + } + + public static void EnsureKnown(Player player) + { + if (player == null) return; + + GameObject prefab = PrefabManager.Instance.GetPrefab(PieceName); + Piece piece = prefab != null ? prefab.GetComponent() : null; + if (piece == null) return; + + Traverse traverse = Traverse.Create(player); + traverse.Method("AddKnownPiece", piece).GetValue(); + traverse.Method("UpdateAvailablePiecesList").GetValue(); + } + + private static Sprite BorrowIcon(string prefabName) + { + ItemDrop drop = PrefabManager.Cache.GetPrefab(prefabName); + Sprite[] icons = drop != null && drop.m_itemData != null && drop.m_itemData.m_shared != null + ? drop.m_itemData.m_shared.m_icons + : null; + return icons != null && icons.Length > 0 ? icons[0] : null; + } + } + + [HarmonyPatch(typeof(Player), "OnSpawned")] + public static class DvergarBancoKnownPatch + { + public static void Postfix(Player __instance) + { + if (__instance != Player.m_localPlayer) return; + DvergarBanco.EnsureKnown(__instance); + } + } + + /// + /// The race lock, caught at placement so the marble and the coin are not spent before the refusal. + /// The same shape as TrolTotemRaceLockPatch - the second station in the mod that refuses the hammer + /// outright, because hiring dvergr with dvergr money is the race's identity and not a tool it owns. + /// + [HarmonyPatch(typeof(Player), "PlacePiece", + new[] { typeof(Piece), typeof(Vector3), typeof(Quaternion), typeof(bool) })] + public static class DvergarBancoRaceLockPatch + { + public static bool Prefix(Player __instance, Piece __0) + { + if (__instance != Player.m_localPlayer || __0 == null) return true; + if (Utils.GetPrefabName(__0.gameObject) != DvergarBanco.PieceName) return true; + if (DvergarRace.IsDvergar()) return true; + + __instance.Message(MessageHud.MessageType.Center, "The contract is in runic. You do not sign it."); + return false; + } + } + + /// + /// A hired crew keeps its employer's truce. + /// + /// Without this the station fights itself: a Dvergar player is at peace with the mountain's dvergr + /// (FactionHostilityPatch), and those dvergr are where the player BUYS - so walking into an outpost + /// with an escort would mean the escort killing the shopkeeper. Taming a creature puts it in the + /// player faction, which makes it an enemy of everything the player is merely not fighting. + /// + /// One condition covers the whole band, seekers included, because every hired body is a RaisedThrall + /// carrying the same commanding race - so the leashed brood at your heel is as welcome in an outpost + /// as the dvergr holding its chain, even though wild dvergr shoot seekers on sight. That was the + /// player's call and it is the only reason a bank is usable in the mistlands at all: retaliation + /// damage does not go through IsEnemy, so one shot fired by an outpost would have escalated into a + /// war this patch could no longer stop. + /// + /// A postfix that only ever says "not enemies", layered on top of the older hostility patch on the + /// same method exactly as that one layers on RaceHostilityManager. It cannot make anything hostile + /// that was not already. + /// + [HarmonyPatch(typeof(BaseAI), nameof(BaseAI.IsEnemy), new System.Type[] { typeof(Character), typeof(Character) })] + public static class DvergarMercenaryTrucePatch + { + /// The mountain's dvergr, by prefab name. The same roster FactionHostilityPatch uses + /// for the player's own truce - kept as its own copy so a change to one is a deliberate change + /// to that one, since these two lists answer different questions. + private static readonly HashSet WildDvergr = new HashSet + { + "Dverger", "DvergerMageFire", "DvergerMageIce", "DvergerMageSupport", "DvergerAshlands", + }; + + public static void Postfix(Character a, Character b, ref bool __result) + { + if (!__result) return; // already not enemies, nothing to add + if (a == null || b == null) return; + + if (IsTruce(a, b) || IsTruce(b, a)) __result = false; + } + + /// True if is one of ours and is + /// a wild dvergr. + private static bool IsTruce(Character mercenary, Character other) + { + RaisedThrall thrall = mercenary.GetComponent(); + if (thrall == null || thrall.m_commandingRace != DvergarBanco.RaceId) return false; + + return WildDvergr.Contains(Utils.GetPrefabName(other.gameObject)); + } + } +} diff --git a/JotunnModStub/Dvergar/DvergarBancoBehaviour.cs b/JotunnModStub/Dvergar/DvergarBancoBehaviour.cs new file mode 100644 index 0000000..dbbfa6e --- /dev/null +++ b/JotunnModStub/Dvergar/DvergarBancoBehaviour.cs @@ -0,0 +1,290 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace RacesOfValheim +{ + /// + /// The bank's logic: five contracts, bought with coin, and no way to cancel one. + /// + /// Slots count CREWS, not bodies - a fire crew of five is one slot, and it stays one slot as its + /// members die. Each hired body carries its crew's id in its own ZDO, so the count survives a reload + /// and corrects itself when a whole crew is wiped, with nothing tallied anywhere. + /// + /// This is TrolTotemBehaviour's twin and was written from it. The differences are all consequences + /// of one thing - these are paid professionals rather than a shouted-for warband: + /// - the price a player pays is discounted by their own Dvergar tier (DvergarBanco.PriceFor); + /// - the upgrade is the Queen's drop rather than Yagluth's, and it puts coin on the table + /// instead of a head on a post. + /// If a bug is found in one of the two files, look for it in the other before assuming it is local. + /// + public class DvergarBancoBehaviour : MonoBehaviour + { + public Switch m_switch; + public GameObject m_coinPile; + + private const string KeyUpgraded = "RoV_dvergarBankUpgraded"; + private const string KeyNextGroup = "RoV_dvergarBankNextGroup"; + + private ZNetView m_nview; + + private void Awake() + { + RaisedThrall.RegisterStation(transform); + + m_nview = GetComponent(); + if (m_nview == null || m_nview.GetZDO() == null) return; + + if (m_switch != null) + { + m_switch.m_onUse = OnUse; + m_switch.m_onHover = Hover; + } + + m_nview.Register("RoV_DvergarHire", RPC_Hire); + m_nview.Register("RoV_DvergarUpgrade", RPC_Upgrade); + + InvokeRepeating("UpdatePile", 0.5f, 2f); + } + + private void OnDestroy() + { + RaisedThrall.UnregisterStation(transform); + } + + /// The coin is mounted from the start; the tier decides whether it is there to see. + private void UpdatePile() + { + if (m_coinPile != null) m_coinPile.SetActive(IsUpgraded()); + } + + // ---------------------------------------------------------------- interaction + + private bool OnUse(Switch caller, Humanoid user, ItemDrop.ItemData item) + { + Player player = user as Player; + if (player == null) return false; + + if (!DvergarRace.IsDvergar()) + { + player.Message(MessageHud.MessageType.Center, "The ledger is not written for you."); + return false; + } + + // The Queen's drop in hand rewrites the ledger: coin on the table, and two more crews. + if (item != null && item.m_dropPrefab != null && item.m_dropPrefab.name == DvergarBanco.UpgradeItem) + { + return TryUpgrade(player, item); + } + + if (item != null) + { + player.Message(MessageHud.MessageType.Center, "$msg_wontwork"); + return false; + } + + return OpenStore(player); + } + + private bool TryUpgrade(Player player, ItemDrop.ItemData item) + { + if (IsUpgraded()) + { + player.Message(MessageHud.MessageType.Center, "It has already had one."); + return false; + } + + if (BossProgressionManager.GetCurrentProgressionState() < DvergarBanco.UpgradeProgressionState) + { + player.Message(MessageHud.MessageType.Center, "Not while she still sits under the mist."); + return false; + } + + player.GetInventory().RemoveItem(item, 1); + m_nview.InvokeRPC("RoV_DvergarUpgrade"); + player.Message(MessageHud.MessageType.Center, "The ledger is rewritten. Better names sign it now."); + return true; + } + + /// + /// Opens the vanilla store window, with the crew column hung off it by DvergarBancoStore. A + /// Trader has to be present for StoreGui.Show to have anything to show; this one's catalogue is + /// empty, which is how "hires crews, buys nothing" is expressed. + /// + private bool OpenStore(Player player) + { + Trader trader = GetComponent(); + if (trader == null || StoreGui.instance == null) + { + player.Message(MessageHud.MessageType.Center, "The ledger is shut."); + return false; + } + + // Nothing is handed to the panel: DvergarBancoStore reads the bank back out of StoreGui's + // own m_trader when it repaints, so the window cannot draw one bank's crews while showing + // another's, and there is no static left over to go stale. + StoreGui.instance.Show(trader); + return true; + } + + // ---------------------------------------------------------------- what the store calls + + /// Sign a crew by id, from a row the player clicked. Every check TryHire made applies. + public void HireFromStore(string troopId) + { + Player player = Player.m_localPlayer; + if (player == null) return; + + DvergarBanco.Troop troop = DvergarBanco.Find(troopId); + if (troop == null) return; + if (troop.NeedsUpgrade && !IsUpgraded()) return; + + if (CountGroups() >= DvergarBanco.MaxTroops) + { + player.Message(MessageHud.MessageType.Center, "Five contracts is all the ledger holds."); + return; + } + + Inventory inventory = player.GetInventory(); + if (inventory == null) return; + + // Priced here and NOT on the way in from the row: the button only draws a number, and the + // player's tier could have changed since the window was opened. + int price = DvergarBanco.PriceFor(troop); + + if (CountCoins(inventory) < price) + { + player.Message(MessageHud.MessageType.Center, "$msg_notenoughmoney"); + return; + } + + TakeCoins(inventory, price); + m_nview.InvokeRPC("RoV_DvergarHire", troop.Id); + player.Message(MessageHud.MessageType.Center, $"{troop.Display} signs on."); + } + + private const string CoinsPrefab = "Coins"; + + private static int CountCoins(Inventory inventory) + { + int total = 0; + foreach (ItemDrop.ItemData item in inventory.GetAllItems()) + { + if (item != null && item.m_dropPrefab != null && item.m_dropPrefab.name == CoinsPrefab) + { + total += item.m_stack; + } + } + return total; + } + + private static void TakeCoins(Inventory inventory, int amount) + { + foreach (ItemDrop.ItemData item in new List(inventory.GetAllItems())) + { + if (amount <= 0) return; + if (item == null || item.m_dropPrefab == null || item.m_dropPrefab.name != CoinsPrefab) continue; + + int take = Mathf.Min(amount, item.m_stack); + inventory.RemoveItem(item, take); + amount -= take; + } + } + + // ---------------------------------------------------------------- hiring + + private void RPC_Hire(long sender, string troopId) + { + if (!m_nview.IsOwner()) return; + + DvergarBanco.Troop troop = DvergarBanco.Find(troopId); + if (troop == null || CountGroups() >= DvergarBanco.MaxTroops) return; + if (troop.NeedsUpgrade && !IsUpgraded()) return; + + int next = m_nview.GetZDO().GetInt(KeyNextGroup) + 1; + m_nview.GetZDO().Set(KeyNextGroup, next); + string group = troopId + "#" + next; + + foreach (KeyValuePair member in troop.Members) + { + string hired = DvergarBanco.HiredNameFor(member.Key); + if (hired == null) continue; + + GameObject prefab = ZNetScene.instance != null ? ZNetScene.instance.GetPrefab(hired) : null; + if (prefab == null) + { + Jotunn.Logger.LogWarning($"[Dvergar] No '{hired}' in ZNetScene; part of {troop.Display} " + + "did not turn up for work."); + continue; + } + + for (int i = 0; i < member.Value; i++) SpawnOne(prefab, group); + } + } + + private void SpawnOne(GameObject prefab, string group) + { + Vector3 offset = Random.insideUnitSphere * 3f; + offset.y = 0f; + Vector3 position = transform.position + offset + Vector3.up * 0.5f; + + GameObject spawned = Instantiate(prefab, position, Quaternion.Euler(0f, Random.Range(0, 360), 0f)); + + ZNetView nview = spawned.GetComponent(); + if (nview != null && nview.IsValid()) nview.GetZDO().Set(DvergarBanco.KeyGroup, group); + + RaisedThrall thrall = spawned.GetComponent(); + if (thrall != null) thrall.Bind(transform.position); + } + + private void RPC_Upgrade(long sender) + { + if (!m_nview.IsOwner()) return; + m_nview.GetZDO().Set(KeyUpgraded, true); + } + + // ---------------------------------------------------------------- state + + public bool IsUpgraded() => + m_nview != null && m_nview.IsValid() && m_nview.GetZDO().GetBool(KeyUpgraded, false); + + private static string GroupOf(RaisedThrall thrall) + { + ZNetView nview = thrall != null ? thrall.GetComponent() : null; + if (nview == null || !nview.IsValid()) return null; + + string group = nview.GetZDO().GetString(DvergarBanco.KeyGroup, ""); + return string.IsNullOrEmpty(group) ? null : group; + } + + /// + /// Live crews, counted as distinct groups rather than as bodies. Nothing is stored: the count + /// is the truth, and it corrects itself the moment a crew is wiped out. + /// + public int CountGroups() + { + HashSet groups = new HashSet(); + foreach (RaisedThrall thrall in RaisedThrall.BoundTo(transform.position)) + { + string group = GroupOf(thrall); + if (group != null) groups.Add(group); + } + return groups.Count; + } + + private string Hover() + { + string body = $"contracts {CountGroups()}/{DvergarBanco.MaxTroops}"; + + // Said in as many words: a player who cannot see their own discount will read the lower + // number in the window as a mistake. + float discount = Mathf.Clamp01(DvergarProgression.Current.TraderBuyDiscount); + if (discount > 0f) body += $"\nyour seal is worth {Mathf.RoundToInt(discount * 100f)}% off"; + + if (!IsUpgraded()) body += "\n(what the Queen left behind buys two more crews)"; + + body += "\n[$KEY_Use] Read the ledger"; + + return Localization.instance.Localize($"{DvergarBanco.PieceDisplayName} ({body})"); + } + } +} diff --git a/JotunnModStub/Dvergar/DvergarBancoStore.cs b/JotunnModStub/Dvergar/DvergarBancoStore.cs new file mode 100644 index 0000000..e225ae0 --- /dev/null +++ b/JotunnModStub/Dvergar/DvergarBancoStore.cs @@ -0,0 +1,211 @@ +using System.Collections.Generic; +using System.Text; +using HarmonyLib; +using TMPro; +using UnityEngine; +using UnityEngine.UI; + +namespace RacesOfValheim +{ + /// + /// The contract bank's window: the merchant's own store, with a column of hireable crews in it. + /// + /// TWINNED WITH Trol/TrolTotemStore.cs. This is a copy of that file, taken deliberately rather than + /// refactored into something shared, so the Trol's totem is not touched while it is in test - the + /// two are the same panel drawn from a different roster. A FIX TO ONE BELONGS IN THE OTHER; when + /// the totem is settled they should collapse into one panel driven by a common station interface. + /// + /// Two things are deliberately NOT copied across: + /// - StoreGuiEmptyCatalogueGuardPatch, which is what stops vanilla FillList throwing on an empty + /// catalogue and taking every postfix down with it. It is generic - it fires for any trader with + /// nothing to sell - so it already covers this bank, and a second copy would just be a second + /// prefix on the same method doing the same work. + /// - the slot rack. There was one on the totem and it was removed at the player's call: a crew + /// that dies is dead, and a butcher knife already dismisses one that has outlived its use. + /// + /// The two columns cannot collide. Each one clears itself at the top of its own Refresh and only + /// switches on when the trader the window belongs to carries ITS behaviour, so at most one is ever + /// drawn - a bank is not a totem. + /// + public static class DvergarBancoStore + { + private static RectTransform _crewList; + private static readonly List _rows = new List(); + + /// + /// The bank the open window belongs to, read back out of StoreGui's own m_trader rather than + /// pushed in before Show(). Same field the factions sell panel and the totem's column read. + /// + public static DvergarBancoBehaviour ActiveBank(StoreGui gui) + { + Trader trader = FactionMerchantRuntime.GetActiveTrader(gui); + return trader != null ? trader.GetComponent() : null; + } + + // ---------------------------------------------------------------- build + + public static void Create(StoreGui gui) + { + if (gui == null || gui.m_listRoot == null) + { + Jotunn.Logger.LogWarning("[Dvergar] StoreGui has no m_listRoot; the contract bank's window " + + "cannot be built."); + return; + } + if (_crewList != null) return; + + GameObject clone = Object.Instantiate(gui.m_listRoot.gameObject, gui.m_listRoot.parent); + clone.name = "DvergarCrewList"; + _crewList = clone.GetComponent(); + _crewList.anchoredPosition = gui.m_listRoot.anchoredPosition; + + // The clone carries whatever rows the vanilla list held at Awake. Usually none, but a + // leftover would sit under ours forever, so it starts empty by construction. + foreach (Transform child in _crewList) Object.Destroy(child.gameObject); + + _crewList.gameObject.SetActive(false); + } + + public static void Clear() + { + foreach (GameObject row in _rows) if (row != null) Object.Destroy(row); + _rows.Clear(); + + if (_crewList != null) _crewList.gameObject.SetActive(false); + } + + // ---------------------------------------------------------------- fill + + public static void Refresh(StoreGui gui) + { + Clear(); + + DvergarBancoBehaviour bank = ActiveBank(gui); + if (bank == null) return; // an ordinary merchant, or the Trol's totem. Not ours. + + if (_crewList == null) + { + Jotunn.Logger.LogWarning("[Dvergar] The contract bank's column was never built (did the patch " + + "on StoreGui.Awake fail?), so nothing can be drawn into it."); + return; + } + + _crewList.gameObject.SetActive(true); + + int row = 0; + int hidden = 0; + foreach (DvergarBanco.Troop troop in DvergarBanco.Troops) + { + if (troop.NeedsUpgrade && !bank.IsUpgraded()) { hidden++; continue; } + BuildRow(gui, bank, troop, row++); + } + + float baseSize = Traverse.Create(gui).Field("m_itemlistBaseSize").GetValue(); + _crewList.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, + Mathf.Max(baseSize, row * gui.m_itemSpacing)); + + Jotunn.Logger.LogInfo($"[Dvergar] Contract bank window: {row} crews on offer, {hidden} still behind " + + $"the Queen, {bank.CountGroups()}/{DvergarBanco.MaxTroops} contracts live."); + } + + private static void BuildRow(StoreGui gui, DvergarBancoBehaviour bank, DvergarBanco.Troop troop, int rowIndex) + { + GameObject element = Object.Instantiate(gui.m_listElement, _crewList); + element.SetActive(true); + + RectTransform rt = (RectTransform)element.transform; + float offset = (_crewList.rect.width - rt.rect.width) / 2f; + rt.anchoredPosition = new Vector2(offset, rowIndex * -gui.m_itemSpacing - offset); + + Sprite icon = TrophyIcon(troop.Icon); + Image iconImage = element.transform.Find("icon").GetComponent(); + if (icon != null) iconImage.sprite = icon; + else Jotunn.Logger.LogWarning($"[Dvergar] No icon on '{troop.Icon}' for {troop.Display}; the row " + + "keeps whatever the cloned element was showing."); + + element.transform.Find("name").GetComponent().text = troop.Display; + + // The DISCOUNTED price, because that is what will actually leave the player's pocket. + TMP_Text price = FindDescendant(element.transform, "price"); + if (price != null) price.text = DvergarBanco.PriceFor(troop).ToString(); + + UITooltip tooltip = element.GetComponent(); + if (tooltip != null) tooltip.Set(troop.Display, Composition(troop), gui.m_tooltipAnchor, default(Vector2)); + + string id = troop.Id; + element.GetComponent