Seifer

Citizen
ServUO Version
Publish 57
Ultima Expansion
Renaissance
Not really sure what I am missing there, it looks pretty simple but monsters like balron are still doing 50+ damage on naked players. Im guessing damage is generated somewhere else ? (Baseweapons maybe?)

thanks for your highlightment
:)

dmg:
 public virtual void AlterMeleeDamageTo(Mobile to, ref int damage)
        {
            
            int mindamage = 5;
            int maxdamage = 35;
            
            // Damage Limit from monsters to Players//
            if(IsMonster && to is PlayerMobile)
            {
            if (damage <= 5)
            {
            damage = (int)mindamage;
            }
            else if (damage >= 35)
            {
            damage = (int)maxdamage;
            }
            }
 

UO_Stryder

Citizen
Add an override to the balron like this:

AlterMeleeDamageTo:
        public override void AlterMeleeDamageTo(Mobile to, ref int damage)
        {
            base.AlterMeleeDamageTo(to, ref damage);
            
            if (damage > 50)
                damage = 50;
        }

Your code is changing only it's Min/Max hit damage like you would change on a weapon. It does not really mean it can do a minimum of 5 damage and a maximum of 35. That is before any modifiers like their skills and stats are taken into account.
 

UO_Stryder

Citizen
Adding this to every single creature sounds pretty awful tho :p
You're not adding it to every single creature, you're overriding in Balron.cs not adding to the virtual in BaseCreature.cs which makes it for balrons only.

**Edit**
You'll want to add a PlayerMobile check to make sure it only decreases damage for players only and not their pets. Such as:
AlterMeleeDamageTo:
        public override void AlterMeleeDamageTo(Mobile to, ref int damage)
        {
            base.AlterMeleeDamageTo(to, ref damage);

            if (to is PlayerMobile && damage > 50)
                damage = 50;
        }
 
Last edited: