diff --git a/Scripts/Engines/Craft/Core/ITradeSkillBonus.cs b/Scripts/Engines/Craft/Core/ITradeSkillBonus.cs new file mode 100644 index 0000000..67d873f --- /dev/null +++ b/Scripts/Engines/Craft/Core/ITradeSkillBonus.cs @@ -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; } + } +} diff --git a/Scripts/Mobiles/Base/BaseGuildmaster.cs b/Scripts/Mobiles/Base/BaseGuildmaster.cs index fcc5652..a800796 100644 --- a/Scripts/Mobiles/Base/BaseGuildmaster.cs +++ b/Scripts/Mobiles/Base/BaseGuildmaster.cs @@ -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(); } } -} \ No newline at end of file +} diff --git a/Scripts/Quests/Rewards/GuildRings/AlchemistRing.cs b/Scripts/Quests/Rewards/GuildRings/AlchemistRing.cs new file mode 100644 index 0000000..ab19345 --- /dev/null +++ b/Scripts/Quests/Rewards/GuildRings/AlchemistRing.cs @@ -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(); + } + } +} diff --git a/Scripts/Quests/Rewards/GuildRings/CarpenterRing.cs b/Scripts/Quests/Rewards/GuildRings/CarpenterRing.cs new file mode 100644 index 0000000..026126e --- /dev/null +++ b/Scripts/Quests/Rewards/GuildRings/CarpenterRing.cs @@ -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(); + } + } +} diff --git a/Scripts/Quests/Rewards/GuildRings/SmithsRing.cs b/Scripts/Quests/Rewards/GuildRings/SmithsRing.cs new file mode 100644 index 0000000..cba8a48 --- /dev/null +++ b/Scripts/Quests/Rewards/GuildRings/SmithsRing.cs @@ -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(); + } + } +} diff --git a/Scripts/Quests/Rewards/GuildRings/TailorsRing.cs b/Scripts/Quests/Rewards/GuildRings/TailorsRing.cs new file mode 100644 index 0000000..5fc425a --- /dev/null +++ b/Scripts/Quests/Rewards/GuildRings/TailorsRing.cs @@ -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(); + } + } +} diff --git a/Scripts/Skills/SkillCheck.cs b/Scripts/Skills/SkillCheck.cs index 67b5ff8..43c0fc4 100644 --- a/Scripts/Skills/SkillCheck.cs +++ b/Scripts/Skills/SkillCheck.cs @@ -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;