예제 #1
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 = 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];
                    c.DropItem(item);
                }
            }

            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);
        }
예제 #2
0
 public override int GenerateFurs(Corpse c)
 {
     Item i = new LightFur();
     i.Amount = 2;
     c.DropItem( i );
     return 2;
 }
예제 #3
0
		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." );
		}
예제 #4
0
        public override void OnCarve(Mobile from, Corpse corpse, Item with)
        {
            if (corpse != null)
                corpse.DropItem(new DragonBlood(8));

            base.OnCarve(from, corpse, with);
        }
예제 #5
0
파일: Corpse.cs 프로젝트: jicomub/Temrael
        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;

            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
            {
                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);
        }
예제 #6
0
        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);
        }
예제 #7
0
 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);
 }
예제 #8
0
        public static Container Mobile_CreateCorpseHandler(
            Mobile owner, HairInfo hair, FacialHairInfo facialhair, List <Item> initialContent, List <Item> equipItems)
        {
            var c = new Corpse(owner, hair, facialhair, equipItems);

            owner.Corpse = c;

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

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

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

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

                if (pm != null)
                {
                    c.RestoreEquip = pm.EquipSnapshot;
                }
            }

            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);
        }
예제 #9
0
파일: Corpse.cs 프로젝트: nogu3ira/xrunuo
        public InstancedCorpse(Corpse corpse, Mobile m)
            : base(0x2006)
        {
            Movable = false;

            m_Owner = corpse;

            m_Looters = new List <Mobile>();
            m_Looters.Add(m);

            corpse.DropItem(this);
            corpse.EquipItems.Add(this);
        }
예제 #10
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 UndeadRelic());
                    from.SendMessage("Vous arrachez un morceau de chair à la liche");
                }
            }
            base.OnCarve(from, corpse, with);
        }
예제 #11
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);
        }
예제 #12
0
        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;
            }
        }
예제 #13
0
파일: Corpse.cs 프로젝트: nogu3ira/xrunuo
        public static Container Mobile_CreateCorpseHandler(Mobile owner, HairInfo hair, FacialHairInfo facialhair, List <Item> initialContent, List <Item> equipItems)
        {
            Corpse c = new Corpse(owner, hair, facialhair, equipItems);

            owner.Corpse = c;

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

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

                if (owner.IsPlayer)
                {
                    c.SetRestoreInfo(item, item.Location);
                }
            }

            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);
        }
예제 #14
0
        public static Container Mobile_CreateCorpseHandler(Mobile owner, HairInfo hair, FacialHairInfo facialhair, List <Item> initialContent, List <Item> equipItems)
        {
            bool shouldFillCorpse = true;

            Corpse 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];

                    c.DropItem(item);
                    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);

            return(c);
        }
예제 #15
0
        public virtual void OnCarve( Mobile from, Corpse corpse )
        {
            int feathers = Feathers;
            int wool = Wool;
            int meat = Meat;
            int hides = Hides;
            int scales = 0;//Scales;
            int furs = GenerateFurs( corpse );

            if ( (feathers == 0 && furs == 0 && wool == 0 && meat == 0 && hides == 0 && scales == 0) || Summoned )
            {
                from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
            }
            else
            {
                new Blood( 0x122D ).MoveToWorld( corpse.Location, corpse.Map );

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

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

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

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

                if ( hides != 0 )
                {
                    if ( HideType == HideType.Regular )
                        corpse.DropItem( new Hides( hides ) );
                    else if ( HideType == HideType.Spined )
                        corpse.DropItem( new Hides( hides ) );
                    else if ( HideType == HideType.Horned )
                        corpse.DropItem( new Hides( hides ) );
                    else if ( HideType == HideType.Barbed )
                        corpse.DropItem( new Hides( hides ) );
                }

                //if ( hides != 0 || furs != 0 )
                //	from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse.

                corpse.Carved = true;

                if ( corpse.IsCriminalAction( from ) )
                    from.CriminalAction( true );
            }
        }
예제 #16
0
 public override int GenerateFurs(Corpse c)
 {
     c.DropItem( new LightFur() );
     return 1;
 }
예제 #17
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);
        }
