Inheritance: Server.Mobile, IHonorTarget
コード例 #1
0
ファイル: BaseAI.cs プロジェクト: Crome696/ServUO
		public BaseAI(BaseCreature m)
		{
			m_Mobile = m;

			m_Timer = new AITimer(this);

			bool activate;

			if (!m.PlayerRangeSensitive)
			{
				activate = true;
			}
			else if (World.Loading)
			{
				activate = false;
			}
			else if (m.Map == null || m.Map == Map.Internal || !m.Map.GetSector(m).Active)
			{
				activate = false;
			}
			else
			{
				activate = true;
			}

			if (activate)
			{
				m_Timer.Start();
			}

			Action = ActionType.Wander;
		}
コード例 #2
0
ファイル: AnimalTaming.cs プロジェクト: greeduomacro/divinity
        public static void Scale(BaseCreature bc, double scalar, bool scaleStats)
        {
            if (scaleStats)
            {
                if (bc.RawStr > 0)
                    bc.RawStr = (int)Math.Max(1, bc.RawStr * scalar);

                if (bc.RawDex > 0)
                    bc.RawDex = (int)Math.Max(1, bc.RawDex * scalar);

                if (bc.HitsMaxSeed > 0)
                {
                    bc.HitsMaxSeed = (int)Math.Max(1, bc.HitsMaxSeed * scalar);
                    bc.Hits = bc.Hits;
                }

                if (bc.StamMaxSeed > 0)
                {
                    bc.StamMaxSeed = (int)Math.Max(1, bc.StamMaxSeed * scalar);
                    bc.Stam = bc.Stam;
                }
            }

            for (int i = 0; i < bc.Skills.Length; ++i)
                bc.Skills[i].Base *= scalar;
        }
コード例 #3
0
		public static void TokenTest(Mobile m, BaseCreature bc)
		{
			if ( m.Backpack == null )
				return;

			int karma = Math.Abs( bc.Karma );
			int tokenbase = ( bc.TotalGold + karma + bc.Fame + ((bc.Hits+bc.Stam+bc.Mana)/3)) / 6000;
			int maxtokens = 6 + ( 100 * tokenbase );
			int mintokens = TokenSettings.Loot_Difference*(maxtokens/100);

			int tokenstogive = Utility.Random( mintokens, maxtokens );
			bool tokensgiven = false;

			foreach( Item i in m.Backpack.Items )
			{
				if( i is TokenBag && !tokensgiven)
				{
					Tokens t = new Tokens( tokenstogive );
					if ( ((Container)i).TryDropItem( m, t, true ) )
					{
						m.SendMessage( "You have received {0} tokens", tokenstogive );
						tokensgiven = true;
					}
					else
						t.Delete();
				}
				if ( tokensgiven )
					break;
			}
		}
コード例 #4
0
		public CouncilMemberAI(BaseCreature m)
			: base(m)
		{
			DmgSlowsMovement = false;
			CanRun = false;
			UsesPotions = false; //CanDrinkPots = false;
		}
コード例 #5
0
ファイル: AnimalLore.cs プロジェクト: Crome696/ServUO
			private static void Check(Mobile from, BaseCreature c, double min)
			{
				if (from.CheckTargetSkill(SkillName.AnimalLore, c, min, 120.0))
					SendGump(from, c);
				else
					from.SendLocalizedMessage(500334); // You can't think of anything you know offhand.
			}
コード例 #6
0
		public static void RunFly( BaseCreature fbc )
		{
			if ( NullCheck( fbc ))
				return;

			fbc.Direction |= Direction.Running;
		}
コード例 #7
0
        public PetResurrectGump(Mobile from, BaseCreature pet, double hitsScalar) : base(50, 50)
        {
            from.CloseGump(typeof (PetResurrectGump));

            m_Pet = pet;
            m_HitsScalar = hitsScalar;

            AddPage(0);

            AddBackground(10, 10, 265, 140, 0x242C);

            AddItem(205, 40, 0x4);
            AddItem(227, 40, 0x5);

            AddItem(180, 78, 0xCAE);
            AddItem(195, 90, 0xCAD);
            AddItem(218, 95, 0xCB0);

            AddHtmlLocalized(30, 30, 150, 75, 1049665, false, false);
                // <div align=center>Wilt thou sanctify the resurrection of:</div>
            AddHtml(30, 70, 150, 25, String.Format("<div align=CENTER>{0}</div>", pet.Name), true, false);

            AddButton(40, 105, 0x81A, 0x81B, 0x1, GumpButtonType.Reply, 0); // Okay
            AddButton(110, 105, 0x819, 0x818, 0x2, GumpButtonType.Reply, 0); // Cancel
        }
コード例 #8
0
 public virtual void ChangeToSetManeuver( BaseCreature bc )
 {
     bc.CombatManeuver = bc.SetManeuver;
     bc.OffensiveFeat = bc.CombatManeuver.ListedName;
     bc.ManeuverAccuracyBonus = bc.CombatManeuver.AccuracyBonus * bc.CombatManeuver.FeatLevel;
     bc.ManeuverDamageBonus = bc.CombatManeuver.DamageBonus * bc.CombatManeuver.FeatLevel;
 }
コード例 #9
0
ファイル: LevelItemManager.cs プロジェクト: jasegiffin/JustUO
        private static bool IsFireBreathingCreature(BaseCreature bc)
        {
            if (bc == null)
                return false;

            return bc.HasBreath;
        }
コード例 #10
0
 public RandomFarmableItems(BaseCreature creature)
     : base(creature, EnumChance.Normal)
 {
     this.AddSortableItem(new Cotton(3));
     this.AddSortableItem(new Flax(3));
     this.AddSortableItem(new WheatSheaf(3));
 }
コード例 #11
0
		public static void ScaleStats(BaseCreature bc, double scalar)
		{
			if (bc.RawStr > 0)
			{
				bc.RawStr = (int)Math.Max(1, bc.RawStr * scalar);
			}

			if (bc.RawDex > 0)
			{
				bc.RawDex = (int)Math.Max(1, bc.RawDex * scalar);
			}

			if (bc.RawInt > 0)
			{
				bc.RawInt = (int)Math.Max(1, bc.RawInt * scalar);
			}

			if (bc.HitsMaxSeed > 0)
			{
				bc.HitsMaxSeed = (int)Math.Max(1, bc.HitsMaxSeed * scalar);
				bc.Hits = bc.Hits;
			}

			if (bc.StamMaxSeed > 0)
			{
				bc.StamMaxSeed = (int)Math.Max(1, bc.StamMaxSeed * scalar);
				bc.Stam = bc.Stam;
			}
		}
コード例 #12
0
ファイル: CharmedMobile.cs プロジェクト: evildude807/kaltar
 public CharmedMobile(BaseCreature owner)
     : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
 {
     owner = m_Owner;
     Body = 777;
     Title = " The Mystic Lama Herder";
 }
コード例 #13
0
ファイル: Objectives.cs プロジェクト: FreeReign/imaginenation
		public override void OnKill( BaseCreature creature, Container corpse )
		{
			if ( creature is CursedSoul )
			{
				if ( m_CursedSoulsKilled == 0 )
					System.AddConversation( new GainKarmaConversation( true ) );

				m_CursedSoulsKilled++;

				// Cursed Souls killed:  ~1_COUNT~
				System.From.SendLocalizedMessage( 1063038, m_CursedSoulsKilled.ToString() );
			}
			else if ( creature is YoungRonin )
			{
				if ( m_YoungRoninKilled == 0 )
					System.AddConversation( new GainKarmaConversation( false ) );

				m_YoungRoninKilled++;

				// Young Ronin killed:  ~1_COUNT~
				System.From.SendLocalizedMessage( 1063039, m_YoungRoninKilled.ToString() );
			}

			CurProgress = Math.Max( m_CursedSoulsKilled, m_YoungRoninKilled );
		}
コード例 #14
0
ファイル: PackHorse.cs プロジェクト: Godkong/Origins
        public static void CombineBackpacks( BaseCreature animal )
        {
            if ( Core.AOS )
                return;

            //if ( animal.IsBonded || animal.IsDeadPet )
            //	return;

            Container pack = animal.Backpack;

            if ( pack != null )
            {
                Container newPack = new Backpack();

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

                    newPack.DropItem( pack.Items[i] );
                }

                pack.DropItem( newPack );
            }
        }
コード例 #15
0
ファイル: UnsummonTimer.cs プロジェクト: Crome696/ServUO
 public UnsummonTimer(Mobile caster, BaseCreature creature, TimeSpan delay)
     : base(delay)
 {
     this.m_Caster = caster;
     this.m_Creature = creature;
     this.Priority = TimerPriority.OneSecond;
 }
コード例 #16
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 1:
                {
                    m_BondOwner = reader.ReadMobile();
                    goto case 0;
                }
                case 0:
                {
                    m_link = (BaseCreature)reader.ReadMobile();
                    m_toDeletePet = reader.ReadBool();
                    break;
                }

            }

            if ( m_link != null )
                m_link.IsStabled = true;
        }
コード例 #17
0
ファイル: EventArgs.cs プロジェクト: greeduomacro/hubroot
 public CreatureDamagedEventArgs( BaseCreature bc, int amount, Mobile from, bool willKill )
 {
     Aggressor = from;
     Creature = bc;
     DamageAmount = amount;
     WillKill = willKill;
 }
コード例 #18
0
ファイル: KillEntry.cs プロジェクト: FreeReign/imaginenation
        /// <summary>
        /// Represents an entry in the killTable
        /// pkKillEntryID, fkMonsterEntryID, PlayersKilled, PlayerCount, BSCount, EVcount
        /// </summary>
        /// <param name="creatureKilled"></param>
        /// <param name="damageEntries"></param>
        /// <param name="mobilesKilled"></param>
        /// <param name="lootItems"></param>
        public KillEntry(BaseCreature creatureKilled, IList<DamageEntry> damageEntries, Dictionary<Mobile, int> mobilesKilled, IList<Item> lootItems)
        {
            m_CreatureKilled = creatureKilled;

            m_KillTime = m_CreatureKilled.KillDuration;

            //Used to determine if a killer has accoured
            List<Mobile> monsterKillerList = GetKillerList(damageEntries);
            
            SetKillerTypes(monsterKillerList);

            SetPlayersDied(mobilesKilled, monsterKillerList);

            //Initialize the list and add the gold entry to it
            m_DatabaseEntries = new List<DatabaseEntry>(lootItems.Count + 1) { new GoldValueEntry(lootItems) };

            //Loop through the remaining items (gold and stones excluded) and add them to the DatabaseEntry list
            for (int i = 0; i < lootItems.Count; i++)
            {
                Item item = lootItems[i];

                if (item is BaseWeapon)
                    m_DatabaseEntries.Add(new WeaponEntry((BaseWeapon)item));
                else if (item is BaseArmor)
                    m_DatabaseEntries.Add(new ArmorEntry((BaseArmor)item));
                else
                    m_DatabaseEntries.Add(new ItemEntry(item));
            }
        }
コード例 #19
0
ファイル: DryadAllure.cs プロジェクト: Ravenwolfe/xrunuo
        public void Target( BaseCreature bc )
        {
            if ( !Caster.CanSee( bc ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            if ( !Caster.InRange( bc, 6 ) )
            {
                Caster.SendLocalizedMessage( 500643 ); // Target is too far away.
            }
            else if ( !Caster.CanBeHarmful( bc ) || !bc.CanBeDamaged() )
            {
                Caster.SendLocalizedMessage( 1074379 ); // You cannot charm that!
            }
            else if ( bc.Controlled || bc.Name == null )
            {
                Caster.SendLocalizedMessage( 1074379 ); // You cannot charm that!
            }
            else if ( bc is BaseChampion || bc.IsParagon || bc is Medusa || bc is Lurg || !SlayerGroup.GetEntryByName( SlayerName.Repond ).Slays( bc ) )
            {
                Caster.SendLocalizedMessage( 1074379 ); // You cannot charm that!
            }
            else if ( CheckSequence() )
            {
                double chance = Caster.Skills[SkillName.Spellweaving].Fixed / 1000;

                chance += ( SpellweavingSpell.GetFocusLevel( Caster ) * 2 ) / 100;

                if ( chance > Utility.RandomDouble() )
                {
                    SpellHelper.Turn( Caster, bc );

                    bc.ControlSlots = 3;

                    bc.ActiveSpeed = 2;
                    bc.PassiveSpeed = 2;

                    bc.Owners.Add( Caster );

                    bc.SetControlMaster( Caster );

                    bc.IsBonded = false;

                    Caster.SendLocalizedMessage( 1072527 ); // You allure the humanoid to follow and protect you.

                    Caster.PlaySound( 0x5C4 );
                }
                else
                {
                    bc.Combatant = Caster;

                    Caster.SendLocalizedMessage( 1072528 ); // The humanoid becomes enraged by your charming attempt and attacks you.

                    Caster.PlaySound( 0x5C5 );
                }
            }

            FinishSequence();
        }
コード例 #20
0
        public virtual void HandleStance( BaseCreature bc )
        {
            if( bc.Warmode && bc.SetStance != null && bc.Stance.GetType() != bc.SetStance.GetType() )
                ChangeToSetStance(bc);

            else if( !bc.Warmode && bc.Stance.FeatLevel > 0 )
                TurnStanceOff(bc);
        }
コード例 #21
0
		public static bool CheckMastery(Mobile tamer, BaseCreature creature)
		{
			if (tamer.AccessLevel >= AccessLevel.GameMaster)
			{
				return true;
			}
			return false;
		}
コード例 #22
0
ファイル: AnimalTaming.cs プロジェクト: m309/ForkUO
 public static bool MustBeSubdued(BaseCreature bc)
 {
     if (bc.Owners.Count > 0)
     {
         return false;
     }//Checks to see if the animal has been tamed before
     return bc.SubdueBeforeTame && (bc.Hits > (bc.HitsMax / 10));
 }
コード例 #23
0
ファイル: Objectives.cs プロジェクト: Crome696/ServUO
 public override void OnKill(BaseCreature creature, Container corpse)
 {
     if (creature is DeathwatchBeetleHatchling)
     {
         this.Complete();
         this.System.AddObjective(new ThirdKillObjective(2));
     }
 }
コード例 #24
0
		public static void AnimateFlying( BaseCreature fbc )
		{
			if ( NullCheck( fbc ))
				return;

               		fbc.PlaySound( 0x2D0 );
			fbc.Animate( 24, 5, 1, true, false, 0 );
		}
コード例 #25
0
ファイル: CharmedMobile.cs プロジェクト: evildude807/kaltar
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();
            m_Owner = reader.ReadMobile() as BaseCreature;

            Delete();
        }
コード例 #26
0
ファイル: PackHorse.cs プロジェクト: Godkong/Origins
        public PackAnimalBackpackEntry( BaseCreature animal, Mobile from )
            : base(6145, 3)
        {
            m_Animal = animal;
            m_From = from;

            if ( animal.IsDeadPet )
                Enabled = false;
        }
コード例 #27
0
        public AIControlMobileTarget(BaseAI ai, OrderType order)
            : base(-1, false, (order == OrderType.Attack ? TargetFlags.Harmful : TargetFlags.None))
        {
            this.m_List = new List<BaseAI>();
            this.m_Order = order;

            this.AddAI(ai);
            this.m_Mobile = ai.m_Mobile;
        }
コード例 #28
0
ファイル: TeachEntry.cs プロジェクト: greeduomacro/last-wish
		public TeachEntry( SkillName skill, BaseCreature m, Mobile from, bool enabled ) : base( 6000 + (int)skill )
		{
			m_Skill = skill;
			m_Mobile = m;
			m_From = from;

			if ( !enabled )
				Flags |= Network.CMEFlags.Disabled;
		}
コード例 #29
0
ファイル: AnimalLore.cs プロジェクト: greeduomacro/hubroot
        private static string FormatSkill( BaseCreature c, SkillName name )
        {
            Skill skill = c.Skills[name];

            if( skill.Base < 10.0 )
                return "<div align=right>---</div>";

            return String.Format("<div align=right>{0:F1}</div>", skill.Value);
        }
コード例 #30
0
ファイル: Paragon.cs プロジェクト: greeduomacro/UO-Forever
		public static void Convert(BaseCreature bc)
		{
			if (bc.IsParagon)
			{
				return;
			}

			bc.SolidHueOverride = Hue;

			if (bc.HitsMaxSeed >= 0)
			{
				bc.HitsMaxSeed = (int)(bc.HitsMaxSeed * HitsBuff);
			}

			bc.RawStr = (int)(bc.RawStr * StrBuff);
			bc.RawInt = (int)(bc.RawInt * IntBuff);
			bc.RawDex = (int)(bc.RawDex * DexBuff);

			bc.Hits = bc.HitsMax;
			bc.Mana = bc.ManaMax;
			bc.Stam = bc.StamMax;

			foreach (Skill skill in bc.Skills.Where(skill => skill.Base > 0.0))
			{
				skill.Base *= SkillsBuff;
			}

			bc.PassiveSpeed /= SpeedBuff;
			bc.ActiveSpeed /= SpeedBuff;
			bc.CurrentSpeed = bc.PassiveSpeed;

			bc.DamageMin += DamageBuff;
			bc.DamageMax += DamageBuff;

			if (bc.Fame > 0)
			{
				bc.Fame = (int)(bc.Fame * FameBuff);
			}

			if (bc.Fame > 32000)
			{
				bc.Fame = 32000;
			}

			if (bc.Karma == 0)
			{
				return;
			}

			bc.Karma = (int)(bc.Karma * KarmaBuff);

			if (Math.Abs(bc.Karma) > 32000)
			{
				bc.Karma = 32000 * Math.Sign(bc.Karma);
			}
		}
コード例 #31
0
ファイル: DemonKnight.cs プロジェクト: Drake1187/runuocustom
 public static void DistributeArtifact(BaseCreature creature, bool points)
 {
     DistributeArtifact(creature, points, CreateRandomArtifact());
 }
コード例 #32
0
        public void GivePowerScrolls()
        {
            List <Mobile>      toGive = new List <Mobile>();
            List <DamageStore> rights = BaseCreature.GetLootingRights(this.DamageEntries, this.HitsMax);

            for (int i = rights.Count - 1; i >= 0; --i)
            {
                DamageStore ds = rights[i];

                if (ds.m_HasRight)
                {
                    toGive.Add(ds.m_Mobile);
                }
            }

            if (toGive.Count == 0)
            {
                return;
            }

            // Randomize
            for (int i = 0; i < toGive.Count; ++i)
            {
                int    rand = Utility.Random(toGive.Count);
                Mobile hold = toGive[i];
                toGive[i]    = toGive[rand];
                toGive[rand] = hold;
            }

            for (int i = 0; i < 16; ++i)
            {
                /*
                 * int level;
                 *              double random = Utility.RandomDouble();
                 *
                 *              if ( 0.1 >= random )
                 *                      level = 25;
                 *              else if ( 0.25 >= random )
                 *                      level = 20;
                 *              else if ( 0.45 >= random )
                 *                      level = 15;
                 *              else if ( 0.70 >= random )
                 *                      level = 10;
                 *              else
                 *                      level = 5;
                 */

                Mobile m = toGive[i % toGive.Count];

                HarrowerTicket ps = new HarrowerTicket();

                m.SendLocalizedMessage(1049524);                   // You have received a scroll of power!
                m.AddToBackpack(ps);

                if (m is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)m;

                    for (int j = 0; j < pm.JusticeProtectors.Count; ++j)
                    {
                        Mobile prot = (Mobile)pm.JusticeProtectors[j];

                        if (prot.Map != m.Map || prot.Kills >= Mobile.MurderCount || prot.Criminal || !JusticeVirtue.CheckMapRegion(m, prot))
                        {
                            continue;
                        }

                        /*
                         *                      int chance = 0;
                         *
                         *                      switch ( VirtueHelper.GetLevel( prot, VirtueName.Justice ) )
                         *                      {
                         *                              case VirtueLevel.Seeker: chance = 60; break;
                         *                              case VirtueLevel.Follower: chance = 80; break;
                         *                              case VirtueLevel.Knight: chance = 100; break;
                         *                      }
                         *
                         *                      if ( chance > Utility.Random( 100 ) )
                         *                      {
                         *                              prot.SendLocalizedMessage( 1049368 ); // You have been rewarded for your dedication to Justice!
                         *                              prot.AddToBackpack( new StatCapScroll( 225 + level ) );
                         *                      }
                         */
                    }
                }
            }
        }
