示例#1
0
        // nickfly|gorgan edits for equip method - start

        public override void OnDoubleClick(Mobile from)
        {
            if (!this.Movable)
            {
                from.SendMessage("That item cannot be moved, let alone equipped. Nice try.");
                return;
            }

            if (from.FindItemOnLayer(this.Layer) == this)
            {
                from.Backpack.DropItem(this);
                //from.SendMessage("");
                return;
            }

            if (Parent != from)
            {
                if (!from.InRange(this.GetWorldLocation(), 2))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 906, 1019045); //I can't reach that.
                    return;
                }
            }

            if (!from.Backpack.TryDropItem(from, this, false))
            {
                from.SendMessage("You don't have enough room in your backpack.");
                return;
            }

            if (this.Layer == Layer.TwoHanded)
            {
                from.Backpack.DropItem(from.FindItemOnLayer(Layer.TwoHanded));
                from.Backpack.DropItem(from.FindItemOnLayer(Layer.FirstValid));
                from.EquipItem(this);
                return;
            }

            if (from.FindItemOnLayer(this.Layer) != this)
            {
                from.Backpack.DropItem(from.FindItemOnLayer(this.Layer));
                from.EquipItem(this);
                //from.SendMessage("");
                return;
            }
        }
示例#2
0
 public override void OnDoubleClick(Mobile from)
 {
     if (from.EquipItem(this) || IsChildOf(from))
     {
         from.PlaySound(0x166);
         from.PublicOverheadMessage(MessageType.Emote, 33, true, "*The Daemon claws demand a soul*");
         from.BeginTarget(-1, true, TargetFlags.None, OnTarget);
     }
     else
         from.SendAsciiMessage("You must equip the claws to use them");
 }
示例#3
0
 public override void OnDoubleClick( Mobile m )
 {
    if( Parent != m )
    {
       m.SendMessage( "You must be wearing the robe to use it!" );
    }
    else
    {
       if ( ItemID == 0x2683 || ItemID == 0x2684 )
       {
          m.SendMessage( "You lower the hood." );
          m.PlaySound( 0x57 );
          ItemID = 0x1F03;
          m.NameMod = null;
          m.RemoveItem(this);
          m.EquipItem(this);
          if( m.Kills >= 5)
          {
          m.Criminal = true;
           }
           if( m.GuildTitle != null)
          {
             m.DisplayGuildTitle = true;
           }
       }
       else if ( ItemID == 0x1F03 || ItemID == 0x1F04 )
       {
          m.SendMessage( "You pull the hood over your head." );
          m.PlaySound( 0x57 );
          ItemID = 0x2683;
          m.DisplayGuildTitle = false;
          m.Criminal = false;
          m.RemoveItem(this);
          m.EquipItem(this);
       }
    }
 }
        public static void From(Mobile m)
        {
            if (m.Backpack == null)
                return;

            int key = m.Serial.Value;

            if (Config.AllowPlayerToggle && DisabledPlayers.Contains(key))
                return;

            Item weapon = m.FindItemOnLayer(Layer.OneHanded);

            if (weapon == null || !weapon.Movable)
                weapon = m.FindItemOnLayer(Layer.TwoHanded);

            Item lastWeapon = null;

            if (PlayerWeapons.ContainsKey(key))
                lastWeapon = PlayerWeapons[key];

            if (m.Warmode)
            {
                if ((weapon == null || AllowedToKeep(weapon)) && lastWeapon != null && lastWeapon.IsChildOf(m.Backpack) && lastWeapon.Movable && lastWeapon.Visible && !lastWeapon.Deleted)
                {
                    m.EquipItem(lastWeapon);

                    if (Config.SendOverheadMessage)
                        m.LocalOverheadMessage(Network.MessageType.Emote, m.EmoteHue, false, "*Unsheathes Weapon*");
                }
            }
            else
            {
                if (weapon != null && !AllowedToKeep(weapon))
                {
                    m.Backpack.DropItem(weapon);
                    PlayerWeapons[key] = weapon;

                    if (Config.SendOverheadMessage)
                        m.LocalOverheadMessage(Network.MessageType.Emote, m.EmoteHue, false, "*Sheathes Weapon*");
                }
            }
        }
示例#5
0
        public virtual bool OnFired(Mobile attacker, Mobile defender)
        {
            Container pack = attacker.Backpack;

            if (attacker.InRange(defender.Location, 2))
            {
                return(false);
            }

            if (attacker.Player && this.GetType() == AmmoType)
            {
                this.MoveToWorld(defender.Location, defender.Map);
                attacker.MovingEffect(defender, EffectID, 18, 2, false, false);
                attacker.EquipItem(pack.FindItemByType(AmmoType, true));
                return(true);
            }

            if (attacker.Player && (pack == null || !pack.ConsumeTotal(AmmoType, 1)))
            {
                if (attacker is TeiravonMobile && ((((TeiravonMobile)attacker).IsArcher()) && (((TeiravonMobile)attacker).IsUndead()) && (((TeiravonMobile)attacker).Shapeshifted)))
                {
                    attacker.Damage(2);
                    attacker.MovingEffect(defender, 0xF7E, 18, 1, false, false);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }



            attacker.MovingEffect(defender, EffectID, 18, 1, false, false);

            return(true);
        }
示例#6
0
        public override void OnDoubleClick(Mobile from)
        {
            Item typeE = from.FindItemOnLayer(Layer.TwoHanded);

            if (!from.InRange(this.GetWorldLocation(), 1))
            {
                from.SendMessage(89, "Your too far away from the spinning blade to do any damage.");
            }
            if (typeE != null && typeE is ArmStumps)
            {
                from.SendMessage(89, "Your want the 1st aid kit!!!! not the blades.");
            }
            else
            {
                Item typeA = from.FindItemOnLayer(Layer.OneHanded);
                if (typeA != null)
                {
                    typeA.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map);
                }
                Item typeB = from.FindItemOnLayer(Layer.TwoHanded);
                if (typeB != null)
                {
                    typeB.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map);
                }
                Item typeC = from.FindItemOnLayer(Layer.Gloves);
                if (typeC != null)
                {
                    typeC.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map);
                }
                ArmStumps armStumps = new ArmStumps();
                armStumps.Movable = false;
                from.EquipItem(armStumps);
                from.SendMessage(89, "You have cut off your hands and the stuff they were hold fell to the ground");
                Effects.PlaySound(from.Location, from.Map, 0x218);
                BeginBleed(from);
            }
        }
示例#7
0
        public void TestCorpseContainerPacket(ProtocolChanges changes)
        {
            var m = new Mobile((Serial)0x1);

            m.DefaultMobileInit();

            var weapon = new VikingSword();

            m.EquipItem(weapon);

            var c = new Corpse(m, m.Items);

            var ns = PacketTestUtilities.CreateTestNetState();

            ns.ProtocolChanges = changes;

            var expected = (ns.ContainerGridLines ? (Packet) new CorpseContent6017(m, c) : new CorpseContent(m, c)).Compile();

            ns.SendCorpseContent(m, c);

            var result = ns.SendPipe.Reader.TryRead();

            AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
        }
示例#8
0
文件: BaseAxe.cs 项目: Ziden/ServUO
        public override void OnDoubleClick(Mobile from)
        {
            if (HarvestSystem == null || Deleted)
            {
                return;
            }

            Point3D loc = GetWorldLocation();

            if (!from.InLOS(loc) || !from.InRange(loc, 2))
            {
                from.LocalOverheadMessage(Server.Network.MessageType.Regular, 0x3E9, 1019045); // I can't reach that
                return;
            }
            else if (!IsAccessibleTo(from))
            {
                PublicOverheadMessage(Server.Network.MessageType.Regular, 0x3E9, 1061637); // You are not allowed to access
                return;
            }

            if (!(HarvestSystem is Mining))
            {
                from.SendMessage("Aonde voce gostaria de usar isto ?"); // What do you want to use this item on?
            }
            if (from.FindItemOnLayer(Layer.OneHanded) == this ||
                from.FindItemOnLayer(Layer.TwoHanded) == this)
            {
                HarvestSystem.BeginHarvesting(from, this);
            }
            else
            {
                from.ClearHands();
                from.EquipItem(this);
                HarvestSystem.BeginHarvesting(from, this);
            }
        }
示例#9
0
		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 ) )
					return;

				base.OnDoubleClick( from );
			}
			else
			{
				from.SendLocalizedMessage( 500446 ); // That is too far away.
				return;
			}
		}
示例#10
0
        public override void OnResponse(NetState state, RelayInfo info)           //Function for GumpButtonType.Reply Buttons
        {
            Mobile       from   = state.Mobile;
            PlayerMobile pm     = from as PlayerMobile;
            PlayerModule module = pm.PlayerModule;

            m_cost = 50;            //MOD COST OF WEAPON HERE!!
            Item      wep  = from.FindItemOnLayer(Layer.FirstValid);
            Item      weps = from.FindItemOnLayer(Layer.TwoHanded);
            Container pack = from.Backpack;

            if (wep != null)
            {
                pack.TryDropItem(from, wep, false);
            }

            if (weps != null)
            {
                pack.TryDropItem(from, weps, false);
            }

            switch (info.ButtonID)
            {
            case 0:                     //Cancel
            {
                from.SendMessage("You decide against spending your skill points.");
                //from.SendGump( new LevelGump( from ) );
                break;
            }

            case 1:                     //Katana
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Katana kat = new Katana();
                    (( Item )kat).Name = "Katana [Level Item]";
                    kat.Identified     = true;                                //Prevents others from being used in the upgrading!
                    kat.LootType       = LootType.Blessed;
                    from.EquipItem(kat);
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 2:                     //Broad Sword
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Broadsword bs = new Broadsword();
                    bs.Identified = true;
                    bs.Name       = "Broadsword";
                    bs.LootType   = LootType.Blessed;
                    from.EquipItem(bs);
                    from.SendMessage(102, "You chose a Broadsword");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 3:                     //Scimitar
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Scimitar sc = new Scimitar();
                    sc.Identified = true;
                    sc.Name       = "Scimitar";
                    sc.LootType   = LootType.Blessed;
                    from.EquipItem(sc);
                    from.SendMessage(102, "You chose a Scimitar");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 4:                     //Viking sword
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    VikingSword vs = new VikingSword();
                    vs.Identified = true;
                    vs.Name       = "Vikingsword";
                    vs.LootType   = LootType.Blessed;
                    from.EquipItem(vs);
                    from.SendMessage(102, "You chose a Viking Sword");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 5:                     //Halberd
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Halberd hb = new Halberd();
                    hb.Identified = true;
                    hb.Name       = "Halberd";
                    hb.LootType   = LootType.Blessed;
                    from.EquipItem(hb);
                    from.SendMessage(102, "You chose a Halberd");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 6:                     //Bardiche
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Bardiche bd = new Bardiche();
                    bd.Identified = true;
                    bd.Name       = "Bardiche";
                    bd.LootType   = LootType.Blessed;
                    from.EquipItem(bd);
                    from.SendMessage(102, "You chose a Bardiche");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 7:                     //Double Axe
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    DoubleAxe da = new DoubleAxe();
                    da.Identified = true;
                    da.Name       = "Double Axe";
                    da.LootType   = LootType.Blessed;
                    from.EquipItem(da);
                    from.SendMessage(102, "You chose a Double Axe");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 8:                     //Large Battle Axe
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    LargeBattleAxe lba = new LargeBattleAxe();
                    lba.Identified = true;
                    lba.Name       = "Large Battle Axe";
                    lba.LootType   = LootType.Blessed;
                    from.EquipItem(lba);
                    from.SendMessage(102, "You chose a Large Battle Axe");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 9:                     //Axe
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Axe a = new Axe();
                    a.Identified = true;
                    a.Name       = "Axe";
                    a.LootType   = LootType.Blessed;
                    from.EquipItem(a);
                    from.SendMessage(102, "You chose an Axe");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 10:                     //Kryss
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Kryss k = new Kryss();
                    k.Identified = true;
                    k.Name       = "Kryss";
                    k.LootType   = LootType.Blessed;
                    from.EquipItem(k);
                    from.SendMessage(102, "You chose a Kryss");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 11:                     //War Fork
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    WarFork wf = new WarFork();
                    wf.Identified = true;
                    wf.Name       = "War Fork";
                    wf.LootType   = LootType.Blessed;
                    from.EquipItem(wf);
                    from.SendMessage(102, "You chose a War Fork");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 12:                     //Dagger
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Dagger d = new Dagger();
                    d.Identified = true;
                    d.Name       = "Dagger";
                    d.LootType   = LootType.Blessed;
                    from.EquipItem(d);
                    from.SendMessage(102, "You chose a Dagger");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 13:                     //Pike
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Pike p = new Pike();
                    p.Identified = true;
                    p.Name       = "Pike";
                    p.LootType   = LootType.Blessed;
                    from.EquipItem(p);
                    from.SendMessage(102, "You chose a Pike");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 14:                     //Short Spear
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    ShortSpear ss = new ShortSpear();
                    ss.Identified = true;
                    ss.Name       = "Short Spear";
                    ss.LootType   = LootType.Blessed;
                    from.EquipItem(ss);
                    from.SendMessage(102, "You chose a Short Spear");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 15:                     //Long Spear
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Spear ls = new Spear();
                    ls.Identified = true;
                    ls.Name       = "Long Spear";
                    ls.LootType   = LootType.Blessed;
                    from.EquipItem(ls);
                    from.SendMessage(102, "You chose a Long Spear");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 16:                     //Pitchfork
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Pitchfork p = new Pitchfork();
                    p.Identified = true;
                    p.Name       = "Pitchfork";
                    p.LootType   = LootType.Blessed;
                    from.EquipItem(p);
                    from.SendMessage(102, "You chose a Pitchfork");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 17:                     //lance
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Lance l = new Lance();
                    l.Identified = true;
                    l.Name       = "Lance";
                    l.LootType   = LootType.Blessed;
                    from.EquipItem(l);
                    from.SendMessage(102, "You chose a Lance");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 18:                     //Sai's
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Sai s = new Sai();
                    s.Identified = true;
                    s.Name       = "Sai";
                    s.LootType   = LootType.Blessed;
                    from.EquipItem(s);
                    from.SendMessage(102, "You chose Sai's");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 19:                     //War Mace
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    WarMace wm = new WarMace();
                    wm.Identified = true;
                    wm.Name       = "War Mace";
                    wm.LootType   = LootType.Blessed;
                    from.EquipItem(wm);
                    from.SendMessage(102, "You chose a War Mace");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 20:                     //War Hammer
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    WarHammer wh = new WarHammer();
                    wh.Identified = true;
                    wh.Name       = "War Hammer";
                    wh.LootType   = LootType.Blessed;
                    from.EquipItem(wh);
                    from.SendMessage(102, "You chose a War Hammer");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 21:                     //Maul
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Maul w = new Maul();
                    w.Identified = true;
                    w.Name       = "Maul";
                    w.LootType   = LootType.Blessed;
                    from.EquipItem(w);
                    from.SendMessage(102, "You chose a Maul");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 22:                     //Club
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Club w = new Club();
                    w.Identified = true;
                    w.Name       = "Club";
                    w.LootType   = LootType.Blessed;
                    from.EquipItem(w);
                    from.SendMessage(102, "You chose a Club");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 23:                     //Q Staff
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    QuarterStaff w = new QuarterStaff();
                    w.Identified = true;
                    w.Name       = "Quarter Staff";
                    w.LootType   = LootType.Blessed;
                    from.EquipItem(w);
                    from.SendMessage(102, "You chose a Quarter Staff");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 24:                     //G Staff
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    GnarledStaff w = new GnarledStaff();
                    w.Identified = true;
                    w.Name       = "Gnarled Staff";
                    w.LootType   = LootType.Blessed;
                    from.EquipItem(w);
                    from.SendMessage(102, "You chose a Gnarled Staff");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 25:                     //B Staff
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    BlackStaff w = new BlackStaff();
                    w.Identified = true;
                    w.Name       = "BlackStaff";
                    w.LootType   = LootType.Blessed;
                    from.EquipItem(w);
                    from.SendMessage(102, "You chose a Black Staff");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 26:                     //Hammer Pick
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    HammerPick w = new HammerPick();
                    w.Identified = true;
                    w.Name       = "Hammer Pick";
                    w.LootType   = LootType.Blessed;
                    from.EquipItem(w);
                    from.SendMessage(102, "You chose a Hammer Pick");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 27:                     //War Axe
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    WarAxe w = new WarAxe();
                    w.Identified = true;
                    w.Name       = "War Axe";
                    w.LootType   = LootType.Blessed;
                    from.EquipItem(w);
                    from.SendMessage(102, "You chose a War Axe");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 28:                     //Bow
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Bow w = new Bow();
                    w.Identified = true;
                    w.Name       = "Bow";
                    w.LootType   = LootType.Blessed;
                    from.EquipItem(w);
                    from.SendMessage(102, "You chose a Bow");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 29:                     //Composite Bow
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    CompositeBow w = new CompositeBow();
                    w.Identified = true;
                    w.Name       = "Composite Bow";
                    w.LootType   = LootType.Blessed;
                    from.EquipItem(w);
                    from.SendMessage(102, "You chose a Composite Bow");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 30:                     //Crossbow
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Crossbow w = new Crossbow();
                    w.Identified = true;
                    w.Name       = "Crossbow";
                    w.LootType   = LootType.Blessed;
                    from.EquipItem(w);
                    from.SendMessage(102, "You chose a Crossbow");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 31:                     //Heavy Crossbow
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    HeavyCrossbow w = new HeavyCrossbow();
                    w.Identified = true;
                    w.Name       = "Heavy Crossbow";
                    w.LootType   = LootType.Blessed;
                    from.EquipItem(w);
                    from.SendMessage(102, "You chose a Heavy Crossbow");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 32:                     //Repeating Crossbow
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    RepeatingCrossbow w = new RepeatingCrossbow();
                    w.Identified = true;
                    w.Name       = "Repeating Crossbow";
                    w.LootType   = LootType.Blessed;
                    from.EquipItem(w);
                    from.SendMessage(102, "You chose a Repeating Crossbow");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }

            case 33:                     //Yumi
            {
                if (module.SkillPts < m_cost)
                {
                    from.SendMessage(37, "Not enough skill points!");
                }
                else
                {
                    module.SkillPts -= m_cost;
                    Yumi w = new Yumi();
                    w.Identified = true;
                    w.Name       = "Yumi";
                    w.LootType   = LootType.Blessed;
                    from.EquipItem(w);
                    from.SendMessage(102, "You chose a Yumi");
                }

                from.SendGump(new WepUpgradeGump(from));
                break;
            }
            }
        }
