#W# Started work on guild rings.
This commit is contained in:
parent
000d16eab6
commit
6cb014d51c
7 changed files with 201 additions and 2 deletions
12
Scripts/Engines/Craft/Core/ITradeSkillBonus.cs
Normal file
12
Scripts/Engines/Craft/Core/ITradeSkillBonus.cs
Normal 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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -196,7 +196,21 @@ namespace Server.Mobiles
|
||||||
pm.NpcGuildJoinTime = DateTime.Now;
|
pm.NpcGuildJoinTime = DateTime.Now;
|
||||||
pm.NpcGuildGameTime = pm.GameTime;
|
pm.NpcGuildGameTime = pm.GameTime;
|
||||||
pm.InvalidateProperties();
|
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();
|
dropped.Delete();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
38
Scripts/Quests/Rewards/GuildRings/AlchemistRing.cs
Normal file
38
Scripts/Quests/Rewards/GuildRings/AlchemistRing.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
38
Scripts/Quests/Rewards/GuildRings/CarpenterRing.cs
Normal file
38
Scripts/Quests/Rewards/GuildRings/CarpenterRing.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
38
Scripts/Quests/Rewards/GuildRings/SmithsRing.cs
Normal file
38
Scripts/Quests/Rewards/GuildRings/SmithsRing.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
38
Scripts/Quests/Rewards/GuildRings/TailorsRing.cs
Normal file
38
Scripts/Quests/Rewards/GuildRings/TailorsRing.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using Server;
|
using Server;
|
||||||
using Server.Mobiles;
|
using Server.Mobiles;
|
||||||
|
using Server.Items;
|
||||||
namespace Server.Misc
|
namespace Server.Misc
|
||||||
{
|
{
|
||||||
public enum Trades
|
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.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; } }
|
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 )
|
if ( value > 100 )
|
||||||
value = 100;
|
value = 100;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue