示例#1
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            m_From = sender.Mobile;

            string page = "You open the homepage.";

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

            case 1:
            {
                m_From.PlaySound(579);
                m_From.LaunchBrowser(string.Format("http://in-uo.net/"));
                m_From.SendAsciiMessage(page);

                break;
            }

            case 2:
            {
                m_From.PlaySound(579);
                m_From.LaunchBrowser(string.Format("http://in-uo.net/forums/index.php"));
                m_From.SendAsciiMessage(page);

                break;
            }
            }
        }
示例#2
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (GuildGump.BadMember(m_Mobile, m_Guild))
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 0: return;                    // Close

            case 1: break;                     // Return to main menu

            case 2:
            {
                string website;

                if ((website = m_Guild.Website) == null || (website = website.Trim()).Length <= 0)
                {
                    website = DefaultWebsite;
                }

                m_Mobile.LaunchBrowser(website);
                break;
            }
            }

            GuildGump.EnsureClosed(m_Mobile);
            m_Mobile.SendGump(new GuildGump(m_Mobile, m_Guild));
        }
 public override void OnDoubleClick( Mobile from )
 {
     if ( !from.InRange( GetWorldLocation(), 2 ) )
         from.SendLocalizedMessage( 500446 ); // That is too far away.
     else
         from.LaunchBrowser( m_sUrl );
 }
示例#4
0
        public override void OnResponse(NetState state, int index)
        {
            if (GuildMenu.BadMember(m_Mobile, m_Guild))
            {
                return;
            }

            switch (index)
            {
            case 0:
            {
                string website;

                if ((website = m_Guild.Website) == null || (website = website.Trim()).Length <= 0)
                {
                    website = DefaultWebsite;
                }

                m_Mobile.LaunchBrowser(website);
                break;
            }

            case 1:
            {
                m_Mobile.SendMenu(new GuildMenu(m_Mobile, m_Guild));
                break;
            }
            }
        }
示例#5
0
        public static void OpenBrowser_Callback(Mobile from, bool okay, object state)
        {
            object[] states = (object[])state;
            Mobile   gm     = (Mobile)states[0];
            string   url    = (string)states[1];
            bool     echo   = (bool)states[2];

            if (okay)
            {
                if (echo)
                {
                    gm.SendMessage("{0} : has opened their web browser to : {1}", from.Name, url);
                }

                from.LaunchBrowser(url);
            }
            else
            {
                if (echo)
                {
                    gm.SendMessage("{0} : has chosen not to open their web browser to : {1}", from.Name, url);
                }

                from.SendMessage("You have chosen not to open your web browser.");
            }
        }
示例#6
0
		public virtual void OnVote(Mobile from, VoteStatus status)
		{
			if (status == VoteStatus.Success && VoteSite.Valid)
			{
				if (_Messages)
				    from.SendMessage("Thank you for voting on {0}!", VoteConfig.Instance.DefaultName);

                if (VoteConfig.Instance.DefaultGold > 0)
                {
                    from.AddToBackpack(new Gold(VoteConfig.Instance.DefaultGold));
                    from.SendAsciiMessage("{0} gold has been added to your backpack", VoteConfig.Instance.DefaultGold);
                    from.PlaySound(55);
                }

                //from.LaunchBrowser("http://www.gamesites200.com/ultimaonline/in.php?id=2224"); Not allowed to have this :(
			    from.LaunchBrowser(VoteConfig.Instance.DefaultURL);
				VoteHelper.SetLastVoteTime(from, VoteSite);

            }
			else if (status == VoteStatus.TooEarly)
			{
				if (_Messages)
				{
					TimeSpan timeLeft = VoteHelper.GetTimeLeft(from, VoteSite);
                    from.SendMessage(0x22, "Sorry, you can not vote on {0} for {1}.", VoteConfig.Instance.DefaultName, VoteHelper.GetFormattedTime(timeLeft));
				}
			}
			else if (status == VoteStatus.Invalid)
			{
				if (_Messages)
				{
					from.SendMessage(0x22, "Sorry, voting is currently unavailable.");
				}
			}
		}
示例#7
0
        public static void Mydefiance_OnCommand(CommandEventArgs e)
        {
            string url = "my.defianceuo.com";

            Mobile m = e.Mobile;

            m.LaunchBrowser(url);
        }
        public static void Radio_OnCommand(CommandEventArgs e)
        {
            string url = "http://defianceuo.com/radio";

            Mobile m = e.Mobile;

            m.LaunchBrowser(url);
        }
示例#9
0
        public static void Donate_OnCommand(CommandEventArgs e)
        {
            string url = "http://www.defianceuo.com/donate/";

            Mobile m = e.Mobile;

            m.LaunchBrowser(url);
        }
示例#10
0
            public override void OnClick()
            {
                if (!(m_Mobile is PlayerMobile))
                {
                    return;
                }

                m_Mobile.LaunchBrowser("http://www.google.com");
            }
示例#11
0
 private static void OpenBrowser_Callback(Mobile m, bool okay, object unused)
 {
     if (okay)
     {
         m.SendAsciiMessage(Ad_OkMsg);
         m.LaunchBrowser(Ad_Url);
     }
     else
     {
         m.SendAsciiMessage(Ad_CancelMsg);
     }
 }
 public override void OnDoubleClick(Mobile sender)
 {
     if (sender.InRange(this, 2))
     {
         sender.SendMessage("Opening a browser to the home page!");
         sender.LaunchBrowser("http://www.topshards.com/index.php?do=votes&id=180");
     }
     else
     {
         sender.SendMessage("You are too far away to use that!");
     }
 }
示例#13
0
 public override void OnDoubleClick(Mobile sender)
 {
     if (sender.InRange(this, 2))
     {
         sender.SendMessage("Opening a browser to the home page!");
         sender.LaunchBrowser("http://www.slither.co.uk/vasortflam/index.php");
     }
     else
     {
         sender.SendMessage("You are too far away to use that!");
     }
 }
示例#14
0
 public override void OnDoubleClick(Mobile from)
 {
     if (lastused + delay > DateTime.Now)
     {
         from.SendMessage("Your request is already being processed. Please wait 5 seconds between uses.");
         return;
     }
     else
     {
         lastused = DateTime.Now;
         from.LaunchBrowser(m_URL);
     }
 }
示例#15
0
        public static void Vote_OnCommand(CommandEventArgs e)
        {
            if (e.Mobile == null || e.Mobile.Deleted)
            {
                return;
            }

            string url = "http://www.defianceuo.com/vote.htm";

            Mobile m = e.Mobile;

            m.LaunchBrowser(url);
        }
示例#16
0
        public override void OnResponse(NetState state, int index)
        {
            Mobile from = state.Mobile;

            PageType type = (PageType)(-1);

            switch (index)
            {
            case 0:
                from.LaunchBrowser("http://www.uorebirth.com/");
                break;

            case 1:
            {
                if (from.Region is Server.Regions.Jail)
                {
                    from.SendLocalizedMessage(1041530, "", 0x35);                               // You'll need a better jailbreak plan then that!
                }
                else if (from.CanUseStuckMenu() && from.Region.CanUseStuckMenu(from) && !CheckCombat(from) && !from.Frozen && !from.Criminal)
                {
                    StuckMenu menu = new StuckMenu(from, from, true);
                    menu.BeginClose();
                    from.SendGump(menu);
                }
                else
                {
                    type = PageType.Stuck;
                }
                break;
            }

            case 2:
                type = PageType.Harassment;
                break;

            case 3:
                type = PageType.Bug;
                break;

            case 4:
                type = PageType.Other;
                break;
            }

            if (type != (PageType)(-1) && PageQueue.CheckAllowedToPage(from))
            {
                from.Prompt = new PagePrompt(type);
                from.SendAsciiMessage("Enter a description of your problem, or press (Esc) to cancel:");
            }
            //from.SendGump( new PagePromptGump( from, type ) );
        }
示例#17
0
        public static void OpenBrowser_Callback(Mobile from, bool okay, object state)
        {
            object[] states = (object[])state;
            string   url    = (string)states[0];

            if (okay)
            {
                from.LaunchBrowser(url);
            }
            else
            {
                from.SendMessage("You have chosen not to open your web browser.");
            }
        }
示例#18
0
        public virtual void OnVote(Mobile from, VoteStatus status)
        {
            if (from == null || from.Deleted)
            {
                return;
            }

            switch (status)
            {
            case VoteStatus.Success:
            {
                if (VoteSite.Valid)
                {
                    if (_Messages)
                    {
                        from.SendMessage("Thank you for voting on {0}!", VoteSite.Name);
                    }

                    from.LaunchBrowser(VoteSite.URL);
                    VoteHelper.SetLastVoteTime(from, VoteSite);
                }
                else
                {
                    if (_Messages)
                    {
                        from.SendMessage(0x22, "Sorry, voting is currently unavailable.");
                    }
                }
            } break;

            case VoteStatus.Invalid:
            {
                if (_Messages)
                {
                    from.SendMessage(0x22, "Sorry, voting is currently unavailable.");
                }
            } break;

            case VoteStatus.TooEarly:
            {
                if (_Messages)
                {
                    TimeSpan timeLeft = VoteHelper.GetTimeLeft(from, VoteSite);
                    from.SendMessage(0x22, "Sorry, you can not vote at {0} for {1}.", VoteSite.Name, VoteHelper.GetFormattedTime(timeLeft));
                }
            } break;

            case VoteStatus.Custom: { } break;
            }
        }
示例#19
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from   = sender.Mobile;
            int    button = info.ButtonID;

            switch (button)
            {
            default:
                Subject s = (Subject)(button - 10);
                from.SendGump(new HelpMenu(s, from));
                break;

            case 0:
                break;

            case 1:
                from.SendGump(new HelpMenu()); break;

            case 2:
                from.SendGump(this);
                if (!PageQueue.CheckAllowedToPage(from))
                {
                    break;
                }
                if (PageQueue.Contains(from))
                {
                    from.SendMenu(new ContainedMenu(from));
                }
                else
                {
                    from.SendLocalizedMessage(501234, "", 0x35);                               //Next available counselor will respond...
                    if (p_Subject != null)
                    {
                        PageQueue.Enqueue(new PageEntry(from, String.Format("This is an automated message: {0} needs assistance with Help Menu subject \"{1}\".", from.Name, Variables.SubjectTitle(p_Subject.Subject)), PageType.Other));
                    }
                    else
                    {
                        PageQueue.Enqueue(new PageEntry(from, String.Format("This is an automated message: {0} needs assistance.", from.Name), PageType.Other));
                    }
                }
                break;

            case 3:
                from.SendGump(this);
                from.SendMessage("Launching website, please wait...");
                from.LaunchBrowser(Variables.Website);
                break;
            }
        }
示例#20
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_From is PlayerMobile)
            {
                switch (info.ButtonID)
                {
                case 0: return;

                case 1:    //1vs1
                {
                    m_From.CloseGump(typeof(Show2vs2LadderLadder));
                    m_From.CloseGump(typeof(ShowTotalLadderLadder));
                    m_From.SendGump(new Show1vs1LadderLadder(m_From));
                    break;
                }

                case 2:    //2vs2
                {
                    m_From.CloseGump(typeof(Show1vs1LadderLadder));
                    m_From.CloseGump(typeof(ShowTotalLadderLadder));
                    m_From.SendGump(new Show2vs2LadderLadder(m_From));
                    break;
                }

                case 3:    //total
                {
                    m_From.CloseGump(typeof(Show1vs1LadderLadder));
                    m_From.CloseGump(typeof(Show2vs2LadderLadder));
                    m_From.SendGump(new ShowTotalLadderLadder(m_From));
                    break;
                }

                case 4:    //Web ladder
                {
                    m_From.LaunchBrowser(MySQLConnection.ladderUrl);
                    break;
                }

                case 5:
                case 6:
                case 7:
                case 8:
                case 9:
                case 10:
                default: m_From.SendAsciiMessage("Error in gump"); break;
                }
            }
        }
