public OrganizationGump( PlayerMobile from, CustomGuildStone guild, int currentNav, int navScroll, int currentMain, int mainScroll, 
     GuildRankInfo rank, PlayerMobile member)
     : base(0, 0)
 {
     InitialSetup( from, guild, currentNav, navScroll, currentMain, mainScroll, rank, member );
     AddNavigation();
     AddMain();
 }
Example #2
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            if( version > 1 )
                m_ControllingGuild = (CustomGuildStone)reader.ReadItem();

            Treasuries.Add( this );
        }
        public GuildDyeTarget( PlayerMobile m, int hue, bool clothing, CustomGuildStone guild )
            : base(8, false, TargetFlags.None)
        {
            m_hue = hue;
            m_clothing = clothing;
            m_guild = guild;

            if( hue < 0 && CustomGuildStone.IsGuildLeader(m, guild) )
                m.SendMessage( "Target an item of the desired colour for your guild's {0} colour.", clothing == true ? "clothing" : "armour" );

            else
            {
                if( !clothing )
                    m.SendMessage( "Choose the piece of armour you wish to enamel." );

                else
                    m.SendMessage( "Choose the piece of clothing you wish to dye." );

                if( CustomGuildStone.IsGuildLeader(m, guild) )
                    m.SendMessage( "If you wish to reset your guild's {0} colour, target yourself.", clothing == true ? "clothing" : "armour" );
            }
        }
        public CustomGuildInfo( GenericReader reader )
        {
            int version = reader.ReadInt();
            int test = 0;

            if( version < 1 )
            {
                m_GuildStone = (CustomGuildStone)reader.ReadItem();
                test = reader.ReadInt();
                test = reader.ReadInt();
                test = reader.ReadInt();
                test = reader.ReadInt();
                test = reader.ReadInt();
                test = reader.ReadInt();
                test = reader.ReadInt();
                test = reader.ReadInt();
                test = reader.ReadInt();
                test = reader.ReadInt();
                test = reader.ReadInt();
                test = reader.ReadInt();
                test = reader.ReadInt();
                test = reader.ReadInt();
                m_RegistrationName = reader.ReadString();
            }

            else
            {
                m_GuildStone = (CustomGuildStone)reader.ReadItem();
                m_RankID = reader.ReadInt();
                m_RegistrationName = reader.ReadString();
                m_ActiveTitle = reader.ReadBool();

                if( version > 1 )
                    m_Balance = reader.ReadInt();
            }
        }
