Пример #1
0
 public static void AddClone_OnCommand(CommandEventArgs e)
 {
     BaseCreature clone = new MedusaClone(e.Mobile);
     clone.Frozen = clone.Blessed = true;
     clone.MoveToWorld(e.Mobile.Location, e.Mobile.Map);
 }
Пример #2
0
        public void DoGaze()
        {
            Mobile target = FindRandomMedusaTarget();
            Map    map    = Map;

            if (map == null || target == null)
            {
                return;
            }

            if ((target is BaseCreature && ((BaseCreature)target).SummonMaster != this) || CanBeHarmful(target))
            {
                if (CheckBlockGaze(target))
                {
                    if (GorgonLense.TotalCharges(target) == 0)
                    {
                        target.SendLocalizedMessage(1112600); // Your lenses crumble. You are no longer protected from Medusa's gaze!
                    }
                    else
                    {
                        target.SendLocalizedMessage(1112599); //Your Gorgon Lens deflect Medusa's petrifying gaze!
                    }
                }
                else
                {
                    BaseCreature clone = new MedusaClone(target);

                    bool    validLocation = false;
                    Point3D loc           = Location;

                    for (int j = 0; !validLocation && j < 10; ++j)
                    {
                        int x = X + Utility.Random(10) - 1;
                        int y = Y + Utility.Random(10) - 1;
                        int z = map.GetAverageZ(x, y);

                        if (validLocation = map.CanFit(x, y, Z, 16, false, false))
                        {
                            loc = new Point3D(x, y, Z);
                        }
                        else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                        {
                            loc = new Point3D(x, y, z);
                        }
                    }

                    Effects.SendLocationEffect(loc, target.Map, 0x37B9, 10, 5);
                    clone.Frozen           = clone.Blessed = true;
                    clone.SolidHueOverride = 761;

                    target.Frozen           = target.Blessed = true;
                    target.SolidHueOverride = 761;

                    //clone.MoveToWorld(loc, target.Map);
                    Summon(clone, false, this, loc, 0, TimeSpan.FromMinutes(90));

                    if (target is BaseCreature && !((BaseCreature)target).Summoned && ((BaseCreature)target).GetMaster() != null)
                    {
                        ((BaseCreature)target).GetMaster().SendLocalizedMessage(1113281, null, 43); // Your pet has been petrified!
                    }
                    else
                    {
                        target.SendLocalizedMessage(1112768); // You have been turned to stone!!!
                    }
                    new GazeTimer(target, clone, this, Utility.RandomMinMax(5, 10)).Start();
                    m_GazeDelay = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(45, 75));

                    m_Helpers.Add(clone);
                    m_TurnedToStone.Add(target);

                    BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.MedusaStone, 1153790, 1153825));
                    return;
                }
            }

            m_GazeDelay = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(25, 65));
        }
Пример #3
0
        public override void OnThink()
        {
            base.OnThink();

            if (DateTime.UtcNow > this.m_DelayOne)
            {
                Medusa.AffectedMobiles.Clear();

                this.m_DelayOne = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(30, 180));
            }

            if (DateTime.UtcNow > this.m_GazeDelay)
            {
                Mobile target = FindRandomMedusaTarget(this);
                //  Mobile target = Ability.FindRandomMedusaTarget(this);

                Map map = this.Map;

                if (map == null)
                {
                    return;
                }

                this.DoSpecialAbility(this);

                if ((target != null) && !(target is MedusaClone) && !(target is StoneMonster))
                {
                    BaseCreature clone = new MedusaClone(target);

                    bool    validLocation = false;
                    Point3D loc           = this.Location;

                    for (int j = 0; !validLocation && j < 10; ++j)
                    {
                        int x = this.X + Utility.Random(10) - 1;
                        int y = this.Y + Utility.Random(10) - 1;
                        int z = map.GetAverageZ(x, y);

                        if (validLocation = map.CanFit(x, y, this.Z, 16, false, false))
                        {
                            loc = new Point3D(x, y, this.Z);
                        }
                        else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                        {
                            loc = new Point3D(x, y, z);
                        }
                    }

                    Effects.SendLocationEffect(loc, target.Map, 0x37B9, 10, 5);
                    clone.Frozen            = clone.Blessed = true;
                    clone.SolidHueOverride  = 761;
                    target.Frozen           = true;
                    target.SolidHueOverride = 761;
                    clone.MoveToWorld(loc, target.Map);
                    target.SendLocalizedMessage(1112768); // You have been turned to stone!!!

                    new GazeTimer(target, clone).Start();
                    this.m_GazeDelay = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(30, 60));

                    AffectedMobiles.Add(target);
                }
            }
        }
