Inheritance: Server.Items.Container, ICarvable
コード例 #1
0
ファイル: ColdDrake.cs プロジェクト: Crome696/ServUO
        public override void OnCarve(Mobile from, Corpse corpse, Item with)
        {
            if (corpse != null)
                corpse.DropItem(new DragonBlood(8));

            base.OnCarve(from, corpse, with);
        }
コード例 #2
0
ファイル: PolarBear.cs プロジェクト: FreeReign/Rebirth-Repack
 public override int GenerateFurs(Corpse c)
 {
     Item i = new LightFur();
     i.Amount = 2;
     c.DropItem( i );
     return 2;
 }
コード例 #3
0
 public override void AddBodyParts( BodyPartsContainer bpc, Corpse corpse )
 {
     base.AddBodyParts( bpc, corpse );
     DragonHead head = new DragonHead();
     head.Hue = 0;
     bpc.DropItem( head );
 }
コード例 #4
0
ファイル: Packets.cs プロジェクト: zerodowned/angelisland
		public CorpseContent( Mobile beholder, Corpse beheld ) : base( 0x3C )
		{
			ArrayList items = beheld.EquipItems;
			int count = items.Count;

			EnsureCapacity( 5 + (count * 19) );

			long pos = m_Stream.Position;

			int written = 0;

			m_Stream.Write( (ushort) 0 );

			for ( int i = 0; i < count; ++i )
			{
				Item child = (Item)items[i];

				if ( !child.Deleted && child.Parent == beheld && beholder.CanSee( child ) )
				{
					m_Stream.Write( (int) child.Serial );
					m_Stream.Write( (ushort) child.ItemID );
					m_Stream.Write( (byte) 0 ); // signed, itemID offset
					m_Stream.Write( (ushort) child.Amount );
					m_Stream.Write( (short) child.X );
					m_Stream.Write( (short) child.Y );
					m_Stream.Write( (int) beheld.Serial );
					m_Stream.Write( (ushort) child.Hue );

					++written;
				}
			}

			m_Stream.Seek( pos, SeekOrigin.Begin );
			m_Stream.Write( (ushort) written );
		}
コード例 #5
0
ファイル: Troll.cs プロジェクト: greeduomacro/hubroot
		public override void OnCarve( Mobile from, Corpse corpse, Item with )
		{
			base.OnCarve( from, corpse, with );

			corpse.DropItem( new Bloodmoss( Utility.RandomMinMax( 8, 16 ) ) );
			from.SendMessage( "You cut some bloodmoss from between the troll's toes; it remains on the corpse." );
		}
コード例 #6
0
ファイル: Piglet.cs プロジェクト: justdanofficial/khaeros
 public override void AddBodyParts( BodyPartsContainer bpc, Corpse corpse )
 {
     base.AddBodyParts( bpc, corpse );
     bpc.DropItem( new PorkHock( 1 ) );
     bpc.DropItem( new RawHam( 1 ) );
     bpc.DropItem( new RawBaconSlab( 1 ) );
 }
コード例 #7
0
 public static bool CanUseWithDeed(Mobile from, Corpse corpse)
 {
     if (corpse.IsCriminalAction(from))
     {
         from.SendMessage("You did not earn the right to use this creature in the deed.");
         return false;
     }
     else return true;
 }
コード例 #8
0
 public override void AddBodyParts( BodyPartsContainer bpc, Corpse corpse )
 {
     base.AddBodyParts( bpc, corpse );
     Ribs ribs = new Ribs( 3 );
     ribs.Hue = 2935;
     ribs.Name = "flesh";
     ribs.RotStage = RotStage.Rotten;
     bpc.DropItem( ribs );
 }
コード例 #9
0
ファイル: Titan.cs プロジェクト: greeduomacro/vivre-uo
 public override void OnCarve(Mobile from, Corpse corpse, Item with)
 {
     if (!corpse.Carved)
     {
         corpse.DropItem(new TitanTooth());
         from.SendMessage("Vous arrachez une dent au titan");
     }
     
     base.OnCarve(from, corpse, with);
 }
コード例 #10
0
ファイル: GoblinElder.cs プロジェクト: greeduomacro/annox
        public override void OnCarve(Mobile from, Corpse corpse)
        {
            if (corpse.Carved == false)
            {
                base.OnCarve(from, corpse);

                new Blood(Utility.RandomMinMax(4650, 4655)).MoveToWorld(corpse.Location, corpse.Map);
                new GoblinEars().MoveToWorld(corpse.Location, corpse.Map);
                corpse.Delete();
            }
        }
コード例 #11
0
            public static bool CheckCorpseType(Mobile from, Corpse corpse, SmallBOD deed)
            {
                if (corpse != null && corpse.Owner != null)
                {
                    Type corpseOwnerType = corpse.Owner.GetType();

                    if (corpseOwnerType != null && deed.Type != null && corpseOwnerType == deed.Type)
                        return true;
                    else
                        from.SendMessage("The creature is not in the request.");
                }
                return false;
            }
コード例 #12
0
            public static bool CheckUseWithDeedTime(Mobile from, Corpse corpse)
            {
                DateTime dtCannAdd = corpse.TimeOfDeath + TimeSpan.FromSeconds(30.0);
                if (dtCannAdd > DateTime.Now)
                {
                    TimeSpan ts = dtCannAdd - DateTime.Now;

                    if (ts < TimeSpan.Zero)
                        ts = TimeSpan.Zero;

                    from.SendMessage("This corpse cannot be added yet, try again in {0} seconds.", ts.Seconds);
                    return false;
                }
                else return true;
            }
コード例 #13
0
        public override void OnCarve(Mobile from, Corpse corpse, Item with)
        {
            if (corpse.Carved)
                base.OnCarve(from, corpse, with);

            if (Utility.RandomDouble() < 0.15)
            {
                if (!from.CheckSkill(SkillName.Forensics, 30, 80))
                    from.SendMessage("Vous auriez gagné à mieux appréhender les cadavres");
                else
                {
                    corpse.DropItem(new ReptiledRelic());
                    from.SendMessage("Un pan de cuir se détache du ventre de la bête");
                }
            }
            base.OnCarve(from, corpse, with);
        }
コード例 #14
0
        public override void OnCarve(Mobile from, Corpse corpse, Item with)
        {
            if (corpse.Carved)
                base.OnCarve(from, corpse, with);

            if (Utility.RandomDouble() < 0.15)
            {
                if (!from.CheckSkill(SkillName.Forensics, 30, 80))
                    from.SendMessage("Vous auriez gagné à mieux appréhender les cadavres");
                else
                {
                    corpse.DropItem(new ElementalRelic());
                    from.SendMessage("L'élémental se crystallise");
                }
            }
            base.OnCarve(from, corpse, with);
        }
コード例 #15
0
ファイル: AncientLich.cs プロジェクト: greeduomacro/vivre-uo
        public override void OnCarve(Mobile from, Corpse corpse, Item with)
        {
            if (corpse.Carved)
                base.OnCarve(from, corpse, with);

            if (Utility.RandomDouble() < 0.15)
            {
                if (!from.CheckSkill(SkillName.Forensics, 30, 80))
                    from.SendMessage("Vous auriez gagné à mieux appréhender les cadavres");
                else
                {
                    corpse.DropItem(new UndeadRelic());
                    from.SendMessage("Vous arrachez un morceau de chair à la liche");
                }
            }
            base.OnCarve(from, corpse, with);
        }
コード例 #16
0
		public void AnimateCorpse( Corpse corp, Mobile caster )
		{
			if ( corp != null )
			{
				Corpse c = corp;
				
				Point3D p = c.GetWorldLocation();
				Map map = c.Map;

				if ( map != null )
				{
					Effects.PlaySound( p, map, 0x1FB );
					Effects.SendLocationParticles( EffectItem.Create( p, map, EffectItem.DefaultDuration ), 0x3789, 1, 40, 0x3F, 3, 9907, 0 );

					Timer.DelayCall( TimeSpan.FromSeconds( 2.0 ), new TimerStateCallback( SummonDelay_Callback ), new object[]{ caster, c, p, map } );
				}
			}
		}
コード例 #17
0
ファイル: Wisp.cs プロジェクト: greeduomacro/vivre-uo
        public override void OnCarve(Mobile from, Corpse corpse, Item with)
        {
            if (corpse.Carved)
                base.OnCarve(from, corpse, with);

            TransformContext context = TransformationSpellHelper.GetContext(from);
            if (context != null && context.Spell is NecromancerSpell && Utility.RandomDouble() < 0.3) 
			{
                corpse.DropItem(new GlowingOre(Utility.Random(2,3)));
                from.SendMessage("Le Wisp se fige à votre toucher");
            }
            else if (Utility.RandomDouble() < .1)
            {
                corpse.DropItem(new GlowingOre());
                from.SendMessage("Seulement une partie du wisp se fige. Vous ne deviez pas être assez effrayant...");
            }
            base.OnCarve(from, corpse, with);
        }
コード例 #18
0
ファイル: Packets.cs プロジェクト: Crome696/ServUO
		public CorpseEquip(Mobile beholder, Corpse beheld)
			: base(0x89)
		{
			var list = beheld.EquipItems;

			int count = list.Count;
			if (beheld.Hair != null && beheld.Hair.ItemID > 0)
			{
				count++;
			}
			if (beheld.FacialHair != null && beheld.FacialHair.ItemID > 0)
			{
				count++;
			}

			EnsureCapacity(8 + (count * 5));

			m_Stream.Write(beheld.Serial);

			for (int i = 0; i < list.Count; ++i)
			{
				Item item = list[i];

				if (!item.Deleted && beholder.CanSee(item) && item.Parent == beheld)
				{
					m_Stream.Write((byte)(item.Layer + 1));
					m_Stream.Write(item.Serial);
				}
			}

			if (beheld.Hair != null && beheld.Hair.ItemID > 0)
			{
				m_Stream.Write((byte)(Layer.Hair + 1));
				m_Stream.Write(HairInfo.FakeSerial(beheld.Owner) - 2);
			}

			if (beheld.FacialHair != null && beheld.FacialHair.ItemID > 0)
			{
				m_Stream.Write((byte)(Layer.FacialHair + 1));
				m_Stream.Write(FacialHairInfo.FakeSerial(beheld.Owner) - 2);
			}

			m_Stream.Write((byte)Layer.Invalid);
		}
コード例 #19
0
        public static void FinalEffect( Mobile caster, Corpse corpse, BaseCreature creature, XmlSpiritSummoning att )
        {
            int power = 1;

            if( creature.Fame > 5000 )
                power = creature.Fame / 5000;

            GenericWarrior summoned = new GenericWarrior();

            summoned.RawHits = 75 * power;
            summoned.Hits = summoned.RawHits;
            summoned.DamageMin = 15 + ( 2 * power );
            summoned.DamageMax = 20 + ( 2 * power );
            summoned.BodyValue = creature.BodyValue;
            summoned.BaseSoundID = 442;
            summoned.Hue = 12345678;
            summoned.Name = "A Summoned Spirit";

            if( summoned.BodyValue == 400 || summoned.BodyValue == 401 )
            {
                Club club = new Club();
                club.Hue = 12345678;
                summoned.EquipItem( club );
                summoned.EquipItem( new RaggedPants( 12345678 ) );
                summoned.EquipItem( new Shirt( 12345678 ) );
                summoned.HairItemID = creature.HairItemID;
                summoned.HairHue = 12345678;
                summoned.FacialHairItemID = creature.FacialHairItemID;
                summoned.FacialHairHue = 12345678;
                summoned.HasNoCorpse = true;
            }

            corpse.Channeled = true;
            Summon( caster, summoned, 30, 534, false );
            summoned.Location = corpse.Location;
            summoned.Emote( "*is summoned from the spirit realm to serve " + caster.Name + "*" );

            if( att != null )
            {
                att.NextUseAllowed = DateTime.Now + att.CoolDown;
                att.Summoned = summoned;
            }
        }
コード例 #20
0
ファイル: SilkWorm.cs プロジェクト: ITLongwell/aedilis2server
        public override void OnCarve(Mobile from, Corpse corpse)
        {
            if (corpse.Carved)
            {
                base.OnCarve(from, corpse);
            }
            else
            {
                if (Utility.Random(5) == 1)
                {
                    from.SendMessage("You dig through the worm goo and find some silk!");
                    corpse.DropItem(new WormSilk());
                }
                else
                {
                    from.SendMessage("You carve into the gooey worm corpse, but find nothing useful.");
                }

                corpse.Carved = true;
            }
        }
コード例 #21
0
ファイル: Objectives.cs プロジェクト: rokann/JustUO
        public override void ChildDeserialize(GenericReader reader)
        {
            var version = reader.ReadEncodedInt();

            switch (version)
            {
                case 1:
                {
                    m_CorpseLocation = reader.ReadPoint3D();
                    goto case 0;
                }
                case 0:
                {
                    Corpse = (Corpse) reader.ReadItem();
                    break;
                }
            }

            if (version == 0)
                m_CorpseLocation = RandomCorpseLocation();
        }
コード例 #22
0
ファイル: Packets.cs プロジェクト: zerodowned/angelisland
		public CorpseEquip( Mobile beholder, Corpse beheld ) : base( 0x89 )
		{
			ArrayList list = beheld.EquipItems;

			EnsureCapacity( 8 + (list.Count * 5) );

			m_Stream.Write( (int) beheld.Serial );

			for ( int i = 0; i < list.Count; ++i )
			{
				Item item = (Item)list[i];

				if ( !item.Deleted && beholder.CanSee( item ) && item.Parent == beheld )
				{
					m_Stream.Write( (byte) (item.Layer + 1) );
					m_Stream.Write( (int) item.Serial );
				}
			}

			m_Stream.Write( (byte) Layer.Invalid );
		}
コード例 #23
0
		public override void CheckProgress()
		{
			PlayerMobile player = System.From;
			Map map = player.Map;

			if ( ( m_Corpse == null || m_Corpse.Deleted ) && ( map == Map.Trammel || map == Map.Felucca ) && player.InRange( m_CorpseLocation, 8 ) )
			{
				m_Corpse = new HagApprenticeCorpse();
				m_Corpse.MoveToWorld( m_CorpseLocation, map );

				Effects.SendLocationEffect( m_CorpseLocation, map, 0x3728, 10, 10 );
				Effects.PlaySound( m_CorpseLocation, map, 0x1FE );

				Mobile imp = new Zeefzorpul();
				imp.MoveToWorld( m_CorpseLocation, map );

				// * You see a strange imp stealing a scrap of paper from the bloodied corpse *
				m_Corpse.SendLocalizedMessageTo( player, 1055049 );

				Timer.DelayCall( TimeSpan.FromSeconds( 3.0 ), new TimerStateCallback( DeleteImp ), imp );
			}
		}
コード例 #24
0
		protected virtual int GetProgress(ConquestState state, Corpse corpse)
		{
			if (corpse == null)
			{
				return 0;
			}

            if (state.User == null)
                return 0;

			if (Creature.IsNotNull && !corpse.Owner.TypeEquals(Creature, Children))
			{
				if (ChangeCreatureReset)
				{
					return -state.Progress;
				}

				return 0;
			}

			return 1;
		}
コード例 #25
0
 public InternalTimer(Corpse c, TimeSpan delay)
     : base(delay)
 {
     m_Corpse = c;
     Priority = TimerPriority.FiveSeconds;
 }
コード例 #26
0
 public ReviveTimer(Mobile from, Corpse corpse, Mobile Ghost) : base(TimeSpan.FromSeconds(8))
 {
     m_Healer = from;
     m_Ghost  = Ghost;
     m_Corpse = corpse;
 }
コード例 #27
0
            protected override void OnTarget(Mobile from, object target)
            {
                PlayerMobile pm = (PlayerMobile)from;

                if (target is Corpse)
                {
                    Corpse  corpse = target as Corpse;
                    Point3D loc    = corpse.Location;
                    Map     map    = corpse.Map;

                    if (corpse.Owner.Player == true && m_Bury.CanBuryPlayers == false)
                    {
                        pm.SendMessage(" You cannot bury player corpses.");
                    }

                    else
                    #region map

                    {
                        Tile lt = map.Tiles.GetLandTile(from.X, from.Y);

                        if (IsDirt(lt.ID))
                        {
                            Grave grave = new Grave();
                            from.SendMessage("You bury the creature. Your deity rewards you with some karma.");
                            from.Karma += Utility.Random(1, 10); // customize what you want to give
                            from.Stam  -= 2;

                            if (from.Luck >= 10)
                            {
                                switch (Utility.Random(100))
                                {
                                case 1:
                                {
                                    from.AddToBackpack(new Gold()); // customize what you want to give
                                    from.PlaySound(0x2E6);          // drop gold sound
                                    from.SendMessage("You are lucky and find a coin in the ground.");
                                    break;
                                }

                                case 2:
                                {
                                    from.AddToBackpack(new FertileDirt(Utility.Random(1, 2)));        // customize what you want to give
                                    from.SendMessage("This is very fertile ground.You decide to take some of it.");
                                    break;
                                }

                                case 3:
                                {
                                    from.AddToBackpack(new Spoon());        // customize what you want to give
                                    from.SendMessage("You found an old spoon in the ground.");
                                    break;
                                }

                                default: break;
                                }
                            }

                            grave.MoveToWorld(loc, map);
                            corpse.Delete();

                            ItemRemovalTimer2 thisTimer = new ItemRemovalTimer2(grave);
                            thisTimer.Start();
                        }

                        if (IsSand(lt.ID))
                        {
                            //Grave grave = new Grave();
                            from.SendMessage("You bury the creature in the sand. Your deity rewards you with some karma.");
                            from.Karma += Utility.Random(1, 10); // customize what you want to give
                            from.Stam  -= 2;

                            if (from.Luck >= 10)
                            {
                                switch (Utility.Random(100))
                                {
                                case 1:
                                {
                                    from.AddToBackpack(new Gold()); // customize what you want to give
                                    from.PlaySound(0x2E6);          // drop gold sound
                                    from.SendMessage("You are lucky and find a coin in the sand.");
                                    break;
                                }

                                case 2:
                                {
                                    from.AddToBackpack(new Diamond());        // customize what you want to give
                                    from.SendMessage("You found a diamond in the sand!");
                                    break;
                                }

                                default: break;
                                }
                            }
                            corpse.Delete();
                        }
                        #endregion

                        #region static
                        // is it a static swamp?

                        Tile[] tiles = map.Tiles.GetStaticTiles(from.X, from.Y);

                        for (int i = 0; i < tiles.Length; ++i)
                        {
                            Tile     t  = tiles[i];
                            ItemData id = TileData.ItemTable[t.ID & 0x3FFF];

                            int tand = t.ID & 0x3FFF;

                            if (t.Z != from.Z)
                            {
                                continue;
                            }
                            else if (IsStaticDirt(tand))
                            {
                                Grave grave = new Grave();
                                from.SendMessage("You bury the creature. Your deity rewards you with some karma.");
                                from.Karma += Utility.Random(1, 10); // customize what you want to give
                                from.Stam  -= 2;

                                if (from.Luck >= 10)
                                {
                                    switch (Utility.Random(100))
                                    {
                                    case 1:
                                    {
                                        from.AddToBackpack(new Gold()); // customize what you want to give
                                        from.PlaySound(0x2E6);          // drop gold sound
                                        from.SendMessage("You are lucky and find a coin in the ground.");
                                        break;
                                    }

                                    case 2:
                                    {
                                        from.AddToBackpack(new FertileDirt(Utility.Random(1, 2)));        // customize what you want to give
                                        from.SendMessage("This is very fertile ground.You decide to take some of it.");
                                        break;
                                    }

                                    case 3:
                                    {
                                        from.AddToBackpack(new Spoon());        // customize what you want to give
                                        from.SendMessage("You found an old spoon in the ground.");
                                        break;
                                    }

                                    default: break;
                                    }
                                }

                                grave.MoveToWorld(loc, map);
                                corpse.Delete();

                                ItemRemovalTimer2 thisTimer = new ItemRemovalTimer2(grave);
                                thisTimer.Start();
                            }


                            else if (IsStaticSand(tand))
                            {
                                from.SendMessage("You bury the creature in the sand. Your deity rewards you with some karma.");
                                from.Karma += Utility.Random(1, 10); // customize what you want to give
                                from.Stam  -= 2;

                                if (from.Luck >= 10)
                                {
                                    switch (Utility.Random(100))
                                    {
                                    case 1:
                                    {
                                        from.AddToBackpack(new Gold()); // customize what you want to give
                                        from.PlaySound(0x2E6);          // drop gold sound
                                        from.SendMessage("You are lucky and find a coin in the sand.");
                                        break;
                                    }

                                    case 2:
                                    {
                                        from.AddToBackpack(new Diamond());        // customize what you want to give
                                        from.SendMessage("You found a diamond in the sand!");
                                        break;
                                    }

                                    default: break;
                                    }
                                }
                            }
                            else
                            {
                                from.SendMessage("You can't bury this here.");
                            }
                        }
                    }
                    #endregion
                }

                else
                {
                    from.SendMessage("You may only use this to bury corpses.");
                }
                return;
            }
コード例 #28
0
ファイル: Corpse.cs プロジェクト: nogu3ira/xrunuo
 public InternalTimer(Corpse c, TimeSpan delay)
     : base(delay)
 {
     m_Corpse = c;
 }
コード例 #29
0
            protected override void OnTarget(Mobile from, object target)
            {
                if (target is Corpse)
                {
                    Corpse c = (Corpse)target;
                    if (c.Owner is BaseCreature)
                    {
                        if (c.Carved == false)
                        {
                            Map map = from.Map;
                            if (map == null)
                            {
                                return;
                            }
                            int hides = (int)(((BaseCreature)c.Owner).Hides * 1.2);

                            if (m_Knife != null)
                            {
                                if (((BaseCreature)c.Owner).HideType == HideType.Regular)
                                {
                                    c.DropItem(new Hides(hides));
                                }
                                else if (((BaseCreature)c.Owner).HideType == HideType.Spined)
                                {
                                    c.DropItem(new SpinedHides(hides));
                                }
                                else if (((BaseCreature)c.Owner).HideType == HideType.Horned)
                                {
                                    c.DropItem(new HornedHides(hides));
                                }
                                else if (((BaseCreature)c.Owner).HideType == HideType.Barbed)
                                {
                                    c.DropItem(new BarbedHides(hides));
                                }
                                else if (((BaseCreature)c.Owner).HideType == HideType.Polar)
                                {
                                    c.DropItem(new PolarHides(hides));
                                }
                                else if (((BaseCreature)c.Owner).HideType == HideType.Synthetic)
                                {
                                    c.DropItem(new SyntheticHides(hides));
                                }
                                else if (((BaseCreature)c.Owner).HideType == HideType.BlazeL)
                                {
                                    c.DropItem(new BlazeHides(hides));
                                }
                                else if (((BaseCreature)c.Owner).HideType == HideType.Daemonic)
                                {
                                    c.DropItem(new DaemonicHides(hides));
                                }
                                else if (((BaseCreature)c.Owner).HideType == HideType.Shadow)
                                {
                                    c.DropItem(new ShadowHides(hides));
                                }
                                else if (((BaseCreature)c.Owner).HideType == HideType.Frost)
                                {
                                    c.DropItem(new FrostHides(hides));
                                }
                                else if (((BaseCreature)c.Owner).HideType == HideType.Ethereal)
                                {
                                    c.DropItem(new EtherealHides(hides));
                                }
                                c.Carved = true;

                                if (m_Knife.UsesRemaining > 1)
                                {
                                    m_Knife.UsesRemaining--;
                                }
                                else
                                {
                                    m_Knife.Delete();
                                    from.SendMessage("You used up your masters knife");
                                }
                            }
                        }
                        else
                        {
                            from.SendMessage("You see nothing useful to carve from the corpse.");
                        }
                    }
                }
            }
コード例 #30
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Stake.Deleted)
                {
                    return;
                }

                object obj = targeted;

                if (obj is Corpse)
                {
                    Corpse c = (Corpse)targeted;

                    if (c.VisitedByTaxidermist == true)
                    {
                        from.SendMessage("You don't need to do that!");
                        return;
                    }
                    else
                    {
                        int score = 0;

                        if (typeof(VampireWoods) == c.Owner.GetType())
                        {
                            score = 10;
                        }
                        else if (typeof(Vampire) == c.Owner.GetType())
                        {
                            score = 20;
                        }
                        else if (typeof(VampireLord) == c.Owner.GetType())
                        {
                            score = 40;
                        }
                        else if (typeof(VampirePrince) == c.Owner.GetType())
                        {
                            score = 60;
                        }
                        else if (typeof(Dracula) == c.Owner.GetType())
                        {
                            score = 400;
                        }
                        else if (typeof(VampiricDragon) == c.Owner.GetType())
                        {
                            score = 500;
                        }

                        if (score > 0)
                        {
                            m_Stake.VampiresSlain = m_Stake.VampiresSlain + score;
                            if (m_Stake.VampiresSlain > 10000)
                            {
                                m_Stake.VampiresSlain = 10000;
                            }
                            from.SendMessage("Vampire Reward: " + m_Stake.VampiresSlain + " Gold!");
                            c.VisitedByTaxidermist = true;
                            from.PlaySound(0x13E);
                        }
                        else
                        {
                            from.SendMessage("You don't need to do that!");
                            return;
                        }
                    }
                }
                else
                {
                    from.SendMessage("You don't need to do that!");
                    return;
                }
            }
