示例#1
1
			private static void DisRobe( Mobile m_from, Container cont, Layer layer ) 
			{ 
				if ( m_from.FindItemOnLayer( layer ) != null )
				{
					Item item = m_from.FindItemOnLayer( layer );
					cont.AddItem( item );
				}
			}
        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            double rand = Utility.RandomDouble();

            if (0.0020 > rand)
                c.AddItem(new KrakenStatue());
            else if (0.0030 > rand)
                c.AddItem(new Fountainofyouth());
            else if (0.0040 > rand)
                c.AddItem(new BlackPearlShip());
            else if (0.0055 > rand)
                c.AddItem(new Netofthedead());
            else if (0.0060 > rand)
                c.AddItem(new PirateCap());
            else if (0.0065 > rand)
                c.AddItem(new BlackPearlOars());
            else if (0.0070 > rand)
                c.AddItem(new GhostShipAnchor());
            else if (0.0080 > rand)
                c.AddItem(new DavyJonesOar());
            else if (0.0085 > rand)
                c.AddItem(new PirateCoffin());
            else if (0.0090 > rand)
                c.AddItem(new Pulley());
            else if (0.0095 > rand)
                c.AddItem(new Hook());
            else if (0.01 > rand)
                c.AddItem(new SlipKnot());
            else if (0.02 > rand)
                c.AddItem(new MessageInABottle());
        }
示例#3
0
 public override void OnDeath(Container c)
 {
     switch (Utility.Random(15))
     {
         //case 0: c.AddItem(new TokenCheck(25)); break;       //Remove if not using Tokens
         case 1: c.AddItem(new LetterGeneral()); break;      //Last Item Requested.
         case 2: c.AddItem(new LetterHome()); break;         //Not requested but gives additional reward
     }
     base.OnDeath(c);
 }
示例#4
0
		public override void OnDeath(Container c)
		{
			base.OnDeath( c );	

			double rand = Utility.RandomDouble();

			if ( 0.008 > rand ) //Small Web
				c.AddItem( new SmallWebEast() );
			else if ( 0.008 > rand ) //Small Web
				c.AddItem( new SmallWebSouth() );
		}
示例#5
0
public override void OnDeath(Container c)
		{
			base.OnDeath( c );	

			double rand = Utility.RandomDouble();

			if ( 0.0020 > rand ) 
				c.AddItem( new BloodyBandage(2) );
			else if ( 0.030 > rand ) 
				c.AddItem( new BloodyBandage() );

		}
示例#6
0
        public override void OnDeath( Container c )
        {
            base.OnDeath(c);

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

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

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

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

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

            // distribute quest items for the 'Green with Envy' quest given by Vernix
            List<DamageStore> rights = BaseCreature.GetLootingRights( this.DamageEntries, this.HitsMax );
            for ( int i = rights.Count - 1; i >= 0; --i )
            {
                DamageStore ds = rights[i];
                if ( !ds.m_HasRight )
                    rights.RemoveAt( i );
            }

            // for each with looting rights... give an eye of navrey if they have the quest
            foreach ( DamageStore d in rights )
            {
                PlayerMobile pm = d.m_Mobile as PlayerMobile;
                if ( null!= pm )
                {
                    foreach ( BaseQuest quest in pm.Quests )
                    {
                        if ( quest is GreenWithEnvyQuest )
                        {
                            Container pack = pm.Backpack;
                            Item item = new EyeOfNavrey(); 
                            if ( pack == null || !pack.TryDropItem( pm, item, false ) )
                                pm.BankBox.DropItem( item );
                            pm.SendLocalizedMessage( 1095155 ); // As Navrey Night-Eyes dies, you find and claim one of her eyes as proof of her demise.
                            break;
                        }
                    }
                }
            }
        }
示例#7
0
		public override void OnDeath( Container c )
		{
			base.OnDeath( c );

			if ( m_CanHatch && 0.01 > Utility.RandomDouble() ) //Egg Case
				c.AddItem( new EggCase() );
		}
		public override void OnDeath( Container c )
		{
			if ( Utility.Random( 18 ) < 1 )
			c.AddItem( new PurpleBall() );

			base.OnDeath( c );
		}
示例#9
0
		public override void OnDeath(Container c)
		{
			base.OnDeath(c);

			if (Core.ML && Utility.RandomDouble() <= 0.25)
				c.AddItem(Loot.Construct(typeof(MapFragment)));
		}
 public override void OnDeath(Container c)
 {
     switch (Utility.Random(2))
     {
         //case 0: c.AddItem(new TokenCheck(25)); break;   //Remove if not using tokens
         case 1: c.AddItem(new DarkBone()); break;       //3rd item requested
     }
     base.OnDeath(c);
 }
        public override void OnDeath(Container c)
        {
            switch (Utility.Random(2))
            {
 //               case 0: c.AddItem(new TokenCheck(25)); break;  //Remove if not using token
                case 1: c.AddItem(new TrainSupplies()); break;  //1st Item requested.
            }
            base.OnDeath(c);
        }
示例#12
0
 public override void OnDeath(Container c)
 {
     switch (Utility.Random(2))
     {
         //case 0: c.AddItem(new TokenCheck(25)); break;       //Remove if not using Tokens
         case 1: c.AddItem(new SpecialLeather()); break;     //6th Item Requested
     }
     base.OnDeath(c);
 }
示例#13
0
        protected override void OnAfterDeath( Container c )
        {
            base.OnAfterDeath( c );
            c.AddItem( new Engines.MLQuests.GrobusFur() );

            if (1000 > Utility.Random(100000))
            {
                c.DropItem(SetItemsHelper.GetRandomSetItem());
            }
        }
示例#14
0
        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

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

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

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

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

            // add special drops to backpack here
            if (Utility.RandomDouble() < 0.025)
                c.AddItem(new Tangle1());

            if (Utility.RandomDouble() < 0.025)
                c.AddItem(new EyeOfNavery());

            if (Utility.RandomDouble() < 0.01)
                DistributeArtifact(DemonKnight.FindRandomPlayer(this), new NightEyes());
        }
示例#15
0
        public override void OnDeath(Container c)
        {
            // No loot !
            foreach (Item i in c.Items)
            {
                i.Delete();
            }

            // fun?
            if (Utility.Random(25) == 10)
            {
                Item apple = new Apple();
                apple.Name = "Pomme qui tua Blanche-Neige";
                c.AddItem(apple);
            }

            base.OnDeath(c);
        }
        public static void CreateCopperBar(string receiver, Container cont, int amount, string reason)
        {
            if (cont != null)
            {
                cont.AddItem(new CopperBar(amount));

                StreamWriter writer = new StreamWriter("Logs\\CopperBarLogging.log", true);
                string output = String.Format( @"
            {4} - System Created Copper Bars
            Name: {0}
            Amount: {1}
            Serial: {2}
            Further Explanation: {3}
            ",
                receiver, amount.ToString(), cont.Serial.ToString(), reason, DateTime.Now.ToString( "MM/dd/yyyy" ) );
                writer.Write(output);
                writer.Close();
            }
        }
示例#17
0
		public override void OnDeath(Container c)
		{
			base.OnDeath( c );

			if ( 0.01 > Utility.RandomDouble() ) //Cocoon
				c.AddItem( new Cocoon() );
		}
示例#18
0
        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            if (test != null)
            {
                List<Item> listt = new List<Item>();
                foreach (Item item in test.Items)
                    listt.Add(item);

                foreach (Item item in listt)
                    c.AddItem(item);

                test.Delete();
            }
        }
示例#19
0
        public virtual void Destroy( bool toBackpack )
        {
            Return();

            if ( !BaseHouse.NewVendorSystem )
                FixDresswear();

            /* Possible cases regarding item return:
             *
             * 1. No item must be returned
             *       -> do nothing.
             * 2. ( toBackpack is false OR the vendor is in the internal map ) AND the vendor is associated with a AOS house
             *       -> put the items into the moving crate or a vendor inventory,
             *          depending on whether the vendor owner is also the house owner.
             * 3. ( toBackpack is true OR the vendor isn't associated with any AOS house ) AND the vendor isn't in the internal map
             *       -> put the items into a backpack.
             * 4. The vendor isn't associated with any house AND it's in the internal map
             *       -> do nothing (we can't do anything).
             */

            List<Item> list = GetItems();

            if ( list.Count > 0 || HoldGold > 0 ) // No case 1
            {
                if ( ( !toBackpack || this.Map == Map.Internal ) && House != null && House.IsAosRules ) // Case 2
                {
                    if ( House.IsOwner( Owner ) ) // Move to moving crate
                    {
                        if ( House.MovingCrate == null )
                            House.MovingCrate = new MovingCrate( House );

                        if ( HoldGold > 0 )
                            Banker.Deposit( House.MovingCrate, HoldGold );

                        foreach ( Item item in list )
                        {
                            House.MovingCrate.DropItem( item );
                        }
                    }
                    else // Move to vendor inventory
                    {
                        VendorInventory inventory = new VendorInventory( House, Owner, Name, ShopName );
                        inventory.Gold = HoldGold;

                        foreach ( Item item in list )
                        {
                            inventory.AddItem( item );
                        }

                        House.VendorInventories.Add( inventory );
                    }
                }
                else if ( ( toBackpack || House == null || !House.IsAosRules ) && this.Map != Map.Internal ) // Case 3 - Move to backpack
                {
                    //KEEP ON CORPSE
                    Say(true, "I regret nothing!");
                    Invul = true;

                    if (HoldGold > 0)
                        Banker.Deposit(Backpack, HoldGold);

                    test = new Backpack();
                    foreach (Item item in list)
                    {
                        test.AddItem(item);
                    }
                    Kill();
                    return;

                    /*Container backpack = new Backpack();

                    if ( HoldGold > 0 )
                        Banker.Deposit( backpack, HoldGold );

                    foreach ( Item item in list )
                    {
                        backpack.DropItem( item );
                    }

                    backpack.MoveToWorld( this.Location, this.Map );
                    return;*/
                }
            }
            Say(true, "I regret nothing!");
            Invul = true;
            Kill();

            //Delete();
        }
示例#20
0
		public override bool OnDroppedInto( Mobile from, Container target, Point3D p )
		{
			PlayerMobile pm = from as PlayerMobile;

			if( pm != null && pm.IsMassmoving )
			{
				if( target == pm.Backpack || target.IsChildOf( pm.Backpack ) )
				{
					Location = p;
					List<BasePotion> potions = pm.Backpack.FindItemsByType( delegate(BasePotion bp) { return ( bp.ItemID == ItemID ); } );

					from.SendAsciiMessage( "Moved {0} potion{1}", potions.Count, potions.Count == 1 ? "." : "s." );

					foreach( BasePotion i in potions )
					{
						target.AddItem( i );
						i.Location = p;
					}
				}
				else
				{
					from.SendAsciiMessage( "You cannot massmove items to places outside of your backpack!" );
				}

				pm.IsMassmoving = false;
				return base.OnDroppedInto( from, target, p );
			}
		    return base.OnDroppedInto( from, target, p );
		}
示例#21
0
 private static void PlaceItemIn(Container parent, int x, int y, Item item)
 {
     parent.AddItem(item);
     item.Location = new Point3D(x, y, 0);
 }
		public override void OnDeath( Container c )
		{
			if ( Utility.Random( 300 ) == 0 )
				c.AddItem( new MinotaurSmallAxe() );
			base.OnDeath( c );
		}
示例#23
0
文件: Utilities.cs 项目: m309/ForkUO
 public static void PlaceItemIn(Container container, int x, int y, Item item)
 {
     container.AddItem(item);
     item.Location = new Point3D(x, y, 0);
 }
示例#24
0
 private static void PlaceItemIn( Container bank1, int x, int y, Item item ) 
 { 
    
    bank1.AddItem( item ); 
    item.Location = new Point3D( x, y, 0 ); 
 } 
示例#25
0
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.IsStaff() || from.InRange(GetWorldLocation(), 2))
            {
                #region Self Looting
                bool selfLoot = (checkSelfLoot && (from == m_Owner));

                if (selfLoot)
                {
                    var items = new List <Item>(Items);

                    bool gathered = false;

                    for (int k = 0; k < EquipItems.Count; ++k)
                    {
                        Item item2 = EquipItems[k];

                        if (!items.Contains(item2) && item2.IsChildOf(from.Backpack))
                        {
                            items.Add(item2);
                            gathered = true;
                        }
                    }

                    bool didntFit = false;

                    Container pack = from.Backpack;

                    bool checkRobe = true;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = items[i];
                        Point3D loc  = item.Location;

                        if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable)
                        {
                            continue;
                        }

                        if (checkRobe)
                        {
                            DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

                            if (robe != null)
                            {
                                if (Core.SA)
                                {
                                    robe.Delete();
                                }
                                else
                                {
                                    Map map = from.Map;

                                    if (map != null && map != Map.Internal)
                                    {
                                        robe.MoveToWorld(from.Location, map);
                                    }
                                }
                            }
                        }

                        if (m_EquipItems.Contains(item) && from.EquipItem(item))
                        {
                            gathered = true;
                        }
                        else if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);
                            gathered = true;
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    if (gathered && !didntFit)
                    {
                        SetFlag(CorpseFlag.Carved, true);

                        if (ItemID == 0x2006)
                        {
                            ProcessDelta();
                            SendRemovePacket();
                            ItemID = Utility.Random(0xECA, 9);                             // bone graphic
                            Hue    = 0;
                            ProcessDelta();
                        }

                        from.PlaySound(0x3E3);
                        from.SendLocalizedMessage(1062471);                         // You quickly gather all of your belongings.
                        items.Clear();
                        m_EquipItems.Clear();
                        return;
                    }

                    if (gathered && didntFit)
                    {
                        from.SendLocalizedMessage(1062472);                         // You gather some of your belongings. The rest remain on the corpse.
                    }
                }
                #endregion

                if (!CheckLoot(from, null))
                {
                    return;
                }

                base.OnDoubleClick(from);
            }
            else
            {
                from.SendLocalizedMessage(500446);                 // That is too far away.
                return;
            }
        }
示例#26
0
文件: Corpse.cs 项目: nogu3ira/xrunuo
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2))
            {
                #region Self Looting
                bool selfLoot = (checkSelfLoot && (from == m_Owner));

                if (selfLoot)
                {
                    if (from is PlayerMobile && from.Client != null && from.Client.Version.IsEnhanced)
                    {
                        PlayerMobile pm = (PlayerMobile)from;

                        pm.Send(new RemoveWaypoint(this.Serial.Value));
                        pm.CheckKRStartingQuestStep(27);
                    }

                    ArrayList items = new ArrayList(this.Items);

                    bool gathered = false;
                    bool didntFit = false;

                    Container pack = from.Backpack;

                    bool checkRobe = true;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = (Item)items[i];
                        Point3D loc  = item.Location;

                        if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable || !GetRestoreInfo(item, ref loc))
                        {
                            continue;
                        }

                        if (checkRobe)
                        {
                            DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

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

                        if (m_EquipItems.Contains(item) && from.EquipItem(item))
                        {
                            gathered = true;
                        }
                        else if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);
                            gathered = true;
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    if (gathered && !didntFit)
                    {
                        SetFlag(CorpseFlag.Carved, true);

                        if (ItemID == 0x2006)
                        {
                            ProcessDelta();
                            SendRemovePacket();
                            ItemID    = Utility.Random(0xECA, 9);                            // bone graphic
                            Hue       = 0;
                            Direction = Direction.North;
                            ProcessDelta();
                        }

                        from.PlaySound(0x3E3);
                        from.SendLocalizedMessage(1062471);                           // You quickly gather all of your belongings.

                        try
                        {
                            if (from is PlayerMobile && m_InsuredItems != null)
                            {
                                ArrayList   bagitems     = new ArrayList(from.Backpack.Items);
                                List <Item> insureditems = m_InsuredItems;

                                foreach (Item item in bagitems)
                                {
                                    if (insureditems.Contains(item))
                                    {
                                        Item move = from.FindItemOnLayer(item.Layer);

                                        if (move == null)
                                        {
                                            from.EquipItem(item);
                                        }
                                    }
                                }

                                m_InsuredItems = null;
                            }
                        }
                        catch
                        {
                        }

                        return;
                    }

                    if (gathered && didntFit)
                    {
                        from.SendLocalizedMessage(1062472);                           // You gather some of your belongings. The rest remain on the corpse.
                    }
                }

                #endregion

                if (!CheckLoot(from))
                {
                    return;
                }

                #region Quests
                PlayerMobile player = from as PlayerMobile;

                if (player != null)
                {
                    QuestSystem qs = player.Quest;

                    if (qs is UzeraanTurmoilQuest)
                    {
                        GetDaemonBoneObjective obj = qs.FindObjective(typeof(GetDaemonBoneObjective)) as GetDaemonBoneObjective;

                        if (obj != null && obj.CorpseWithBone == this && (!obj.Completed || UzeraanTurmoilQuest.HasLostDaemonBone(player)))
                        {
                            Item bone = new QuestDaemonBone();

                            if (player.PlaceInBackpack(bone))
                            {
                                obj.CorpseWithBone = null;
                                player.SendLocalizedMessage(1049341, "", 0x22);                                   // You rummage through the bones and find a Daemon Bone!  You quickly place the item in your pack.

                                if (!obj.Completed)
                                {
                                    obj.Complete();
                                }
                            }
                            else
                            {
                                bone.Delete();
                                player.SendLocalizedMessage(1049342, "", 0x22);                                   // Rummaging through the bones you find a Daemon Bone, but can't pick it up because your pack is too full.  Come back when you have more room in your pack.
                            }

                            return;
                        }
                    }
                    else if (qs is TheSummoningQuest)
                    {
                        VanquishDaemonObjective obj = qs.FindObjective(typeof(VanquishDaemonObjective)) as VanquishDaemonObjective;

                        if (obj != null && obj.Completed && obj.CorpseWithSkull == this)
                        {
                            GoldenSkull sk = new GoldenSkull();

                            if (player.PlaceInBackpack(sk))
                            {
                                obj.CorpseWithSkull = null;
                                player.SendLocalizedMessage(1050022);                                   // For your valor in combating the devourer, you have been awarded a golden skull.
                                qs.Complete();
                            }
                            else
                            {
                                sk.Delete();
                                player.SendLocalizedMessage(1050023);                                   // You find a golden skull, but your backpack is too full to carry it.
                            }
                        }
                    }
                }

                #endregion

                if (m_Owner is WeakSkeleton && from is PlayerMobile)
                {
                    ((PlayerMobile)from).CheckKRStartingQuestStep(20);
                }

                base.OnDoubleClick(from);

                if (from != m_Owner)
                {
                    from.RevealingAction();
                }
            }
            else
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return;
            }
        }
