public override void OnDoubleClick(Mobile from)
		{
			if ( this.IsChildOf( from.Backpack ) )
			{
				if (i_Owner == 0)
				{
					i_Owner = from.Serial;
					Name = from.Name + "'s Reward Ticket Ledger";
					i_RewardTickets = 0;
					from.SendGump( new RewardTicketsGump( from, this ) );
				}
				else if (from.Serial == i_Owner)
				{
					from.SendGump( new RewardTicketsGump( from, this ) );
				}
				else if (from.AccessLevel >= AccessLevel.GameMaster)
				{
					from.SendMessage(1161, "Select a new owner for this Reward ticket ledger.");
					BeginSetOwner( from );
				}
				else
				{
					from.PlaySound(1074); //play no!! sound
					from.SendMessage(1161, "This book is not yours and you cannot seem to write your name in it!");
				}
			}
			else
				from.SendMessage(1161, "The Reward ticket ledger must be in your backpack to be used.");
		}
Esempio n. 2
0
 protected override void OnTarget(Mobile from, object target)
 {
     if (from != null && !from.Deleted && target != null)
     {
         if (target is PlayerMobile)
         {
             Mobile targetted = target as Mobile;
             if (targetted == from)
             {
                 from.SendMessage("Cela sera un jet sur vous-même...");
             }
             else
             {
                 from.SendMessage("Cela sera un jet contre un joueur...");
                 targetted.SendMessage("{0} prépare une jet RolePlay avec vous...", from.Name);
             }
             from.SendGump(new RolePlayGump(from, (Mobile)target, 0, false, 1, false));
         }
         else if (target is Mobile)
         {
             from.SendMessage("Cela sera un jet contre un personnage non joueur...");
             from.SendGump(new RolePlayGump(from, (Mobile)target, 0, false, 1, false));
         }
     }
 }
		public override void OnDoubleClick( Mobile from )
		{
			Map map = from.Map;

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

			if ( from.AccessLevel >= AccessLevel.GameMaster )
			{
				from.CloseGump( typeof( HolidayTreeAddonChoiceGump ) );
				from.SendGump( new HolidayTreeAddonChoiceGump( from, this ) );
			}
			else
			{

				if ( !IsChildOf( from.Backpack ) )
					from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
				else if ( !from.InRange( this.GetWorldLocation(), 1 ) )
					from.SendLocalizedMessage( 500446 ); // That is too far away.
				else if ( DateTime.Now.Month != 12 )
					from.SendLocalizedMessage( 1005700 ); // You will have to wait till next December to put your tree back up for display.
				else
				{
					from.CloseGump( typeof( HolidayTreeAddonChoiceGump ) );
					from.SendGump( new HolidayTreeAddonChoiceGump( from, this ) );
				}
			}
		}
        public override void Drink(Mobile from)
        {
            Item am = from.Backpack.FindItemByType(typeof(RecluseStingMarker));
            if (am != null)
            {
                from.BodyMod = 0;
                from.Hue = -1;
                from.YellowHealthbar = false;

                from.PlaySound(0xF6);
                from.PlaySound(0x1F7);
                from.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                    BasePotion.PlayDrinkEffect(from);

                    this.Consume();
                    from.SendGump(new RecluseAntidoteGump());
                    //am.Delete();
                }
                else if (am == null )
                {
                    from.SendGump(new RecluseCuredGump());
                    
                }
            }
Esempio n. 5
0
        public static void SendTo( Mobile to, Mobile sender, Mobile handler, bool staff, PageEntry entry, bool resendEntryGump )
        {
            to.SendGump( new ChatGumpDisplay( sender, handler, staff, entry ) );

            if( resendEntryGump )
                to.SendGump( new ChatGumpEntry( sender, handler, entry ) );
        }
		protected override void OnTarget(Mobile from, object targeted)
		{
			try
			{
				m_Callback.DynamicInvoke( new object[] { from, targeted } );
			}
			catch
			{
//				Console.WriteLine( "The auction system cannot access the cliloc.enu file. Please review the system instructions for proper installation" );
				if (targeted != null)
				{
//					from.SendMessage ("target ! null");
					if (targeted is Item)
					{
						((Item)targeted).Visible = true;
						from.SendGump(new AuctionWontAcceptNoticeGump(from));
					}
					else
					{
						from.SendGump( new NoticeGump( 1060637, 30720, "Please let a GM know - Aution Target Else.", 0xFFC000, 320, 240, null, null ) );
					}
				}
				else
				{
					from.SendMessage ("targeted was null");
				}
			}
		}
		public override void OnDoubleClick( Mobile from )
		{	
			if ( from.InRange( GetWorldLocation(), 2 ) )
			{
				if ( BlueMageControl.IsBlueMage( from ) )
				{
					if ( from.HasGump( typeof( BlueQuitGump ) ) )
						from.CloseGump( typeof( BlueQuitGump ) );

					from.SendGump( new BlueQuitGump( from ) );
				}
				else
				{
					if ( from.AccessLevel == AccessLevel.Player )
						from.SendMessage( "Please speak to Ben in New Haven" );
					else
					{
						if ( from.HasGump( typeof( BlueAcceptGump ) ) )
							from.CloseGump( typeof( BlueAcceptGump ) );
						
						from.SendGump( new BlueAcceptGump( from ) );
					}
				}
			}

		}
Esempio n. 8
0
		protected override void OnTarget( Mobile from, object targeted )
		{
			if( targeted is Mobile )
			{
				Mobile m = ((Mobile)targeted);

				if( m == creature )
				{
					from.SendMessage( "It cannot attack itself!" );
					from.SendGump( new CreatureControl( creature, from ) );
				}

				else
				{

					if( creature.Alive )
					{
						m_AI.Action = ActionType.Combat;
						m_AI.NextMove = DateTime.Now;
						creature.Combatant = m;
						from.SendGump( new CreatureControl( creature, from ) );
					}
				}
			}

			else
			{
				from.SendMessage( "You cannot attack that!" );
				from.SendGump( new CreatureControl( creature, from ) );
			}
		}
 protected override void OnTargetFinish( Mobile from )
 {
     if ( m_Type == typeof( Type ) )
         from.SendGump( new PropertiesGump( m_Mobile, m_Object, m_Stack, m_List, m_Page ) );
     else
         from.SendGump( new SetObjectGump( m_Property, m_Mobile, m_Object, m_Stack, m_Type, m_Page, m_List ) );
 }
			protected override void OnTarget( Mobile from, object o )
			{
				if ( !BaseCommand.IsAccessible( from, o ) )
					from.SendMessage( "That is not accessible." );
				else if ( m_Normal )
					from.SendGump( new PropertiesGump( from, o ) );
				else if ( o is Guildstone )
					from.SendGump( new PropertiesGump( from, ((Guildstone)o).Guild ) );
			}