コード例 #33
0
ファイル: AnimalTrainer.cs プロジェクト: zerodowned/RunUO.T2A
        public void Claim(Mobile from, string petName)
        {
            if (Deleted || !from.CheckAlive())
            {
                return;
            }

            bool claimed = false;
            int  stabled = 0;

            bool claimByName = petName != null;

            for (int i = 0; i < from.Stabled.Count; ++i)
            {
                BaseCreature pet = from.Stabled[i] as BaseCreature;

                if (pet == null || pet.Deleted)
                {
                    pet.IsStabled = false;
                    pet.StabledBy = null;
                    from.Stabled.RemoveAt(i);
                    --i;
                    continue;
                }

                ++stabled;

                if (claimByName && !Insensitive.Equals(pet.Name, petName))
                {
                    continue;
                }

                if (CanClaim(from, pet))
                {
                    DoClaim(from, pet);

                    from.Stabled.RemoveAt(i);

                    if (from is PlayerMobile)
                    {
                        ((PlayerMobile)from).AutoStabled.Remove(pet);
                    }

                    --i;

                    claimed = true;
                }
                else
                {
                    SayTo(from, 1049612, pet.Name);                       // ~1_NAME~ remained in the stables because you have too many followers.
                }
            }

            if (claimed)
            {
                SayTo(from, 1042559);                   // Here you go... and good day to you!
            }
            else if (stabled == 0)
            {
                SayTo(from, 502671);                   // But I have no animals stabled with me at the moment!
            }
            else if (claimByName)
            {
                BeginClaimList(from);
            }
        }
コード例 #34
0
 public AbilityProfile(BaseCreature bc)
 {
     Creature    = bc;
     DamageIndex = -1;
 }
コード例 #35
0
 public VendorAI(BaseCreature m) : base(m)
 {
 }
コード例 #36
0
ファイル: Spawner.cs プロジェクト: phpjunkie420/RunUO
        public void Spawn(int index)
        {
            Map map = Map;

            if (map == null || map == Map.Internal || m_CreaturesName.Count == 0 || index >= m_CreaturesName.Count || Parent != null)
            {
                return;
            }

            Defrag();

            if (m_Creatures.Count >= m_Count)
            {
                return;
            }

            Type type = SpawnerType.GetType(m_CreaturesName[index]);

            if (type != null)
            {
                try
                {
                    object o = Activator.CreateInstance(type);

                    if (o is Mobile)
                    {
                        Mobile m = (Mobile)o;

                        m_Creatures.Add(m);


                        Point3D loc = (m is BaseVendor ? this.Location : GetSpawnPosition());

                        m.OnBeforeSpawn(loc, map);
                        InvalidateProperties();


                        m.MoveToWorld(loc, map);

                        if (m is BaseCreature)
                        {
                            BaseCreature c = (BaseCreature)m;

                            if (m_WalkingRange >= 0)
                            {
                                c.RangeHome = m_WalkingRange;
                            }
                            else
                            {
                                c.RangeHome = m_HomeRange;
                            }

                            c.CurrentWayPoint = m_WayPoint;

                            if (m_Team > 0)
                            {
                                c.Team = m_Team;
                            }

                            c.Home = this.Location;
                        }

                        m.OnAfterSpawn();
                    }
                    else if (o is Item)
                    {
                        Item item = (Item)o;

                        m_Creatures.Add(item);

                        Point3D loc = GetSpawnPosition();

                        item.OnBeforeSpawn(loc, map);
                        InvalidateProperties();

                        item.MoveToWorld(loc, map);

                        item.OnAfterSpawn();
                    }
                }
                catch
                {
                }
            }
        }