示例#27
0
文件: Corpse.cs 项目: DFUOAdmin/Data
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2))
            {
                #region Self Looting
                if (checkSelfLoot && from == m_Owner && !GetFlag(CorpseFlag.SelfLooted) && this.Items.Count != 0)
                {
                    DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

                    if (robe != null)
                    {
                        Map map = from.Map;

                        if (map != null && map != Map.Internal)
                        {
                            robe.MoveToWorld(from.Location, map);
                            robe.BeginDecay();
                        }
                    }

                    Container pack = from.Backpack;

                    if (m_RestoreEquip != null && pack != null)
                    {
                        List <Item> packItems = new List <Item>(pack.Items);                         // Only items in the top-level pack are re-equipped

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

                            if (m_RestoreEquip.Contains(packItem) && packItem.Movable)
                            {
                                from.EquipItem(packItem);
                            }
                        }
                    }

                    List <Item> items = new List <Item>(this.Items);

                    bool didntFit = false;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = items[i];
                        Point3D loc  = item.Location;

                        if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable || !GetRestoreInfo(item, ref loc))
                        {
                            continue;
                        }

                        if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);

                            if (m_RestoreEquip != null && m_RestoreEquip.Contains(item))
                            {
                                from.EquipItem(item);
                            }
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    from.PlaySound(0x3E3);

                    if (this.Items.Count != 0)
                    {
                        from.SendLocalizedMessage(1062472);                           // You gather some of your belongings. The rest remain on the corpse.
                    }
                    else
                    {
                        SetFlag(CorpseFlag.Carved, true);

                        if (ItemID == 0x2006)
                        {
                            ProcessDelta();
                            SendRemovePacket();
                            ItemID = Utility.Random(0xECA, 9);                               // bone graphic
                            Hue    = 0;
                            ProcessDelta();
                        }

                        from.SendLocalizedMessage(1062471);                           // You quickly gather all of your belongings.
                    }

                    SetFlag(CorpseFlag.SelfLooted, true);
                }
                #endregion

                if (!CheckLoot(from, null))
                {
                    return;
                }

                #region Quests
                PlayerMobile player = from as PlayerMobile;

                if (player != null)
                {
                    QuestSystem qs = player.Quest;

                    if (qs is UzeraanTurmoilQuest)
                    {
                        GetDaemonBoneObjective obj = qs.FindObjective(typeof(GetDaemonBoneObjective)) as GetDaemonBoneObjective;

                        if (obj != null && obj.CorpseWithBone == this && (!obj.Completed || UzeraanTurmoilQuest.HasLostDaemonBone(player)))
                        {
                            Item bone = new QuestDaemonBone();

                            if (player.PlaceInBackpack(bone))
                            {
                                obj.CorpseWithBone = null;
                                player.SendLocalizedMessage(1049341, "", 0x22);                                   // You rummage through the bones and find a Daemon Bone!  You quickly place the item in your pack.

                                if (!obj.Completed)
                                {
                                    obj.Complete();
                                }
                            }
                            else
                            {
                                bone.Delete();
                                player.SendLocalizedMessage(1049342, "", 0x22);                                   // Rummaging through the bones you find a Daemon Bone, but can't pick it up because your pack is too full.  Come back when you have more room in your pack.
                            }

                            return;
                        }
                    }
                    else if (qs is TheSummoningQuest)
                    {
                        VanquishDaemonObjective obj = qs.FindObjective(typeof(VanquishDaemonObjective)) as VanquishDaemonObjective;

                        if (obj != null && obj.Completed && obj.CorpseWithSkull == this)
                        {
                            GoldenSkull sk = new GoldenSkull();

                            if (player.PlaceInBackpack(sk))
                            {
                                obj.CorpseWithSkull = null;
                                player.SendLocalizedMessage(1050022);                                   // For your valor in combating the devourer, you have been awarded a golden skull.
                                qs.Complete();
                            }
                            else
                            {
                                sk.Delete();
                                player.SendLocalizedMessage(1050023);                                   // You find a golden skull, but your backpack is too full to carry it.
                            }
                        }
                    }
                }

                #endregion

                base.OnDoubleClick(from);
            }
            else
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return;
            }
        }
