Пример #1
0
        public virtual void Activate()
        {
            Active = true;
            PoisonTimer timer = new PoisonTimer(this);

            timer.Start();
        }
Пример #2
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (m != null && m_Door != null && !m_Door.Locked && !m_Door.Open && m.Player && m.Alive && m_CanActive)
            {
                IPooledEnumerable eable = Map.Malas.GetMobilesInBounds(Rect);

                foreach (object obj in eable)
                {
                    if (obj is Mobile)
                    {
                        Mobile mobile = obj as Mobile;

                        if (mobile != null && !(mobile is DarkGuardian))
                        {
                            if (mobile.Player)
                            {
                                mobile.SendLocalizedMessage(1050000, null, 0x41);                                   // The locks on the door click loudly and you begin to hear a faint hissing near the walls.
                            }

                            for (int j = 0; j < 2; j++)
                            {
                                DarkGuardian guard = new DarkGuardian();

                                guard.Map = Map.Malas;

                                guard.Location = new Point3D(365, 15, -1);
                            }
                        }
                    }
                }

                eable.Free();

                m_Door.Locked      = true;
                m_Door.Link.Locked = true;

                if (m_Timer != null)
                {
                    m_Timer.Stop();
                }

                m_Timer = new PoisonTimer(this);

                m_Timer.Start();

                m_CanActive = false;
            }
        }
