Fun Fact: All Human Enemies Can Spawn With Poisoned Weapons

Discuss Daggerfall Unity and Daggerfall Tools for Unity.
Post Reply
User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Fun Fact: All Human Enemies Can Spawn With Poisoned Weapons

Post by Magicono43 »

So here is something I was not expecting while reading into the code of how enemies inventories are generated. I found at the very bottom of a method this.

Code: Select all

// Chance for poisoned weapon
            if (player.Level > 1)
            {
                DaggerfallUnityItem weapon = enemyEntity.ItemEquipTable.GetItem(EquipSlots.RightHand);
                if (weapon != null && (enemyEntity.EntityType == EntityTypes.EnemyClass || enemyEntity.MobileEnemy.ID == (int)MobileTypes.Orc
                        || enemyEntity.MobileEnemy.ID == (int)MobileTypes.Centaur || enemyEntity.MobileEnemy.ID == (int)MobileTypes.OrcSergeant))
                {
                    int chanceToPoison = 5;
                    if (enemyEntity.MobileEnemy.ID == (int)MobileTypes.Assassin)
                        chanceToPoison = 60;

                    if (Dice100.SuccessRoll(chanceToPoison))
                    {
                        // Apply poison
                        weapon.poisonType = (Items.Poisons)UnityEngine.Random.Range(128, 135 + 1);
                    }
                }
            }
So enemies can ONLY spawn with poisoned weapons if the player is not currently level 1. HOWEVER, every enemy class has a 5% chance when first spawned to have their weapon inflicted with a random poison, this also includes all of the monsters listed in that if-statement as well, which I had no clue was the case. And, the only class that has an increased chance of spawning with a poisoned weapon is the assassin.

From reading some things on the Wiki (which I know is often inaccurate) I thought that only "thief" classes could spawn with poisoned weapons, or at the very least that those types had an increased chance of it happening, not just the assassin. Well, I guess this makes poison resistance an even more useful trait now that I know this, lol.

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: Fun Fact: All Human Enemies Can Spawn With Poisoned Weapons

Post by Interkarma »

This logic was built out by Allofich after reverse engineering. Below is the PR with his comments when this code was introduced.

https://github.com/Interkarma/daggerfall-unity/pull/884

While it's always possible Allofich made a mistake, usually when he says "matched to classic", it really is matched to classic. :) His info is typically more reliable than other sources.

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: Fun Fact: All Human Enemies Can Spawn With Poisoned Weapons

Post by Magicono43 »

Yeah, when I saw it I was not really doubting the accuracy, just always one of those things when you see contradictory information from two different sources, the first one that I got from the wiki which said only thief classes had a chance.

Now I know why Ralzar has had his characters die due to poison so often, literally every encounter with any human and a few select monsters has a chance of inflicting you with some kind of poison effect. Certainly makes most diseases outside of the Plague seem like child's play in comparison, but I guess those diseases get a chance multiple times instead of just once per enemy, lol.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Fun Fact: All Human Enemies Can Spawn With Poisoned Weapons

Post by Ralzar »

Yup, playing with only Quicksave has cost me a few characters :D

The trick is to never quicksave right after fighting a human if you don't have cure poison available. Instead you have to wait a while, preferably resting, to make sure you're not poisoned.
And yeah I already knew this. Any human is a possible source of poison.

User avatar
Baler
Posts: 225
Joined: Thu May 23, 2019 1:39 am
Location: Earth

Re: Fun Fact: All Human Enemies Can Spawn With Poisoned Weapons

Post by Baler »

Sounds like prime territory for a mod.

Post Reply