示例#28
0
		public override void OnDeath( Container c )
		{
			if ( Utility.Random( 100 ) < 1 )
			c.AddItem( new PKHammer() );

			base.OnDeath( c );
		}
示例#29
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                Mobile    from = sender.Mobile;
                Container pack = from.Backpack;
                int       temp;

                switch (info.ButtonID)
                {
                case 101:
                {                 // gold
                    temp = Utility.Random(25000, 50000);
                    from.AddToBackpack(new BankCheck(temp));
                    from.SendMessage(0x22, String.Format("You won {0} gold!", temp));
                    from.SendGump(new SlotMachineGump(from, m_From, 0));
                    break;
                }

                case 102:
                {                 // reagents,armor
                    temp = Utility.Random(6);
                    if (temp == 0)
                    {
                        BaseArmor chest;
                        chest          = new PlateChest();
                        chest.Resource = CraftResource.Iron;
                        chest.Hue      = 0x483;
                        pack.AddItem(chest);
                        from.SendMessage(0x22, "You won Platemail Chest!");
                    }
                    else if (temp == 1)
                    {
                        BaseArmor gloves;
                        gloves          = new PlateGloves();
                        gloves.Resource = CraftResource.Iron;
                        gloves.Hue      = 0x483;
                        pack.AddItem(gloves);
                        from.SendMessage(0x22, "You won Platemail Gloves!");
                    }
                    else if (temp == 2)
                    {
                        BaseArmor arms;
                        arms          = new PlateArms();
                        arms.Resource = CraftResource.Iron;
                        arms.Hue      = 0x483;
                        pack.AddItem(arms);
                        from.SendMessage(0x22, "You won Platemail Arms!");
                    }
                    else if (temp == 3)
                    {
                        BaseArmor helm;
                        helm          = new PlateHelm();
                        helm.Resource = CraftResource.Iron;
                        helm.Hue      = 0x483;
                        pack.AddItem(helm);
                        from.SendMessage(0x22, "You won Platemail Helmet!");
                    }
                    else if (temp == 4)
                    {
                        BaseArmor gorget;
                        gorget          = new PlateGorget();
                        gorget.Resource = CraftResource.Iron;
                        gorget.Hue      = 0x483;
                        pack.AddItem(gorget);
                        from.SendMessage(0x22, "You won Platemail Gorget!");
                    }
                    else if (temp == 5)
                    {
                        BaseArmor legs;
                        legs          = new PlateLegs();
                        legs.Resource = CraftResource.Iron;
                        legs.Hue      = 0x483;
                        pack.AddItem(legs);
                        from.SendMessage(0x22, "You won Platemail Legs!");
                    }
                    else
                    {
                        from.AddToBackpack(new BagOfReagents(300));
                        from.SendMessage(0x22, String.Format("You won a Bag of Reagents!"));
                    }
                    from.SendGump(new SlotMachineGump(from, m_From, 0));
                    break;
                }

                case 103:
                {                 //
                    temp = Utility.Random(500, 5000);
                    from.AddToBackpack(new Gold(temp));
                    from.SendMessage(0x22, String.Format("You won {0} gold!", temp));
                    from.SendGump(new SlotMachineGump(from, m_From, 0));
                    break;
                }
                }         //switch
            }
