Exemple #1
0
        public static MiniChampInfo GetInfo(MiniChampType type)
        {
            int v = (int)type;

            if (v < 0 || v >= m_Table.Length)
            {
                v = 0;
            }

            return(m_Table[v]);
        }
Exemple #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_BossSpawnPoint = reader.ReadPoint3D();
                goto case 0;
            }

            case 0:
            {
                m_Spawn = new List <MiniChampSpawnInfo>();

                m_Active       = reader.ReadBool();
                m_Type         = (MiniChampType)reader.ReadInt();
                m_Level        = reader.ReadInt();
                m_SpawnRange   = reader.ReadInt();
                m_RestartDelay = reader.ReadTimeSpan();

                int spawnCount = reader.ReadInt();
                for (int i = 0; i < spawnCount; i++)
                {
                    m_Spawn.Add(new MiniChampSpawnInfo(reader));
                }

                if (m_Active)
                {
                    m_Timer = new SliceTimer(this);
                    m_Timer.Start();
                }
                else
                {
                    m_RestartTimer = Timer.DelayCall(m_RestartDelay, new TimerCallback(Start));
                }

                break;
            }
            }
        }
Exemple #3
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                Spawn = new List <MiniChampSpawnInfo>();

                BossSpawnPoint = reader.ReadPoint3D();
                m_Active       = reader.ReadBool();
                m_Type         = (MiniChampType)reader.ReadInt();
                m_Level        = reader.ReadInt();
                m_SpawnRange   = reader.ReadInt();
                m_RestartDelay = reader.ReadTimeSpan();

                int spawnCount = reader.ReadInt();

                for (int i = 0; i < spawnCount; i++)
                {
                    Spawn.Add(new MiniChampSpawnInfo(reader));
                }

                Despawns = reader.ReadStrongMobileList();

                if (m_Active)
                {
                    StartTimer();
                }
                else
                {
                    StartRestartTimer();
                }

                break;
            }
            }

            Controllers.Add(this);
        }
