public void SpawnJukaLord(Mobile target)
        {
            Map map = target.Map;

            if (map == null)
            {
                return;
            }

            int jukas = 0;

            foreach (Mobile m in this.GetMobilesInRange(10))
            {
                if (m is JukaLord)
                {
                    ++jukas;
                }
            }

            if (jukas < 10)
            {
                BaseCreature juka = new JukaLord();

                juka.Team = this.Team;

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

                for (int j = 0; !validLocation && j < 10; ++j)
                {
                    int x = target.X + Utility.Random(3) - 1;
                    int y = target.Y + Utility.Random(3) - 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);
                    }
                }

                juka.MoveToWorld(loc, map);

                juka.Combatant = target;
            }
        }
示例#2
0
        private void Unbuff(JukaLord toDebuff, int hitsMaxSeed, int rawStr, int rawDex)
        {
            toDebuff.EndAction <JukaMage>();

            if (toDebuff.Deleted)
            {
                return;
            }

            toDebuff.HitsMaxSeed = hitsMaxSeed;
            toDebuff.RawStr      = rawStr;
            toDebuff.RawDex      = rawDex;

            toDebuff.Hits = toDebuff.Hits;
            toDebuff.Stam = toDebuff.Stam;
        }
示例#3
0
        private void Unbuff(object[] states)
        {
            JukaLord toDebuff = (JukaLord)states[0];

            toDebuff.EndAction(typeof(JukaMage));

            if (toDebuff.Deleted)
            {
                return;
            }

            toDebuff.HitsMaxSeed = (int)states[1];
            toDebuff.RawStr      = (int)states[2];
            toDebuff.RawDex      = (int)states[3];

            toDebuff.Hits = toDebuff.Hits;
            toDebuff.Stam = toDebuff.Stam;
        }
示例#4
0
        public override void OnThink()
        {
            if (DateTime.Now >= m_NextAbilityTime)
            {
                JukaLord toBuff = null;

                foreach (Mobile m in this.GetMobilesInRange(8))
                {
                    if (m is JukaLord && IsFriend(m) && m.Combatant != null && CanBeBeneficial(m) && m.CanBeginAction(typeof(JukaMage)) && InLOS(m))
                    {
                        toBuff = (JukaLord)m;
                        break;
                    }
                }

                if (toBuff != null)
                {
                    if (CanBeBeneficial(toBuff) && toBuff.BeginAction(typeof(JukaMage)))
                    {
                        m_NextAbilityTime = DateTime.Now + TimeSpan.FromSeconds(Utility.RandomMinMax(30, 60));

                        toBuff.Say(true, "Give me the power to destroy my enemies!");
                        this.Say(true, "Fight well my lord!");

                        DoBeneficial(toBuff);

                        object[] state = new object[] { toBuff, toBuff.HitsMaxSeed, toBuff.RawStr, toBuff.RawDex };

                        SpellHelper.Turn(this, toBuff);

                        int toScale = toBuff.HitsMaxSeed;

                        if (toScale > 0)
                        {
                            toBuff.HitsMaxSeed += AOS.Scale(toScale, 75);
                            toBuff.Hits        += AOS.Scale(toScale, 75);
                        }

                        toScale = toBuff.RawStr;

                        if (toScale > 0)
                        {
                            toBuff.RawStr += AOS.Scale(toScale, 50);
                        }

                        toScale = toBuff.RawDex;

                        if (toScale > 0)
                        {
                            toBuff.RawDex += AOS.Scale(toScale, 50);
                            toBuff.Stam   += AOS.Scale(toScale, 50);
                        }

                        toBuff.Hits = toBuff.Hits;
                        toBuff.Stam = toBuff.Stam;

                        toBuff.FixedParticles(0x375A, 10, 15, 5017, EffectLayer.Waist);
                        toBuff.PlaySound(0x1EE);

                        Timer.DelayCall(TimeSpan.FromSeconds(20.0), new TimerStateCallback(Unbuff), state);
                    }
                }
                else
                {
                    m_NextAbilityTime = DateTime.Now + TimeSpan.FromSeconds(Utility.RandomMinMax(2, 5));
                }
            }

            base.OnThink();
        }
示例#5
0
        public override void OnThink()
        {
            if (Core.Now >= m_NextAbilityTime)
            {
                JukaLord toBuff = null;

                foreach (var m in GetMobilesInRange(8))
                {
                    if (m is JukaLord lord && IsFriend(lord) && lord.Combatant != null && CanBeBeneficial(lord) &&
                        lord.CanBeginAction <JukaMage>() && InLOS(lord))
                    {
                        toBuff = lord;
                        break;
                    }
                }

                if (toBuff != null)
                {
                    if (CanBeBeneficial(toBuff) && toBuff.BeginAction <JukaMage>())
                    {
                        m_NextAbilityTime = Core.Now + TimeSpan.FromSeconds(Utility.RandomMinMax(30, 60));

                        toBuff.Say(true, "Give me the power to destroy my enemies!");
                        Say(true, "Fight well my lord!");

                        DoBeneficial(toBuff);

                        SpellHelper.Turn(this, toBuff);

                        var toScale = toBuff.HitsMaxSeed;

                        if (toScale > 0)
                        {
                            toBuff.HitsMaxSeed += AOS.Scale(toScale, 75);
                            toBuff.Hits        += AOS.Scale(toScale, 75);
                        }

                        toScale = toBuff.RawStr;

                        if (toScale > 0)
                        {
                            toBuff.RawStr += AOS.Scale(toScale, 50);
                        }

                        toScale = toBuff.RawDex;

                        if (toScale > 0)
                        {
                            toBuff.RawDex += AOS.Scale(toScale, 50);
                            toBuff.Stam   += AOS.Scale(toScale, 50);
                        }

                        toBuff.Hits = toBuff.Hits;
                        toBuff.Stam = toBuff.Stam;

                        toBuff.FixedParticles(0x375A, 10, 15, 5017, EffectLayer.Waist);
                        toBuff.PlaySound(0x1EE);

                        Timer.DelayCall(
                            TimeSpan.FromSeconds(20.0),
                            Unbuff,
                            toBuff,
                            toBuff.HitsMaxSeed,
                            toBuff.RawStr,
                            toBuff.RawDex
                            );
                    }
                }
                else
                {
                    m_NextAbilityTime = Core.Now + TimeSpan.FromSeconds(Utility.RandomMinMax(2, 5));
                }
            }

            base.OnThink();
        }
		public void SpawnJukaLord( Mobile target )
		{
			Map map = target.Map;

			if ( map == null )
				return;

			int jukas = 0;

			foreach ( Mobile m in this.GetMobilesInRange( 10 ) )
			{
				if ( m is JukaLord )
					++jukas;
			}

			if ( jukas < 10 )
			{
				BaseCreature juka = new JukaLord();

				juka.Team = this.Team;

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

				for ( int j = 0; !validLocation && j < 10; ++j )
				{
					int x = target.X + Utility.Random( 3 ) - 1;
					int y = target.Y + Utility.Random( 3 ) - 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 );
				}

				juka.MoveToWorld( loc, map );

				juka.Combatant = target;
			}
		}