示例#1
0
            private void Initialize(CreatureSpawner owner, bool deactivateOnRemove, SpawnState initialState, ISpawnable initialSpawned, Timer initialTimer)
            {
                m_Owner = owner;
                m_DeactivateOnRemove = deactivateOnRemove;

                m_State = initialState;

                m_Spawned = initialSpawned;
                m_Timer   = initialTimer;
            }
示例#2
0
            public static SpawnInstance Instantiate(CreatureSpawner owner, bool deactivateOnRemove)
            {
                if (m_Pool.Count > 0)
                {
                    SpawnInstance si = m_Pool.Pop();
                    si.Initialize(owner, deactivateOnRemove);
                    return(si);
                }

                return(new SpawnInstance(owner, deactivateOnRemove));
            }
示例#3
0
            public SpawnInstance(GenericReader reader, CreatureSpawner owner)
            {
                m_Owner = owner;

                m_State = (SpawnState)reader.ReadInt();
                m_DeactivateOnRemove = reader.ReadBool();

                switch (m_State)
                {
                // TODO: It seems a good place to use the State pattern...

                case SpawnState.Inactive:
                    break;

                case SpawnState.Active:
                    m_Spawned = World.FindEntity(reader.ReadInt()) as ISpawnable;

                    if (m_Spawned != null)
                    {
                        m_Spawned.Spawner = this;
                    }
                    else
                    {
                        m_State = SpawnState.Inactive;
                    }

                    break;

                case SpawnState.Respawning:
                    m_NextSpawn = reader.ReadDateTime();

                    TimeSpan delay = m_NextSpawn - DateTime.UtcNow;

                    if (delay.TotalMilliseconds < 0)
                    {
                        delay = TimeSpan.Zero;
                    }

                    m_Timer = Timer.DelayCall(delay, Respawn);
                    break;
                }
            }
示例#4
0
 private void Initialize(CreatureSpawner owner, bool deactivateOnRemove)
 {
     Initialize(owner, deactivateOnRemove, SpawnState.Inactive, null, null);
 }
示例#5
0
 private SpawnInstance(CreatureSpawner owner, bool deactivateOnRemove)
 {
     Initialize(owner, deactivateOnRemove);
 }
示例#6
0
            public CreatureSpawner CreateSpawner()
            {
                CreatureSpawner spawner = new CreatureSpawner( m_Creature, m_Amount, (int) m_MinDelay.TotalSeconds, (int) m_MaxDelay.TotalSeconds, 20, 10 );

                spawner.Murderer = true;
                spawner.MoveToWorld( this.Location, this.Map );

                return spawner;
            }
