예제 #1
0
		public void SetFlag( SkillBallFlags flag, bool value )
		{
			if ( value )
				m_Flags |= flag;
			else
				m_Flags &= ~flag;
		}
예제 #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadEncodedInt();

            switch (version)
            {
            case 1:
            {
                m_Flags      = (SkillBallFlags)reader.ReadEncodedInt();
                m_ExpireDate = reader.ReadDateTime();
                goto case 0;
            }

            case 0:
            {
                m_SkillBonus = reader.ReadInt();
                break;
            }
            }

            //We save it just in case, then delete it afterwards
            if (Expires && DateTime.UtcNow >= m_ExpireDate)
            {
                AddToCleanup(this);
            }
        }
예제 #3
0
 public void SetFlag(SkillBallFlags flag, bool value)
 {
     if (value)
     {
         m_Flags |= flag;
     }
     else
     {
         m_Flags &= ~flag;
     }
 }
예제 #4
0
 public bool GetFlag(SkillBallFlags flag)
 {
     return((m_Flags & flag) != 0);
 }
예제 #5
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadEncodedInt();

			switch ( version )
			{
				case 1:
				{
					m_Flags = (SkillBallFlags)reader.ReadEncodedInt();
					m_ExpireDate = reader.ReadDateTime();
					goto case 0;
				}
				case 0:
				{
					m_SkillBonus = reader.ReadInt();
					break;
				}
			}

			//We save it just in case, then delete it afterwards
			if ( Expires && DateTime.UtcNow >= m_ExpireDate )
				AddToCleanup( this );
		}
예제 #6
0
		public bool GetFlag( SkillBallFlags flag )
		{
			return ( m_Flags & flag ) != 0;
		}
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
            /*
            if ( version == 0 ) //Donation Item
            {
                if ( reader.ReadBool() ) //Yes donation?
                    ItemConversion.AddToDonationConversion( this );
                version = reader.ReadInt(); //SkillBall
            }
            */
            if ( version > 3 )
            {
                switch ( version )
                {
                    case 4:
                    {
                        m_Flags = (SkillBallFlags)reader.ReadEncodedInt();

                        if ( AltMinCap )
                            m_MinCap = reader.ReadInt();
                        else m_MinCap = 120;

                        if ( AltMaxCap )
                            m_MaxCap = reader.ReadInt();
                        else m_MaxCap = 100;

                        if ( PlayerBound )
                            m_OwnerPlayer = reader.ReadMobile();

                        if ( AccountBound )
                            m_OwnerAccount = reader.ReadString();

                        m_ExpireDate = reader.ReadDateTime();
                        m_SkillBonus = reader.ReadInt();
                        break;
                    }
                }

                //We save it just in case, then delete it afterwards
                if ( Expires && DateTime.Now > m_ExpireDate )
                    AddToCleanup( this );
            }
            else //Conversion Code
            {
                m_OwnerAccount = reader.ReadString();
                m_OwnerPlayer = reader.ReadMobile();

                SetFlag( SkillBallFlags.Limited,	!reader.ReadBool() );

                m_SkillBonus = reader.ReadInt();
                MaxCap = reader.ReadInt();
            }
        }