コード例 #37
0
        public AbilityProfile(BaseCreature bc, GenericReader reader)
        {
            int version = reader.ReadInt();

            Creature = bc;

            switch (version)
            {
            case 0:
                DamageIndex = -1;
                break;

            case 1:
                DamageIndex = reader.ReadInt();
                break;
            }

            MagicalAbility = (MagicalAbility)reader.ReadInt();
            TokunoTame     = reader.ReadBool();

            RegenHits = reader.ReadInt();
            RegenStam = reader.ReadInt();
            RegenMana = reader.ReadInt();

            int count = reader.ReadInt();

            SpecialAbilities = new SpecialAbility[count];

            for (int i = 0; i < count; i++)
            {
                SpecialAbilities[i] = SpecialAbility.Abilities[reader.ReadInt()];
            }

            count       = reader.ReadInt();
            AreaEffects = new AreaEffect[count];

            for (int i = 0; i < count; i++)
            {
                AreaEffects[i] = AreaEffect.Effects[reader.ReadInt()];
            }

            count           = reader.ReadInt();
            WeaponAbilities = new WeaponAbility[count];

            for (int i = 0; i < count; i++)
            {
                WeaponAbilities[i] = WeaponAbility.Abilities[reader.ReadInt()];
            }

            count = reader.ReadInt();
            for (int i = 0; i < count; i++)
            {
                if (Advancements == null)
                {
                    Advancements = new List <object>();
                }

                switch (reader.ReadInt())
                {
                case 1: Advancements.Add((MagicalAbility)reader.ReadInt()); break;

                case 2: Advancements.Add(SpecialAbility.Abilities[reader.ReadInt()]); break;

                case 3: Advancements.Add(AreaEffect.Effects[reader.ReadInt()]); break;

                case 4: Advancements.Add(WeaponAbility.Abilities[reader.ReadInt()]); break;

                case 5: Advancements.Add((SkillName)reader.ReadInt()); break;
                }
            }
        }
コード例 #38
0
 public static bool CheckConvert(BaseCreature bc) => CheckConvert(bc, bc.Location, bc.Map);
コード例 #39
0
        public static void HandleKill(Mobile victim, Mobile killer)
        {
            PlayerMobile pm = killer as PlayerMobile;
            BaseCreature bc = victim as BaseCreature;

            if (!Core.AOS)
            {
                return;
            }

            if (pm == null || bc == null || bc.NoKillAwards /*|| !CheckLocation(bc) || !CheckLocation(pm)*/)
            {
                return;
            }

            //Make sure its a boss we killed!!
            bool boss = bc is Impaler || bc is DemonKnight || bc is DarknightCreeper || bc is FleshRenderer || bc is ShadowKnight || bc is AbysmalHorror;

            if (!boss)
            {
                return;
            }

            double gpoints = pm.GauntletPoints;

            pm.GauntletPoints += (int)(bc.Fame * (1 + Math.Sqrt(pm.RealLuck) / 100)) / 2;

            const double A = 0.000863316841;
            const double B = 0.00000425531915;

            double chance = A * Math.Pow(10, B * gpoints);
            double roll   = Utility.RandomDouble();

            if (chance > roll)
            {
                Item i = null;

                if (Core.TOL)
                {
                    int ran = Utility.Random(m_RewardTable.Length + 1);

                    if (ran >= m_RewardTable.Length)
                    {
                        int luck = killer is PlayerMobile ? ((PlayerMobile)killer).RealLuck : killer.Luck;

                        i = Loot.RandomArmorOrShieldOrWeaponOrJewelry(LootPackEntry.IsInTokuno(killer), LootPackEntry.IsMondain(killer), LootPackEntry.IsStygian(killer));
                        RunicReforging.GenerateRandomArtifactItem(i, luck, Utility.RandomMinMax(1000, 1200));
                        NegativeAttributes attrs = RunicReforging.GetNegativeAttributes(i);

                        if (attrs != null)
                        {
                            attrs.Prized    = 1;
                            attrs.Brittle   = 0;
                            attrs.Massive   = 0;
                            attrs.Unwieldly = 0;
                            attrs.Antique   = 0;
                            attrs.NoRepair  = 0;
                        }
                    }
                    else
                    {
                        Type[] list = m_RewardTable[ran];
                        Type   t    = list.Length == 1 ? list[0] : list[Utility.Random(list.Length)];

                        i = Activator.CreateInstance(t) as Item;
                    }
                }
                else
                {
                    i = Activator.CreateInstance(m_DoomArtifact[Utility.Random(m_DoomArtifact.Length)]) as Item;
                }

                if (i != null)
                {
                    pm.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.

                    pm.PlaySound(0x5B4);

                    if (!pm.PlaceInBackpack(i))
                    {
                        if (pm.BankBox != null && pm.BankBox.TryDropItem(killer, i, false))
                        {
                            pm.SendLocalizedMessage(1079730); // The item has been placed into your bank box.
                        }
                        else
                        {
                            pm.SendLocalizedMessage(1072523); // You find an artifact, but your backpack and bank are too full to hold it.
                            i.MoveToWorld(pm.Location, pm.Map);
                        }
                    }

                    pm.GauntletPoints = 0;
                }
            }
        }
コード例 #40
0
        public bool UseProvocation()
        {
            if (!this.m_Mobile.UseSkill(SkillName.Provocation))
            {
                return(false);
            }
            else if (this.m_Mobile.Target != null)
            {
                this.m_Mobile.Target.Cancel(this.m_Mobile, TargetCancelType.Canceled);
            }

            Mobile target = this.m_Mobile.Combatant;

            if (this.m_Mobile.Combatant is BaseCreature)
            {
                BaseCreature bc = this.m_Mobile.Combatant as BaseCreature;
                target = bc.GetMaster();

                if (target != null && bc.CanBeHarmful(target))
                {
                    if (this.m_Mobile.Debug)
                    {
                        this.m_Mobile.Say(1162, "Provocation: Pet to Master");
                    }

                    bc.Provoke(this.m_Mobile, target, true);
                    return(true);
                }
            }

            List <BaseCreature> list = new List <BaseCreature>();

            foreach (Mobile m in this.m_Mobile.GetMobilesInRange(5))
            {
                if (m != null && m is BaseCreature && m != this.m_Mobile)
                {
                    BaseCreature bc = m as BaseCreature;

                    if (this.m_Mobile.Controlled != bc.Controlled)
                    {
                        continue;
                    }

                    if (this.m_Mobile.Summoned != bc.Summoned)
                    {
                        continue;
                    }

                    list.Add(bc);
                }
            }

            if (list.Count == 0)
            {
                return(false);
            }

            for (int i = 0; i < list.Count; i++)
            {
                if (list[i].CanBeHarmful(target))
                {
                    if (this.m_Mobile.Debug)
                    {
                        this.m_Mobile.Say(1162, "Provocation: " + list[i].Name + " to " + target.Name);
                    }

                    list[i].Provoke(this.m_Mobile, target, true);
                    return(true);
                }
            }

            return(false);
        }