Example #5
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
            m_Guild = (CustomGuildStone)reader.ReadItem();
            m_Charges = reader.ReadInt();
            m_ExpirationDate = reader.ReadDateTime();
        }
        public void TryToAddNeutral( PlayerMobile m, CustomGuildStone g )
        {
            if( !IsGuildOfficer(m, this, true) )
                return;

            if( AlliedGuilds.Contains(g) )
                AlliedGuilds.Remove( g );

            if( EnemyGuilds.Contains(g) )
                EnemyGuilds.Remove( g );
        }
        public static bool IsGuildOwner( PlayerMobile m, CustomGuildStone g )
        {
            if( m.AccessLevel > AccessLevel.Player )
                return true;

            if (g.Owner == null)
                return false;

            if( g.Owner == m )
                return true;

            return false;
        }
 public static bool IsGuildOfficer( PlayerMobile m, CustomGuildStone g )
 {
     return IsGuildOfficer( m, g, false );
 }
        public static bool IsGuildMember( PlayerMobile m, CustomGuildStone g, bool msg )
        {
            if( g.Members.Contains(m) && m.CustomGuilds.ContainsKey(g) )
                return true;

            if( msg )
                m.SendMessage( "You do not have access to that function because you are not a member this organization." );

            return false;
        }
        public static bool IsGuildEconomic(PlayerMobile m, CustomGuildStone g)
        {
            if (m.AccessLevel > AccessLevel.Player)
                return true;

            if (IsGuildLeader(m, g))
                return true;

            if (IsGuildMember(m, g) && m.CustomGuilds[g].RankInfo != null && m.CustomGuilds[g].RankInfo.IsEconomic)
                return true;

            return false;
        }
 public static bool HasViewingRights( PlayerMobile m, CustomGuildStone g )
 {
     return HasViewingRights( m, g, false );
 }
        public void MyOrganizationsOnResponse( int id )
        {
            if( id >= (int)Buttons.MB1 && id <= (int)Buttons.MB8 )
            {
                int index = id - (int)Buttons.MB1 + m_Start;

                if( CustomGuildStone.Guilds.Count > index )
                    CustomGuildStone.Guilds[index].TryToApply( m_Viewer );
            }

            if( id >= (int)Buttons.MB9 && id <= (int)Buttons.MB16 )
            {
                int index = id - (int)Buttons.MB9 + m_Start;

                if( CustomGuildStone.Guilds.Count > index )
                    CustomGuildStone.Guilds[index].TryToResign( m_Viewer );
            }

            if( id >= (int)Buttons.MB17 && id <= (int)Buttons.MB24 )
            {
                int index = id - (int)Buttons.MB17 + m_Start;

                if( CustomGuildStone.Guilds.Count > index && CustomGuildStone.HasViewingRights( m_Viewer, CustomGuildStone.Guilds[index], true ) )
                    m_Guild = CustomGuildStone.Guilds[index];
            }
        }
        public virtual void InitialSetup( PlayerMobile from, CustomGuildStone guild, int currentNav, int navScroll, int currentMain, int mainScroll, 
            GuildRankInfo rank, PlayerMobile member)
        {
            Closable = true;
            Disposable = true;
            Dragable = true;
            Resizable = false;
            m_Guild = guild;
            m_CurrentNav = currentNav;
            m_NavScroll = navScroll;
            m_CurrentMain = currentMain;
            m_MainScroll = mainScroll;
            m_Rank = rank;
            m_Member = member;
            m_ItemsPerPage = 9;
            m_Start = m_ItemsPerPage * m_NavScroll;
            m_Y = 228;
            m_LineHeight = 28;
            m_Viewer = from;
            m_Viewer.CloseGump( typeof(OrganizationGump) );
            AddPage( 0 );
            AddBackground( 64, 114, 671, 55, 9270 );
            AddLabel( 215, 132, 2010, @"Khaeros'   Government   and   Private   Organization   System" );
            AddBackground( 64, 169, 203, 338, 9270 );
            AddBackground( 267, 169, 468, 338, 9270 );
            AddBackground( 283, 185, 435, 305, 3500 );
            AddBackground( 80, 185, 170, 305, 3500 );
            AddBackground( 64, 507, 671, 55, 9270 );
            AddImage( 703, 61, 10441 );
            AddImage( 16, 61, 10440 );

            if( m_Guild != null && !String.IsNullOrEmpty(m_Guild.Name) )
                AddLabel( 82, 525, 2010, "Organization:   " + m_Guild.Name.Replace(" ", "   ") );
        }
 public GuildTreasuryTarget( PlayerMobile m, CustomGuildStone guild )
     : base(8, false, TargetFlags.None)
 {
     g = guild;
     m.SendMessage( "Target a safe to use as your guild's treasury." );
 }