Пример #3
0
        public void CheckCode()
        {
            bool incomplete = false;

            int correct_souls = 0;

            for (int i = 0; i < m_Pads.Count; i++)
            {
                PuzzlePad pad = m_Pads[i] as PuzzlePad;

                if (pad == null || !pad.Busy)
                {
                    incomplete = true;
                }
            }

            correct_souls = CompareCodes(m_PuzzleCode, m_Code);

            if (incomplete)
            {
                SayStatues(1050004, -1);                   // The circle is the key, the key is incomplete and so the gate remains closed.
            }
            else
            {
                // we don't guess code
                if (correct_souls >= 0 && correct_souls < 4)
                {
                    ArrayList players = new ArrayList();

                    for (int i = 0; i < m_Pads.Count; i++)
                    {
                        PuzzlePad pad = m_Pads[i] as PuzzlePad;

                        if (pad != null && pad.Stander != null && pad.Stander.Alive)
                        {
                            players.Add(pad.Stander);
                        }
                    }

                    for (int j = 0; j < players.Count; j++)
                    {
                        PlayerMobile player = players[j] as PlayerMobile;

                        if (player != null)
                        {
                            Point3D location1 = player.Location;
                            location1.Z = 49;

                            Point3D location2 = player.Location;
                            location2.Z = -1;

                            Effects.SendPacket(player, player.Map, new HuedEffect(EffectType.Moving, Serial.Zero, player.Serial, 0x11B7, location1, location2, 20, 0, true, true, 0, 0));

                            Effects.PlaySound(new Point3D(324, 64, -1), Map.Malas, 0x144);

                            Effects.PlaySound(new Point3D(player.X, player.Y, -1), Map.Malas, Utility.RandomList(0x154, 0x14B));

                            player.Send(new AsciiMessage(Serial.MinusOne, 0xFFFF, MessageType.Label, 0x66D, 3, "", "You are pinned down by the weight of the boulder!!!"));
                        }
                    }

                    switch (correct_souls)
                    {
                    case 0:
                        SayStatues(1050009, correct_souls);
                        break;                                 // The circle of souls has failed to turn the key.  The gate remains closed...

                    case 1:
                        SayStatues(1050007, correct_souls);
                        break;                                 // ~1_NUM~ soul has turned the key correctly, but the rest have forsaken the circle...

                    default:
                        SayStatues(1050008, correct_souls);
                        break;                                 // ~1_NUM~ souls have turned the key correctly, but the rest have forsaken the circle...
                    }

                    for (int j = 0; j < players.Count; j++)
                    {
                        PlayerMobile player = players[j] as PlayerMobile;

                        if (player != null)
                        {
                            Effects.SendPacket(player, player.Map, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x36BD, new Point3D(player.X, player.Y, 0), new Point3D(player.X, player.Y, 0), 20, 10, true, false));

                            Effects.SendPacket(player, player.Map, new GraphicalEffect(EffectType.FixedFrom, player.Serial, Serial.Zero, 0x36BD, new Point3D(player.X, player.Y, -1), new Point3D(player.X, player.Y, -1), 20, 10, true, false));

                            Effects.PlaySound(new Point3D(player.X, player.Y, -1), player.Map, 0x307);

                            for (int k = 0; k < 5; k++)
                            {
                                Effects.SendPacket(player, player.Map, new GraphicalEffect(EffectType.Moving, Serial.Zero, Serial.Zero, 0x1363 + Utility.Random(0, 11), new Point3D(player.X, player.Y, 0), new Point3D(player.X, player.Y, 0), 5, 0, false, false));

                                Effects.PlaySound(new Point3D(player.X, player.Y, -1), Map.Malas, 0x13F);

                                Effects.PlaySound(new Point3D(player.X, player.Y, -1), Map.Malas, 0x154);

                                player.Say("OUCH!");
                            }

                            player.Damage(90, null);

                            player.Send(new AsciiMessage(Serial.MinusOne, 0xFFFF, MessageType.Label, 0x66D, 3, "", "A speeding rock hits you in the head!"));

                            player.SendLocalizedMessage(502382);                               // You can move!
                        }
                    }
                }
                else
                {
                    // we done it!
                    PlayerMobile center = ((PuzzlePad)m_Pads[4]).Stander;

                    for (int i = 0; i < m_Pads.Count; i++)
                    {
                        PuzzlePad pad = m_Pads[i] as PuzzlePad;

                        if (pad != null && pad.Stander != null && pad.Stander.Alive)
                        {
                            Effects.SendPacket(pad.Stander, Map.Malas, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x1153, new Point3D(325, 64, -1), new Point3D(325, 64, -1), 1, 60, true, false));
                            Effects.SendPacket(pad.Stander, Map.Malas, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x1153, new Point3D(325, 64, -1), new Point3D(325, 64, -1), 1, 60, true, false));

                            Effects.PlaySound(new Point3D(325, 64, -1), Map.Malas, 0x244);

                            if (center != null)
                            {
                                Effects.SendPacket(pad.Stander, Map.Malas, new GraphicalEffect(EffectType.Lightning, center.Serial, Serial.Zero, 0x0, new Point3D(324, 64, -1), new Point3D(324, 64, -1), 0, 0, false, false));
                                Effects.SendPacket(pad.Stander, Map.Malas, new ParticleEffect(EffectType.FixedFrom, center.Serial, Serial.Zero, 0x0, new Point3D(324, 64, -1), new Point3D(324, 64, -1), 0, 0, false, false, 0, 0, 0x13A7, 0, 0, center.Serial, 3, 0));
                            }
                        }
                    }

                    if (center != null)
                    {
                        center.MoveToWorld(new Point3D(467, 96, -1), Map.Malas);

                        if (m_Timer != null)
                        {
                            m_Timer.Stop();
                        }

                        m_Timer = new PoisonTimer(this);

                        m_Timer.Start();

                        m_CanActive = false;

                        m_Box.CanSummon = true;
                    }
                }
            }

            FreeLevers();
        }
 public virtual void Activate()
 {
     Active = true;
     PoisonTimer timer = new PoisonTimer(this);
     timer.Start();
 }