Exemple #4
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            if ( version >= 16 && version <= 18 )
                reader.ReadItem(); // spawner

            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();

            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_dActiveSpeed = activeSpeed;
            }

            if ( isStandardPassive )
            {
                m_dPassiveSpeed = passiveSpeed;
            }

            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();

                if ( version < 25 )
                {
                    int i, iCount;

                    iCount = reader.ReadInt();
                    for ( i = 0; i < iCount; i++ )
                        reader.ReadString();

                    iCount = reader.ReadInt();
                    for ( i = 0; i < iCount; i++ )
                        reader.ReadString();
                }
            }
            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 = (PetLoyalty) reader.ReadInt();
            else
                m_Loyalty = PetLoyalty.WonderfullyHappy;

            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();
                m_IsChampionMonster = reader.ReadBool();
            }
            else
            {
                m_Paragon = false;
                m_IsChampionMonster = false;
            }

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

            if ( version >= 14 )
                m_SpawnLevel = reader.ReadInt();
            else
                m_SpawnLevel = 0;

            if ( version >= 15 )
                m_ChampionType = (ChampionSpawnType) reader.ReadInt();

            if ( version >= 17 )
                m_StolenFrom = reader.ReadBool();

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

                for ( int i = 0; i < count; i++ )
                {
                    Item rummaged = reader.ReadItem();
                    Mobile owner = reader.ReadMobile();

                    if ( rummaged != null && owner != null )
                        m_RummagedItems.Add( rummaged, owner );
                }
            }

            if ( version >= 20 )
            {
                m_IsMinichampMonster = reader.ReadBool();
                m_MinichampType = (MiniChampType) reader.ReadInt();
            }

            if ( version >= 21 )
            {
                m_NextTastyTreat = reader.ReadDateTime();
            }

            if ( version >= 22 )
            {
                m_Petrified = reader.ReadBool();

                if ( m_Petrified )
                {
                    m_StatueAnimation = reader.ReadInt();
                    m_StatueFrames = reader.ReadInt();

                    Frozen = true;
                    HueMod = 2401;
                }
            }

            if ( version >= 23 )
            {
                m_NextArmorEssence = reader.ReadDateTime();
            }

            if ( version >= 24 )
            {
                m_IsGolem = reader.ReadBool();
            }
            else
            {
                m_IsGolem = this is Golem;
            }

            CheckStatTimers();

            ChangeAIType( m_CurrentAI );

            AddFollowers();

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

            if ( Controlled )
                Skills.Cap = 15000;
        }
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 1:
                    {
                        m_BossSpawnPoint = reader.ReadPoint3D();
                        goto case 0;
                    }
                case 0:
                    {
                        m_Spawn = new List<MiniChampSpawnInfo>();

                        m_Active = reader.ReadBool();
                        m_Type = (MiniChampType) reader.ReadInt();
                        m_Level = reader.ReadInt();
                        m_SpawnRange = reader.ReadInt();
                        m_RestartDelay = reader.ReadTimeSpan();

                        int spawnCount = reader.ReadInt();
                        for ( int i = 0; i < spawnCount; i++ )
                            m_Spawn.Add( new MiniChampSpawnInfo( reader ) );

                        if ( m_Active )
                        {
                            m_Timer = new SliceTimer( this );
                            m_Timer.Start();
                        }
                        else
                        {
                            m_RestartTimer = Timer.DelayCall( m_RestartDelay, new TimerCallback( Start ) );
                        }

                        break;
                    }
            }
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            m_DamageEntries = new Dictionary<Mobile, int>();

            int version = reader.ReadInt();

            switch (version)
            {
                case 7:
                    {
                        this.m_ExpireDelay = reader.ReadTimeSpan();
                        this.m_ExpireTime = reader.ReadDeltaTime();

                        goto case 6;
                    }
                case 6:
                    {
                        this.m_Champion2 = reader.ReadMobile();

                        goto case 5;
                    }
                case 5:
                    {
                        int entries = reader.ReadInt();
                        Mobile m;
                        int damage;
                        for (int i = 0; i < entries; ++i)
                        {
                            m = reader.ReadMobile();
                            damage = reader.ReadInt();

                            if (m == null)
                                continue;

                            this.m_DamageEntries.Add(m, damage);
                        }

                        goto case 4;
                    }
                case 4:
                    {
                        this.m_ConfinedRoaming = reader.ReadBool();
                        this.m_HasBeenAdvanced = reader.ReadBool();

                        goto case 3;
                    }
                case 3:
                    {
                        this.m_SpawnArea = reader.ReadRect2D();

                        goto case 2;
                    }
                case 2:
                    {
                        this.m_RandomizeType = reader.ReadBool();

                        goto case 1;
                    }
                case 1:
                    {
                        this.m_Kills = reader.ReadInt();
                        Spwnd = reader.ReadInt();

                        goto case 0;
                    }
                case 0:
                    {
                        bool active = reader.ReadBool();
                        this.m_Type = (MiniChampType)reader.ReadInt();
                        this.m_Creatures = reader.ReadStrongMobileList();
                        this.m_Champion = reader.ReadMobile();
                        this.m_RestartDelay = reader.ReadTimeSpan();

                        if (reader.ReadBool())
                        {
                            this.m_RestartTime = reader.ReadDeltaTime();
                            BeginRestart(this.m_RestartTime - DateTime.Now);
                        }

                        if (active)
                            this.Start();

                        break;
                    }
            }

            Timer.DelayCall(TimeSpan.Zero, new TimerCallback(UpdateRegion));
        }
Exemple #7
0
        public static MiniChampInfo GetInfo( MiniChampType type )
        {
            int v = (int) type;

            if ( v < 0 || v >= m_Table.Length )
                v = 0;

            return m_Table[v];
        }
