From 27a3e6858855224c1fb3c3b24ceb17adc8f7e2dc Mon Sep 17 00:00:00 2001 From: asayre Date: Sat, 23 Sep 2006 05:04:08 +0000 Subject: [PATCH] --- .../New Guild System/GuildMemberInfoGump.cs | 4 ++-- Scripts/Items/Armor/Plate/WoodlandArms.cs | 1 + Scripts/Items/Armor/Plate/WoodlandChest.cs | 1 + Scripts/Items/Armor/Plate/WoodlandGloves.cs | 1 + Scripts/Items/Armor/Plate/WoodlandGorget.cs | 7 ++++-- Scripts/Items/Armor/Plate/WoodlandLegs.cs | 1 + Scripts/Items/Clothing/Waist.cs | 2 ++ Scripts/Misc/Guild.cs | 22 ++++++++++++++----- Scripts/Mobiles/Vendors/SBInfo/SBFisherman.cs | 8 +++---- 9 files changed, 33 insertions(+), 14 deletions(-) diff --git a/Scripts/Gumps/Guilds/New Guild System/GuildMemberInfoGump.cs b/Scripts/Gumps/Guilds/New Guild System/GuildMemberInfoGump.cs index b5f21676d..4494fd58e 100644 --- a/Scripts/Gumps/Guilds/New Guild System/GuildMemberInfoGump.cs +++ b/Scripts/Gumps/Guilds/New Guild System/GuildMemberInfoGump.cs @@ -150,11 +150,11 @@ namespace Server.Guilds { if( m_Member == pm.GuildFealty && guild.Leader != m_Member ) pm.SendLocalizedMessage( 1063158 ); // You have cleared your vote for guild leader. - else if( playerRank.GetFlag( RankFlags.CanVote ) ) + else if( guild.CanVote( m_Member ) )//( playerRank.GetFlag( RankFlags.CanVote ) ) { if( m_Member == guild.Leader ) pm.SendLocalizedMessage( 1063424 ); // You can't vote for the current guild leader. - else if( guild.CanBeVotedFor( m_Member ) ) + else if( !guild.CanBeVotedFor( m_Member ) ) pm.SendLocalizedMessage( 1063425 ); // You can't vote for an inactive guild member. else { diff --git a/Scripts/Items/Armor/Plate/WoodlandArms.cs b/Scripts/Items/Armor/Plate/WoodlandArms.cs index cde2ecae3..5d6e51122 100644 --- a/Scripts/Items/Armor/Plate/WoodlandArms.cs +++ b/Scripts/Items/Armor/Plate/WoodlandArms.cs @@ -21,6 +21,7 @@ namespace Server.Items public override int ArmorBase{ get{ return 40; } } public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } } + public override Race RequiredRace { get { return Race.Elf; } } [Constructable] public WoodlandArms() : base( 0x2B6C ) diff --git a/Scripts/Items/Armor/Plate/WoodlandChest.cs b/Scripts/Items/Armor/Plate/WoodlandChest.cs index 140ba1aa7..b49bb1672 100644 --- a/Scripts/Items/Armor/Plate/WoodlandChest.cs +++ b/Scripts/Items/Armor/Plate/WoodlandChest.cs @@ -21,6 +21,7 @@ namespace Server.Items public override int ArmorBase{ get{ return 40; } } public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } } + public override Race RequiredRace { get { return Race.Elf; } } [Constructable] public WoodlandChest() : base( 0x2B67 ) diff --git a/Scripts/Items/Armor/Plate/WoodlandGloves.cs b/Scripts/Items/Armor/Plate/WoodlandGloves.cs index f52b7deaa..df73c7ca2 100644 --- a/Scripts/Items/Armor/Plate/WoodlandGloves.cs +++ b/Scripts/Items/Armor/Plate/WoodlandGloves.cs @@ -21,6 +21,7 @@ namespace Server.Items public override int ArmorBase{ get{ return 40; } } public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } } + public override Race RequiredRace { get { return Race.Elf; } } [Constructable] public WoodlandGloves() : base( 0x2B6A ) diff --git a/Scripts/Items/Armor/Plate/WoodlandGorget.cs b/Scripts/Items/Armor/Plate/WoodlandGorget.cs index f58e06ba5..059ff730b 100644 --- a/Scripts/Items/Armor/Plate/WoodlandGorget.cs +++ b/Scripts/Items/Armor/Plate/WoodlandGorget.cs @@ -21,11 +21,11 @@ namespace Server.Items public override int ArmorBase{ get{ return 40; } } public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } } + public override Race RequiredRace { get { return Race.Elf; } } [Constructable] public WoodlandGorget() : base( 0x2B69 ) { - Weight = 2.0; } public WoodlandGorget( Serial serial ) : base( serial ) @@ -36,7 +36,7 @@ namespace Server.Items { base.Serialize( writer ); - writer.WriteEncodedInt( 0 ); // version + writer.WriteEncodedInt( 1 ); // version } public override void Deserialize( GenericReader reader ) @@ -44,6 +44,9 @@ namespace Server.Items base.Deserialize( reader ); int version = reader.ReadEncodedInt(); + + if( version == 0 ) + Weight = -1; } } } \ No newline at end of file diff --git a/Scripts/Items/Armor/Plate/WoodlandLegs.cs b/Scripts/Items/Armor/Plate/WoodlandLegs.cs index e3ad1c567..62252decd 100644 --- a/Scripts/Items/Armor/Plate/WoodlandLegs.cs +++ b/Scripts/Items/Armor/Plate/WoodlandLegs.cs @@ -21,6 +21,7 @@ namespace Server.Items public override int ArmorBase{ get{ return 40; } } public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } } + public override Race RequiredRace { get { return Race.Elf; } } [Constructable] public WoodlandLegs() : base( 0x2B6B ) diff --git a/Scripts/Items/Clothing/Waist.cs b/Scripts/Items/Clothing/Waist.cs index 34db6c45b..289a5436a 100644 --- a/Scripts/Items/Clothing/Waist.cs +++ b/Scripts/Items/Clothing/Waist.cs @@ -101,6 +101,8 @@ namespace Server.Items [FlipableAttribute( 0x2B68, 0x315F )] public class WoodlandBelt : BaseWaist { + public override Race RequiredRace { get { return Race.Elf; } } + [Constructable] public WoodlandBelt() : this( 0 ) { diff --git a/Scripts/Misc/Guild.cs b/Scripts/Misc/Guild.cs index 6e4923243..4fcf47e5a 100644 --- a/Scripts/Misc/Guild.cs +++ b/Scripts/Misc/Guild.cs @@ -1467,7 +1467,7 @@ namespace Server.Guilds return false; } - return ( m == null || m.Deleted || m.Guild != this ); + return ( m != null && !m.Deleted && m.Guild == this ); } public bool CanBeVotedFor( Mobile m ) { @@ -1478,12 +1478,13 @@ namespace Server.Guilds return false; } - return ( m == null || m.Deleted || m.Guild != this ); + return ( m != null && !m.Deleted && m.Guild == this ); } public void CalculateGuildmaster() { - Hashtable votes = new Hashtable(); + //Hashtable votes = new Hashtable(); + Dictionary votes = new Dictionary(); int votingMembers = 0; @@ -1508,10 +1509,19 @@ namespace Server.Guilds if ( m == null ) continue; + int v; + + if( !votes.TryGetValue( m, out v ) ) + votes[m] = 1; + else + votes[m] = v + 1; + + /* if ( votes[m] == null ) votes[m] = (int)1; else votes[m] = (int)(votes[m]) + 1; + * */ votingMembers++; } @@ -1519,10 +1529,10 @@ namespace Server.Guilds Mobile winner = null; int highVotes = 0; - foreach ( DictionaryEntry de in votes ) + foreach ( KeyValuePair kvp in votes ) { - Mobile m = (Mobile)de.Key; - int val = (int)de.Value; + Mobile m = (Mobile)kvp.Key; + int val = (int)kvp.Value; if ( winner == null || val > highVotes ) { diff --git a/Scripts/Mobiles/Vendors/SBInfo/SBFisherman.cs b/Scripts/Mobiles/Vendors/SBInfo/SBFisherman.cs index 1acc31211..e2e869596 100644 --- a/Scripts/Mobiles/Vendors/SBInfo/SBFisherman.cs +++ b/Scripts/Mobiles/Vendors/SBInfo/SBFisherman.cs @@ -23,10 +23,10 @@ namespace Server.Mobiles Add( new GenericBuyInfo( typeof( RawFishSteak ), 3, 20, 0x97A, 0 ) ); //TODO: Add( new GenericBuyInfo( typeof( SmallFish ), 3, 20, 0xDD6, 0 ) ); //TODO: Add( new GenericBuyInfo( typeof( SmallFish ), 3, 20, 0xDD7, 0 ) ); - Add( new GenericBuyInfo( typeof( Fish ), 3, 80, 0x9CC, 0 ) ); - Add( new GenericBuyInfo( typeof( Fish ), 3, 80, 0x9CD, 0 ) ); - Add( new GenericBuyInfo( typeof( Fish ), 3, 80, 0x9CE, 0 ) ); - Add( new GenericBuyInfo( typeof( Fish ), 3, 80, 0x9CF, 0 ) ); + Add( new GenericBuyInfo( typeof( Fish ), 6, 80, 0x9CC, 0 ) ); + Add( new GenericBuyInfo( typeof( Fish ), 6, 80, 0x9CD, 0 ) ); + Add( new GenericBuyInfo( typeof( Fish ), 6, 80, 0x9CE, 0 ) ); + Add( new GenericBuyInfo( typeof( Fish ), 6, 80, 0x9CF, 0 ) ); Add( new GenericBuyInfo( typeof( FishingPole ), 15, 20, 0xDC0, 0 ) ); } }