コード例 #31
0
ファイル: BaseCreature.cs プロジェクト: greeduomacro/uotitan
		public virtual void OnCarve( Mobile from, Corpse corpse, Item with )
		{
			int feathers = Feathers;
			int wool = Wool;
			int meat = Meat;
			int hides = Hides;
			int scales = Scales;

			if ( (feathers == 0 && wool == 0 && meat == 0 && hides == 0 && scales == 0) || Summoned || IsBonded || corpse.Animated )
			{
				if ( corpse.Animated ) 
					corpse.SendLocalizedMessageTo( from, 500464 );	// Use this on corpses to carve away meat and hide
				else
				from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
			}
			else
			{
				if( Core.ML && from.Race == Race.Human )
				{
					hides = (int)Math.Ceiling( hides * 1.1 );	//10% Bonus Only applies to Hides, Ore & Logs
				}

				if ( corpse.Map == Map.Felucca )
				{
					feathers *= 2;
					wool *= 2;
					hides *= 2;

					if (Core.ML)
					{
						meat *= 2;
						scales *= 2;
					}
				}

				new Blood( 0x122D ).MoveToWorld( corpse.Location, corpse.Map );

				if ( feathers != 0 )
				{
					corpse.AddCarvedItem( new Feather( feathers ), from );
					from.SendLocalizedMessage( 500479 ); // You pluck the bird. The feathers are now on the corpse.
				}

				if ( wool != 0 )
				{
					corpse.AddCarvedItem( new TaintedWool( wool ), from );
					from.SendLocalizedMessage( 500483 ); // You shear it, and the wool is now on the corpse.
				}

				if ( meat != 0 )
				{
					if ( MeatType == MeatType.Ribs )
						corpse.AddCarvedItem( new RawRibs( meat ), from );
					else if ( MeatType == MeatType.Bird )
						corpse.AddCarvedItem( new RawBird( meat ), from );
					else if ( MeatType == MeatType.LambLeg )
						corpse.AddCarvedItem( new RawLambLeg( meat ), from );

					from.SendLocalizedMessage( 500467 ); // You carve some meat, which remains on the corpse.
				}

				if ( hides != 0 )
				{
					Item holding = from.Weapon as Item;
					if ( Core.AOS && ( holding is SkinningKnife /* TODO: || holding is ButcherWarCleaver || with is ButcherWarCleaver */ ) )
					{
						Item leather = null;

						switch ( HideType )
						{
							case HideType.Regular: leather = new Leather( hides ); break;
							case HideType.Spined: leather = new SpinedLeather( hides ); break;
							case HideType.Horned: leather = new HornedLeather( hides ); break;
							case HideType.Barbed: leather = new BarbedLeather( hides ); break;
						}

						if ( leather != null )
						{
							if ( !from.PlaceInBackpack( leather ) )
							{
								corpse.DropItem( leather );
								from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse.
							}
							else
								from.SendLocalizedMessage( 1073555 ); // You skin it and place the cut-up hides in your backpack.
						}
					}
					else
					{
						if ( HideType == HideType.Regular )
							corpse.DropItem( new Hides( hides ) );
						else if ( HideType == HideType.Spined )
							corpse.DropItem( new SpinedHides( hides ) );
						else if ( HideType == HideType.Horned )
							corpse.DropItem( new HornedHides( hides ) );
						else if ( HideType == HideType.Barbed )
							corpse.DropItem( new BarbedHides( hides ) );

						from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse.
					}
				}

				if ( scales != 0 )
				{
					ScaleType sc = this.ScaleType;

					switch ( sc )
					{
						case ScaleType.Red:     corpse.AddCarvedItem( new RedScales( scales ), from ); break;
						case ScaleType.Yellow:  corpse.AddCarvedItem( new YellowScales( scales ), from ); break;
						case ScaleType.Black:   corpse.AddCarvedItem( new BlackScales( scales ), from ); break;
						case ScaleType.Green:   corpse.AddCarvedItem( new GreenScales( scales ), from ); break;
						case ScaleType.White:   corpse.AddCarvedItem( new WhiteScales( scales ), from ); break;
						case ScaleType.Blue:    corpse.AddCarvedItem( new BlueScales( scales ), from ); break;
						case ScaleType.All:
						{
							corpse.AddCarvedItem( new RedScales( scales ), from );
							corpse.AddCarvedItem( new YellowScales( scales ), from );
							corpse.AddCarvedItem( new BlackScales( scales ), from );
							corpse.AddCarvedItem( new GreenScales( scales ), from );
							corpse.AddCarvedItem( new WhiteScales( scales ), from );
							corpse.AddCarvedItem( new BlueScales( scales ), from );
							break;
						}
					}

					from.SendMessage( "You cut away some scales, but they remain on the corpse." );
				}

				corpse.Carved = true;

				if ( corpse.IsCriminalAction( from ) )
					from.CriminalAction( true );
			}
		}
コード例 #32
0
        public static Container Mobile_CreateCorpseHandler(
            Mobile owner, HairInfo hair, FacialHairInfo facialhair, List <Item> initialContent, List <Item> equipItems)
        {
            bool shouldFillCorpse = true;

            //if ( owner is BaseCreature )
            //	shouldFillCorpse = !((BaseCreature)owner).IsBonded;

            Corpse c;

            if (owner is MilitiaFighter)
            {
                c = new MilitiaFighterCorpse(owner, hair, facialhair, shouldFillCorpse ? equipItems : new List <Item>());
            }
            else
            {
                c = new Corpse(owner, hair, facialhair, shouldFillCorpse ? equipItems : new List <Item>());
            }

            owner.Corpse = c;

            if (shouldFillCorpse)
            {
                for (int i = 0; i < initialContent.Count; ++i)
                {
                    Item item = initialContent[i];

                    if (Core.AOS && owner.Player && item.Parent == owner.Backpack)
                    {
                        c.AddItem(item);
                    }
                    else
                    {
                        c.DropItem(item);
                    }

                    if (owner.Player && Core.AOS)
                    {
                        c.SetRestoreInfo(item, item.Location);
                    }
                }

                if (!owner.Player)
                {
                    c.AssignInstancedLoot();
                }
                else if (Core.AOS)
                {
                    PlayerMobile pm = owner as PlayerMobile;

                    if (pm != null)
                    {
                        c.RestoreEquip = pm.EquipSnapshot;
                    }
                }
            }
            else
            {
                c.Carved = true;                 // TODO: Is it needed?
            }

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

            if (map == null || map == Map.Internal)
            {
                loc = owner.LogoutLocation;
                map = owner.LogoutMap;
            }

            c.MoveToWorld(loc, map);

            return(c);
        }
コード例 #33
0
ファイル: Algazars.cs プロジェクト: FreeReign/imaginenation
        public override void OnCarve(Mobile from, Corpse corpse, Item item)
        {
            corpse.DropItem(new DaemonHeart());
            base.OnCarve(from, corpse, item);

        } 
コード例 #34
0
        public static Container Mobile_CreateCorpseHandler(Mobile owner, ArrayList initialContent, ArrayList equipItems)
        {
            bool shouldFillCorpse = true;

            //if ( owner is BaseCreature )
            //	shouldFillCorpse = !((BaseCreature)owner).IsBonded;

            Corpse c;

            if (owner is MilitiaFighter)
            {
                c = new MilitiaFighterCorpse(owner, shouldFillCorpse ? equipItems : new ArrayList());
            }
            else
            {
                c = new Corpse(owner, shouldFillCorpse ? equipItems : new ArrayList());
            }

            owner.Corpse = c;
            if (owner is BaseCreature)
            {
                c.ShiftType = (TransformGroup)TAVShiftUtilities.GetTransformGroup((BaseCreature)owner);
            }

            if (shouldFillCorpse)
            {
                for (int i = 0; i < initialContent.Count; ++i)
                {
                    Item item = (Item)initialContent[i];

                    if (Core.AOS && owner.Player && item.Parent == owner.Backpack)
                    {
                        c.AddItem(item);
                    }
                    else
                    {
                        c.DropItem(item);
                    }

                    if (owner.Player && Core.AOS)
                    {
                        c.SetRestoreInfo(item, item.Location);
                    }
                }
            }
            else
            {
                c.Carved = true; // TODO: Is it needed?
            }

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

            if (map == null || map == Map.Internal)
            {
                loc = owner.LogoutLocation;
                map = owner.LogoutMap;
            }

            c.MoveToWorld(loc, map);
            c.CheckRaise();
            return(c);
        }
コード例 #35
0
ファイル: Corpse.cs プロジェクト: jicomub/Temrael
 public AmeEatingEntry(PlayerMobile from, Corpse corpse)
     : base(6215, 2)
 {
     m_from   = from;
     m_corpse = corpse;
 }
コード例 #36
0
ファイル: Notoriety.cs プロジェクト: suiy187/runuocustom
		public static int CorpseNotoriety( Mobile source, Corpse target )
		{
			if( target.AccessLevel > AccessLevel.Player )
				return Notoriety.CanBeAttacked;

			Body body = (Body)target.Amount;

			BaseCreature cretOwner = target.Owner as BaseCreature;

			if( cretOwner != null )
			{
				Guild sourceGuild = GetGuildFor( source.Guild as Guild, source );
				Guild targetGuild = GetGuildFor( target.Guild as Guild, target.Owner );

				if( sourceGuild != null && targetGuild != null )
				{
					if( sourceGuild == targetGuild || sourceGuild.IsAlly( targetGuild ) )
						return Notoriety.Ally;
					else if( sourceGuild.IsEnemy( targetGuild ) )
						return Notoriety.Enemy;
				}

				Faction srcFaction = Faction.Find( source, true, true );
				Faction trgFaction = Faction.Find( target.Owner, true, true );

				if( srcFaction != null && trgFaction != null && srcFaction != trgFaction && source.Map == Faction.Facet )
					return Notoriety.Enemy;

				if( CheckHouseFlag( source, target.Owner, target.Location, target.Map ) )
					return Notoriety.CanBeAttacked;

				int actual = Notoriety.CanBeAttacked;

				if( target.Kills >= 5 || (body.IsMonster && IsSummoned( target.Owner as BaseCreature )) || (target.Owner is BaseCreature && (((BaseCreature)target.Owner).AlwaysMurderer || ((BaseCreature)target.Owner).IsAnimatedDead)) )
					actual = Notoriety.Murderer;

				if( DateTime.Now >= (target.TimeOfDeath + Corpse.MonsterLootRightSacrifice) )
					return actual;

				Party sourceParty = Party.Get( source );

				List<Mobile> list = target.Aggressors;

				for( int i = 0; i < list.Count; ++i )
				{
					if( list[i] == source || (sourceParty != null && Party.Get( list[i] ) == sourceParty) )
						return actual;
				}

				return Notoriety.Innocent;
			}
			else
			{
				if( target.Kills >= 5 || (body.IsMonster && IsSummoned( target.Owner as BaseCreature )) || (target.Owner is BaseCreature && (((BaseCreature)target.Owner).AlwaysMurderer || ((BaseCreature)target.Owner).IsAnimatedDead)) )
					return Notoriety.Murderer;

				if (target.Criminal && target.Map != null && ((target.Map.Rules & MapRules.HarmfulRestrictions) == 0))
					return Notoriety.Criminal;

				Guild sourceGuild = GetGuildFor( source.Guild as Guild, source );
				Guild targetGuild = GetGuildFor( target.Guild as Guild, target.Owner );

				if( sourceGuild != null && targetGuild != null )
				{
					if( sourceGuild == targetGuild || sourceGuild.IsAlly( targetGuild ) )
						return Notoriety.Ally;
					else if( sourceGuild.IsEnemy( targetGuild ) )
						return Notoriety.Enemy;
				}

				Faction srcFaction = Faction.Find( source, true, true );
				Faction trgFaction = Faction.Find( target.Owner, true, true );

				if( srcFaction != null && trgFaction != null && srcFaction != trgFaction && source.Map == Faction.Facet )
				{
					List<Mobile> secondList = target.Aggressors;

					for( int i = 0; i < secondList.Count; ++i )
					{
						if( secondList[i] == source || secondList[i] is BaseFactionGuard )
							return Notoriety.Enemy;
					}
				}

				if( target.Owner != null && target.Owner is BaseCreature && ((BaseCreature)target.Owner).AlwaysAttackable )
					return Notoriety.CanBeAttacked;

				if( CheckHouseFlag( source, target.Owner, target.Location, target.Map ) )
					return Notoriety.CanBeAttacked;

				if( !(target.Owner is PlayerMobile) && !IsPet( target.Owner as BaseCreature ) )
					return Notoriety.CanBeAttacked;

				List<Mobile> list = target.Aggressors;

				for( int i = 0; i < list.Count; ++i )
				{
					if( list[i] == source )
						return Notoriety.CanBeAttacked;
				}

				return Notoriety.Innocent;
			}
		}