Esempio n. 11
0
        protected override void OnTargetFinish( Mobile from )
        {
            if( m_Type == typeof( Type ) )
                from.SendGump( new PropertiesGump( m_Mobile, m_Object, m_Stack, m_List, m_Page ) );
            else
            {
                PlayerMobile pm = from as PlayerMobile;

                if( pm.AccessLevel > AccessLevel.Player )
                {
                    from.SendGump( new SetObjectGump( m_Property, m_Mobile, m_Object, m_Stack, m_Type, m_Page, m_List ) );
                }
            }
        }
Esempio n. 12
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( m_Faction == null )
				return;
			if ( from.Kills >= 5 )
			{
                if (MurderSystemController._MurderersCanJoinAnyFaction == false)
                {
                    if ((m_Faction.Definition.FriendlyName == "True Britannians" || m_Faction.Definition.FriendlyName == "Council of Mages"))
                    {
                        from.SendMessage("Murderers cannot join this faction!");
                        return;
                    }
                }
			}

			if ( !from.InRange( GetWorldLocation(), 2 ) )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
			}
			else if ( FactionGump.Exists( from ) )
			{
				from.SendLocalizedMessage( 1042160 ); // You already have a faction menu open.
			}
			else if ( from is PlayerMobile )
			{
				Faction existingFaction = Faction.Find( from );

				if ( existingFaction == m_Faction || from.AccessLevel >= AccessLevel.GameMaster )
				{
					PlayerState pl = PlayerState.Find( from );

					if ( pl != null && pl.IsLeaving )
						from.SendLocalizedMessage( 1005051 ); // You cannot use the faction stone until you have finished quitting your current faction
					else
						from.SendGump( new FactionStoneGump( (PlayerMobile) from, m_Faction ) );
				}
				else if ( existingFaction != null )
				{
					// TODO: Validate
					from.SendLocalizedMessage( 1005053 ); // This is not your faction stone!
				}
				else
				{
					from.SendGump( new JoinStoneGump( (PlayerMobile) from, m_Faction ) );
				}
			}
		}
Esempio n. 13
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsChildOf( from.Backpack ) )
				from.SendGump( new HousePlacementCategoryGump( from ) );
			else
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
		}
		public static void SendGump(Mobile from, MasterLooterBackpack backpack, int page)
		{
			CloseGump(from);
			if ( backpack == null || backpack.Deleted || !backpack.IsOwner(from as PlayerMobile))
				return;
			from.SendGump(new MasterLooterSetupGump(backpack, page));
		}
Esempio n. 15
0
		public bool UseGate( Mobile m )
		{
			if ( m.Criminal )
			{
				m.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
				return false;
			}
			else if ( SpellHelper.CheckCombat( m ) )
			{
				m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
				return false;
			}
			else if ( m.Spell != null )
			{
				m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
				return false;
			}
			else
			{
				m.CloseGump( typeof( MoongateGump ) );
				m.SendGump( new MoongateGump( m, this ) );

				if ( !m.Hidden || m.AccessLevel == AccessLevel.Player )
					Effects.PlaySound( m.Location, m.Map, 0x20E );

				return true;
			}
		}
		public override void OnDoubleClick( Mobile from )
		{
			if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
				return;
			
			if ( m_UsesRemaining > 0 )
			{
				from.SendLocalizedMessage( 1072357 ); // Select an object to engrave.
				from.Target = new TargetWeapon( this );
			}
			else 
			{
				if ( from.Skills.Tinkering.Value == 0 )
				{
					from.SendLocalizedMessage( 1076179 ); // Since you have no tinkering skill, you will need to find an NPC tinkerer to repair this for you.					
				}
				else if ( from.Skills.Tinkering.Value < 75.0 )
				{		
					from.SendLocalizedMessage( 1076178 ); // Your tinkering skill is too low to fix this yourself.  An NPC tinkerer can help you repair this for a fee.
				}
				else
				{					
					Item diamond = from.Backpack.FindItemByType( typeof( BlueDiamond ) );	
					
					if ( diamond != null )
						from.SendGump( new ConfirmGump( this, null ) );	
					else					
						from.SendLocalizedMessage( 1076166 ); // You do not have a blue diamond needed to recharge the engraving tool.	
				}
				
				from.SendLocalizedMessage( 1076163 ); // There are no charges left on this engraving tool.
			}		
		}
Esempio n. 17
0
        public override void OnDoubleClick( Mobile from )
        {
            if ( this.Parent != null || !this.VerifyMove( from ) )
                return;

            if ( !from.InRange( this, 2 ) )
            {
                from.LocalOverheadMessage( MessageType.Regular, 0x3B2, true, "I can't reach that." ); // I can't reach that.
                return;
            }

            if ( this.ItemID == 0xA57 ) // rolled
            {
                Direction dir = PlayerMobile.GetDirection4( from.Location, this.Location );

                if ( dir == Direction.North || dir == Direction.South )
                    this.ItemID = 0xA55;
                else
                    this.ItemID = 0xA56;
            }
            else // unrolled
            {
                this.ItemID = 0xA57;

                if ( !from.HasGump( typeof( LogoutGump ) ) )
                {
                    CampfireEntry entry = Campfire.GetEntry( from );

                    if ( entry != null && entry.Safe )
                        from.SendGump( new LogoutGump( entry, this ) );
                }
            }
        }
Esempio n. 18
0
        public static void OnAccepted( Mobile from )
        {
            if ( from.Backpack == null )
                return;

            PlainGreyCloak cloak = from.FindItemOnLayer( Layer.Cloak ) as PlainGreyCloak;

            if ( cloak == null )
            {
                from.DropHolding();
                cloak = from.Backpack.FindItemByType<PlainGreyCloak>();
            }

            if ( cloak == null )
                return;

            cloak.Delete();
            from.PlaceInBackpack( new ShieldOfRecognition() );

            /* *smiles* Surely thy deeds will be recognized by those who see thee
             * wearing this shield! It shall serve as a reminder of the exalted
             * path that thou hast journeyed upon, and I wish to thank thee on
             * behalf of all whom thine efforts shall benefit. Ah, let us not
             * forget that old cloak I gavest thee - I shall take it back now and
             * give thee thine reward. */
            from.SendGump( new GenericQuestGump( 1075783 ) );

            if ( from is PlayerMobile )
                ( (PlayerMobile) from ).HumilityQuestStatus = HumilityQuestStatus.RewardAccepted;
        }
Esempio n. 19
0
			protected override void OnTarget( Mobile from, object o )
			{
				if ( !BaseCommand.IsAccessible( from, o ) )
					from.SendMessage( "That is not accessible." );
				else
					from.SendGump( new PropertiesGump( from, o ) );
			}