示例#21
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            if (info.ButtonID == (int)BUTTONS_ENUM.WEBSITE)
            {
                from.LaunchBrowser("http://daat99.home.dyndns.org/index.html");
            }
            else if (!b_ForStaff)
            {
                return;
            }
            else if (info.ButtonID >= OPTIONS_DIFF)             //switch settings
            {
                int optionId = info.ButtonID - OPTIONS_DIFF;
                if (Enum.IsDefined(typeof(OWLTROptionsManager.OPTIONS_ENUM), optionId))
                {
                    OWLTROptionsManager.SwitchOption((OWLTROptionsManager.OPTIONS_ENUM)optionId);
                }
                else
                {
                    from.SendMessage(1173, "Unable to interpret the option id: " + optionId);
                }
            }
            else if (info.ButtonID == (int)BUTTONS_ENUM.TOKENS_EXCHANGE_SET)
            {
                TextRelay tr_Text = info.GetTextEntry((int)BUTTONS_ENUM.TOKENS_EXCHANGE_AMOUNT);
                if (tr_Text != null)
                {
                    int iNewPrice = 0;
                    try { iNewPrice = Convert.ToInt32(tr_Text.Text, 10); }
                    catch { from.SendMessage("Please make sure you wrote only numbers."); }
                    if (iNewPrice > 60000)
                    {
                        from.SendMessage(32, "You can't set the price for more then 60k gold per token.");
                    }
                    else if (iNewPrice > 0)
                    {
                        LadyLuck.TokenCostInGold = iNewPrice;
                        from.SendMessage(88, "You set a new price for tokens, from now on each tokens will be exchanged for {0} gold", iNewPrice);
                    }
                }
            }
            if (info.ButtonID != (int)BUTTONS_ENUM.OK)
            {
                from.SendGump(new Daat99CustomOWLTRGump(p_From));
            }
        }
示例#22
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_Voteds.Contains(from))
            {
                from.SendMessage(63, "Uz jsi jednou hlasoval.");
                return;
            }

            if (from != null && from.Alive)
            {
                m_Voteds.Add(from);
                from.SendGump(new StoneGump(from, this));
                from.LaunchBrowser("http://www.gamesites200.com/ultimaonline/in.php?id=1427");
                from.SendMessage(1153, "Dekujeme za podporu. ");
            }
        }
示例#23
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_Voteds.Contains(from))
            {
                from.SendMessage(63, "You have already voted.");
                return;
            }

            if (from != null && from.Alive)
            {
                m_Voteds.Add(from);
                from.SendGump(new StoneGump(from, this));
                from.LaunchBrowser("http://www.gamesites200.com/ultimaonline/in.php?id=1618");
                from.SendMessage(1153, "Thank you for supporting us. ");
            }
        }
示例#24
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile       from = sender.Mobile;
            PlayerMobile pm   = from as PlayerMobile;

            if (pm != null)
            {
                pm.ShowNews = info.IsSwitched(0);
            }

            switch (info.ButtonID)
            {
            //deposit
            case 1:
            {
                if (from.Account != null)
                {
                    Account account = from.Account as Account;

                    if (account.WalletBalance > 0)
                    {
                        from.BankBox.DropItem(new Platinum(account.WalletBalance));
                        from.SendAsciiMessage(String.Format("You have deposited {0} platinum coins in to your bank box.", account.WalletBalance));
                        account.WalletBalance = 0;
                    }
                    else
                    {
                        from.SendAsciiMessage("You have no platinum coins to deposit.");
                    }

                    from.CloseGump(typeof(LoginGump));
                }
                break;
            }

            case 2:     //learn
            {
                from.LaunchBrowser("http://www.uoorigins.com/threads/platinum-and-veteran-rewards.1863/");
                break;
            }
            }
        }
示例#25
0
        private void UserAFK(Mobile m)
        {
            if (m == null)
            {
                return;
            }
            m.CloseGump(typeof(AFKCPassPhraseGump));
            m.Say("I'm AFK!");
            Account mAccount = m.Account as Account;

            if (mAccount != null)
            {
                CommandLogging.WriteLine(m, "{0} {1} {2} ", m.AccessLevel, CommandLogging.Format(m), "Failed AFK Check.");
                string text = String.Format("{0} AFK Check-{1}: **Failed** Retries={2}/{3} Seconds={4}/{5}", DateTime.Now, m.Name, m_RetryCount, m_MaxRetries, m_TotalSeconds, m_MaxSeconds);
                mAccount.Comments.Add(new AccountComment("AFK Checker", text));
                if (m_Jail)
                {
                    MoveToJail(m);
                }
                else if (m_MoveToMap != null && m_MoveTo != Point3D.Zero)
                {
                    m.MoveToWorld(m_MoveTo, m_MoveToMap);
                    Effects.SendBoltEffect(m, true, 0);
                    Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x307);
                }
                if (m_Website != null)
                {
                    try { m.LaunchBrowser(m_Website); }
                    catch { }
                }
                if (m_Kick)
                {
                    m_KickTimer = new KickTimer(m, TimeSpan.FromSeconds(5));
                    m_KickTimer.Start();
                }
                if (m_Staff != null && !m_Staff.Deleted && m_Staff.Map != Map.Internal)
                {
                    m_Staff.SendMessage(37, "*{0} FAILED AFK Check*", m.Name);
                    m_Staff.CloseGump(typeof(AFKCancelGump));
                }
            }
        }
示例#26
0
        public static void OpenBrowser_Callback(Mobile from, bool okay, Mobile gm, string url, bool echo)
        {
            if (okay)
            {
                if (echo)
                {
                    gm.SendMessage("{0} : has opened their web browser to : {1}", from.Name, url);
                }

                from.LaunchBrowser(url);
            }
            else
            {
                if (echo)
                {
                    gm.SendMessage("{0} : has chosen not to open their web browser to : {1}", from.Name, url);
                }

                from.SendMessage("You have chosen not to open your web browser.");
            }
        }
示例#27
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from  = state.Mobile;
            int    count = i_Page * 30;

            switch (info.ButtonID)
            {
            default: from.CloseGump(typeof(MissingRecipesGump)); break;

            case 1: { from.SendGump(new MissingRecipesGump(p_From, i_Page - 1)); break; }

            case 2: { from.SendGump(new MissingRecipesGump(p_From, i_Page + 1)); break; }

            case 999:
            {
                from.LaunchBrowser("http://www.angelfire.com/trek/daat99/index.html");
                from.SendGump(new MissingRecipesGump(p_From, i_Page));
                break;
            }
            }
        }
示例#28
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m.Alive)
            {
                m.PlaySound(0x214);
                m.FixedEffect(0x376A, 10, 16);

                int i = 0;

                while (i < 52)
                {
                    ///
                    i++;
                }
                m.LaunchBrowser("http://www.uogateway.com/shard.php?id=231&act=vote");
            }
            else
            {
                //m.SendLocalizedMessage(2, "Your dead and can't use this" ); 
            }

            return true;
        }
示例#29
0
		public override bool OnMoveOver( Mobile m )
		{
			if ( m.Alive )
			{
				m.PlaySound( 0x214 );
				m.FixedEffect( 0x376A, 10, 16 );

				int i = 0;
				
				while (i < 52)
				{
					///
				i++;
				}
                                  m.LaunchBrowser( "annox.no-ip.com" ); 
           }
			else
			{
				//m.SendLocalizedMessage(2, "Your dead and can't use this" ); 
			}

			return true;
		}
示例#30
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m.Alive)
            {
                m.PlaySound(0x214);
                m.FixedEffect(0x376A, 10, 16);

                int i = 0;

                while (i < 52)
                {
                    ///
                    i++;
                }
                m.LaunchBrowser("annox.no-ip.com");
            }
            else
            {
                //m.SendLocalizedMessage(2, "Your dead and can't use this" );
            }

            return(true);
        }
示例#31
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m.Alive)
            {
                m.PlaySound(0x214);
                m.FixedEffect(0x376A, 10, 16);

                int i = 0;

                while (i < 52)
                {
                    ///
                    i++;
                }
                m.LaunchBrowser("http://www.uogateway.com/shard.php?id=231&act=vote");
            }
            else
            {
                //m.SendLocalizedMessage(2, "Your dead and can't use this" );
            }

            return(true);
        }
示例#32
0
        public virtual void OnVote(Mobile from, VoteStatus status)
        {
            if (status == VoteStatus.Success && VoteSite.Valid)
            {
                if (_Messages)
                {
                    from.SendMessage("Thank you for voting on {0}!", VoteConfig.Instance.DefaultName);
                }

                if (VoteConfig.Instance.DefaultGold > 0)
                {
                    from.AddToBackpack(new Gold(VoteConfig.Instance.DefaultGold));
                    from.SendAsciiMessage("{0} gold has been added to your backpack", VoteConfig.Instance.DefaultGold);
                    from.PlaySound(55);
                }

                //from.LaunchBrowser("http://www.gamesites200.com/ultimaonline/in.php?id=2224"); Not allowed to have this :(
                from.LaunchBrowser(VoteConfig.Instance.DefaultURL);
                VoteHelper.SetLastVoteTime(from, VoteSite);
            }
            else if (status == VoteStatus.TooEarly)
            {
                if (_Messages)
                {
                    TimeSpan timeLeft = VoteHelper.GetTimeLeft(from, VoteSite);
                    from.SendMessage(0x22, "Sorry, you can not vote on {0} for {1}.", VoteConfig.Instance.DefaultName, VoteHelper.GetFormattedTime(timeLeft));
                }
            }
            else if (status == VoteStatus.Invalid)
            {
                if (_Messages)
                {
                    from.SendMessage(0x22, "Sorry, voting is currently unavailable.");
                }
            }
        }
