#W# Bosses: Working on Dungeon Bosses. Added some reward drops to increase stat/skill/totalskill cap.

This commit is contained in:
WarrentyExpired 2026-10-31 12:44:45 -04:00
parent 00c25cd506
commit 69a2b8772b
11 changed files with 406 additions and 3 deletions

View file

@ -0,0 +1,59 @@
using System;
using Server;
using Server.Mobiles;
using ModernUO.Serialization;
namespace Server.Items
{
[SerializationGenerator(0)]
public partial class CrystalOfFortitude : Item
{
[Constructible]
public CrystalOfFortitude() : base(0x1F19) // Matching crystal graphic
{
Name = "a crystalline shard of fortitude";
Hue = 0x21; // A deep, vibrant red hue to represent physical stats
Weight = 1.0;
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // "That must be in your pack for you to use it."
return;
}
// Standard stats are handled as simple integers (unlike skills which use tenths)
int maxCap = 250;
int capIncrease = 1;
if (from.StatCap >= maxCap)
{
from.SendMessage(38, "Your physical form cannot be pushed any further. You are already at the absolute maximum stat cap.");
return;
}
// Apply the permanent stat cap increase
from.StatCap += capIncrease;
// Failsafe in case a GM accidentally sets them too high
if (from.StatCap > maxCap)
{
from.StatCap = maxCap;
}
// Theatrical effects
from.SendMessage(0x21, "The crystal shatters, surging through your veins! Your total stat cap has permanently increased by 1.");
from.PlaySound(0x1F8);
from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
// Destroy the item
Delete();
}
public CrystalOfFortitude(Serial serial) : base(serial)
{
}
}
}

View file

@ -0,0 +1,60 @@
using System;
using Server;
using Server.Mobiles;
using ModernUO.Serialization;
namespace Server.Items
{
[SerializationGenerator(0)]
public partial class CrystalOfInsight : Item
{
[Constructible]
public CrystalOfInsight() : base(0x1F19) // A cool crystal/gem graphic
{
Name = "a crystalline shard of insight";
Hue = 0x47E; // Matches the Diamond Core stance hue
Weight = 1.0;
}
public override void OnDoubleClick(Mobile from)
{
// Security check: Must be in the player's main backpack to use
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // "That must be in your pack for you to use it."
return;
}
// In UO integer logic, 720.0 is 7200, and 1.0 is 10
int maxCap = 7200;
int capIncrease = 10;
if (from.SkillsCap >= maxCap)
{
from.SendMessage(38, "Your mind cannot expand any further. You are already at the absolute maximum skill cap.");
return;
}
// Apply the permanent increase
from.SkillsCap += capIncrease;
// Failsafe: If they somehow used a +1.0 item while at 719.5, hard-cap it at exactly 720.0
if (from.SkillsCap > maxCap)
{
from.SkillsCap = maxCap;
}
// Theatrical effects to make the reward feel powerful
from.SendMessage(0x47E, "The crystal shatters in your hands, expanding your mind! Your total skill cap has permanently increased by 1.0.");
from.PlaySound(0x1F8); // Shatter sound (same as the Titan's stance shift)
from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist); // Sparkle effect around the player
// Destroy the item now that it has been consumed
Delete();
}
public CrystalOfInsight(Serial serial) : base(serial)
{
}
}
}

View file

@ -0,0 +1,100 @@
using System;
using Server;
using Server.Mobiles;
namespace Server.Items
{
public class CrystalOfKnowledge : Item
{
private SkillName _Skill;
[CommandProperty(AccessLevel.GameMaster)]
public SkillName Skill
{
get => _Skill;
set
{
_Skill = value;
UpdateName();
}
}
[Constructible]
public CrystalOfKnowledge() : this((SkillName)Utility.Random(SkillInfo.Table.Length))
{
}
[Constructible]
public CrystalOfKnowledge(SkillName skill) : base(0x1F19)
{
_Skill = skill;
Hue = 0x501;
Weight = 1.0;
UpdateName();
}
private void UpdateName()
{
Name = $"a minor shard of {_Skill}";
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001);
return;
}
Skill targetSkill = from.Skills[_Skill];
if (targetSkill == null)
return;
int maxCap = 120;
int capIncrease = 1;
if (targetSkill.Cap >= maxCap)
{
from.SendMessage(38, $"Your mastery of {_Skill} is already at its absolute limit.");
return;
}
targetSkill.Cap += capIncrease;
if (targetSkill.Cap > maxCap)
{
targetSkill.Cap = maxCap;
}
from.SendMessage(0x501, $"The shard dissolves, permanently increasing your {_Skill} cap by 1.0!");
from.PlaySound(0x243);
from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
Delete();
}
public CrystalOfKnowledge(Serial serial) : base(serial)
{
}
// --- ModernUO Manual Serialization ---
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // Version
// Save the specific skill ID to the hard drive
writer.Write((int)_Skill);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
// Load the specific skill ID back when the server boots
_Skill = (SkillName)reader.ReadInt();
}
}
}