Esempio n. 20
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsChildOf( from.Backpack ) || Parent == from )
			{
				if ( UsesRemaining > 0 )
				{
					CraftSystem system = this.CraftSystem;
	
					int num = system.CanCraft( from, this, null );
	
					if ( num > 0 )
					{
						from.SendLocalizedMessage( num );
					}
					else
					{
						CraftContext context = system.GetContext( from );
	
						from.SendGump( new CraftGump( from, system, this, null ) );
					}
				}
				else
					from.SendLocalizedMessage( 1072306 ); // You must wait a moment for it to recharge.
			}
			else
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
		}
Esempio n. 21
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsChildOf( from.Backpack ) )
			{
				from.SendGump( new ScrollOfAbraxusGump() );

				PlayerMobile pm = from as PlayerMobile;

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

					if ( qs is DarkTidesQuest )
					{
						QuestObjective obj = qs.FindObjective( typeof( ReadAbraxusScrollObjective ) );

						if ( obj != null && !obj.Completed )
							obj.Complete();
					}
				}
			}
			else
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
		}
 public override void OnDoubleClick(Mobile from)
 {
     if (m_Arena != null && !m_Arena.Deleted && m_Arena.Running)
         from.SendGump(new ArenaScoreBoardGump(m_Arena));
     else
         from.SendMessage("The Arena is under maintainance; there is no score available at the moment.");
 }
Esempio n. 23
0
        	public override void OnDoubleClick( Mobile from )
        	{
			if ( IsChildOf( from.Backpack ) )
			{

				PlayerMobile pm = (PlayerMobile)from;
				if ( from.Skills[SkillName.AnimalTaming].Base < 100.0 && from.Skills[SkillName.Tinkering].Base < 100.0 )
				{
					from.SendMessage( "You have no clue how to use this." );
				}
				else if ( FSATS.EnableBioEngineer == false )
				{
					from.SendMessage( "Bio-Engineering has been disabled on this server, Please contact your server administrator for more information." );
				}
				//else if ( pm.Bioenginer == false )
				//{
				//	from.SendMessage( "You have no clue how to use this." );
				//}
				else
				{
					from.CloseGump( typeof( SampleDNAGump ) );
					from.SendGump( new SampleDNAGump( this ) );
				}
			}
			else
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
		}
Esempio n. 24
0
 protected override void OnTargetFinish( Mobile from )
 {
     if ( !m_Plant.Deleted && m_Plant.PlantStatus < PlantStatus.DecorativePlant && from.InRange( m_Plant.GetWorldLocation(), 3 ) && m_Plant.IsUsableBy( from ) && !from.HasGump( typeof(MainPlantGump) ) )
     {
         from.SendGump( new MainPlantGump( m_Plant ) );
     }
 }
Esempio n. 25
0
 public override void OnDoubleClick(Mobile from)
 {
     if ((!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this)) && from.AccessLevel == AccessLevel.Player)
     {
         from.SendLocalizedMessage(500446); // That is too far away.
         return;
     }
     m_TimeOut = DateTime.UtcNow - m_LastBuild;
     if (m_UpdateTimer < m_TimeOut || itemarray == null)
         BuildArrayList(from);
     else if (turboslotsarray != null)
     {
         foreach (TurboSlot t in turboslotsarray)
         {
             if ((t == null || t.Deleted) )
             {
                 BuildArrayList(from);
                 break;
             }
         }
     }
     if (turboslotsarray != null)
     {
         from.CloseGump(typeof(TurboSlotsStatGump));
         from.SendGump(new TurboSlotsStatGump(from, turboslotsarray));
     }
 }
Esempio n. 26
0
        public override void OnDoubleClick(Mobile from)
        {
            MerlinsStaff Staff = from.FindItemOnLayer(Layer.TwoHanded) as MerlinsStaff;

            if (Parent != from)
            {
                from.SendMessage("You remember that you must equip the staff to summon a portal to Merlin");
            }
            else
            {
                Item marker1 = from.Backpack.FindItemByType(typeof(Marker1));
                if (marker1 != null)
                {
                    marker1.Delete();

                    from.AddToBackpack(new Marker2());
                    from.AddToBackpack(new Tablet());
                    from.FixedParticles(0x3709, 1, 30, 9904, 1108, 6, EffectLayer.RightFoot);
                    from.SendGump(new MerlinsQuestGump6(from));
                    from.SendMessage("Muahahahaha!!!! You fool!");
                    Talon2 tl = new Talon2();
                    tl.Map = from.Map;
                    tl.Location = from.Location;
                    Delete();
                }
                else
                {
                    from.SendMessage("You have no right to have this staff!!!!");
                }
            }
        }
Esempio n. 27
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( GetWorldLocation(), 2 ) )
			from.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
			else if ( from is PlayerMobile )
			from.SendGump( new FoodPantryGump( (PlayerMobile)from, this ) );
		}
Esempio n. 28
0
		public override void OnDoubleClickSecureTrade( Mobile from )
		{
			if ( !from.InRange( GetWorldLocation(), 2 ) )
			{
				from.SendLocalizedMessage( 500446 ); // That is too far away.
			}
			else if ( m_Entries.Count == 0 )
			{
				from.SendLocalizedMessage( 1062381 ); // The book is empty.
			}
			else
			{
				from.SendGump( new BOBGump( (PlayerMobile)from, this ) );

				SecureTradeContainer cont = GetSecureTradeCont();

				if ( cont != null )
				{
					SecureTrade trade = cont.Trade;

					if ( trade != null && trade.From.Mobile == from )
						trade.To.Mobile.SendGump( new BOBGump( (PlayerMobile)(trade.To.Mobile), this ) );
					else if ( trade != null && trade.To.Mobile == from )
						trade.From.Mobile.SendGump( new BOBGump( (PlayerMobile)(trade.From.Mobile), this ) );
				}
			}
		}
Esempio n. 29
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsChildOf( from.Backpack ) )
				from.SendGump( new ConfirmBreakCrystalGump( this ) );
			else
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
		}
		public static void SendToolbar(Mobile m)
		{
			ToolbarModule module = m.GetModule(typeof(ToolbarModule)) as ToolbarModule ?? new ToolbarModule(m);

			m.CloseGump(typeof(ToolbarGump));
            m.SendGump(new ToolbarGump(module.ToolbarInfo, m));
		}
