Exemplo n.º 1
0
        public static bool UnequipPirateItems(Mobile m)
        {
            ArrayList ItemsToMove   = new ArrayList();
            ArrayList ItemsToDelete = new ArrayList();

            Bag     bag     = new Bag();
            BankBox bankBox = m.BankBox;

            if (bankBox == null || !bankBox.TryDropItem(m, bag, false))
            {
                bag.Delete();
                return(false);
            }

            Bag bag2 = new Bag();

            bag2.Name = "Pirate Curse Unequiped Items";
            bag2.Hue  = m.Hue;

            Container pack = m.Backpack;

            if (pack == null && !pack.CheckHold(m, bag2, false, true))
            {
                bag2.Delete();
                return(false);
            }
            pack.AddItem(bag2);

            foreach (Item item in m.Items)
            {
                if (item.Layer != Layer.Bank && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Layer != Layer.Mount && item.Layer != Layer.Backpack)
                {
                    if (item.Layer == Layer.OneHanded || item.Layer == Layer.Shirt || item.Layer == Layer.Pants || item.Layer == Layer.Helm || item.Layer == Layer.Shoes)
                    {
                        ItemsToDelete.Add(item);
                    }
                    else
                    {
                        ItemsToMove.Add(item);
                    }
                }
            }

            foreach (Item item in ItemsToDelete)
            {
                bag.AddItem(item);
            }
            bag.Delete();

            foreach (Item item in ItemsToMove)
            {
                bag2.AddItem(item);
            }

            RestorePlayerItems(m);

            return(true);
        }