コード例 #41
0
 public CloneAI(BaseCreature m)
     : base(m)
 {
     m.CurrentSpeed = m.ActiveSpeed;
 }
コード例 #42
0
ファイル: Shepherd.cs プロジェクト: slawdis/uoodyssey-scripts
 public bool CanClaim(Mobile from, BaseCreature pet)
 {
     return((from.Followers + pet.ControlSlots) <= from.FollowersMax);
 }
コード例 #43
0
ファイル: Shepherd.cs プロジェクト: slawdis/uoodyssey-scripts
        public void EndStable(Mobile from, BaseCreature pet)
        {
            if (Deleted || !from.CheckAlive())
            {
                return;
            }

            if (pet.Body.IsHuman)
            {
                SayTo(from, 502672);                   // HA HA HA! Sorry, I am not an inn.
            }
            else if (!pet.Controlled)
            {
                SayTo(from, 1048053);                   // You can't stable that!
            }
            else if (pet.ControlMaster != from)
            {
                SayTo(from, 1042562);                   // You do not own that pet!
            }
            else if (pet.IsDeadPet)
            {
                SayTo(from, 1049668);                   // Living pets only, please.
            }
            else if (pet.Summoned)
            {
                SayTo(from, 502673);                   // I can not stable summoned creatures.
            }
            else if ((pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0))
            {
                SayTo(from, 1042563);                   // You need to unload your pet.
            }
            else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
            {
                SayTo(from, 1042564);                   // I'm sorry.  Your pet seems to be busy.
            }
            else if (from.Stabled.Count >= Server.Mobiles.AnimalTrainer.GetMaxStabled(from))
            {
                SayTo(from, 1042565);                   // You have too many pets in the stables!
            }
            else
            {
                Container bank = from.FindBankNoCreate();

                if ((from.Backpack != null && from.Backpack.ConsumeTotal(typeof(Gold), 30)) || (bank != null && bank.ConsumeTotal(typeof(Gold), 30)))
                {
                    pet.Language      = null;
                    pet.ControlTarget = null;
                    pet.ControlOrder  = OrderType.Stay;
                    pet.Internalize();

                    pet.SetControlMaster(null);
                    pet.SummonMaster = null;

                    pet.IsStabled = true;

                    if (Core.SE)
                    {
                        pet.Loyalty = BaseCreature.MaxLoyalty;                         // Wonderfully happy
                    }
                    from.Stabled.Add(pet);

                    SayTo(from, Core.AOS ? 1049677 : 502679);                       // [AOS: Your pet has been stabled.] Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed!
                }
                else
                {
                    SayTo(from, 502677);                       // But thou hast not the funds in thy bank account!
                }
            }
        }
コード例 #44
0
 public ThiefAI(BaseCreature m) : base(m)
 {
 }
コード例 #45
0
 public CouncilAI(BaseCreature m)
     : base(m)
 {
 }
コード例 #46
0
ファイル: NecroMageAI.cs プロジェクト: Brrm1/New-One
        public bool CanDispel(Mobile m)
        {
            BaseCreature c = m as BaseCreature;

            return(c != null && c.Summoned && c.SummonMaster != this.m_Mobile && this.m_Mobile.CanBeHarmful(m, false) && !c.IsAnimatedDead);
        }
コード例 #47
0
ファイル: Navrey.cs プロジェクト: babyfoxx/ServUO
        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            if (Utility.RandomBool())
            {
                c.AddItem(ScrollofTranscendence.CreateRandom(30, 30));
            }

            if (Utility.RandomBool())
            {
                c.AddItem(new TatteredAncientScroll());
            }

            if (Utility.RandomBool())
            {
                c.AddItem(new UntransTome());
            }

            if (Utility.RandomBool())
            {
                c.AddItem(new SpiderCarapace());
            }

            if (Utility.RandomDouble() < 0.01)
            {
                DistributeRandomArtifact(this, m_Artifact);
            }

            // distribute quest items for the 'Green with Envy' quest given by Vernix
            List <DamageStore> rights = BaseCreature.GetLootingRights(this.DamageEntries, this.HitsMax);

            for (int i = rights.Count - 1; i >= 0; --i)
            {
                DamageStore ds = rights[i];
                if (!ds.m_HasRight)
                {
                    rights.RemoveAt(i);
                }
            }

            // for each with looting rights... give an eye of navrey if they have the quest
            foreach (DamageStore d in rights)
            {
                PlayerMobile pm = d.m_Mobile as PlayerMobile;
                if (null != pm)
                {
                    foreach (BaseQuest quest in pm.Quests)
                    {
                        if (quest is GreenWithEnvyQuest)
                        {
                            Container pack = pm.Backpack;
                            Item      item = new EyeOfNavrey();
                            if (pack == null || !pack.TryDropItem(pm, item, false))
                            {
                                pm.BankBox.DropItem(item);
                            }
                            pm.SendLocalizedMessage(1095155); // As Navrey Night-Eyes dies, you find and claim one of her eyes as proof of her demise.
                            break;
                        }
                    }
                }
            }
        }
コード例 #48
0
 public ArcherAI(BaseCreature m) : base(m)
 {
 }
コード例 #49
0
ファイル: AnimalAI.cs プロジェクト: uotools/xrunuo
 public AnimalAI(BaseCreature m)
     : base(m)
 {
 }