Example #15
0
 public GovernmentGump( PlayerMobile from, CustomGuildStone gov, int currentNav, int navScroll, int currentMain, int mainScroll,
                         GuildRankInfo rank, PlayerMobile member )
     : base(from, gov, currentNav, navScroll, currentMain, mainScroll, rank, member)
 {
 }
        public static void CheckMemberActivity(CustomGuildStone g)
        {
            List<PlayerMobile> inactiveList = new List<PlayerMobile>();

            foreach (Mobile m in g.Members)
            {
                if (m is PlayerMobile)
                {
                    PlayerMobile pm = m as PlayerMobile;

                    if (pm.LastOnline + TimeSpan.FromDays(45) < DateTime.Now)
                        inactiveList.Add(pm);
                }
            }

            int count = inactiveList.Count;
            for (int i = 0; i < count; i++)
                g.Members.Remove(inactiveList[i]);
        }
 public OrganizationGump( PlayerMobile from, CustomGuildStone guild )
     : this(from, guild, 0, 0, 0, 0)
 {
 }
        public static bool HasViewingRights( PlayerMobile m, CustomGuildStone g, bool msg )
        {
            if( m.AccessLevel > AccessLevel.Player )
                return true;

            if( IsGuildOwner( m, g ) )
                return true;

            return IsGuildMember( m, g, msg );
        }
 public OrganizationGump( PlayerMobile from, CustomGuildStone guild, int currentNav, int navScroll, int currentMain, int mainScroll )
     : this(from, guild, currentNav, navScroll, currentMain, mainScroll, null, null)
 {
 }
        public static bool IsGuildLeader( PlayerMobile m, CustomGuildStone g, bool msg )
        {
            if( m.AccessLevel > AccessLevel.Player )
                return true;

            if( IsGuildOwner(m, g) )
                return true;

            if( IsGuildMember(m, g) && m.CustomGuilds[g].RankID == g.Ranks.Count )
                return true;

            if( msg )
                m.SendMessage( "You do not have access to that function because you are not one of the leaders of this organization." );

            return false;
        }
        public static void ChangeHue(CustomGuildStone g, int newHue, bool clothes)
        {
            if (g is GovernmentEntity)
            {
                GovernmentEntity gov = g as GovernmentEntity;

                if (clothes)
                {
                    if (gov.Employees != null)
                    {
                        foreach (Mobile m in gov.Employees)
                        {
                            if (!m.Deleted && m is BaseCreature)
                            {
                                (m as BaseCreature).DyeClothes = newHue;
                            }
                        }
                    }
                    if (gov.TradeAdvisor != null && !gov.TradeAdvisor.Deleted)
                        gov.TradeAdvisor.DyeClothes = newHue;
                    if (gov.MilitaryAdvisor != null && !gov.MilitaryAdvisor.Deleted)
                        gov.MilitaryAdvisor.DyeClothes = newHue;
                }
                else
                {
                    if (gov.Employees != null)
                    {
                        foreach (Mobile m in gov.Employees)
                        {
                            if (!m.Deleted && m is BaseCreature)
                            {
                                (m as BaseCreature).DyeArmour = newHue;
                            }
                        }
                    }
                    if (gov.TradeAdvisor != null && !gov.TradeAdvisor.Deleted)
                        gov.TradeAdvisor.DyeArmour = newHue;
                    if (gov.MilitaryAdvisor != null && !gov.MilitaryAdvisor.Deleted)
                        gov.MilitaryAdvisor.DyeArmour = newHue;
                }
            }
        }
        public static bool IsGuildMilitary(PlayerMobile m, CustomGuildStone g)
        {
            if (m.AccessLevel > AccessLevel.Player)
                return true;

            if( (IsGuildMember(m, g) && ((m.CustomGuilds[g].RankInfo != null && m.CustomGuilds[g].RankInfo.IsMilitary) || IsGuildOwner(m,g) || IsGuildLeader(m,g))))
                return true;

            return false;
        }
 public DepositCopperTarget( PlayerMobile m, CustomGuildStone guild )
     : base(8, false, TargetFlags.None)
 {
     g = guild;
     m.SendMessage( "Target a pile of copper in your backpack to deposit it into your organizaiton's treasury." );
 }
        public static bool IsGuildOfficer( PlayerMobile m, CustomGuildStone g, bool msg )
        {
            if( m.AccessLevel > AccessLevel.Player )
                return true;

            if( (IsGuildMember(m, g) && m.CustomGuilds[g].RankInfo != null && m.CustomGuilds[g].RankInfo.IsOfficer) || IsGuildOwner( m, g ) )
                return true;

            if (IsGuildMilitary(m, g))
                return true;

            if( msg )
                m.SendMessage( "You do not have access to that function because you are not an officer of this organization." );

            return false;
        }
Example #25
0
 public GovernmentGump( PlayerMobile from, CustomGuildStone gov )
     : this(from, gov, 0, 0, 0, 0)
 {
 }
        public static bool Outranks( PlayerMobile one, PlayerMobile two, CustomGuildStone g )
        {
            if( one.AccessLevel > AccessLevel.Player )
                return true;

            if( !IsGuildOwner(two, g) )
            {
                if( IsGuildOwner(one, g) )
                    return true;

                if( IsGuildMember(one, g) && IsGuildMember(two, g) )
                {
                    if( one.CustomGuilds[g].RankID > two.CustomGuilds[g].RankID )
                        return true;
                }
            }

            if( one == two )
                return true;

            one.SendMessage( "You cannot change the status of a member of equal or superior rank in an organization." );
            return false;
        }
Example #27
0
 public GovernmentGump( PlayerMobile from, CustomGuildStone gov, int currentNav, int navScroll, int currentMain, int mainScroll )
     : this(from, gov, currentNav, navScroll, currentMain, mainScroll, null, null)
 {
 }
