#W# Started work on guild rings.

This commit is contained in:
WarrentyExpired 2026-07-24 19:06:22 -04:00
parent 000d16eab6
commit 6cb014d51c
7 changed files with 201 additions and 2 deletions

View file

@ -0,0 +1,12 @@
using System;
using Server.Misc;
using Server.Mobiles;
namespace Server.Items
{
public interface ITradeSkillBonus
{
Trades TradeSkill { get; }
double TradeBonus { get; }
NpcGuild RequiredGuild { get; }
}
}

View file

@ -196,7 +196,21 @@ namespace Server.Mobiles
pm.NpcGuildJoinTime = DateTime.Now;
pm.NpcGuildGameTime = pm.GameTime;
pm.InvalidateProperties();
// --- START GUILD REWARD LOGIC ---
Item reward = null;
if ( this.NpcGuild == NpcGuild.BlacksmithsGuild )
reward = new SmithsRing();
else if ( this.NpcGuild == NpcGuild.TailorsGuild )
reward = new TailorsRing();
// Add more else ifs here as you make items for other guilds!
if ( reward != null )
{
pm.AddToBackpack( reward );
from.SendMessage( "The guildmaster places a symbol of your new membership in your backpack." );
}
// --- END GUILD REWARD LOGIC ---
dropped.Delete();
return true;
}
@ -230,4 +244,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -0,0 +1,38 @@
using System;
using Server;
using Server.Items;
using Server.Misc;
using Server.Mobiles;
namespace Server.Items
{
public class AlchemistRing : GoldRing, ITradeSkillBonus
{
public Trades TradeSkill { get { return Trades.Alchemy; } }
public double TradeBonus { get { return 5.0; } }
public NpcGuild RequiredGuild { get { return NpcGuild.AlchemistsGuild; } }
[Constructable]
public AlchemistRing()
{
Name = "ring of the master alchemist";
Hue = 0x482;
}
public AlchemistRing( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,38 @@
using System;
using Server;
using Server.Items;
using Server.Misc;
using Server.Mobiles;
namespace Server.Items
{
public class CarpentersRing : GoldRing, ITradeSkillBonus
{
public Trades TradeSkill { get { return Trades.Carpentry; } }
public double TradeBonus { get { return 5.0; } }
public NpcGuild RequiredGuild { get { return NpcGuild.CarpentryGuild; } }
[Constructable]
public CarpentersRing()
{
Name = "ring of the master carpenter";
Hue = 0x482;
}
public CarpentersRing( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,38 @@
using System;
using Server;
using Server.Items;
using Server.Misc;
using Server.Mobiles;
namespace Server.Items
{
public class SmithsRing : GoldRing, ITradeSkillBonus
{
public Trades TradeSkill { get { return Trades.Blacksmith; } }
public double TradeBonus { get { return 5.0; } }
public NpcGuild RequiredGuild { get { return NpcGuild.BlacksmithsGuild; } }
[Constructable]
public SmithsRing()
{
Name = "ring of the master smith";
Hue = 0x482;
}
public SmithsRing( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -0,0 +1,38 @@
using System;
using Server;
using Server.Items;
using Server.Misc;
using Server.Mobiles;
namespace Server.Items
{
public class TailorsRing : GoldRing, ITradeSkillBonus
{
public Trades TradeSkill { get { return Trades.Tailoring; } }
public double TradeBonus { get { return 5.0; } }
public NpcGuild RequiredGuild { get { return NpcGuild.TailorsGuild; } }
[Constructable]
public TailorsRing()
{
Name = "ring of the master tailor";
Hue = 0x482;
}
public TailorsRing( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -1,7 +1,7 @@
using System;
using Server;
using Server.Mobiles;
using Server.Items;
namespace Server.Misc
{
public enum Trades
@ -110,6 +110,27 @@ namespace Server.Misc
else if ( trade == Trades.Tailoring ){ value += (m.Dex*0.65)+(m.Int*0.35); if ( !raw && pm.NpcGuild == NpcGuild.TailorsGuild ){ value += 20; } }
else if ( trade == Trades.Tinkering ){ value += (m.Dex*0.5)+(m.Int*0.5); if ( !raw && pm.NpcGuild == NpcGuild.TinkersGuild ){ value += 20; } }
}
// --- CUSTOM TRADE BONUSES FROM ITEMS START ---
if ( !raw && m is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)m;
// Loop through every item the player is currently wearing/holding
foreach ( Item item in m.Items )
{
if ( item is ITradeSkillBonus )
{
ITradeSkillBonus bonusItem = (ITradeSkillBonus)item;
// Check if it boosts the right trade AND the player is in the required guild!
if ( bonusItem.TradeSkill == trade && pm.NpcGuild == bonusItem.RequiredGuild )
{
value += bonusItem.TradeBonus;
}
}
}
}
// --- CUSTOM TRADE BONUSES FROM ITEMS END ---
if ( value > 100 )
value = 100;