Exemplo n.º 2
0
        private void ReadyPlayer(Mobile m)
        {
            if (!m_ScoreTable.ContainsKey(m.Serial))
                m_ScoreTable.Add(m.Serial, new ScoreKeeper(m));

            if (!m_UseSphereRules)
            {
                #region DistroCode

                bool MagicWeapons = MagicWeaponRule == pMagicWeaponRule.Allowed;
                bool MagicArmor = MagicArmorRule == pMagicArmorRule.Allowed;
                bool Potions = PotionRule == pPotionRule.Allowed;
                bool Bandages = BandageRule == pBandaidRule.Allowed;
                bool Pets = PetRule == pPetRule.Allowed;
                bool Mounts = MountRule == pMountRule.Allowed;

                if (!m.Alive)
                    m.Resurrect();

                Container bp = m.Backpack;
                Container bag = new Bag();
                bag.Hue = 38;
                BankBox bank = m.BankBox;
                Item oncurs = m.Holding;

                if (oncurs != null)
                    bp.DropItem(oncurs);

                m.CurePoison(m);

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

                m.StatMods.Clear();

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

                foreach (Layer layer in PvpCore.EquipmentLayers)
                {
                    Item item = m.FindItemOnLayer(layer);

                    if (item != null)
                    {
                        if (item is BaseWeapon && !MagicWeapons)
                        {
                            BaseWeapon weapon = (BaseWeapon)item;

                            if (weapon.AccuracyLevel != WeaponAccuracyLevel.Regular)
                                items.Add(weapon);
                            else if (weapon.DamageLevel != WeaponDamageLevel.Regular)
                                items.Add(weapon);
                            else if (weapon.DurabilityLevel != WeaponDurabilityLevel.Regular)
                                items.Add(weapon);
                        }
                        else if (item is BaseArmor && !MagicArmor)
                        {
                            BaseArmor armor = (BaseArmor)item;

                            if (armor.Durability != ArmorDurabilityLevel.Regular)
                                items.Add(armor);
                            else if (armor.ProtectionLevel != ArmorProtectionLevel.Regular)
                                items.Add(armor);
                        }
                    }
                }

                if (m.Backpack != null)
                {
                    foreach (Item item in m.Backpack.Items)
                    {
                        if (item != null)
                        {
                            if (item is BaseWeapon && !MagicWeapons)
                            {
                                BaseWeapon weapon = (BaseWeapon) item;

                                if (weapon.AccuracyLevel != WeaponAccuracyLevel.Regular)
                                    items.Add(weapon);
                                else if (weapon.DamageLevel != WeaponDamageLevel.Regular)
                                    items.Add(weapon);
                                else if (weapon.DurabilityLevel != WeaponDurabilityLevel.Regular)
                                    items.Add(weapon);
                            }
                            else if (item is BaseArmor && !MagicArmor)
                            {
                                BaseArmor armor = (BaseArmor) item;

                                if (armor.Durability != ArmorDurabilityLevel.Regular)
                                    items.Add(armor);
                                else if (armor.ProtectionLevel != ArmorProtectionLevel.Regular)
                                    items.Add(armor);
                            }
                            else if (item is BasePotion && !Potions)
                                items.Add(item);
                            else if (item is EtherealMount && !Mounts)
                                items.Add(item);
                            else if (item is Bandage && !Bandages)
                                items.Add(item);
                        }
                    }
                }

                if (!Mounts)
                {
                    if (m.Mount != null)
                    {
                        IMount mount = m.Mount;
                        mount.Rider = null;
                        if (mount is BaseMount)
                        {
                            if (mount is BaseCreature)
                            {
                                BaseCreature bc = (BaseCreature)mount;
                                bc.ControlTarget = null;
                                bc.ControlOrder = OrderType.Stay;
                                bc.Internalize();

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

                                bc.IsStabled = true;
                                m.Stabled.Add(bc);
                                MountCollection.Add(m.Serial, bc);
                                m.SendMessage(38, "Your mount has been moved to the your stables");
                            }
                        }
                    }
                }

                if (items.Count > 0)
                    m.SendMessage(38, "You had items that did not meet the requirements for the deathmatch and were thus moved to your bank.");

                foreach (Item item in items)
                    bag.AddItem(item);

                if (bag.Items.Count > 0)
                    bank.DropItem(bag);
                else
                    bag.Delete();

                #endregion
            }
            
            if (m_EventSupplier != null)
                m_EventSupplier.OnMoveOver(m);

            Contestants.Add(m);

            SpawnMobile(m);

            if ( m_GiveHorses )
                DMHorse.TryGiveHorse(m);

            if (m.NetState != null)
            {
                m.SendMessage(38, "You have joined a deathmatch");
                m.SendMessage(38, "You can check the score with \".DMScore\"");
            }
        }
        protected virtual void FinishEffect(Point3D p, Map map, Mobile from)
        {
            from.RevealingAction();

            from.ShilCheckSkill(SkillName.Fishing, points: 100);

            switch (Utility.Random(10))
            {
            case 0:
            case 1:
            case 2:
            {
                BaseCreature spawn = null;

                if (Utility.Random(11) > 9)
                {
                    spawn = new Kraken();
                }
                else if (Utility.Random(11) > 9)
                {
                    spawn = new Kraken();
                }
                else if (Utility.Random(11) > 9)
                {
                    spawn = new SeaSerpent();
                }

                if (spawn != null)
                {
                    from.SendFailureMessage("You caught something dangerous in your net!");
                    from.ShilCheckSkill(SkillName.Fishing, points: 100);
                    spawn.MoveToWorld(from.Location, from.Map);
                }
                else
                {
                    if (Utility.Random(6) == 2)
                    {
                        var sosBottle = new MessageInABottle();
                        from.AddToBackpack(sosBottle);
                    }
                    else
                    {
                        var pouch = new Pouch();
                        pouch.AddItem(new Gold(Utility.Random(100) + 250));
                        from.AddToBackpack(pouch);
                        from.SendSuccessMessage("You find an old backpack!");
                    }
                }
                break;
            }

            case 3:
            {
                var shell = GetRandomShell(from);
                from.AddToBackpack(shell);
                from.SendSuccessMessage("You find something valuable!");
                break;
            }

            case 4:
            case 5:
            {
                var magicFish = GetFish(from);
                if (magicFish == null)
                {
                    from.AddToBackpack(new Fish(Utility.RandomMinMax(6, 12)));
                    from.ShilCheckSkill(SkillName.Fishing, points: 100);
                }
                else
                {
                    magicFish.Amount = Utility.RandomMinMax(1, 2);
                    from.AddToBackpack(magicFish);
                    from.ShilCheckSkill(SkillName.Fishing, points: 150);
                }
                from.SendSuccessMessage("You caught some fish.");
                break;
            }

            case 6:
            {
                if (Utility.Random(10) > 8)
                {
                    from.AddToBackpack(new FishingTrophy1(from));
                    from.SendSuccessMessage("You catch a trophy!");
                }
                else if (Utility.Random(10) > 8)
                {
                    from.AddToBackpack(new FishingTrophy2(from));
                    from.SendSuccessMessage("You catch a trophy!");
                }
                else
                {
                    var bag = new Bag();
                    bag.AddItem(new Gold(Utility.Random(200) + 150));
                    from.AddToBackpack(bag);
                    from.SendSuccessMessage("You find an old bag!");
                }

                break;
            }

            case 7:
            case 8:
            {
                var remains = GetRemains(from);
                from.AddToBackpack(remains);
                from.SendSuccessMessage("You find human skeleton remains!");
                break;
            }

            case 9:
            {
                var seaSerpent = new SeaSerpent();
                Spawn(from.Location, from.Map, seaSerpent);
                from.SendFailureMessage("You did not catch anything, except...");
                break;
            }
            }

            Delete();
        }
