Is our weapon/armor (HP) damage rate consistent with UO?

If Wishes were UOX Coders, we'd be done by now ;P Post your wishes/suggestions for UOX3 changes/improvements here.
Post Reply
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Is our weapon/armor (HP) damage rate consistent with UO?

Post by stranf »

As i recall from my 1997 days of UO, your equipment would show signs of wear and tear and you had to make sure to have a spare weapon or possibly a suit of armor if your armor condition (hp) got low.

Meeting smiths and having them repair your magic weapons and precious armor became a very real business in the early days of UO.

I've noticed with version 3.7 that my weapons and armor show very little signs of wear and tear, even after tremendous adventuring. granted, my UO PC wasn't as tough as he is in UOx3, so maybe it has something to do with skill? Or maybe later patches of UO reduced this amount because Power Gamers were whining that their swords were breaking.

whatever the case, I'm wondering what you think about changing the amount of damage caused to your weapons and armor when you get hit/cause damage. maybe twice or three times the current amount, but not so serious that you have to worry about carrying extra weapons for a dungeon run. having a sword be repaired after 4 or 5 dungeon expeditions should be about right for how I remember UO. Currently I could probably go for 40 or 50 without so much of a worry.

Anybody familiar with how this is calculated? thanks.
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post by Maarc »

It's a straightforward solution:

Code: Select all

if( doDamage && !p->IsNpc() && !RandomNum( 0, 5 ) )
If you're a PC, and it rolls a six sided dice and comes up with a 1, then damage is applied to the weapon (a single hitpoint is taken off it).

Same damage rate is applied to shields (and only shields) when they are attacked, though damage occurs to that less often (it's skill based to some degree, if the skill check fails, then it's the same random roll, if the skill check passes, no damage. If skill check passes, damage is also reduced, too, because of successful parry).
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

So that code is in the c++ I assume?

and as for armor, it gets no damage at all?

I honestly don't think this is a serious or priority issue by any means, I was just wondering about what everyone else thinks.

I notice most of my players are wearing the same stuff as they started with, and the usefulness of blacksmiths has gone down some.
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post by Maarc »

Yup, that's C++ and yup, that's shields only (and even then, it's for physical damage only, not elemental or poison).

I suspect, however, that some of this is already editable via JS for combat routines. It would be applied when you call the JS function ApplyDefenseModifiers. Given that you can call this, it makes me suspect that it is possible to script around this particular issue, if you deem it as such.

Here is the code for that particular routine:

Code: Select all

SI16 CHandleCombat::ApplyDefenseModifiers( WeatherType damageType, CChar *mChar, CChar *ourTarg, UI08 getFightSkill, UI08 hitLoc, SI16 baseDamage, bool doArmorDamage )
{
	if( !ValidateObject( ourTarg ) )
		return baseDamage;

	UI16 getDef = 0, attSkill = 1000;
	R32 damageModifier = 0;
	R32 damage = (R32)baseDamage;
	
	if( ValidateObject( mChar ) )
		attSkill = mChar->GetSkill( getFightSkill );

	CSocket *targSock = ourTarg->GetSocket();
	CItem *shield = getShield( ourTarg );

	switch( damageType )
	{
		case NONE: break;	//	No Armor protection
		case PHYSICAL:		//	Physical damage
			// Check Shield Defense
			if( ValidateObject( shield ) )
			{
				Skills->CheckSkill( ourTarg, PARRYING, 0, 1000 );
				// Chance to block with Shield ( % = Skill / 2 ) 
				const UI16 defendParry = ourTarg->GetSkill( PARRYING );
				if( HalfRandomNum( defendParry ) >= HalfRandomNum( attSkill ) )
				{
					damage -= HalfRandomNum( shield->GetResist( PHYSICAL ) );
					if( !RandomNum( 0, 5 ) ) 
						shield->IncHP( -1 );
					if( shield->GetHP() <0>sysmessage( 283 );
						shield->Delete();
					}
				}
			}

			getDef = HalfRandomNum( calcDef( ourTarg, hitLoc, doArmorDamage, PHYSICAL ) );
			break;
		case POISON:		//	POISON Damage
			damageModifier = ( calcDef( ourTarg, hitLoc, doArmorDamage, damageType ) / 100 );
			damage = (SI16)roundNumber( ((R32)baseDamage - ( (R32)baseDamage * damageModifier )) );
			break;
		default:			//	Elemental damage
			getDef = HalfRandomNum( calcDef( ourTarg, hitLoc, doArmorDamage, damageType ) );
			break;
	}

	if( getDef > 0 )
		damage -= (R32)( ( (R32)getDef * (R32)attSkill ) / 750 );

	return (SI16)roundNumber( damage );
}

If you have any questions about it, sing out, but you could probably understand most of it if you understand JS (the syntax is somewhat different, but not hugely so).

And yup, armour doesn't get any damage at all.
Post Reply