Esempio n. 31
0
            public override void OnResponse(NetState state, RelayInfo info)
            {
                Mobile    from       = state.Mobile;
                Account   acct       = (Account)from.Account;
                ArrayList ip_List    = new ArrayList(acct.LoginIPs);
                int       id         = info.ButtonID;
                Account   tafacc     = null;
                ArrayList tafip_List = new ArrayList();

                if (id == 1)
                {
                    string input = info.GetTextEntry(2).Text;
                    try
                    {
                        tafacc     = Accounts.GetAccount(input) as Account;
                        tafip_List = new ArrayList(tafacc.LoginIPs);
                    }
                    catch (Exception e) { }

                    string initialText = "";

                    if (tafacc == null)
                    {
                        initialText = String.Format("Account: '{0}' NOT found", input);
                    }
                    else if (input == "")
                    {
                        initialText = "Please enter a valid Account name.";
                    }
                    else if (input.ToLower() == acct.ToString().ToLower())
                    {
                        initialText = "You can't enter you own Account name!";
                    }
                    else
                    {
                        bool uniqueIP = true;

                        if (checkIP)
                        {
                            for (int i = 0; i < ip_List.Count; ++i)
                            {
                                if (tafip_List.Contains(ip_List[i]))
                                {
                                    uniqueIP = false;
                                }
                            }

                            if (uniqueIP)
                            {
                                initialText = String.Format("{0} Marked as Referrer", tafacc);
                                acct.SetTag("ToldAFriend", "true");
                                acct.SetTag("Referrer", tafacc.ToString());
                            }
                            else
                            {
                                initialText = "You can't refer another account you own";
                            }
                        }
                        else
                        {
                            initialText = String.Format("{0} Marked as Referrer", tafacc);
                            acct.SetTag("ToldAFriend", "true");
                            acct.SetTag("Referrer", tafacc.ToString());
                        }
                    }
                    from.SendGump(new TAFGump(from, initialText));
                }
                if (id == 2)
                {
                    from.BeginTarget(10, false, TargetFlags.None, new TargetCallback(TAFTarget));
                    from.SendMessage(String.Format("Please target the character of the person who referred you to {0}", TAFShardName));
                }
            }
Esempio n. 32
0
        private static void TAFLogin(LoginEventArgs args)
        {
            Mobile m = args.Mobile;

            m.SendMessage(String.Format("Your friend will receive a reward for referring you to {0} next time (s)he logs in.", TAFShardName));
            Account ac         = (Account)m.Account;
            bool    toldfriend = ToldAFriend(m);
            bool    gotfriend  = GotAFriend(m);

            if (ac.Created >= age)
            {
                if (!toldfriend)
                {
                    m.SendGump(new TAFGump(m));
                }
            }
            else if (toldfriend)
            {
                string  friend     = ac.GetTag("Referrer");
                Account friendacct = Accounts.GetAccount(friend) as Account;
                if (friendacct == null)
                {
                    ac.RemoveTag("Referrer");
                }
                else
                {
                    if (ac.LastLogin > mindate && friendacct.LastLogin > mindate && ac.TotalGameTime >= RewardTime && friendacct.TotalGameTime >= RewardTime)
                    {
                        //m.SendMessage( String.Format( "Your friend will receive a reward for referring you to {0} next time (s)he logs in.", TAFShardName ) );
                        m.SendMessage(String.Format("You receive a reward for your loyalty to {0}.", TAFShardName));
                        m.AddToBackpack(new PetBondingDeed());
                        m.AddToBackpack(new ReferrerReward());
                        if (Convert.ToBoolean(ac.GetTag("GotAFriend")))
                        {
                            string friends = ac.GetTag("GotFriend") + "," + ac.ToString();
                            friendacct.SetTag("GotFriend", friends);
                        }
                        else
                        {
                            friendacct.SetTag("GotAFriend", "true");
                            friendacct.SetTag("GotFriend", ac.ToString());
                        }
                        ac.RemoveTag("Referrer");
                        ac.RemoveTag("ToldAFriend");
                    }
                }
            }
            else if (gotfriend)
            {
                string   friend  = ac.GetTag("GotFriend");
                string[] friends = friend.Split(',');
                for (int i = 0; i < friends.Length; ++i)
                {
                    m.SendMessage(String.Format("You receive a reward and a referral token for referring one of your friends to {0}.", TAFShardName));
                    m.AddToBackpack(new PetBondingDeed());
                    m.AddToBackpack(new ReferrerReward());
                }
                ac.RemoveTag("GotAFriend");
                ac.RemoveTag("GotFriend");
            }
        }
