SetHits() public method

public SetHits ( int val ) : void
val int
return void
コード例 #1
0
ファイル: AbyssalInfernal.cs プロジェクト: pallop/Servuo
        public void SpawnFollowers(Mobile from)
        {
            if (Map == null)
            {
                return;
            }

            Point3D loc  = Map.GetSpawnPosition(Location, 8);
            Type    type = m_SummonTypes[Utility.Random(m_SummonTypes.Length)];

            PlaySound(0x218);

            for (int i = 0; i < 4; i++)
            {
                BaseCreature summon = (BaseCreature)Activator.CreateInstance(type);

                if (summon != null)
                {
                    summon.SetHits(summon.HitsMax / 2);
                    summon.Team = Team;
                    summon.OnBeforeSpawn(loc, Map);
                    summon.MoveToWorld(loc, Map);
                    summon.Combatant = from;
                }
            }
        }
コード例 #2
0
        public void Scale(BaseCreature c)
        {
            if (c == null)
            {
                return;
            }

            if (c is BaseAspect && c != this)
            {
                return;
            }

            var factor = GetLevelFactor();

            if (c is IAspectSpawn asp)
            {
                if (asp.Aspect != this)
                {
                    return;
                }

                factor *= 0.10;
            }
            else if (c.Team != Team)
            {
                return;
            }

            c.VirtualArmor = Math.Min(90, 40 + Scale(10, factor));

            c.SetStr(Scale(200, factor), Scale(250, factor));
            c.SetDex(Scale(200, factor), Scale(250, factor));
            c.SetInt(Scale(200, factor), Scale(250, factor));

            c.SetHits(Scale(50000, factor), Scale(75000, factor));
            c.SetStam(Scale(1000, factor), Scale(2500, factor));
            c.SetMana(Scale(1000, factor), Scale(2500, factor));

            var damage = Scale(10, factor);

            c.SetDamage(Math.Min(80, 15 + damage), Math.Min(90, 30 + damage));

            var skill = Math.Min(120.0, 95.0 + Scale(5.0, factor));

            c.SetAllSkills(skill, Math.Max(100, skill));
        }
コード例 #3
0
ファイル: HellSteed.cs プロジェクト: felladrin/runuo-pt-br
        public static void SetStats( BaseCreature steed )
        {
            steed.SetStr( 201, 210 );
            steed.SetDex( 101, 110 );
            steed.SetInt( 101, 115 );

            steed.SetHits( 201, 220 );

            steed.SetDamage( 20, 24 );

            steed.SetDamageType( ResistanceType.Physical, 25 );
            steed.SetDamageType( ResistanceType.Fire, 75 );

            steed.SetResistance( ResistanceType.Physical, 60, 70 );
            steed.SetResistance( ResistanceType.Fire, 90 );
            steed.SetResistance( ResistanceType.Poison, 100 );

            steed.SetSkill( SkillName.MagicResist, 90.1, 110.0 );
            steed.SetSkill( SkillName.Tactics, 50.0 );
            steed.SetSkill( SkillName.Wrestling, 90.1, 110.0 );

            steed.Fame = 0;
            steed.Karma = 0;
        }
コード例 #4
0
ファイル: HellSteed.cs プロジェクト: pallop/Servuo
        public static void SetStats(BaseCreature steed)
        {
            steed.SetStr(201, 210);
            steed.SetDex(101, 110);
            steed.SetInt(101, 115);

            steed.SetHits(201, 220);

            steed.SetDamage(20, 24);

            steed.SetDamageType(ResistanceType.Physical, 25);
            steed.SetDamageType(ResistanceType.Fire, 75);

            steed.SetResistance(ResistanceType.Physical, 60, 70);
            steed.SetResistance(ResistanceType.Fire, 90);
            steed.SetResistance(ResistanceType.Poison, 100);

            steed.SetSkill(SkillName.MagicResist, 90.1, 110.0);
            steed.SetSkill(SkillName.Tactics, 50.0);
            steed.SetSkill(SkillName.Wrestling, 90.1, 110.0);

            steed.Fame  = 0;
            steed.Karma = 0;
        }
コード例 #5
0
ファイル: BaseCreature.cs プロジェクト: g4idrijs/ServUO
		public static bool Summon(
			BaseCreature creature, bool controlled, Mobile caster, Point3D p, int sound, TimeSpan duration)
		{
			if (caster.Followers + creature.ControlSlots > caster.FollowersMax)
			{
				caster.SendLocalizedMessage(1049645); // You have too many followers to summon that creature.
				creature.Delete();
				return false;
			}

			m_Summoning = true;

			if (controlled)
			{
				creature.SetControlMaster(caster);
			}

			creature.RangeHome = 10;
			creature.Summoned = true;

			creature.SummonMaster = caster;

			Container pack = creature.Backpack;

			if (pack != null)
			{
				for (int i = pack.Items.Count - 1; i >= 0; --i)
				{
					if (i >= pack.Items.Count)
					{
						continue;
					}

					pack.Items[i].Delete();
				}
			}

			creature.SetHits(
				(int)Math.Floor(creature.HitsMax * (1 + ArcaneEmpowermentSpell.GetSpellBonus(caster, false) / 100.0)));

			new UnsummonTimer(caster, creature, duration).Start();
			creature.m_SummonEnd = DateTime.UtcNow + duration;

			creature.MoveToWorld(p, caster.Map);

			Effects.PlaySound(p, creature.Map, sound);

			m_Summoning = false;

			return true;
		}