Пример #5
0
        public void CheckCode()
        {
            bool incomplete = false;

            int correct_souls = 0;

            for ( int i = 0; i < m_Pads.Count; i++ )
            {
                PuzzlePad pad = m_Pads[ i ] as PuzzlePad;

                if ( pad == null || !pad.Busy )
                {
                    incomplete = true;
                }
            }

            correct_souls = CompareCodes( m_PuzzleCode, m_Code );

            if ( incomplete )
            {
                SayStatues( 1050004, -1 ); // The circle is the key, the key is incomplete and so the gate remains closed.
            }
            else
            {
                // we don't guess code
                if ( correct_souls >= 0 && correct_souls < 4 )
                {
                    ArrayList players = new ArrayList();

                    for ( int i = 0; i < m_Pads.Count; i++ )
                    {
                        PuzzlePad pad = m_Pads[ i ] as PuzzlePad;

                        if ( pad != null && pad.Stander != null && pad.Stander.Alive )
                        {
                            players.Add( pad.Stander );
                        }
                    }

                    for ( int j = 0; j < players.Count; j++ )
                    {
                        PlayerMobile player = players[ j ] as PlayerMobile;

                        if ( player != null )
                        {
                            Point3D location1 = player.Location;
                            location1.Z = 49;

                            Point3D location2 = player.Location;
                            location2.Z = -1;

                            Effects.SendPacket( player, player.Map, new HuedEffect( EffectType.Moving, Serial.Zero, player.Serial, 0x11B7, location1, location2, 20, 0, true, true, 0, 0 ) );
                            Effects.PlaySound( new Point3D( 324, 64, -1 ), Map.Malas, 0x144 );
                            Effects.PlaySound( new Point3D( player.X, player.Y, -1 ), Map.Malas, Utility.RandomList( 0x154, 0x14B ) );
                            player.Send( new AsciiMessage( Serial.MinusOne, 0xFFFF, MessageType.Label, 0x66D, 3, "", "You are pinned down by the weight of the boulder!!!" ) );
                        }
                    }

                    switch ( correct_souls )
                    {
                        case 0:
                            SayStatues( 1050009, correct_souls );
                            break; // The circle of souls has failed to turn the key.  The gate remains closed...
                        case 1:
                            SayStatues( 1050007, correct_souls );
                            break; // ~1_NUM~ soul has turned the key correctly, but the rest have forsaken the circle...
                        default:
                            SayStatues( 1050008, correct_souls );
                            break; // ~1_NUM~ souls have turned the key correctly, but the rest have forsaken the circle...
                    }

                    for ( int j = 0; j < players.Count; j++ )
                    {
                        PlayerMobile player = players[ j ] as PlayerMobile;

                        if ( player != null )
                        {
                            Effects.SendPacket( player, player.Map, new HuedEffect( EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x36BD, new Point3D( player.X, player.Y, 0 ), new Point3D( player.X, player.Y, 0 ), 20, 10, true, false, 0, 0 ) );
                            Effects.SendPacket( player, player.Map, new HuedEffect( EffectType.FixedFrom, player.Serial, Serial.Zero, 0x36BD, new Point3D( player.X, player.Y, -1 ), new Point3D( player.X, player.Y, -1 ), 20, 10, true, false, 0, 0 ) );
                            Effects.PlaySound( new Point3D( player.X, player.Y, -1 ), player.Map, 0x307 );

                            for ( int k = 0; k < 5; k++ )
                            {
                                Effects.SendPacket( player, player.Map, new HuedEffect( EffectType.Moving, Serial.Zero, Serial.Zero, 0x1363 + Utility.Random( 0, 11 ), new Point3D( player.X, player.Y, 0 ), new Point3D( player.X, player.Y, 0 ), 5, 0, false, false, 0, 0 ) );
                                Effects.PlaySound( new Point3D( player.X, player.Y, -1 ), Map.Malas, 0x13F );
                                Effects.PlaySound( new Point3D( player.X, player.Y, -1 ), Map.Malas, 0x154 );

                                player.Say( "OUCH!" );
                            }

                            player.Damage( 90, null );
                            player.Send( new AsciiMessage( Serial.MinusOne, 0xFFFF, MessageType.Label, 0x66D, 3, "", "A speeding rock hits you in the head!" ) );
                            player.SendLocalizedMessage( 502382 ); // You can move!
                        }
                    }
                }
                else
                {
                    // we done it!
                    PlayerMobile center = ( (PuzzlePad) m_Pads[ 4 ] ).Stander;

                    for ( int i = 0; i < m_Pads.Count; i++ )
                    {
                        PuzzlePad pad = m_Pads[ i ] as PuzzlePad;

                        if ( pad != null && pad.Stander != null && pad.Stander.Alive )
                        {
                            Effects.SendPacket( pad.Stander, Map.Malas, new HuedEffect( EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x1153, new Point3D( 325, 64, -1 ), new Point3D( 325, 64, -1 ), 1, 60, true, false, 0, 0 ) );
                            Effects.SendPacket( pad.Stander, Map.Malas, new HuedEffect( EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x1153, new Point3D( 325, 64, -1 ), new Point3D( 325, 64, -1 ), 1, 60, true, false, 0, 0 ) );
                            Effects.PlaySound( new Point3D( 325, 64, -1 ), Map.Malas, 0x244 );

                            if ( center != null )
                            {
                                Effects.SendPacket( pad.Stander, Map.Malas, new HuedEffect( EffectType.Lightning, center.Serial, Serial.Zero, 0x0, new Point3D( 324, 64, -1 ), new Point3D( 324, 64, -1 ), 0, 0, false, false, 0, 0 ) );
                                Effects.SendPacket( pad.Stander, Map.Malas, new ParticleEffect( EffectType.FixedFrom, center.Serial, Serial.Zero, 0x0, new Point3D( 324, 64, -1 ), new Point3D( 324, 64, -1 ), 0, 0, false, false, 0, 0, 0x13A7, 0, 0, center.Serial, 3, 0 ) );
                            }
                        }
                    }

                    if ( center != null )
                    {
                        center.MoveToWorld( new Point3D( 467, 96, -1 ), Map.Malas );

                        if ( m_Timer != null )
                        {
                            m_Timer.Stop();
                        }

                        m_Timer = new PoisonTimer( this );
                        m_Timer.Start();
                        m_CanActive = false;
                        m_Box.CanSummon = true;
                    }
                }
            }

            FreeLevers();
        }