Exemple #8
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            m_DamageEntries = new Dictionary <Mobile, int>();

            int version = reader.ReadInt();

            switch (version)
            {
            case 7:
            {
                this.m_ExpireDelay = reader.ReadTimeSpan();
                this.m_ExpireTime  = reader.ReadDeltaTime();

                goto case 6;
            }

            case 6:
            {
                this.m_Champion2 = reader.ReadMobile();

                goto case 5;
            }

            case 5:
            {
                int    entries = reader.ReadInt();
                Mobile m;
                int    damage;
                for (int i = 0; i < entries; ++i)
                {
                    m      = reader.ReadMobile();
                    damage = reader.ReadInt();

                    if (m == null)
                    {
                        continue;
                    }

                    this.m_DamageEntries.Add(m, damage);
                }

                goto case 4;
            }

            case 4:
            {
                this.m_ConfinedRoaming = reader.ReadBool();
                this.m_HasBeenAdvanced = reader.ReadBool();

                goto case 3;
            }

            case 3:
            {
                this.m_SpawnArea = reader.ReadRect2D();

                goto case 2;
            }

            case 2:
            {
                this.m_RandomizeType = reader.ReadBool();

                goto case 1;
            }

            case 1:
            {
                this.m_Kills = reader.ReadInt();
                Spwnd        = reader.ReadInt();

                goto case 0;
            }

            case 0:
            {
                bool active = reader.ReadBool();
                this.m_Type         = (MiniChampType)reader.ReadInt();
                this.m_Creatures    = reader.ReadStrongMobileList();
                this.m_Champion     = reader.ReadMobile();
                this.m_RestartDelay = reader.ReadTimeSpan();

                if (reader.ReadBool())
                {
                    this.m_RestartTime = reader.ReadDeltaTime();
                    BeginRestart(this.m_RestartTime - DateTime.Now);
                }

                if (active)
                {
                    this.Start();
                }

                break;
            }
            }

            Timer.DelayCall(TimeSpan.Zero, new TimerCallback(UpdateRegion));
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            m_DamageEntries = new Dictionary <Mobile, int>();

            int version = reader.ReadInt();

            switch (version)
            {
            case 5:
            {
                int    entries = reader.ReadInt();
                Mobile m;
                int    damage;
                for (int i = 0; i < entries; ++i)
                {
                    m      = reader.ReadMobile();
                    damage = reader.ReadInt();

                    if (m == null)
                    {
                        continue;
                    }

                    m_DamageEntries.Add(m, damage);
                }

                goto case 4;
            }

            case 4:
            {
                m_ConfinedRoaming = reader.ReadBool();
                m_HasBeenAdvanced = reader.ReadBool();

                goto case 3;
            }

            case 3:
            {
                m_SpawnArea = reader.ReadRect2D();

                goto case 2;
            }

            case 2:
            {
                m_RandomizeType = reader.ReadBool();

                goto case 1;
            }

            case 1:
            {
                if (version < 3)
                {
                    int oldRange = reader.ReadInt();

                    m_SpawnArea = new Rectangle2D(new Point2D(X - oldRange, Y - oldRange), new Point2D(X + oldRange, Y + oldRange));
                }

                m_Kills = reader.ReadInt();

                goto case 0;
            }

            case 0:
            {
                if (version < 1)
                {
                    m_SpawnArea = new Rectangle2D(new Point2D(X - 18, Y - 18), new Point2D(X + 18, Y + 18));            //Default was 24
                }
                bool active = reader.ReadBool();
                m_Type         = (MiniChampType)reader.ReadInt();
                m_Creatures    = reader.ReadStrongMobileList();
                m_RedSkulls    = reader.ReadStrongItemList();
                m_WhiteSkulls  = reader.ReadStrongItemList();
                m_MiniPlatform = reader.ReadItem <MiniChampPlatform>();
                m_MiniAltar    = reader.ReadItem <MiniChampAltar>();
                m_ExpireDelay  = reader.ReadTimeSpan();
                m_ExpireTime   = reader.ReadDeltaTime();
                m_MiniChamp    = reader.ReadMobile();
                m_RestartDelay = reader.ReadTimeSpan();

                if (reader.ReadBool())
                {
                    m_RestartTime = reader.ReadDeltaTime();
                    BeginRestart(m_RestartTime - DateTime.Now);
                }

                if (m_MiniPlatform == null || m_MiniAltar == null)
                {
                    Delete();
                }
                else if (active)
                {
                    Start();
                }

                break;
            }
            }

            Timer.DelayCall(TimeSpan.Zero, new TimerCallback(UpdateRegion));
        }