Пример #4
0
        public override void OnThink()
        {
           
            base.OnThink();

            if (DateTime.Now > m_DelayOne)
            {
                Medusa.AffectedMobiles.Clear();

                m_DelayOne = DateTime.Now + TimeSpan.FromSeconds( Utility.RandomMinMax( 30, 180 ) ); 
   
            } 

            if (DateTime.Now > m_GazeDelay)
            {
                Mobile target = FindRandomMedusaTarget(this);
            //  Mobile target = Ability.FindRandomMedusaTarget(this);

                Map map = this.Map;

         	if ( map == null )
			return;

               DoSpecialAbility( this ); 
   				
               if ( (target != null) && !(target is MedusaClone) && !(target is StoneMonster) ) 
               {
                  BaseCreature clone = new MedusaClone(target);
		             				   
		  bool validLocation = false;
		  Point3D loc = this.Location;
       
		  for ( int j = 0; !validLocation && j < 10; ++j )
                  {
			int x = X + Utility.Random( 10 ) - 1;
			int y = Y + Utility.Random( 10 ) - 1;
			int z = map.GetAverageZ( x, y );

			if ( validLocation = map.CanFit( x, y, this.Z, 16, false, false ) )
				loc = new Point3D( x, y, Z );
			else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) )
				loc = new Point3D( x, y, z );
		   }

                    Effects.SendLocationEffect(loc, target.Map, 0x37B9, 10, 5);
                    clone.Frozen = clone.Blessed = true;
                    clone.SolidHueOverride = 761;                     
		            target.Frozen = true;
                    target.SolidHueOverride = 761;
                    clone.MoveToWorld(loc, target.Map);
                    target.SendLocalizedMessage(1112768); // You have been turned to stone!!!

                    new GazeTimer(target, clone).Start();
                    m_GazeDelay = DateTime.Now + TimeSpan.FromSeconds(Utility.RandomMinMax(30, 60));

                    AffectedMobiles.Add(target);

                }
            }
         } 
Пример #5
0
        public void DoGaze()
        {
            Mobile target = FindRandomMedusaTarget();
            Map map = Map;

            if (map == null || target == null)
                return;

            if ((target is BaseCreature && ((BaseCreature)target).SummonMaster != this) || CanBeHarmful(target))
            {
                if (CheckBlockGaze(target))
                    target.SendLocalizedMessage(1112599); //Your Gorgon Lens deflect Medusa's petrifying gaze!
                else
                {
                    BaseCreature clone = new MedusaClone(target);

                    bool validLocation = false;
                    Point3D loc = Location;

                    for (int j = 0; !validLocation && j < 10; ++j)
                    {
                        int x = X + Utility.Random(10) - 1;
                        int y = Y + Utility.Random(10) - 1;
                        int z = map.GetAverageZ(x, y);

                        if (validLocation = map.CanFit(x, y, Z, 16, false, false))
                            loc = new Point3D(x, y, Z);
                        else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                            loc = new Point3D(x, y, z);
                    }

                    Effects.SendLocationEffect(loc, target.Map, 0x37B9, 10, 5);
                    clone.Frozen = clone.Blessed = true;
                    clone.SolidHueOverride = 761;

                    target.Frozen = target.Blessed = true;
                    target.SolidHueOverride = 761;

                    //clone.MoveToWorld(loc, target.Map);
                    BaseCreature.Summon(clone, false, this, loc, 0, TimeSpan.FromMinutes(90));

                    if (target is BaseCreature && !((BaseCreature)target).Summoned && ((BaseCreature)target).GetMaster() != null)
                        ((BaseCreature)target).GetMaster().SendLocalizedMessage(1113281, null, 43); // Your pet has been petrified!
                    else
                        target.SendLocalizedMessage(1112768); // You have been turned to stone!!!

                    new GazeTimer(target, clone, this).Start();
                    m_GazeDelay = DateTime.Now + TimeSpan.FromSeconds(Utility.RandomMinMax(45, 75));

                    m_Helpers.Add(clone);
                    m_TurnedToStone.Add(target);

                    BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.MedusaStone, 1153790, 1153825));
                    return;
                }
            }

            m_GazeDelay = DateTime.Now + TimeSpan.FromSeconds(Utility.RandomMinMax(25, 65));
        }