示例#11
0
        private bool SwitchClothes(Mobile from)
        {
            if (BaseHouse.FindHouseAt(from) == null || !BaseHouse.FindHouseAt(from).IsOwner(from))
            {
                from.SendMessage("You must be in your house to use this.");
                return(false);
            }

            if (BaseHouse.FindHouseAt(this) == null || !BaseHouse.FindHouseAt(this).IsOwner(from))
            {
                from.SendMessage("Your Steward must be in your own house to use it.");
                return(false);
            }

            if (BaseHouse.FindHouseAt(this) != null && BaseHouse.FindHouseAt(from) != null &&
                BaseHouse.FindHouseAt(this) != BaseHouse.FindHouseAt(from))
            {
                from.SendMessage("You and your Steward must be in the same house to do that!");
                return(false);
            }

            if (!CanSee(from) || !from.InLOS(this))
            {
                from.SendMessage("You and your Steward must be able to see eachother to do that.");
                return(false);
            }

            List <Item> stewardItems = new List <Item>();
            List <Item> mobileItems  = new List <Item>();

            foreach (Item item in Items)
            {
                if (IsEquipped(item) && !(item is Backpack))
                {
                    stewardItems.Add(item);
                }
            }

            foreach (Item item in from.Items)
            {
                if (IsEquipped(item) && !(item is Backpack))
                {
                    mobileItems.Add(item);
                }
            }

            foreach (Item item in mobileItems)
            {
                from.RemoveItem(item);
            }

            foreach (Item item in stewardItems)
            {
                RemoveItem(item);
            }

            foreach (Item item in mobileItems)
            {
                EquipItem(item);
            }

            bool someRemoved = false;

            foreach (Item item in stewardItems)
            {
                if (!from.EquipItem(item))
                {
                    someRemoved = true;
                    if (!from.AddToBackpack(item))
                    {
                        item.DropToWorld(from, from.Location);
                    }
                }
            }

            if (someRemoved)
            {
                from.SendMessage("You were not able to equip everything.");
                return(false);
            }

            return(true);
        }
示例#12
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!this.Movable || this.Layer == Layer.Invalid || this.Parent is Corpse)
            {
                return;
            }

            if (!from.InRange(this.GetWorldLocation(), 2)) // Do not equip items further than 2 tiles
            {
                from.SendLocalizedMessage(500446);         // That is too far away.
                return;
            }

            m_Mobile = from;
            m_Cont   = this.Parent as Container;
            bool backpack = from.Backpack != null;

            if (from.FindItemOnLayer(this.Layer) == this)
            {
                if (!backpack)
                {
                    from.SendMessage(35, "You have no inventory. Equip inventory bag first.");
                }
                else if (from.Backpack.TryDropItem(from, this, true))
                {
                    from.PlaySound(EquipSound);
                    //from.SendMessage(MessageColorization ? this.Hue : 55, "You put {0} into your backpack.", this.Name != null ? this.Name : this.ItemData.Name);
                }
                return;
            }

            if (this.Layer == Layer.TwoHanded && !(this is BaseShield)) // If item is Two-handed weapon
            {
                if (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(this.Layer) != null)
                {
                    if (!backpack)
                    {
                        from.SendMessage(35, "You have no inventory. Equip inventory bag first.");
                        return;
                    }
                }
                if (from.FindItemOnLayer(Layer.OneHanded) != null && from.FindItemOnLayer(this.Layer) == null)
                {
                    Item item = from.FindItemOnLayer(Layer.OneHanded);
                    DoSwap(item);
                    from.PlaySound(EquipSound);
                    return;
                }
                else if (from.FindItemOnLayer(Layer.OneHanded) != null && from.FindItemOnLayer(this.Layer) != null)
                {
                    Item firstHand  = from.FindItemOnLayer(Layer.OneHanded);
                    Item secondHand = from.FindItemOnLayer(this.Layer);
                    DoSwap(firstHand, secondHand);
                    from.PlaySound(EquipSound);
                    return;
                }
            }

            if (from.FindItemOnLayer(this.Layer) != null)
            {
                if (!backpack)
                {
                    from.SendMessage(35, "You have no inventory. Equip inventory bag first.");
                    return;
                }
                Item item = from.FindItemOnLayer(this.Layer);
                DoSwap(item);
                from.PlaySound(EquipSound);
            }
            else if (this.Layer == Layer.OneHanded && from.FindItemOnLayer(Layer.TwoHanded) != null && !(from.FindItemOnLayer(Layer.TwoHanded) is BaseShield))
            {
                Item item = from.FindItemOnLayer(Layer.TwoHanded);
                DoSwap(item);
                from.PlaySound(EquipSound);
            }
            else
            {
                from.EquipItem(this);
                if (from.FindItemOnLayer(this.Layer) == this)
                {
                    from.PlaySound(EquipSound);
                    //from.SendMessage(MessageColorization ? this.Hue : 75, "You equipped {0}.", this.Name != null ? this.Name : this.ItemData.Name);
                }
            }
        }
        public static void RandomGuardEquipment( Mobile m, Nation nation, int choice )
        {
            if( m == null )
                return;

            if( choice > 3 || choice < 1 )
                choice = Utility.RandomMinMax( 0, 2 );
            else
                choice--;

            switch (nation)
            {
                case Nation.Imperial: { if (Utility.RandomBool()) { nation = Nation.Vhalurian; } else { nation = Nation.Khemetar; } break; }
                case Nation.Sovereign: { if (Utility.RandomBool()) { nation = Nation.Alyrian; } else { nation = Nation.Mhordul; } break; }
                case Nation.Society: { if (Utility.RandomBool()) { nation = Nation.Azhuran; } else { nation = Nation.Tyrean; } break; }
                case Nation.Insularii: { if (Utility.RandomBool()) { nation = Nation.Vhalurian; } else { nation = Nation.Khemetar; } break; }
            }

            switch( nation )
            {
                case Nation.Alyrian:
                {
                    GreenBeret greenberet = new GreenBeret();
                    greenberet.Hue = 2587;
                    m.EquipItem( greenberet );

                    switch( choice )
                    {
                        case 0:
                        {
                            AlyrianChainChest chest = new AlyrianChainChest();
                            chest.Resource = CraftResource.Bronze;

                            AlyrianChainLegs legs = new AlyrianChainLegs();
                            legs.Resource = CraftResource.Bronze;

                            AlyrianChainArms arms = new AlyrianChainArms();
                            arms.Resource = CraftResource.Bronze;

                            AlyrianChainGorget gorget = new AlyrianChainGorget();
                            gorget.Resource = CraftResource.Bronze;

                            m.EquipItem( chest );
                            m.EquipItem( legs );
                            m.EquipItem( arms );
                            m.EquipItem( gorget );
                            m.EquipItem( new Cloak( 2587 ) );

                            if( m.Female )
                            {
                                AlyrianLeafShield shield = new AlyrianLeafShield();
                                shield.Resource = CraftResource.Bronze;

                                AlyrianSabre sabre = new AlyrianSabre();
                                sabre.Resource = CraftResource.Bronze;

                                m.EquipItem( shield );
                                m.EquipItem( sabre );
                                m.EquipItem( new FemaleKilt( 2587 ) );
                            }

                            else
                            {
                                AlyrianTwoHandedAxe axe = new AlyrianTwoHandedAxe();
                                axe.Resource = CraftResource.Bronze;

                                m.EquipItem( axe );
                                m.EquipItem( new ElegantKilt( 2587 ) );
                            }

                            break;
                        }

                        case 1:
                        {
                            if( m.Female )
                            {
                                AlyrianRoundShield shield = new AlyrianRoundShield();
                                shield.Resource = CraftResource.Bronze;

                                AlyrianLongsword sword = new AlyrianLongsword();
                                sword.Resource = CraftResource.Bronze;

                                m.EquipItem( shield );
                                m.EquipItem( sword );
                                m.EquipItem( new ElegantFemaleKilt( 2587 ) );
                                m.EquipItem( new MetallicBra() );
                                m.EquipItem( new ElegantShoes() );
                            }

                            else
                            {
                                AlyrianClaymore sword = new AlyrianClaymore();
                                sword.Resource = CraftResource.Bronze;

                                m.EquipItem( sword );
                                m.EquipItem( new OrnateKilt( 2587 ) );
                                m.EquipItem( new Sandals() );
                            }

                            break;
                        }

                        case 2:
                        {
                            if( m.Female )
                            {
                                AlyrianLongbow bow = new AlyrianLongbow();
                                bow.Resource = CraftResource.Redwood;

                                m.EquipItem( bow );
                                m.EquipItem( new ElegantKilt( 2587 ) );
                                m.EquipItem( new MetallicBra() );

                            }

                            else
                            {
                                AlyrianGiantBow bow = new AlyrianGiantBow();
                                bow.Resource = CraftResource.Redwood;

                                m.EquipItem( bow );
                                m.EquipItem( new PlainKilt( 2587 ) );
                            }

                            m.EquipItem( new Sandals() );

                            if( m is BaseCreature )
                            {
                                BaseCreature bc = m as BaseCreature;
                                bc.AI = AIType.AI_Archer;
                                bc.PackItem( new Arrow( Utility.RandomMinMax( 10, 20 ) ) );
                            }

                            break;
                        }
                    }

                    break;
                }

                case Nation.Azhuran:
                {
                    switch( choice )
                    {
                        case 0:
                        {
                            AzhuranHelm helm = new AzhuranHelm();
                            helm.Resource = CraftResource.Bronze;

                            AzhuranSpikedChainChest chest = new AzhuranSpikedChainChest();
                            chest.Resource = CraftResource.Bronze;

                            RingmailArms arms = new RingmailArms();
                            arms.Resource = CraftResource.Bronze;

                            ChainLegs legs = new ChainLegs();
                            legs.Resource = CraftResource.Bronze;

                            RingmailGloves gloves = new RingmailGloves();
                            gloves.Resource = CraftResource.Bronze;

                            m.EquipItem( helm );
                            m.EquipItem( chest );
                            Sandals sandals = new Sandals();
                            sandals.Resource = CraftResource.BeastLeather;
                            sandals.Hue = 2810;
                            m.EquipItem( sandals );
                            m.EquipItem( gloves );
                            m.EquipItem( arms );
                            m.EquipItem( legs );
                            m.EquipItem( new Cloak( 2810 ) );

                            if( m.Female )
                            {
                                AzhuranKiteShield shield = new AzhuranKiteShield();
                                shield.Resource = CraftResource.Bronze;

                                AzhuranShortsword sword = new AzhuranShortsword();
                                sword.Resource = CraftResource.Bronze;

                                m.EquipItem( shield );
                                m.EquipItem( sword );
                                m.EquipItem( new ElegantWaistCloth( 2810 ) );
                            }

                            else
                            {
                                AzhuranRoundShield shield = new AzhuranRoundShield();
                                shield.Resource = CraftResource.Bronze;

                                AzhuranBroadsword sword = new AzhuranBroadsword();
                                sword.Resource = CraftResource.Bronze;

                                m.EquipItem( shield );
                                m.EquipItem( sword );
                            }

                            break;
                        }

                        case 1:
                        {
                            AzhuranLeatherTunic chest = new AzhuranLeatherTunic();
                            chest.Resource = CraftResource.BeastLeather;

                            AzhuranLeatherPauldrons pauldrons = new AzhuranLeatherPauldrons();
                            pauldrons.Resource = CraftResource.BeastLeather;

                            AzhuranLeatherBoots boots = new AzhuranLeatherBoots();
                            boots.Resource = CraftResource.BeastLeather;

                            AzhuranLeatherLegs legs = new AzhuranLeatherLegs();
                            legs.Resource = CraftResource.BeastLeather;

                            LeatherGloves gloves = new LeatherGloves();
                            gloves.Resource = CraftResource.BeastLeather;

                            LeatherArms arms = new LeatherArms();
                            arms.Resource = CraftResource.BeastLeather;

                            AzhuranSpear spear = new AzhuranSpear();
                            spear.Resource = CraftResource.Bronze;

                            m.EquipItem( chest );
                            m.EquipItem( pauldrons );
                            m.EquipItem( new Bandana( 2810 ) );
                            m.EquipItem( spear );
                            m.EquipItem( boots );
                            m.EquipItem( legs );
                            m.EquipItem( gloves );
                            m.EquipItem( arms );
                            break;
                        }

                        case 2:
                        {
                            Sandals sandals = new Sandals();
                            sandals.Resource = CraftResource.BeastLeather;
                            sandals.Hue = 2810;
                            m.EquipItem( sandals );

                            if( m.Female )
                            {
                                AzhuranShortbow bow = new AzhuranShortbow();
                                bow.Resource = CraftResource.Redwood;

                                m.EquipItem( bow );
                                m.EquipItem( new MetallicBra() );
                                m.EquipItem( new WaistCloth( 2810 ) );
                            }

                            else
                            {
                                AzhuranBoomerang bow = new AzhuranBoomerang();
                                bow.Resource = CraftResource.Redwood;

                                m.EquipItem( bow );
                                m.EquipItem( new LoinCloth( 2810 ) );
                            }

                            if( m is BaseCreature )
                            {
                                BaseCreature bc = m as BaseCreature;
                                bc.AI = AIType.AI_Archer;

                                if( m.Female )
                                    bc.PackItem( new Arrow( Utility.RandomMinMax( 10, 20 ) ) );
                            }

                            break;
                        }
                    }

                    break;
                }

                case Nation.Khemetar:
                {
                    switch( choice )
                    {
                        case 0:
                        {
                            KhemetarScaleChest chest = new KhemetarScaleChest();
                            chest.Resource = CraftResource.Bronze;
                            chest.Hue = 2947;
                            m.EquipItem( chest );

                            PlateLegs legs = new PlateLegs();
                            legs.Resource = CraftResource.Bronze;
                            legs.Hue = 2947;
                            m.EquipItem( legs );

                            PlateArms arms = new PlateArms();
                            arms.Resource = CraftResource.Bronze;
                            arms.Hue = 2947;
                            m.EquipItem( arms );

                            PlateGorget gorget = new PlateGorget();
                            gorget.Resource = CraftResource.Bronze;
                            gorget.Hue = 2947;
                            m.EquipItem( gorget );

                            PlateGloves gloves = new PlateGloves();
                            gloves.Resource = CraftResource.Bronze;
                            gloves.Hue = 2947;
                            m.EquipItem( gloves );

                            KhemetarScaleHelmet helmet = new KhemetarScaleHelmet();
                            helmet.Resource = CraftResource.Bronze;
                            helmet.Hue = 2947;
                            m.EquipItem( helmet );

                            RunicCloak cloak = new RunicCloak();
                            cloak.Hue = 2795;
                            m.EquipItem( cloak );

                            KhemetarAxe axe = new KhemetarAxe();
                            axe.Resource = CraftResource.Bronze;
                            m.EquipItem( axe );

                            if( m.Female )
                            {
                                ElegantWaistCloth waist = new ElegantWaistCloth();
                                waist.Hue = 2795;
                                m.EquipItem( waist );
                            }

                            else
                            {
                                WaistSash sash = new WaistSash();
                                sash.Hue = 2795;
                                m.EquipItem( sash );
                            }

                            break;
                        }

                        case 1:
                        {
                            ThighBoots boots = new ThighBoots();
                            boots.Resource = CraftResource.BeastLeather;
                            boots.Hue = 2947;
                            m.EquipItem( boots );

                            KhemetarScaleChest chest = new KhemetarScaleChest();
                            chest.Resource = CraftResource.Bronze;
                            chest.Hue = 2947;
                            m.EquipItem( chest );

                            KhemetarScaleLegs legs = new KhemetarScaleLegs();
                            legs.Resource = CraftResource.Bronze;
                            legs.Hue = 2947;
                            m.EquipItem( legs );

                            KhemetarScaleArms arms = new KhemetarScaleArms();
                            arms.Resource = CraftResource.Bronze;
                            arms.Hue = 2947;
                            m.EquipItem( arms );

                            RingmailGloves gloves = new RingmailGloves();
                            gloves.Resource = CraftResource.Bronze;
                            gloves.Hue = 2947;
                            m.EquipItem( gloves );

                            KhemetarScaleHelmet helmet = new KhemetarScaleHelmet();
                            helmet.Resource = CraftResource.Bronze;
                            helmet.Hue = 2947;
                            m.EquipItem( helmet );

                            RunicCloak cloak = new RunicCloak();
                            cloak.Hue = 2795;
                            m.EquipItem( cloak );

                            KhemetarKhopesh sword = new KhemetarKhopesh();
                            sword.Resource = CraftResource.Bronze;
                            m.EquipItem( sword );

                            MetalShield shield = new MetalShield();
                            shield.Resource = CraftResource.Bronze;
                            shield.Hue = 2947;
                            m.EquipItem( shield );

                            if( m.Female )
                            {
                                ElegantWaistCloth waist = new ElegantWaistCloth();
                                waist.Hue = 2795;
                                m.EquipItem( waist );
                            }

                            else
                            {
                                WaistSash sash = new WaistSash();
                                sash.Hue = 2795;
                                m.EquipItem( sash );
                            }

                            break;
                        }

                        case 2:
                        {
                            Sandals sandals = new Sandals();
                            sandals.Resource = CraftResource.BeastLeather;
                            sandals.Hue = 2947;
                            m.EquipItem( sandals );

                            KhemetarScaleChest chest = new KhemetarScaleChest();
                            chest.Resource = CraftResource.Bronze;
                            chest.Hue = 2947;
                            m.EquipItem( chest );

                            KhemetarScaleLegs legs = new KhemetarScaleLegs();
                            legs.Resource = CraftResource.Bronze;
                            legs.Hue = 2947;
                            m.EquipItem( legs );

                            KhemetarScaleHelmet helmet = new KhemetarScaleHelmet();
                            helmet.Resource = CraftResource.Bronze;
                            helmet.Hue = 2947;
                            m.EquipItem( helmet );

                            RunicCloak cloak = new RunicCloak();
                            cloak.Hue = 2795;
                            m.EquipItem( cloak );

                            KhemetarLongbow bow = new KhemetarLongbow();
                            bow.Resource = CraftResource.Redwood;
                            m.EquipItem( bow );

                            if( m.Female )
                            {
                                ElegantWaistCloth waist = new ElegantWaistCloth();
                                waist.Hue = 2795;
                                m.EquipItem( waist );
                            }

                            else
                            {
                                WaistSash sash = new WaistSash();
                                sash.Hue = 2795;
                                m.EquipItem( sash );
                            }

                            if( m is BaseCreature )
                            {
                                BaseCreature bc = m as BaseCreature;
                                bc.AI = AIType.AI_Archer;
                                bc.PackItem( new Arrow( Utility.RandomMinMax( 10, 20 ) ) );
                            }

                            break;
                        }
                    }

                    break;
                }

                case Nation.Mhordul:
                {
                    Sandals sandals = new Sandals();
                    sandals.Resource = CraftResource.BeastLeather;
                    sandals.Hue = 1194;
                    m.EquipItem( sandals );

                    MhordulBoneArms mba = new MhordulBoneArms();
                    mba.Hue = 2101;
                    m.EquipItem( mba );

                    switch( choice )
                    {
                        case 0:
                        {
                            MhordulHornedSkullHelm mhsh = new MhordulHornedSkullHelm();
                            mhsh.Hue = 2101;
                            m.EquipItem( mhsh );

                            MhordulBoneChest mbc = new MhordulBoneChest();
                            mbc.Hue = 2101;
                            m.EquipItem( mbc );

                            MhordulBoneLegs mbl = new MhordulBoneLegs();
                            mbl.Hue = 2101;
                            m.EquipItem( mbl );

                            MhordulBoneGloves mbg = new MhordulBoneGloves();
                            mbg.Hue = 2101;
                            m.EquipItem( mbg );

                            MhordulBoneShield mbs = new MhordulBoneShield();
                            mbs.Hue = 2101;
                            m.EquipItem( mbs );

                            if( m.Female )
                            {
                                m.EquipItem( new MhordulBoneSword() );
                                m.EquipItem( new SmallRaggedSkirt( 1194 ) );
                            }

                            else
                            {
                                m.EquipItem( new MhordulBoneAxe() );
                            }

                            break;
                        }

                        case 1:
                        {
                            MhordulBoneHelm mbh = new MhordulBoneHelm();
                            mbh.Hue = 2101;
                            m.EquipItem( mbh );

                            MhordulBoneLegs mbl = new MhordulBoneLegs();
                            mbl.Hue = 2101;
                            m.EquipItem( mbl );

                            MhordulBoneGloves mbg = new MhordulBoneGloves();
                            mbg.Hue = 2101;
                            m.EquipItem( mbg );

                            if( m.Female )
                            {
                                m.EquipItem( new MhordulBoneSpear() );
                                m.EquipItem( new SmallRaggedSkirt( 1194 ) );
                                m.EquipItem( new RaggedBra( 1194 ) );
                            }

                            else
                            {
                                m.EquipItem( new MhordulBoneScythe() );
                                m.EquipItem( new WaistCloth( 1194 ) );
                            }

                            break;
                        }

                        case 2:
                        {
                            MhordulBoneHelm mbh = new MhordulBoneHelm();
                            mbh.Hue = 2101;
                            m.EquipItem( mbh );

                            m.EquipItem( new MhordulBoneBow() );

                            if( m.Female )
                            {
                                m.EquipItem( new SmallRaggedSkirt( 1194 ) );
                                m.EquipItem( new RaggedBra( 1194 ) );
                            }

                            else
                                m.EquipItem( new RaggedPants( 1194 ) );

                            if( m is BaseCreature )
                            {
                                BaseCreature bc = m as BaseCreature;
                                bc.AI = AIType.AI_Archer;
                                bc.PackItem( new Arrow( Utility.RandomMinMax( 10, 20 ) ) );
                            }

                            break;
                        }
                    }

                    break;
                }

                case Nation.Tyrean:
                {
                    Surcoat coat = new Surcoat();
                    coat.ItemID = 15477;
                    coat.Name = "Tyrean Military Surcoat";
                    coat.Hue = 2741;
                    m.EquipItem( coat );

                    switch( choice )
                    {
                        case 0:
                        {
                            TyreanHalfPlateChest thpc = new TyreanHalfPlateChest();
                            thpc.Resource = CraftResource.Bronze;
                            thpc.Hue = 1899;
                            m.EquipItem( thpc );

                            TyreanHalfPlateLegs thpl = new TyreanHalfPlateLegs();
                            thpl.Resource = CraftResource.Bronze;
                            thpl.Hue = 1899;
                            m.EquipItem( thpl );

                            TyreanHalfPlateSabatons thps = new TyreanHalfPlateSabatons();
                            thps.Resource = CraftResource.Bronze;
                            thps.Hue = 1899;
                            m.EquipItem( thps );

                            TyreanHalfPlateArms thpa = new TyreanHalfPlateArms();
                            thpa.Resource = CraftResource.Bronze;
                            thpa.Hue = 1899;
                            m.EquipItem( thpa );

                            TyreanHalfPlateGloves thpg = new TyreanHalfPlateGloves();
                            thpg.Resource = CraftResource.Bronze;
                            thpg.Hue = 1899;
                            m.EquipItem( thpg );

                            TyreanHalfPlateGorget thpo = new TyreanHalfPlateGorget();
                            thpo.Resource = CraftResource.Bronze;
                            thpo.Hue = 1899;
                            m.EquipItem( thpo );

                            TyreanKiteShield tks = new TyreanKiteShield();
                            tks.Resource = CraftResource.Bronze;
                            tks.Hue = 1899;
                            m.EquipItem( tks );

                            m.EquipItem( new Cloak( 1445 ) );

                            TyreanWingedHelm twh = new TyreanWingedHelm();
                            twh.Resource = CraftResource.Bronze;
                            twh.Hue = 1899;
                            m.EquipItem( twh );

                            if( m.Female )
                            {
                                TyreanWarAxe axe = new TyreanWarAxe();
                                axe.Resource = CraftResource.Bronze;

                                m.EquipItem( axe );
                            }

                            else
                            {
                                TyreanOrnateAxe axe = new TyreanOrnateAxe();
                                axe.Resource = CraftResource.Bronze;

                                m.EquipItem( axe );
                            }

                            break;
                        }

                        case 1:
                        {
                            ChainChest cc = new ChainChest();
                            cc.Resource = CraftResource.Bronze;
                            cc.Hue = 1899;
                            m.EquipItem( cc );

                            ChainLegs cl = new ChainLegs();
                            cl.Resource = CraftResource.Bronze;
                            cl.Hue = 1899;
                            m.EquipItem( cl );

                            RingmailArms ra = new RingmailArms();
                            ra.Resource = CraftResource.Bronze;
                            ra.Hue = 1899;
                            m.EquipItem( ra );

                            RingmailGloves rg = new RingmailGloves();
                            rg.Resource = CraftResource.Bronze;
                            rg.Hue = 1899;
                            m.EquipItem( rg );

                            TyreanHornedHelm thh = new TyreanHornedHelm();
                            thh.Resource = CraftResource.Bronze;
                            thh.Hue = 1899;
                            m.EquipItem( thh );

                            FurBoots boots = new FurBoots();
                            boots.Resource = CraftResource.BeastLeather;
                            boots.Hue = 2741;

                            m.EquipItem( boots );

                            if( m.Female )
                            {
                                TyreanHarpoon weapon = new TyreanHarpoon();
                                weapon.Resource = CraftResource.Bronze;

                                m.EquipItem( weapon );
                            }

                            else
                            {
                                TyreanBattleAxe weapon = new TyreanBattleAxe();
                                weapon.Resource = CraftResource.Bronze;

                                m.EquipItem( weapon );
                            }

                            break;
                        }

                        case 2:
                        {
                            LeatherChest lc = new LeatherChest();
                            lc.Resource = CraftResource.BeastLeather;
                            lc.Hue = 1899;
                            m.EquipItem( lc );

                            LeatherLegs ll = new LeatherLegs();
                            ll.Resource = CraftResource.BeastLeather;
                            ll.Hue = 1899;
                            m.EquipItem( ll );

                            LeatherArms la = new LeatherArms();
                            la.Resource = CraftResource.BeastLeather;
                            la.Hue = 1899;
                            m.EquipItem( ll );

                            LeatherGloves lg = new LeatherGloves();
                            lg.Resource = CraftResource.BeastLeather;
                            lg.Hue = 1899;
                            m.EquipItem( lg );

                            LeatherGorget lo = new LeatherGorget();
                            lo.Resource = CraftResource.BeastLeather;
                            lo.Hue = 1899;
                            m.EquipItem( lo );

                            LeatherCap lcap = new LeatherCap();
                            lcap.Resource = CraftResource.BeastLeather;
                            lcap.Hue = 1899;
                            m.EquipItem( lcap );

                            FurBoots boots = new FurBoots();
                            boots.Resource = CraftResource.BeastLeather;
                            boots.Hue = 2741;
                            m.EquipItem( boots );

                            TyreanCompositeBow bow = new TyreanCompositeBow();
                            bow.Resource = CraftResource.Redwood;
                            m.EquipItem( bow );

                            if( m is BaseCreature )
                            {
                                BaseCreature bc = m as BaseCreature;
                                bc.AI = AIType.AI_Archer;
                                bc.PackItem( new Arrow( Utility.RandomMinMax( 10, 20 ) ) );
                            }

                            break;
                        }
                    }

                    break;
                }

                case Nation.Vhalurian:
                {
                    Surcoat coat = new Surcoat();
                    coat.Name = "Vhalurian Military Surcoat";
                    coat.Hue = 1327;
                    coat.ItemID = 15479;
                    m.EquipItem( coat );

                    switch( choice )
                    {
                        case 0:
                        {
                            VhalurianOrnatePlateChest vopc = new VhalurianOrnatePlateChest();
                            vopc.Resource = CraftResource.Bronze;
                            vopc.Hue = 2101;
                            m.EquipItem( vopc );

                            VhalurianOrnatePlateLegs vopl = new VhalurianOrnatePlateLegs();
                            vopl.Resource = CraftResource.Bronze;
                            vopl.Hue = 2101;
                            m.EquipItem( vopl );

                            VhalurianOrnatePlateGorget vopo = new VhalurianOrnatePlateGorget();
                            vopo.Resource = CraftResource.Bronze;
                            vopo.Hue = 2101;
                            m.EquipItem( vopo );

                            PlateSabatons ps = new PlateSabatons();
                            ps.Resource = CraftResource.Bronze;
                            ps.Hue = 2105;
                            m.EquipItem( ps );

                            VhalurianOrnatePlateArms vopa = new VhalurianOrnatePlateArms();
                            vopa.Resource = CraftResource.Bronze;
                            vopa.Hue = 2101;
                            m.EquipItem( vopa );

                            VhalurianOrnatePlateGloves vopg = new VhalurianOrnatePlateGloves();
                            vopg.Resource = CraftResource.Bronze;
                            vopg.Hue = 2101;
                            m.EquipItem( vopg );

                            VhalurianOrnateKiteShield voks = new VhalurianOrnateKiteShield();
                            voks.Resource = CraftResource.Bronze;
                            voks.Hue = 2102;
                            m.EquipItem( voks );

                            m.EquipItem( new Cloak( 1327 ) );

                            if( m.Female )
                            {
                                VhalurianMace mace = new VhalurianMace();
                                mace.Resource = CraftResource.Bronze;

                                m.EquipItem( mace );

                                VhalurianOrnateHelm voh = new VhalurianOrnateHelm();
                                voh.Resource = CraftResource.Bronze;
                                voh.Hue = 2102;
                                m.EquipItem( voh );
                            }

                            else
                            {
                                VhalurianWarHammer mace = new VhalurianWarHammer();
                                mace.Resource = CraftResource.Bronze;

                                m.EquipItem( mace );

                                VhalurianOrnatePlateHelm voph = new VhalurianOrnatePlateHelm();
                                voph.Resource = CraftResource.Bronze;
                                voph.Hue = 2102;
                                m.EquipItem( voph );
                            }

                            break;
                        }

                        case 1:
                        {
                            ChainChest cc = new ChainChest();
                            cc.Resource = CraftResource.Bronze;
                            cc.Hue = 2101;
                            m.EquipItem( cc );

                            ChainLegs cl = new ChainLegs();
                            cl.Resource = CraftResource.Bronze;
                            cl.Hue = 2101;
                            m.EquipItem( cl );

                            ChainCoif co = new ChainCoif();
                            co.Resource = CraftResource.Bronze;
                            co.Hue = 2101;
                            m.EquipItem( co );

                            RingmailArms ra = new RingmailArms();
                            ra.Resource = CraftResource.Bronze;
                            ra.Hue = 2101;
                            m.EquipItem( ra );

                            RingmailGloves rg = new RingmailGloves();
                            rg.Resource = CraftResource.Bronze;
                            rg.Hue = 2101;
                            m.EquipItem( rg );

                            VhalurianMetalKiteShield vmks = new VhalurianMetalKiteShield();
                            vmks.Resource = CraftResource.Bronze;
                            vmks.Hue = 2101;
                            m.EquipItem( vmks );

                            LeatherBoots boots = new LeatherBoots();
                            boots.Resource = CraftResource.BeastLeather;
                            boots.Hue = 2101;

                            m.EquipItem( boots );

                            if( m.Female )
                            {
                                VhalurianGladius sword = new VhalurianGladius();
                                sword.Resource = CraftResource.Bronze;

                                m.EquipItem( sword );
                            }

                            else
                            {
                                VhalurianBroadsword sword = new VhalurianBroadsword();
                                sword.Resource = CraftResource.Bronze;

                                m.EquipItem( sword );
                            }

                            break;
                        }

                        case 2:
                        {
                            LeatherBoots boots = new LeatherBoots();
                            boots.Resource = CraftResource.BeastLeather;
                            boots.Hue = 2101;

                            m.EquipItem( boots );

                            Beret beret = new Beret();
                            beret.Hue = 1327;
                            m.EquipItem( beret );

                            StuddedChest sc = new StuddedChest();
                            sc.Resource = CraftResource.BeastLeather;
                            sc.Hue = 2101;
                            m.EquipItem( sc );

                            StuddedLegs sl = new StuddedLegs();
                            sl.Resource = CraftResource.BeastLeather;
                            sl.Hue = 2101;
                            m.EquipItem( sl );

                            StuddedArms sa = new StuddedArms();
                            sa.Resource = CraftResource.BeastLeather;
                            sa.Hue = 2101;
                            m.EquipItem( sa );

                            StuddedGloves sg = new StuddedGloves();
                            sg.Resource = CraftResource.BeastLeather;
                            sg.Hue = 2101;
                            m.EquipItem( sg );

                            StuddedGorget so = new StuddedGorget();
                            so.Resource = CraftResource.BeastLeather;
                            so.Hue = 2101;
                            m.EquipItem( so );

                            VhalurianLongbow bow = new VhalurianLongbow();
                            bow.Resource = CraftResource.Redwood;

                            m.EquipItem( bow );

                            if( m is BaseCreature )
                            {
                                BaseCreature bc = m as BaseCreature;
                                bc.AI = AIType.AI_Archer;
                                bc.PackItem( new Arrow( Utility.RandomMinMax( 10, 20 ) ) );
                            }

                            break;
                        }
                    }

                    break;
                }
            }
        }