예제 #18
0
        public virtual void OnCarve( Mobile from, Corpse corpse )
        {
            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 )
            {
                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;
                }

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

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

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

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

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

                if ( hides != 0 )
                {
                    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.DropItem( new RedScales( scales ) ); break;
                        case ScaleType.Yellow:	corpse.DropItem( new YellowScales( scales ) ); break;
                        case ScaleType.Black:	corpse.DropItem( new BlackScales( scales ) ); break;
                        case ScaleType.Green:	corpse.DropItem( new GreenScales( scales ) ); break;
                        case ScaleType.White:	corpse.DropItem( new WhiteScales( scales ) ); break;
                        case ScaleType.Blue:	corpse.DropItem( new BlueScales( scales ) ); break;
                        case ScaleType.All:
                        {
                            corpse.DropItem( new RedScales( scales ) );
                            corpse.DropItem( new YellowScales( scales ) );
                            corpse.DropItem( new BlackScales( scales ) );
                            corpse.DropItem( new GreenScales( scales ) );
                            corpse.DropItem( new WhiteScales( scales ) );
                            corpse.DropItem( new BlueScales( scales ) );
                            break;
                        }
                    }

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

                corpse.Carved = true;

                if ( corpse.IsCriminalAction( from ) )
                    from.CriminalAction( true );
            }
        }
예제 #19
0
        public virtual void OnCarve( Mobile from, Corpse corpse )
        {
            if ( !from.InRange( corpse.Location, 1 ) )
            {
                from.SendMessage( "You are too far away." );
                return;
            }

            BodyPartsContainer bpc = corpse.FindItemByType( typeof( BodyPartsContainer ) ) as BodyPartsContainer;
            if (bpc == null)
            {
                bpc = new BodyPartsContainer();
                corpse.DropItem( bpc );
            }

            if ( !corpse.Carved && !Summoned && !IsBonded )
            {
                AddBodyParts( bpc, corpse );
                corpse.Carved = true;
            }

            if ( bpc.TotalItems > 0 )
            {
                from.CloseGump( typeof( SkinningGump ) );
                from.SendGump( new SkinningGump( corpse, corpse.FindItemByType( typeof( BodyPartsContainer ) ) as BodyPartsContainer, from ) );
            }
            else
                from.SendMessage( "There's nothing left to carve." );

            PlayerMobile pm = from as PlayerMobile;
            if ( pm != null )
            {
                OnXMLEvent( XMLEventType.OnCarveInvokeOnMobile, pm );
                OnXMLEvent( XMLEventType.OnCarveInvokeOnItem, corpse );
                OnXMLEvent( XMLEventType.OnCarve );
            }
        }
예제 #20
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.");
                        }
                    }
                }
            }
예제 #21
0
파일: Medusa.cs 프로젝트: mcarriere/ServUO
        public override void OnCarve(Mobile from, Corpse corpse, Item with)
        {
            int amount = Utility.Random(5) + 1;

            corpse.DropItem(new MedusaLightScales(amount));

            if (0.20 > Utility.RandomDouble())
                corpse.DropItem(new MedusaBlood());

            base.OnCarve(from, corpse, with);
        }
예제 #22
0
		public virtual void OnCarve( Mobile from, Corpse corpse )
		{
			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 )
			{
				from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
			}
			else
			{
				//	6/8/2004 - Pulse
				//		No longer doubles the resources from corpses if in Felucca, to re-add double resources
				//		un-comment the 6 lines of code below.
				//				if ( corpse.Map == Map.Felucca )
				//				{
				//					feathers *= 2;
				//					wool *= 2;
				//					hides *= 2;
				//				}

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

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

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

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

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

				if ( hides != 0 )
				{
					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.DropItem( new RedScales( scales ) ); break;
						case ScaleType.Yellow:	corpse.DropItem( new YellowScales( scales ) ); break;
						case ScaleType.Black:	corpse.DropItem( new BlackScales( scales ) ); break;
						case ScaleType.Green:	corpse.DropItem( new GreenScales( scales ) ); break;
						case ScaleType.White:	corpse.DropItem( new WhiteScales( scales ) ); break;
						case ScaleType.Blue:	corpse.DropItem( new BlueScales( scales ) ); break;
						case ScaleType.All:
						{
							corpse.DropItem( new RedScales( scales ) );
							corpse.DropItem( new YellowScales( scales ) );
							corpse.DropItem( new BlackScales( scales ) );
							corpse.DropItem( new GreenScales( scales ) );
							corpse.DropItem( new WhiteScales( scales ) );
							corpse.DropItem( new BlueScales( scales ) );
							break;
						}
					}

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

				corpse.Carved = true;

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

			Corpse 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];

					c.DropItem( item );
                    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 );

			return c;
		}
예제 #24
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);
        }