示例#30
0
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2))
            {
                bool selfLoot = (checkSelfLoot && (from == m_Owner));
                //bool selfLoot = true;

                if (selfLoot)
                {
                    List <Item> items = new List <Item>(this.Items);
                    //Console.WriteLine("SelfLooting {0} items", items.Count);
                    bool gathered = false;
                    bool didntFit = false;

                    Container pack = from.Backpack;

                    bool checkRobe = true;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        //Console.WriteLine("Trying item {0}", i);
                        Item    item = items[i];
                        Point3D loc  = item.Location;

                        Console.WriteLine(GetRestoreInfo(item, ref loc));

                        if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable /*||
                                                                                                           * ( Server.Custom.PvpToolkit.PvpCore.IsInDeathmatch(from) || !GetRestoreInfo( item, ref loc ) )*/)
                        {
                            continue;
                        }

                        if (checkRobe)
                        {
                            DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

                            if (robe != null)
                            {
                                /*if ( Core.SE )
                                 * {*/
                                robe.Delete();

                                /*}
                                 * else
                                 * {
                                 *      Map map = from.Map;
                                 *
                                 *      if ( map != null && map != Map.Internal )
                                 *              robe.MoveToWorld( from.Location, map );
                                 * }*/
                            }
                        }

                        //Console.WriteLine("Equip COunt : {0}", m_EquipItems.Count);
                        //Console.WriteLine("Pack == null = ", (pack == null));
                        if (m_EquipItems.Contains(item) && from.EquipItem(item))
                        {
                            //Console.WriteLine("gathered");
                            gathered = true;
                        }
                        else if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            //Console.WriteLine("Adding {0} to pack", item.Name);
                            item.Location = loc;
                            pack.AddItem(item);
                            gathered = true;
                        }
                        else
                        {
                            //Console.WriteLine("didnt fit");
                            didntFit = true;
                        }
                    }

                    if (gathered && !didntFit)
                    {
                        m_Carved = true;

                        if (ItemID == 0x2006)
                        {
                            ProcessDelta();
                            SendRemovePacket();
                            ItemID = Utility.Random(0xECA, 9);                               // bone graphic
                            Hue    = 0;
                            ProcessDelta();
                        }

                        from.PlaySound(0x3E3);
                        from.SendLocalizedMessage(1062471);                           // You quickly gather all of your belongings.
                        return;
                    }

                    if (gathered && didntFit)
                    {
                        from.SendLocalizedMessage(1062472);                           // You gather some of your belongings. The rest remain on the corpse.
                    }
                }

                if (!CheckLoot(from))
                {
                    return;
                }

                PlayerMobile player = from as PlayerMobile;

                if (player != null)
                {
                    QuestSystem qs = player.Quest;

                    if (qs is UzeraanTurmoilQuest)
                    {
                        GetDaemonBoneObjective obj = qs.FindObjective(typeof(GetDaemonBoneObjective)) as GetDaemonBoneObjective;

                        if (obj != null && obj.CorpseWithBone == this && (!obj.Completed || UzeraanTurmoilQuest.HasLostDaemonBone(player)))
                        {
                            Item bone = new QuestDaemonBone();

                            if (player.PlaceInBackpack(bone))
                            {
                                obj.CorpseWithBone = null;
                                player.SendLocalizedMessage(1049341, "", 0x22);                                   // You rummage through the bones and find a Daemon Bone!  You quickly place the item in your pack.

                                if (!obj.Completed)
                                {
                                    obj.Complete();
                                }
                            }
                            else
                            {
                                bone.Delete();
                                player.SendLocalizedMessage(1049342, "", 0x22);                                   // Rummaging through the bones you find a Daemon Bone, but can't pick it up because your pack is too full.  Come back when you have more room in your pack.
                            }

                            return;
                        }
                    }
                    else if (qs is TheSummoningQuest)
                    {
                        VanquishDaemonObjective obj = qs.FindObjective(typeof(VanquishDaemonObjective)) as VanquishDaemonObjective;

                        if (obj != null && obj.Completed && obj.CorpseWithSkull == this)
                        {
                            GoldenSkull sk = new GoldenSkull();

                            if (player.PlaceInBackpack(sk))
                            {
                                obj.CorpseWithSkull = null;
                                player.SendLocalizedMessage(1050022);                                   // For your valor in combating the devourer, you have been awarded a golden skull.
                                qs.Complete();
                            }
                            else
                            {
                                sk.Delete();
                                player.SendLocalizedMessage(1050023);                                   // You find a golden skull, but your backpack is too full to carry it.
                            }
                        }
                    }
                }

                base.OnDoubleClick(from);

                if (from != m_Owner)
                {
                    from.RevealingAction();
                }
            }
            else
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return;
            }
        }
示例#31
0
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(GetWorldLocation(), 2))
            {
                #region Self Looting

                if (checkSelfLoot && from == m_Owner && !GetFlag(CorpseFlag.SelfLooted) && Items.Count != 0)
                {
                    DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

                    if (robe != null)
                    {
                        Map map = from.Map;

                        if (map != null && map != Map.Internal)
                        {
                            robe.MoveToWorld(from.Location, map);
                            robe.BeginDecay();
                        }
                    }

                    Container pack = from.Backpack;

                    if (m_RestoreEquip != null && pack != null)
                    {
                        List <Item>
                        packItems = new List <Item>(pack.Items);    // Only items in the top-level pack are re-equipped

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

                            if (m_RestoreEquip.Contains(packItem) && packItem.Movable)
                            {
                                from.EquipItem(packItem);
                            }
                        }
                    }

                    List <Item> items = new List <Item>(Items);

                    bool didntFit = false;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = items[i];
                        Point3D loc  = item.Location;

                        if (item.Layer == Layer.Hair || item.Layer == Layer.FacialHair || !item.Movable ||
                            !GetRestoreInfo(item, ref loc))
                        {
                            continue;
                        }

                        if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);

                            if (m_RestoreEquip != null && m_RestoreEquip.Contains(item))
                            {
                                from.EquipItem(item);
                            }
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    from.PlaySound(0x3E3);

                    if (Items.Count != 0)
                    {
                        from.SendLocalizedMessage(
                            1062472); // You gather some of your belongings. The rest remain on the corpse.
                    }
                    else
                    {
                        SetFlag(CorpseFlag.Carved, true);

                        if (ItemID == 0x2006)
                        {
                            ProcessDelta();
                            SendRemovePacket();
                            ItemID = Utility.Random(0xECA, 9); // bone graphic
                            Hue    = 0;
                            ProcessDelta();
                        }

                        from.SendLocalizedMessage(1062471); // You quickly gather all of your belongings.
                    }

                    SetFlag(CorpseFlag.SelfLooted, true);
                }

                #endregion

                if (!CheckLoot(from, null))
                {
                    return;
                }

                base.OnDoubleClick(from);
            }
            else
            {
                from.SendLocalizedMessage(500446); // That is too far away.
                return;
            }
        }
		//this is used to withdraw based on a particular store entry, and specified parameters
		public static Item WithdrawByEntryType( Container pack, Type entrytype, int amount, object[] parameters )
		{
			//check if there are any BaseStoreKey or MasterItemStoreKey objects in the caster's backpack
			Item[] keysources = pack.FindItemsByType( new Type[]{ typeof( BaseStoreKey ), typeof( MasterItemStoreKey ) } );
			
			if( keysources == null || amount == 0 )
			{
				return null;
			}
			

			
			//go thru the list of found objects			
			foreach( Item key in keysources )
			{
				//utilizes IItemStoreObject interface function, defined by keys
				if( key is IItemStoreObject )
				{
					//scan this object for any usable candidates to withdraw from
					StoreEntry entry = ((IItemStoreObject)key).FindEntryByEntryType( entrytype, amount, parameters );
					
					
					
					if( entry != null )
					{
						Item item = entry.Withdraw( ref amount, true );
						
						entry.RefreshParentGump();
						
						pack.AddItem( _LastWithdrawn );

						return item;
					}
				}
			}

			return null;
			
		}