コード例 #50
0
        public static void Convert(BaseCreature bc)
        {
            if (bc.IsParagon ||
                !bc.CanBeParagon)
            {
                return;
            }

            bc.Hue = Hue;

            if (bc.HitsMaxSeed >= 0)
            {
                bc.HitsMaxSeed = (int)(bc.HitsMaxSeed * HitsBuff);
            }

            bc.RawStr = (int)(bc.RawStr * StrBuff);
            bc.RawInt = (int)(bc.RawInt * IntBuff);
            bc.RawDex = (int)(bc.RawDex * DexBuff);

            bc.Hits = bc.HitsMax;
            bc.Mana = bc.ManaMax;
            bc.Stam = bc.StamMax;

            for (int i = 0; i < bc.Skills.Length; i++)
            {
                Skill skill = bc.Skills[i];

                if (skill.Base > 0.0)
                {
                    skill.Base *= SkillsBuff;
                }
            }

            bc.PassiveSpeed /= SpeedBuff;
            bc.ActiveSpeed  /= SpeedBuff;
            bc.CurrentSpeed  = bc.PassiveSpeed;

            bc.DamageMin += DamageBuff;
            bc.DamageMax += DamageBuff;

            if (bc.Fame > 0)
            {
                bc.Fame = (int)(bc.Fame * FameBuff);
            }

            if (bc.Fame > 32000)
            {
                bc.Fame = 32000;
            }

            // TODO: Mana regeneration rate = Sqrt( buffedFame ) / 4

            if (bc.Karma != 0)
            {
                bc.Karma = (int)(bc.Karma * KarmaBuff);

                if (Math.Abs(bc.Karma) > 32000)
                {
                    bc.Karma = 32000 * Math.Sign(bc.Karma);
                }
            }
        }
コード例 #51
0
ファイル: HealerAI.cs プロジェクト: tateima/PathOfUO
 public HealerAI(BaseCreature m) : base(m)
 {
 }
コード例 #52
0
ファイル: MeerMage.cs プロジェクト: zerodowned/UO-Forever
        public override void OnThink()
        {
            if (DateTime.UtcNow >= m_NextAbilityTime)
            {
                Mobile combatant = this.Combatant;

                if (combatant != null && combatant.Map == this.Map && combatant.InRange(this, 12) && IsEnemy(combatant) && !UnderEffect(combatant))
                {
                    m_NextAbilityTime = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(20, 30));

                    if (combatant is BaseCreature)
                    {
                        BaseCreature bc = (BaseCreature)combatant;

                        if (bc.Controlled && bc.ControlMaster != null && !bc.ControlMaster.Deleted && bc.ControlMaster.Alive)
                        {
                            if (bc.ControlMaster.Map == this.Map && bc.ControlMaster.InRange(this, 12) && !UnderEffect(bc.ControlMaster))
                            {
                                Combatant = combatant = bc.ControlMaster;
                            }
                        }
                    }

                    if (Utility.RandomDouble() < .1)
                    {
                        int[][] coord =
                        {
                            new int[] { -4, -6 }, new int[] { 4, -6 }, new int[] { 0, -8 }, new int[] { -5, 5 }, new int[] { 5, 5 }
                        };

                        BaseCreature rabid;

                        for (int i = 0; i < 5; i++)
                        {
                            int x = combatant.X + coord[i][0];
                            int y = combatant.Y + coord[i][1];

                            Point3D loc = new Point3D(x, y, combatant.Map.GetAverageZ(x, y));

                            if (!combatant.Map.CanSpawnMobile(loc))
                            {
                                continue;
                            }

                            switch (i)
                            {
                            case 0: rabid = new EnragedRabbit(this); break;

                            case 1: rabid = new EnragedHind(this); break;

                            case 2: rabid = new EnragedHart(this); break;

                            case 3: rabid = new EnragedBlackBear(this); break;

                            default: rabid = new EnragedEagle(this); break;
                            }

                            rabid.FocusMob = combatant;
                            rabid.MoveToWorld(loc, combatant.Map);
                        }
                        this.Say(1071932);                           //Creatures of the forest, I call to thee!  Aid me in the fight against all that is evil!
                    }
                    else if (combatant.Player)
                    {
                        this.Say(true, "I call a plague of insects to sting your flesh!");
                        m_Table[combatant] = Timer.DelayCall <EffectInfo>(TimeSpan.FromSeconds(0.5), TimeSpan.FromSeconds(7.0), new TimerStateCallback <EffectInfo>(DoEffect), new EffectInfo(combatant));
                    }
                }
            }

            base.OnThink();
        }
コード例 #53
0
ファイル: SpellbinderAI.cs プロジェクト: travismills82/TrueUO
 public SpellbinderAI(BaseCreature m)
     : base(m)
 {
 }
コード例 #54
0
 public MageAI(BaseCreature m)
     : base(m)
 {
 }
