예제 #1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int versao = reader.ReadInt();

            raca = reader.ReadRace();

            //recuperas as habilidades
            habilidades = new Dictionary<IdHabilidadeRacial, HabilidadeNode>();
            int numHabilidade = reader.ReadInt();
            for (int i = 0; i < numHabilidade; i++)
            {
                HabilidadeNode hn = new HabilidadeNode();
                hn.Deserialize(reader);

                habilidades.Add((IdHabilidadeRacial)hn.Id, hn);
            }
        }
예제 #2
0
파일: Mobile.cs 프로젝트: Ravenwolfe/xrunuo
        public virtual void Deserialize( GenericReader reader )
        {
            int version = reader.ReadInt();

            switch ( version )
            {
                case 36:
                case 35:
                case 34:
                    {
                        byte hairflag = reader.ReadByte();

                        if ( ( hairflag & 0x01 ) != 0 )
                            m_Hair = new HairInfo( reader );

                        if ( ( hairflag & 0x02 ) != 0 )
                            m_FacialHair = new FacialHairInfo( reader );

                        m_InstanceID = reader.ReadInt();

                        m_Race = reader.ReadRace();

                        if ( version < 36 )
                            reader.ReadDeltaTime();

                        m_TithingPoints = reader.ReadInt();

                        m_Corpse = reader.ReadItem() as Container;

                        m_CreationTime = reader.ReadDateTime();

                        m_Stabled = reader.ReadStrongMobileList();

                        m_CantWalk = reader.ReadBool();

                        m_Virtues = new VirtueInfo( reader );

                        m_Thirst = reader.ReadInt();
                        m_BAC = reader.ReadInt();

                        m_ShortTermMurders = reader.ReadInt();

                        if ( version < 35 )
                            reader.ReadInt();

                        m_MagicDamageAbsorb = reader.ReadInt();

                        m_GuildFealty = reader.ReadMobile();
                        m_Guild = reader.ReadGuild();
                        m_DisplayGuildTitle = reader.ReadBool();

                        m_CanSwim = reader.ReadBool();

                        m_Squelched = reader.ReadBool();

                        m_Holding = reader.ReadItem();

                        m_BaseSoundID = reader.ReadInt();

                        m_DisarmReady = reader.ReadBool();
                        m_StunReady = reader.ReadBool();

                        m_StatCap = reader.ReadInt();

                        m_NameHue = reader.ReadInt();

                        m_Hunger = reader.ReadInt();

                        m_Location = reader.ReadPoint3D();
                        m_Body = new Body( reader.ReadInt() );
                        m_Name = reader.ReadString();
                        if ( m_Name != null )
                            m_Name = string.Intern( m_Name );
                        m_GuildTitle = reader.ReadString();
                        m_Criminal = reader.ReadBool();
                        m_Kills = reader.ReadInt();
                        m_SpeechHue = reader.ReadInt();
                        m_EmoteHue = reader.ReadInt();
                        m_WhisperHue = reader.ReadInt();
                        m_YellHue = reader.ReadInt();
                        m_Language = reader.ReadString();
                        if ( m_Language != null )
                            m_Language = string.Intern( m_Language );
                        m_Female = reader.ReadBool();
                        m_Warmode = reader.ReadBool();
                        m_Hidden = reader.ReadBool();
                        m_Direction = (Direction) reader.ReadByte();
                        m_Hue = reader.ReadInt();
                        m_Str = reader.ReadInt();
                        m_Dex = reader.ReadInt();
                        m_Int = reader.ReadInt();
                        m_Hits = reader.ReadInt();
                        m_Stam = reader.ReadInt();
                        m_Mana = reader.ReadInt();
                        m_Map = reader.ReadMap();
                        m_Blessed = reader.ReadBool();
                        m_Fame = reader.ReadInt();
                        m_Karma = reader.ReadInt();
                        m_AccessLevel = (AccessLevel) reader.ReadByte();

                        m_Skills = new Skills( this, reader );

                        int itemCount = reader.ReadInt();

                        m_EquippedItems = new List<Item>( itemCount );

                        for ( int i = 0; i < itemCount; ++i )
                        {
                            Item item = reader.ReadItem();

                            if ( item != null )
                                m_EquippedItems.Add( item );
                        }

                        m_IsPlayer = reader.ReadBool();
                        m_Title = reader.ReadString();
                        if ( m_Title != null )
                            m_Title = string.Intern( m_Title );
                        m_Profile = reader.ReadString();
                        m_ProfileLocked = reader.ReadBool();

                        m_AutoPageNotify = reader.ReadBool();

                        m_LogoutLocation = reader.ReadPoint3D();
                        m_LogoutMap = reader.ReadMap();

                        m_StrLock = (StatLockType) reader.ReadByte();
                        m_DexLock = (StatLockType) reader.ReadByte();
                        m_IntLock = (StatLockType) reader.ReadByte();

                        m_StatMods = new List<StatMod>();

                        if ( reader.ReadBool() )
                        {
                            m_StuckMenuUses = new DateTime[reader.ReadInt()];

                            for ( int i = 0; i < m_StuckMenuUses.Length; ++i )
                            {
                                m_StuckMenuUses[i] = reader.ReadDateTime();
                            }
                        }
                        else
                        {
                            m_StuckMenuUses = null;
                        }

                        if ( m_IsPlayer && m_Map != Map.Internal )
                        {
                            m_LogoutLocation = m_Location;
                            m_LogoutMap = m_Map;

                            m_Map = Map.Internal;
                        }

                        if ( m_Map != null )
                            m_Map.OnEnter( this );

                        if ( m_Criminal )
                        {
                            if ( m_ExpireCriminal == null )
                                m_ExpireCriminal = new ExpireCriminalTimer( this );

                            m_ExpireCriminal.Start();
                        }

                        if ( ShouldCheckStatTimers )
                            CheckStatTimers();

                        UpdateRegion();

                        UpdateResistances();

                        break;
                    }
            }
        }