コード例 #37
0
            protected override void OnTarget(Mobile from, object target)
            {
                if (target is Corpse)
                {
                    Corpse c = (Corpse)target;
                    if (c.Owner is BaseCreature)
                    {
                        if (c.Carved == false && ((BaseCreature)c.Owner).Hides != 0)
                        {
                            Map map = from.Map;
                            if (map == null)
                            {
                                return;
                            }
                            BaseCreature spawned = null;
                            if (((BaseCreature)c.Owner).HideType == HideType.Regular)
                            {
                                if (0.1 > Utility.RandomDouble())
                                {
                                    switch (Utility.Random(4))
                                    {
                                    case 0: spawned = new Elementals(102); break;

                                    case 1: spawned = new Elementals(103); break;

                                    case 2: spawned = new Elementals(104); break;

                                    case 3: spawned = new Elementals(105); break;
                                    }
                                }
                                switch (Utility.Random(4))
                                {
                                case 0: c.AddItem(new SpinedHides(((BaseCreature)c.Owner).Hides)); break;

                                case 1: c.AddItem(new HornedHides(((BaseCreature)c.Owner).Hides)); break;

                                case 2: c.AddItem(new BarbedHides(((BaseCreature)c.Owner).Hides)); break;

                                case 3: c.AddItem(new PolarHides(((BaseCreature)c.Owner).Hides)); break;
                                }
                            }
                            else if (((BaseCreature)c.Owner).HideType == HideType.Spined)
                            {
                                if (0.1 > Utility.RandomDouble())
                                {
                                    switch (Utility.Random(5))
                                    {
                                    case 0: spawned = new Elementals(103); break;

                                    case 1: spawned = new Elementals(104); break;

                                    case 2: spawned = new Elementals(105); break;

                                    case 3: spawned = new Elementals(106); break;

                                    case 4: spawned = new Elementals(107); break;
                                    }
                                }
                                switch (Utility.Random(5))
                                {
                                case 0: c.AddItem(new HornedHides(((BaseCreature)c.Owner).Hides)); break;

                                case 1: c.AddItem(new BarbedHides(((BaseCreature)c.Owner).Hides)); break;

                                case 2: c.AddItem(new PolarHides(((BaseCreature)c.Owner).Hides)); break;

                                case 3: c.AddItem(new SyntheticHides(((BaseCreature)c.Owner).Hides)); break;

                                case 4: c.AddItem(new BlazeHides(((BaseCreature)c.Owner).Hides)); break;
                                }
                            }
                            else if (((BaseCreature)c.Owner).HideType == HideType.Horned)
                            {
                                if (0.1 > Utility.RandomDouble())
                                {
                                    switch (Utility.Random(6))
                                    {
                                    case 0: spawned = new Elementals(104); break;

                                    case 1: spawned = new Elementals(105); break;

                                    case 2: spawned = new Elementals(106); break;

                                    case 3: spawned = new Elementals(107); break;

                                    case 4: spawned = new Elementals(108); break;

                                    case 5: spawned = new Elementals(109); break;
                                    }
                                }
                                switch (Utility.Random(6))
                                {
                                case 0: c.AddItem(new BarbedHides(((BaseCreature)c.Owner).Hides)); break;

                                case 1: c.AddItem(new PolarHides(((BaseCreature)c.Owner).Hides)); break;

                                case 2: c.AddItem(new SyntheticHides(((BaseCreature)c.Owner).Hides)); break;

                                case 3: c.AddItem(new BlazeHides(((BaseCreature)c.Owner).Hides)); break;

                                case 4: c.AddItem(new DaemonicHides(((BaseCreature)c.Owner).Hides)); break;

                                case 5: c.AddItem(new ShadowHides(((BaseCreature)c.Owner).Hides)); break;
                                }
                            }
                            else if (((BaseCreature)c.Owner).HideType == HideType.Barbed)
                            {
                                if (0.1 > Utility.RandomDouble())
                                {
                                    switch (Utility.Random(7))
                                    {
                                    case 0: spawned = new Elementals(105); break;

                                    case 1: spawned = new Elementals(106); break;

                                    case 2: spawned = new Elementals(107); break;

                                    case 3: spawned = new Elementals(108); break;

                                    case 4: spawned = new Elementals(109); break;

                                    case 5: spawned = new Elementals(110); break;

                                    case 6: spawned = new Elementals(111); break;
                                    }
                                }
                                switch (Utility.Random(7))
                                {
                                case 0: c.AddItem(new PolarHides(((BaseCreature)c.Owner).Hides)); break;

                                case 1: c.AddItem(new SyntheticHides(((BaseCreature)c.Owner).Hides)); break;

                                case 2: c.AddItem(new BlazeHides(((BaseCreature)c.Owner).Hides)); break;

                                case 3: c.AddItem(new DaemonicHides(((BaseCreature)c.Owner).Hides)); break;

                                case 4: c.AddItem(new ShadowHides(((BaseCreature)c.Owner).Hides)); break;

                                case 5: c.AddItem(new FrostHides(((BaseCreature)c.Owner).Hides)); break;

                                case 6: c.AddItem(new EtherealHides(((BaseCreature)c.Owner).Hides)); break;
                                }
                            }
                            else if (((BaseCreature)c.Owner).HideType == HideType.Polar)
                            {
                                if (0.1 > Utility.RandomDouble())
                                {
                                    switch (Utility.Random(6))
                                    {
                                    case 0: spawned = new Elementals(106); break;

                                    case 1: spawned = new Elementals(107); break;

                                    case 2: spawned = new Elementals(108); break;

                                    case 3: spawned = new Elementals(109); break;

                                    case 4: spawned = new Elementals(110); break;

                                    case 5: spawned = new Elementals(111); break;
                                    }
                                }
                                switch (Utility.Random(6))
                                {
                                case 0: c.AddItem(new SyntheticHides(((BaseCreature)c.Owner).Hides)); break;

                                case 1: c.AddItem(new BlazeHides(((BaseCreature)c.Owner).Hides)); break;

                                case 2: c.AddItem(new DaemonicHides(((BaseCreature)c.Owner).Hides)); break;

                                case 3: c.AddItem(new ShadowHides(((BaseCreature)c.Owner).Hides)); break;

                                case 4: c.AddItem(new FrostHides(((BaseCreature)c.Owner).Hides)); break;

                                case 5: c.AddItem(new EtherealHides(((BaseCreature)c.Owner).Hides)); break;
                                }
                            }
                            else if (((BaseCreature)c.Owner).HideType == HideType.Synthetic)
                            {
                                if (0.1 > Utility.RandomDouble())
                                {
                                    switch (Utility.Random(5))
                                    {
                                    case 0: spawned = new Elementals(107); break;

                                    case 1: spawned = new Elementals(108); break;

                                    case 2: spawned = new Elementals(109); break;

                                    case 3: spawned = new Elementals(110); break;

                                    case 4: spawned = new Elementals(111); break;
                                    }
                                }
                                switch (Utility.Random(5))
                                {
                                case 0: c.AddItem(new BlazeHides(((BaseCreature)c.Owner).Hides)); break;

                                case 1: c.AddItem(new DaemonicHides(((BaseCreature)c.Owner).Hides)); break;

                                case 2: c.AddItem(new ShadowHides(((BaseCreature)c.Owner).Hides)); break;

                                case 3: c.AddItem(new FrostHides(((BaseCreature)c.Owner).Hides)); break;

                                case 4: c.AddItem(new EtherealHides(((BaseCreature)c.Owner).Hides)); break;
                                }
                            }
                            else if (((BaseCreature)c.Owner).HideType == HideType.BlazeL)
                            {
                                if (0.1 > Utility.RandomDouble())
                                {
                                    switch (Utility.Random(4))
                                    {
                                    case 0: spawned = new Elementals(108); break;

                                    case 1: spawned = new Elementals(109); break;

                                    case 2: spawned = new Elementals(110); break;

                                    case 3: spawned = new Elementals(111); break;
                                    }
                                }
                                switch (Utility.Random(4))
                                {
                                case 0: c.AddItem(new DaemonicHides(((BaseCreature)c.Owner).Hides)); break;

                                case 1: c.AddItem(new ShadowHides(((BaseCreature)c.Owner).Hides)); break;

                                case 2: c.AddItem(new FrostHides(((BaseCreature)c.Owner).Hides)); break;

                                case 3: c.AddItem(new EtherealHides(((BaseCreature)c.Owner).Hides)); break;
                                }
                            }
                            else if (((BaseCreature)c.Owner).HideType == HideType.Daemonic)
                            {
                                if (0.1 > Utility.RandomDouble())
                                {
                                    switch (Utility.Random(3))
                                    {
                                    case 0: spawned = new Elementals(109); break;

                                    case 1: spawned = new Elementals(110); break;

                                    case 2: spawned = new Elementals(111); break;
                                    }
                                }
                                switch (Utility.Random(3))
                                {
                                case 0: c.AddItem(new ShadowHides(((BaseCreature)c.Owner).Hides)); break;

                                case 1: c.AddItem(new FrostHides(((BaseCreature)c.Owner).Hides)); break;

                                case 2: c.AddItem(new EtherealHides(((BaseCreature)c.Owner).Hides)); break;
                                }
                            }
                            else if (((BaseCreature)c.Owner).HideType == HideType.Shadow)
                            {
                                if (0.1 > Utility.RandomDouble())
                                {
                                    switch (Utility.Random(2))
                                    {
                                    case 0: spawned = new Elementals(110); break;

                                    case 1: spawned = new Elementals(111); break;
                                    }
                                }
                                switch (Utility.Random(2))
                                {
                                case 0: c.AddItem(new FrostHides(((BaseCreature)c.Owner).Hides)); break;

                                case 1: c.AddItem(new EtherealHides(((BaseCreature)c.Owner).Hides)); break;
                                }
                            }
                            else if (((BaseCreature)c.Owner).HideType >= HideType.Frost)
                            {
                                if (0.1 > Utility.RandomDouble())
                                {
                                    spawned = new Elementals(111);
                                }
                                c.AddItem(new EtherealHides(((BaseCreature)c.Owner).Hides));
                            }
                            else
                            {
                                from.SendMessage("You can't use gargoyles knife on that.");
                                from.PlaySound(1066);                                 //play giggle sound
                                return;
                            }
                            c.Carved = true;
                            if (m_Knife != null)
                            {
                                if (m_Knife.UsesRemaining > 1)
                                {
                                    m_Knife.UsesRemaining--;
                                }
                                else
                                {
                                    m_Knife.Delete();
                                    from.SendMessage("You used up your gargoyles knife");
                                }
                            }
                            if (spawned != null)
                            {
                                from.SendMessage("When you used your gargoyles knife on the corpse a leather elemental came to defend it.");
                                from.PlaySound(1098);                                 //play m_yell

                                int offset = Utility.Random(8) * 2;
                                for (int i = 0; i < m_Offsets.Length; i += 2)
                                {
                                    int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
                                    int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
                                    if (map.CanSpawnMobile(x, y, from.Z))
                                    {
                                        spawned.MoveToWorld(new Point3D(x, y, from.Z), map);
                                        spawned.Combatant = from;
                                        return;
                                    }
                                    else
                                    {
                                        int z = map.GetAverageZ(x, y);

                                        if (map.CanSpawnMobile(x, y, z))
                                        {
                                            spawned.MoveToWorld(new Point3D(x, y, z), map);
                                            spawned.Combatant = from;
                                            return;
                                        }
                                    }
                                }
                                try
                                {
                                    spawned.MoveToWorld(from.Location, from.Map);
                                    spawned.Combatant = from;
                                }
                                catch
                                {
                                }
                            }
                            else
                            {
                                from.SendMessage("Nothing happened when you used your gargoyles knife on the corpse.");
                                if (from.BodyValue == 401)
                                {
                                    from.PlaySound(787);                                     // play f_cry
                                }
                                else if (from.BodyValue == 400)
                                {
                                    from.PlaySound(1058);                                     //play m_cry
                                }
                            }
                        }
                        else
                        {
                            from.SendMessage("You see nothing useful to carve from the corpse.");
                        }
                    }
                }
            }
コード例 #38
0
        public void TryEndSummon(Mobile m, List <Corpse> corpses)
        {
            if (_Timers.ContainsKey(m))
            {
                _Timers.Remove(m);
            }

            if (corpses == null || corpses.Count == 0)
            {
                m.SendLocalizedMessage(1071511); // The staff glows slightly, then fades. Its magic is unable to locate a corpse of yours to recover.
                return;
            }

            bool tooFar         = false;
            bool notEnoughTime  = false;
            bool tooManySummons = false;
            bool success        = true;

            if (_SummonAll)
            {
                List <Corpse> copy = new List <Corpse>(corpses);

                foreach (Corpse c in copy)
                {
                    bool remove = false;

                    if (c.Map != m.Map)
                    {
                        remove = true;
                        tooFar = true;
                    }

                    if (c.Killer is PlayerMobile && c.Killer != m && c.TimeOfDeath + TimeSpan.FromSeconds(180) > DateTime.UtcNow)
                    {
                        remove        = true;
                        notEnoughTime = true;
                    }

                    if (Corpse.PlayerCorpses.ContainsKey(c) && Corpse.PlayerCorpses[c] >= 3)
                    {
                        remove         = true;
                        tooManySummons = true;
                    }

                    if (remove)
                    {
                        corpses.Remove(c);
                    }
                }

                if (corpses.Count == 0)
                {
                    success = false;
                }
            }
            else
            {
                Corpse c = corpses[0];

                if (c.Map != m.Map)
                {
                    tooFar = true;
                }

                if (c.Killer is PlayerMobile && c.Killer != m && c.TimeOfDeath + TimeSpan.FromSeconds(180) > DateTime.UtcNow)
                {
                    notEnoughTime = true;
                }

                if (Corpse.PlayerCorpses != null && Corpse.PlayerCorpses.ContainsKey(c) && Corpse.PlayerCorpses[c] >= 3)
                {
                    tooManySummons = true;
                }

                if (tooFar || notEnoughTime || tooManySummons)
                {
                    if (tooFar)
                    {
                        m.SendLocalizedMessage(1071512); // ...but the corpse is too far away!
                    }
                    else if (notEnoughTime)
                    {
                        m.SendLocalizedMessage(1071515); // ...but not enough time has passed since you were slain in battle!
                    }
                    else
                    {
                        m.SendLocalizedMessage(1071517); // ...but the corpse has already been summoned too many times!
                    }
                    success = false;
                }
            }

            if (success)
            {
                m.PlaySound(0xFA);

                foreach (Corpse c in corpses)
                {
                    c.MoveToWorld(m.Location, m.Map);

                    if (Corpse.PlayerCorpses != null && Corpse.PlayerCorpses.ContainsKey(c))
                    {
                        Corpse.PlayerCorpses[c]++;
                    }
                }

                if (_SummonAll)
                {
                    m.SendLocalizedMessage(1071530, corpses.Count.ToString()); // ...and succeeds in summoning ~1_COUNT~ of them!

                    if (tooFar)
                    {
                        m.SendLocalizedMessage(1071513); // ...but one of them is too far away!
                    }
                    else if (notEnoughTime)
                    {
                        m.SendLocalizedMessage(1071516); // ...but one of them deflects the magic because of the stain of war!
                    }
                    else if (tooManySummons)
                    {
                        m.SendLocalizedMessage(1071519); // ...but one of them has already been summoned too many times!
                    }
                }
                else
                {
                    m.SendLocalizedMessage(1071529); // ...and succeeds in the summoning of it!
                }
                if (Charges <= 0)
                {
                    m.SendLocalizedMessage(1071509); // The staff has been reduced to pieces!
                    Delete();
                }
                else
                {
                    Charges--;
                }
            }
        }