Пример #6
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (!Rect.Contains(m.Location) || m is BaseCreature)
            {
                return;
            }

            if (m != null && m_Door != null && !m_Door.Locked && !m_Door.Open && m_Door.Link != null && !m_Door.Link.Locked && !m_Door.Link.Open && m.IsPlayer && m.Alive && m_CanActive)
            {
                m_CanActive = false;                 //Carrabas: Moved this here so it will not execute the OnMovement more than once while executing the loops

                int guardianCount = 0;

                foreach (var mobile in Map.GetMobilesInBounds(Rect).ToArray())
                {
                    if (!(mobile is DarkGuardian))
                    {
                        if (mobile.IsPlayer)
                        {
                            mobile.SendLocalizedMessage(1050000, null, 0x41);                               // The locks on the door click loudly and you begin to hear a faint hissing near the walls.
                        }
                        guardianCount += 2;
                    }
                }

                if (guardianCount > 12)
                {
                    guardianCount = 12;
                }

                for (int j = 0; j < guardianCount; j++)
                {
                    DarkGuardian guard = new DarkGuardian();

                    guard.Map      = Map.Malas;
                    guard.Location = guard.Map.GetSpawnPosition(new Point3D(365, 15, -1), 8);
                }

                for (int i = 0; i < 5; i++)
                {
                    int x = Utility.Random(Rect.X, Rect.Width);
                    int y = Utility.Random(Rect.Y, Rect.Height);

                    GuardianTreasureChest chest = new GuardianTreasureChest(0xE41);

                    int itemID = Utility.RandomList(chest.ItemIDs);

                    chest.ItemID = itemID;
                    chest.MoveToWorld(new Point3D(x, y, -1), Map.Malas);
                }

                m_Door.Locked      = true;
                m_Door.Link.Locked = true;

                if (m_Timer != null)
                {
                    m_Timer.Stop();
                }

                m_Timer = new PoisonTimer(this);
                m_Timer.Start();
            }
        }