示例#7
0
        private static void GenQuest_Command( CommandEventArgs e )
        {
            e.Mobile.SendMessage( "Creating Humility Cloak Quest..." );

            // var declarations
            CreatureSpawner spawner;

            // Gareth
            spawner = new CreatureSpawner( "Gareth", 1, 300, 600, 5, 1 );
            spawner.MoveToWorld( new Point3D( 2024, 2838, 20 ), Map.Trammel );
            spawner.Active = true;

            // Maribel
            spawner = new CreatureSpawner( "Maribel", 1, 300, 600, 5, 1 );
            spawner.MoveToWorld( new Point3D( 1460, 1657, 10 ), Map.Trammel );
            spawner.Active = true;

            // Deirdre
            spawner = new CreatureSpawner( "Deirdre", 1, 300, 600, 5, 1 );
            spawner.MoveToWorld( new Point3D( 1460, 1657, 10 ), Map.Felucca );
            spawner.Active = true;

            // Jason
            spawner = new CreatureSpawner( "Jason", 1, 300, 600, 5, 1 );
            spawner.MoveToWorld( new Point3D( 607, 2170, 0 ), Map.Trammel );
            spawner.Active = true;

            // Walton
            spawner = new CreatureSpawner( "Walton", 1, 300, 600, 5, 1 );
            spawner.MoveToWorld( new Point3D( 607, 2170, 0 ), Map.Felucca );
            spawner.Active = true;

            // Nelson
            spawner = new CreatureSpawner( "Nelson", 1, 300, 600, 5, 1 );
            spawner.MoveToWorld( new Point3D( 3442, 2637, 28 ), Map.Trammel );
            spawner.Active = true;

            // Kevin
            spawner = new CreatureSpawner( "Kevin", 1, 300, 600, 5, 1 );
            spawner.MoveToWorld( new Point3D( 2468, 474, 15 ), Map.Trammel );
            spawner.Active = true;

            // Sean
            spawner = new CreatureSpawner( "Sean", 1, 300, 600, 5, 1 );
            spawner.MoveToWorld( new Point3D( 2468, 474, 15 ), Map.Felucca );
            spawner.Active = true;

            // Triggers!
            HumilityCloakTrigger trigger;

            trigger = new HumilityCloakTrigger();
            trigger.MoveToWorld( new Point3D( 4273, 3697, 0 ), Map.Trammel );
            trigger = new HumilityCloakTrigger();
            trigger.MoveToWorld( new Point3D( 4274, 3697, 0 ), Map.Trammel );
            trigger = new HumilityCloakTrigger();
            trigger.MoveToWorld( new Point3D( 4273, 3696, 0 ), Map.Trammel );
            trigger = new HumilityCloakTrigger();
            trigger.MoveToWorld( new Point3D( 4274, 3696, 0 ), Map.Trammel );

            trigger = new HumilityCloakTrigger();
            trigger.MoveToWorld( new Point3D( 4273, 3697, 0 ), Map.Felucca );
            trigger = new HumilityCloakTrigger();
            trigger.MoveToWorld( new Point3D( 4274, 3697, 0 ), Map.Felucca );
            trigger = new HumilityCloakTrigger();
            trigger.MoveToWorld( new Point3D( 4273, 3696, 0 ), Map.Felucca );
            trigger = new HumilityCloakTrigger();
            trigger.MoveToWorld( new Point3D( 4274, 3696, 0 ), Map.Felucca );

            // Ilshenar WON'T work! :)

            e.Mobile.SendMessage( "Generation completed!" );
        }