示例#14
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from != m_Owner)
            {
                from.SendAsciiMessage("Only the owner can equip this.");
                return;
            }

            if (from.Mounted)
            {
                from.SendMessage("Can not equip while being mounted.");
                return;
            }

            if (from.HasTrade)
            {
                from.SendMessage("Can not equip while having a trade up.");
                return;
            }

            //This is most likley not needed, but anyways.
            if (from.IsInEvent)
            {
                from.IsInEvent = false;
                from.SendAsciiMessage("You auto supply has been removed.");

                SupplySystem.RemoveEventGear(from);
            }

            for (int i = 0; i < m_EquippedItems.Count; ++i)
            {
                if (!m_EquippedItems[i].IsChildOf(this))
                {
                    continue;
                }

                if (from.FindItemOnLayer(m_EquippedItems[i].Layer) != null)
                {
                    if (from.Backpack != null)
                    {
                        from.AddToBackpack(from.FindItemOnLayer(m_EquippedItems[i].Layer));
                    }
                    else if (m_Owner.BankBox != null)
                    {
                        from.BankBox.DropItem(from.FindItemOnLayer(m_EquippedItems[i].Layer));
                    }
                }

                from.EquipItem(m_EquippedItems[i]);
            }

            for (int i = 0; i < m_BackpackContent.Count; ++i)
            {
                if (m_BackpackContent[i].ItemStored != null)
                {
                    if (!m_BackpackContent[i].ItemStored.IsChildOf(this))
                    {
                        continue;
                    }

                    if (from.Backpack != null)
                    {
                        AddToPack(m_BackpackContent[i]);
                    }
                    else if (from.BankBox != null)
                    {
                        from.BankBox.DropItem(m_BackpackContent[i].ItemStored);
                    }
                }
            }

            if (Items.Count < 1)
            {
                Delete();
            }
        }
        public static void RandomPoorClothes( Mobile m, Nation nation )
        {
            if( m == null )
                return;

            int choice = Utility.RandomMinMax( 0, 2 );

            switch (nation)
            {
                case Nation.Imperial: { if (Utility.RandomBool()) { nation = Nation.Vhalurian; } else { nation = Nation.Khemetar; } break; }
                case Nation.Sovereign: { if (Utility.RandomBool()) { nation = Nation.Alyrian; } else { nation = Nation.Mhordul; } break; }
                case Nation.Society: { if (Utility.RandomBool()) { nation = Nation.Azhuran; } else { nation = Nation.Tyrean; } break; }
                case Nation.Insularii: { if (Utility.RandomBool()) { nation = Nation.Vhalurian; } else { nation = Nation.Khemetar; } break; }
            }

            switch( nation )
            {
                case Nation.Alyrian:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0: m.EquipItem( new FemaleKilt( Utility.RandomNeutralHue() ) ); break;
                            case 1: m.EquipItem( new ElegantFemaleKilt( Utility.RandomNeutralHue() ) ); break;
                            case 2: m.EquipItem( new LongSkirt( Utility.RandomNeutralHue() ) ); break;
                        }

                        if( choice < 2 )
                        {
                            m.EquipItem( new MetallicBra() );
                            m.EquipItem( new ElegantShoes() );
                        }

                        else
                        {
                            m.EquipItem( new Sandals() );
                            m.EquipItem( new Shirt() );
                        }
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0: m.EquipItem( new ElegantKilt( Utility.RandomNeutralHue() ) ); break;
                            case 1: m.EquipItem( new PlainKilt( Utility.RandomNeutralHue() ) ); break;
                            case 2: m.EquipItem( new Kilt( Utility.RandomNeutralHue() ) ); break;
                        }

                        if( choice > 0 )
                        {
                            m.EquipItem( new Sandals() );
                        }

                        else
                        {
                            m.EquipItem( new LeatherBoots() );
                        }
                    }

                    break;
                }

                case Nation.Azhuran:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0: m.EquipItem( new WaistCloth( Utility.RandomNeutralHue() ) ); break;
                            case 1: m.EquipItem( new ElegantWaistCloth( Utility.RandomNeutralHue() ) ); break;
                            case 2: m.EquipItem( new LoinCloth( Utility.RandomNeutralHue() ) ); break;
                        }

                        m.EquipItem( new Sandals() );
                        m.EquipItem( new MetallicBra() );
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0: m.EquipItem( new WaistCloth( Utility.RandomNeutralHue() ) ); break;
                            case 1: m.EquipItem( new ElegantWaistCloth( Utility.RandomNeutralHue() ) ); break;
                            case 2: m.EquipItem( new OrnateWaistCloth( Utility.RandomNeutralHue() ) ); break;
                        }

                        m.EquipItem( new Sandals() );
                    }

                    break;
                }

                case Nation.Khemetar:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0: m.EquipItem( new LongPlainDress() ); break;
                            case 1: m.EquipItem( new LongDress() ); break;
                            case 2: m.EquipItem( new BaggyPants() ); break;
                        }

                        if( choice < 2 )
                            m.EquipItem( new Sandals() );

                        else
                        {
                            m.EquipItem( new WaistSash() );
                            m.EquipItem( new Shirt() );
                        }
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0: m.EquipItem( new LongSkirt() ); break;
                            case 1: m.EquipItem( new ElegantWaistCloth() ); break;
                            case 2: m.EquipItem( new BaggyPants() ); break;
                        }

                        if( choice < 2 )
                            m.EquipItem( new Sandals() );

                        else
                        {
                            m.EquipItem( new WaistSash() );
                        }
                    }

                    break;
                }

                case Nation.Mhordul:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new LongRaggedBra() );
                                m.EquipItem( new RaggedSkirt() );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new RaggedBra() );
                                m.EquipItem( new SmallRaggedSkirt() );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new SmallDress( Utility.RandomNeutralHue() ) );
                                break;
                            }
                        }

                        m.EquipItem( new Sandals() );
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0: m.EquipItem( new RaggedPants( Utility.RandomNeutralHue() ) ); break;
                            case 1: m.EquipItem( new WaistCloth( Utility.RandomNeutralHue() ) ); break;
                            case 2: m.EquipItem( new LoinCloth( Utility.RandomNeutralHue() ) ); break;
                        }

                        m.EquipItem( new Sandals() );
                    }

                    break;
                }

                case Nation.Tyrean:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0: m.EquipItem( new LacedGown( Utility.RandomSlimeHue() ) ); break;
                            case 1: m.EquipItem( new RunedDress( Utility.RandomSlimeHue() ) ); break;
                            case 2:
                            {
                                m.EquipItem( new FancyShirt() );
                                m.EquipItem( new Skirt( Utility.RandomSlimeHue() ) );
                                m.EquipItem( new Boots() );
                                break;
                            }
                        }

                        if( choice < 2 )
                            m.EquipItem( new FurBoots() );
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new LongPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new FancyShirt() );
                                m.EquipItem( new LongVest( Utility.RandomNeutralHue() ) );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new BeltedPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new ExpensiveShirt( Utility.RandomNeutralHue() ) );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new BeltedPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new Tunic( Utility.RandomNeutralHue() ) );
                                break;
                            }
                        }

                        m.EquipItem( new FurBoots() );
                    }

                    break;
                }

                case Nation.Vhalurian:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0: m.EquipItem( new BeltedDress( Utility.RandomSlimeHue() ) ); break;
                            case 1: m.EquipItem( new ElegantGown( Utility.RandomSlimeHue() ) ); break;
                            case 2: m.EquipItem( new LongOrnateDress( Utility.RandomSlimeHue() ) ); break;
                        }

                        m.EquipItem( new Sandals() );
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new Boots() );
                                m.EquipItem( new LongPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new FancyShirt( Utility.RandomSlimeHue() ) );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new LeatherBoots() );
                                m.EquipItem( new BeltedPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new ExpensiveShirt( Utility.RandomSlimeHue() ) );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new BlackLeatherBoots() );
                                m.EquipItem( new BeltedPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new Tunic( Utility.RandomSlimeHue() ) );
                                break;
                            }
                        }
                    }

                    break;
                }
            }
        }