Exemplo n.º 4
0
		public void GivePrizes( Mobile pm )
		{
			bool Won = false;
			int team;
			if( pm.FindItemOnLayer( Layer.Cloak ) != null )
			{
				team = pm.FindItemOnLayer( Layer.Cloak ).Hue;
			}
			else
			{
				pm.SendMessage( "You have no team cloak.  Please ask the GM about this!" );
				return;
			}
			
			if( ( m_Team1 > 0 && m_Team2 == 0 && m_Team3 == 0 && m_Team4 == 0 ) && team == m_Team1Hue )
		{
			Won = true;
			pm.MoveToWorld( Exit1Dest, MapDest );
		}
			if(  (m_Team2 > 0 && m_Team1 == 0 && m_Team3 == 0 && m_Team4 == 0)  && team == m_Team2Hue )
		{
			Won = true;
			pm.MoveToWorld( Exit2Dest, MapDest );
		}
		
			if(  ( m_Team3 > 0 && m_Team2 == 0 && m_Team1 == 0 && m_Team4 == 0) && team == m_Team3Hue )
		{
			Won = true;
			pm.MoveToWorld( Exit3Dest, MapDest );
		}
			if( ( m_Team4 > 0 && m_Team2 == 0 && m_Team3 == 0 && m_Team1 == 0) && team == m_Team4Hue )
		{
			Won = true;	
			pm.MoveToWorld( Exit4Dest, MapDest );
		}
				
			

			if( Won )
			{
				pm.SendMessage( "Your team won!  Here is your prize." );
				if( m_WinnersPrizes == null || m_WinnersPrizes.Count == 0 )
				{
					pm.SendMessage( "The GM did not set an automatic prize.  Please ask them if they are planning on giving one out!" );
					return;
				}
				Bag winnersBag = new Bag();
				Item toGive;
				for( int i = 0; i < m_WinnersPrizes.Count; i++ )
				{
					if( m_WinnersPrizes[i] is BankCheck )
					{
						int bcWorth = ((BankCheck)m_WinnersPrizes[i]).Worth;
						toGive = new BankCheck( bcWorth );
					}
					else
					{
						toGive = (Item)Activator.CreateInstance( m_WinnersPrizes[i].GetType() );
						toGive.Amount = ((Item)m_WinnersPrizes[i]).Amount;
					}
					winnersBag.AddItem( toGive );
				}
				pm.AddToBackpack( winnersBag );
			}
			else
				pm.SendMessage( "Your team did not win this game.  Try again next time!" );
		}