Пример #1
0
 public static void SkillTest_OnCommand(CommandEventArgs e)
 {
     //ListTestGump g = new ListTestGump();
     if (QueryPageHelper.PluginExists("TMSkill"))
     {
         Dictionary <string, object> t = new Dictionary <string, object>();
         t.Add("Skin", SkinHelper.getSkin(SkillSettings.ControlSkinName));
         t.Add("Mobile", e.Mobile);
         SuperSkillProfile p  = (SuperSkillProfile)SkillProfileHelper.getProfile("Default Profile");
         SkillProfile      sp = p.getProfile(0);
         t.Add("Profile", sp);
         TMQueryPage pg = new TMQueryPage("TMSS Skill Gump", t);
         //e.Mobile.SendGump(pg);
     }
     else
     {
         DoTell("Error when creating Skill Gump. Plugin does not exist.");
         return;
     }
 }
Пример #2
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            //has 0, 101, and profile cases.
            //0: cancel, right-click.
            //101: Finish.
            //profile: gives 1-base index of profile to load in master profile.
            SkillSettings.DoTell("Button ID: " + info.ButtonID);

            if (info.ButtonID == 0 && sender.Mobile.AccessLevel >= SkillSettings.GumpControlLevel)
            {
                this.Session.Close(); return;
            }
            else if (sender.Mobile.AccessLevel <= SkillSettings.GumpControlLevel && info.ButtonID == 0)
            {
                Page.Clone(); return;
            }

            if (info.ButtonID == 101)
            {
                if (Session.VerifyFinal())
                {
                    ClearGumps(sender); sender.Mobile.SendGump(new TMAlertGump("Congratulations, you are now ready to play the shard."));
                }
                else
                {
                    sender.Mobile.SendGump(Page.Clone()); sender.Mobile.SendGump(new TMAlertGump(Session.CurrentErrorMessage));
                }
                return;
            }

            int has = hasControlGump(sender);

            if (has != -1)
            {
                if (has == 1)
                {
                    sender.Mobile.CloseGump(typeof(TMSkill));
                }
                else if (has == 2)
                {
                    sender.Mobile.CloseGump(typeof(TMStat));
                }
            }

            if (info.ButtonID == 1 && Session.Profile.StatEnable)
            {
                TMQueryPage p = new TMQueryPage("TMSS Stat Gump", Session);
                Page.Clone();
            }
            else
            {
                /*if (hasControlGump(sender))
                 * {
                 *      sender.Mobile.SendGump(Page.Clone());
                 *      sender.Mobile.SendGump(new TMAlertGump("You cannot open more than one selection page at a time."));
                 *      return;
                 * }*/
                int pro = info.ButtonID - 1;
                Dictionary <string, object> arg = new Dictionary <string, object>();
                arg.Add("Profile", prof.getProfile(pro));
                arg.Add("Session", Session);
                arg.Add("Skin", Session.Skin);
                arg.Add("Mobile", sender.Mobile);
                SkillSettings.DoTell("Master Gump skill gump send: Profile:" + prof.getProfile(pro) + " Session: " + Session + " Skin: " + Session.Skin + " Mobile: " + sender.Mobile);
                SkillSettings.DoTell("MG Session: TSP: " + Session.totalSelectedPoints + " TAP: " + Session.totalAllowedPoints);
                TMQueryPage p = new TMQueryPage("TMSS Skill Gump", arg);
                Page.Clone();
            }
        }