コード例 #39
0
        public void TryEndSummon(Mobile m, List <Corpse> corpses)
        {
            if (_Timers.ContainsKey(m))
            {
                _Timers.Remove(m);
            }

            if (corpses == null || corpses.Count == 0)
            {
                m.SendMessage("The bell stops ringing... it seems unable to locate your corpse");
                return;
            }

            bool tooFar         = false;
            bool notEnoughTime  = false;
            bool tooManySummons = false;
            bool success        = true;

            if (_SummonAll)
            {
                List <Corpse> copy = new List <Corpse>(corpses);

                foreach (var c in copy)
                {
                    bool remove = false;

                    if (c.Map != m.Map)
                    {
                        remove = true;
                        tooFar = true;
                    }

                    if (Corpse.PlayerCorpses.ContainsKey(c) && Corpse.PlayerCorpses[c] >= 3)
                    {
                        remove         = true;
                        tooManySummons = true;
                    }

                    if (!m.InRange(c.GetWorldLocation(), 30))
                    {
                        remove = true;
                        tooFar = true;
                    }

                    if (remove)
                    {
                        corpses.Remove(c);
                    }
                }

                if (corpses.Count == 0)
                {
                    success = false;
                }
            }
            else
            {
                Corpse c = corpses[0];

                if (c.Map != m.Map)
                {
                    tooFar = true;
                }

                if (c.Killer is PlayerMobile && c.Killer != m && c.TimeOfDeath + TimeSpan.FromSeconds(180) > DateTime.UtcNow)
                {
                    notEnoughTime = true;
                }

                if (Corpse.PlayerCorpses != null && Corpse.PlayerCorpses.ContainsKey(c) && Corpse.PlayerCorpses[c] >= 3)
                {
                    tooManySummons = true;
                }

                if (tooFar || notEnoughTime || tooManySummons)
                {
                    if (tooFar)
                    {
                        m.SendLocalizedMessage(1071512);                         // ...but the corpse is too far away!
                    }
                    else
                    {
                        m.SendLocalizedMessage(1071517);                         // ...but the corpse has already been summoned too many times!
                    }
                    success = false;
                }
            }

            if (success)
            {
                m.PlaySound(0xFA);

                foreach (var c in corpses)
                {
                    c.MoveToWorld(m.Location, m.Map);

                    if (Corpse.PlayerCorpses != null && Corpse.PlayerCorpses.ContainsKey(c))
                    {
                        Corpse.PlayerCorpses[c]++;
                    }
                }

                if (_SummonAll)
                {
                    m.SendLocalizedMessage(1071530, corpses.Count.ToString());                     // ...and succeeds in summoning ~1_COUNT~ of them!

                    if (tooFar)
                    {
                        m.SendLocalizedMessage(1071513);                         // ...but one of them is too far away!
                    }
                    else if (notEnoughTime)
                    {
                        m.SendLocalizedMessage(1071516);                         // ...but one of them deflects the magic because of the stain of war!
                    }
                    else if (tooManySummons)
                    {
                        m.SendLocalizedMessage(1071519);                         // ...but one of them has already been summoned too many times!
                    }
                }
                else
                {
                    m.SendLocalizedMessage(1071529);                     // ...and succeeds in the summoning of it!
                }
            }
        }
コード例 #40
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                if (targeted is Corpse)
                {
                    Corpse c     = targeted as Corpse;
                    bool   found = false;
                    Mobile owner = c.Owner;
                    Timer  m_Revive;

                    Mobile ghost = null;

                    if (owner == null || owner.Deleted || (owner is TeiravonMobile && ((TeiravonMobile)owner).IsUndead()) || c.ItemID != 0x2006)
                    {
                        from.SendMessage("You cannot revive that!");
                        return;
                    }

                    IPooledEnumerable eable = c.Map.GetMobilesInRange(c.Location, 1);

                    foreach (Mobile m in eable)
                    {
                        if (m == c.Owner)
                        {
                            found = true;
                            ghost = m;
                        }
                    }
                    eable.Free();
                    if (!found && c.Owner != null)
                    {
                        from.SendMessage("The body is cold and unresponsive as if the spirit has left it.");
                        c.Owner.SendMessage("You feel drawn to your body.");
                        return;
                    }
                    if (found && ghost != null && !ghost.Alive)
                    {
                        from.SendMessage("You attempt to revive the fallen.");
                        m_Revive = new ReviveTimer(from, c, ghost);
                        SpellHelper.Turn(from, c);
                        BandageClearHands(from);
                        from.Animate(32, 5, 1, true, false, 0);
                        m_Bandage.Consume();
                        m_Revive.Start();
                        return;
                    }
                }

                if (targeted is Mobile)
                {
                    if (from.InRange(m_Bandage.GetWorldLocation(), Core.AOS ? 2 : 1))
                    {
                        TeiravonMobile m_Player = targeted as TeiravonMobile;
                        Mobile         m        = targeted as Mobile;
                        if (targeted is TeiravonMobile && m_Player.PlayerRace == TeiravonMobile.Race.Undead)
                        {
                            from.SendMessage("The dead cannot be bandaged.");
                            return;
                        }


                        if (m_Slayer.Slays(m))
                        {
                            from.SendLocalizedMessage(1060177); // You cannot heal a creature that is already dead!
                            return;
                        }

                        if (m_Player != null && m_Player.NextHeal - DateTime.Now > new TimeSpan(0, 0, 3))
                        {
                            m_Player.SendMessage("It's too soon to do this again.");

                            return;
                        }

                        if (BandageContext.BeginHeal(from, (Mobile)targeted) != null)
                        {
                            m_Bandage.Consume();
                            //from.ClearHands();
                            BandageClearHands(from);

                            if (m_Player != null)
                            {
                                m_Player.NextHeal = DateTime.Now + TimeSpan.FromSeconds(2.0);
                            }
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500295);                           // You are too far away to do that.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500970);                       // Bandages can not be used on that.
                }
            }
コード例 #41
0
        public void Carve(Mobile from, Item item)
        {
            if (IsCriminalAction(from) && this.Map != null && (this.Map.Rules & MapRules.HarmfulRestrictions) != 0)
            {
                if (m_Owner == null || !m_Owner.Player)
                {
                    from.SendLocalizedMessage(1005035);                       // You did not earn the right to loot this creature!
                }
                else
                {
                    from.SendLocalizedMessage(1010049);                       // You may not loot this corpse.
                }
                return;
            }

            Mobile dead = m_Owner;

            string world      = Server.Misc.Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y);
            bool   HumanLands = false;

            if (world == "the Bottle World of Kuldar" || world == "the Land of Sosaria")
            {
                HumanLands = true;
            }

            if (GetFlag(CorpseFlag.Carved) || dead == null)
            {
                from.SendLocalizedMessage(500485);                   // You see nothing useful to carve from the corpse.
            }
            else if (((Body)Amount).IsHuman && ItemID == 0x2006 && ( // DON'T WANT TO CARVE ORKS AND ELVES
                         dead is EvilMage || dead is EvilMageLord || dead is Brigand || dead is Executioner ||
                         dead is Savage || dead is SavageRider ||
                         dead is Bandit || dead is Mangar || dead is ZuluuNative ||
                         dead is ZuluuArcher || dead is NativeWitchDoctor || dead is NativeArcher || dead is Native ||
                         dead is Rogue || dead is ZuluuWitchDoctor || dead is PirateLand || dead is PirateCrew ||
                         dead is Monks || dead is PirateCaptain || dead is EvilSailorArcher || dead is EvilSailorWizard ||
                         dead is Minstrel || dead is EvilSailorMinstrel || dead is SailorArcher || dead is SailorWizard ||
                         dead is Berserker || dead is SailorMinstrel || dead is BlackKnight || dead is BloodAssassin ||
                         dead is Archmage || dead is BombWorshipper || dead is Psionicist || dead is SavageAlien ||
                         (HumanLands == true && dead is BaseVendor) || (HumanLands == true && dead is BaseHealer) || (HumanLands == true && dead is BasePerson)
                         ))
            {
                new Blood(0x122D).MoveToWorld(Location, Map);

                Corpse bodyBag = (Corpse)this;
                bodyBag.AddCarvedItem(new Torso(), from);
                bodyBag.AddCarvedItem(new LeftLeg(), from);
                bodyBag.AddCarvedItem(new LeftArm(), from);
                bodyBag.AddCarvedItem(new RightLeg(), from);
                bodyBag.AddCarvedItem(new RightArm(), from);
                bodyBag.AddCarvedItem(new TastyHeart(dead.Name), from);

                string myWork = "";

                bool CriminalCarve = true;

                if (m_CorpseName != null && m_CorpseName != "")
                {
                    if (m_CorpseName.Contains(" the assassin"))
                    {
                        myWork = "Assassin";     dead.Name = (dead.Name).Replace(" the assassin", "");   CriminalCarve = false;
                    }
                    else if (m_CorpseName.Contains(" the thief"))
                    {
                        myWork = "Thief";              dead.Name = (dead.Name).Replace(" the thief", "");              CriminalCarve = false;
                    }
                    else if (m_CorpseName.Contains(" the pirate"))
                    {
                        myWork = "Pirate";    dead.Name = (dead.Name).Replace(" the pirate", "");             CriminalCarve = false;
                    }
                    else if (m_CorpseName.Contains(" the bandit"))
                    {
                        myWork = "Bandit";    dead.Name = (dead.Name).Replace(" the bandit", "");             CriminalCarve = false;
                    }
                    else if (m_CorpseName.Contains(" the brigand"))
                    {
                        myWork = "Brigand";  dead.Name = (dead.Name).Replace(" the brigand", "");    CriminalCarve = false;
                    }
                }

                if (CriminalCarve == true)
                {
                    if (IsCriminalAction(from))
                    {
                        from.CriminalAction(true);
                    }

                    Misc.Titles.AwardKarma(from, -50, true);
                }

                Head head = new Head(dead.Name);
                if (myWork != "")
                {
                    head.m_Job = myWork;
                }

                bodyBag.AddCarvedItem(head, from);

                SetFlag(CorpseFlag.Carved, true);

                ProcessDelta();
                SendRemovePacket();
                ItemID = Utility.Random(0xECA, 9);                   // bone graphic
                Hue    = 0;
                ProcessDelta();
            }
            else if (
                dead is ElfEvilSailorMinstrel || dead is ElfEvilSailorArcher || dead is ElfEvilSailorWizard ||
                dead is ElfPirateCaptain || dead is ElfPirateCrew || dead is OrkRogue ||
                dead is ElfRogue
                )
            {
                string myWork = "";

                if (m_CorpseName != null && m_CorpseName != "")
                {
                    if (m_CorpseName.Contains(" the assassin"))
                    {
                        myWork = "Assassin";     dead.Name = (dead.Name).Replace(" the assassin", "");
                    }
                    else if (m_CorpseName.Contains(" the thief"))
                    {
                        myWork = "Thief";              dead.Name = (dead.Name).Replace(" the thief", "");
                    }
                    else if (m_CorpseName.Contains(" the pirate"))
                    {
                        myWork = "Pirate";    dead.Name = (dead.Name).Replace(" the pirate", "");
                    }
                    else if (m_CorpseName.Contains(" the bandit"))
                    {
                        myWork = "Bandit";    dead.Name = (dead.Name).Replace(" the bandit", "");
                    }
                    else if (m_CorpseName.Contains(" the brigand"))
                    {
                        myWork = "Brigand";  dead.Name = (dead.Name).Replace(" the brigand", "");
                    }
                }

                if (myWork != "")                   // ONLY ADD A HEAD FOR ORKS AND ELVES...ROGUES & PIRATES
                {
                    Head head = new Head(dead.Name);
                    head.Hue = dead.Hue;
                    if (myWork != "")
                    {
                        head.m_Job = myWork;
                    }

                    Corpse bodyBag = (Corpse)this;
                    bodyBag.AddCarvedItem(head, from);
                }

                ((BaseCreature)dead).OnCarve(from, this, item);
            }
            else if (dead is BaseCreature)
            {
                ((BaseCreature)dead).OnCarve(from, this, item);
            }
            else
            {
                from.SendLocalizedMessage(500485);                   // You see nothing useful to carve from the corpse.
            }
        }