コード例 #6
0
ファイル: BaseCreature.cs プロジェクト: Ravenwolfe/xrunuo
        public static bool Summon( BaseCreature creature, bool controlled, Mobile caster, Point3D p, int sound, TimeSpan duration )
        {
            if ( caster.Followers + creature.ControlSlots > caster.FollowersMax )
            {
                caster.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
                creature.Delete();
                return false;
            }

            m_Summoning = true;

            creature.RangeHome = 10;
            creature.Summoned = true;

            if ( controlled )
                creature.SetControlMaster( caster );

            creature.SummonMaster = caster;

            Container pack = creature.Backpack;

            if ( pack != null )
            {
                for ( int i = pack.Items.Count - 1; i >= 0; --i )
                {
                    if ( i >= pack.Items.Count )
                        continue;

                    ( (Item) pack.Items[i] ).Delete();
                }
            }

            double hitsScalar = 1.0 + ( ArcaneEmpowermentSpell.GetSummonHitsBonus( caster ) / 100 );

            if ( hitsScalar != 1.0 )
                creature.SetHits( (int) ( creature.HitsMax * hitsScalar ) );

            new UnsummonTimer( caster, creature, duration ).Start();
            creature.m_SummonEnd = DateTime.Now + duration;

            creature.MoveToWorld( p, caster.Map );

            Effects.PlaySound( p, creature.Map, sound );

            if ( creature is EnergyVortex || creature is BladeSpirits )
                SpellHelper.CheckSummonLimits( creature );

            m_Summoning = false;

            return true;
        }
コード例 #7
0
        public override void OnDamage(int amount, Mobile from, bool willKill)
        {
            base.OnDamage(amount, from, willKill);

            if (willKill || Map == null || from == null)
            {
                return;
            }

            if (0.05 > Utility.RandomDouble())
            {
                Point3D loc  = Map.GetSpawnPosition(Location, 8);
                Type    type = m_SummonTypes[Utility.Random(m_SummonTypes.Length)];

                for (int i = 0; i < 4; i++)
                {
                    BaseCreature summon = (BaseCreature)Activator.CreateInstance(type);

                    if (summon != null)
                    {
                        summon.SetHits(summon.HitsMax / 2);

                        summon.OnBeforeSpawn(loc, Map);
                        summon.MoveToWorld(loc, Map);

                        summon.Combatant = from;
                    }
                }
            }

            if (0.1 > Utility.RandomDouble() && DateTime.UtcNow > m_NextAbilityTime)
            {
                Say(1112362);                   // You will burn to a pile of ash!

                from.PlaySound(0x349);

                for (int i = 0; i < m_ColumnOffset.Length; i++)
                {
                    Point2D offset = m_ColumnOffset[i];

                    Point3D effectLocation = new Point3D(Location.X + offset.X, Location.Y + offset.Y, Location.Z);

                    Effects.SendPacket(effectLocation, Map,
                                       new LocationEffect(effectLocation, 0x3709, 10, 30, 0, 0));
                }

                Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerCallback(
                                    delegate
                {
                    // TODO: Based on OSI taken videos, not accurate, but an aproximation

                    Effects.SendPacket(this.Location, this.Map, new FlashEffect(FlashType.LightFlash));

                    PlaySound(0x44B);

                    int range = 8;

                    Point3D loc = this.Location;
                    Map map     = this.Map;

                    for (int x = -range; x <= range; x++)
                    {
                        for (int y = -range; y <= range; y++)
                        {
                            Point3D p = new Point3D(loc.X + x, loc.Y + y, loc.Z - 5);
                            int dist  = (int)Math.Round(Utility.GetDistanceToSqrt(loc, p));

                            if (dist <= range)
                            {
                                int itemId, renderMode, duration;

                                if (dist >= 8)
                                {
                                    itemId     = 0x36CB;
                                    duration   = 9;
                                    renderMode = 4;
                                }
                                else if (dist >= 6)
                                {
                                    itemId     = 0x3728;
                                    duration   = 13;
                                    renderMode = 4;
                                }
                                else
                                {
                                    itemId     = 0x3728;
                                    duration   = 13;
                                    renderMode = 3;
                                }

                                Effects.SendPacket(loc, map, new HuedEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, itemId, p, p, 1, duration, true, false, 1150, renderMode));
                            }
                        }
                    }

                    foreach (Mobile m in this.GetMobilesInRange(8).ToArray())
                    {
                        if (this != m && this.GetDistanceToSqrt(m) <= 8 && CanBeHarmful(m))
                        {
                            if (m is BaseCreature && !((BaseCreature)m).Controlled && !((BaseCreature)m).Summoned)
                            {
                                continue;
                            }

                            DoHarmful(m);

                            // TODO: Where do we freeze target and teleport them away?

                            AOS.Damage(m, this, Utility.RandomMinMax(90, 110), 0, 100, 0, 0, 0);
                        }
                    }
                }));

                m_NextAbilityTime = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(35, 45));
            }
        }