Esempio n. 33
0
        public static void Freeze(Mobile from, Map targetMap, Point3D start3d, Point3D end3d)
        {
            Hashtable mapTable = new Hashtable();

            if (start3d == NullP3D && end3d == NullP3D)
            {
                if (targetMap == null)
                {
                    CommandLogging.WriteLine(from, "{0} {1} invoking freeze for every item in every map", from.AccessLevel, CommandLogging.Format(from));
                }
                else
                {
                    CommandLogging.WriteLine(from, "{0} {1} invoking freeze for every item in {0}", from.AccessLevel, CommandLogging.Format(from), targetMap);
                }

                foreach (Item item in World.Items.Values)
                {
                    if (targetMap != null && item.Map != targetMap)
                    {
                        continue;
                    }

                    if (item.Parent != null)
                    {
                        continue;
                    }

                    if (item is Static || item is BaseFloor || item is BaseWall)
                    {
                        Map itemMap = item.Map;

                        if (itemMap == null || itemMap == Map.Internal)
                        {
                            continue;
                        }

                        Hashtable table = (Hashtable)mapTable[itemMap];

                        if (table == null)
                        {
                            mapTable[itemMap] = table = new Hashtable();
                        }

                        Point2D p = new Point2D(item.X >> 3, item.Y >> 3);

                        DeltaState state = (DeltaState)table[p];

                        if (state == null)
                        {
                            table[p] = state = new DeltaState(p);
                        }

                        state.m_List.Add(item);
                    }
                }
            }
            else if (targetMap != null)
            {
                Point2D start = targetMap.Bound(new Point2D(start3d)), end = targetMap.Bound(new Point2D(end3d));

                CommandLogging.WriteLine(from, "{0} {1} invoking freeze from {2} to {3} in {4}", from.AccessLevel, CommandLogging.Format(from), start, end, targetMap);

                IPooledEnumerable eable = targetMap.GetItemsInBounds(new Rectangle2D(start.X, start.Y, end.X - start.X + 1, end.Y - start.Y + 1));

                foreach (Item item in eable)
                {
                    if (item is Static || item is BaseFloor || item is BaseWall)
                    {
                        Map itemMap = item.Map;

                        if (itemMap == null || itemMap == Map.Internal)
                        {
                            continue;
                        }

                        Hashtable table = (Hashtable)mapTable[itemMap];

                        if (table == null)
                        {
                            mapTable[itemMap] = table = new Hashtable();
                        }

                        Point2D p = new Point2D(item.X >> 3, item.Y >> 3);

                        DeltaState state = (DeltaState)table[p];

                        if (state == null)
                        {
                            table[p] = state = new DeltaState(p);
                        }

                        state.m_List.Add(item);
                    }
                }

                eable.Free();
            }

            if (mapTable.Count == 0)
            {
                from.SendGump(new NoticeGump(1060637, 30720, "No freezable items were found.  Only the following item types are frozen:<br> - Static<br> - BaseFloor<br> - BaseWall", 0xFFC000, 320, 240, null, null));
                return;
            }

            bool badDataFile = false;

            int totalFrozen = 0;

            foreach (DictionaryEntry de in mapTable)
            {
                Map       map   = (Map)de.Key;
                Hashtable table = (Hashtable)de.Value;

                TileMatrix matrix = map.Tiles;

                using (FileStream idxStream = OpenWrite(matrix.IndexStream))
                {
                    using (FileStream mulStream = OpenWrite(matrix.DataStream))
                    {
                        if (idxStream == null || mulStream == null)
                        {
                            badDataFile = true;
                            continue;
                        }

                        BinaryReader idxReader = new BinaryReader(idxStream);

                        BinaryWriter idxWriter = new BinaryWriter(idxStream);
                        BinaryWriter mulWriter = new BinaryWriter(mulStream);

                        foreach (DeltaState state in table.Values)
                        {
                            int          oldTileCount;
                            StaticTile[] oldTiles = ReadStaticBlock(idxReader, mulStream, state.m_X, state.m_Y, matrix.BlockWidth, matrix.BlockHeight, out oldTileCount);

                            if (oldTileCount < 0)
                            {
                                continue;
                            }

                            int          newTileCount = 0;
                            StaticTile[] newTiles     = new StaticTile[state.m_List.Count];

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

                                int xOffset = item.X - (state.m_X * 8);
                                int yOffset = item.Y - (state.m_Y * 8);

                                if (xOffset < 0 || xOffset >= 8 || yOffset < 0 || yOffset >= 8)
                                {
                                    continue;
                                }

                                StaticTile newTile = new StaticTile();

                                newTile.m_ID  = (short)(item.ItemID & 0x3FFF);
                                newTile.m_X   = (byte)xOffset;
                                newTile.m_Y   = (byte)yOffset;
                                newTile.m_Z   = (sbyte)item.Z;
                                newTile.m_Hue = (short)item.Hue;

                                newTiles[newTileCount++] = newTile;

                                item.Delete();

                                ++totalFrozen;
                            }

                            int mulPos = -1;
                            int length = -1;
                            int extra  = 0;

                            if ((oldTileCount + newTileCount) > 0)
                            {
                                mulWriter.Seek(0, SeekOrigin.End);

                                mulPos = (int)mulWriter.BaseStream.Position;
                                length = (oldTileCount + newTileCount) * 7;
                                extra  = 1;

                                for (int i = 0; i < oldTileCount; ++i)
                                {
                                    StaticTile toWrite = oldTiles[i];

                                    mulWriter.Write((short)toWrite.m_ID);
                                    mulWriter.Write((byte)toWrite.m_X);
                                    mulWriter.Write((byte)toWrite.m_Y);
                                    mulWriter.Write((sbyte)toWrite.m_Z);
                                    mulWriter.Write((short)toWrite.m_Hue);
                                }

                                for (int i = 0; i < newTileCount; ++i)
                                {
                                    StaticTile toWrite = newTiles[i];

                                    mulWriter.Write((short)toWrite.m_ID);
                                    mulWriter.Write((byte)toWrite.m_X);
                                    mulWriter.Write((byte)toWrite.m_Y);
                                    mulWriter.Write((sbyte)toWrite.m_Z);
                                    mulWriter.Write((short)toWrite.m_Hue);
                                }

                                mulWriter.Flush();
                            }

                            int idxPos = ((state.m_X * matrix.BlockHeight) + state.m_Y) * 12;

                            idxWriter.Seek(idxPos, SeekOrigin.Begin);
                            idxWriter.Write(mulPos);
                            idxWriter.Write(length);
                            idxWriter.Write(extra);

                            idxWriter.Flush();

                            matrix.SetStaticBlock(state.m_X, state.m_Y, null);
                        }
                    }
                }
            }

            if (totalFrozen == 0 && badDataFile)
            {
                from.SendGump(new NoticeGump(1060637, 30720, "Output data files could not be opened and the freeze operation has been aborted.<br><br>This probably means your server and client are using the same data files.  Instructions on how to resolve this can be found in the first warning window.", 0xFFC000, 320, 240, null, null));
            }
            else
            {
                from.SendGump(new NoticeGump(1060637, 30720, String.Format("Freeze operation completed successfully.<br><br>{0} item{1} frozen.<br><br>You must restart your client and update it's data files to see the changes.", totalFrozen, totalFrozen != 1 ? "s were" : " was"), 0xFFC000, 320, 240, null, null));
            }
        }
