Integrating Arms Lore into Repairs

Moderators: Benn, Calix, senji

Post Reply
Superfast Oz
Cardinal Chunder
Posts: 1031
Joined: Fri Nov 19, 2004 11:23 pm
Contact:

Integrating Arms Lore into Repairs

Post by Superfast Oz »

Ok, so this isn't the most simple one to post about. It's fairly simple if you understand it, but difficult to explain. The short and narrow is that there is a process for repairs, with various distinct points in it. At any stage you can integrate Arms Lore in, in any way you like.

First the scripts set a variable 'toWeaken' to 1 for AOS. That means if the weapon loses dura, the amount is set at 1. Here you could say set the base to 2, and then use the arms lore skill value to calculate a chance to reduce it to 1.

Next it calculates the chance of it weakening. Here I think is the most appropriate place to integrate Arms Lore, because you gain a benefit of it without it being essential. Weaken chance is calculated like so:

Code: Select all

				return (40 + (maxHits - curHits)) - (int)(((m_Deed != null)? m_Deed.SkillLevel : mob.Skills[skill].Value) / 10);
E.g 100 dura weapon on 50 dura remaining at 120 smith skill: (40+50)-(120/10) = 78

Which is then ran against:

Code: Select all

return ( GetWeakenChance( mob, skill, curHits, maxHits ) > Utility.Random( 100 ) );
So basically if our 78 is more than a random number 1-100, then the weapon will weaken. (78% chance of losing dura)

This is rather high, but loot will be easy to come by so no big deal imo. As an example we could take arms lore skill, divide it by 50 and then divide the chance by that. So 100 arms lore / 50 = 2 = half chance to lose dura.

Finally it checks the repair difficulty vs skill and repairs if it succeeds. I don't think we should modify this as a high smith should still have the same chance to repair imo.

Armor uses the same math basically.

Calix
MOTODEAMON
Posts: 6109
Joined: Sat Dec 27, 2003 10:05 am

Re: Integrating Arms Lore into Repairs

Post by Calix »

Assuming I've understood correctly, there's 3 stages in the repair process. Simple explanation for retards like me that find the above hard to read:

1. % Chance to lose max durability on item, with this being where Arms Lore will come into play to decrease chance of max durability loss.
2. Weaken loss = how much max durability loss occurs if test above fails.
3. Actual chance to successfully repair. This is unaffected by the above. You can still have a successful repair even if max durability is lost, etc.

Not sure on the actual %'s and how much Arms Lore can/should affect it - all for the test shard I guess!

Superfast Oz
Cardinal Chunder
Posts: 1031
Joined: Fri Nov 19, 2004 11:23 pm
Contact:

Re: Integrating Arms Lore into Repairs

Post by Superfast Oz »

http://uded.net/oz/Repair.zip

I was going to do armslore / 50 so this scaled dynamically, but I realised then that you'd need at least 50 to hit 1. Below 50 would increase your chance weakening. Instead I just scaled it per 25 skill.

Code: Select all

private double GetWeakenChance( Mobile mob, SkillName skill, int curHits, int maxHits )
			{
			
				double alskill = mob.Skills[SkillName.ArmsLore].Value;
				double almod = 1;
				
						if ( alskill == 100.0 )
							almod = 2;
						else if ( alskill >= 75.0 )
							almod = 1.75;
						else if ( alskill >= 50.0 )
							almod = 1.50;
						else if ( alskill >= 25.0 )
							almod = 1.25;
						else
							almod = 1;
							
				// 40% - (1% per hp lost) - (1% per 10 craft skill)
				// Oz - Now divided by our armslore mod, maximum 2 (50%)
				return ((40 + (maxHits - curHits)) -(((m_Deed != null)? m_Deed.SkillLevel : mob.Skills[skill].Value) / 10.0)/ almod);
			}
The scaling part is obvious. The other change was changing the function type to double to allow decimals into the formulaz.

Post Reply