示例#16
0
        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);

                        this.Delete();

                        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;
            }
        }
        public static void RandomRichClothes( Mobile m, Nation nation )
        {
            if( m == null )
                return;

            int choice = Utility.RandomMinMax( 0, 2 );

            switch (nation)
            {
                case Nation.Imperial: { if (Utility.RandomBool()) { nation = Nation.Vhalurian; } else { nation = Nation.Khemetar; } break; }
                case Nation.Sovereign: { if (Utility.RandomBool()) { nation = Nation.Alyrian; } else { nation = Nation.Mhordul; } break; }
                case Nation.Society: { if (Utility.RandomBool()) { nation = Nation.Azhuran; } else { nation = Nation.Tyrean; } break; }
                case Nation.Insularii: { if (Utility.RandomBool()) { nation = Nation.Vhalurian; } else { nation = Nation.Khemetar; } break; }
            }

            switch( nation )
            {
                case Nation.Alyrian:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new ElegantShortDress( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new GoldNecklace() );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new PuffyDress( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new SilverNecklace() );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new OrnateDress( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new SilverBracelet() );
                                break;
                            }
                        }

                        m.EquipItem( new Sandals() );
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new MaleDress( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new Sandals() );
                                m.EquipItem( new GoldBracelet() );
                                break;
                            }

                            case 1:
                            {
                                int hue = Utility.RandomNeutralHue();
                                m.EquipItem( new ElegantTunic( hue ) );
                                m.EquipItem( new ElegantShoes() );
                                m.EquipItem( new BeltedPants() );
                                m.EquipItem( new ElegantCloak( hue ) );
                                m.EquipItem( new GoldBeadNecklace() );
                                break;
                            }

                            case 2:
                            {
                                int hue = Utility.RandomNeutralHue();
                                Bonnet bonnet = new Bonnet();
                                bonnet.Hue = hue;
                                m.EquipItem( bonnet );
                                m.EquipItem( new LeatherBoots() );
                                m.EquipItem( new BeltedPants() );
                                m.EquipItem( new RunicCloak( hue ) );
                                m.EquipItem( new LeatherGloves() );
                                m.EquipItem( new ElegantShirt() );
                                break;
                            }
                        }
                    }

                    break;
                }

                case Nation.Azhuran:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new Skirt( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new SilverBracelet() );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new LongSkirt( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new SilverBracelet() );
                                m.EquipItem( new SilverNecklace() );
                                m.EquipItem( new SilverRing() );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new ShortPlainDress( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new GoldBracelet() );
                                m.EquipItem( new GoldBeadNecklace() );
                                m.EquipItem( new GoldRing() );
                                break;
                            }
                        }

                        m.EquipItem( new Sandals() );

                        if( choice < 2 )
                            m.EquipItem( new MetallicBra() );
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new LongSkirt( Utility.RandomNeutralHue() ) );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new OrnateWaistCloth( Utility.RandomNeutralHue() ) );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new AzhuranLeatherTunic() );
                                break;
                            }
                        }

                        m.EquipItem( new Sandals() );
                        m.EquipItem( new GoldBeadNecklace() );

                        if( choice < 2 )
                        {
                            m.EquipItem( new GoldBracelet() );
                            m.EquipItem( new GoldRing() );
                        }
                    }

                    break;
                }

                case Nation.Khemetar:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new ElegantShortDress() );
                                m.EquipItem( new GoldRing() );
                                m.EquipItem( new GoldBeadNecklace() );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new GildedGown() );
                                m.EquipItem( new FancyGloves() );
                                m.EquipItem( new SilverBeadNecklace() );
                                m.EquipItem( new SilverEarrings() );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new ElegantSkirt() );
                                m.EquipItem( new FancyBra() );
                                m.EquipItem( new GoldBracelet() );
                                break;
                            }
                        }

                        m.EquipItem( new Sandals() );
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new ElegantTunic() );
                                m.EquipItem( new BeltedPants() );
                                m.EquipItem( new ThighBoots() );
                                m.EquipItem( new GoldBeadNecklace() );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new LongSkirt() );
                                m.EquipItem( new GoldEarrings() );
                                m.EquipItem( new GoldBracelet() );
                                m.EquipItem( new GoldRing() );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new BaggyPants() );
                                m.EquipItem( new Shoes() );
                                m.EquipItem( new Doublet() );
                                m.EquipItem( new GoldRing() );
                                m.EquipItem( new GoldBeadNecklace() );
                                break;
                            }
                        }

                        if( choice < 2 )
                            m.EquipItem( new RunicCloak() );

                        if( choice != 1 )
                            m.EquipItem( new WaistSash() );
                    }

                    break;
                }

                case Nation.Mhordul:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new LongRaggedBra() );
                                m.EquipItem( new LongSkirt( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new GoldBeadNecklace() );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new LongRaggedBra() );
                                m.EquipItem( new Skirt( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new GoldEarrings() );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new ShortPlainDress( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new GoldRing() );
                                m.EquipItem( new GoldBeadNecklace() );
                                break;
                            }
                        }

                        m.EquipItem( new Sandals() );
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new RaggedPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new MonsterMask() );
                                break;
                            }
                            case 1:
                            {
                                m.EquipItem( new WaistCloth( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new WolfMask() );
                                break;
                            }
                            case 2:
                            {
                                m.EquipItem( new LongSkirt( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new BearMask() );
                                m.EquipItem( new StuddedArms() );
                                break;
                            }
                        }

                        m.EquipItem( new Sandals() );
                        m.EquipItem( new GoldBeadNecklace() );
                        m.EquipItem( new GoldRing() );

                        if( choice < 2 )
                        {
                            m.EquipItem( new ElegantCloak( Utility.RandomNeutralHue() ) );
                            m.EquipItem( new GoldBracelet() );
                        }
                    }

                    break;
                }

                case Nation.Tyrean:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                int hue = Utility.RandomSlimeHue();
                                Bonnet bonnet = new Bonnet();
                                bonnet.Hue = hue;
                                m.EquipItem( bonnet );
                                m.EquipItem( new LacedGown( hue ) );
                                break;
                            }

                            case 1:
                            {
                                int hue = Utility.RandomSlimeHue();
                                FloppyHat floppy = new FloppyHat();
                                floppy.Hue = hue;
                                m.EquipItem( floppy );
                                m.EquipItem( new LongOrnateDress( hue ) );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new GoldRing() );
                                m.EquipItem( new LongDress( Utility.RandomSlimeHue() ) );
                                break;
                            }
                        }

                        m.EquipItem( new ElegantShoes() );

                        if( choice < 2 )
                        {
                            m.EquipItem( new GoldBracelet() );
                            m.EquipItem( new GoldBeadNecklace() );
                        }
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                int hue = Utility.RandomNeutralHue();
                                m.EquipItem( new ExpensiveShirt() );
                                m.EquipItem( new ThighBoots() );
                                m.EquipItem( new ElegantCloak( hue ) );
                                m.EquipItem( new ElegantTunic( Utility.RandomNeutralHue() ) );
                                break;
                            }

                            case 1:
                            {
                                int hue = Utility.RandomNeutralHue();
                                m.EquipItem( new ExpensiveShirt() );
                                m.EquipItem( new ExpensiveCloak( hue ) );
                                m.EquipItem( new ElegantSurcoat( Utility.RandomNeutralHue() ) );
                                break;
                            }

                            case 2:
                            {
                                int hue = Utility.RandomNeutralHue();
                                m.EquipItem( new ExpensiveCloak( hue ) );
                                m.EquipItem( new ExpensiveShirt() );
                                m.EquipItem( new PaddedVest( Utility.RandomNeutralHue() ) );
                                break;
                            }
                        }

                        m.EquipItem( new BeltedPants( Utility.RandomNeutralHue() ) );

                        if( choice > 0 )
                        {
                            m.EquipItem( new BlackLeatherBoots() );
                        }
                    }

                    break;
                }

                case Nation.Vhalurian:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new ExpensiveLongGown( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new WhiteFeatheredHat() );
                                m.EquipItem( new SilverBeadNecklace() );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new GildedFancyDress( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new GoldBeadNecklace() );
                                m.EquipItem( new ExpensiveCloak() );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new ExpensiveGown( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new ExpensiveHat() );
                                m.EquipItem( new GoldEarrings() );
                                m.EquipItem( new ElegantShoes() );
                                break;
                            }
                        }
                        if( choice < 2 )
                            m.EquipItem( new HighHeels() );
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new ExpensiveShirt( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new ExpensiveCloak() );
                                m.EquipItem( new WhiteFeatheredHat() );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new ExtravagantShirt( Utility.RandomNeutralHue() ) );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new ElegantShoes() );
                                m.EquipItem( new FormalShirt( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new GoldRing() );
                                break;
                            }
                        }
                    }

                    m.EquipItem( new BeltedPants( Utility.RandomNeutralHue() ) );

                    if( choice < 2 )
                            m.EquipItem( new ThighBoots() );

                    if( choice > 0 )
                            m.EquipItem( new ElegantCloak( Utility.RandomNeutralHue() ) );

                    break;
                }
            }
        }
示例#18
0
        public void SwitchClothes(Mobile from, Mobile m)
        {
            List <Item> MobileItems = new List <Item>();

            for (var index = 0; index < from.Items.Count; index++)
            {
                var x = from.Items[index];

                if (IsEquipped(x))
                {
                    MobileItems.Add(x);
                }
            }

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

            for (var index = 0; index < m.Items.Count; index++)
            {
                var x = m.Items[index];

                if (IsEquipped(x))
                {
                    MannequinItems.Add(x);
                }
            }

            for (var index = 0; index < MannequinItems.Count; index++)
            {
                var x = MannequinItems[index];

                m.RemoveItem(x);
            }

            for (var index = 0; index < MobileItems.Count; index++)
            {
                var x = MobileItems[index];

                from.RemoveItem(x);
            }

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

            MannequinItems.ForEach(x =>
            {
                if (x.CanEquip(from))
                {
                    from.EquipItem(x);
                }
                else
                {
                    ExceptItems.Add(x);
                }
            });

            MobileItems.ForEach(x =>
            {
                if (x.CanEquip(m))
                {
                    m.EquipItem(x);
                }
                else
                {
                    ExceptItems.Add(x);
                }
            });

            if (ExceptItems.Count > 0)
            {
                ExceptItems.ForEach(x => from.AddToBackpack(x));
                from.SendLocalizedMessage(1151641, ExceptItems.Count.ToString(), 0x22); // ~1_COUNT~ items could not be swapped between you and the mannequin. These items are now in your backpack, or on the floor at your feet if your backpack is too full to hold them.
            }

            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1151607); // You quickly swap clothes with the mannequin.
        }
示例#19
0
        //Maka : fix the bad code practise
        public void SphereDoubleClick(Mobile from)
        {

            if (Parent == null)
                SpellHelper.Turn(from, this);

            //Maka : New layers
            if (from.FindItemOnLayer(Layer.FirstValid) != null && from.FindItemOnLayer(Layer.FirstValid) != this)
            {
                Item i = from.FindItemOnLayer(Layer.FirstValid);

                if (i != null)
                {
                    from.SendAsciiMessage(string.Format("You put the {0} in your pack.", Sphere.ComputeName(i)));
                    from.AddToBackpack(i);
                }
            }

            if (from.FindItemOnLayer(Layer) != null && from.FindItemOnLayer(Layer) != this)
            {
                Item i = from.FindItemOnLayer(Layer);

                //Is it a shield
                if (i is BaseArmor)
                {
                    from.SendAsciiMessage(string.Format("You put the {0} in your pack.", Sphere.ComputeName(i)));
                    from.AddToBackpack(i);

                    //If its a shield, is he holding a weap
                    i = from.FindItemOnLayer(Layer.OneHanded);

                    if (i != null)
                    {
                        from.SendAsciiMessage(string.Format("You put the {0} in your pack.", Sphere.ComputeName(i)));
                        from.AddToBackpack(i);
                    }
                }
                else
                {
                    i = from.FindItemOnLayer(Layer);

                    from.SendAsciiMessage(string.Format("You put the {0} in your pack.", Sphere.ComputeName(i)));

                    from.AddToBackpack(i);
                }

                from.EquipItem(this);
                from.PlaySound(0x57);
            }
            else if (Layer == Layer.OneHanded && from.FindItemOnLayer(Layer.TwoHanded) != null || Layer == Layer.TwoHanded && from.FindItemOnLayer(Layer.OneHanded) != null)
            {
                Item i = from.FindItemOnLayer(Layer.TwoHanded);

                if (i != null && !(i is BaseShield))
                {
                    from.SendAsciiMessage(string.Format("You put the {0} in your pack.", Sphere.ComputeName(i)));
                    from.AddToBackpack(i);
                }

                from.EquipItem(this);
            }
            else if (Layer == Layer.TwoHanded && from.FindItemOnLayer(Layer.OneHanded) != null)
            {
                Item i = from.FindItemOnLayer(Layer.OneHanded);

                if (i != null)
                {
                    from.SendAsciiMessage(string.Format("You put the {0} in your pack.", Sphere.ComputeName(i)));
                    from.AddToBackpack(i);
                }

                from.EquipItem(this);
            }
            else
                from.EquipItem(this);
        }