示例#33
0
        public override void OnDoubleClick(Mobile from)
        {
            string url = "http://www.defianceuo.com/forums/viewtopic.php?t=446";

            from.LaunchBrowser(url);
        }
        public static void CreateItem(ItemInfo info, Mobile m)
        {
            if (m == null)
                return;

            Item item = null;
            BaseCreature bc = null;
            switch (info.IncrID)
            {
                case 0: item = new BlackPearl(999); break;
                case 1: item = new Bloodmoss(999); break;
                case 2: item = new MandrakeRoot(999); break;
                case 3: item = new Garlic(999); break;
                case 4: item = new Ginseng(999); break;
                case 5: item = new Nightshade(999); break;
                case 6: item = new SpidersSilk(999); break;
                case 7: item = new SulfurousAsh(999); break;
                case 8: item = new Bag();
                        ((Bag)item).DropItem( new BlackPearl(100) );
                        ((Bag)item).DropItem( new Bloodmoss(100) );
                        ((Bag)item).DropItem( new MandrakeRoot(100) );
                        ((Bag)item).DropItem( new Garlic(100) );
                        ((Bag)item).DropItem( new Ginseng(100) );
                        ((Bag)item).DropItem( new Nightshade(100) );
                        ((Bag)item).DropItem( new SpidersSilk(100) );
                        ((Bag)item).DropItem( new SulfurousAsh(100) );
                        break;
                case 9: item = new BatWing(999); break;
                case 10: item = new GraveDust(999); break;
                case 11: item = new DaemonBlood(999); break;
                case 12: item = new NoxCrystal(999); break;
                case 13: item = new PigIron(999); break;
                case 14: item = new Bag();
                        ((Bag)item).DropItem( new BatWing(100) );
                        ((Bag)item).DropItem( new GraveDust(100) );
                        ((Bag)item).DropItem( new DaemonBlood(100) );
                        ((Bag)item).DropItem( new NoxCrystal(100) );
                        ((Bag)item).DropItem( new PigIron(100) );
                        break;
                case 15: for (int i=0; i < 2; i++) //The last potion is dropped later
                        {
                            item = new RefreshPotion();
                            m.AddToBackpack(item);
                        }
                        item = new RefreshPotion();
                        break;
                case 16: for (int i=0; i < 2; i++) //The last potion is dropped later
                        {
                            item = new RefreshPotion();
                            m.AddToBackpack(item);
                        }
                        item = new LesserCurePotion();
                        break;
                case 17: for (int i=0; i < 2; i++) //The last potion is dropped later
                        {
                            item = new RefreshPotion();
                            m.AddToBackpack(item);
                        }
                        item = new LesserHealPotion();
                        break;
                case 18: for (int i=0; i < 2; i++) //The last potion is dropped later
                        {
                            item = new RefreshPotion();
                            m.AddToBackpack(item);
                        }
                        item = new NightSightPotion();
                        break;
                case 19: item = new Bandage(50); break;
                case 20: item = new Bandage(200); break;
                case 21: item = new Bandage(1000); break;
                case 22: item = new Arrow(100); break;
                case 23: item = new Arrow(1000); break;
                case 24: item = new Bolt(100); break;
                case 25: item = new Bolt(1000); break;
                case 26: bc = new Horse(); break;
                case 27: bc = new PackLlama(); break;
                case 28: item = new Club();
                        BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 29: item = new WarFork();
                        BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 30: item = new Katana();
                        BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 31: item = new Bow();
                        BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 32: item = new MetalKiteShield();
                        BaseRunicTool.ApplyAttributesTo((BaseShield)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 33: item = new WoodenShield();
                        BaseRunicTool.ApplyAttributesTo((BaseShield)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 34: item = new LeatherChest();
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 35: item = new LeatherGloves();
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 36: item = new LeatherGorget();
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 37: item = new LeatherLegs();
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 38: item = new LeatherCap();
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 39: item = new LeatherArms();
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 40: item = new Gold(300); break;
                case 41: item = new Gold(3000); break;
                case 42: item = new Server.Engines.BulkOrders.BulkOrderBook(); break;
                case 43: item = new Drums();
                        ((BaseInstrument)item).Quality = InstrumentQuality.Exceptional;
                        break;
                case 44: item = new TambourineTassel();
                        ((BaseInstrument)item).Quality = InstrumentQuality.Exceptional;
                        break;
                case 45: item = new Server.Multis.SmallDragonBoatDeed(); break;
                case 46: item = new Server.Multis.LargeDragonBoatDeed(); break;
            }

            if (item != null)
            {
                m.AddToBackpack(item);
                m.SendMessage("Here are the goods you requested.");
            }
            else if (bc != null)
            {
                bc.Controlled = true;
                bc.ControlMaster = m;
                bc.MoveToWorld( m.Location, m.Map );
                m.SendMessage("Here is the pet you requested.");
            }
            else
            {
                m.SendMessage("That item is not available. Please report the bug at the site that will open in your browser.");
                m.LaunchBrowser( "http://bug.casiopia.net/" );
                m.AddToBackpack( new VeriteGem(info.Price) );
            }
        }
            public override void OnResponse(NetState state, RelayInfo info)
            {
                if (info.ButtonID == 0) // Cancel
                {
                    return;
                }
                else if (m_Mobile.Deleted || m_Mobile.Map == null)
                {
                    return;
                }
                else if (info.ButtonID == 2) // Launch Browser
                {
                    m_Mobile.LaunchBrowser("http://uo.stratics.com/thb/info/maparchive/Archive1.shtml");
                }

                int[] switches = info.Switches;

                if (switches.Length == 0)
                {
                    return;
                }

                int switchID  = switches[0];
                int listIndex = switchID / 100;
                int listEntry = switchID % 100;

                if (listIndex < 0 || listIndex >= m_Lists.Length)
                {
                    return;
                }

                TMList list = m_Lists[listIndex];

                if (listEntry < 0 || listEntry >= list.Entries.Length)
                {
                    return;
                }

                TMEntry entry = list.Entries[listEntry];

                if (Server.Spells.SpellHelper.CheckCombat(m_Mobile))
                {
                    m_Mobile.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                }
                else if (m_Mobile.Spell != null)
                {
                    m_Mobile.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
                }
                else if (m_Mobile.Map == list.Map && m_Mobile.InRange(entry.Location, 1))
                {
                    m_Mobile.SendLocalizedMessage(1019003); // You are already there.
                }
                else
                {
                    BaseCreature.TeleportPets(m_Mobile, entry.Location, list.Map);

                    m_Mobile.Combatant = null;
                    m_Mobile.Warmode   = false;
                    m_Mobile.Map       = list.Map;
                    m_Mobile.Location  = entry.Location;
                }
            }
示例#36
0
        public static void OpenBrowser_Callback(Mobile from, bool okay, object state)
        {
            object[] states = (object[])state;
            Mobile gm = (Mobile)states[0];
            string url = (string)states[1];
            bool echo = (bool)states[2];

            if (okay)
            {
                if (echo)
                    gm.SendMessage("{0} : has opened their web browser to : {1}", from.Name, url);

                from.LaunchBrowser(url);
            }
            else
            {
                if (echo)
                    gm.SendMessage("{0} : has chosen not to open their web browser to : {1}", from.Name, url);

                from.SendMessage("You have chosen not to open your web browser.");
            }
        }
示例#37
0
        public static bool SpawnTypeKeyword(object invoker, XmlSpawner.SpawnObject TheSpawn, string typeName, string substitutedtypeName, bool requiresurface,
            List<XmlSpawner.SpawnPositionInfo> spawnpositioning, Mobile triggermob, Point3D location, Map map, XmlGumpCallback gumpcallback, out string status_str)
        {
            status_str = null;

            if (typeName == null || TheSpawn == null || substitutedtypeName == null)
                return false;

            XmlSpawner spawner = invoker as XmlSpawner;

            // check for any special keywords that might appear in the type such as SET, GIVE, or TAKE

            if (IsTypeKeyword(typeName))
            {
                typeKeyword kw = (typeKeyword)typeKeywordHash[typeName];

                switch (kw)
                {
                    case typeKeyword.SET:
                        {
                            // the syntax is SET/prop/value/prop2/value...
                            // check for the SET,itemname[,itemtype]/prop/value form is used
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            string[] keywordargs = ParseString(arglist[0], 3, ",");

                            if (keywordargs.Length > 1)
                            {
                                string typestr = null;
                                if (keywordargs.Length > 2)
                                {
                                    typestr = keywordargs[2];
                                }

                                // is the itemname a serialno?
                                object setitem = null;
                                if (keywordargs[1].StartsWith("0x"))
                                {
                                    int serial = -1;
                                    try
                                    {
                                        serial = Convert.ToInt32(keywordargs[1], 16);
                                    }
                                    catch
                                    {
                                    }
                                    if (serial >= 0)
                                        setitem = World.FindEntity(serial);
                                }
                                else
                                {
                                    // just look it up by name
                                    setitem = FindItemByName(spawner, keywordargs[1], typestr);
                                }

                                if (setitem == null)
                                {
                                    status_str = "cant find unique item :" + keywordargs[1];
                                    return false;
                                }
                                else
                                {
                                    ApplyObjectStringProperties(spawner, substitutedtypeName, setitem, triggermob, invoker, out status_str);
                                }
                            }
                            else if (spawner != null)
                            {
                                ApplyObjectStringProperties(spawner, substitutedtypeName, spawner.SetItem, triggermob, invoker, out status_str);
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.SETONMOB:
                        {
                            // the syntax is SETONMOB,mobname[,mobtype]/prop/value/prop2/value...
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            Mobile mob = null;
                            if (arglist.Length > 0)
                            {
                                string[] keywordargs = ParseString(arglist[0], 3, ",");
                                if (keywordargs.Length > 1)
                                {
                                    string typestr = null;
                                    if (keywordargs.Length > 2)
                                    {
                                        typestr = keywordargs[2];
                                    }

                                    mob = FindMobileByName(spawner, keywordargs[1], typestr);

                                    if (mob == null)
                                    {
                                        status_str = String.Format("named mob '{0}' not found", keywordargs[1]);
                                    }
                                }
                                else
                                {
                                    status_str = "missing mob name in SETONMOB";
                                }
                            }
                            if (mob != null)
                            {
                                ApplyObjectStringProperties(spawner, substitutedtypeName, mob, triggermob, invoker, out status_str);
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.SETONTHIS:
                        {
                            // the syntax is SETONTHIS/prop/value/prop2/value...
                            //string [] arglist = ParseString(substitutedtypeName,3,"/");
                            if (invoker != null)
                            {
                                ApplyObjectStringProperties(spawner, substitutedtypeName, invoker, triggermob, invoker, out status_str);
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.SETONTRIGMOB:
                        {
                            // the syntax is SETONTRIGMOB/prop/value/prop2/value...
                            ApplyObjectStringProperties(spawner, substitutedtypeName, triggermob, triggermob, invoker, out status_str);
                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.SETACCOUNTTAG:
                        {
                            // the syntax is SETACCOUNTTAG,tagname/value
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 2);

                            if (arglist.Length > 1)
                            {
                                string[] objstr = ParseString(arglist[0], 2, ",");

                                if (objstr.Length < 2)
                                {
                                    status_str = "missing tagname in SETACCOUNTTAG";
                                    return false;
                                }

                                string tagname = objstr[1];
                                string tagval = arglist[1];

                                // set the tag value
                                // get the value of the account tag from the triggering mob
                                if (triggermob != null && !triggermob.Deleted)
                                {
                                    Account acct = triggermob.Account as Account;
                                    if (acct != null)
                                    {
                                        acct.SetTag(tagname, tagval);
                                    }
                                }
                            }
                            else
                            {
                                status_str = "no value assigned to SETACCOUNTTAG";
                                return false;
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.SETVAR:
                        {
                            // the syntax is SETVAR,varname/value
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 2);

                            if (arglist.Length > 1)
                            {
                                string[] objstr = ParseString(arglist[0], 2, ",");

                                if (objstr.Length < 2)
                                {
                                    status_str = "missing varname in SETVAR";
                                    return false;
                                }

                                string varname = objstr[1];
                                string varval = arglist[1];

                                // find the xmllocalvariable attachment with that name
                                XmlLocalVariable a = (XmlLocalVariable)XmlAttach.FindAttachment(invoker, typeof(XmlLocalVariable), varname);

                                if (a == null)
                                {
                                    // doesnt already exist so add it
                                    XmlAttach.AttachTo(invoker, new XmlLocalVariable(varname, varval));
                                }
                                else
                                {
                                    a.Data = varval;
                                }
                            }
                            else
                            {
                                status_str = "no value assigned to SETVAR";
                                return false;
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.SETONNEARBY:
                        {
                            // the syntax is SETONNEARBY,range,name[,type][,searchcontainers][,proptest]/prop/value/prop/value...
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            string typestr = null;
                            string targetname = null;
                            string proptest = null;
                            int range = -1;
                            bool searchcontainers = false;

                            if (arglist.Length > 0)
                            {
                                string[] objstr = ParseString(arglist[0], 6, ",");
                                if (objstr.Length < 3)
                                {
                                    status_str = "missing range or name in SETONNEARBY";
                                    return false;
                                }

                                try
                                {
                                    range = int.Parse(objstr[1]);
                                }
                                catch
                                {
                                }

                                if (range < 0)
                                {
                                    status_str = "invalid range in SETONNEARBY";
                                    return false;
                                }

                                targetname = objstr[2];

                                if (objstr.Length > 3)
                                {
                                    typestr = objstr[3];
                                }

                                if (objstr.Length > 4)
                                {
                                    try
                                    {
                                        searchcontainers = bool.Parse(objstr[4]);
                                    }
                                    catch
                                    {
                                    }
                                }

                                if (objstr.Length > 5)
                                {
                                    proptest = objstr[5];
                                }
                            }
                            else
                            {
                                status_str = "missing args to SETONNEARBY";
                                return false;
                            }

                            Type targettype = null;
                            if (typestr != null)
                            {
                                targettype = SpawnerType.GetType(typestr);
                            }
                            ArrayList nearbylist = GetNearbyObjects(invoker, targetname, targettype, typestr, range, searchcontainers, proptest);

                            // apply the properties to everything on the list
                            foreach (object nearbyobj in nearbylist)
                            {
                                ApplyObjectStringProperties(spawner, substitutedtypeName, nearbyobj, triggermob, invoker, out status_str);
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.SETONPETS:
                        {
                            // the syntax is SETONPETS,range/prop/value/prop/value...
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            string typestr = "BaseCreature";
                            string targetname = null;
                            int range = -1;
                            bool searchcontainers = false;

                            if (arglist.Length > 0)
                            {
                                string[] objstr = ParseString(arglist[0], 2, ",");
                                if (objstr.Length < 2)
                                {
                                    status_str = "missing range or name in SETONPETS";
                                    return false;
                                }

                                try
                                {
                                    range = int.Parse(objstr[1]);
                                }
                                catch
                                {
                                }

                                if (range < 0)
                                {
                                    status_str = "invalid range in SETONPETS";
                                    return false;
                                }
                            }
                            else
                            {
                                status_str = "missing args to SETONPETS";
                                return false;
                            }

                            Type targettype = null;

                            if (typestr != null)
                            {
                                targettype = SpawnerType.GetType(typestr);
                            }

                            // get all of the nearby pets
                            ArrayList nearbylist = GetNearbyObjects(triggermob, targetname, targettype, typestr, range, searchcontainers, null);

                            // apply the properties to everything on the list
                            foreach (object nearbyobj in nearbylist)
                            {
                                // is this a pet of the triggering mob
                                BaseCreature pet = nearbyobj as BaseCreature;

                                if (pet != null && pet.Controlled && pet.ControlMaster == triggermob)
                                {
                                    ApplyObjectStringProperties(spawner, substitutedtypeName, nearbyobj, triggermob, invoker, out status_str);
                                }
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }

                    case typeKeyword.SETONCARRIED:
                        {
                            // the syntax is SETONCARRIED,itemname[,itemtype][,equippedonly]/prop/value/prop2/value...
                            // or SETONCARRIED,itemname[,itemtype]/prop/value
                            // first find the carried item
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            string typestr = null;
                            string itemname = null;
                            bool equippedonly = false;

                            if (arglist.Length > 0)
                            {
                                string[] objstr = ParseString(arglist[0], 4, ",");
                                if (objstr.Length < 2)
                                {
                                    status_str = "missing itemname in SETONCARRIED";
                                    return false;
                                }

                                itemname = objstr[1];

                                if (objstr.Length > 2)
                                {
                                    typestr = objstr[2];
                                }

                                if (objstr.Length > 3)
                                {
                                    if (objstr[3].ToLower() == "equippedonly")
                                    {
                                        equippedonly = true;
                                    }
                                    else
                                    {
                                        try
                                        {
                                            equippedonly = bool.Parse(objstr[3]);
                                        }
                                        catch
                                        {
                                        }
                                    }
                                }
                            }
                            else
                            {
                                status_str = "missing args to SETONCARRIED";
                                return false;
                            }

                            Item testitem = SearchMobileForItem(triggermob, ParseObjectType(itemname), typestr, false, equippedonly);

                            ApplyObjectStringProperties(spawner, substitutedtypeName, testitem, triggermob, invoker, out status_str);

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.SETONSPAWN:
                        {
                            // the syntax is SETONSPAWN[,spawnername],subgroup/prop/value/prop2/value...
                            // or SETONSPAWN[,spawnername],subgroup/prop/value
                            // first find the spawn
                            int subgroup = -1;
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            XmlSpawner targetspawner = spawner;
                            if (arglist.Length > 0)
                            {
                                string[] keywordargs = ParseString(arglist[0], 3, ",");
                                if (keywordargs.Length < 2)
                                {
                                    status_str = "missing subgroup in SETONSPAWN";
                                    return false;
                                }
                                else
                                {
                                    string subgroupstr = keywordargs[1];
                                    string spawnerstr = null;
                                    if (keywordargs.Length > 2)
                                    {
                                        spawnerstr = keywordargs[1];
                                        subgroupstr = keywordargs[2];
                                    }
                                    if (spawnerstr != null)
                                    {
                                        targetspawner = FindSpawnerByName(spawner, spawnerstr);
                                    }
                                    try
                                    {
                                        subgroup = int.Parse(subgroupstr);
                                    }
                                    catch
                                    {
                                    }
                                }
                            }
                            if (subgroup == -1)
                            {
                                status_str = "invalid subgroup in SETONSPAWN";
                                return false;
                            }

                            ArrayList spawnedlist = XmlSpawner.GetSpawnedList(targetspawner, subgroup);
                            if (spawnedlist == null)
                                return true;
                            foreach (object targetobj in spawnedlist)
                            {
                                if (targetobj == null)
                                    return true;

                                // dont apply it to keyword tags
                                if (targetobj is KeywordTag)
                                    continue;

                                // set the properties on the target object
                                ApplyObjectStringProperties(spawner, substitutedtypeName, targetobj, triggermob, spawner, out status_str);
                            }
                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.SETONSPAWNENTRY:
                        {
                            // the syntax is SETONSPAWNENTRY[,spawnername],entrystring/prop/value/prop2/value...
                            // find the spawn entry
                            string entrystring = null;
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            XmlSpawner targetspawner = spawner;

                            if (arglist.Length > 0)
                            {
                                string[] keywordargs = ParseString(arglist[0], 3, ",");
                                if (keywordargs.Length < 2)
                                {
                                    status_str = "missing entrystring in SETONSPAWNENTRY";
                                    return false;
                                }
                                else
                                {
                                    entrystring = keywordargs[1];
                                    string spawnerstr = null;
                                    if (keywordargs.Length > 2)
                                    {
                                        spawnerstr = keywordargs[1];
                                        entrystring = keywordargs[2];
                                    }
                                    if (spawnerstr != null)
                                    {
                                        targetspawner = FindSpawnerByName(spawner, spawnerstr);
                                    }
                                }
                            }
                            if (entrystring == null || entrystring.Length == 0)
                            {
                                status_str = "invalid entrystring in SETONSPAWNENTRY";
                                return false;
                            }

                            int entryindex = -1;
                            // is the entrystring a number?
                            if (entrystring[0] >= '0' && entrystring[0] <= '9')
                            {
                                try
                                {
                                    entryindex = int.Parse(entrystring);
                                }
                                catch
                                {
                                }
                            }

                            if (targetspawner == null || targetspawner.SpawnObjects == null)
                                return true;

                            for (int i = 0; i < targetspawner.SpawnObjects.Length; i++)
                            {
                                XmlSpawner.SpawnObject targetobj = targetspawner.SpawnObjects[i];

                                // is this references by entrystring or entryindex?
                                if ((entryindex == i) ||
                                    (entryindex == -1 && targetobj != null && targetobj.TypeName != null && targetobj.TypeName.IndexOf(entrystring) >= 0))
                                {
                                    // set the properties on the spawn entry object
                                    ApplyObjectStringProperties(spawner, substitutedtypeName, targetobj, triggermob, spawner, out status_str);
                                }
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.SETONPARENT:
                        {
                            // the syntax is SETONPARENT/prop/value/prop2/value...
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);

                            if (invoker != null && (invoker is Item))
                            {
                                ApplyObjectStringProperties(spawner, substitutedtypeName, ((Item)invoker).Parent, triggermob, invoker, out status_str);
                            }
                            else if (invoker != null && (invoker is XmlAttachment))
                            {
                                ApplyObjectStringProperties(spawner, substitutedtypeName, ((XmlAttachment)invoker).Attached, triggermob, invoker, out status_str);
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.GIVE:
                        {
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);

                            string remainder;
                            if (arglist.Length > 1)
                            {
                                // check for any special keywords such as the additem option or the subproperty specification
                                // note this will be an arg to some property
                                string[] keywordargs = ParseString(arglist[0], 2, ",");
                                AddItemToTarget(spawner, triggermob, keywordargs, arglist, triggermob, invoker, false, out remainder, out status_str);
                            }
                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.TAKE:
                        {
                            // syntax TAKE[,prob[,quantity[,true,[type]]]]/itemname
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            string targetName;
                            string typestr = null;
                            if (arglist.Length > 1)
                            {
                                targetName = arglist[1];
                            }
                            else
                            {
                                status_str = "invalid TAKE specification";
                                return false;
                            }
                            string[] keywordargs = ParseString(arglist[0], 5, ",");
                            double drop_probability = 1;
                            int quantity = 0;
                            bool banksearch = false;
                            Item savedItem = null;
                            if (keywordargs.Length > 1)
                            {
                                bool converterror = false;
                                try
                                {
                                    drop_probability = Convert.ToDouble(keywordargs[1], CultureInfo.InvariantCulture);
                                }
                                catch
                                {
                                    status_str = "Invalid TAKE probability : " + arglist[1];
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                            }
                            if (keywordargs.Length > 2)
                            {
                                bool converterror = false;
                                try
                                {
                                    quantity = int.Parse(keywordargs[2]);
                                }
                                catch
                                {
                                    status_str = "Invalid TAKE quantity : " + arglist[1];
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                            }
                            if (keywordargs.Length > 3)
                            {
                                bool converterror = false;
                                try
                                {
                                    banksearch = bool.Parse(keywordargs[3]);
                                }
                                catch
                                {
                                    status_str = "Invalid TAKE bankflag : " + arglist[1];
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                            }
                            if (keywordargs.Length > 4)
                            {
                                typestr = keywordargs[4];
                            }
                            if (drop_probability == 1 || Utility.RandomDouble() < drop_probability)
                            {
                                // search the trigger mob for the named item
                                Item itemTarget = SearchMobileForItem(triggermob, targetName, typestr, banksearch);

                                // found the item so get rid of it
                                if (itemTarget != null)
                                {
                                    // if a quantity was specified and the item is stackable, then try to take the quantity
                                    if (quantity > 0 && itemTarget.Stackable)
                                    {
                                        // create a copy of the stacked item to be saved
                                        //savedItem = itemTarget.Dupe(0);
                                        savedItem = Mobile.LiftItemDupe(itemTarget, itemTarget.Amount);
                                        if (savedItem != null)
                                        {
                                            savedItem.Internalize();
                                        }

                                        int totaltaken = 0;

                                        int remaining = itemTarget.Amount - quantity;
                                        if (remaining <= 0)
                                        {
                                            int taken = itemTarget.Amount;
                                            totaltaken += taken;

                                            itemTarget.Delete();
                                            while (remaining < 0)
                                            {
                                                quantity -= taken;
                                                // if didnt get the full amount then keep looking for other stacks
                                                itemTarget = SearchMobileForItem(triggermob, targetName, typestr, banksearch);
                                                if (itemTarget == null)
                                                    break;

                                                remaining = itemTarget.Amount - quantity;

                                                if (remaining <= 0)
                                                {
                                                    taken = itemTarget.Amount;
                                                    totaltaken += taken;

                                                    itemTarget.Delete();
                                                }
                                                else
                                                {
                                                    totaltaken += quantity;
                                                    itemTarget.Amount = remaining;
                                                }
                                            }
                                        }
                                        else
                                        {
                                            totaltaken = quantity;
                                            itemTarget.Amount = remaining;
                                        }

                                        if (savedItem != null)
                                        {
                                            savedItem.Amount = totaltaken;
                                        }
                                    }
                                    else
                                    {
                                        // dont save quest holders
                                        if (itemTarget is XmlQuestBook || itemTarget is IXmlQuest)
                                        {
                                            itemTarget.Delete();
                                        }
                                        else
                                            savedItem = itemTarget;
                                    }

                                    // if the saved item was being held then release it otherwise the player can take it back
                                    if (triggermob != null && triggermob.Holding == savedItem)
                                    {
                                        triggermob.Holding = null;
                                    }

                                    XmlSaveItem si = (XmlSaveItem)XmlAttach.FindAttachment(invoker, typeof(XmlSaveItem), "Taken");

                                    if (si == null)
                                    {
                                        XmlAttach.AttachTo(invoker, new XmlSaveItem("Taken", savedItem, triggermob));
                                    }
                                    else
                                    {
                                        si.SavedItem = savedItem;
                                        si.WasOwnedBy = triggermob;
                                    }
                                }
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.TAKEBYTYPE:
                        {
                            // syntax TAKEBYTYPE[,prob[,quantity[,true]]]/itemtype
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            string targetName;
                            if (arglist.Length > 1)
                            {
                                targetName = arglist[1];
                            }
                            else
                            {
                                status_str = "invalid TAKEBYTYPE specification";
                                return false;
                            }
                            string[] keywordargs = ParseString(arglist[0], 4, ",");
                            double drop_probability = 1;
                            int quantity = 0;
                            bool banksearch = false;
                            Item savedItem = null;

                            if (keywordargs.Length > 1)
                            {
                                bool converterror = false;
                                try
                                {
                                    drop_probability = Convert.ToDouble(keywordargs[1], CultureInfo.InvariantCulture);
                                }
                                catch
                                {
                                    status_str = "Invalid TAKEBYTYPE probability : " + arglist[1];
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                            }
                            if (keywordargs.Length > 2)
                            {
                                bool converterror = false;
                                try
                                {
                                    quantity = int.Parse(keywordargs[2]);
                                }
                                catch
                                {
                                    status_str = "Invalid TAKEBYTYPE quantity : " + arglist[1];
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                            }
                            if (keywordargs.Length > 3)
                            {
                                bool converterror = false;
                                try
                                {
                                    banksearch = bool.Parse(keywordargs[3]);
                                }
                                catch
                                {
                                    status_str = "Invalid TAKEBYTYPE bankflag : " + arglist[1];
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                            }
                            if (drop_probability == 1 || Utility.RandomDouble() < drop_probability)
                            {
                                // search the trigger mob for the named item
                                Item itemTarget = SearchMobileForItemType(triggermob, targetName, banksearch);

                                // found the item so get rid of it
                                if (itemTarget != null)
                                {
                                    // if a quantity was specified and the item is stackable, then try to take the quantity
                                    if (quantity > 0 && itemTarget.Stackable)
                                    {
                                        // create a copy of the stacked item to be saved
                                        //savedItem = itemTarget.Dupe(0);
                                        savedItem = Mobile.LiftItemDupe(itemTarget, itemTarget.Amount);
                                        if (savedItem != null)
                                        {
                                            savedItem.Internalize();
                                        }

                                        int totaltaken = 0;

                                        int remaining = itemTarget.Amount - quantity;
                                        if (remaining <= 0)
                                        {
                                            int taken = itemTarget.Amount;
                                            totaltaken += taken;

                                            itemTarget.Delete();

                                            while (remaining < 0)
                                            {
                                                quantity -= taken;
                                                // if didnt get the full amount then keep looking for other stacks
                                                itemTarget = SearchMobileForItemType(triggermob, targetName, banksearch);

                                                if (itemTarget == null)
                                                    break;

                                                remaining = itemTarget.Amount - quantity;
                                                if (remaining <= 0)
                                                {
                                                    taken = itemTarget.Amount;
                                                    totaltaken += taken;

                                                    itemTarget.Delete();
                                                }
                                                else
                                                {
                                                    totaltaken += quantity;
                                                    itemTarget.Amount = remaining;
                                                }
                                            }
                                        }
                                        else
                                        {
                                            totaltaken = quantity;
                                            itemTarget.Amount = remaining;
                                        }

                                        if (savedItem != null)
                                        {
                                            savedItem.Amount = totaltaken;
                                        }
                                    }
                                    else
                                    {
                                        // dont save quest holders
                                        if (itemTarget is XmlQuestBook || itemTarget is XmlQuestHolder || itemTarget is XmlQuestToken)
                                        {
                                            itemTarget.Delete();
                                        }
                                        else
                                            savedItem = itemTarget;
                                    }
                                }

                                // is there an existing xmlsaveitem attachment

                                XmlSaveItem si = (XmlSaveItem)XmlAttach.FindAttachment(invoker, typeof(XmlSaveItem), "Taken");

                                if (si == null)
                                {
                                    XmlAttach.AttachTo(invoker, new XmlSaveItem("Taken", savedItem, triggermob));
                                }
                                else
                                {
                                    si.SavedItem = savedItem;
                                    si.WasOwnedBy = triggermob;
                                }
                            }
                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.GUMP:
                        {
                            // the syntax is GUMP,title,type/string
                            // can alternatively accept a gump constructor name
                            // GUMP,title,type,constructorname/string
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            string gumpText;
                            if (arglist.Length > 1)
                            {
                                gumpText = arglist[1];
                            }
                            else
                            {
                                status_str = "invalid GUMP specification";
                                return false;
                            }

                            string[] gumpkeywordargs = ParseString(arglist[0], 4, ",");
                            string gumpTitle = "";
                            int gumpNumber = 0; // 0=simple text gump, 1=yes/no gump, 2=reply gump, 3=quest gump

                            if (gumpkeywordargs.Length > 2)
                            {
                                gumpTitle = gumpkeywordargs[1];
                                bool converterror = false;
                                try
                                {
                                    gumpNumber = int.Parse(gumpkeywordargs[2]);
                                }
                                catch
                                {
                                    status_str = "Invalid GUMP args";
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                            }
                            else
                            {
                                status_str = "invalid GUMP specification";
                                return false;
                            }
                            string gumptypestr = "XmlSimpleGump"; // default gump constructor

                            if (gumpkeywordargs.Length > 3)
                            {
                                // get the gump constructor type
                                gumptypestr = gumpkeywordargs[3].Trim();
                            }
                            Type type = null;
                            if (gumptypestr != null)
                            {
                                try
                                {
                                    type = SpawnerType.GetType(gumptypestr);
                                }
                                catch
                                {
                                }
                            }
                            if (type == null)
                            {
                                status_str = "invalid GUMP constructor : " + gumptypestr;
                                return false;
                            }

                            // prepare the keyword tag for the gump
                            KeywordTag newtag = new KeywordTag(substitutedtypeName, spawner, 1);
                            if (triggermob != null && !triggermob.Deleted && (triggermob is PlayerMobile))
                            {
                                object newgump = null;
                                object[] gumpargs = new object[7];
                                gumpargs[0] = invoker;
                                gumpargs[1] = gumpText;
                                gumpargs[2] = gumpTitle;
                                gumpargs[3] = gumpNumber;
                                gumpargs[4] = newtag;
                                gumpargs[5] = triggermob;
                                gumpargs[6] = gumpcallback;

                                //spawner.TriggerMob.SendGump( new XmlSimpleGump(this, gumpText,gumpTitle, gumpType ));
                                try
                                {
                                    newgump = Activator.CreateInstance(type, gumpargs);
                                }
                                catch
                                {
                                    status_str = "Error in creating gump type : " + gumptypestr;
                                    newtag.Delete();
                                    return false;
                                }
                                if (newgump != null)
                                {
                                    if (newgump is Gump)
                                    {
                                        triggermob.SendGump((Gump)newgump);
                                    }
                                    else if (newgump is Item)
                                    {
                                        ((Item)newgump).Delete();
                                        status_str = gumptypestr + " is not a Gump type";
                                        newtag.Delete();
                                        return false;
                                    }
                                    else if (newgump is Mobile)
                                    {
                                        ((Mobile)newgump).Delete();
                                        status_str = gumptypestr + " is not a Gump type";
                                        newtag.Delete();
                                        return false;
                                    }
                                    else
                                    {
                                        status_str = gumptypestr + " is not a Gump type";
                                        newtag.Delete();
                                        return false;
                                    }
                                }
                            }
                            TheSpawn.SpawnedObjects.Add(newtag);

                            break;
                        }
                    case typeKeyword.BROWSER:
                        {
                            // the syntax is BROWSER/url
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 2);
                            string url;

                            if (arglist.Length > 1)
                            {
                                if (arglist[1] != null && arglist[1].Length > 0 && arglist[1][0] == '@')
                                {
                                    url = arglist[1].Substring(1);
                                }
                                else
                                    url = arglist[1];
                            }
                            else
                            {
                                status_str = "invalid BROWSER specification";
                                return false;
                            }

                            if (triggermob != null && !triggermob.Deleted && (triggermob is PlayerMobile))
                            {
                                triggermob.LaunchBrowser(url);
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.SENDMSG:
                        {
                            // the syntax is SENDMSG[,hue]/string
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            // check for literal
                            string msgText;
                            int hue = 0x3B2;
                            int font = 3;

                            if (arglist.Length > 0)
                            {
                                string[] keywordargs = ParseString(arglist[0], 2, ",");
                                if (keywordargs.Length > 1)
                                {
                                    try
                                    {
                                        hue = int.Parse(keywordargs[1]);
                                    }
                                    catch
                                    {
                                        status_str = "invalid hue arg to SENDMSG";
                                    }
                                }
                            }
                            if (arglist.Length > 1)
                            {
                                if (arglist[1] != null && arglist[1].Length > 0 && arglist[1][0] == '@')
                                {
                                    arglist = ParseSlashArgs(substitutedtypeName, 2);
                                    msgText = arglist[1].Substring(1);
                                }
                                else
                                    msgText = arglist[1];
                            }
                            else
                            {
                                status_str = "invalid SENDMSG specification";
                                return false;
                            }
                            if (triggermob != null && !triggermob.Deleted && (triggermob is PlayerMobile))
                            {
                                //triggermob.SendMessage(msgText);
                                triggermob.Send(new UnicodeMessage(Serial.MinusOne, -1, MessageType.Regular, hue, font, "ENU", "System", msgText));
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.SENDASCIIMSG:
                        {
                            // the syntax is SENDASCIIMSG[,hue][,font#]/string
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            // check for literal
                            string msgText;
                            int hue = 0x3B2;
                            int font = 3;

                            if (arglist.Length > 0)
                            {
                                string[] keywordargs = ParseString(arglist[0], 3, ",");
                                if (keywordargs.Length > 1)
                                {
                                    try
                                    {
                                        hue = int.Parse(keywordargs[1]);
                                    }
                                    catch
                                    {
                                        status_str = "invalid hue arg to SENDASCIIMSG";
                                    }
                                }
                                if (keywordargs.Length > 2)
                                {
                                    try
                                    {
                                        font = int.Parse(keywordargs[2]);
                                    }
                                    catch
                                    {
                                        status_str = "invalid font arg to SENDASCIIMSG";
                                    }
                                }
                            }
                            if (arglist.Length > 1)
                            {
                                if (arglist[1] != null && arglist[1].Length > 0 && arglist[1][0] == '@')
                                {
                                    arglist = ParseSlashArgs(substitutedtypeName, 2);
                                    msgText = arglist[1].Substring(1);
                                }
                                else
                                    msgText = arglist[1];
                            }
                            else
                            {
                                status_str = "invalid SENDASCIIMSG specification";
                                return false;
                            }
                            if (triggermob != null && !triggermob.Deleted && (triggermob is PlayerMobile))
                            {
                                triggermob.Send(new AsciiMessage(Serial.MinusOne, -1, MessageType.Regular, hue, font, "System", msgText));
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.WAITUNTIL:
                        {
                            // the syntax is WAITUNTIL[,delay][,timeout][/condition][/thendogroup]
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 4);
                            double delay = 0;
                            double timeout = 0;
                            string condition = null;
                            int gotogroup = -1;
                            if (arglist.Length > 0)
                            {
                                string[] keywordargs = ParseString(arglist[0], 3, ",");
                                if (keywordargs.Length > 1)
                                {
                                    try
                                    {
                                        delay = double.Parse(keywordargs[1]);
                                    }
                                    catch
                                    {
                                        status_str = "invalid delay arg to WAITUNTIL";
                                    }
                                }
                                if (keywordargs.Length > 2)
                                {
                                    try
                                    {
                                        timeout = double.Parse(keywordargs[2]);
                                    }
                                    catch
                                    {
                                        status_str = "invalid timeout arg to WAITUNTIL";
                                    }
                                }
                            }
                            if (arglist.Length > 1)
                            {
                                condition = arglist[1];
                            }
                            if (arglist.Length > 2)
                            {
                                try
                                {
                                    gotogroup = int.Parse(arglist[2]);
                                }
                                catch
                                {
                                    status_str = "invalid goto arg to WAITUNTIL";
                                }
                            }
                            if (status_str != null)
                            {
                                return false;
                            }
                            // suppress sequential advancement
                            //spawner.HoldSequence = true;

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner, TimeSpan.FromMinutes(delay), TimeSpan.FromMinutes(timeout), condition, gotogroup));

                            break;
                        }
                    case typeKeyword.WHILE:
                        {
                            // the syntax is WHILE/condition/dogroup
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 4);
                            string condition = null;
                            int gotogroup = -1;
                            if (arglist.Length < 3)
                            {
                                status_str = "insufficient args to WHILE";
                            }
                            else
                            {
                                condition = arglist[1];
                                try
                                {
                                    gotogroup = int.Parse(arglist[2]);
                                }
                                catch
                                {
                                    status_str = "invalid dogroup arg to WHILE";
                                }
                            }
                            if (status_str != null)
                            {
                                return false;
                            }
                            // test the condition
                            if (TestItemProperty(spawner, spawner, condition, triggermob, out status_str))
                            {
                                // try to spawn the dogroup
                                if (spawner != null && !spawner.Deleted)
                                {
                                    if (gotogroup >= 0)
                                    {
                                        // spawn the subgroup
                                        spawner.SpawnSubGroup(gotogroup);
                                        // advance the sequence to that group
                                        //spawner.SequentialSpawn = gotogroup;
                                    }
                                    // and suppress sequential advancement
                                    spawner.HoldSequence = true;
                                }
                            }
                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.IF:
                        {
                            // the syntax is IF/condition/thengroup [/elsegroup]
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 5);
                            string condition = null;
                            int thengroup = -1;
                            int elsegroup = -1;
                            if (arglist.Length < 3)
                            {
                                status_str = "insufficient args to IF";
                            }
                            else
                            {
                                condition = arglist[1];
                                try
                                {
                                    thengroup = int.Parse(arglist[2]);
                                }
                                catch
                                {
                                    status_str = "invalid thengroup arg to IF";
                                }
                            }
                            if (arglist.Length > 3)
                            {
                                try
                                {
                                    elsegroup = int.Parse(arglist[3]);
                                }
                                catch
                                {
                                    status_str = "invalid elsegroup arg to IF";
                                }
                            }

                            if (status_str != null)
                            {
                                return false;
                            }

                            // test the condition
                            if (TestItemProperty(spawner, spawner, condition, triggermob, out status_str))
                            {
                                // try to spawn the thengroup
                                if (thengroup >= 0 && spawner != null && !spawner.Deleted)
                                {
                                    // spawn the subgroup
                                    spawner.SpawnSubGroup(thengroup);
                                    // advance the sequence to that group
                                    //spawner.SequentialSpawn = thengroup;
                                }
                                // and suppress sequential advancement
                                //spawner.HoldSequence = true;
                            }
                            else
                            {
                                // try to spawn the elsegroup
                                if (elsegroup >= 0 && spawner != null && !spawner.Deleted)
                                {
                                    // spawn the subgroup
                                    spawner.SpawnSubGroup(elsegroup);
                                    // advance the sequence to that group
                                    //spawner.SequentialSpawn = elsegroup;
                                }
                                // and suppress sequential advancement
                                //spawner.HoldSequence = true;
                            }
                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.DESPAWN:
                        {
                            // the syntax is DESPAWN[,spawnername],subgroup
                            // first find the spawner and group
                            int subgroup = -1;
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            XmlSpawner targetspawner = spawner;
                            if (arglist.Length > 0)
                            {
                                string[] keywordargs = ParseString(arglist[0], 3, ",");
                                if (keywordargs.Length < 2)
                                {
                                    status_str = "missing subgroup in DESPAWN";
                                    return false;
                                }
                                else
                                {
                                    string subgroupstr = keywordargs[1];
                                    string spawnerstr = null;
                                    if (keywordargs.Length > 2)
                                    {
                                        spawnerstr = keywordargs[1];
                                        subgroupstr = keywordargs[2];
                                    }
                                    if (spawnerstr != null)
                                    {
                                        targetspawner = FindSpawnerByName(spawner, spawnerstr);
                                    }
                                    try
                                    {
                                        subgroup = int.Parse(subgroupstr);
                                    }
                                    catch
                                    {
                                    }
                                }
                            }
                            if (subgroup == -1)
                            {
                                status_str = "invalid subgroup in DESPAWN";
                                return false;
                            }

                            if (targetspawner != null)
                            {
                                targetspawner.ClearSubgroup(subgroup);
                            }
                            else
                            {
                                status_str = "invalid spawner in DESPAWN";
                                return false;
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.SPAWN:
                        {
                            // the syntax is SPAWN[,spawnername],subgroup
                            // first find the spawner and group
                            int subgroup = -1;
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            XmlSpawner targetspawner = spawner;
                            if (arglist.Length > 0)
                            {
                                string[] keywordargs = ParseString(arglist[0], 3, ",");
                                if (keywordargs.Length < 2)
                                {
                                    status_str = "missing subgroup in SPAWN";
                                    return false;
                                }
                                else
                                {
                                    string subgroupstr = keywordargs[1];
                                    string spawnerstr = null;
                                    if (keywordargs.Length > 2)
                                    {
                                        spawnerstr = keywordargs[1];
                                        subgroupstr = keywordargs[2];
                                    }
                                    if (spawnerstr != null)
                                    {
                                        targetspawner = FindSpawnerByName(spawner, spawnerstr);
                                    }
                                    try
                                    {
                                        subgroup = int.Parse(subgroupstr);
                                    }
                                    catch
                                    {
                                    }
                                }
                            }
                            if (subgroup == -1)
                            {
                                status_str = "invalid subgroup in SPAWN";
                                return false;
                            }

                            if (targetspawner != null)
                            {
                                if (spawner != targetspawner)
                                {
                                    // allow spawning of other spawners to be forced and ignore the normal loop protection
                                    targetspawner.SpawnSubGroup(subgroup, false, true);
                                }
                                else
                                {
                                    targetspawner.SpawnSubGroup(subgroup);
                                }
                            }
                            else
                            {
                                status_str = "invalid spawner in SPAWN";
                                return false;
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.GOTO:
                        {
                            // the syntax is GOTO/subgroup
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            int group = -1;
                            if (arglist.Length < 2)
                            {
                                status_str = "insufficient args to GOTO";
                            }
                            else
                            {
                                try
                                {
                                    group = int.Parse(arglist[1]);
                                }
                                catch
                                {
                                    status_str = "invalid subgroup arg to GOTO";
                                }
                            }
                            if (status_str != null)
                            {
                                return false;
                            }

                            // move the sequence to the specified subgroup
                            if (group >= 0 && spawner != null && !spawner.Deleted)
                            {
                                // note, this will activate sequential spawning if it wasnt already set
                                spawner.SequentialSpawn = group;

                                // and suppress sequential advancement so that the specified group is the next to spawn
                                spawner.HoldSequence = true;
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner, 2));

                            break;
                        }
                    case typeKeyword.COMMAND:
                        {
                            // the syntax is COMMAND/commandstring
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            if (arglist.Length > 0)
                            {
                                // mod to use a dummy char to issue commands
                                if (CommandMobileName != null)
                                {
                                    Mobile dummy = FindMobileByName(spawner, CommandMobileName, "Mobile");
                                    if (dummy != null)
                                    {
                                        CommandSystem.Handle(dummy, String.Format("{0}{1}", CommandSystem.Prefix, arglist[1]));
                                    }
                                }
                                else if (triggermob != null && !triggermob.Deleted)
                                {
                                    CommandSystem.Handle(triggermob, String.Format("{0}{1}", CommandSystem.Prefix, arglist[1]));
                                }
                            }
                            else
                            {
                                status_str = "insufficient args to COMMAND";
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.MUSIC:
                        {
                            // the syntax is MUSIC,name,range
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            if (arglist.Length > 0)
                            {
                                SendMusicToPlayers(arglist[0], triggermob, invoker, out status_str);
                                if (status_str != null)
                                {
                                    return false;
                                }
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.SOUND:
                        {
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);

                            if (arglist.Length > 0)
                            {
                                // Syntax is SOUND,soundnumber
                                string[] keywordargs = ParseString(arglist[0], 3, ",");
                                int sound = -1;
                                // try to get the soundnumber argument
                                if (keywordargs.Length < 2)
                                {
                                    status_str = "Missing sound number";
                                }
                                else
                                {
                                    try
                                    {
                                        sound = int.Parse(keywordargs[1]);
                                    }
                                    catch
                                    {
                                        status_str = "Improper sound number format";
                                    }
                                }
                                if (sound >= 0 && invoker is IEntity)
                                {
                                    Effects.PlaySound(((IEntity)invoker).Location, ((IEntity)invoker).Map, sound);
                                }
                                if (status_str != null)
                                {
                                    return false;
                                }
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                        //
                        //  MEFFECT keyword
                        //
                    case typeKeyword.MEFFECT:
                        {
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            if (arglist.Length > 0)
                            {
                                string[] keywordargs = ParseString(arglist[0], 9, ",");

                                if (keywordargs.Length < 9)
                                {
                                    status_str = "Missing args";
                                }
                                else
                                {
                                    int effect = -1;
                                    int duration = 0;
                                    int speed = 1;
                                    Point3D eloc1 = new Point3D(0, 0, 0);
                                    Point3D eloc2 = new Point3D(0, 0, 0);
                                    Map emap = Map.Internal;

                                    // syntax is MEFFECT,itemid,speed,x,y,z,x2,y2,z2

                                    // try to get the effect argument

                                    try
                                    {
                                        effect = int.Parse(keywordargs[1]);
                                    }
                                    catch
                                    {
                                        status_str = "Improper effect number format";
                                    }

                                    try
                                    {
                                        speed = int.Parse(keywordargs[2]);
                                    }
                                    catch
                                    {
                                        status_str = "Improper effect speed format";
                                    }

                                    int x = 0;
                                    int y = 0;
                                    int z = 0;
                                    try
                                    {
                                        x = int.Parse(keywordargs[3]);
                                        y = int.Parse(keywordargs[4]);
                                        z = int.Parse(keywordargs[5]);
                                    }
                                    catch
                                    {
                                        status_str = "Improper effect location format";
                                    }
                                    eloc1 = new Point3D(x, y, z);

                                    try
                                    {
                                        x = int.Parse(keywordargs[6]);
                                        y = int.Parse(keywordargs[7]);
                                        z = int.Parse(keywordargs[8]);
                                    }
                                    catch
                                    {
                                        status_str = "Improper effect location format";
                                    }
                                    eloc2 = new Point3D(x, y, z);

                                    if (effect >= 0 && emap != Map.Internal)
                                    {
                                        Effects.SendPacket(eloc1, emap, new HuedEffect(EffectType.Moving, -1, -1, effect, eloc1, eloc2, speed, duration, false, false, 0, 0));
                                    }
                                }
                                if (status_str != null)
                                {
                                    return false;
                                }
                            }
                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));
                            break;
                        }
                    case typeKeyword.EFFECT:
                        {
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            if (spawner == null || spawner.Deleted)
                                return false;
                            if (arglist.Length > 0)
                            {
                                string[] keywordargs = ParseString(arglist[0], 6, ",");
                                int effect = -1;
                                int duration = 1;
                                // syntax is EFFECT,itemid,duration[,x,y,z] or EFFECT,itemid,duration[,trigmob]
                                // try to get the effect argument
                                // some interesting effects are explosion(14013,15), sparkle(14155,15), explosion2(14000,13)
                                if (keywordargs.Length < 3)
                                {
                                    status_str = "Missing effect number and duration";
                                }
                                else
                                {
                                    try
                                    {
                                        effect = int.Parse(keywordargs[1]);
                                    }
                                    catch
                                    {
                                        status_str = "Improper effect number format";
                                    }
                                    try
                                    {
                                        duration = int.Parse(keywordargs[2]);
                                    }
                                    catch
                                    {
                                        status_str = "Improper effect duration format";
                                    }
                                }
                                // by default just use the spawner location
                                Point3D eloc = spawner.Location;
                                Map emap = spawner.Map;
                                if (keywordargs.Length > 3)
                                {
                                    // is this applied to the trig mob or to a location?
                                    if (keywordargs.Length > 5)
                                    {
                                        int x = spawner.Location.X;
                                        int y = spawner.Location.Y;
                                        int z = spawner.Location.Z;
                                        try
                                        {
                                            x = int.Parse(keywordargs[3]);
                                            y = int.Parse(keywordargs[4]);
                                            z = int.Parse(keywordargs[5]);
                                        }
                                        catch
                                        {
                                            status_str = "Improper effect location format";
                                        }
                                        eloc = new Point3D(x, y, z);
                                    }
                                }
                                if (status_str != null)
                                {
                                    return false;
                                }
                                if (effect >= 0)
                                {
                                    Effects.SendLocationEffect(eloc, emap, effect, duration);
                                }
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.POISON:
                        {
                            // the syntax is POISON,name,range
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            if (arglist.Length > 0)
                            {
                                ApplyPoisonToPlayers(arglist[0], triggermob, invoker, out status_str);
                                if (status_str != null)
                                {
                                    return false;
                                }
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.DAMAGE:
                        {
                            // the syntax is DAMAGE,damage,phys,fire,cold,pois,energy[,range]
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            if (arglist.Length > 0)
                            {
                                ApplyDamageToPlayers(arglist[0], triggermob, invoker, out status_str);
                                if (status_str != null)
                                {
                                    return false;
                                }
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.RESURRECT:
                        {
                            // the syntax is RESURRECT[,range][,PETS]
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            if (arglist.Length > 0)
                            {
                                ResurrectPlayers(arglist[0], triggermob, invoker, out status_str);
                                if (status_str != null)
                                {
                                    return false;
                                }
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.CAST:
                        {
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            // Syntax is CAST,spellnumber[,arg] or CAST,spellname[,arg]
                            string[] keywordargs = ParseString(arglist[0], 3, ",");
                            int spellnumber = 0;
                            bool hasnumber = true;
                            // try it as spellnumber
                            if (keywordargs.Length > 1)
                            {
                                try
                                {
                                    spellnumber = int.Parse(keywordargs[1]);
                                }
                                catch
                                {
                                    hasnumber = false;
                                }
                            }
                            else
                            {
                                status_str = "invalid CAST specification";
                                // note that returning true means that Spawn will assume that it worked and will not try to recast
                                return true;
                            }
                            // call this with the 3 argument version that includes the bodytype arg
                            int keywordarg2 = 0;
                            if (keywordargs.Length > 2)
                            {
                                try
                                {
                                    keywordarg2 = int.Parse(keywordargs[2]);
                                }
                                catch
                                {
                                }
                            }

                            Spell spell = null;

                            // the trigger mob will cast the spells

                            Mobile caster = triggermob;
                            if (caster == null)
                            {
                                // note that returning true means that Spawn will assume that it worked and will not try to recast
                                return true;
                            }

                            // make the placeholder wand to avoid reagent and mana use
                            BaseWand cwand = new ClumsyWand();
                            cwand.Parent = caster;

                            if (hasnumber)
                            {
                                spell = SpellRegistry.NewSpell(spellnumber, caster, cwand);
                            }
                            else
                            {
                                spell = SpellRegistry.NewSpell(keywordargs[1], caster, cwand);
                            }
                            if (spell != null)
                            {
                                bool casterror = false;
                                try
                                {
                                    // deal with the 3 types of spells, mob targeted, location targeted, and self targeted
                                    // dont go through all of the warm up stuff, get right to the casting
                                    spell.State = SpellState.Sequencing;

                                    Type spelltype = spell.GetType();
                                    // deal with any special cases here
                                    if (spelltype == typeof(Server.Spells.Seventh.PolymorphSpell))
                                    {
                                        if (keywordarg2 == 0)
                                        {
                                            // this is invalid so dont cast
                                            throw (new ArgumentNullException());
                                        }
                                        object[] polyargs = new object[3];
                                        polyargs[0] = caster;
                                        polyargs[1] = cwand;
                                        polyargs[2] = keywordarg2;
                                        spell = (Spell)Activator.CreateInstance(spelltype, polyargs);

                                        if (spell == null)
                                        {
                                            throw (new ArgumentNullException());
                                        }
                                        spell.State = SpellState.Sequencing;
                                    }
                                    MethodInfo spelltargetmethod = null;

                                    // get the targeting method from the spell
                                    // note, the precedence is important as the target call should override oncast if it is present
                                    if (spelltype != null && (spelltargetmethod = spelltype.GetMethod("Target")) != null)
                                    {
                                    }
                                    // if it doesnt have it then check for self targeted types
                                    else if (spelltype != null && (spelltargetmethod = spelltype.GetMethod("OnCast")) != null)
                                    {
                                    }
                                    else
                                    {
                                        throw (new ArgumentNullException());
                                    }
                                    // Get the parameters for the target method.
                                    ParameterInfo[] spelltargetparms = spelltargetmethod.GetParameters();
                                    // target will have one parm
                                    // selftarg will have none
                                    object[] targetargs = null;
                                    // check the parameters
                                    if (spelltargetparms != null && spelltargetparms.Length > 0)
                                    {
                                        if (spelltargetparms[0].ParameterType == typeof(Server.Mobile))
                                        {
                                            // set the target parameter
                                            targetargs = new object[1];
                                            targetargs[0] = triggermob;
                                        }
                                        else if (spelltargetparms[0].ParameterType == typeof(Server.IPoint3D))
                                        {
                                            // set the target parameter
                                            targetargs = new object[1];
                                            // pick a random point around the caster
                                            int range = keywordarg2;
                                            if (range == 0)
                                                range = 1;
                                            int randx = Utility.RandomMinMax(-range, range);
                                            int randy = Utility.RandomMinMax(-range, range);
                                            if (randx == 0 && randy == 0)
                                                randx = 1;
                                            targetargs[0] = new Point3D(triggermob.Location.X + randx,
                                                triggermob.Location.Y + randy,
                                                triggermob.Location.Z);
                                        }
                                        else
                                        {
                                            // dont handle any other types of args
                                            throw (new ArgumentNullException());
                                        }
                                    }
                                    // set the spell on the caster
                                    caster.Spell = spell;
                                    // invoke the spell method with the appropriate args
                                    spelltargetmethod.Invoke(spell, targetargs);

                                    // get rid of the placeholder wand
                                    if (cwand != null && !cwand.Deleted)
                                        cwand.Delete();
                                }
                                catch
                                {
                                    status_str = "bad spell call : " + spell.Name;
                                    casterror = true;
                                    // get rid of the placeholder wand
                                    if (cwand != null && !cwand.Deleted)
                                        cwand.Delete();
                                }

                                if (casterror)
                                    return true;
                            }
                            else
                            {
                                status_str = "spell invalid or disabled : " + keywordargs[1];
                                //return true;
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));
                            // note that returning true means that Spawn assume that it worked and will not try to recast
                            break;
                        }
                    case typeKeyword.BCAST:
                        {
                            // syntax is BCAST[,hue][,font]/message
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);

                            int hue = 0x482;
                            int font = -1;

                            if (arglist.Length > 0)
                            {
                                string[] keywordargs = ParseString(arglist[0], 3, ",");
                                if (keywordargs.Length > 1)
                                {
                                    try
                                    {
                                        hue = int.Parse(keywordargs[1]);
                                    }
                                    catch
                                    {
                                        status_str = "invalid hue arg to BCAST";
                                    }
                                }
                                if (keywordargs.Length > 2)
                                {
                                    try
                                    {
                                        font = int.Parse(keywordargs[2]);
                                    }
                                    catch
                                    {
                                        status_str = "invalid font arg to BCAST";
                                    }
                                }
                            }

                            if (arglist.Length > 1)
                            {
                                string msg = arglist[1];
                                if (arglist[1] != null && arglist[1].Length > 0 && arglist[1][0] == '@')
                                {
                                    arglist = ParseSlashArgs(substitutedtypeName, 2);
                                    msg = arglist[1].Substring(1);
                                }
                                if (font >= 0)
                                {
                                    // broadcast an ascii message to all players
                                    BroadcastAsciiMessage(AccessLevel.Player, hue, font, msg);
                                }
                                else
                                {
                                    // standard unicode message format
                                    CommandHandlers.BroadcastMessage(AccessLevel.Player, hue, msg);
                                }
                            }
                            else
                            {
                                status_str = "missing msg arg in BCAST";
                                return false;
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    case typeKeyword.BSOUND:
                        {
                            // syntax is BSOUND,soundid
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);

                            int soundid = -1;

                            if (arglist.Length > 0)
                            {
                                string[] keywordargs = ParseString(arglist[0], 2, ",");
                                if (keywordargs.Length > 1)
                                {
                                    try
                                    {
                                        soundid = int.Parse(keywordargs[1]);
                                    }
                                    catch
                                    {
                                        status_str = "invalid soundid arg to BSOUND";
                                    }
                                }

                                if (soundid >= 0)
                                {
                                    // broadcast a sound to all players
                                    BroadcastSound(AccessLevel.Player, soundid);
                                }
                            }

                            TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                            break;
                        }
                    default:
                        {
                            status_str = "unrecognized keyword";
                            // should never get here
                            break;
                        }
                }
                // indicate successful keyword spawn
                return true;
            }
            else if (IsSpecialItemKeyword(typeName))
            {
                // these are special keyword item drops
                string[] arglist = ParseSlashArgs(substitutedtypeName, 2);
                string itemtypestr = arglist[0];
                string baseitemtype = typeName;

                // itemtypestr will have the form keyword[,x[,y]]
                string[] itemkeywordargs = ParseString(itemtypestr, 3, ",");

                // deal with the special keywords
                itemKeyword kw = (itemKeyword)itemKeywordHash[baseitemtype];

                switch (kw)
                {
                    case itemKeyword.ARMOR:
                        {
                            // syntax is ARMOR,min,max
                            //get the min,max
                            if (itemkeywordargs.Length == 3)
                            {
                                int min = 0;
                                int max = 0;
                                bool converterror = false;
                                try
                                {
                                    min = int.Parse(itemkeywordargs[1]);
                                }
                                catch
                                {
                                    status_str = "Invalid ARMOR args : " + itemtypestr;
                                    converterror = true;
                                }
                                try
                                {
                                    max = int.Parse(itemkeywordargs[2]);
                                }
                                catch
                                {
                                    status_str = "Invalid ARMOR args : " + itemtypestr;
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                                Item item = MagicArmor(min, max, false, false);
                                if (item != null)
                                {
                                    AddSpawnItem(spawner, TheSpawn, item, location, map, triggermob, requiresurface, spawnpositioning, substitutedtypeName, out status_str);
                                }
                            }
                            else
                            {
                                status_str = "ARMOR takes 2 args : " + itemtypestr;
                                return false;
                            }
                            break;
                        }
                    case itemKeyword.WEAPON:
                        {
                            // syntax is WEAPON,min,max
                            //get the min,max
                            if (itemkeywordargs.Length == 3)
                            {
                                int min = 0;
                                int max = 0;
                                bool converterror = false;
                                try
                                {
                                    min = int.Parse(itemkeywordargs[1]);
                                }
                                catch
                                {
                                    status_str = "Invalid WEAPON args : " + itemtypestr;
                                    converterror = true;
                                }
                                try
                                {
                                    max = int.Parse(itemkeywordargs[2]);
                                }
                                catch
                                {
                                    status_str = "Invalid WEAPON args : " + itemtypestr;
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                                Item item = MagicWeapon(min, max, false);
                                if (item != null)
                                {
                                    AddSpawnItem(spawner, TheSpawn, item, location, map, triggermob, requiresurface, spawnpositioning, substitutedtypeName, out status_str);
                                }
                            }
                            else
                            {
                                status_str = "WEAPON takes 2 args : " + itemtypestr;
                                return false;
                            }
                            break;
                        }
                    case itemKeyword.JARMOR:
                        {
                            // syntax is JARMOR,min,max
                            //get the min,max
                            if (itemkeywordargs.Length == 3)
                            {
                                int min = 0;
                                int max = 0;
                                bool converterror = false;
                                try
                                {
                                    min = int.Parse(itemkeywordargs[1]);
                                }
                                catch
                                {
                                    status_str = "Invalid JARMOR args : " + itemtypestr;
                                    converterror = true;
                                }
                                try
                                {
                                    max = int.Parse(itemkeywordargs[2]);
                                }
                                catch
                                {
                                    status_str = "Invalid JARMOR args : " + itemtypestr;
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                                Item item = MagicArmor(min, max, true, true);
                                if (item != null)
                                {
                                    AddSpawnItem(spawner, TheSpawn, item, location, map, triggermob, requiresurface, spawnpositioning, substitutedtypeName, out status_str);
                                }
                            }
                            else
                            {
                                status_str = "JARMOR takes 2 args : " + itemtypestr;
                                return false;
                            }
                            break;
                        }
                    case itemKeyword.JWEAPON:
                        {
                            // syntax is JWEAPON,min,max
                            //get the min,max
                            if (itemkeywordargs.Length == 3)
                            {
                                int min = 0;
                                int max = 0;
                                bool converterror = false;
                                try
                                {
                                    min = int.Parse(itemkeywordargs[1]);
                                }
                                catch
                                {
                                    status_str = "Invalid JWEAPON args : " + itemtypestr;
                                    converterror = true;
                                }
                                try
                                {
                                    max = int.Parse(itemkeywordargs[2]);
                                }
                                catch
                                {
                                    status_str = "Invalid JWEAPON args : " + itemtypestr;
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                                Item item = MagicWeapon(min, max, true);
                                if (item != null)
                                {
                                    AddSpawnItem(spawner, TheSpawn, item, location, map, triggermob, requiresurface, spawnpositioning, substitutedtypeName, out status_str);
                                }
                            }
                            else
                            {
                                status_str = "JWEAPON takes 2 args : " + itemtypestr;
                                return false;
                            }
                            break;
                        }
                    case itemKeyword.SARMOR:
                        {
                            // syntax is SARMOR,min,max
                            //get the min,max
                            if (itemkeywordargs.Length == 3)
                            {
                                int min = 0;
                                int max = 0;
                                bool converterror = false;
                                try
                                {
                                    min = int.Parse(itemkeywordargs[1]);
                                }
                                catch
                                {
                                    status_str = "Invalid SARMOR args : " + itemtypestr;
                                    converterror = true;
                                }
                                try
                                {
                                    max = int.Parse(itemkeywordargs[2]);
                                }
                                catch
                                {
                                    status_str = "Invalid SARMOR args : " + itemtypestr;
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                                Item item = MagicArmor(min, max, false, true);
                                if (item != null)
                                {
                                    AddSpawnItem(spawner, TheSpawn, item, location, map, triggermob, requiresurface, spawnpositioning, substitutedtypeName, out status_str);
                                }
                            }
                            else
                            {
                                status_str = "SARMOR takes 2 args : " + itemtypestr;
                                return false;
                            }
                            break;
                        }
                    case itemKeyword.SHIELD:
                        {
                            // syntax is SHIELD,min,max
                            //get the min,max
                            if (itemkeywordargs.Length == 3)
                            {
                                int min = 0;
                                int max = 0;
                                bool converterror = false;
                                try
                                {
                                    min = int.Parse(itemkeywordargs[1]);
                                }
                                catch
                                {
                                    status_str = "Invalid SHIELD args : " + itemtypestr;
                                    converterror = true;
                                }
                                try
                                {
                                    max = int.Parse(itemkeywordargs[2]);
                                }
                                catch
                                {
                                    status_str = "Invalid SHIELD args : " + itemtypestr;
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                                Item item = MagicShield(min, max);
                                if (item != null)
                                {
                                    AddSpawnItem(spawner, TheSpawn, item, location, map, triggermob, requiresurface, spawnpositioning, substitutedtypeName, out status_str);
                                }
                            }
                            else
                            {
                                status_str = "SHIELD takes 2 args : " + itemtypestr;
                                return false;
                            }
                            break;
                        }
                    case itemKeyword.JEWELRY:
                        {
                            // syntax is JEWELRY,min,max
                            //get the min,max
                            if (itemkeywordargs.Length == 3)
                            {
                                int min = 0;
                                int max = 0;
                                bool converterror = false;
                                try
                                {
                                    min = int.Parse(itemkeywordargs[1]);
                                }
                                catch
                                {
                                    status_str = "Invalid JEWELRY args : " + itemtypestr;
                                    converterror = true;
                                }
                                try
                                {
                                    max = int.Parse(itemkeywordargs[2]);
                                }
                                catch
                                {
                                    status_str = "Invalid JEWELRY args : " + itemtypestr;
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                                Item item = MagicJewelry(min, max);
                                if (item != null)
                                {
                                    AddSpawnItem(spawner, TheSpawn, item, location, map, triggermob, requiresurface, spawnpositioning, substitutedtypeName, out status_str);
                                }
                            }
                            else
                            {
                                status_str = "JEWELRY takes 2 args : " + itemtypestr;
                                return false;
                            }
                            break;
                        }
                    case itemKeyword.ITEM:
                        {
                            // syntax is ITEM,serial
                            if (itemkeywordargs.Length == 2)
                            {
                                int serial = -1;
                                bool converterror = false;
                                try
                                {
                                    serial = Convert.ToInt32(itemkeywordargs[1], 16);
                                }
                                catch
                                {
                                    status_str = "Invalid ITEM args : " + itemtypestr;
                                    converterror = true;
                                }

                                if (converterror)
                                    return false;

                                Item item = World.FindItem(serial);
                                if (item != null)
                                {
                                    AddSpawnItem(spawner, TheSpawn, item, location, map, triggermob, requiresurface, spawnpositioning, substitutedtypeName, out status_str);
                                }
                            }
                            else
                            {
                                status_str = "ITEM takes 1 arg : " + itemtypestr;
                                return false;
                            }

                            break;
                        }
                    case itemKeyword.SCROLL:
                        {
                            // syntax is SCROLL,mincircle,maxcircle
                            //get the min,max
                            if (itemkeywordargs.Length == 3)
                            {
                                int minCircle = 0;
                                int maxCircle = 0;
                                bool converterror = false;
                                try
                                {
                                    minCircle = int.Parse(itemkeywordargs[1]);
                                }
                                catch
                                {
                                    status_str = "Invalid SCROLL args : " + itemtypestr;
                                    converterror = true;
                                }
                                try
                                {
                                    maxCircle = int.Parse(itemkeywordargs[2]);
                                }
                                catch
                                {
                                    status_str = "Invalid SCROLL args : " + itemtypestr;
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                                int circle = Utility.RandomMinMax(minCircle, maxCircle);
                                int min = (circle - 1) * 8;
                                Item item = Loot.RandomScroll(min, min + 7, SpellbookType.Regular);
                                if (item != null)
                                {
                                    AddSpawnItem(spawner, TheSpawn, item, location, map, triggermob, requiresurface, spawnpositioning, substitutedtypeName, out status_str);
                                }
                            }
                            else
                            {
                                status_str = "SCROLL takes 2 args : " + itemtypestr;
                                return false;
                            }
                            break;
                        }
                    case itemKeyword.LOOT:
                        {
                            // syntax is LOOT,methodname
                            if (itemkeywordargs.Length == 2)
                            {
                                Item item = null;

                                // look up the method
                                Type ltype = typeof(Loot);
                                if (ltype != null)
                                {
                                    MethodInfo method = null;

                                    try
                                    {
                                        // get the zero arg method with the specified name
                                        method = ltype.GetMethod(itemkeywordargs[1], new Type[0]);
                                    }
                                    catch
                                    {
                                    }

                                    if (method != null && method.IsStatic)
                                    {
                                        ParameterInfo[] pinfo = method.GetParameters();
                                        // check to make sure the method for this object has the right args
                                        if (pinfo.Length == 0)
                                        {
                                            // method must be public static with no arguments returning an Item class object
                                            try
                                            {
                                                item = method.Invoke(null, null) as Item;
                                            }
                                            catch
                                            {
                                            }
                                        }
                                        else
                                        {
                                            status_str = "LOOT method must be zero arg : " + itemtypestr;
                                            return false;
                                        }
                                    }
                                    else
                                    {
                                        status_str = "LOOT no valid method found : " + itemtypestr;
                                        return false;
                                    }
                                }

                                if (item != null)
                                {
                                    AddSpawnItem(spawner, TheSpawn, item, location, map, triggermob, requiresurface, spawnpositioning, substitutedtypeName, out status_str);
                                }
                            }
                            else
                            {
                                status_str = "LOOT takes 1 arg : " + itemtypestr;
                                return false;
                            }
                            break;
                        }
                    case itemKeyword.POTION:
                        {
                            // syntax is POTION
                            Item item = Loot.RandomPotion();
                            if (item != null)
                            {
                                AddSpawnItem(spawner, TheSpawn, item, location, map, triggermob, requiresurface, spawnpositioning, substitutedtypeName, out status_str);
                            }
                            break;
                        }
                    case itemKeyword.TAKEN:
                        {
                            // syntax is TAKEN
                            // find the XmlSaveItem attachment
                            Item item = GetTaken(invoker);

                            if (item != null)
                            {
                                AddSpawnItem(spawner, invoker, TheSpawn, item, location, map, triggermob, requiresurface, spawnpositioning, substitutedtypeName, out status_str);
                            }
                            break;
                        }
                    case itemKeyword.GIVEN:
                        {
                            // syntax is GIVEN
                            // find the XmlSaveItem attachment
                            Item item = GetGiven(invoker);

                            if (item != null)
                            {
                                AddSpawnItem(spawner, invoker, TheSpawn, item, location, map, triggermob, requiresurface, spawnpositioning, substitutedtypeName, out status_str);
                            }
                            break;
                        }

                    case itemKeyword.NECROSCROLL:
                        {
                            // syntax is NECROSCROLL,index
                            if (itemkeywordargs.Length == 2)
                            {
                                int necroindex = 0;
                                bool converterror = false;
                                try
                                {
                                    necroindex = int.Parse(itemkeywordargs[1]);
                                }
                                catch
                                {
                                    status_str = "Invalid NECROSCROLL args : " + itemtypestr;
                                    converterror = true;
                                }
                                if (converterror)
                                    return false;
                                if (Core.AOS)
                                {
                                    Item item = Loot.Construct(Loot.NecromancyScrollTypes, necroindex);
                                    if (item != null)
                                    {
                                        AddSpawnItem(spawner, TheSpawn, item, location, map, triggermob, requiresurface, spawnpositioning, substitutedtypeName, out status_str);
                                    }
                                }
                            }
                            else
                            {
                                status_str = "NECROSCROLL takes 1 arg : " + itemtypestr;
                                return false;
                            }
                            break;
                        }
                    case itemKeyword.MULTIADDON:
                        {
                            // syntax is MULTIADDON,filename
                            if (itemkeywordargs.Length == 2)
                            {
                                string filename = itemkeywordargs[1];

                                // read in the multi.txt file

                                Item item = XmlSpawnerAddon.ReadMultiFile(filename, out status_str);

                                if (item != null)
                                {
                                    AddSpawnItem(spawner, TheSpawn, item, location, map, triggermob, requiresurface, spawnpositioning, substitutedtypeName, out status_str);
                                }
                            }
                            else
                            {
                                status_str = "MULTIADDON takes 1 arg : " + itemtypestr;
                                return false;
                            }
                            break;
                        }
                    default:
                        {
                            status_str = "unrecognized keyword";
                            // should never get here
                            break;
                        }
                }

                return true;
            }
            else
            {
                // should never get here
                status_str = "unrecognized keyword";
                return false;
            }
        }
示例#38
0
		public override void OnResponse( NetState sender, RelayInfo info )
		{	
			m_From = sender.Mobile;
			
			string page = "You open the homepage.";

			switch( info.ButtonID )
			{
				case 0:
				{
					m_From.PlaySound( 46 );
					break;
				}	
				
				case 1:
				{
						m_From.PlaySound( 579 );
                        m_From.LaunchBrowser(string.Format("http://in-uo.net/"));
                        m_From.SendAsciiMessage( page );

					break;
				}
				
				case 2:
				{
						m_From.PlaySound( 579 );
                        m_From.LaunchBrowser(string.Format("http://in-uo.net/forums/index.php"));
                        m_From.SendAsciiMessage( page );

					break;
				}
			}
		}
			public static void OPENBROWSER(TriggerObject trigObject, Mobile mob, string url)
			{
				if (mob != null && url != null)
				{
					mob.LaunchBrowser(url);
				}
			}
        public static void CreateReward(EventRewardInfo info, Mobile m)
        {
            if (m == null)
                return;

            Item item = null;
            switch (info.IncrID)
            {
                case 0: item = new MagicSewingKit(1); break;
                case 1:
                    string str = "PottedCactus";
                    int randint = Utility.Random(6);
                    if (randint > 0)
                        str = str + randint.ToString();

                    Type type = ScriptCompiler.FindTypeByName(str);
                    item = (Item)Activator.CreateInstance(type);
                    item.Weight = 100;
                    break;
                case 2:
                    if (Utility.RandomBool())
                        item = new PottedTree();
                    else
                        item = new PottedTree1();
                    break;
                case 3:
                    switch (Utility.Random(3))
                    {
                        case 0: item = new PottedPlant(); break;
                        case 1: item = new PottedPlant1(); break;
                        case 2: item = new PottedPlant2(); break;
                    }
                    break;
                case 4: item = new SpecialHairDye(); break;
                case 5: item = new SpecialBeardDye(); break;
                case 6: item = new TempHorseEthereal(50);
                        item.Hue = Utility.Random(795, 7);
                        break;
                case 7: item = new FireworksWand(99); break;
                case 8: item = new LayeredSashDeed(); break;
                case 9: item = new SkillBall(1); break;
                case 10: item = new SkillBall(5); break;
                case 11: item = new SkillBall(10); break;
                case 12: item = new SkillBall(25); break;
                case 13: item = new SkillBall(50); break;
                case 14: item = new PersonalisationDeed(); break;
                case 15: item = new CrystalPedestalAddonDeed(); break;
                case 16: item = new FountainStoneAddonDeed(); break;
                case 17: item = new FountainSandstoneAddonDeed(); break;
                case 18: item = new SquirrelStatueEastDeed(); break;
                case 19: item = new SquirrelStatueSouthDeed(); break;
                case 20: item = new ArcanistStatueEastDeed(); break;
                case 21: item = new ArcanistStatueSouthDeed(); break;
                case 22: item = new WarriorStatueEastDeed(); break;
                case 23: item = new WarriorStatueSouthDeed(); break;
                case 24: item = new TempRobe(31);
                        ((BaseClothing)item).Attributes.RegenHits = 3;
                        break;
                case 25: item = new TempCloak(31);
                        ((BaseClothing)item).Attributes.RegenHits = 3;
                        break;
                case 26: item = new CampfireDeed(); break;
                case 27: item = new FireDeed(); break;
                case 28: item = new SoulstoneFragment();
                        ((SoulstoneFragment)item).Account = m.Account.Username;
                        break;
                case 29: item = new NameChangeDeed(); break;
                case 30: item = new SexChangeDeed(); break;
                case 31: item = new KillResetDeedAOS(); break;
                case 32: item = new PetBondingDeed(); break;
                case 33: item = new WarHorseBondingDeed(); break;
                case 34: item = new AntiBlessDeed(); break;
                case 35: item = new WhisperingRose(m.Name); break;
                case 36: item = new WeddingDeed(); break;
                case 37: item = new KillBook();
                        ((KillBook)item).BookOwner = m;
                        break;
            }

            if (item != null)
            {
                m.AddToBackpack(item);
                m.SendMessage("The reward item has been placed into your backpack, have fun!");
            }
            else
            {
                m.SendMessage("That item is not available. Please report the bug at the site that will open in your browser.");
                m.LaunchBrowser( "http://bug.casiopia.net/" );
                m.AddToBackpack( new CopperBar(info.Price) );
            }
        }
示例#41
0
		public override void OnDoubleClick( Mobile from )
		{
		if ( lastused + delay > DateTime.Now )
				{
					from.SendMessage( "Your request is already being processed. Please wait 5 seconds between uses." ); 
					return;
				}
		else
		{
		lastused = DateTime.Now;
		from.LaunchBrowser( m_URL );	
		}
		}