コード例 #8
0
        public void SizeUpCrewMember(BaseCreature bc, bool evil, int link, Mobile captain, string toss)
        {
            MorphingTime.RemoveMyClothes((Mobile)bc);

            if (bc.Backpack != null)
            {
                List <Item> belongings = new List <Item>();
                foreach (Item i in bc.Backpack.Items)
                {
                    belongings.Add(i);
                }
                foreach (Item stuff in belongings)
                {
                    stuff.Delete();
                }
            }

            bc.AI        = AIType.AI_Archer;
            bc.FightMode = FightMode.Evil;
            bc.Karma     = 1500;
            bc.Name      = "a sailor";

            if (evil)
            {
                bc.FightMode = FightMode.Closest;
                bc.Karma     = -1500;
                bc.Name      = "a pirate";
                if (captain is PirateCult)
                {
                    bc.Name = "a follower";
                }
            }

            bc.SetStr(96, 120);
            bc.SetDex(81, 105);
            bc.SetInt(36, 60);

            bc.SetHits(58, 72);

            SetDamage(10, 23);

            bc.SetDamageType(ResistanceType.Physical, 100);

            bc.SetResistance(ResistanceType.Physical, 35, 50);
            bc.SetResistance(ResistanceType.Fire, 10, 30);
            bc.SetResistance(ResistanceType.Cold, 10, 30);
            bc.SetResistance(ResistanceType.Poison, 10, 30);
            bc.SetResistance(ResistanceType.Energy, 10, 30);

            bc.SetSkill(SkillName.Archery, 66.0, 97.5);
            bc.SetSkill(SkillName.MagicResist, 25.0, 47.5);
            bc.SetSkill(SkillName.Tactics, 65.0, 87.5);
            bc.SetSkill(SkillName.Wrestling, 66.0, 97.5);

            bc.Fame = 1500;

            bc.VirtualArmor = 32;

            bc.Title    = null;
            bc.EmoteHue = link;

            if (toss == "stones")
            {
                MonsterGloves gloves = new MonsterGloves(); gloves.ThrowType = "Stones"; bc.AddItem(gloves);
            }
            else if (toss == "stars")
            {
                MonsterGloves gloves = new MonsterGloves(); gloves.ThrowType = "Stars"; bc.AddItem(gloves);
            }
            else if (toss == "axes")
            {
                MonsterGloves gloves = new MonsterGloves(); gloves.ThrowType = "Axes"; bc.AddItem(gloves);
            }
            else if (toss == "daggers")
            {
                MonsterGloves gloves = new MonsterGloves(); gloves.ThrowType = "Daggers"; bc.AddItem(gloves);
            }
            else if (toss == "darts")
            {
                MonsterGloves gloves = new MonsterGloves(); gloves.ThrowType = "Darts"; bc.AddItem(gloves);
            }
            else if (toss == "spear")
            {
                MonsterGloves gloves = new MonsterGloves(); gloves.ThrowType = "Spear"; bc.AddItem(gloves);
            }
            else if (toss == "boulder")
            {
                MonsterGloves gloves = new MonsterGloves(); gloves.ThrowType = "Boulder"; bc.AddItem(gloves);
            }
            else if (toss == "bones")
            {
                MonsterGloves gloves = new MonsterGloves(); gloves.ThrowType = "Bones"; bc.AddItem(gloves);
            }
            else if (toss == "arrows")
            {
                bc.AddItem(new Bow());
            }
            else if (toss == "crossbow")
            {
                bc.AddItem(new Crossbow());
            }
            else if (toss == "harpoon")
            {
                bc.AddItem(new Harpoon());
            }

            else if (toss == "fire")
            {
                WizardStaff staff = new WizardStaff(); staff.AosElementDamages.Fire = 75; staff.damageType = 1; bc.AddItem(staff);
            }
            else if (toss == "cold")
            {
                WizardStaff staff = new WizardStaff(); staff.AosElementDamages.Cold = 75; staff.damageType = 2; bc.AddItem(staff);
            }
            else if (toss == "energy")
            {
                WizardStaff staff = new WizardStaff(); staff.AosElementDamages.Energy = 75; staff.damageType = 3; bc.AddItem(staff);
            }
            else if (toss == "poison")
            {
                WizardStaff staff = new WizardStaff(); staff.AosElementDamages.Poison = 75; staff.damageType = 4; bc.AddItem(staff);
            }
            else if (toss == "bolt")
            {
                WizardStaff staff = new WizardStaff(); staff.damageType = 0; bc.AddItem(staff);
            }

            DressUpCrewMember(bc, captain);
            bc.NameColor();
            bc.MoveToWorld(captain.Location, captain.Map);
        }