Esempio n. 34
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile m = state.Mobile;

            switch (info.ButtonID)
            {
            case 0: { break; }

            case 1:
            {
                if (info.Switches.Length < switches)
                {
                    m.SendGump(new SkillPickGump5x100());
                    m.SendMessage(0, "You must pick {0} more skills.", switches - info.Switches.Length);
                    break;
                }
                else if (info.Switches.Length > switches)
                {
                    m.SendGump(new SkillPickGump5x100());
                    m.SendMessage(0, "Please get rid of {0} skills, you have exceeded 7.", info.Switches.Length - switches);
                    break;
                }
                else
                {
                    Server.Skills skills = m.Skills;

                    for (int i = 0; i < skills.Length; ++i)
                    {
                        skills[i].Base = 0;
                    }
                    if (info.IsSwitched(1))
                    {
                        m.Skills[SkillName.Alchemy].Base = val;
                    }
                    if (info.IsSwitched(2))
                    {
                        m.Skills[SkillName.Anatomy].Base = val;
                    }
                    if (info.IsSwitched(3))
                    {
                        m.Skills[SkillName.AnimalLore].Base = val;
                    }
                    if (info.IsSwitched(4))
                    {
                        m.Skills[SkillName.AnimalTaming].Base = val;
                    }
                    if (info.IsSwitched(5))
                    {
                        m.Skills[SkillName.Archery].Base = val;
                    }
                    if (info.IsSwitched(6))
                    {
                        m.Skills[SkillName.ArmsLore].Base = val;
                    }
                    if (info.IsSwitched(7))
                    {
                        m.Skills[SkillName.Begging].Base = val;
                    }
                    if (info.IsSwitched(8))
                    {
                        m.Skills[SkillName.Bushido].Base = val;
                    }
                    if (info.IsSwitched(9))
                    {
                        m.Skills[SkillName.Blacksmith].Base = val;
                    }
                    if (info.IsSwitched(10))
                    {
                        m.Skills[SkillName.Chivalry].Base = val;
                    }
                    if (info.IsSwitched(11))
                    {
                        m.Skills[SkillName.Camping].Base = val;
                    }
                    if (info.IsSwitched(12))
                    {
                        m.Skills[SkillName.Fletching].Base = val;
                    }
                    if (info.IsSwitched(13))
                    {
                        m.Skills[SkillName.Carpentry].Base = val;
                    }
                    if (info.IsSwitched(14))
                    {
                        m.Skills[SkillName.Cooking].Base = val;
                    }
                    if (info.IsSwitched(15))
                    {
                        m.Skills[SkillName.Fishing].Base = val;
                    }
                    if (info.IsSwitched(16))
                    {
                        m.Skills[SkillName.Focus].Base = val;
                    }
                    if (info.IsSwitched(17))
                    {
                        m.Skills[SkillName.Healing].Base = val;
                    }
                    if (info.IsSwitched(18))
                    {
                        m.Skills[SkillName.Herding].Base = val;
                    }
                    if (info.IsSwitched(19))
                    {
                        m.Skills[SkillName.Lockpicking].Base = val;
                    }
                    if (info.IsSwitched(20))
                    {
                        m.Skills[SkillName.Lumberjacking].Base = val;
                    }
                    if (info.IsSwitched(21))
                    {
                        m.Skills[SkillName.Magery].Base = val;
                    }
                    if (info.IsSwitched(22))
                    {
                        m.Skills[SkillName.Meditation].Base = val;
                    }
                    if (info.IsSwitched(23))
                    {
                        m.Skills[SkillName.Mining].Base = val;
                    }
                    if (info.IsSwitched(24))
                    {
                        m.Skills[SkillName.Musicianship].Base = val;
                    }
                    if (info.IsSwitched(25))
                    {
                        m.Skills[SkillName.Necromancy].Base = val;
                    }
                    if (info.IsSwitched(26))
                    {
                        m.Skills[SkillName.Ninjitsu].Base = val;
                    }
                    if (info.IsSwitched(27))
                    {
                        m.Skills[SkillName.RemoveTrap].Base = val;
                    }
                    if (info.IsSwitched(28))
                    {
                        m.Skills[SkillName.MagicResist].Base = val;
                    }
                    if (info.IsSwitched(29))
                    {
                        m.Skills[SkillName.Snooping].Base = val;
                    }
                    if (info.IsSwitched(30))
                    {
                        m.Skills[SkillName.Spellweaving].Base = val;
                    }
                    if (info.IsSwitched(31))
                    {
                        m.Skills[SkillName.Stealing].Base = val;
                    }
                    if (info.IsSwitched(32))
                    {
                        m.Skills[SkillName.Stealth].Base = val;
                    }
                    if (info.IsSwitched(33))
                    {
                        m.Skills[SkillName.Tailoring].Base = val;
                    }
                    if (info.IsSwitched(34))
                    {
                        m.Skills[SkillName.Tinkering].Base = val;
                    }
                    if (info.IsSwitched(35))
                    {
                        m.Skills[SkillName.Veterinary].Base = val;
                    }
                    if (info.IsSwitched(36))
                    {
                        m.Skills[SkillName.Fencing].Base = val;
                    }
                    if (info.IsSwitched(37))
                    {
                        m.Skills[SkillName.Macing].Base = val;
                    }
                    if (info.IsSwitched(38))
                    {
                        m.Skills[SkillName.Parry].Base = val;
                    }
                    if (info.IsSwitched(39))
                    {
                        m.Skills[SkillName.Swords].Base = val;
                    }
                    if (info.IsSwitched(40))
                    {
                        m.Skills[SkillName.Tactics].Base = val;
                    }
                    if (info.IsSwitched(41))
                    {
                        m.Skills[SkillName.Wrestling].Base = val;
                    }
                    if (info.IsSwitched(42))
                    {
                        m.Skills[SkillName.Cartography].Base = val;
                    }
                    if (info.IsSwitched(43))
                    {
                        m.Skills[SkillName.DetectHidden].Base = val;
                    }
                    if (info.IsSwitched(44))
                    {
                        m.Skills[SkillName.Inscribe].Base = val;
                    }
                    if (info.IsSwitched(45))
                    {
                        m.Skills[SkillName.Peacemaking].Base = val;
                    }
                    if (info.IsSwitched(46))
                    {
                        m.Skills[SkillName.Poisoning].Base = val;
                    }
                    if (info.IsSwitched(47))
                    {
                        m.Skills[SkillName.Provocation].Base = val;
                    }
                    if (info.IsSwitched(48))
                    {
                        m.Skills[SkillName.SpiritSpeak].Base = val;
                    }
                    if (info.IsSwitched(49))
                    {
                        m.Skills[SkillName.Tracking].Base = val;
                    }
                    if (info.IsSwitched(50))
                    {
                        m.Skills[SkillName.EvalInt].Base = val;
                    }
                    if (info.IsSwitched(51))
                    {
                        m.Skills[SkillName.Forensics].Base = val;
                    }
                    if (info.IsSwitched(52))
                    {
                        m.Skills[SkillName.ItemID].Base = val;
                    }
                    if (info.IsSwitched(53))
                    {
                        m.Skills[SkillName.TasteID].Base = val;
                    }
                    if (info.IsSwitched(54))
                    {
                        m.Skills[SkillName.Discordance].Base = val;
                    }
                    if (info.IsSwitched(55))
                    {
                        m.Skills[SkillName.Hiding].Base = val;
                    }
                    if (info.IsSwitched(56))
                    {
                        m.Skills[SkillName.Throwing].Base = val;
                    }
                    if (info.IsSwitched(57))
                    {
                        m.Skills[SkillName.Mysticism].Base = val;
                    }
                    if (info.IsSwitched(58))
                    {
                        m.Skills[SkillName.Imbuing].Base = val;
                    }
                }
                break;
            }
            }
        }
Esempio n. 35
0
 public static void SendWarning(Mobile m, string header, string baseWarning, Map map, Point3D start, Point3D end, WarningGumpCallback callback)
 {
     m.SendGump(new WarningGump(1060635, 30720, String.Format(baseWarning, String.Format(header, map)), 0xFFC000, 420, 400, callback, new StateInfo(map, start, end)));
 }