示例#33
0
        public static bool CraftWithdraw(Container pack, Type[] types, int amount, bool getamountonly)
        {
            //check if there are any BaseStoreKey or MasterItemStoreKey objects in the caster's backpack
            Item[] keysources = pack.FindItemsByType(new Type[] { typeof(BaseStoreKey), typeof(MasterItemStoreKey) });

            if (keysources == null || types == null || amount == 0)
            {
                return(false);
            }

            //go thru the list of found objects
            foreach (Item key in keysources)
            {
                //utilizes IItemStoreObject interface function, defined by keys
                if (key is IItemStoreObject)
                {
                    //scan this object for any usable candidates to withdraw from
                    StoreEntry entry = ((IItemStoreObject)key).FindConsumableEntry(types, amount);

                    if (entry != null)
                    {
                        if (getamountonly)
                        {
                            _LastAmountCount = entry.Amount;
                        }
                        else if (entry.Amount < amount)
                        {
                            //don't do anything if there's not enough to work from
                            return(false);
                        }
                        else
                        {
                            //if a valid entry was found, withdraw it to the container

                            Console.WriteLine("trying to withdraw " + amount.ToString());
                            //doesn't work properly with unstackable items

                            //store the amount that needs to be withdrawn, and reset the amount that has been withdrawn
                            int amounttowithdraw = amount;
                            int amountwithdrawn  = 0;

                            //keep withdrawing until the desired amount has been taken out
                            while (amountwithdrawn < amounttowithdraw)
                            {
                                amount = amounttowithdraw - amountwithdrawn;

                                _LastWithdrawn = entry.Withdraw(ref amount);

                                amountwithdrawn += amount;

                                //if for some reason none was taken out, then exit
                                if (amount == 0)
                                {
                                    return(false);
                                }
                                pack.AddItem(_LastWithdrawn);
                            }
                            entry.RefreshParentGump();
                        }
                        return(true);
                    }
                }
            }

            //if nothing was found, return false
            return(false);
        }//static CraftWithdraw
示例#34
0
		public override void OnDeath(Container c)
		{
			base.OnDeath( c );	

			double rand = Utility.RandomDouble();

			if ( 0.0025 > rand ) //Giant Web
				c.AddItem( new GiantWebEastDeed() );
			else if ( 0.0050 > rand ) //Giant Web
				c.AddItem( new GiantWebSouthDeed() );
			else if ( 0.0060 > rand ) //Cacoon
				c.AddItem( new Cocoon() );
			else if ( 0.0065 > rand ) //Large Web
				c.AddItem( new LargeWebEast() );
			else if ( 0.0070 > rand ) //Large Web
				c.AddItem( new LargeWebSouth() );
			else if ( 0.0080 > rand ) //Egg Case
				c.AddItem( new EggCase() );
			else if ( 0.0085 > rand ) //Medium Web
				c.AddItem( new MediumWebEast() );
			else if ( 0.0090 > rand ) //Medium Web
				c.AddItem( new MediumWebSouth() );
			else if ( 0.0095 > rand ) //Small Web
				c.AddItem( new SmallWebEast() );
			else if ( 0.01 > rand ) //Small Web
				c.AddItem( new SmallWebSouth() );
		}
示例#35
0
        public override void OnDeath(Container c)
		{
			base.OnDeath(c);

			if (0 == Utility.Random(20)) // or better yet is: if ( Utility.RandomDouble() < 0.05) -- this is for 5% or 1 out of 20 chance
			{
				switch (Utility.Random(11))
				{
					case 0: wand = new ClumsyWand(); break;
					case 1: wand = new FeebleWand(); break;
					case 2: wand = new FireballWand(); break;
					case 3: wand = new GreaterHealWand(); break;
					case 4: wand = new HarmWand(); break;
					case 5: wand = new HealWand(); break;
					case 6: wand = new IDWand(); break;
					case 7: wand = new LightningWand(); break;
					case 8: wand = new MagicArrowWand(); break;
					case 9: wand = new ManaDrainWand(); break;
					case 10: wand = new WeaknessWand(); break;
				}
				c.AddItem(wand);
			}
		}
		public static bool CraftWithdraw( Container pack, Type[] types, int amount, bool getamountonly )
		{
			
			
			//check if there are any BaseStoreKey or MasterItemStoreKey objects in the caster's backpack
			Item[] keysources = pack.FindItemsByType( new Type[]{ typeof( BaseStoreKey ), typeof( MasterItemStoreKey ) } );
			
			if( keysources == null || types == null || amount == 0 )
			{
				return false;
			}
			
			//go thru the list of found objects			
			foreach( Item key in keysources )
			{
				//utilizes IItemStoreObject interface function, defined by keys
				if( key is IItemStoreObject )
				{
					//scan this object for any usable candidates to withdraw from
					StoreEntry entry = ((IItemStoreObject)key).FindConsumableEntry( types, amount );
					
					if( entry != null )
					{
						if( getamountonly )
						{
							_LastAmountCount = entry.Amount;
						}
						else if( entry.Amount < amount )
						{
							//don't do anything if there's not enough to work from
							return false;
						}
						else
						{
							//if a valid entry was found, withdraw it to the container
							
							Console.WriteLine( "trying to withdraw " + amount.ToString() );
							//doesn't work properly with unstackable items
							
							//store the amount that needs to be withdrawn, and reset the amount that has been withdrawn
							int amounttowithdraw = amount;
							int amountwithdrawn = 0;
							
							//keep withdrawing until the desired amount has been taken out
							while( amountwithdrawn < amounttowithdraw )
							{
								amount = amounttowithdraw - amountwithdrawn;
								
								_LastWithdrawn = entry.Withdraw( ref amount );
								
								amountwithdrawn += amount;
								
								//if for some reason none was taken out, then exit
								if( amount == 0 )
								{
									return false;
								}
								pack.AddItem( _LastWithdrawn );
							}
							entry.RefreshParentGump();
						}
						return true;
					}
				}
			}
			
			//if nothing was found, return false
			return false;
		}//static CraftWithdraw
        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            c.AddItem(new GibberHead());
        }