コード例 #42
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Trophy.Deleted)
                {
                    return;
                }

                if (targeted is Fish || targeted is BigFish)
                {
                    Item fish   = (Item)targeted;
                    Item trophy = new MountedTrophyHead();
                    trophy.Name   = "mounted fish";
                    trophy.ItemID = 0x1E69;
                    from.AddToBackpack(trophy);
                    from.SendMessage("You mount the fish on the base.");
                    fish.Delete();
                    m_Trophy.Delete();
                }
                else if (targeted is NewFish)
                {
                    Item fish   = (Item)targeted;
                    Item trophy = new MountedTrophyHead();
                    trophy.Hue    = fish.Hue;
                    trophy.Name   = "mounted " + fish.Name;
                    trophy.ItemID = 0x44E8;
                    from.AddToBackpack(trophy);
                    from.SendMessage("You mount the fish on the base.");
                    fish.Delete();
                    m_Trophy.Delete();
                }
                else if (!(targeted is Corpse))
                {
                    from.SendMessage("That cannot be mounted as a trophy!");
                    return;
                }
                else
                {
                    Region reg = Region.Find(from.Location, from.Map);

                    object obj = targeted;

                    if (obj is Corpse)
                    {
                        obj = ((Corpse)obj).Owner;
                    }

                    if (obj != null)
                    {
                        Corpse c = (Corpse)targeted;

                        if (c.VisitedByTaxidermist == true)
                        {
                            from.SendMessage("This has already been claimed as a trophy!");
                            return;
                        }
                        else
                        {
                            string trophyName = c.Name;
                            if (c.m_Owner.Title != "")
                            {
                                trophyName = trophyName + " " + c.m_Owner.Title;
                            }
                            int trophyColor = c.Hue;
                            int trophyID    = 0;

                            if ((typeof(AncientWyrm) == c.Owner.GetType()) ||
                                (typeof(CaddelliteDragon) == c.Owner.GetType()) ||
                                (typeof(DragonKing) == c.Owner.GetType()) ||
                                (typeof(SlasherOfVoid) == c.Owner.GetType()) ||
                                (typeof(VolcanicDragon) == c.Owner.GetType()) ||
                                (typeof(AshDragon) == c.Owner.GetType()) ||
                                (typeof(BottleDragon) == c.Owner.GetType()) ||
                                (typeof(RadiationDragon) == c.Owner.GetType()) ||
                                (typeof(CrystalDragon) == c.Owner.GetType()) ||
                                (typeof(VoidDragon) == c.Owner.GetType()) ||
                                (typeof(ElderDragon) == c.Owner.GetType()) ||
                                (typeof(DeepSeaDragon) == c.Owner.GetType()) ||
                                (typeof(ShadowWyrm) == c.Owner.GetType()) ||
                                (typeof(ZombieDragon) == c.Owner.GetType()))
                            {
                                trophyID = 0x21FB;
                                if (typeof(ShadowWyrm) == c.Owner.GetType())
                                {
                                    trophyColor = 0x966;
                                }
                                else if (typeof(DragonKing) == c.Owner.GetType())
                                {
                                    trophyColor = 0xA65;
                                }
                            }
                            else if ((typeof(Dragons) == c.Owner.GetType()) ||
                                     (typeof(RidingDragon) == c.Owner.GetType()) ||
                                     (typeof(GemDragon) == c.Owner.GetType()) ||
                                     (typeof(GhostDragyn) == c.Owner.GetType()) ||
                                     (typeof(GrayDragon) == c.Owner.GetType()) ||
                                     (typeof(BlueDragon) == c.Owner.GetType()) ||
                                     (typeof(MetalDragon) == c.Owner.GetType()) ||
                                     (typeof(Dragon) == c.Owner.GetType()) ||
                                     (typeof(StoneDragon) == c.Owner.GetType()) ||
                                     (typeof(WhiteDragon) == c.Owner.GetType()) ||
                                     (typeof(BlackDragon) == c.Owner.GetType()) ||
                                     (typeof(AsianDragon) == c.Owner.GetType()) ||
                                     (typeof(GreenDragon) == c.Owner.GetType()) ||
                                     (typeof(DragonGolem) == c.Owner.GetType()))
                            {
                                if (typeof(Dragon) == c.Owner.GetType())
                                {
                                    trophyColor = 0x9A2;
                                }
                                trophyID = 0x270D;
                            }
                            else if ((typeof(Wyrms) == c.Owner.GetType()))
                            {
                                if (c.Amount == 12)
                                {
                                    trophyID = 0x270D;
                                }
                                else if (c.Amount == 46)
                                {
                                    trophyID = 0x270D;
                                }
                                else
                                {
                                    trophyID = 0x33FD;
                                }
                            }
                            else if ((typeof(NightWyrm) == c.Owner.GetType()) ||
                                     (typeof(OnyxWyrm) == c.Owner.GetType()) ||
                                     (typeof(EmeraldWyrm) == c.Owner.GetType()) ||
                                     (typeof(AmethystWyrm) == c.Owner.GetType()) ||
                                     (typeof(SapphireWyrm) == c.Owner.GetType()) ||
                                     (typeof(GarnetWyrm) == c.Owner.GetType()) ||
                                     (typeof(TopazWyrm) == c.Owner.GetType()) ||
                                     (typeof(RubyWyrm) == c.Owner.GetType()) ||
                                     (typeof(SpinelWyrm) == c.Owner.GetType()) ||
                                     (typeof(QuartzWyrm) == c.Owner.GetType()) ||
                                     (typeof(JungleWyrm) == c.Owner.GetType()) ||
                                     (typeof(DesertWyrm) == c.Owner.GetType()) ||
                                     (typeof(MountainWyrm) == c.Owner.GetType()) ||
                                     (typeof(IceDragon) == c.Owner.GetType()) ||
                                     (typeof(LavaDragon) == c.Owner.GetType()) ||
                                     (typeof(WhiteWyrm) == c.Owner.GetType()))
                            {
                                trophyID = 0x393B;
                            }
                            else if ((typeof(Lizardman) == c.Owner.GetType()) ||
                                     (typeof(Reptaur) == c.Owner.GetType()) ||
                                     (typeof(LizardmanArcher) == c.Owner.GetType()))
                            {
                                trophyID = 0x393F;
                            }
                            else if ((typeof(Sakleth) == c.Owner.GetType()) ||
                                     (typeof(MutantLizardman) == c.Owner.GetType()) ||
                                     (typeof(Grathek) == c.Owner.GetType()) ||
                                     (typeof(Sleestax) == c.Owner.GetType()) ||
                                     (typeof(SaklethArcher) == c.Owner.GetType()) ||
                                     (typeof(SaklethMage) == c.Owner.GetType()) ||
                                     (typeof(Reptalar) == c.Owner.GetType()) ||
                                     (typeof(ReptalarShaman) == c.Owner.GetType()) ||
                                     (typeof(ReptalarChieftain) == c.Owner.GetType()) ||
                                     (typeof(SaklethArcher) == c.Owner.GetType()))
                            {
                                trophyID = 0x33AB;
                            }
                            else if ((typeof(Goblin) == c.Owner.GetType()) ||
                                     (typeof(GoblinArcher) == c.Owner.GetType()))
                            {
                                trophyID = 0x3937;
                            }
                            else if ((typeof(Ratman) == c.Owner.GetType()) ||
                                     (typeof(RatmanMage) == c.Owner.GetType()) ||
                                     (typeof(RatmanArcher) == c.Owner.GetType()))
                            {
                                trophyID = 0x392B;
                            }
                            else if ((typeof(Bugbear) == c.Owner.GetType()))
                            {
                                trophyID = 0x3935;
                            }
                            else if ((typeof(MinotaurCaptain) == c.Owner.GetType()) ||
                                     (typeof(RottingMinotaur) == c.Owner.GetType()) ||
                                     (typeof(MutantMinotaur) == c.Owner.GetType()) ||
                                     (typeof(MinotaurSmall) == c.Owner.GetType()) ||
                                     (typeof(MinotaurScout) == c.Owner.GetType()) ||
                                     (typeof(Minotaur) == c.Owner.GetType()))
                            {
                                trophyID = 0x3944;
                            }
                            else if ((typeof(Cyclops) == c.Owner.GetType()) ||
                                     (typeof(ZornTheBlacksmith) == c.Owner.GetType()) ||
                                     (typeof(ShamanicCyclops) == c.Owner.GetType()))
                            {
                                trophyID = 0x3931;
                            }
                            else if ((typeof(StoneGiant) == c.Owner.GetType()) ||
                                     (typeof(IceGiant) == c.Owner.GetType()) ||
                                     (typeof(LavaGiant) == c.Owner.GetType()) ||
                                     (typeof(MountainGiant) == c.Owner.GetType()))
                            {
                                trophyID = 0x3912;
                            }
                            else if (typeof(UndeadGiant) == c.Owner.GetType())
                            {
                                trophyID = 0x21F9;
                            }
                            else if ((typeof(Titan) == c.Owner.GetType()) ||
                                     (typeof(ElderTitan) == c.Owner.GetType()))
                            {
                                trophyID = 0x21F7;
                            }
                            else if ((typeof(TundraOgre) == c.Owner.GetType()) ||
                                     (typeof(OgreMagi) == c.Owner.GetType()) ||
                                     (typeof(Ogre) == c.Owner.GetType()))
                            {
                                trophyID = 0x33E1;
                            }
                            else if ((typeof(Ettin) == c.Owner.GetType()) ||
                                     (typeof(ArcticEttin) == c.Owner.GetType()) ||
                                     (typeof(AncientEttin) == c.Owner.GetType()))
                            {
                                trophyID = 0x393D;
                            }
                            else if (typeof(EttinShaman) == c.Owner.GetType())
                            {
                                trophyID = 0x33A7;
                            }
                            else if ((typeof(HillGiant) == c.Owner.GetType()) ||
                                     (typeof(HillGiantShaman) == c.Owner.GetType()))
                            {
                                trophyID = 0x33A9;
                            }
                            else if ((typeof(FireGargoyle) == c.Owner.GetType()) ||
                                     (typeof(Gargoyle) == c.Owner.GetType()) ||
                                     (typeof(AncientGargoyle) == c.Owner.GetType()) ||
                                     (typeof(GhostGargoyle) == c.Owner.GetType()) ||
                                     (typeof(MutantGargoyle) == c.Owner.GetType()) ||
                                     (typeof(CosmicGargoyle) == c.Owner.GetType()) ||
                                     (typeof(SpectralGargoyle) == c.Owner.GetType()) ||
                                     (typeof(ZombieGargoyle) == c.Owner.GetType()) ||
                                     (typeof(GargoyleMarble) == c.Owner.GetType()) ||
                                     (typeof(StygianGargoyle) == c.Owner.GetType()) ||
                                     (typeof(StygianGargoyleLord) == c.Owner.GetType()) ||
                                     (typeof(CodexGargoyleA) == c.Owner.GetType()) ||
                                     (typeof(CodexGargoyleB) == c.Owner.GetType()) ||
                                     (typeof(GargoyleWarrior) == c.Owner.GetType()) ||
                                     (typeof(StoneGargoyle) == c.Owner.GetType()) ||
                                     (typeof(ShadowDemon) == c.Owner.GetType()))
                            {
                                trophyID = 0x3933;
                            }
                            else if ((typeof(GargoyleRuby) == c.Owner.GetType()) ||
                                     (typeof(GargoyleEmerald) == c.Owner.GetType()) ||
                                     (typeof(GargoyleAmethyst) == c.Owner.GetType()) ||
                                     (typeof(GargoyleSapphire) == c.Owner.GetType()) ||
                                     (typeof(Tarjan) == c.Owner.GetType()) ||
                                     (typeof(BloodDemigod) == c.Owner.GetType()) ||
                                     (typeof(Xurtzar) == c.Owner.GetType()) ||
                                     (typeof(AbysmalDaemon) == c.Owner.GetType()) ||
                                     (typeof(DeepSeaDevil) == c.Owner.GetType()) ||
                                     (typeof(Devil) == c.Owner.GetType()) ||
                                     (typeof(BloodDemon) == c.Owner.GetType()) ||
                                     (typeof(Demon) == c.Owner.GetType()) ||
                                     (typeof(FireDemon) == c.Owner.GetType()) ||
                                     (typeof(Daemonic) == c.Owner.GetType()) ||
                                     (typeof(DaemonTemplate) == c.Owner.GetType()) ||
                                     (typeof(Daemon) == c.Owner.GetType()))
                            {
                                if (typeof(DeepSeaDevil) == c.Owner.GetType())
                                {
                                    trophyColor = 1365;
                                }
                                trophyID = 0x567F;
                            }

                            else if (typeof(Balron) == c.Owner.GetType())
                            {
                                trophyID = 0x5681;
                            }
                            else if (typeof(Archfiend) == c.Owner.GetType())
                            {
                                trophyID = 0x5681; trophyColor = 0xB1E;
                            }
                            else if (typeof(Fiend) == c.Owner.GetType())
                            {
                                trophyID = 0x567F; trophyColor = 0xB1E;
                            }
                            else if ((typeof(GargoyleOnyx) == c.Owner.GetType()) ||
                                     (typeof(BlackGateDemon) == c.Owner.GetType()))
                            {
                                trophyID = 0x392C; trophyColor = 0;
                            }
                            else if ((typeof(BrownBear) == c.Owner.GetType()) ||
                                     (typeof(GrizzlyBearRiding) == c.Owner.GetType()) ||
                                     (typeof(GrizzlyBear) == c.Owner.GetType()))
                            {
                                trophyID = 0x1E67;
                            }
                            else if ((typeof(SabretoothBear) == c.Owner.GetType()) ||
                                     (typeof(SabretoothBearRiding) == c.Owner.GetType()) ||
                                     (typeof(DeathBear) == c.Owner.GetType()) ||
                                     (typeof(DireBear) == c.Owner.GetType()) ||
                                     (typeof(ElderBrownBear) == c.Owner.GetType()) ||
                                     (typeof(ElderBrownBearRiding) == c.Owner.GetType()) ||
                                     (typeof(GreatBear) == c.Owner.GetType()))
                            {
                                trophyID = 0x339B;
                            }
                            else if (typeof(CaveBear) == c.Owner.GetType())
                            {
                                trophyID = 0x339D;
                            }
                            else if (typeof(CaveBearRiding) == c.Owner.GetType())
                            {
                                trophyID = 0x339D;
                            }
                            else if ((typeof(ElderBlackBear) == c.Owner.GetType()) ||
                                     (typeof(ElderBlackBearRiding) == c.Owner.GetType()) ||
                                     (typeof(BlackBear) == c.Owner.GetType()) ||
                                     (typeof(SabreclawCub) == c.Owner.GetType()) ||
                                     (typeof(KodiakBear) == c.Owner.GetType()))
                            {
                                trophyID    = 0x3399;
                                trophyColor = 0;
                            }
                            else if (typeof(PolarBear) == c.Owner.GetType())
                            {
                                trophyID = 0x1E6C; trophyColor = 0;
                            }
                            else if (typeof(ElderPolarBear) == c.Owner.GetType())
                            {
                                trophyID = 0x339F;
                            }
                            else if (typeof(ElderPolarBearRiding) == c.Owner.GetType())
                            {
                                trophyID = 0x339F;
                            }
                            else if ((typeof(OgreLord) == c.Owner.GetType()) ||
                                     (typeof(ArcticOgreLord) == c.Owner.GetType()))
                            {
                                trophyID = 0x3378;
                            }
                            else if (typeof(Cerberus) == c.Owner.GetType())
                            {
                                trophyID = 0x335A;
                            }
                            else if (typeof(Drake) == c.Owner.GetType())
                            {
                                trophyID = 0x3368;
                            }
                            else if (typeof(SwampDrake) == c.Owner.GetType())
                            {
                                trophyID = 0x3385;
                            }
                            else if (typeof(SwampDrakeRiding) == c.Owner.GetType())
                            {
                                trophyID = 0x3385;
                            }
                            else if (typeof(AncientDrake) == c.Owner.GetType())
                            {
                                trophyID = 0x3358;
                            }
                            else if (typeof(Owlbear) == c.Owner.GetType())
                            {
                                trophyID = 0x337B;
                            }
                            else if (typeof(AbysmalOgre) == c.Owner.GetType())
                            {
                                trophyID = 0x3354;
                            }
                            else if (typeof(SeaDrake) == c.Owner.GetType())
                            {
                                trophyID = 0x3381;
                            }
                            else if (typeof(AncientCyclops) == c.Owner.GetType())
                            {
                                trophyID = 0x3356;
                            }
                            else if (typeof(StormGiant) == c.Owner.GetType())
                            {
                                trophyID = 0x335C;
                            }
                            else if (typeof(CloudGiant) == c.Owner.GetType())
                            {
                                trophyColor = 0xB70; trophyID = 0x335C;
                            }
                            else if (typeof(StarGiant) == c.Owner.GetType() && c.Amount == 770)
                            {
                                trophyColor = 0xB73; trophyID = 0x3352;
                            }
                            else if (typeof(StarGiant) == c.Owner.GetType())
                            {
                                trophyColor = 0xB73; trophyID = 0x3374;
                            }
                            else if (typeof(DemonOfTheSea) == c.Owner.GetType())
                            {
                                trophyID = 0x337D;
                            }
                            else if (typeof(DragonGhost) == c.Owner.GetType())
                            {
                                trophyID = 0x337F;
                            }
                            else if ((typeof(Tiger) == c.Owner.GetType()) ||
                                     (typeof(SabretoothTiger) == c.Owner.GetType()) ||
                                     (typeof(SabretoothTigerRiding) == c.Owner.GetType()) ||
                                     (typeof(TigerRiding) == c.Owner.GetType()))
                            {
                                trophyID    = 0x3389;
                                trophyColor = 0;
                            }
                            else if ((typeof(WhiteTiger) == c.Owner.GetType()) || (typeof(WhiteTigerRiding) == c.Owner.GetType()) || (typeof(PredatorHellCatRiding) == c.Owner.GetType()) ||
                                     (typeof(PredatorHellCat) == c.Owner.GetType()))
                            {
                                trophyID = 0x3389;
                            }
                            else if ((typeof(Lion) == c.Owner.GetType()) ||
                                     (typeof(LionRiding) == c.Owner.GetType()) ||
                                     (typeof(SnowLion) == c.Owner.GetType()) ||
                                     (typeof(Manticore) == c.Owner.GetType()) ||
                                     (typeof(Chimera) == c.Owner.GetType()))
                            {
                                trophyID = 0x3376;
                            }
                            else if (typeof(Exodus) == c.Owner.GetType())
                            {
                                trophyID = 0x5681;
                            }
                            else if ((typeof(Wyvra) == c.Owner.GetType()) ||
                                     (typeof(Hydra) == c.Owner.GetType()) ||
                                     (typeof(EnergyHydra) == c.Owner.GetType()))
                            {
                                trophyID = 0x3372;
                                if (typeof(Hydra) == c.Owner.GetType())
                                {
                                    trophyColor = 0xA5D;
                                }
                            }
                            else if (typeof(SkeletalDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33B3;
                            }
                            else if (typeof(Dracolich) == c.Owner.GetType())
                            {
                                trophyID = 0x3364;
                            }
                            else if (typeof(SwampThing) == c.Owner.GetType())
                            {
                                trophyID = 0x3387;
                            }
                            else if (typeof(Griffon) == c.Owner.GetType())
                            {
                                trophyID = 0x3370;
                            }
                            else if (typeof(GriffonRiding) == c.Owner.GetType())
                            {
                                trophyID = 0x3370;
                            }
                            else if (typeof(Walrus) == c.Owner.GetType())
                            {
                                trophyID = 0x33DF;
                            }
                            else if (typeof(Meglasaur) == c.Owner.GetType())
                            {
                                trophyID = 0x3362;
                            }
                            else if (typeof(Stegosaurus) == c.Owner.GetType())
                            {
                                trophyID = 0x3393;
                            }
                            else if (typeof(Tyranasaur) == c.Owner.GetType())
                            {
                                trophyID = 0x3391;
                            }
                            else if (typeof(DragonTurtle) == c.Owner.GetType())
                            {
                                trophyID = 0x3366;
                            }
                            else if (typeof(DeepSeaGiant) == c.Owner.GetType())
                            {
                                trophyID = 0x3360;
                            }
                            else if (typeof(Trollbear) == c.Owner.GetType())
                            {
                                trophyID = 0x33E3;
                            }
                            else if (typeof(Satan) == c.Owner.GetType())
                            {
                                trophyID = 0x33AF;
                            }
                            else if (typeof(SeaGiant) == c.Owner.GetType())
                            {
                                trophyID = 0x3383;
                            }
                            else if (typeof(SandGiant) == c.Owner.GetType() || typeof(AbyssGiant) == c.Owner.GetType())
                            {
                                trophyID = 0x3352;
                                if (typeof(SandGiant) == c.Owner.GetType())
                                {
                                    trophyColor = 0x96D;
                                }
                            }
                            else if (typeof(JungleGiant) == c.Owner.GetType())
                            {
                                trophyID = 0x3374;
                            }
                            else if (typeof(ForestGiant) == c.Owner.GetType() || typeof(FireGiant) == c.Owner.GetType())
                            {
                                trophyID = 0x336C;
                                if (typeof(FireGiant) == c.Owner.GetType())
                                {
                                    trophyColor = 0xA93;
                                }
                            }
                            else if ((typeof(ZombieGiant) == c.Owner.GetType()) ||
                                     (typeof(FleshGolem) == c.Owner.GetType()) ||
                                     (typeof(AncientFleshGolem) == c.Owner.GetType()))
                            {
                                trophyID = 0x336A;
                            }
                            else if (typeof(FrostGiant) == c.Owner.GetType())
                            {
                                trophyID = 0x336E;
                            }
                            else if ((typeof(SeaTroll) == c.Owner.GetType()) ||
                                     (typeof(FrostTroll) == c.Owner.GetType()) ||
                                     (typeof(FrostTrollShaman) == c.Owner.GetType()) ||
                                     (typeof(SwampTroll) == c.Owner.GetType()) ||
                                     (typeof(TrollWitchDoctor) == c.Owner.GetType()) ||
                                     (typeof(Troll) == c.Owner.GetType()))
                            {
                                trophyID = 0x1E6D;
                            }
                            else if ((typeof(Orc) == c.Owner.GetType()) ||
                                     (typeof(OrcBomber) == c.Owner.GetType()) ||
                                     (typeof(OrcCaptain) == c.Owner.GetType()) ||
                                     (typeof(OrcishLord) == c.Owner.GetType()) ||
                                     (typeof(OrcishMage) == c.Owner.GetType()) ||
                                     (typeof(Urk) == c.Owner.GetType()) ||
                                     (typeof(UrkShaman) == c.Owner.GetType()) ||
                                     (typeof(Urc) == c.Owner.GetType()) ||
                                     (typeof(UrcShaman) == c.Owner.GetType()) ||
                                     (typeof(UrcBowman) == c.Owner.GetType()) ||
                                     (typeof(OrkMage) == c.Owner.GetType()) ||
                                     (typeof(OrkMonks) == c.Owner.GetType()) ||
                                     (typeof(OrkRogue) == c.Owner.GetType()) ||
                                     (typeof(OrkWarrior) == c.Owner.GetType()))
                            {
                                trophyID = 0x1E6B; trophyColor = 0;
                            }
                            else if (typeof(GreatHart) == c.Owner.GetType() || typeof(Antelope) == c.Owner.GetType())
                            {
                                trophyID = 0x1E68;
                            }
                            else if ((typeof(Gorilla) == c.Owner.GetType()) ||
                                     (typeof(Infected) == c.Owner.GetType()) ||
                                     (typeof(Ape) == c.Owner.GetType()))
                            {
                                trophyID = 0x1E6A;
                                if (typeof(Infected) != c.Owner.GetType())
                                {
                                    trophyColor = 0;
                                }
                            }
                            else if ((typeof(Yeti) == c.Owner.GetType()))
                            {
                                trophyID = 0x1E6A; trophyColor = 0x47E;
                            }
                            else if ((typeof(Pixie) == c.Owner.GetType()) || (typeof(Sprite) == c.Owner.GetType()) || (typeof(Faerie) == c.Owner.GetType()))
                            {
                                switch (Utility.RandomMinMax(0, 4))
                                {
                                case 0: trophyID = 0x2A79; break;

                                case 1: trophyID = 0x2A75; break;

                                case 2: trophyID = 0x2A71; break;

                                case 3: trophyID = 0x2A77; break;

                                case 4: trophyID = 0x2A73; break;
                                }
                            }
                            else if ((typeof(Unicorn) == c.Owner.GetType()))
                            {
                                trophyID = 0x33B1;
                            }
                            else if ((typeof(Dreadhorn) == c.Owner.GetType()))
                            {
                                trophyID = 0x33B1;
                            }
                            else if ((typeof(DarkUnicorn) == c.Owner.GetType()))
                            {
                                trophyID = 0x335E;
                            }
                            else if ((typeof(DarkUnicornRiding) == c.Owner.GetType()))
                            {
                                trophyID = 0x335E;
                            }
                            else if (typeof(Nightmare) == c.Owner.GetType() || typeof(AncientNightmareRiding) == c.Owner.GetType() || typeof(AncientNightmare) == c.Owner.GetType() || typeof(Placeron) == c.Owner.GetType())
                            {
                                trophyID = 0x33AD;
                            }
                            else if ((typeof(Wyvern) == c.Owner.GetType()) ||
                                     (typeof(Wyverns) == c.Owner.GetType()) ||
                                     (typeof(Teradactyl) == c.Owner.GetType()))
                            {
                                trophyID = 0x33B5;
                            }
                            else if (typeof(AncientWyvern) == c.Owner.GetType())
                            {
                                trophyID = 0x3397;
                            }
                            else if (typeof(IceDevil) == c.Owner.GetType())
                            {
                                trophyID = 0x338F;
                            }
                            else if (typeof(Xenomorph) == c.Owner.GetType())
                            {
                                trophyID = 0x33B9; trophyColor = 0;
                            }
                            else if (typeof(Hippogriff) == c.Owner.GetType())
                            {
                                trophyID = 0x33DD;
                            }
                            else if (typeof(HippogriffRiding) == c.Owner.GetType())
                            {
                                trophyID = 0x33DD;
                            }
                            else if (typeof(HellBeast) == c.Owner.GetType())
                            {
                                trophyID = 0x33DB;
                            }
                            else if (typeof(Styguana) == c.Owner.GetType())
                            {
                                trophyID = 0x33B7;
                            }
                            else if (typeof(Watcher) == c.Owner.GetType())
                            {
                                trophyID = 0x33BB;
                            }
                            else if (typeof(CragCat) == c.Owner.GetType())
                            {
                                trophyID = 0x33BD;
                            }
                            else if (typeof(PrimevalGreenDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33C1;
                            }
                            else if (typeof(PrimevalNightDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33D3;
                            }
                            else if (typeof(PrimevalRedDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33C5;
                            }
                            else if (typeof(PrimevalRoyalDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33C3;
                            }
                            else if (typeof(PrimevalRunicDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33BF;
                            }
                            else if (typeof(PrimevalSeaDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33C7;
                            }
                            else if (typeof(ReanimatedDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33D5;
                            }
                            else if (typeof(VampiricDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33CD;
                            }
                            else if (typeof(PrimevalAbysmalDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33CB;
                            }
                            else if (typeof(PrimevalAmberDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33D1;
                            }
                            else if (typeof(PrimevalBlackDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33A3;
                            }
                            else if (typeof(PrimevalDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33D9;
                            }
                            else if (typeof(PrimevalSilverDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33A5;
                            }
                            else if (typeof(PrimevalVolcanicDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33CF;
                            }
                            else if (typeof(PrimevalFireDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33D7;
                            }
                            else if (typeof(PrimevalStygianDragon) == c.Owner.GetType())
                            {
                                trophyID = 0x33C9;
                            }
                            else if (typeof(TitanLithos) == c.Owner.GetType())
                            {
                                trophyID = 0x338B;
                            }
                            else if (typeof(TitanPyros) == c.Owner.GetType())
                            {
                                trophyID = 0x338D;
                            }
                            else if (typeof(TitanHydros) == c.Owner.GetType())
                            {
                                trophyID = 0x338F;
                            }

                            if (trophyID > 0)
                            {
                                MountedTrophyHead trophy = new MountedTrophyHead();
                                trophy.Hue         = trophyColor;
                                trophy.Name        = "mounted head of " + trophyName;
                                trophy.ItemID      = trophyID;
                                trophy.AnimalWhere = "From " + Server.Misc.Worlds.GetRegionName(from.Map, from.Location);
                                if (c.m_Killer != null && c.m_Killer is PlayerMobile)
                                {
                                    string trophyKiller = c.m_Killer.Name + " the " + Server.Misc.GetPlayerInfo.GetSkillTitle(c.m_Killer);
                                    trophy.AnimalKiller = "Slain by " + trophyKiller;
                                }
                                from.AddToBackpack(trophy);
                                from.SendMessage("You mount the head on the base.");
                                c.VisitedByTaxidermist = true;
                                m_Trophy.Delete();
                            }
                            else
                            {
                                from.SendMessage("That cannot be mounted as a trophy!");
                                return;
                            }
                        }
                    }
                    else
                    {
                        from.SendMessage("That cannot seem to mount this as a trophy!");
                        return;
                    }
                }
            }
コード例 #43
0
ファイル: Notoriety.cs プロジェクト: cynricthehun/UOLegends
        public static int CorpseNotoriety( Mobile source, Corpse target )
        {
            if ( target.AccessLevel > AccessLevel.Player )
                return Notoriety.CanBeAttacked;

            // MODIFICATIONS FOR Capture the Flag / Double Dom games
            if ( target.Owner != null )
            {
                Server.Items.CTFTeam ft = Server.Items.CTFGame.FindTeamFor( source );
                if ( ft != null )
                {
                    Server.Items.CTFTeam tt = Server.Items.CTFGame.FindTeamFor( target.Owner );
                    if ( tt != null && ft.Game == tt.Game )
                        return ft == tt ? Notoriety.Ally : Notoriety.Enemy;
                }
            }

            Body body = (Body) target.Amount;

            BaseCreature cretOwner = target.Owner as BaseCreature;

            if ( cretOwner != null )
            {
                Guild sourceGuild = GetGuildFor( source.Guild as Guild, source );
                Guild targetGuild = GetGuildFor( target.Guild as Guild, target.Owner );

                if ( sourceGuild != null && targetGuild != null )
                {
                    if ( sourceGuild == targetGuild || sourceGuild.IsAlly( targetGuild ) )
                        return Notoriety.Ally;
                    else if ( sourceGuild.IsEnemy( targetGuild ) )
                        return Notoriety.Enemy;
                }

                Faction srcFaction = Faction.Find( source, true, true );
                Faction trgFaction = Faction.Find( target.Owner, true, true );

                if ( srcFaction != null && trgFaction != null && srcFaction != trgFaction && source.Map == Faction.Facet )
                    return Notoriety.Enemy;

                if ( CheckHouseFlag( source, target.Owner, target.Location, target.Map ) )
                    return Notoriety.CanBeAttacked;

                int actual = Notoriety.CanBeAttacked;

                if ( target.Kills >= 5 || (body.IsMonster && IsSummoned( target.Owner as BaseCreature )) || (target.Owner is BaseCreature && (((BaseCreature)target.Owner).AlwaysMurderer || ((BaseCreature)target.Owner).IsAnimatedDead)) )
                    actual = Notoriety.Murderer;

                if ( DateTime.Now >= (target.TimeOfDeath + Corpse.MonsterLootRightSacrifice) )
                    return actual;

                Party sourceParty = Party.Get( source );

                ArrayList list = target.Aggressors;

                for ( int i = 0; i < list.Count; ++i )
                {
                    if ( list[i] == source || (sourceParty != null && Party.Get( (Mobile)list[i] ) == sourceParty) )
                        return actual;
                }

                return Notoriety.Innocent;
            }
            else
            {
                if ( target.Kills >= 5 || (body.IsMonster && IsSummoned( target.Owner as BaseCreature )) || (target.Owner is BaseCreature && (((BaseCreature)target.Owner).AlwaysMurderer || ((BaseCreature)target.Owner).IsAnimatedDead)) )
                    return Notoriety.Murderer;

                if ( target.Criminal )
                    return Notoriety.Criminal;

                Guild sourceGuild = GetGuildFor( source.Guild as Guild, source );
                Guild targetGuild = GetGuildFor( target.Guild as Guild, target.Owner );

                if ( sourceGuild != null && targetGuild != null )
                {
                    if ( sourceGuild == targetGuild || sourceGuild.IsAlly( targetGuild ) )
                        return Notoriety.Ally;
                    else if ( sourceGuild.IsEnemy( targetGuild ) )
                        return Notoriety.Enemy;
                }

                Faction srcFaction = Faction.Find( source, true, true );
                Faction trgFaction = Faction.Find( target.Owner, true, true );

                if ( srcFaction != null && trgFaction != null && srcFaction != trgFaction && source.Map == Faction.Facet )
                {
                    ArrayList secondList = target.Aggressors;

                    for ( int i = 0; i < secondList.Count; ++i )
                    {
                        if ( secondList[i] == source || secondList[i] is BaseFactionGuard )
                            return Notoriety.Enemy;
                    }
                }

                if ( target.Owner != null && target.Owner is BaseCreature && ((BaseCreature)target.Owner).AlwaysAttackable )
                    return Notoriety.CanBeAttacked;

                if ( CheckHouseFlag( source, target.Owner, target.Location, target.Map ) )
                    return Notoriety.CanBeAttacked;

                if ( !(target.Owner is PlayerMobile) && !IsPet( target.Owner as BaseCreature ) )
                    return Notoriety.CanBeAttacked;

                ArrayList list = target.Aggressors;

                for ( int i = 0; i < list.Count; ++i )
                {
                    if ( list[i] == source )
                        return Notoriety.CanBeAttacked;
                }

                return Notoriety.Innocent;
            }
        }
コード例 #44
0
        public static Container Mobile_CreateCorpseHandler(Mobile owner, HairInfo hair, FacialHairInfo facialhair, List <Item> initialContent, List <Item> equipItems)
        {
            bool shouldFillCorpse = true;

            Corpse c = null;

            if (owner == null)
            {
                return(c);
            }

            c = new Corpse(owner, hair, facialhair, shouldFillCorpse ? equipItems : new List <Item>());

            if (c == null)
            {
                return(c);
            }

            owner.Corpse = c;

            if (shouldFillCorpse)
            {
                for (int i = 0; i < initialContent.Count; ++i)
                {
                    Item item = initialContent[i];

                    if (item == null)
                    {
                        continue;
                    }

                    c.DropItem(item);
                }
            }

            else
            {
                c.Carved = true;
            }

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

            if (map == null || map == Map.Internal)
            {
                loc = owner.LogoutLocation;
                map = owner.LogoutMap;
            }

            c.MoveToWorld(loc, map);

            //Creature or Player Ocean Corpse Advanced Decay Rate
            if (!(c.Map == null || c.Map == Map.Internal))
            {
                if (c.Map.Tiles != null)
                {
                    LandTile     landTile = c.Map.Tiles.GetLandTile(c.X, c.Y);
                    StaticTile[] tiles    = c.Map.Tiles.GetStaticTiles(c.X, c.Y, true);

                    bool landHasWater   = false;
                    bool staticHasWater = false;

                    if ((landTile.ID >= 168 && landTile.ID <= 171) || (landTile.ID >= 310 && landTile.ID <= 311))
                    {
                        landHasWater = true;
                    }

                    for (int i = 0; i < tiles.Length; ++i)
                    {
                        StaticTile tile = tiles[i];

                        bool isWater = (tile.ID >= 0x1796 && tile.ID <= 0x17B2);

                        if (isWater)
                        {
                            staticHasWater = true;
                        }
                    }

                    if ((landHasWater || staticHasWater) && c.TotalItems == 0)
                    {
                        if (c.m_DecayTimer != null)
                        {
                            c.m_DecayTimer.Stop();
                        }

                        //Empty PlayerMobile is 30 Seconds Decay
                        if (c.Owner is PlayerMobile)
                        {
                            c.BeginDecay(TimeSpan.FromSeconds(30));
                        }

                        //Empty Creature is 10 Seconds Decay
                        else
                        {
                            c.BeginDecay(TimeSpan.FromSeconds(10));
                        }
                    }
                }
            }

            return(c);
        }
コード例 #45
0
ファイル: Packets.cs プロジェクト: Godkong/RunUO
        public CorpseContent6017(Mobile beholder, Corpse beheld)
            : base(0x3C)
        {
            List<Item> items = beheld.Items;
            int count = items.Count;

            if (beheld.Hair != null && beheld.Hair.ItemID > 0)
                count++;
            if (beheld.FacialHair != null && beheld.FacialHair.ItemID > 0)
                count++;

            EnsureCapacity(5 + (count * 20));

            long pos = m_Stream.Position;

            int written = 0;

            m_Stream.Write((ushort)0);

            for (int i = 0; i < items.Count; ++i)
            {
                Item child = items[i];

                if (!child.Deleted && child.Parent == beheld && beholder.CanSee(child))
                {
                    m_Stream.Write((int)child.Serial);
                    m_Stream.Write((ushort)child.ItemID);
                    m_Stream.Write((byte)0); // signed, itemID offset
                    m_Stream.Write((ushort)child.Amount);
                    m_Stream.Write((short)child.X);
                    m_Stream.Write((short)child.Y);
                    m_Stream.Write((byte)0); // Grid Location?
                    m_Stream.Write((int)beheld.Serial);
                    m_Stream.Write((ushort)child.Hue);

                    ++written;
                }
            }

            if (beheld.Hair != null && beheld.Hair.ItemID > 0)
            {
                m_Stream.Write((int)HairInfo.FakeSerial(beheld.Owner) - 2);
                m_Stream.Write((ushort)beheld.Hair.ItemID);
                m_Stream.Write((byte)0); // signed, itemID offset
                m_Stream.Write((ushort)1);
                m_Stream.Write((short)0);
                m_Stream.Write((short)0);
                m_Stream.Write((byte)0); // Grid Location?
                m_Stream.Write((int)beheld.Serial);
                m_Stream.Write((ushort)beheld.Hair.Hue);

                ++written;
            }

            if (beheld.FacialHair != null && beheld.FacialHair.ItemID > 0)
            {
                m_Stream.Write((int)FacialHairInfo.FakeSerial(beheld.Owner) - 2);
                m_Stream.Write((ushort)beheld.FacialHair.ItemID);
                m_Stream.Write((byte)0); // signed, itemID offset
                m_Stream.Write((ushort)1);
                m_Stream.Write((short)0);
                m_Stream.Write((short)0);
                m_Stream.Write((byte)0); // Grid Location?
                m_Stream.Write((int)beheld.Serial);
                m_Stream.Write((ushort)beheld.FacialHair.Hue);

                ++written;
            }

            m_Stream.Seek(pos, SeekOrigin.Begin);
            m_Stream.Write((ushort)written);
        }
コード例 #46
0
            protected override void OnTarget(Mobile from /* WHO TARGETED */, object target /* WHAT'S BEEN TARGETED */)
            {
                if (target is Corpse)
                {
                    Corpse c = (Corpse)target;

                    if (c.Owner is Ettin)                      //If you want this script to claim some other creature change "Ettin" in this line.
                    {
                        if (c.Channeled == false)
                        {
                            c.Channeled         = true;
                            c.Hue               = 0x835;
                            m_BloodyJar.Weight += 0.1;                              //I guess if you want it to go up in higher increments change the 0.1 just be careful.
                            m_BloodyJar.InvalidateProperties();
                            if (m_BloodyJar.Weight == 1.1)
                            {
                                m_BloodyJar.Name   = "a jar of ettins blood";
                                m_BloodyJar.Hue    = 1157;
                                m_BloodyJar.ItemID = 4103;
                                from.SendMessage("You notice as you drain blood from the ettin's corpse the Jar's weight increased.");
                            }
                            else if (m_BloodyJar.Weight <= 1.9)
                            {
                            }
                            else if (m_BloodyJar.Weight <= 2.0)
                            {
                                from.SendMessage("The scarlet liquid continues to rise as you add more blood to the jar.");
                            }
                            else if (m_BloodyJar.Weight <= 2.9)
                            {
                            }
                            else if (m_BloodyJar.Weight <= 3.0)
                            {
                                from.SendMessage("You notice the jar is nearly half-way full.");                        //You can change any of the messages easy, and better to what you like.
                            }
                            else if (m_BloodyJar.Weight <= 3.9)
                            {
                            }
                            else if (m_BloodyJar.Weight <= 4.0)
                            {
                                from.SendMessage("As you drain blood from the ettin's corpse you notice it is almost full.");
                            }
                            else if (m_BloodyJar.Weight <= 4.9)
                            {
                            }                                                                //Always keep this number 0.1 right below the following.
                            else if (m_BloodyJar.Weight >= 5.0)                              //If you want your players to kill more ettins make the 5.0 higher.
                            {
                                from.SendMessage("You notice as you drain the ettin the jar becomes full.");
                                from.AddToBackpack(new FullJarOfEttinsBlood());
                                m_BloodyJar.Delete();
                            }
                        }

                        else
                        {
                            from.SendMessage("This body has already been drained of all its blood.");
                        }
                    }
                }

                else
                {
                    from.SendMessage("You may only use this item on corpses.");
                }
            }
コード例 #47
0
ファイル: PlagueBeast.cs プロジェクト: rokann/JustUO
        public bool Devour(Corpse corpse)
        {
            if (corpse == null || corpse.Owner == null) // sorry we can't devour because the corpse's owner is null
                return false;

            if (corpse.Owner.Body.IsHuman)
                corpse.TurnToBones(); // Not bones yet, and we are a human body therefore we turn to bones.

            IncreaseHits((int) Math.Ceiling(corpse.Owner.HitsMax*0.75));
            TotalDevoured++;

            PublicOverheadMessage(MessageType.Emote, 0x3B2, 1053033);
                // * The plague beast absorbs the fleshy remains of the corpse *

            if (!HasMetalChest && TotalDevoured >= DevourGoal)
            {
                PackItem(new MetalChest());
                HasMetalChest = true;
            }

            return true;
        }
コード例 #48
0
ファイル: HuntingPermit.cs プロジェクト: tflynt91/TrueUO
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Corpse)
                {
                    Corpse c = targeted as Corpse;

                    if (!from.InRange(c.Location, 3))
                    {
                        from.SendLocalizedMessage(500446); // That is too far away.
                    }
                    if (c.VisitedByTaxidermist)
                    {
                        from.SendLocalizedMessage(1042596); // That corpse seems to have been visited by a taxidermist already.
                    }
                    else if (!m_Permit.IsChildOf(from.Backpack))
                    {
                        from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                    }
                    else if (c.Owner == null)
                    {
                        from.SendLocalizedMessage(1155706); // That is not a valid kill.
                    }
                    else if (!IsOnlyAttacker(from, c.Owner))
                    {
                        from.SendLocalizedMessage(1155707);       // You cannot document someone else's kill.
                    }
                    else
                    {
                        Type t = c.Owner.GetType();

                        if (t == typeof(RagingGrizzlyBear)) // Bandaid Fix, we'll keep this until others arise
                        {
                            t = typeof(GrizzlyBear);
                        }

                        for (int i = 0; i < HuntingTrophyInfo.Infos.Count; i++)
                        {
                            HuntingTrophyInfo info = HuntingTrophyInfo.Infos[i];

                            if (t == info.CreatureType)
                            {
                                int v = 0;

                                if (HuntingSystem.Instance != null && HuntingSystem.Instance.IsPrimeHunt(from, c.Location))
                                {
                                    v = Utility.RandomMinMax(0, 100);
                                }
                                else
                                {
                                    v = Utility.RandomMinMax(0, 10000);
                                    v = (int)Math.Sqrt(v);
                                    v = 100 - v;
                                }

                                int measurement = info.MinMeasurement + (int)((info.MaxMeasurement - info.MinMeasurement) * (v / 100.0));
                                m_Permit.KillEntry     = new HuntingKillEntry(m_Permit.Owner, measurement, DateTime.Now, i, WorldLocationInfo.GetLocationString(c.Location, c.Map));
                                c.VisitedByTaxidermist = true;

                                from.PlaySound(0x249);
                                from.PrivateOverheadMessage(Network.MessageType.Regular, 0x45, 1155713, from.NetState); // *You document your kill on the permit*
                                m_Permit.InvalidateProperties();
                                return;
                            }
                        }

                        from.SendLocalizedMessage(1155706); // That is not a valid kill.
                    }
                }
            }