Esempio n. 36
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile m = state.Mobile;

            switch (info.ButtonID)
            {
            case 0: { break; }

            case 1:
            {
                if (info.Switches.Length < switches)
                {
                    m.SendGump(new SkillPickGump(m_SkillBallPlus));
                    m.SendMessage(0, "You must pick {0} more skills.", switches - info.Switches.Length);
                    break;
                }
                else if (info.Switches.Length > switches)
                {
                    m.SendGump(new SkillPickGump(m_SkillBallPlus));
                    m.SendMessage(0, "Please get rid of {0} skills, you have exceeded the 7 skills that are allowed.", info.Switches.Length - switches);
                    break;
                }

                else
                {
                    Server.Skills skills = m.Skills;

                    for (int i = 0; i < skills.Length; ++i)
                    {
                        //       skills[i].Base = 0;
                        if (info.IsSwitched(1)) // ------------------------------------------------ Alchemy
                        {
                            m.Skills[SkillName.Alchemy].Base = val;
                            Container pack = m.Backpack;
                            if (pack != null)
                            {
                                pack.DropItem(new Bottle(10));
                                pack.DropItem(new MortarPestle());
                                pack.DropItem(new BagOfReagents(50));
                            }
                        }
                    }
                    if (info.IsSwitched(2))     // ------------------------------------------------ Anatomy
                    {
                        m.Skills[SkillName.Anatomy].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Bandage(50));
                        }
                    }
                    if (info.IsSwitched(3))     // ------------------------------------------------ AnimalLore
                    {
                        m.Skills[SkillName.AnimalLore].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new ShepherdsCrook());
                        }
                    }
                    if (info.IsSwitched(4))     // ------------------------------------------------ AnimalTaming
                    {
                        m.Skills[SkillName.AnimalTaming].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Apple(10));
                        }
                    }
                    if (info.IsSwitched(5))     // ------------------------------------------------ Archery
                    {
                        m.Skills[SkillName.Archery].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Arrow(200));
                            pack.DropItem(new Bow( ));
                        }
                    }
                    if (info.IsSwitched(6)) // ------------------------------------------------ ArmsLore
                    {
                        m.Skills[SkillName.ArmsLore].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new IronIngot(50));
                        }
                    }
                    if (info.IsSwitched(7)) // ------------------------------------------------ Begging
                    {
                        m.Skills[SkillName.Begging].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BankCheck(5000));
                        }
                    }
                    if (info.IsSwitched(9)) // ------------------------------------------------ Blacksmith
                    {
                        m.Skills[SkillName.Blacksmith].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new IronIngot(50));
                            pack.DropItem(new Tongs());
                            pack.DropItem(new Pickaxe());
                            pack.DropItem(new Pickaxe());
                            pack.DropItem(new Shovel());
                        }
                    }
                    if (info.IsSwitched(11)) // ------------------------------------------------ Camping
                    {
                        m.Skills[SkillName.Camping].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Bedroll());
                            pack.DropItem(new Kindling(20));
                        }
                    }
                    if (info.IsSwitched(13)) // ------------------------------------------------ Carpentry
                    {
                        m.Skills[SkillName.Carpentry].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Saw());
                            pack.DropItem(new Board(100));
                        }
                    }
                    if (info.IsSwitched(14)) // ------------------------------------------------ Cooking
                    {
                        m.Skills[SkillName.Cooking].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Kindling(10));
                            pack.DropItem(new RawLambLeg());
                            pack.DropItem(new RawChickenLeg());
                            pack.DropItem(new RawFishSteak());
                            pack.DropItem(new SackFlour());
                            pack.DropItem(new Pitcher(BeverageType.Water));
                        }
                    }
                    if (info.IsSwitched(15)) // ------------------------------------------------ Fishing
                    {
                        m.Skills[SkillName.Fishing].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new FishingPole());
                            pack.DropItem(new FishingPole());
                            pack.DropItem(new FishingPole());
                            pack.DropItem(new FloppyHat(Utility.RandomYellowHue()));
                        }
                    }
                    if (info.IsSwitched(17)) // ------------------------------------------------ Healing
                    {
                        m.Skills[SkillName.Healing].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Bandage(50));
                            pack.DropItem(new Scissors());
                        }
                    }
                    if (info.IsSwitched(18)) // ------------------------------------------------ Herding
                    {
                        m.Skills[SkillName.Herding].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new ShepherdsCrook());
                        }
                    }
                    if (info.IsSwitched(19)) // ------------------------------------------------ Lockpicking
                    {
                        m.Skills[SkillName.Lockpicking].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Lockpick(20));
                        }
                    }
                    if (info.IsSwitched(20)) // ------------------------------------------------ Lumberjacking
                    {
                        m.Skills[SkillName.Lumberjacking].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Hatchet());
                            pack.DropItem(new FullApron(Utility.RandomYellowHue()));
                        }
                    }
                    if (info.IsSwitched(21)) // ------------------------------------------------ Magery
                    {
                        m.Skills[SkillName.Magery].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Spellbook(UInt64.MaxValue));
                            pack.DropItem(new BagOfReagents(50));
                        }
                    }
                    if (info.IsSwitched(22))     // ------------------------------------------------ Meditation
                    {
                        m.Skills[SkillName.Meditation].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new DecoCrystalBall());
                        }
                    }
                    if (info.IsSwitched(23)) // ------------------------------------------------ Mining
                    {
                        m.Skills[SkillName.Mining].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Pickaxe());
                            pack.DropItem(new Pickaxe());
                            pack.DropItem(new Pickaxe());
                            pack.DropItem(new Shovel());
                            pack.DropItem(new Shovel());
                            pack.DropItem(new Shovel());
                        }
                    }
                    if (info.IsSwitched(24)) // ------------------------------------------------ Musicianship
                    {
                        m.Skills[SkillName.Musicianship].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Lute());
                            pack.DropItem(new LapHarp());
                            pack.DropItem(new TambourineTassel());
                            pack.DropItem(new Drums());
                        }
                    }
                    if (info.IsSwitched(27)) // ------------------------------------------------ RemoveTrap
                    {
                        m.Skills[SkillName.RemoveTrap].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new GreaterHealPotion(3));
                        }
                    }
                    if (info.IsSwitched(28)) // ------------------------------------------------ MagicResist
                    {
                        m.Skills[SkillName.MagicResist].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new FireballWand());
                            pack.DropItem(new LightningWand());
                            pack.DropItem(new MagicArrowWand());
                        }
                    }
                    if (info.IsSwitched(29)) // ------------------------------------------------ Snooping
                    {
                        m.Skills[SkillName.Snooping].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BankCheck(5000));
                        }
                    }
                    if (info.IsSwitched(31)) // ------------------------------------------------ Stealing
                    {
                        m.Skills[SkillName.Stealing].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BankCheck(5000));
                        }
                    }
                    if (info.IsSwitched(32)) // ------------------------------------------------ Stealth
                    {
                        m.Skills[SkillName.Stealth].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BurglarsBandana());
                        }
                    }
                    if (info.IsSwitched(33)) // ------------------------------------------------ Tailoring
                    {
                        m.Skills[SkillName.Tailoring].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BoltOfCloth( ));
                            pack.DropItem(new Cloth(100));
                            pack.DropItem(new SewingKit( ));
                            pack.DropItem(new SewingKit( ));
                            pack.DropItem(new SewingKit( ));
                        }
                    }
                    if (info.IsSwitched(34)) // ------------------------------------------------ Tinkering
                    {
                        m.Skills[SkillName.Tinkering].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new TinkerTools());
                            pack.DropItem(new IronIngot(20));
                        }
                    }
                    if (info.IsSwitched(35)) // ------------------------------------------------ Veterinary
                    {
                        m.Skills[SkillName.Veterinary].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Bandage(50));
                        }
                    }
                    if (info.IsSwitched(36)) // ------------------------------------------------ Fencing
                    {
                        m.Skills[SkillName.Fencing].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Kryss());
                        }
                    }
                    if (info.IsSwitched(37)) // ------------------------------------------------ Macing
                    {
                        m.Skills[SkillName.Macing].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Mace());
                        }
                    }
                    if (info.IsSwitched(38)) // ------------------------------------------------ Parry
                    {
                        m.Skills[SkillName.Parry].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new MetalKiteShield());
                        }
                    }
                    if (info.IsSwitched(39)) // ------------------------------------------------ Swords
                    {
                        m.Skills[SkillName.Swords].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Longsword());
                        }
                    }
                    if (info.IsSwitched(40)) // ------------------------------------------------ Tactics
                    {
                        m.Skills[SkillName.Tactics].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Gold(500));
                        }
                    }
                    if (info.IsSwitched(41)) // ------------------------------------------------ Wrestling
                    {
                        m.Skills[SkillName.Wrestling].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new LeatherGloves());
                        }
                    }
                    if (info.IsSwitched(42)) // ------------------------------------------------ Cartography
                    {
                        m.Skills[SkillName.Cartography].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BlankMap());
                            pack.DropItem(new BlankMap());
                            pack.DropItem(new BlankMap());
                            pack.DropItem(new BlankMap());
                            pack.DropItem(new Sextant());
                        }
                    }
                    if (info.IsSwitched(43)) // ------------------------------------------------ DetectHidden
                    {
                        m.Skills[SkillName.DetectHidden].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Cloak(0x455));
                        }
                    }
                    if (info.IsSwitched(44)) // ------------------------------------------------ Inscribe
                    {
                        m.Skills[SkillName.Inscribe].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BlankScroll(10));
                            pack.DropItem(new BlueBook( ));
                        }
                    }
                    if (info.IsSwitched(45)) // ------------------------------------------------ Peacemaking
                    {
                        m.Skills[SkillName.Peacemaking].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Tambourine());
                        }
                    }
                    if (info.IsSwitched(46)) // ------------------------------------------------ Poisoning
                    {
                        m.Skills[SkillName.Poisoning].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new LesserPoisonPotion());
                            pack.DropItem(new LesserPoisonPotion());
                            pack.DropItem(new LesserPoisonPotion());
                        }
                    }
                    if (info.IsSwitched(47)) // ------------------------------------------------ Provocation
                    {
                        m.Skills[SkillName.Provocation].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BambooFlute());
                        }
                    }
                    if (info.IsSwitched(48)) // ------------------------------------------------ SpiritSpeak
                    {
                        m.Skills[SkillName.SpiritSpeak].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BagOfNecroReagents(50));
                        }
                    }
                    if (info.IsSwitched(49)) // ------------------------------------------------ Tracking
                    {
                        m.Skills[SkillName.Tracking].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BearMask(0x1545));
                        }
                    }
                    if (info.IsSwitched(50)) // ------------------------------------------------ EvalInt
                    {
                        m.Skills[SkillName.EvalInt].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BagOfReagents(50));
                        }
                    }
                    if (info.IsSwitched(51)) // ------------------------------------------------ Forensics
                    {
                        m.Skills[SkillName.Forensics].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new SkinningKnife(0xEC4));
                        }
                    }
                    if (info.IsSwitched(52)) // ------------------------------------------------ ItemID
                    {
                        m.Skills[SkillName.ItemID].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new IDWand(25));
                        }
                    }
                    if (info.IsSwitched(53)) // ------------------------------------------------ TasteID
                    {
                        m.Skills[SkillName.TasteID].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new GreaterHealPotion(1));
                            pack.DropItem(new GreaterAgilityPotion(1));
                            pack.DropItem(new GreaterStrengthPotion(1));
                        }
                    }
                    if (info.IsSwitched(55)) // ------------------------------------------------ Hiding
                    //           {
                    //           m.Skills[SkillName.Hiding].Base = val;
                    //                       Container pack = m.Backpack;
                    //               if (pack != null)
                    //               {
                    //                   pack.DropItem( new BagOfSmokeBombs(20) );
                    //               }
                    //           }
                    {
                        if (info.IsSwitched(56)) // ------------------------------------------------ Fletching
                        {
                            m.Skills[SkillName.Fletching].Base = val;
                            Container pack = m.Backpack;
                            if (pack != null)
                            {
                                pack.DropItem(new FletcherTools(0x1022));
                                pack.DropItem(new Shaft(50));
                                pack.DropItem(new Feather(50));
                            }
                        }
                    }
                    if (info.IsSwitched(57)) // ------------------------------------------------ Focus
                    {
                        m.Skills[SkillName.Focus].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Chessboard(0xFA6));
                        }
                    }
                    if (info.IsSwitched(58)) // ------------------------------------------------ Throwing
                    {
                        m.Skills[SkillName.Throwing].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new ThrowingDagger());
                        }
                    }
                    if (info.IsSwitched(59))     // ------------------------------------------------ Bushido
                    {
                        m.Skills[SkillName.Bushido].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BookOfBushido());
                        }
                    }
                    if (info.IsSwitched(60))     // ------------------------------------------------ Chivalry
                    {
                        m.Skills[SkillName.Chivalry].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BookOfChivalry((UInt64)0x3FF));
                        }
                    }
                    if (info.IsSwitched(61)) // ------------------------------------------------ Imbuing
                    {
                        m.Skills[SkillName.Imbuing].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new RunicHammer(CraftResource.Valorite));
                        }
                    }
                    if (info.IsSwitched(62)) // ------------------------------------------------ Mysticism
                    {
                        m.Skills[SkillName.Mysticism].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Bone(50));
                            pack.DropItem(new DaemonBone(50));
                            pack.DropItem(new FertileDirt(50));
                        }
                    }
                    if (info.IsSwitched(63)) // ------------------------------------------------ Necromancy
                    {
                        m.Skills[SkillName.Necromancy].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new NecromancerSpellbook((UInt64)0xFFFF));
                            pack.DropItem(new BagOfNecroReagents(50));
                        }
                    }
                    if (info.IsSwitched(64))     // ------------------------------------------------ Ninjitsu
                    {
                        m.Skills[SkillName.Ninjitsu].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BookOfNinjitsu());
                        }
                    }

                    if (info.IsSwitched(65)) // ------------------------------------------------ Spellweaving
                    {
                        m.Skills[SkillName.Spellweaving].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            new SpellweavingBook((Int64)0xFFFF);
                        }
                    }
                    if (info.IsSwitched(66)) // ------------------------------------------------ Discordance
                    {
                        m.Skills[SkillName.Discordance].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Harp());
                        }
                    }

                    m_SkillBallPlus.Delete();
                }

                break;
            }
            }
        }
Esempio n. 37
0
 public override void OnDoubleClick(Mobile m)
 {
     m.CloseGump(typeof(SkillPickGump5x100));
     m.SendGump(new SkillPickGump5x100());
     this.Delete();
 }