示例#20
0
        public void EquipTo(Mobile mobile, bool?deleteConflictOverride = null)
        {
            var itemOne   = mobile.FindItemOnLayer(Layer.OneHanded);
            var itemTwo   = mobile.FindItemOnLayer(Layer.TwoHanded);
            var operation = Operation.Equip;
            var container = this.Parent as Container ?? mobile.Backpack;

            // If target mobile is NPC we delete conflicting item, if player we drop it into their backpack (unless deleteConflictOverride is set)
            var deleteConflict = deleteConflictOverride ?? !(mobile is PlayerMobile);

            if (this.Layer != Layer.OneHanded && this.Layer != Layer.TwoHanded)
            {
                // Item layer is of a simple handling
                itemOne = mobile.FindItemOnLayer(this.Layer);
                if (itemOne != null)
                {
                    operation = Operation.Swap;
                }
            }
            else
            {
                // Handling weapons and shields gets a bit complicated as there are several possible combinations

                if (this.Layer == Layer.TwoHanded)
                {
                    // Trying to equip either two-handed weapon or shield
                    if (this is BaseShield)
                    {
                        // Its a shield!
                        if (itemTwo != null)
                        {
                            operation = Operation.SwapHands;
                        }
                    }
                    else
                    {
                        // Its a two-handed weapon!
                        if (itemTwo != null)
                        {
                            if (itemOne != null)
                            {
                                // Mobile has one handed weapon and shield
                                operation = Operation.Swap3;
                            }
                            else if (itemOne == null)
                            {
                                // Mobile has just two-handed weapon
                                operation = Operation.SwapHands;
                            }
                        }
                        else if (itemOne != null)
                        {
                            // Mobile has just one-handed weapon
                            operation = Operation.SwapHands;
                        }
                    }
                }
                else
                {
                    // Trying to equip one-handed weapon
                    if (itemOne != null)
                    {
                        // Mobile has one-handed weapon
                        if (itemTwo != null && itemTwo is BaseShield)
                        {
                            // Mobile has one-handed weapon and shield (preserve shield)
                            itemTwo = null;
                        }

                        operation = Operation.SwapHands;
                    }
                    else if (itemTwo != null && !(itemTwo is BaseShield))
                    {
                        // Mobile has two-handed weapon
                        operation = Operation.SwapHands;
                    }
                }
            }

            var layerToSwap = itemOne;

            switch (operation)
            {
            case Operation.SwapHands:
                layerToSwap = itemTwo ?? itemOne;
                goto case Operation.Swap;

            case Operation.Swap:
                if (!deleteConflict)
                {
                    if (container.TryDropItem(mobile, layerToSwap, mobile is PlayerMobile))
                    {
                        if (mobile.EquipItem(this) && mobile is PlayerMobile)
                        {
                            mobile.SendMessage(this.Hue, "You swapped {0} with {1}.", layerToSwap.Name, this.Name);
                            layerToSwap.Location = this.Location;
                        }
                    }
                }
                else
                {
                    layerToSwap.Delete();
                    goto default;
                }
                break;

            case Operation.Swap3:
                if (!deleteConflict)
                {
                    if (container.TryDropItem(mobile, itemOne, mobile is PlayerMobile) && container.TryDropItem(mobile, itemTwo, mobile is PlayerMobile))
                    {
                        if (mobile.EquipItem(this) && mobile is PlayerMobile)
                        {
                            mobile.SendMessage(this.Hue, "You swapped {0} and {1} with {2}.", itemOne.Name, itemTwo.Name, this.Name);
                            itemOne.Location = this.Location;
                            itemTwo.Location = this.Location;
                        }
                    }
                }
                else
                {
                    itemOne.Delete();
                    itemTwo.Delete();
                    goto default;
                }
                break;

            default:
                if (mobile.EquipItem(this) && mobile is PlayerMobile)
                {
                    var typeString = this is BaseWeapon ? "unsheated" : this is BaseClothing ? "dressed into" : "equipped";
                    mobile.SendMessage(this.Hue, "You {0} {1}.", typeString, this.Name);
                }

                break;
            }
        }
        public static void RandomCrafterClothes( Mobile m, Nation nation )
        {
            if( m == null )
                return;

            int choice = Utility.RandomMinMax( 0, 2 );

            switch (nation)
            {
                case Nation.Imperial: { if (Utility.RandomBool()) { nation = Nation.Vhalurian; } else { nation = Nation.Khemetar; } break; }
                case Nation.Sovereign: { if (Utility.RandomBool()) { nation = Nation.Alyrian; } else { nation = Nation.Mhordul; } break; }
                case Nation.Society: { if (Utility.RandomBool()) { nation = Nation.Azhuran; } else { nation = Nation.Tyrean; } break; }
                case Nation.Insularii: { if (Utility.RandomBool()) { nation = Nation.Vhalurian; } else { nation = Nation.Khemetar; } break; }
            }

            switch( nation )
            {
                case Nation.Alyrian:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new Shirt( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new FemaleKilt( Utility.RandomNeutralHue() ) );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new ShortPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new MetallicBra() );
                                m.EquipItem( new FullApron( Utility.RandomNeutralHue() ) );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new MetallicBra() );
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new ElegantFemaleKilt( Utility.RandomNeutralHue() ) );
                                break;
                            }
                        }

                        m.EquipItem( new ElegantShoes() );
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new ElegantKilt( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new Sandals() );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new FullApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new BlackLeatherBoots() );
                                m.EquipItem( new BeltedPants() );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new LeatherBoots() );
                                m.EquipItem( new BeltedPants() );
                                m.EquipItem( new LeatherGloves() );
                                m.EquipItem( new ShortPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                break;
                            }
                        }
                    }

                    break;
                }

                case Nation.Azhuran:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new ShortPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new MetallicBra() );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new FullApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new ShortPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new Shirt( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new LeatherGloves() );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new LoinCloth( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new MetallicBra() );
                                break;
                            }
                        }

                        m.EquipItem( new Sandals() );
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new ShortPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new Sandals() );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new FullApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new ShortPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new Sandals() );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new ShortPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new Boots() );
                                m.EquipItem( new LeatherGloves() );
                                break;
                            }
                        }
                    }

                    break;
                }

                case Nation.Khemetar:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new HalfApron() );
                                m.EquipItem( new Sandals() );
                                m.EquipItem( new GoldBeadNecklace() );
                                m.EquipItem( new LongPlainDress( 2983 ) );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new BaggyPants() );
                                m.EquipItem( new FullApron() );
                                m.EquipItem( new Shirt() );
                                m.EquipItem( new Shoes() );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new Doublet() );
                                m.EquipItem( new HalfApron() );
                                m.EquipItem( new LongSkirt() );
                                m.EquipItem( new Sandals() );
                                break;
                            }
                        }
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new BaggyPants() );
                                m.EquipItem( new FullApron() );
                                m.EquipItem( new LeatherGloves() );
                                m.EquipItem( new Shoes() );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new LongSkirt() );
                                m.EquipItem( new HalfApron() );
                                m.EquipItem( new Sandals() );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new BaggyPants() );
                                m.EquipItem( new Shoes() );
                                m.EquipItem( new HalfApron() );
                                break;
                            }
                        }
                    }

                    break;
                }

                case Nation.Mhordul:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new Sandals() );
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new SmallDress( Utility.RandomNeutralHue() ) );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new Boots() );
                                m.EquipItem( new FullApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new RaggedPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new RaggedBra( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new LeatherGloves() );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new SmallRaggedSkirt( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new RaggedBra( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new Sandals() );
                                break;
                            }
                        }
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new RaggedPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new LeatherBoots() );
                                m.EquipItem( new LeatherGloves() );
                                break;
                            }
                            case 1:
                            {
                                m.EquipItem( new RaggedPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new FullApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new Sandals() );
                                break;
                            }
                            case 2:
                            {
                                m.EquipItem( new ShortPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new Sandals() );
                                break;
                            }
                        }
                    }

                    break;
                }

                case Nation.Tyrean:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                int hue = Utility.RandomNeutralHue();
                                Bonnet bonnet = new Bonnet();
                                bonnet.Hue = hue;
                                m.EquipItem( bonnet );
                                m.EquipItem( new PlainDress( hue ) );
                                m.EquipItem( new HalfApron( hue ) );
                                m.EquipItem( new FurBoots() );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new FurBoots() );
                                m.EquipItem( new FancyShirt() );
                                m.EquipItem( new LongPants() );
                                m.EquipItem( new LeatherGloves() );
                                m.EquipItem( new FullApron( Utility.RandomNeutralHue() ) );
                                break;
                            }

                            case 2:
                            {
                                int hue = Utility.RandomNeutralHue();
                                m.EquipItem( new Skirt( hue ) );
                                m.EquipItem( new HalfApron( hue ) );
                                m.EquipItem( new Boots() );
                                m.EquipItem( new FancyShirt() );
                                break;
                            }
                        }
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new FurBoots() );
                                m.EquipItem( new FancyShirt() );
                                m.EquipItem( new BeltedPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new FullApron( Utility.RandomNeutralHue() ) );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new FurBoots() );
                                m.EquipItem( new Shirt() );
                                m.EquipItem( new FullApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new LongVest( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new BeltedPants( Utility.RandomNeutralHue() ) );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new Boots() );
                                m.EquipItem( new LeatherGloves() );
                                m.EquipItem( new Tunic( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new BeltedPants( Utility.RandomNeutralHue() ) );
                                break;
                            }
                        }
                    }

                    break;
                }

                case Nation.Vhalurian:
                {
                    if( m.Female )
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                int hue = Utility.RandomNeutralHue();
                                Cap bonnet = new Cap();
                                bonnet.Hue = hue;
                                m.EquipItem( bonnet );
                                m.EquipItem( new FullApron( hue ) );
                                m.EquipItem( new LeatherGloves() );
                                m.EquipItem( new LeatherBoots() );
                                m.EquipItem( new Shirt() );
                                m.EquipItem( new LongPants( Utility.RandomNeutralHue() ) );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new BeltedDress( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new ElegantShoes() );
                                break;
                            }

                            case 2:
                            {
                                int hue = Utility.RandomNeutralHue();
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new Skirt( hue ) );
                                m.EquipItem( new FancyDoublet( hue ) );
                                m.EquipItem( new FancyShirt() );
                                m.EquipItem( new ElegantShoes() );
                                break;
                            }
                        }
                    }

                    else
                    {
                        switch( choice )
                        {
                            case 0:
                            {
                                m.EquipItem( new FullApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new ShortPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new ElegantShoes() );
                                m.EquipItem( new FancyShirt() );
                                break;
                            }

                            case 1:
                            {
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new BeltedPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new BlackLeatherBoots() );
                                m.EquipItem( new FancyShirt() );
                                m.EquipItem( new Tunic( Utility.RandomNeutralHue() ) );
                                break;
                            }

                            case 2:
                            {
                                m.EquipItem( new LeatherGloves() );
                                m.EquipItem( new HalfApron( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new BeltedPants( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new Shirt( Utility.RandomNeutralHue() ) );
                                m.EquipItem( new LeatherBoots() );
                                break;
                            }
                        }
                    }
                    break;
                }
            }
        }
示例#22
0
        private bool SwitchClothes(Mobile from)
        {
            if (BaseHouse.FindHouseAt(from) == null || !BaseHouse.FindHouseAt(from).IsOwner(from))
            {
                from.SendMessage("You must be in your house to use this.");
                return false;
            }

            if (BaseHouse.FindHouseAt(this) == null || !BaseHouse.FindHouseAt(this).IsOwner(from))
            {
                from.SendMessage("Your mannequin must be in your own house to use it.");
                return false;
            }

            if (BaseHouse.FindHouseAt(this) != null && BaseHouse.FindHouseAt(from) != null &&
                BaseHouse.FindHouseAt(this) != BaseHouse.FindHouseAt(from))
            {
                from.SendMessage("You and your mannequin must be in the same house to do that!");
                return false;
            }

            if (!CanSee(from) || !from.InLOS(this))
            {
                from.SendMessage("You and your mannequin must be able to see eachother to do that.");
                return false;
            }

            if (STAM_LOSS_FOR_CHANGE)
            {
                if (from.Stam <= STAM_LOSS)
                {
                    from.SendMessage("You don't have the energy to make a quick change at this time.");
                    return false;
                }
            }

            List<Item> mannequinItems = new List<Item>();
            List<Item> mobileItems = new List<Item>();

            foreach (Item item in Items)
            {
                if (IsEquipped(item) && !(item is Backpack))
                {
                    mannequinItems.Add(item);
                }
            }

            foreach (Item item in from.Items)
            {
                if (IsEquipped(item) && !(item is Backpack))
                {
                    mobileItems.Add(item);
                }
            }

            foreach (Item item in mobileItems)
            {
                from.RemoveItem(item);
            }

            foreach (Item item in mannequinItems)
            {
                RemoveItem(item);
            }

            foreach (Item item in mobileItems)
            {
                EquipItem(item);
            }

            bool someRemoved = false;
            int itemsAdded = 0;
            foreach (Item item in mannequinItems)
            {
                if (from.EquipItem(item))
                {
                    itemsAdded++;
                }
                else
                {
                    someRemoved = true;
                    if (!from.AddToBackpack(item))
                        item.DropToWorld(from, from.Location);
                }
            }

            if (itemsAdded > 0 && STAM_LOSS_FOR_CHANGE)
            {
                from.Stam -= STAM_LOSS;
            }

            if (someRemoved)
            {
                from.SendMessage("You were not able to equip everything.");
                return false;
            }

            return true;
        }
示例#23
0
        private bool SwitchClothes(Mobile from)
        {
            if (BaseHouse.FindHouseAt(from) == null || !BaseHouse.FindHouseAt(from).IsOwner(from))
            {
                from.SendMessage("You must be in your house to use this.");
                return(false);
            }

            if (BaseHouse.FindHouseAt(this) == null || !BaseHouse.FindHouseAt(this).IsOwner(from))
            {
                from.SendMessage("Your mannequin must be in your own house to use it.");
                return(false);
            }

            if (BaseHouse.FindHouseAt(this) != null && BaseHouse.FindHouseAt(from) != null &&
                BaseHouse.FindHouseAt(this) != BaseHouse.FindHouseAt(from))
            {
                from.SendMessage("You and your mannequin must be in the same house to do that!");
                return(false);
            }

            if (!CanSee(from) || !from.InLOS(this))
            {
                from.SendMessage("You and your mannequin must be able to see eachother to do that.");
                return(false);
            }

            if (STAM_LOSS_FOR_CHANGE)
            {
                if (from.Stam <= STAM_LOSS)
                {
                    from.SendMessage("You don't have the energy to make a quick change at this time.");
                    return(false);
                }
            }

            List <Item> mannequinItems = new List <Item>();
            List <Item> mobileItems    = new List <Item>();

            foreach (Item item in Items)
            {
                if (IsEquipped(item) && !(item is Backpack))
                {
                    mannequinItems.Add(item);
                }
            }

            foreach (Item item in from.Items)
            {
                if (IsEquipped(item) && !(item is Backpack))
                {
                    mobileItems.Add(item);
                }
            }

            foreach (Item item in mobileItems)
            {
                from.RemoveItem(item);
            }

            foreach (Item item in mannequinItems)
            {
                RemoveItem(item);
            }

            foreach (Item item in mobileItems)
            {
                EquipItem(item);
            }

            bool someRemoved = false;
            int  itemsAdded  = 0;

            foreach (Item item in mannequinItems)
            {
                if (from.EquipItem(item))
                {
                    itemsAdded++;
                }
                else
                {
                    someRemoved = true;
                    if (!from.AddToBackpack(item))
                    {
                        item.DropToWorld(from, from.Location);
                    }
                }
            }

            if (itemsAdded > 0 && STAM_LOSS_FOR_CHANGE)
            {
                from.Stam -= STAM_LOSS;
            }

            if (someRemoved)
            {
                from.SendMessage("You were not able to equip everything.");
                return(false);
            }

            return(true);
        }
示例#24
0
        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)
                {
                    List <Item> items = new List <Item>(this.Items);

                    bool gathered = false;
                    bool didntFit = false;

                    Container pack = from.Backpack;

                    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 (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();
                            ProcessDelta();
                            this.Delete();
                        }

                        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.
                    }
                }

                #endregion

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

                base.OnDoubleClick(from);

                if (from != m_Owner)
                {
                    from.RevealingAction();

                    if (from.Player)
                    {
                        EventDispatcher.InvokeCorpseAction(new CorpseActionEventArgs((Player)from, this, CorpseActionEventArgs.CorpseAction.Opened));
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(500446); // That is too far away.
                return;
            }
        }
示例#25
0
        //Maka : fix the bad code practise
        public void SphereDoubleClick(Mobile from)
        {
            if (Parent == null)
            {
                SpellHelper.Turn(from, this);
            }

            //Maka : New layers
            if (from.FindItemOnLayer(Layer.FirstValid) != null && from.FindItemOnLayer(Layer.FirstValid) != this)
            {
                Item i = from.FindItemOnLayer(Layer.FirstValid);

                if (i != null)
                {
                    from.SendAsciiMessage(string.Format("You put the {0} in your pack.", Sphere.ComputeName(i)));
                    from.AddToBackpack(i);
                }
            }

            if (from.FindItemOnLayer(Layer) != null && from.FindItemOnLayer(Layer) != this)
            {
                Item i = from.FindItemOnLayer(Layer);

                //Is it a shield
                if (i is BaseArmor)
                {
                    from.SendAsciiMessage(string.Format("You put the {0} in your pack.", Sphere.ComputeName(i)));
                    from.AddToBackpack(i);

                    //If its a shield, is he holding a weap
                    i = from.FindItemOnLayer(Layer.OneHanded);

                    if (i != null)
                    {
                        from.SendAsciiMessage(string.Format("You put the {0} in your pack.", Sphere.ComputeName(i)));
                        from.AddToBackpack(i);
                    }
                }
                else
                {
                    i = from.FindItemOnLayer(Layer);

                    from.SendAsciiMessage(string.Format("You put the {0} in your pack.", Sphere.ComputeName(i)));

                    from.AddToBackpack(i);
                }

                from.EquipItem(this);
                from.PlaySound(0x57);
            }
            else if (Layer == Layer.OneHanded && from.FindItemOnLayer(Layer.TwoHanded) != null || Layer == Layer.TwoHanded && from.FindItemOnLayer(Layer.OneHanded) != null)
            {
                Item i = from.FindItemOnLayer(Layer.TwoHanded);

                if (i != null && !(i is BaseShield))
                {
                    from.SendAsciiMessage(string.Format("You put the {0} in your pack.", Sphere.ComputeName(i)));
                    from.AddToBackpack(i);
                }

                from.EquipItem(this);
            }
            else if (Layer == Layer.TwoHanded && from.FindItemOnLayer(Layer.OneHanded) != null)
            {
                Item i = from.FindItemOnLayer(Layer.OneHanded);

                if (i != null)
                {
                    from.SendAsciiMessage(string.Format("You put the {0} in your pack.", Sphere.ComputeName(i)));
                    from.AddToBackpack(i);
                }

                from.EquipItem(this);
            }
            else
            {
                from.EquipItem(this);
            }
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile       from   = state.Mobile;
            PlayerMobile player = from as PlayerMobile;

            switch (info.ButtonID)
            {
            case 0:
            {
                from.BankBox.DropItem(new BankCheck(5000));
                from.BankBox.DropItem(new Watermelon(500));

                player.Profession = 666;
                player.Level      = 1;
                player.Exp        = 0;
                player.KillExp    = 0;
                player.LevelAt    = 200;

                from.Kills = 0;

                from.Title = "the Running Pants";
                from.EquipItem(new YoureFuckedTalisman());

                from.StatCap   = 1500;
                from.SkillsCap = 50000;
                from.Str       = 10;
                from.Dex       = 10;
                from.Int       = 10;

                from.Hunger = 20;
                from.Thirst = 20;

                from.Fame  -= 50000;
                from.Karma -= 50000;

                from.FollowersMax = 100;

                ResistanceMod mod1 = new ResistanceMod(ResistanceType.Physical, -50);
                ResistanceMod mod2 = new ResistanceMod(ResistanceType.Fire, -50);
                ResistanceMod mod3 = new ResistanceMod(ResistanceType.Cold, -50);
                ResistanceMod mod4 = new ResistanceMod(ResistanceType.Poison, -50);
                ResistanceMod mod5 = new ResistanceMod(ResistanceType.Energy, -50);

                from.AddResistanceMod(mod1);
                from.AddResistanceMod(mod2);
                from.AddResistanceMod(mod3);
                from.AddResistanceMod(mod4);
                from.AddResistanceMod(mod5);

                from.Skills.Alchemy.Base       = 0;
                from.Skills.Anatomy.Base       = 0;
                from.Skills.AnimalLore.Base    = 0;
                from.Skills.AnimalTaming.Base  = 0;
                from.Skills.Archery.Base       = 0;
                from.Skills.ArmsLore.Base      = 0;
                from.Skills.Begging.Base       = 0;
                from.Skills.Blacksmith.Base    = 0;
                from.Skills.Camping.Base       = 0;
                from.Skills.Carpentry.Base     = 0;
                from.Skills.Cartography.Base   = 0;
                from.Skills.Cooking.Base       = 0;
                from.Skills.DetectHidden.Base  = 0;
                from.Skills.Discordance.Base   = 0;
                from.Skills.EvalInt.Base       = 0;
                from.Skills.Fishing.Base       = 0;
                from.Skills.Fencing.Base       = 0;
                from.Skills.Fletching.Base     = 0;
                from.Skills.Focus.Base         = 0;
                from.Skills.Forensics.Base     = 0;
                from.Skills.Healing.Base       = 0;
                from.Skills.Herding.Base       = 0;
                from.Skills.Hiding.Base        = 0;
                from.Skills.Inscribe.Base      = 0;
                from.Skills.ItemID.Base        = 0;
                from.Skills.Lockpicking.Base   = 0;
                from.Skills.Lumberjacking.Base = 0;
                from.Skills.Macing.Base        = 0;
                from.Skills.Magery.Base        = 0;
                from.Skills.MagicResist.Base   = 10;
                from.Skills.Meditation.Base    = 0;
                from.Skills.Mining.Base        = 0;
                from.Skills.Musicianship.Base  = 0;
                from.Skills.Parry.Base         = 0;
                from.Skills.Peacemaking.Base   = 0;
                from.Skills.Poisoning.Base     = 0;
                from.Skills.Provocation.Base   = 0;
                from.Skills.RemoveTrap.Base    = 0;
                from.Skills.Snooping.Base      = 0;
                from.Skills.SpiritSpeak.Base   = 0;
                from.Skills.Stealing.Base      = 0;
                from.Skills.Stealth.Base       = 0;
                from.Skills.Swords.Base        = 0;
                from.Skills.Tactics.Base       = 0;
                from.Skills.Tailoring.Base     = 0;
                from.Skills.TasteID.Base       = 0;
                from.Skills.Tinkering.Base     = 0;
                from.Skills.Tracking.Base      = 0;
                from.Skills.Veterinary.Base    = 0;
                from.Skills.Wrestling.Base     = 0;
                from.Skills.Chivalry.Base      = 0;
                from.Skills.Necromancy.Base    = 0;
                from.Skills.Bushido.Base       = 0;
                from.Skills.Ninjitsu.Base      = 0;
                from.Skills.Spellweaving.Base  = 0;

                from.PlaySound(0x61F);                                 // wilhelm scream

                from.Map      = Map.Malas;
                from.Location = new Point3D(1825, 1020, 50);
                from.FixedEffect(0x376A, 10, 16);

                World.Broadcast(0x35, true, string.Format("{0} is permanently cursed as a pair of running pants because life wasn't already difficult enough!", from.Name));
                from.CloseGump(typeof(YoureFuckedClassGateGump));

                break;
            }

            case 1:
            {
                from.SendMessage("You decide that the way of getting f****d is not in your best interests.");
                from.CloseGump(typeof(YoureFuckedClassGateGump));

                break;
            }
            }
        }
        public override void OnDoubleClick(Mobile m)
        {
            if (Parent != m)
            {
                m.SendMessage("You must be wearing the cloak to use it!");
            }
            else
            {
                if (m.Body == 400 && m.Str <= 175)
                {
                    m.SendMessage("You feel your bones change.");
                    m.BodyMod    = 666;
                    m.Hue        = 1759;
                    m.HairItemID = 499;
                    m.HairHue    = 1608;

                    m.Title      = "the Gargoyle";
                    m.LightLevel = 100;
                    m.EquipItem(this);
                    m.DisplayGuildTitle = true;
                }
                else if (m.BodyMod == 666 && m.Str <= 200)
                {
                    m.SendMessage("You feel your bones change.");
                    m.BodyMod    = 0;
                    m.Title      = null;
                    m.LightLevel = 0;

                    m.Hue = 33770;

                    m.BaseSoundID       = 0;
                    m.DisplayGuildTitle = true;
                    m.Criminal          = false;
                }
                else if (m.Body == 401 && m.Str <= 175)
                {
                    m.SendMessage("You feel your bones change.");
                    m.BodyMod    = 667;
                    m.Hue        = 1759;
                    m.HairItemID = 475;
                    m.HairHue    = 1608;
                    m.Title      = "the Gargoyle";
                    m.LightLevel = 100;

                    m.DisplayGuildTitle = true;
                    m.Criminal          = false;
                }
                else if (m.BodyMod == 667 && m.Str <= 200)
                {
                    m.SendMessage("You feel your bones change.");
                    m.BodyMod    = 0;
                    m.LightLevel = 0;

                    m.Hue = 0;

                    m.BaseSoundID       = 0;
                    m.Title             = null;
                    m.DisplayGuildTitle = true;
                    m.Criminal          = false;
                }
            }
        }