コード例 #55
0
ファイル: DeDOSTrojanHorse.cs プロジェクト: Pumpk1ns/outlands
        protected override bool OnMove(Direction d)
        {
            if (m_ChargeInProgress)
            {
                if (Utility.RandomDouble() <= .15)
                {
                    Effects.PlaySound(Location, Map, 0x2F4);

                    int effectHue = 0;

                    DeDOSElectricField electricField = new DeDOSElectricField(this, effectHue, 1, 20, 3, 5, false, false, true, -1, true);
                    electricField.MoveToWorld(Location, Map);
                }

                m_NextChargeAllowed = DateTime.UtcNow + NextChargeDelay;

                Queue m_Queue = new Queue();

                IPooledEnumerable nearbyMobiles = Map.GetMobilesInRange(Location, 1);

                foreach (Mobile mobile in nearbyMobiles)
                {
                    if (mobile == this)
                    {
                        continue;
                    }
                    if (!SpecialAbilities.MonsterCanDamage(this, mobile))
                    {
                        continue;
                    }
                    if (!Map.InLOS(Location, mobile.Location))
                    {
                        continue;
                    }
                    if (mobile == Combatant)
                    {
                        continue;
                    }
                    if (m_Trampled.Contains(mobile))
                    {
                        continue;
                    }

                    m_Queue.Enqueue(mobile);
                }

                nearbyMobiles.Free();

                while (m_Queue.Count > 0)
                {
                    Mobile mobile = (Mobile)m_Queue.Dequeue();

                    m_Trampled.Add(mobile);

                    Effects.PlaySound(Location, Map, Utility.RandomList(0x3BB, 0x3BA, 0x3B9));
                    Effects.PlaySound(mobile.Location, mobile.Map, mobile.GetHurtSound());

                    double damage = DamageMin;

                    if (Combatant is BaseCreature)
                    {
                        damage *= 2;
                    }

                    new Blood().MoveToWorld(mobile.Location, mobile.Map);

                    AOS.Damage(mobile, (int)damage, 100, 0, 0, 0, 0);

                    if (mobile is PlayerMobile)
                    {
                        mobile.Animate(21, 6, 1, true, false, 0);
                    }

                    else if (mobile is BaseCreature)
                    {
                        BaseCreature bc_Creature = mobile as BaseCreature;

                        if (bc_Creature.IsHighSeasBodyType)
                        {
                            bc_Creature.Animate(2, 14, 1, true, false, 0);
                        }

                        else if (bc_Creature.Body != null)
                        {
                            if (bc_Creature.Body.IsHuman)
                            {
                                bc_Creature.Animate(21, 6, 1, true, false, 0);
                            }

                            else
                            {
                                bc_Creature.Animate(2, 4, 1, true, false, 0);
                            }
                        }
                    }

                    SpecialAbilities.HinderSpecialAbility(1.0, this, mobile, 1.0, 1, false, -1, false, "", "You have been trampled and can't move!", "-1");
                }

                CheckChargeResolved();
            }

            Effects.PlaySound(Location, Map, Utility.RandomList(0x12E, 0x12D));

            return(base.OnMove(d));
        }
コード例 #56
0
 public static bool CheckConvert(BaseCreature bc)
 {
     return(CheckConvert(bc, bc.Location, bc.Map));
 }
コード例 #57
0
ファイル: DeDOSTrojanHorse.cs プロジェクト: Pumpk1ns/outlands
        public void CheckChargeResolved()
        {
            if (!m_ChargeInProgress)
            {
                return;
            }

            bool chargeExpired = false;
            bool clearCharge   = false;

            if (Combatant == null)
            {
                chargeExpired = true;
            }

            else if (!Combatant.Alive || Combatant.Hidden || Utility.GetDistance(Location, Combatant.Location) > 24 || DateTime.UtcNow > m_ChargeTimeout)
            {
                chargeExpired = true;
            }

            if (chargeExpired)
            {
                clearCharge = true;
            }

            else if (SpecialAbilities.Exists(Combatant))
            {
                if (Utility.GetDistance(Location, Combatant.Location) <= 1)
                {
                    PublicOverheadMessage(MessageType.Regular, 0, false, "*tramples opponent*");

                    Effects.PlaySound(Location, Map, 0x59C);
                    Effects.PlaySound(Combatant.Location, Combatant.Map, Combatant.GetHurtSound());

                    double damage = DamageMax;

                    if (Combatant is BaseCreature)
                    {
                        damage *= 1.5;
                    }

                    new Blood().MoveToWorld(Combatant.Location, Combatant.Map);

                    AOS.Damage(Combatant, (int)damage, 100, 0, 0, 0, 0);

                    if (Combatant is PlayerMobile)
                    {
                        Combatant.Animate(21, 6, 1, true, false, 0);
                    }

                    else if (Combatant is BaseCreature)
                    {
                        BaseCreature bc_Combatant = Combatant as BaseCreature;

                        if (bc_Combatant.IsHighSeasBodyType)
                        {
                            bc_Combatant.Animate(2, 14, 1, true, false, 0);
                        }

                        else if (bc_Combatant.Body != null)
                        {
                            if (bc_Combatant.Body.IsHuman)
                            {
                                bc_Combatant.Animate(21, 6, 1, true, false, 0);
                            }

                            else
                            {
                                bc_Combatant.Animate(2, 4, 1, true, false, 0);
                            }
                        }
                    }

                    SpecialAbilities.HinderSpecialAbility(1.0, this, Combatant, 1.0, 1, false, -1, false, "", "You have been trampled and can't move!", "-1");

                    clearCharge = true;
                }
            }

            if (clearCharge)
            {
                ClearCharge();
            }
        }
コード例 #58
0
        public override bool OnBeforeDeath()
        {
            if (m_TrueForm)
            {
                List <DamageStore> rights = BaseCreature.GetLootingRights(this.DamageEntries, this.HitsMax);

                for (int i = rights.Count - 1; i >= 0; --i)
                {
                    DamageStore ds = rights[i];

                    if (ds.m_HasRight && ds.m_Mobile is PlayerMobile)
                    {
                        PlayerMobile.ChampionTitleInfo.AwardHarrowerTitle((PlayerMobile)ds.m_Mobile);
                    }
                }

                if (!NoKillAwards)
                {
                    GivePowerScrolls();

                    Map map = this.Map;

                    if (map != null)
                    {
                        for (int x = -16; x <= 16; ++x)
                        {
                            for (int y = -16; y <= 16; ++y)
                            {
                                double dist = Math.Sqrt(x * x + y * y);

                                if (dist <= 16)
                                {
                                    new GoodiesTimer(map, X + x, Y + y).Start();
                                }
                            }
                        }
                    }

                    m_DamageEntries = new Dictionary <Mobile, int>();

                    for (int i = 0; i < m_Tentacles.Count; ++i)
                    {
                        Mobile m = m_Tentacles[i];

                        if (!m.Deleted)
                        {
                            m.Kill();
                        }

                        RegisterDamageTo(m);
                    }

                    m_Tentacles.Clear();

                    RegisterDamageTo(this);
                    AwardArtifact(GetArtifact());

                    if (m_GateItem != null)
                    {
                        m_GateItem.Delete();
                    }
                }

                return(base.OnBeforeDeath());
            }
            else
            {
                Morph();
                return(false);
            }
        }
コード例 #59
0
 public void EndClaimList(Mobile from, BaseCreature pet)
 {
     return;
 }
コード例 #60
0
ファイル: NecroMageAI.cs プロジェクト: Brrm1/New-One
 public NecroMageAI(BaseCreature m)
     : base(m)
 {
 }