예제 #25
0
		public virtual void OnCarve( Mobile from, Corpse corpse, Item with )
		{
			int feathers = Feathers;
			int wool = Wool;
			int meat = Meat;
			int hides = Hides;

			if ( ( feathers == 0 && wool == 0 && meat == 0 && hides == 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 ( corpse.Map == Map.Felucca )
				{
					feathers *= 2;
					wool *= 2;
					hides *= 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 ( false && ( 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.
					}
				}

				corpse.Carved = true;

				if ( corpse.IsCriminalAction( from ) )
					from.CriminalAction( true );
			}
		}
예제 #26
0
		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 );
			}
		}
예제 #27
0
파일: Corpse.cs 프로젝트: Ravenwolfe/xrunuo
        public InstancedCorpse( Corpse corpse, Mobile m )
            : base(0x2006)
        {
            Movable = false;

            m_Owner = corpse;

            m_Looters = new List<Mobile>();
            m_Looters.Add( m );

            corpse.DropItem( this );
            corpse.EquipItems.Add( this );
        }
예제 #28
0
파일: Corpse.cs 프로젝트: Ravenwolfe/xrunuo
        public static Container Mobile_CreateCorpseHandler( Mobile owner, HairInfo hair, FacialHairInfo facialhair, List<Item> initialContent, List<Item> equipItems )
        {
            Corpse c = new Corpse( owner, hair, facialhair, equipItems );
            owner.Corpse = c;

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

                if ( owner.IsPlayer && item.Parent == owner.Backpack )
                    c.AddItem( item );
                else
                    c.DropItem( item );

                if ( owner.IsPlayer )
                    c.SetRestoreInfo( item, item.Location );
            }

            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;
        }
예제 #29
0
        public virtual void OnCarve( Mobile from, Corpse corpse )
        {
            int feathers = Feathers;
            int wool = Wool;
            int meat = Meat;
            int hides = Hides;
            int scales = Scales;
            int lightfur = LightFur;
            int darkfur = DarkFur;

            if ( (feathers == 0 && wool == 0 && meat == 0 && hides == 0 && scales == 0) || Summoned || IsBonded )
            {
                from.SendAsciiMessage( "You see nothing useful to carve from the corpse." );
            }
            else
            {
                if ( corpse.Map == Map.Felucca )
                {
                    feathers *= 2;
                    wool *= 2;
                    hides *= 2;
                }

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

                if ( feathers != 0 )
                {
                    corpse.DropItem( new Feather( feathers ) );
                    from.SendAsciiMessage( "You pluck the bird. The feathers are now on the corpse." );
                }

                if ( wool != 0 )
                {
                    corpse.DropItem( new Wool( wool ) );
                    from.SendAsciiMessage( "You shear it, and the wool is now on the corpse." );
                }

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

                    from.SendAsciiMessage( "You carve some meat, which remains on the corpse." );
                }

                if ( lightfur != 0 )
                {
                    if ( LightFurType == LightFurType.LightFur )
                        corpse.DropItem( new LightFur( lightfur ) );

                    from.SendAsciiMessage ( "You skin it, and the fur is now on the corpse." );
                }

                if ( darkfur != 0 )
                {
                    if ( DarkFurType == DarkFurType.DarkFur )
                        corpse.DropItem( new DarkFur( darkfur ) );

                    from.SendAsciiMessage ( "You skin it, and the fur is now on the corpse." );
                }

                if ( hides != 0 )
                {
                    if ( HideType == HideType.Regular )
                        corpse.DropItem( new Hides( hides ) );
                    else if ( HideType == HideType.Spined )
                        corpse.DropItem( new Hides( hides ) );
                    else if ( HideType == HideType.Horned )
                        corpse.DropItem( new Hides( hides ) );
                    else if ( HideType == HideType.Barbed )
                        corpse.DropItem( new Hides( hides ) );

                    from.SendAsciiMessage( "You skin it, and the hides are now on the corpse." );
                }

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

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

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

                corpse.Carved = true;

                if ( corpse.IsCriminalAction( from ) )
                    from.CriminalAction( true );
            }
        }
예제 #30
0
        public static Container Mobile_CreateCorpseHandler(Mobile owner, HairInfo hair, FacialHairInfo facialhair, List<Item> initialContent, List<Item> equipedItems)
        {
            bool shouldFillCorpse = true;

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

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

            owner.Corpse = c;

            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 );

            return c;
        }
예제 #31
0
        public override void OnCarve(Mobile from, Corpse corpse, Item item)
        {
            corpse.DropItem(new DaemonHeart());
            base.OnCarve(from, corpse, item);

        } 
예제 #32
0
 public override void OnCarve(Mobile from, Corpse corpse, Item item)
 {
     corpse.DropItem(new FishingBait(4));
     base.OnCarve(from, corpse, item);
 }