示例#28
0
		//Assume all checks are already done, and m is a playermobile (crash otherwise)
		public override void UseGate( Mobile m )
		{
			PlayerMobile pm = m as PlayerMobile;

			Map map = TargetMap;

			if ( map == null || map == Map.Internal )
				map = m.Map;

			Point3D p = Target;

			if ( p == Point3D.Zero )
				p = Location;

			if ( m.AccessLevel == AccessLevel.Player || !StaffOverride )
			{
				if ( ( FreeForDonators && pm.HasDonated ) || m_TollItem == null || m_TollAmount <= 0 || ( GetOptFlag( EGateOptFlags.CheckTollBackpack ) && m.Backpack.ConsumeTotal( m_TollItem, m_TollAmount, true ) ) || ( GetOptFlag( EGateOptFlags.CheckTollBankBox ) && m.BankBox.ConsumeTotal( m_TollItem, m_TollAmount, true ) ) )
				{
					if ( GiveGameRobe )
						m.EquipItem( new GameRobe( m_GameRobeHue ) );

					if ( RemovePolymorph )
					{
						PolymorphSpell.StopTimer( pm );
						pm.EndAction( typeof( PolymorphSpell ) );
					}

					if ( RemoveIncognito )
					{
						IncognitoSpell.StopTimer( pm );
						pm.EndAction( typeof( IncognitoSpell ) );
					}

					if ( RemoveDisguise )
						DisguiseGump.StopTimer( pm );

					if ( !pm.Alive && ResGhosts )
						pm.Resurrect();

					if ( RemoveFSL )
						pm.FactionSkillLoss = false;
				}
				else
				{
					m.SendMessage( "You must have the required toll in your bank to enter this gate." );
					return;
				}
			}

			if ( TransportPets )
				BaseCreature.TeleportPets( pm, p, map );

			pm.MoveToWorld( p, map );

			pm.PlaySound( 0x1FE );

			OnGateUsed( m );
		}
示例#29
0
        public override bool OnBeforeDeath(Mobile m)
        {
            if (!(m is PlayerMobile))
            {
                return(base.OnBeforeDeath(m));
            }

            //Remove the player's items acquired in the dream
            for (int x = m.Items.Count - 1; x >= 0; x--)
            {
                if (!(m.Items[x] is Backpack))
                {
                    m.RemoveItem(m.Items[x]);
                }
            }

            for (int y = m.Backpack.Items.Count - 1; y >= 0; y--)
            {
                if ((m.Backpack.Items[y] is HelmOfCourage) || (m.Backpack.Items[y] is CrystalRoseOfLove) || (m.Backpack.Items[y] is MirrorOfTruth) || (m.Backpack.Items[y] is StaffOrb))
                {
                }
                else
                {
                    m.RemoveItem(m.Backpack.Items[y]);
                }
            }

            //Find the player's item container
            Item[] Items = Map.SerpentIsle.GetItemsInRange(new Point3D(0, 0, 0)).CastToArray <Item>();

            foreach (Item found in Items)
            {
                if (found is MetalBox)
                {
                    MetalBox box = found as MetalBox;

                    if (box.Name == m.Name)
                    {
                        //Give them back their stuff
                        for (int x = box.Items.Count - 1; x >= 0; x--)
                        {
                            if (box.Items[x] is MetalBox)
                            {
                                MetalBox itemBox = box.Items[x] as MetalBox;
                                for (int y = itemBox.Items.Count - 1; y >= 0; y--)
                                {
                                    m.AddToBackpack(itemBox.Items[y]);
                                }
                                if (itemBox.Items.Count == 0)
                                {
                                    itemBox.Delete();
                                }
                            }
                            else
                            {
                                m.EquipItem(box.Items[x]);
                            }
                        }

                        if (box.Items.Count == 0)
                        {
                            box.Delete();
                        }
                    }
                }
            }

            //Move pets back
            foreach (Mobile mobile in ((PlayerMobile)m).AllFollowers)
            {
                mobile.MoveToWorld(new Point3D(650, 881, 0), Map.SerpentIsle);
                mobile.Frozen = false;
            }


            switch (Utility.Random(2))
            {
            case 0:
                m.MoveToWorld(new Point3D(643, 881, 0), Map.SerpentIsle);
                break;

            case 1:
                m.MoveToWorld(new Point3D(662, 882, 0), Map.SerpentIsle);
                break;
            }

            m.SendMessage("Thou hast awoken from thy dream.");

            //Restore player to full
            ((PlayerMobile)m).Hits   = m.HitsMax;
            ((PlayerMobile)m).Mana   = m.ManaMax;
            ((PlayerMobile)m).Stam   = m.StamMax;
            ((PlayerMobile)m).Hunger = 20;
            ((PlayerMobile)m).Thirst = 20;

            ((PlayerMobile)m).Paralyzed = false;
            ((PlayerMobile)m).Poison    = null;

            EvilOmenSpell.TryEndEffect(m);
            StrangleSpell.RemoveCurse(m);
            CorpseSkinSpell.RemoveCurse(m);
            CurseSpell.RemoveEffect(m);
            MortalStrike.EndWound(m);
            BloodOathSpell.RemoveCurse(m);
            MindRotSpell.ClearMindRotScalar(m);

            BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
            BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
            BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
            BuffInfo.RemoveBuff(m, BuffIcon.Curse);
            BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
            BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
            BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);

            return(false);
        }
示例#30
0
	    private static void EquipItem( Item item, bool mustEquip, Mobile m )
		{
			if ( !Core.AOS )
				item.LootType = LootType.Blessed;

			if ( m != null && m.EquipItem( item ) )
				return;

	        Container pack = null;

            if (m != null)
			    pack = m.Backpack;
 
			if ( !mustEquip && pack != null )
				pack.DropItem( item );
			else
				item.Delete();
		}
示例#31
0
        public void AddHalo( Mobile m )
        {
            LightSource newlight = new LightSource();
            newlight.Layer = Layer.ShopBuy;
            newlight.Light = LightType.Circle300;
            newlight.Name = "Weapon Halo";

            Item light = m.FindItemOnLayer( Layer.Talisman );

            if( light != null && light is LightSource )
                light.Delete();

            light = m.FindItemOnLayer( Layer.ShopBuy );

            if( light != null && light is LightSource )
                light.Delete();

            if( m.FindItemOnLayer( Layer.ShopBuy ) == null )
                m.EquipItem( newlight );
        }
示例#32
0
        private static void CopyFromLayer(Mobile from, Mobile mimic, Layer layer)
        {
            if (from.FindItemOnLayer(layer) != null)
            {
                Item copy = from.FindItemOnLayer(layer);
                Type t    = copy.GetType();

                ConstructorInfo[] info = t.GetConstructors();

                foreach (ConstructorInfo c in info)
                {
                    ParameterInfo[] paramInfo = c.GetParameters();

                    if (paramInfo.Length == 0)
                    {
                        object[] objParams = new object[0];

                        try
                        {
                            Item   newItem = null;
                            object o       = c.Invoke(objParams);

                            if (o != null && o is Item)
                            {
                                newItem = (Item)o;
                                CopyProperties(newItem, copy);  //copy.Dupe( item, copy.Amount );
                                newItem.Parent = null;

                                mimic.EquipItem(newItem);
                            }

                            if (newItem != null)
                            {
                                /*
                                 * if ( newItem is BaseWeapon&& o is BaseWeapon)
                                 * {
                                 *  BaseWeapon weapon=newItem as BaseWeapon;
                                 *  BaseWeapon oweapon=o as BaseWeapon;
                                 *  //weapon.Attributes=oweapon.Attributes;
                                 *  //weapon.WeaponAttributes=oweapon.WeaponAttributes;
                                 *
                                 * }
                                 */
                                if (newItem is BaseArmor && o is BaseArmor)
                                {
                                    BaseArmor armor  = newItem as BaseArmor;
                                    BaseArmor oarmor = o as BaseArmor;
                                    armor.Attributes      = oarmor.Attributes;
                                    armor.ArmorAttributes = oarmor.ArmorAttributes;
                                    armor.SkillBonuses    = oarmor.SkillBonuses;
                                }
                                mimic.EquipItem(newItem);
                            }
                        }
                        catch
                        {
                            from.Say("Error!");
                            return;
                        }
                    }
                }
            }
            if (mimic.FindItemOnLayer(layer) != null && mimic.FindItemOnLayer(layer).LootType != LootType.Blessed)
            {
                mimic.FindItemOnLayer(layer).LootType = LootType.Newbied;
            }
        }
        private static void dressPlayer(Mobile pm)
        {
            if (pm == null) return;

            // Une robe d'une couleur aléatoire
            Item i = new Robe();
            i.Hue = Utility.RandomDyedHue();
            pm.EquipItem(i);

            // Des chaussures
            pm.EquipItem(new Shoes());

            // Quelques objets dans le sac s'il en a un
            if (pm.Backpack != null)
            {
                pm.Backpack.DropItem(new Dagger()); // dague
                pm.Backpack.DropItem(new Candle()); // bougie
                pm.Backpack.DropItem(new RedBook());    // un petit livre rouge pour honoré le président Mao...
            }
        }
示例#34
0
		public virtual void Open( Mobile from, bool checkSelfLoot )
		{
            //You can not loot as soon as you open the bones, you have to wait 1.5 secs.
            //This is used to stop people from looting their own items right after they
            //die and get cut and should not interfer with normal players to much
            //Taran: This caused too much annoyance so I removed it

            //if (m_ViewedBy != null && from.AccessLevel == AccessLevel.Player && Owner is PlayerMobile && Carved && !m_ViewedBy.Contains(from))
            //    from.NextActionTime = DateTime.Now + TimeSpan.FromSeconds(1.5);

			if ( from.AccessLevel > AccessLevel.Player || (from.InRange( GetWorldLocation(), 2 ) && from.InLOS(this)) )
			{
                #region Self Looting
                if (checkSelfLoot && from == m_Owner && !GetFlag(CorpseFlag.SelfLooted) && Items.Count != 0 && !GetFlag(CorpseFlag.Carved) && m_Looters.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);

                    if (!m_Looters.Contains(from)) //Add looter flag when self looting
                        m_Looters.Add(from);
                }
                #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.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
				return;
			}
		}
示例#35
0
文件: Control.cs 项目: Telm/RunUO_EME
        private static void MoveEquip( Mobile from, Mobile to, bool fromBackpack)
        {
            Item item;

            for ( int i = 0; i < m_DesiredLayerOrder.Length; ++i )
            {
                item = to.FindItemOnLayer( m_DesiredLayerOrder[i] );
                if ( item != null )
                    item.Bounce(to);

                item = from.FindItemOnLayer( m_DesiredLayerOrder[i] );
                if( item != null )
                {
                    to.EquipItem(item);
                }
            }

            //Backpack
            if ( from.Backpack != null && !(from.Backpack is VendorBackpack) && fromBackpack )
            {

                if ( to.Backpack == null )
                    to.EquipItem( new Backpack() );

                ArrayList itemsToMove = new ArrayList();

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

                    if( item != null && !item.Deleted && item.LootType != LootType.Newbied && item.LootType != LootType.Blessed )
                    {
                        itemsToMove.Add( item );
                    }
                }

                for ( int i = 0; i < itemsToMove.Count; ++i)
                {
                    to.Backpack.DropItem((Item)itemsToMove[i]);
                }
                itemsToMove.Clear();

            }
        }
			public static bool EQUIP(TriggerObject trigObject, Mobile mob, Item item)
			{
				if (mob == null || item == null || item.Deleted || item.Layer == Layer.Invalid)
				{
					return false;
				}

				Item currentlyEquipped = mob.FindItemOnLayer(item.Layer);

				if (currentlyEquipped != null && !currentlyEquipped.Deleted)
				{
					mob.AddToBackpack(currentlyEquipped);
				}

				return mob.EquipItem(item);
			}
示例#37
0
        private void CopyFromLayer(Mobile from, Mobile mimic, Layer layer)
        {
            if (from.FindItemOnLayer(layer) != null)
            {
                Item copy = (Item)from.FindItemOnLayer(layer);
                Type t = copy.GetType();

                ConstructorInfo[] info = t.GetConstructors();

                foreach (ConstructorInfo c in info)
                {
                    //if ( !c.IsDefined( typeof( ConstructableAttribute ), false ) ) continue;

                    ParameterInfo[] paramInfo = c.GetParameters();

                    if (paramInfo.Length == 0)
                    {
                        object[] objParams = new object[0];

                        try
                        {
                            Item newItem = null;
                            object o = c.Invoke(objParams);

                            if (o != null && o is Item)
                            {
                                newItem = (Item)o;
                                CopyProperties(newItem, copy);//copy.Dupe( item, copy.Amount );
                                newItem.Parent = null;

                                mimic.EquipItem(newItem);
                            }

                            if (newItem != null)
                            {
                                if (newItem is BaseWeapon && o is BaseWeapon)
                                {
                                    BaseWeapon weapon = newItem as BaseWeapon;
                                    BaseWeapon oweapon = o as BaseWeapon;
                                    weapon.Attributes = oweapon.Attributes;
                                    weapon.WeaponAttributes = oweapon.WeaponAttributes;

                                }
                                if (newItem is BaseArmor && o is BaseArmor)
                                {
                                    BaseArmor armor = newItem as BaseArmor;
                                    BaseArmor oarmor = o as BaseArmor;
                                    armor.Attributes = oarmor.Attributes;
                                    armor.ArmorAttributes = oarmor.ArmorAttributes;
                                    armor.SkillBonuses = oarmor.SkillBonuses;

                                }

                                mimic.EquipItem(newItem);
                            }
                        }
                        catch
                        {
                            from.Say("Error!");
                            return;
                        }
                    }
                }
            }

            if (mimic.FindItemOnLayer(layer) != null && mimic.FindItemOnLayer(layer).LootType != LootType.Blessed)
                mimic.FindItemOnLayer(layer).LootType = LootType.Newbied;
        }
 public void CreateLight(Mobile from)
 {
     WearableLight light = new WearableLight();
     mLight = light;
     from.EquipItem( mLight );
 }
示例#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 (!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;
            }
        }
示例#40
0
        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;
                }

                base.OnDoubleClick(from);
            }
            else
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return;
            }
        }
示例#41
0
        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 );

                        this.Delete();

                        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;
            }
        }
示例#42
0
        public override void OnDoubleClick(Mobile from)
        {
            // if not a player
            Mobile m_Mob = (Mobile)from;
            AccessLevel al_MobLevel = m_Mob.AccessLevel;
            Account a_Account = (Account)m_Mob.Account;
            AccessLevel al_AccLevel = a_Account.AccessLevel;
            if (al_AccLevel > AccessLevel.Player)
            {
                // if not already possessing a mobile
                if (!m_Possessing)
                {
                    from.SendMessage("Who or What do you want to possess?");
                    from.Target = new InternalTarget(this);
                }
                // restore your self and unhide the previously possessed mobile
                else
                {
                    // restore basics
                    m_Possessing = false;
                    from.Karma = m_Karma;
                    from.Fame = m_Fame;
                    from.Name = m_Name;
                    from.Title = m_Title;
                    from.Hue = m_Hue;
                    from.BodyValue = m_BodyValue;
                    from.Female = m_Female;
                    from.Hidden = true;
                    // Delete eveything you have equipped which is just a copy of what the NPC had   
                    ArrayList equipitems = new ArrayList(from.Items);
                    foreach (Item item in equipitems)
                    {
                        if ((item.Layer != Layer.Bank) && (item.Layer != Layer.Backpack))
                            item.Delete();
                    }
                    // get dressed and delete that white backpack
                    for (int i = m_Stuff.Items.Count - 1; i >= 0; --i)
                    {
                        if (i >= m_Stuff.Items.Count)
                            continue;
                        from.EquipItem((Item)m_Stuff.Items[i]);
                    }
                    // do we really want to delete the backpack?
                    m_Stuff.Delete();

                    // get your location, orient, enabale and show the mobile
                    Point3D from_Location = new Point3D(from.Location.X, from.Location.Y, from.Location.Z);
                    if (m_Possessed != null)
                    {
                        m_Possessed.Direction = from.Direction;
                        m_Possessed.MoveToWorld(from_Location, from.Map);
                        m_Possessed.Hidden = false;
                        m_Possessed.CantWalk = false;
                    }

                }
            }
            else // somehow a player got one of these which should never happen, just delete it and put a scare into them
            {
                from.SendMessage("You are trying to access a restricted item. The item has been removed and your account has been scheduled for deletion.");
                this.Delete();
            }

        }