示例#8
0
        private static void GenQuest_Command( CommandEventArgs e )
        {
            e.Mobile.SendMessage( "Creating KR Starting Quest..." );

            // var declarations
            KRStartingQuestTrigger trigger;
            KRStartingQuestContainer container;
            KRStartingQuestGate gate;
            KRWaypointRemover remover;
            KRStartingQuestTeleporter teleporter;
            CreatureSpawner spawner;

            trigger = new KRStartingQuestTrigger( 3 );
            trigger.MoveToWorld( new Point3D( 3646, 2674, -1 ), Map.Trammel );
            trigger = new KRStartingQuestTrigger( 3 );
            trigger.MoveToWorld( new Point3D( 3647, 2674, -2 ), Map.Trammel );
            trigger = new KRStartingQuestTrigger( 3 );
            trigger.MoveToWorld( new Point3D( 3648, 2674, -2 ), Map.Trammel );
            trigger = new KRStartingQuestTrigger( 3 );
            trigger.MoveToWorld( new Point3D( 3649, 2674, -2 ), Map.Trammel );

            trigger = new KRStartingQuestTrigger( 4 );
            trigger.MoveToWorld( new Point3D( 3647, 2666, -3 ), Map.Trammel );
            trigger = new KRStartingQuestTrigger( 4 );
            trigger.MoveToWorld( new Point3D( 3648, 2666, -3 ), Map.Trammel );
            trigger = new KRStartingQuestTrigger( 4 );
            trigger.MoveToWorld( new Point3D( 3649, 2666, -2 ), Map.Trammel );

            trigger = new KRStartingQuestTrigger( 5 );
            trigger.MoveToWorld( new Point3D( 3646, 2656, -2 ), Map.Trammel );
            trigger = new KRStartingQuestTrigger( 5 );
            trigger.MoveToWorld( new Point3D( 3647, 2656, -4 ), Map.Trammel );
            trigger = new KRStartingQuestTrigger( 5 );
            trigger.MoveToWorld( new Point3D( 3648, 2656, -3 ), Map.Trammel );

            for ( int i = 0; i < 12; i++ )
            {
                trigger = new KRStartingQuestTrigger( 5 );
                trigger.MoveToWorld( new Point3D( 3649 + i, 2656, -2 ), Map.Trammel );
            }

            container = new KRStartingQuestContainer( 0x9A9 );
            container.MoveToWorld( new Point3D( 3646, 2652, -3 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3E );
            container.MoveToWorld( new Point3D( 3649, 2650, 2 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3650, 2650, 2 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3651, 2650, 2 ), Map.Trammel );

            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3643, 2649, 0 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3644, 2648, 3 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3645, 2647, 2 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3645, 2648, -1 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3648, 2644, 0 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3650, 2642, 2 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3648, 2642, 0 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3648, 2641, 2 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3652, 2642, 3 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3653, 2642, 6 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3653, 2643, 0 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3657, 2641, 3 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3657, 2642, 0 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3657, 2643, 0 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3659, 2644, 7 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3660, 2644, 8 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3659, 2645, 7 ), Map.Trammel );
            container = new KRStartingQuestContainer( 0xE3D );
            container.MoveToWorld( new Point3D( 3660, 2645, 7 ), Map.Trammel );

            for ( int i = 0; i < 6; i++ )
            {
                trigger = new KRStartingQuestTrigger( 9 );
                trigger.MoveToWorld( new Point3D( 3672, 2654 - i, 0 ), Map.Trammel );
            }

            spawner = new CreatureSpawner( "HogarthTheKeeperOfOldHaven", 1, 300, 600, 0, 0 );
            spawner.MoveToWorld( new Point3D( 3672, 2653, 0 ), Map.Trammel );
            spawner.Active = true;

            Static sta;

            sta = new Static( 0xB8D );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3668, 2647, 0 ), Map.Trammel );
            sta = new Static( 0xB8C );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3668, 2648, 0 ), Map.Trammel );
            sta = new Static( 0xB8D );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3669, 2647, 0 ), Map.Trammel );
            sta = new Static( 0xB8D );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3669, 2648, 0 ), Map.Trammel );
            sta = new Static( 0xB8A );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3670, 2647, 0 ), Map.Trammel );
            sta = new Static( 0xB8B );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3670, 2648, 0 ), Map.Trammel );

            sta = new Static( 0xB8D );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3673, 2652, 0 ), Map.Trammel );
            sta = new Static( 0xB8C );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3673, 2653, 0 ), Map.Trammel );
            sta = new Static( 0xB8D );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3674, 2652, 0 ), Map.Trammel );
            sta = new Static( 0xB8D );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3674, 2653, 0 ), Map.Trammel );
            sta = new Static( 0xB8D );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3675, 2652, 0 ), Map.Trammel );
            sta = new Static( 0xB8D );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3675, 2653, 0 ), Map.Trammel );
            sta = new Static( 0xB8D );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3676, 2652, 0 ), Map.Trammel );
            sta = new Static( 0xB8D );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3676, 2653, 0 ), Map.Trammel );
            sta = new Static( 0xB8A );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3677, 2652, 0 ), Map.Trammel );
            sta = new Static( 0xB8B );
            sta.Movable = false;
            sta.MoveToWorld( new Point3D( 3677, 2653, 0 ), Map.Trammel );

            remover = new KRWaypointRemover( 15 );
            remover.MoveToWorld( new Point3D( 3665, 2631, 0 ), Map.Trammel );
            remover = new KRWaypointRemover( 15 );
            remover.MoveToWorld( new Point3D( 3665, 2630, 0 ), Map.Trammel );
            remover = new KRWaypointRemover( 15 );
            remover.MoveToWorld( new Point3D( 3665, 2629, 0 ), Map.Trammel );
            remover = new KRWaypointRemover( 15 );
            remover.MoveToWorld( new Point3D( 3665, 2628, 0 ), Map.Trammel );

            gate = new KRStartingQuestGate( 16, new Point3D( 3663, 2629, 0 ) );
            gate.ItemID = 0x830;
            gate.MoveToWorld( new Point3D( 3664, 2630, 0 ), Map.Trammel );
            gate = new KRStartingQuestGate( 16, new Point3D( 3663, 2629, 0 ) );
            gate.ItemID = 0x832;
            gate.MoveToWorld( new Point3D( 3664, 2629, 0 ), Map.Trammel );

            spawner = new CreatureSpawner( "WeakSkeleton", 10, 300, 600, 20, 10 );
            spawner.MoveToWorld( new Point3D( 3649, 2623, 0 ), Map.Trammel );
            spawner.Active = true;

            remover = new KRWaypointRemover( 23 );
            remover.MoveToWorld( new Point3D( 3653, 2604, 0 ), Map.Trammel );
            remover = new KRWaypointRemover( 23 );
            remover.MoveToWorld( new Point3D( 3654, 2604, 0 ), Map.Trammel );
            remover = new KRWaypointRemover( 23 );
            remover.MoveToWorld( new Point3D( 3655, 2604, 0 ), Map.Trammel );
            remover = new KRWaypointRemover( 23 );
            remover.MoveToWorld( new Point3D( 3656, 2604, 0 ), Map.Trammel );

            gate = new KRStartingQuestGate( 24, new Point3D( 3654, 2602, 0 ) );
            gate.ItemID = 0x82F;
            gate.MoveToWorld( new Point3D( 3654, 2603, 0 ), Map.Trammel );
            gate = new KRStartingQuestGate( 24, new Point3D( 3654, 2602, 0 ) );
            gate.ItemID = 0x833;
            gate.MoveToWorld( new Point3D( 3655, 2603, 0 ), Map.Trammel );

            spawner = new CreatureSpawner( "Zombie", 20, 300, 600, 20, 10 );
            spawner.MoveToWorld( new Point3D( 3648, 2589, 0 ), Map.Trammel );
            spawner.Active = true;

            remover = new KRWaypointRemover( 25 );
            remover.MoveToWorld( new Point3D( 3623, 2611, 0 ), Map.Trammel );
            remover = new KRWaypointRemover( 25 );
            remover.MoveToWorld( new Point3D( 3623, 2612, 0 ), Map.Trammel );

            spawner = new CreatureSpawner( "Healer", 1, 300, 600, 5, 1 );
            spawner.MoveToWorld( new Point3D( 3619, 2618, 0 ), Map.Trammel );
            spawner.Active = true;

            for ( int i = 0; i < 7; i++ )
            {
                remover = new KRWaypointRemover( 27 );
                remover.MoveToWorld( new Point3D( 3629 + i, 2578, 0 ), Map.Trammel );
            }

            teleporter = new KRStartingQuestTeleporter( 28, new Point3D( 3631, 2573, 0 ) );
            teleporter.AdvanceLevel = true;
            teleporter.MoveToWorld( new Point3D( 3631, 2577, 0 ), Map.Trammel );
            teleporter = new KRStartingQuestTeleporter( 28, new Point3D( 3631, 2573, 0 ) );
            teleporter.AdvanceLevel = true;
            teleporter.MoveToWorld( new Point3D( 3632, 2577, 0 ), Map.Trammel );

            DarkKnight dk = new DarkKnight();
            dk.MoveToWorld( new Point3D( 3631, 2568, 0 ), Map.Trammel );
            dk.Direction = Direction.South;

            Blocker b = new Blocker();
            b.MoveToWorld( new Point3D( 3631, 2576, 0 ), Map.Trammel );
            b = new Blocker();
            b.MoveToWorld( new Point3D( 3632, 2576, 0 ), Map.Trammel );

            Static st = new Static( 0x3946 );
            st.MoveToWorld( new Point3D( 3631, 2576, 0 ), Map.Trammel );
            st = new Static( 0x3946 );
            st.MoveToWorld( new Point3D( 3632, 2576, 0 ), Map.Trammel );

            st = new Static( 0x3946 );
            st.MoveToWorld( new Point3D( 3631, 2565, 0 ), Map.Trammel );
            st = new Static( 0x3946 );
            st.MoveToWorld( new Point3D( 3632, 2565, 0 ), Map.Trammel );

            trigger = new KRStartingQuestTrigger( 31 );
            trigger.MoveToWorld( new Point3D( 3540, 2570, -1 ), Map.Trammel );
            trigger = new KRStartingQuestTrigger( 31 );
            trigger.MoveToWorld( new Point3D( 3540, 2569, 0 ), Map.Trammel );
            trigger = new KRStartingQuestTrigger( 31 );
            trigger.MoveToWorld( new Point3D( 3540, 2568, 0 ), Map.Trammel );
            trigger = new KRStartingQuestTrigger( 31 );
            trigger.MoveToWorld( new Point3D( 3540, 2567, 0 ), Map.Trammel );

            teleporter = new KRStartingQuestTeleporter( 31, new Point3D( 3631, 2561, 0 ) );
            teleporter.MoveToWorld( new Point3D( 3631, 2566, 0 ), Map.Trammel );
            teleporter = new KRStartingQuestTeleporter( 31, new Point3D( 3631, 2561, 0 ) );
            teleporter.MoveToWorld( new Point3D( 3632, 2566, 0 ), Map.Trammel );

            e.Mobile.SendMessage( "Generation completed!" );
        }