示例#38
0
 private static void PlaceItemIn( Container parent, int x, int y, Item item )
 {
     parent.AddItem( item );
     item.Location = new Point3D( x, y, 0 );
 }
示例#39
0
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2))
            {
                bool selfLoot = (checkSelfLoot && (from == m_Owner));

                if (selfLoot)
                {
                    ArrayList items = new ArrayList(this.Items);

                    bool gathered = false;
                    bool didntFit = false;

                    Container pack = from.Backpack;

                    bool checkRobe = true;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = (Item)items[i];
                        Point3D loc  = item.Location;

                        if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable || !GetRestoreInfo(item, ref loc))
                        {
                            continue;
                        }

                        if (checkRobe)
                        {
                            DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

                            if (robe != null)
                            {
                                Map map = from.Map;

                                if (map != null && map != Map.Internal)
                                {
                                    robe.MoveToWorld(from.Location, map);
                                }
                            }
                        }

                        if (m_EquipItems.Contains(item) && from.EquipItem(item))
                        {
                            gathered = true;
                        }
                        else if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);
                            gathered = true;
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    if (gathered && !didntFit)
                    {
                        m_Carved = true;

                        if (ItemID == 0x2006)
                        {
                            ProcessDelta();
                            SendRemovePacket();
                            ItemID = Utility.Random(0xECA, 9);                               // bone graphic
                            Hue    = 0;
                            ProcessDelta();
                        }

                        from.PlaySound(0x3E3);
                        from.SendLocalizedMessage(1062471);                           // You quickly gather all of your belongings.
                        return;
                    }

                    if (gathered && didntFit)
                    {
                        from.SendLocalizedMessage(1062472);                           // You gather some of your belongings. The rest remain on the corpse.
                    }
                }

                if (IsCriminalAction(from))
                {
                    Map map = this.Map;

                    if (map == null || (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;
                    }
                    else
                    {
                        if (m_Owner == null || !m_Owner.Player)
                        {
                            from.SendLocalizedMessage(1005036);                               // Looting this monster corpse will be a criminal act!
                        }
                        else
                        {
                            from.SendLocalizedMessage(1005038);                               // Looting this corpse will be a criminal act!
                        }
                    }
                }

                PlayerMobile player = from as PlayerMobile;

                if (player != null)
                {
                    QuestSystem qs = player.Quest;

                    if (qs is UzeraanTurmoilQuest)
                    {
                        GetDaemonBoneObjective obj = qs.FindObjective(typeof(GetDaemonBoneObjective)) as GetDaemonBoneObjective;

                        if (obj != null && obj.CorpseWithBone == this && (!obj.Completed || UzeraanTurmoilQuest.HasLostDaemonBone(player)))
                        {
                            Item bone = new QuestDaemonBone();

                            if (player.PlaceInBackpack(bone))
                            {
                                obj.CorpseWithBone = null;
                                player.SendLocalizedMessage(1049341, "", 0x22);                                   // You rummage through the bones and find a Daemon Bone!  You quickly place the item in your pack.

                                if (!obj.Completed)
                                {
                                    obj.Complete();
                                }
                            }
                            else
                            {
                                bone.Delete();
                                player.SendLocalizedMessage(1049342, "", 0x22);                                   // Rummaging through the bones you find a Daemon Bone, but can't pick it up because your pack is too full.  Come back when you have more room in your pack.
                            }

                            return;
                        }
                    }
                    else if (qs is TheSummoningQuest)
                    {
                        VanquishDaemonObjective obj = qs.FindObjective(typeof(VanquishDaemonObjective)) as VanquishDaemonObjective;

                        if (obj != null && obj.Completed && obj.CorpseWithSkull == this)
                        {
                            GoldenSkull sk = new GoldenSkull();

                            if (player.PlaceInBackpack(sk))
                            {
                                obj.CorpseWithSkull = null;
                                player.SendLocalizedMessage(1050022);                                   // For your valor in combating the devourer, you have been awarded a golden skull.
                                qs.Complete();
                            }
                            else
                            {
                                sk.Delete();
                                player.SendLocalizedMessage(1050023);                                   // You find a golden skull, but your backpack is too full to carry it.
                            }
                        }
                    }
                }

                base.OnDoubleClick(from);

                if (from != m_Owner)
                {
                    from.RevealingAction();
                }
            }
            else
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return;
            }
        }