示例#43
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)
                {
                    SetFlag(CorpseFlag.SelfLooted, true);

                    List <Item> 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;

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

                        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;
                            ProcessDelta();
                        }

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

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

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

                #region Quests
                PlayerMobile player = from as PlayerMobile;

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

                    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.
            }
        }
示例#44
0
        private bool MoveItemsToBank(Mobile m)
        {
            Backpack  bag   = new Backpack();
            ArrayList equip = new ArrayList(m.Items);

            if (m.Backpack != null)
            {
                // count clothing items
                int WornCount = 0;
                foreach (Item i in equip)
                {
                    if (Moongate.RestrictedItem(m, i) == false)
                    {
                        continue;                               // not clothes
                    }
                    else
                    {
                        WornCount++;
                    }
                }

                // erl: added check for Mobile.Alive property... will not return false if mobile is not alive
                if (125 - m.BankBox.TotalItems - 1 - m.Backpack.TotalItems - WornCount < 0 && m.Alive)
                {
                    return(false);
                }

                // Unequip any items being worn
                foreach (Item i in equip)
                {
                    if (Moongate.RestrictedItem(m, i) == false)
                    {
                        continue;
                    }
                    else
                    {
                        m.Backpack.DropItem(i);
                    }
                }

                // Get a count of all items in the player's backpack.
                ArrayList items = new ArrayList(m.Backpack.Items);

                // Drop our new bag in the player's bank
                m.BankBox.DropItem(bag);

                // Run through all items in player's pack, move them to the bag we just dropped in the bank
                foreach (Item i in items)
                {
                    // If there's room, drop the item in the bank, otherwise drop it on the ground
                    if (bag.TryDropItem(m, i, false) || !m.Alive)
                    {
                        bag.DropItem(i);
                    }
                    else
                    {
                        i.DropToWorld(m, m.Location);
                    }
                }
            }

            // Give them a Deathrobe, Stinger dagger, and a blank spell book
            if (m.Alive)
            {
                Item robe = new Server.Items.DeathRobe();
                if (!m.EquipItem(robe))
                {
                    robe.Delete();
                }
            }

            Item aiStinger = new Server.Items.AIStinger();

            if (!m.AddToBackpack(aiStinger))
            {
                aiStinger.Delete();
            }

            Item spellbook = new Server.Items.Spellbook();

            if (!m.AddToBackpack(spellbook))
            {
                spellbook.Delete();
            }
            return(true);
        }
示例#45
0
		public override void OnDoubleClick( Mobile from )
		{
			if( from != m_Owner )
			{
				from.SendAsciiMessage( "Only the owner can equip this." );
				return;
			}

			if( from.Mounted )
			{
				from.SendMessage( "Can not equip while being mounted." );
				return;
			}

			if( from.HasTrade )
			{
				from.SendMessage( "Can not equip while having a trade up." );
				return;
			}

			//This is most likley not needed, but anyways.
			if( from.IsInEvent )
			{
				from.IsInEvent = false;
				from.SendAsciiMessage( "You auto supply has been removed." );

				SupplySystem.RemoveEventGear( from );
			}

			for( int i = 0; i < m_EquippedItems.Count; ++i )
			{
				if( !m_EquippedItems[i].IsChildOf( this ) )
					continue;

				if( from.FindItemOnLayer( m_EquippedItems[i].Layer ) != null )
					if( from.Backpack != null )
						from.AddToBackpack( from.FindItemOnLayer( m_EquippedItems[i].Layer ) );
					else if( m_Owner.BankBox != null )
						from.BankBox.DropItem( from.FindItemOnLayer( m_EquippedItems[i].Layer ) );

				from.EquipItem( m_EquippedItems[i] );
			}

			for( int i = 0; i < m_BackpackContent.Count; ++i )
			{
                if (m_BackpackContent[i].ItemStored != null)
                {
                    if (!m_BackpackContent[i].ItemStored.IsChildOf(this))
                        continue;

                    if (from.Backpack != null)
                        AddToPack(m_BackpackContent[i]);
                    else if (from.BankBox != null)
                        from.BankBox.DropItem(m_BackpackContent[i].ItemStored);
                }
		    }

			if( Items.Count < 1 )
				Delete();
		}
示例#46
0
        public void Target(Corpse c)
        {
            Mobile m = c.Owner;

            if (!Caster.CanSee(c))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (m == Caster)
            {
                Caster.SendLocalizedMessage(501039);                   // Thou can not resurrect thyself.
            }
            else if (!Caster.InRange(c, 5))
            {
                Caster.SendLocalizedMessage(501042);                   // Target is not close enough.
            }
            else if (!m.Player)
            {
                Caster.SendLocalizedMessage(501043);                   // Target is not a being.
            }
            else if (CheckSequence() && m != null)
            {
                PlayerMobile pm = m as PlayerMobile;

                if (pm != null && Caster is PlayerMobile && (pm.MortEngine.MortCurrentState == MortState.Assomage || pm.MortEngine.MortCurrentState == MortState.MortDefinitive))
                {
                    SpellHelper.Turn(Caster, pm);

                    /*((PlayerMobile)Caster).AddFatigue(250);
                     * pm.AddFatigue(-250);*/

                    pm.PlaySound(0x214);
                    Effects.SendTargetEffect(pm, 0x376A, 10, 16);

                    if (pm.MortEngine.TimerEvanouie != null)
                    {
                        pm.MortEngine.TimerEvanouie.Stop();
                        pm.MortEngine.TimerEvanouie = null;
                    }

                    if (pm.MortEngine.TimerMort != null)
                    {
                        pm.MortEngine.TimerMort.Stop();
                        pm.MortEngine.TimerMort = null;
                    }

                    pm.Location = c.Location;
                    pm.MortEngine.EndroitMort  = c.Location;
                    pm.MortEngine.RisqueDeMort = false;
                    pm.MortEngine.Mort         = false;
                    pm.Frozen = false;

                    pm.Direction = c.Direction;
                    pm.Animate(21, 5, 1, false, false, 0);

                    pm.Resurrect();

                    if (c != null)
                    {
                        ArrayList list = new ArrayList();

                        foreach (Item item in c.Items)
                        {
                            list.Add(item);
                        }

                        foreach (Item item in list)
                        {
                            if (item.Layer == Layer.Hair || item.Layer == Layer.FacialHair)
                            {
                                item.Delete();
                            }

                            if (item is RaceSkin || c.EquipItems.Contains(item))
                            {
                                if (!m.EquipItem(item))
                                {
                                    m.AddToBackpack(item);
                                }
                            }
                            else
                            {
                                m.AddToBackpack(item);
                            }
                        }
                    }

                    pm.CheckRaceSkin();
                    pm.CheckStatTimers();

                    pm.MortEngine.MortCurrentState = MortState.Resurrection;
                }
                else
                {
                    Caster.SendMessage("Vous devez cibler le corps d'un joueur MORT !");
                }
            }

            FinishSequence();
        }
示例#47
0
        /// <summary>
        /// Auto-equips the weapon if the mobile can equip it.
        /// Else, the item is added to the mobile backpack.
        /// </summary>
        /// <param name="item">Item to equip</param>
        /// <param name="mustEquip">Forces the item to be equipped</param>
        /// <param name="m">Mobile to be equipped</param>
        /// <param name="t">Type of the item</param>
        private static void EquipItem(BaseWeapon item, bool mustEquip, Mobile m, Type t)
        {
            Container pack = m.Backpack;
            Layer layer = item.Layer;
            Item equips = m.FindItemOnLayer(layer);

            item.Quality = WeaponQuality.Exceptional;

            if (mustEquip)
            {
                if (equips != null)
                    pack.DropItem(equips);
            }

            if (pack.FindItemByType(t) != null || equips == item)
            {
                m.EquipItem(equips);
                return;
            }
            else
            {
                if (!Core.AOS)
                {
                    item.LootType = LootType.Regular;
                }

                if (mustEquip)
                {
                    if (equips != null)
                        pack.DropItem(equips);
                }

                if (m != null && m.EquipItem(item))
                    return;

                if (!mustEquip && pack != null)
                    pack.DropItem(item);
                else
                    item.Delete();
            }
        }
示例#48
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile       from   = state.Mobile;
            PlayerMobile player = from as PlayerMobile;

            switch (info.ButtonID)
            {
            case 0:
            {
                Item a = from.Backpack.FindItemByType(typeof(RuneOfRegret));
                if (a != null)
                {
                    a.Delete();
                }
                from.Kills = 0;
                from.SendMessage("You have been resolved of all sin at the cost of your sanity.");

                PlayerMobile pm = from as PlayerMobile;

                if (pm.Level > 1 && pm.Level < 10)
                {
                    from.Kills = 0;
                    from.Str  -= 5;
                    from.Dex  -= 5;
                    from.Int  -= 5;
                }
                else if (pm.Level > 10 && pm.Level < 30)
                {
                    from.Kills = 0;
                    from.Str  -= 20;
                    from.Dex  -= 20;
                    from.Int  -= 20;
                }
                else if (pm.Level > 30 && pm.Level < 60)
                {
                    from.Kills = 0;
                    from.Str  -= 30;
                    from.Dex  -= 30;
                    from.Int  -= 30;
                }
                else if (pm.Level > 60 && pm.Level < 101)
                {
                    from.Kills = 0;
                    from.Str  -= 50;
                    from.Dex  -= 50;
                    from.Int  -= 50;
                }

                if (from.RawStr <= 50)
                {
                    player.Level   = 1;
                    player.Exp     = 0;
                    player.KillExp = 0;
                    player.LevelAt = 200;

                    from.Kills = 0;

                    from.Title = "the Running Pants";
                    from.EquipItem(new YoureFuckedTalisman());

                    from.StatCap   = 500;
                    from.SkillsCap = 30000;
                    from.Str       = 10;
                    from.Dex       = 10;
                    from.Int       = 10;

                    from.Hunger = 0;
                    from.Thirst = 0;

                    from.Fame  -= 50000;
                    from.Karma -= 50000;

                    from.FollowersMax = 100;

                    ResistanceMod mod1 = new ResistanceMod(ResistanceType.Physical, -50);
                    ResistanceMod mod2 = new ResistanceMod(ResistanceType.Fire, -50);
                    ResistanceMod mod3 = new ResistanceMod(ResistanceType.Cold, -50);
                    ResistanceMod mod4 = new ResistanceMod(ResistanceType.Poison, -50);
                    ResistanceMod mod5 = new ResistanceMod(ResistanceType.Energy, -50);

                    from.AddResistanceMod(mod1);
                    from.AddResistanceMod(mod2);
                    from.AddResistanceMod(mod3);
                    from.AddResistanceMod(mod4);
                    from.AddResistanceMod(mod5);

                    from.Skills.Alchemy.Base       = 0;
                    from.Skills.Anatomy.Base       = 0;
                    from.Skills.AnimalLore.Base    = 0;
                    from.Skills.AnimalTaming.Base  = 0;
                    from.Skills.Archery.Base       = 0;
                    from.Skills.ArmsLore.Base      = 0;
                    from.Skills.Begging.Base       = 0;
                    from.Skills.Blacksmith.Base    = 0;
                    from.Skills.Camping.Base       = 0;
                    from.Skills.Carpentry.Base     = 0;
                    from.Skills.Cartography.Base   = 0;
                    from.Skills.Cooking.Base       = 0;
                    from.Skills.DetectHidden.Base  = 0;
                    from.Skills.Discordance.Base   = 0;
                    from.Skills.EvalInt.Base       = 0;
                    from.Skills.Fishing.Base       = 0;
                    from.Skills.Fencing.Base       = 0;
                    from.Skills.Fletching.Base     = 0;
                    from.Skills.Focus.Base         = 0;
                    from.Skills.Forensics.Base     = 0;
                    from.Skills.Healing.Base       = 0;
                    from.Skills.Herding.Base       = 0;
                    from.Skills.Hiding.Base        = 0;
                    from.Skills.Inscribe.Base      = 0;
                    from.Skills.ItemID.Base        = 0;
                    from.Skills.Lockpicking.Base   = 0;
                    from.Skills.Lumberjacking.Base = 0;
                    from.Skills.Macing.Base        = 0;
                    from.Skills.Magery.Base        = 0;
                    from.Skills.MagicResist.Base   = 10;
                    from.Skills.Meditation.Base    = 0;
                    from.Skills.Mining.Base        = 0;
                    from.Skills.Musicianship.Base  = 0;
                    from.Skills.Parry.Base         = 0;
                    from.Skills.Peacemaking.Base   = 0;
                    from.Skills.Poisoning.Base     = 0;
                    from.Skills.Provocation.Base   = 0;
                    from.Skills.RemoveTrap.Base    = 0;
                    from.Skills.Snooping.Base      = 0;
                    from.Skills.SpiritSpeak.Base   = 0;
                    from.Skills.Stealing.Base      = 0;
                    from.Skills.Stealth.Base       = 0;
                    from.Skills.Swords.Base        = 0;
                    from.Skills.Tactics.Base       = 0;
                    from.Skills.Tailoring.Base     = 0;
                    from.Skills.TasteID.Base       = 0;
                    from.Skills.Tinkering.Base     = 0;
                    from.Skills.Tracking.Base      = 0;
                    from.Skills.Veterinary.Base    = 0;
                    from.Skills.Wrestling.Base     = 0;
                    from.Skills.Chivalry.Base      = 0;
                    from.Skills.Necromancy.Base    = 0;
                    from.Skills.Bushido.Base       = 0;
                    from.Skills.Ninjitsu.Base      = 0;
                    from.Skills.Spellweaving.Base  = 0;

                    from.PlaySound(0x61F);                             // wilhelm scream
                    World.Broadcast(0x35, true, string.Format("{0} is permanently cursed as a pair of running pants due to being a colossal scathead!", from.Name));
                }
                else if (from.RawDex <= 50)
                {
                    player.Level   = 1;
                    player.Exp     = 0;
                    player.KillExp = 0;
                    player.LevelAt = 200;

                    from.Kills = 0;

                    from.Title = "the Running Pants";
                    from.EquipItem(new YoureFuckedTalisman());

                    from.StatCap   = 500;
                    from.SkillsCap = 30000;
                    from.Str       = 10;
                    from.Dex       = 10;
                    from.Int       = 10;

                    from.Hunger = 0;
                    from.Thirst = 0;

                    from.Fame  -= 50000;
                    from.Karma -= 50000;

                    from.FollowersMax = 100;

                    ResistanceMod mod1 = new ResistanceMod(ResistanceType.Physical, -50);
                    ResistanceMod mod2 = new ResistanceMod(ResistanceType.Fire, -50);
                    ResistanceMod mod3 = new ResistanceMod(ResistanceType.Cold, -50);
                    ResistanceMod mod4 = new ResistanceMod(ResistanceType.Poison, -50);
                    ResistanceMod mod5 = new ResistanceMod(ResistanceType.Energy, -50);

                    from.AddResistanceMod(mod1);
                    from.AddResistanceMod(mod2);
                    from.AddResistanceMod(mod3);
                    from.AddResistanceMod(mod4);
                    from.AddResistanceMod(mod5);

                    from.Skills.Alchemy.Base       = 0;
                    from.Skills.Anatomy.Base       = 0;
                    from.Skills.AnimalLore.Base    = 0;
                    from.Skills.AnimalTaming.Base  = 0;
                    from.Skills.Archery.Base       = 0;
                    from.Skills.ArmsLore.Base      = 0;
                    from.Skills.Begging.Base       = 0;
                    from.Skills.Blacksmith.Base    = 0;
                    from.Skills.Camping.Base       = 0;
                    from.Skills.Carpentry.Base     = 0;
                    from.Skills.Cartography.Base   = 0;
                    from.Skills.Cooking.Base       = 0;
                    from.Skills.DetectHidden.Base  = 0;
                    from.Skills.Discordance.Base   = 0;
                    from.Skills.EvalInt.Base       = 0;
                    from.Skills.Fishing.Base       = 0;
                    from.Skills.Fencing.Base       = 0;
                    from.Skills.Fletching.Base     = 0;
                    from.Skills.Focus.Base         = 0;
                    from.Skills.Forensics.Base     = 0;
                    from.Skills.Healing.Base       = 0;
                    from.Skills.Herding.Base       = 0;
                    from.Skills.Hiding.Base        = 0;
                    from.Skills.Inscribe.Base      = 0;
                    from.Skills.ItemID.Base        = 0;
                    from.Skills.Lockpicking.Base   = 0;
                    from.Skills.Lumberjacking.Base = 0;
                    from.Skills.Macing.Base        = 0;
                    from.Skills.Magery.Base        = 0;
                    from.Skills.MagicResist.Base   = 10;
                    from.Skills.Meditation.Base    = 0;
                    from.Skills.Mining.Base        = 0;
                    from.Skills.Musicianship.Base  = 0;
                    from.Skills.Parry.Base         = 0;
                    from.Skills.Peacemaking.Base   = 0;
                    from.Skills.Poisoning.Base     = 0;
                    from.Skills.Provocation.Base   = 0;
                    from.Skills.RemoveTrap.Base    = 0;
                    from.Skills.Snooping.Base      = 0;
                    from.Skills.SpiritSpeak.Base   = 0;
                    from.Skills.Stealing.Base      = 0;
                    from.Skills.Stealth.Base       = 0;
                    from.Skills.Swords.Base        = 0;
                    from.Skills.Tactics.Base       = 0;
                    from.Skills.Tailoring.Base     = 0;
                    from.Skills.TasteID.Base       = 0;
                    from.Skills.Tinkering.Base     = 0;
                    from.Skills.Tracking.Base      = 0;
                    from.Skills.Veterinary.Base    = 0;
                    from.Skills.Wrestling.Base     = 0;
                    from.Skills.Chivalry.Base      = 0;
                    from.Skills.Necromancy.Base    = 0;
                    from.Skills.Bushido.Base       = 0;
                    from.Skills.Ninjitsu.Base      = 0;
                    from.Skills.Spellweaving.Base  = 0;

                    from.PlaySound(0x61F);                             // wilhelm scream
                    World.Broadcast(0x35, true, string.Format("{0} is permanently cursed as a pair of running pants due to being a colossal scathead!", from.Name));
                }
                else if (from.RawInt <= 50)
                {
                    player.Level   = 1;
                    player.Exp     = 0;
                    player.KillExp = 0;
                    player.LevelAt = 200;

                    from.Kills = 0;

                    from.Title = "the Running Pants";
                    from.EquipItem(new YoureFuckedTalisman());

                    from.StatCap   = 500;
                    from.SkillsCap = 30000;
                    from.Str       = 10;
                    from.Dex       = 10;
                    from.Int       = 10;

                    from.Hunger = 0;
                    from.Thirst = 0;

                    from.Fame  -= 50000;
                    from.Karma -= 50000;

                    from.FollowersMax = 100;

                    ResistanceMod mod1 = new ResistanceMod(ResistanceType.Physical, -50);
                    ResistanceMod mod2 = new ResistanceMod(ResistanceType.Fire, -50);
                    ResistanceMod mod3 = new ResistanceMod(ResistanceType.Cold, -50);
                    ResistanceMod mod4 = new ResistanceMod(ResistanceType.Poison, -50);
                    ResistanceMod mod5 = new ResistanceMod(ResistanceType.Energy, -50);

                    from.AddResistanceMod(mod1);
                    from.AddResistanceMod(mod2);
                    from.AddResistanceMod(mod3);
                    from.AddResistanceMod(mod4);
                    from.AddResistanceMod(mod5);

                    from.Skills.Alchemy.Base       = 0;
                    from.Skills.Anatomy.Base       = 0;
                    from.Skills.AnimalLore.Base    = 0;
                    from.Skills.AnimalTaming.Base  = 0;
                    from.Skills.Archery.Base       = 0;
                    from.Skills.ArmsLore.Base      = 0;
                    from.Skills.Begging.Base       = 0;
                    from.Skills.Blacksmith.Base    = 0;
                    from.Skills.Camping.Base       = 0;
                    from.Skills.Carpentry.Base     = 0;
                    from.Skills.Cartography.Base   = 0;
                    from.Skills.Cooking.Base       = 0;
                    from.Skills.DetectHidden.Base  = 0;
                    from.Skills.Discordance.Base   = 0;
                    from.Skills.EvalInt.Base       = 0;
                    from.Skills.Fishing.Base       = 0;
                    from.Skills.Fencing.Base       = 0;
                    from.Skills.Fletching.Base     = 0;
                    from.Skills.Focus.Base         = 0;
                    from.Skills.Forensics.Base     = 0;
                    from.Skills.Healing.Base       = 0;
                    from.Skills.Herding.Base       = 0;
                    from.Skills.Hiding.Base        = 0;
                    from.Skills.Inscribe.Base      = 0;
                    from.Skills.ItemID.Base        = 0;
                    from.Skills.Lockpicking.Base   = 0;
                    from.Skills.Lumberjacking.Base = 0;
                    from.Skills.Macing.Base        = 0;
                    from.Skills.Magery.Base        = 0;
                    from.Skills.MagicResist.Base   = 10;
                    from.Skills.Meditation.Base    = 0;
                    from.Skills.Mining.Base        = 0;
                    from.Skills.Musicianship.Base  = 0;
                    from.Skills.Parry.Base         = 0;
                    from.Skills.Peacemaking.Base   = 0;
                    from.Skills.Poisoning.Base     = 0;
                    from.Skills.Provocation.Base   = 0;
                    from.Skills.RemoveTrap.Base    = 0;
                    from.Skills.Snooping.Base      = 0;
                    from.Skills.SpiritSpeak.Base   = 0;
                    from.Skills.Stealing.Base      = 0;
                    from.Skills.Stealth.Base       = 0;
                    from.Skills.Swords.Base        = 0;
                    from.Skills.Tactics.Base       = 0;
                    from.Skills.Tailoring.Base     = 0;
                    from.Skills.TasteID.Base       = 0;
                    from.Skills.Tinkering.Base     = 0;
                    from.Skills.Tracking.Base      = 0;
                    from.Skills.Veterinary.Base    = 0;
                    from.Skills.Wrestling.Base     = 0;
                    from.Skills.Chivalry.Base      = 0;
                    from.Skills.Necromancy.Base    = 0;
                    from.Skills.Bushido.Base       = 0;
                    from.Skills.Ninjitsu.Base      = 0;
                    from.Skills.Spellweaving.Base  = 0;

                    from.PlaySound(0x61F);                             // wilhelm scream
                    World.Broadcast(0x35, true, string.Format("{0} is permanently cursed as a pair of running pants due to being a colossal scathead!", from.Name));
                }

                from.CloseGump(typeof(RuneOfRegretGump));

                break;
            }

            case 1:
            {
                from.SendMessage("You decide to not to use the rune of regret. Continue on being a bastard.");
                from.CloseGump(typeof(RuneOfRegretGump));
                break;
            }
            }
        }