示例#9
0
            private void Initialize( CreatureSpawner owner, bool deactivateOnRemove, SpawnState initialState, ISpawnable initialSpawned, Timer initialTimer )
            {
                m_Owner = owner;
                m_DeactivateOnRemove = deactivateOnRemove;

                m_State = initialState;

                m_Spawned = initialSpawned;
                m_Timer = initialTimer;
            }
示例#10
0
 private void Initialize( CreatureSpawner owner, bool deactivateOnRemove )
 {
     Initialize( owner, deactivateOnRemove, SpawnState.Inactive, null, null );
 }
示例#11
0
            public static SpawnInstance Instantiate( CreatureSpawner owner, bool deactivateOnRemove )
            {
                if ( m_Pool.Count > 0 )
                {
                    SpawnInstance si = m_Pool.Pop();
                    si.Initialize( owner, deactivateOnRemove );
                    return si;
                }

                return new SpawnInstance( owner, deactivateOnRemove );
            }
示例#12
0
 private SpawnInstance( CreatureSpawner owner, bool deactivateOnRemove )
 {
     Initialize( owner, deactivateOnRemove );
 }
示例#13
0
            public SpawnInstance( GenericReader reader, CreatureSpawner owner )
            {
                m_Owner = owner;

                m_State = (SpawnState) reader.ReadInt();
                m_DeactivateOnRemove = reader.ReadBool();

                switch ( m_State )
                {
                    // TODO: It seems a good place to use the State pattern...

                    case SpawnState.Inactive:
                        break;

                    case SpawnState.Active:
                        m_Spawned = World.Instance.FindEntity( reader.ReadInt() ) as ISpawnable;

                        if ( m_Spawned != null )
                            m_Spawned.Spawner = this;
                        else
                            m_State = SpawnState.Inactive;

                        break;

                    case SpawnState.Respawning:
                        m_NextSpawn = reader.ReadDateTime();

                        TimeSpan delay = m_NextSpawn - DateTime.Now;

                        if ( delay.TotalMilliseconds < 0 )
                            delay = TimeSpan.Zero;

                        m_Timer = Timer.DelayCall( delay, Respawn );
                        break;
                }
            }