#W# Craft: Arms Lore now gives execptional armor 5 more resists. Weapons now cap at 25% DI, but Arms Lore can push it up to 35%. 1% Per 10 skill points.

This commit is contained in:
WarrentyExpired 2026-10-27 19:50:32 -04:00
parent 0c1cf1b50f
commit cc59a8ca72
5 changed files with 76 additions and 41 deletions

View file

@ -20,3 +20,5 @@ Citizens
CentrED Stuff CentrED Stuff
- Add unspawnable tiles around dungeons - Add unspawnable tiles around dungeons
Skills

View file

@ -136,19 +136,9 @@ public class CraftGump : DynamicGump
resourceType = subResource.ItemType; resourceType = subResource.ItemType;
} }
var resourceCount = 0; // Calls the new static method to combine identical resources (Logs + Boards)
//var resourceCount = CraftItem.GetAvailableResourceAmount(_from, resourceType);
if (_from.Backpack != null) var resourceCount = Server.Engines.Craft.CraftItem.GetAvailableResourceAmount(_from, resourceType);
{
foreach (var item in _from.Backpack.FindItems())
{
if (resourceType.IsInstanceOfType(item))
{
resourceCount += item.Amount;
}
}
}
builder.AddButton(15, 362, 4005, 4007, GetButtonID(6, 0)); builder.AddButton(15, 362, 4005, 4007, GetButtonID(6, 0));
if (nameNumber > 0) if (nameNumber > 0)
@ -181,19 +171,9 @@ public class CraftGump : DynamicGump
resourceType = subResource.ItemType; resourceType = subResource.ItemType;
} }
var resourceCount = 0; // Calls the new static method to combine identical resources
//var resourceCount = CraftItem.GetAvailableResourceAmount(_from, resourceType);
if (_from.Backpack != null) var resourceCount = Server.Engines.Craft.CraftItem.GetAvailableResourceAmount(_from, resourceType);
{
foreach (var item in _from.Backpack.FindItems())
{
if (resourceType.IsInstanceOfType(item))
{
resourceCount += item.Amount;
}
}
}
builder.AddButton(15, 382, 4005, 4007, GetButtonID(6, 7)); builder.AddButton(15, 382, 4005, 4007, GetButtonID(6, 7));
if (nameNumber > 0) if (nameNumber > 0)
@ -260,20 +240,9 @@ public class CraftGump : DynamicGump
); );
} }
var resourceCount = 0; // Calls the new static method to combine identical resources in the sub-menu selection
//var resourceCount = CraftItem.GetAvailableResourceAmount(from, subResource.ItemType);
if (from.Backpack != null) var resourceCount = Server.Engines.Craft.CraftItem.GetAvailableResourceAmount(from, subResource.ItemType);
{
var type = subResource.ItemType;
foreach (var item in from.Backpack.FindItems())
{
if (type.IsInstanceOfType(item))
{
resourceCount += item.Amount;
}
}
}
builder.AddButton(220, 60 + index * 20, 4005, 4007, GetButtonID(5, i)); builder.AddButton(220, 60 + index * 20, 4005, 4007, GetButtonID(5, i));
if (subResource.Name.Number > 0) if (subResource.Name.Number > 0)

View file

@ -571,7 +571,35 @@ namespace Server.Engines.Craft
return amount; return amount;
} }
public static int GetAvailableResourceAmount(Mobile from, Type resType)
{
var pack = from.Backpack;
if (pack == null)
{
return 0;
}
// Find if this resource has interchangeable types (like Logs -> Boards)
Type[] linkedTypes = null;
for (var j = 0; j < m_TypesTable.Length; ++j)
{
if (m_TypesTable[j][0] == resType)
{
linkedTypes = m_TypesTable[j];
break;
}
}
linkedTypes ??= [resType];
int totalAmount = 0;
for (int i = 0; i < linkedTypes.Length; i++)
{
totalAmount += pack.GetAmount(linkedTypes[i]);
}
return totalAmount;
}
public bool ConsumeRes( public bool ConsumeRes(
Mobile from, Type typeRes, CraftSystem craftSystem, ref int resHue, ref int maxAmount, Mobile from, Type typeRes, CraftSystem craftSystem, ref int resHue, ref int maxAmount,
ConsumeType consumeType, ref TextDefinition message ConsumeType consumeType, ref TextDefinition message
@ -890,6 +918,7 @@ namespace Server.Engines.Craft
if (gainSkills) // This is a passive check. Success chance is entirely dependant on the main skill if (gainSkills) // This is a passive check. Success chance is entirely dependant on the main skill
{ {
from.CheckSkill(craftSkill.SkillToMake, minSkill, maxSkill); from.CheckSkill(craftSkill.SkillToMake, minSkill, maxSkill);
} }
} }

View file

@ -608,7 +608,41 @@ namespace Server.Items
if (Core.AOS) if (Core.AOS)
{ {
var bonus = (int)(from.Skills.ArmsLore.Value / 20);
for (var i = 0; i < bonus; i++)
{
switch (Utility.Random(5))
{
case 0:
{
PhysicalBonus++;
break;
}
case 1:
{
FireBonus++;
break;
}
case 2:
{
ColdBonus++;
break;
}
case 3:
{
EnergyBonus++;
break;
}
case 4:
{
PoisonBonus++;
break;
}
}
}
(tool as BaseRunicTool)?.ApplyAttributesTo(this); (tool as BaseRunicTool)?.ApplyAttributesTo(this);
from.CheckSkill(SkillName.ArmsLore, 0, 100);
} }
return quality; return quality;

View file

@ -670,7 +670,8 @@ public abstract partial class BaseWeapon
if (Quality == WeaponQuality.Exceptional) if (Quality == WeaponQuality.Exceptional)
{ {
Attributes.WeaponDamage = 35; Attributes.WeaponDamage = 25 + (int)(from.Skills.ArmsLore.Value / 10);
from.CheckSkill(SkillName.ArmsLore, 0, 100);
if (Core.ML) if (Core.ML)
{ {