示例#49
0
        public static void GiveItem(Mobile to, int hue, Item item)
        {
            if (to == null && item == null)
                return;

            if (hue != 0)
                item.Hue = hue;

            item.Movable = false;
            to.EquipItem(item);
            return;
        }
示例#50
0
文件: Disarm.cs 项目: tflynt91/TrueUO
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            if (IsImmune(defender))
            {
                attacker.SendLocalizedMessage(1111827); // Your opponent is gripping their weapon too tightly to be disarmed.
                defender.SendLocalizedMessage(1111828); // You will not be caught off guard by another disarm attack for some time.
                return;
            }

            Item toDisarm = defender.FindItemOnLayer(Layer.OneHanded);

            if (toDisarm == null || !toDisarm.Movable)
            {
                toDisarm = defender.FindItemOnLayer(Layer.TwoHanded);
            }

            Container pack = defender.Backpack;

            if (pack == null || toDisarm != null && !toDisarm.Movable)
            {
                attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent.
            }
            else if (toDisarm == null || toDisarm is BaseShield)
            {
                attacker.SendLocalizedMessage(1060849); // Your target is already unarmed!
            }
            else if (CheckMana(attacker, true))
            {
                attacker.SendLocalizedMessage(1060092); // You disarm their weapon!
                defender.SendLocalizedMessage(1060093); // Your weapon has been disarmed!

                defender.PlaySound(0x3B9);
                defender.FixedParticles(0x37BE, 232, 25, 9948, EffectLayer.LeftHand);

                pack.DropItem(toDisarm);

                BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.NoRearm, 1075637, BlockEquipDuration, defender));

                BaseWeapon.BlockEquip(defender, BlockEquipDuration);

                if (defender is BaseCreature && _AutoRearms.Any(t => t == defender.GetType()))
                {
                    Timer.DelayCall(BlockEquipDuration + TimeSpan.FromSeconds(Utility.RandomMinMax(3, 10)), () =>
                    {
                        if (toDisarm != null && !toDisarm.Deleted && toDisarm.IsChildOf(defender.Backpack))
                        {
                            defender.EquipItem(toDisarm);
                        }
                    });
                }

                AddImmunity(defender, attacker.Weapon is Fists ? TimeSpan.FromSeconds(10) : TimeSpan.FromSeconds(15));
            }
        }
 public override void OnDoubleClick(Mobile m)
 {
     if (Parent != m)
     {
         m.SendMessage("You must be wearing the bracelet to use it!");
     }
     else
     {
         if (m.Body == 400)
         {
             m.SendMessage("You feel yourself changing.");
             m.PlaySound(232);
             m.BodyMod           = 83;
             m.Hue               = 2212;
             Attributes.BonusStr = 75;
             Attributes.BonusInt = -50;
             Attributes.BonusDex = 65;
             m.NameMod           = "the Incredible Hulk";
             m.RemoveItem(this);
             m.EquipItem(this);
             if (m.Kills >= 5)
             {
                 m.Criminal = true;
             }
             if (m.GuildTitle != null)
             {
                 m.DisplayGuildTitle = true;
             }
         }
         else if (m.Body == 83)
         {
             m.SendMessage("You feel yourself changing.");
             m.PlaySound(900);
             m.Body              = 400;
             m.BodyMod           = 0x0;
             m.Hue               = 33780;
             Attributes.BonusStr = 0;
             Attributes.BonusInt = 0;
             Attributes.BonusDex = 0;
             m.NameMod           = null;
             m.DisplayGuildTitle = false;
             m.Criminal          = false;
             m.RemoveItem(this);
             m.EquipItem(this);
         }
         else if (m.Body == 401)
         {
             m.SendMessage("You feel yourself changing.");
             m.PlaySound(232);
             m.BodyMod           = 1;
             m.Hue               = 2212;
             Attributes.BonusStr = 75;
             Attributes.BonusInt = -50;
             Attributes.BonusDex = 60;
             m.NameMod           = "the Incredible Hulk";
             m.DisplayGuildTitle = false;
             m.Criminal          = false;
             m.RemoveItem(this);
             m.EquipItem(this);
         }
         else if (m.Body == 1)
         {
             m.SendMessage("You feel yourself changing.");
             m.PlaySound(900);
             m.Body              = 401;
             m.BodyMod           = 0x0;
             m.Hue               = 33780;
             m.Hits              = m.HitsMax;
             m.Mana              = m.ManaMax;
             m.Stam              = m.StamMax;
             m.NameMod           = null;
             m.DisplayGuildTitle = false;
             m.Criminal          = false;
             m.RemoveItem(this);
             m.EquipItem(this);
         }
     }
 }
示例#52
0
        public override void OnDoubleClick(Mobile m)

        {
            if (Parent != m)
            {
                m.SendMessage("You must be wearing the Bracelet to use it!");
            }

            else
            {
                if (m.Mounted)
                {
                    m.SendMessage("You can't activate this while riding.");
                }

                else
                {
                    if (m.Body == 400)
                    {
                        m.SendMessage("You feel yourself changing.");
                        m.PlaySound(357);
                        m.Body              = 40;
                        m.BodyMod           = 0x0;
                        m.Hue               = 1172;
                        Attributes.BonusStr = 50;
                        Attributes.BonusInt = 50;
                        Attributes.BonusDex = 50;
                        m.NameMod           = "Minion of Minax";
                        m.RemoveItem(this);
                        m.EquipItem(this);
                        if (m.Kills >= 5)
                        {
                            m.Criminal = true;
                        }
                        if (m.GuildTitle != null)
                        {
                            m.DisplayGuildTitle = true;
                        }
                    }


                    else if (m.Body == 40)
                    {
                        m.SendMessage("You feel yourself changing.");
                        m.PlaySound(357);
                        m.Body              = 400;
                        m.BodyMod           = 0x0;
                        m.Hue               = 33780;
                        Attributes.BonusStr = 0;
                        Attributes.BonusInt = 0;
                        Attributes.BonusDex = 0;
                        m.NameMod           = null;
                        m.DisplayGuildTitle = false;
                        m.Criminal          = false;
                        m.RemoveItem(this);
                        m.EquipItem(this);
                    }
                    else if (m.Body == 401)
                    {
                        m.SendMessage("You feel yourself changing.");
                        m.PlaySound(1200);
                        m.Body              = 149;
                        m.BodyMod           = 0x0;
                        m.Hue               = 1172;
                        Attributes.BonusStr = 50;
                        Attributes.BonusInt = 50;
                        Attributes.BonusDex = 50;
                        m.NameMod           = "Minion of Minax";
                        m.DisplayGuildTitle = false;
                        m.Criminal          = false;
                        m.RemoveItem(this);
                        m.EquipItem(this);
                    }
                    else if (m.Body == 149)
                    {
                        m.SendMessage("You feel yourself changing.");
                        m.PlaySound(1200);
                        m.Body              = 401;
                        m.BodyMod           = 0x0;
                        m.Hue               = 33780;
                        m.Hits              = m.HitsMax;
                        m.Mana              = m.ManaMax;
                        m.Stam              = m.StamMax;
                        m.NameMod           = null;
                        m.DisplayGuildTitle = false;
                        m.Criminal          = false;
                        m.RemoveItem(this);
                        m.EquipItem(this);
                    }
                }
            }
        }
示例#53
0
        private bool SwitchClothes(Mobile from)
        {
            if (BaseHouse.FindHouseAt(from) == null || !BaseHouse.FindHouseAt(from).IsOwner(from))
            {
                from.SendMessage("You must be in your house to use this.");
                return false;
            }

            if (BaseHouse.FindHouseAt(this) == null || !BaseHouse.FindHouseAt(this).IsOwner(from))
            {
                from.SendMessage("Your Steward must be in your own house to use it.");
                return false;
            }

            if (BaseHouse.FindHouseAt(this) != null && BaseHouse.FindHouseAt(from) != null &&
                BaseHouse.FindHouseAt(this) != BaseHouse.FindHouseAt(from))
            {
                from.SendMessage("You and your Steward must be in the same house to do that!");
                return false;
            }

            if (!CanSee(from) || !from.InLOS(this))
            {
                from.SendMessage("You and your Steward must be able to see eachother to do that.");
                return false;
            }

            List<Item> stewardItems = new List<Item>();
            List<Item> mobileItems = new List<Item>();

            foreach (Item item in Items)
            {
                if (IsEquipped(item) && !(item is Backpack))
                {
                    stewardItems.Add(item);
                }
            }

            foreach (Item item in from.Items)
            {
                if (IsEquipped(item) && !(item is Backpack))
                {
                    mobileItems.Add(item);
                }
            }

            foreach (Item item in mobileItems)
            {
                from.RemoveItem(item);
            }

            foreach (Item item in stewardItems)
            {
                RemoveItem(item);
            }

            foreach (Item item in mobileItems)
            {
                EquipItem(item);
            }

            bool someRemoved = false;
            foreach (Item item in stewardItems)
            {
                if (!from.EquipItem(item))
                {
                    someRemoved = true;
                    if (!from.AddToBackpack(item))
                        item.DropToWorld(from, from.Location);
                }
            }

            if (someRemoved)
            {
                from.SendMessage("You were not able to equip everything.");
                return false;
            }

            return true;
        }
示例#54
0
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.IsStaff() || from.InRange(this.GetWorldLocation(), 2))
            {
                #region Self Looting
                bool selfLoot = (checkSelfLoot && (from == m_Owner));

                if (selfLoot)
                {
                    List<Item> items = new List<Item>(this.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 (!this.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;
            }
        }
示例#55
0
        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)
                {
                    List <Item> items = new List <Item>(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 = items[i];
                        Point3D loc  = item.Location;

                        if (item.Layer == Layer.Hair)
                        {
                            continue;
                        }
                        if (item.Layer == Layer.FacialHair)
                        {
                            continue;
                        }
                        if (!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);
                                    }
                                }
                            }
                        }

                        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.
                    }
                }

                #endregion

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

                base.OnDoubleClick(from);

                if (from != m_Owner)
                {
                    from.RevealingAction();
                }
            }

            else
            {
                from.SendLocalizedMessage(500446); // That is too far away.
                return;
            }
        }
示例#56
0
		public void Refresh( Mobile mob, Container cont )
		{
			if ( !mob.Alive )
			{
				mob.Resurrect();

				DeathRobe robe = mob.FindItemOnLayer( Layer.OuterTorso ) as DeathRobe;

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

				if ( cont is Corpse )
				{
					Corpse corpse = (Corpse) cont;

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

						if ( item.Movable && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.IsChildOf( mob.Backpack ) )
							mob.EquipItem( item );
					}
				}
			}

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

			mob.Poison = null;
		}
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.Validate(attacker))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            Item toDisarm = defender.FindItemOnLayer(Layer.OneHanded);

            if (toDisarm == null || !toDisarm.Movable)
            {
                toDisarm = defender.FindItemOnLayer(Layer.TwoHanded);
            }

            Container pack = defender.Backpack;

            if (pack == null || (toDisarm != null && !toDisarm.Movable))
            {
                attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent.
            }
            else if (toDisarm == null || toDisarm is BaseShield || toDisarm is Spellbook && !Core.ML)
            {
                attacker.SendLocalizedMessage(1060849); // Your target is already unarmed!
            }
            else if (this.CheckMana(attacker, true))
            {
                // Skill Masteries
                int saveChance = Server.Spells.SkillMasteries.MasteryInfo.SavingThrowChance(defender);

                if (saveChance > 0 && saveChance >= Utility.Random(100))
                {
                    attacker.SendLocalizedMessage(1156033); // Your disarm attempt was blocked!
                    defender.SendLocalizedMessage(1156034); // You blocked a disarm attempt!
                    return;
                }

                attacker.SendLocalizedMessage(1060092); // You disarm their weapon!
                defender.SendLocalizedMessage(1060093); // Your weapon has been disarmed!

                defender.PlaySound(0x3B9);
                defender.FixedParticles(0x37BE, 232, 25, 9948, EffectLayer.LeftHand);

                pack.DropItem(toDisarm);

                BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.NoRearm, 1075637, BlockEquipDuration, defender));

                BaseWeapon.BlockEquip(defender, BlockEquipDuration);

                if (defender is BaseCreature && ((BaseCreature)defender).AutoRearms)
                {
                    Timer.DelayCall(BlockEquipDuration + TimeSpan.FromSeconds(Utility.RandomMinMax(3, 10)), () =>
                    {
                        if (toDisarm != null && !toDisarm.Deleted && toDisarm.IsChildOf(defender.Backpack))
                        {
                            defender.EquipItem(toDisarm);
                        }
                    });
                }
            }
        }
示例#58
0
        public override void OnDoubleClick(Mobile from)
        {
            // if not a player
            Mobile      m_Mob       = (Mobile)from;
            AccessLevel al_MobLevel = m_Mob.AccessLevel;
            Account     a_Account   = (Account)m_Mob.Account;
            AccessLevel al_AccLevel = a_Account.AccessLevel;

            if (al_AccLevel > AccessLevel.Player)
            {
                // if not already possessing a mobile
                if (!m_Possessing)
                {
                    from.SendMessage("Who or What do you want to possess?");
                    from.Target = new InternalTarget(this);
                }
                // restore your self and unhide the previously possessed mobile
                else
                {
                    // restore basics
                    m_Possessing   = false;
                    from.Karma     = m_Karma;
                    from.Fame      = m_Fame;
                    from.Name      = m_Name;
                    from.Title     = m_Title;
                    from.Hue       = m_Hue;
                    from.BodyValue = m_BodyValue;
                    from.Female    = m_Female;
                    from.Hidden    = true;
                    // Delete eveything you have equipped which is just a copy of what the NPC had
                    ArrayList equipitems = new ArrayList(from.Items);
                    foreach (Item item in equipitems)
                    {
                        if ((item.Layer != Layer.Bank) && (item.Layer != Layer.Backpack))
                        {
                            item.Delete();
                        }
                    }
                    // get dressed and delete that white backpack
                    for (int i = m_Stuff.Items.Count - 1; i >= 0; --i)
                    {
                        if (i >= m_Stuff.Items.Count)
                        {
                            continue;
                        }
                        from.EquipItem((Item)m_Stuff.Items[i]);
                    }
// do we really want to delete the backpack?
                    m_Stuff.Delete();

                    // get your location, orient, enabale and show the mobile
                    Point3D from_Location = new Point3D(from.Location.X, from.Location.Y, from.Location.Z);
                    if (m_Possessed != null)
                    {
                        m_Possessed.Direction = from.Direction;
                        m_Possessed.MoveToWorld(from_Location, from.Map);
                        m_Possessed.Hidden   = false;
                        m_Possessed.CantWalk = false;
                    }
                }
            }
            else // somehow a player got one of these which should never happen, just delete it and put a scare into them
            {
                from.SendMessage("You are trying to access a restricted item. The item has been removed and your account has been scheduled for deletion.");
                this.Delete();
            }
        }
示例#59
0
        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 )
                {
                    List<Item> items = new List<Item>(this.Items);

                    bool gathered = false;
                    bool didntFit = false;

                    Container pack = from.Backpack;

                    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( 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();
                            ProcessDelta();
                            this.Delete();
                        }

                        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.
                }

                #endregion

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

                base.OnDoubleClick(from);

                if( from != m_Owner )
                {
                    from.RevealingAction();

                    if( from.Player )
                    {
                        EventDispatcher.InvokeCorpseAction(new CorpseActionEventArgs((Player)from, this, CorpseActionEventArgs.CorpseAction.Opened));
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(500446); // That is too far away.
                return;
            }
        }