Example #28
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            int test = 0;

            if (version > 57)
            {
                m_Orders = new List<OrderInfo>();
                int orderCount = reader.ReadInt();
                for (int i = 0; i < orderCount; i++)
                {
                    OrderInfo newOrder = new OrderInfo("", 1, 1, this);
                    OrderInfo.Deserialize(reader, newOrder);
                    m_Orders.Add(newOrder);
                }
            }

            if (version > 55)
            {
                m_Deadly = reader.ReadInt();
            }

            if (version > 54)
            {
                m_Nation = (Nation)reader.ReadInt();
                m_Government = (GovernmentEntity)reader.ReadItem();
                m_Organization = (CustomGuildStone)reader.ReadItem();
            }

            if( version > 53 )
                m_AuraType = (AuraType)reader.ReadInt();

            if( version > 52 )
                m_CustomBreathType = (CustomBreathType)reader.ReadInt();

            if( version > 51 )
                m_ManeuverResistance = reader.ReadInt();

            if( version > 50 )
            {
                m_CantInterrupt = reader.ReadBool();
                m_CantParry = reader.ReadBool();
                m_HasNoCorpse = reader.ReadBool();
            }

            if( version > 49 )
            {
                int count = reader.ReadInt();

                for( int i = 0; i < count; i++ )
                    m_SecondaryWikiConfigs.Add( reader.ReadString() );

                count = reader.ReadInt();

                for( int i = 0; i < count; i++ )
                {
                    XMLEventType eventType = (XMLEventType)reader.ReadInt();
                    List<string> list = new List<string>();
                    int codeCount = reader.ReadInt();

                    for( int a = 0; a < codeCount; a++ )
                        list.Add( reader.ReadString() );

                    m_XMLEventsDatabase.Add( eventType, list );
                }
            }

            if( version > 48 )
                m_RangedAttackType = (RangedAttackType)reader.ReadInt();

            if( version > 47 )
                m_CustomSkinnableParts = reader.ReadStrongItemList();

            if( version > 46 )
            {
                m_NoWoundedMovePenalty = reader.ReadBool();
                m_MeleeAttackType = (MeleeAttackType)reader.ReadInt();
            }

            if( version > 45 )
                m_WikiConfig = reader.ReadString();

            if( version > 44 )
            {
                m_Technique = reader.ReadString();
                m_TechniqueLevel = reader.ReadInt();
            }

            if( version > 43 )
                m_StableTicket = reader.ReadItem();

            if( version > 41 )
                m_StabledOwner = reader.ReadMobile();

            if( version > 40 )
                m_ReceivedNewLoot = reader.ReadBool();

            if( version > 39 )
            {
                m_TimeOfDeath = reader.ReadDeltaTime();

                if( reader.ReadBool() )
                    BeginRess( reader.ReadDeltaTime() - DateTime.Now, this.Corpse );

                m_Lives = reader.ReadInt();
            }

            if( version > 38 )
                m_ReleaseTime = reader.ReadDateTime();

            if( version > 37 )
                m_MarkedForTermination = reader.ReadBool();

            if( version > 36 )
            {
                m_FavouriteStance = reader.ReadString();
                m_FavouriteManeuver = reader.ReadString();
            }

            if( version > 34 )
                m_CombatStyles = new CombatStyles( reader );

            if( version > 32 )
                m_Feats = new Feats( reader, true );

            if( version > 33 )
                m_FixedScales = reader.ReadBool();

            if( version > 31 )
            {
                m_NoDeathCondition = reader.ReadBool();
                m_NoDeath = reader.ReadBool();
                m_NoDeathMsg = reader.ReadString();
                m_NoDeathSound = reader.ReadInt();
            }

            if( version > 30 )
                this.Frozen = reader.ReadBool();

            if( version > 27 )
            {
                m_VanishTime = reader.ReadDateTime();
                m_VanishEmote = reader.ReadString();
            }

            m_CreatureGroup = (CreatureGroup)reader.ReadInt();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_IsSneaky = test > 0;
            }

            else
                m_IsSneaky = reader.ReadBool();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_TakesLifeOnKill = test > 0;
            }

            else
                m_TakesLifeOnKill = reader.ReadBool();

            m_Description = reader.ReadString();

            m_Intimidated = reader.ReadInt();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_IsHuntingHound = test > 0;
            }

            else
                m_IsHuntingHound = reader.ReadBool();

            m_XPScale = reader.ReadInt();

            m_StatScale = reader.ReadInt();

            m_SkillScale = reader.ReadInt();

            m_Level = reader.ReadInt();

            m_XP = reader.ReadInt();

            m_NextLevel = reader.ReadInt();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_Warned = test > 0;
            }

            else
                m_Warned = reader.ReadBool();

            m_WarningTime = reader.ReadDateTime();

            m_BribingTime = reader.ReadDateTime();

            m_EmployerFeatLevel = reader.ReadInt();

            m_TargetsName = reader.ReadString();

            m_Employer = reader.ReadMobile();

            m_HiringTime = reader.ReadDateTime();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_Bribed = test > 0;
            }

            else
                m_Bribed = reader.ReadBool();

            m_LastSeen = reader.ReadDateTime();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_CanBeInformant = test > 0;
            }

            else
                m_CanBeInformant = reader.ReadBool();

            m_CurrentAI = (AIType)reader.ReadInt();
            m_DefaultAI = (AIType)reader.ReadInt();

            m_iRangePerception = reader.ReadInt();
            m_iRangeFight = reader.ReadInt();

            m_iTeam = reader.ReadInt();

            m_dActiveSpeed = reader.ReadDouble();
            m_dPassiveSpeed = reader.ReadDouble();
            m_dCurrentSpeed = reader.ReadDouble();

            if ( m_iRangePerception == OldRangePerception )
                m_iRangePerception = DefaultRangePerception;

            m_pHome.X = reader.ReadInt();
            m_pHome.Y = reader.ReadInt();
            m_pHome.Z = reader.ReadInt();

            if ( version >= 1 )
            {
                m_iRangeHome = reader.ReadInt();

                int i, iCount;

                iCount = reader.ReadInt();
                for ( i=0; i< iCount; i++ )
                {
                    string str = reader.ReadString();
                    Type type = Type.GetType( str );

                    if ( type != null )
                    {
                        m_arSpellAttack.Add( type );
                    }
                }

                iCount = reader.ReadInt();
                for ( i=0; i< iCount; i++ )
                {
                    string str = reader.ReadString();
                    Type type = Type.GetType( str );

                    if ( type != null )
                    {
                        m_arSpellDefense.Add( type );
                    }
                }
            }
            else
            {
                m_iRangeHome = 0;
            }

            if ( version >= 2 )
            {
                m_FightMode = ( FightMode )reader.ReadInt();

                m_bControlled = reader.ReadBool();
                m_ControlMaster = reader.ReadMobile();
                m_ControlTarget = reader.ReadMobile();
                m_ControlDest = reader.ReadPoint3D();
                m_ControlOrder = (OrderType) reader.ReadInt();

                m_dMinTameSkill = reader.ReadDouble();

                if ( version < 9 )
                    reader.ReadDouble();

                m_bTamable = reader.ReadBool();
                m_bSummoned = reader.ReadBool();

                if ( m_bSummoned )
                {
                    m_SummonEnd = reader.ReadDeltaTime();
                    new UnsummonTimer( m_ControlMaster, this, m_SummonEnd - DateTime.Now ).Start();
                }

                m_iControlSlots = reader.ReadInt();
            }
            else
            {
                m_FightMode = FightMode.Closest;

                m_bControlled = false;
                m_ControlMaster = null;
                m_ControlTarget = null;
                m_ControlOrder = OrderType.None;
            }

            if ( version >= 3 )
                m_Loyalty = reader.ReadInt();
            else
                m_Loyalty = MaxLoyalty; // Wonderfully Happy

            if ( version >= 4 )
                m_CurrentWayPoint = reader.ReadItem() as WayPoint;

            if ( version >= 5 )
                m_SummonMaster = reader.ReadMobile();

            if ( version >= 6 )
            {
                //m_HitsMax = reader.ReadInt();
                //m_StamMax = reader.ReadInt();
                //m_ManaMax = reader.ReadInt();
                m_DamageMin = reader.ReadInt();
                m_DamageMax = reader.ReadInt();
            }

            if ( version >= 7 )
            {
                m_PhysicalResistance = reader.ReadInt();
                m_PhysicalDamage = reader.ReadInt();

                m_FireResistance = reader.ReadInt();
                m_FireDamage = reader.ReadInt();

                m_ColdResistance = reader.ReadInt();
                m_ColdDamage = reader.ReadInt();

                m_PoisonResistance = reader.ReadInt();
                m_PoisonDamage = reader.ReadInt();

                m_EnergyResistance = reader.ReadInt();
                m_EnergyDamage = reader.ReadInt();
            }

            if ( version >= 8 )
                m_Owners = reader.ReadStrongMobileList();
            else
                m_Owners = new List<Mobile>();

            if ( version >= 10 )
            {
                m_IsDeadPet = reader.ReadBool();
                m_IsBonded = reader.ReadBool();
                m_BondingBegin = reader.ReadDateTime();
                m_OwnerAbandonTime = reader.ReadDateTime();
            }

            if ( version >= 11 )
                m_HasGeneratedLoot = reader.ReadBool();
            else
                m_HasGeneratedLoot = true;

            if ( version >= 12 )
                m_Paragon = reader.ReadBool();
            else
                m_Paragon = false;

            if ( version >= 13 && reader.ReadBool() )
                m_Friends = reader.ReadStrongMobileList();
            else if ( version < 13 && m_ControlOrder >= OrderType.Unfriend )
                ++m_ControlOrder;

            if ( version < 16 )
                Loyalty *= 10;

            double activeSpeed = m_dActiveSpeed;
            double passiveSpeed = m_dPassiveSpeed;

            SpeedInfo.GetSpeeds( this, ref activeSpeed, ref passiveSpeed );

            bool isStandardActive = false;
            for ( int i = 0; !isStandardActive && i < m_StandardActiveSpeeds.Length; ++i )
                isStandardActive = ( m_dActiveSpeed == m_StandardActiveSpeeds[i] );

            bool isStandardPassive = false;
            for ( int i = 0; !isStandardPassive && i < m_StandardPassiveSpeeds.Length; ++i )
                isStandardPassive = ( m_dPassiveSpeed == m_StandardPassiveSpeeds[i] );

            if ( isStandardActive && m_dCurrentSpeed == m_dActiveSpeed )
                m_dCurrentSpeed = activeSpeed;
            else if ( isStandardPassive && m_dCurrentSpeed == m_dPassiveSpeed )
                m_dCurrentSpeed = passiveSpeed;

            if ( isStandardActive && !m_Paragon )
                m_dActiveSpeed = activeSpeed;

            if ( isStandardPassive && !m_Paragon )
                m_dPassiveSpeed = passiveSpeed;

            if ( version >= 14 )
            {
                m_RemoveIfUntamed = reader.ReadBool();
                m_RemoveStep = reader.ReadInt();
            }

            if( version <= 14 && m_Paragon && Hue == 0x31 )
            {
                Hue = Paragon.Hue; //Paragon hue fixed, should now be 0x501.
            }

            m_BluntResistance = reader.ReadInt();
            m_BluntDamage = reader.ReadInt();
            m_SlashingResistance = reader.ReadInt();
            m_SlashingDamage = reader.ReadInt();
            m_PiercingResistance = reader.ReadInt();
            m_PiercingDamage = reader.ReadInt();

            CheckStatTimers();

            Timer.DelayCall( TimeSpan.FromSeconds( 5 ), new TimerCallback( WaitToChangeAI ) );

            AddFollowers();

            if ( IsAnimatedDead )
                Spells.Necromancy.AnimateDeadSpell.Register( m_SummonMaster, this );

            if( this.Level < 1 )
                this.Level = 1;

            if( this.Blessed && this.Alive )
                this.CanBeInformant = true;

            m_Intimidated = 0;

            if( !( this is Mercenary ) && version < 34 && this.Level > 1 )
            {
                int bonus = this.Level / 2;
                int rest = this.Level % 2;

                this.DamageMax += bonus + rest;
                this.DamageMin += bonus;
            }

            LevelSystem.FixStatsAndSkills( this );

            m_Deserialized = true;
        }
Example #29
0
        public void TryToRecharge( Mobile from, CustomGuildStone target )
        {
            if( from is PlayerMobile && target is CustomGuildStone )
            {
                PlayerMobile pm = from as PlayerMobile;
                CustomGuildStone guild = target as CustomGuildStone;

                if( Guild != null && pm.CustomGuilds.ContainsKey(Guild) )
                {
                    if( !CustomGuildStone.IsGuildOfficer(pm, guild) )
                        return;

                    if( !guild.OfficialGuild && (guild.Treasury == null || guild.Treasury.Deleted || !guild.Treasury.ConsumeTotal(typeof(Copper), 500)) )
                        pm.SendMessage( "Your guild's treasury is either unexistant or does not have 500 copper coins in it." );

                    else
                    {
                        Charges = 5;
                        ExpirationDate = DateTime.MinValue;
                        Name = "A standard of " + (String.IsNullOrEmpty(guild.Name) == true ? "an unnamed guild" : guild.Name) + " guild";
                        Guild = guild;

                        if( guild.ClothingHue >= 0 )
                            Hue = guild.ClothingHue;
                    }
                }
            }

            return;
        }