Exemple #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (Which == "" || !SkillProfileHelper.Profiles.ContainsKey(Which))
                {
                    SkillSettings.DoTell("SPH does not contain, or key is blank. Key: " + Which);
                    IEnumerator ie = SkillProfileHelper.Profiles.GetEnumerator();
                    while (ie.MoveNext())
                    {
                        SkillSettings.DoTell("Value: " + ((KeyValuePair <string, SkillProfile>)ie.Current).Key);
                    }
                    return;
                }

                if (targeted is BaseTMSkillItem)
                {
                    BaseTMSkillItem item = (BaseTMSkillItem)targeted;

                    if (Super)
                    {
                        SkillSettings.DoTell("Profile being set."); item.Profile = SkillProfileHelper.Supers[Which]; SkillSettings.DoTell("Profile set.");
                    }
                    else
                    {
                        from.SendMessage("Non-Super Profile profiles are not yet implemented.");
                    }
                }
                else
                {
                    from.SendMessage("Profile cannot be set on that item.");
                }
            }
Exemple #2
0
        //generates or updates .plg files
        public static void SavePluginSettings(TMPluginSave plugin)
        {
            if (pluginExists(plugin.getName()))
            {
                if (!Directory.Exists(loc))
                {
                    Directory.CreateDirectory(loc);
                }
                string FileName = plugin.getName() + ".plg";
                string path     = loc + FileName;
                Console.Write(" - Saving Settings for TMPlugin " + plugin.getName() + "...");

                try
                {
                    using (FileStream m_FileStream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write))
                    {
                        BinaryFileWriter writer = new BinaryFileWriter(m_FileStream, true);
                        plugin.SavePlugin(writer);

                        writer.Close();
                        m_FileStream.Close();
                    }
                    Console.WriteLine("done.");
                }
                catch (Exception e)
                { SkillSettings.DoTell(" TMPlugin " + plugin + " could not be saved. Error: " + e); }
            }
            else
            {
                SkillSettings.DoTell(" TMPlugin " + plugin + " not registered to system. Save cannot continue.");
            }
        }
Exemple #3
0
        public void GetGumpCode(TMQueryPage page)
        {
            object o = page.GetValueSet();

            Page          = page;
            this.Dragable = false;
            if (o is TMSkillSession)
            {
                Session = (TMSkillSession)o;
                prof    = Session.Profile;
            }
            Page.BaseSkinByType(this);
            if (prof == null)
            {
                SkillSettings.DoTell("Invalid profile to set up Master."); return;
            }
            TMSS4Skin sk = Session.Skin;

            Page.AddSuperButton(sk.FinishButtonX, sk.FinishButtonY, sk.FinishButtonH, sk.FinishButtonW, sk.ButtonOverlay, sk.ButtonUnderID, sk.ButtonUnderID, sk.FinishLabel, GumpButtonType.Reply, 101, 0, this);
            AddLabel(sk.PointsLabelX, sk.PointsLabelY, sk.Red, sk.PointsLabel + " " + Session.totalSelectedPoints + " / " + Session.totalAllowedPoints);
            AddPage(1);

            IEnumerator ie           = prof.getProfileList();
            int         count        = prof.subProfiles.Count;
            int         i            = 0;
            int         pageid       = 1;
            int         pagesubcount = 0;

            //Add button for stats.
            Page.AddSuperButton(sk.ProfileX, sk.ProfileY + ((i % 6) * (sk.ProfileSpacer + sk.ProfileButtonH)), sk.ProfileButtonH, sk.ProfileButtonW, sk.ProfileNormalID, sk.SelectUnderlay, sk.SelectUnderlay, "Stats", GumpButtonType.Reply, i + 1, 0, this);
            i++;
            pagesubcount++;
            while (ie.MoveNext())
            {
                string blah = ((SkillProfile)((KeyValuePair <string, SkillProfile>)ie.Current).Value).ProfileName;
                SkillSettings.DoTell2("Master gump debug: " + blah);
                Page.AddSuperButton(sk.ProfileX, sk.ProfileY + ((i % 6) * (sk.ProfileSpacer + sk.ProfileButtonH)), sk.ProfileButtonH, sk.ProfileButtonW, sk.ProfileNormalID, sk.SelectUnderlay, sk.SelectUnderlay, "" + blah, GumpButtonType.Reply, i + 1, 0, this);
                i++;
                pagesubcount++;
                if (pagesubcount == 5)
                {
                    pagesubcount = 0;
                }
                if (pagesubcount == 1)
                {
                    Page.AddSuperButton(sk.FinishButtonX, sk.FinishButtonY, sk.FinishButtonH, sk.FinishButtonW, sk.ProfileNormalID, sk.SelectUnderlay, sk.SelectUnderlay, "" + sk.FinishLabel, GumpButtonType.Reply, 101, 0, this);
                }
                if (pagesubcount == 0)
                {
                    pageid++;
                    AddPage(pageid);
                    Page.AddSuperButton(sk.NextButtonMX, sk.NextButtonMY, sk.NextButtonMH, sk.NextButtonMW, sk.ProfileNormalID, sk.SelectUnderlay, sk.SelectUnderlay, "" + sk.NextTextM, GumpButtonType.Page, 0, pageid + 1, this);
                    if (pageid != 1)
                    {
                        Page.AddSuperButton(sk.PrevButtonMX, sk.PrevButtonMY, sk.PrevButtonMH, sk.PrevButtonMW, sk.ProfileNormalID, sk.SelectUnderlay, sk.SelectUnderlay, "" + sk.PrevTextM, GumpButtonType.Page, 0, pageid - 1, this);
                    }
                }
            }
            Session.Mobile.SendGump(this);
        }
Exemple #4
0
 public override void OnResponse(NetState sender, RelayInfo info)
 {
     if (info.ButtonID == 0)
     {
         return;
     }
     if (info.ButtonID > 0)
     {
         sender.Mobile.Target = new ProfileTarget(skinnames[info.ButtonID - 1]);
     }
     else
     {
         if (info.ButtonID > 0)
         {
             sender.Mobile.Target = new ProfileTarget(skinnames[info.ButtonID - 1]);
         }
         else
         {
             int val = (info.ButtonID - 1) * (-1);
             if (skinnames.Count >= val)
             {
                 SkillSettings.CCSkinName = skinnames[(val)];
                 SkillSettings.DoTell("CCSkinName: " + SkillSettings.CCSkinName);
             }
             else
             {
                 SkillSettings.DoTell("skinnames does not have such a value.");
             }
         }
     }
 }
 public void Start()
 {
     if (invalidated)
     {
         return;
     }
     if (m_Mobile == null || m_Item == null || Profile == null || Skin == null)
     {
         SkillSettings.DoTell("One or more necessary items are null, the session cannot continue."); return;
     }
     if (Profile.IsGumped)
     {
         WindowInfo masterinf = Skin.WindowInfo["Master"];
         subMaster = new TMQueryPage("TMSS Session Master Gump", this);
         //m_Mobile.SendGump( subMaster );
         //Mobile.SendGump( new TMQueryPage("TMSS Stat Gump", this ) );
         TMQueryPage tqp = new TMQueryPage("TMSS Stat Gump", this);
     }
     else if (Profile.StandTicket)
     {
         QuickMethod();
     }
     else
     {
         SkillSettings.DoTell("Unable to continue. Invalid session configuration.");
     }
 }
        internal bool addSkill(string name, Dictionary <string, TMUsedInfo> values)
        {
            SkillSettings.DoTell("Key (name): " + name);
            IEnumerator ie = values.GetEnumerator();

            while (ie.MoveNext())
            {
                TMUsedInfo ui = ((KeyValuePair <string, TMUsedInfo>)ie.Current).Value;
                SkillSettings.DoTell(" - values: " + ui.SkillName + " val: " + ui.SkillValue);
            }
            if (SelectedSkills.ContainsKey(name))
            {
                SkillSettings.DoTell("Key in dictionary. " + name + " Current sum: " + getCurrentSum(name));
                totalSelectedPoints = revaluePoints(name);
                SelectedSkills.Remove(name);
            }
            SkillSettings.DoTell("Pre count: " + SelectedSkills.Count);
            SelectedSkills.Add(name, values);
            SkillSettings.DoTell("Current count: " + SelectedSkills.Count);
            Dictionary <string, TMUsedInfo> info = SelectedSkills[name];

            ie = info.GetEnumerator();
            while (ie.MoveNext())
            {
                TMUsedInfo ui = ((KeyValuePair <string, TMUsedInfo>)ie.Current).Value;
                SkillSettings.DoTell(" - info: " + ui.SkillName + " val: " + ui.SkillValue);
            }
            return(!verifyEntries(name));
        }
        public void OnResponse(Server.Network.NetState sender, Server.Gumps.RelayInfo info)
        {
            Mobile    from = sender.Mobile;
            TMSS4Skin skin = sk;

            SkillReportsHelper.EnableSelectionReport = info.IsSwitched(2000);
            SkillReportsHelper.EnableProfileReport   = info.IsSwitched(1000);
            //PluginSaver.SavePluginSettings(this);
            Dictionary <string, object> args = new Dictionary <string, object>();

            if (skin != null)
            {
                args.Add("Skin", skin);
            }
            else
            {
                SkillSettings.DoTell("Reports: Skin is null.");
            }
            if (from != null)
            {
                args.Add("Mobile", from);
            }
            else
            {
                SkillSettings.DoTell("Reports: From is null.");
            }
            from.SendGump(new TMQueryPage("Main Menu", args));
        }
        protected override void OnTarget(Mobile from, object targeted)
        {
            if (targeted is Mobile)
            {
                Mobile targ = (Mobile)targeted;

                try
                {
                    targ.Skills[m_Which].Base = m_Value;
                }
                catch (Exception e)
                {
                    SkillSettings.DoTell("Mobile does not have the selected skill: " + SkillInfo.Table[m_Which].Name + " Exception: " + e);
                    return;
                }

                if (m_Set)
                {
                    //CommandLogging.LogChangeProperty( from, targ, "Skill change.", m_Value.ToString() );
                }

                from.SendMessage("{0} : {1}", SkillInfo.Table[m_Which].Name, from.Skills[m_Which].Base);
            }
            else
            {
                from.SendMessage("That does not have skills!");
            }
        }
        public SkillProfile getProfile(int index)
        {
            IEnumerator ie = subProfiles.GetEnumerator();

            //SkillProfile ret = null;
            if (index < 0)
            {
                SkillSettings.DoTell("Invalid profile iteration ID. " + index); return(null);
            }

            while (index > -1 && ie.MoveNext())
            {
                try
                {
                    index--;
                    if (index == 0)
                    {
                        return(((KeyValuePair <string, SkillProfile>)ie.Current).Value);
                    }
                }
                catch (Exception e)
                { SkillSettings.DoTell("Unable to move enumerator where expected able. " + e); return(null); }
            }
            return(null);
        }
Exemple #10
0
        public void GetGumpCode(TMQueryPage page)
        {
            sk = page.Skin;
            page.AddTitle("Shard Message Options", "Control");
            //page.AddLabel(75, 90, 192, @"Shard Settings:");
            //page.AddImage(227, 148, 1143);
            SkillSettings.DoTell("GetCoord: " + sk.GetCoord("Control", "X"));
            page.AddLabel(sk.SelectStartX, 115, sk.White, @"Use Shard Info:");
            page.AddCheck(sk.SelectStartX + 100, 115, sk.genericSelectUp, sk.genericSelectDn, SkillSettings.IsSharded, 1000);

            page.AddLabel(sk.SelectStartX, 140, sk.White, @"Not Yours: ");
            page.AddImageTiled(sk.SelectStartX + 100, 140, 332, 20, 3004);
            page.AddTextEntry(sk.SelectStartX + 100, 140, 330, 20, sk.White, 2001, @"" + SkillSettings.NotYoursMessage);

            page.AddLabel(sk.SelectStartX, 170, sk.White, @"How To Use: ");
            page.AddImageTiled(sk.SelectStartX + 100, 170, 332, 20, 3004);
            page.AddTextEntry(sk.SelectStartX + 100, 170, 330, 20, sk.White, 2002, @"" + SkillSettings.HowToUseMessage);

            page.AddLabel(sk.SelectStartX, 200, sk.White, @"No Ticket: ");
            page.AddImageTiled(sk.SelectStartX + 100, 200, 332, 20, 3004);
            page.AddTextEntry(sk.SelectStartX + 100, 200, 330, 20, sk.White, 2003, @"" + SkillSettings.NoTicketMessage);

            page.AddSuperButton(sk.NextButtonSX - page.X, sk.NextButtonSY - 15, sk.NextButtonSH, sk.NextButtonSW, sk.ButtonOverlay, sk.ButtonUnderID, sk.ButtonUnderIDPress, "APPLY", GumpButtonType.Reply, 1, 0);

            //page.AddButton(450, 380, 238, 239, 1, GumpButtonType.Reply, 1);
            //page.AddLabel(335, 380, 0, @"Apply Settings");
        }
Exemple #11
0
        public ListTestGump() : base(0, 0)
        {
            SkillSettings.DoTell("Setting up new ListTestGump.");
            BaseSkin skin = SkinHelper.getSkin(SkillSettings.ControlSkinName);

            this.AddBackground(0, 0, 500, 500, 9270);
            GumpList list = new GumpList(this, "details", skin);

            SkillSettings.DoTell("List Created.");
            GumpListEntry e1 = new GumpListEntry(0, 0, list, skin.EntryDefaultWidth, skin.EntryDefaultHeight);

            e1.AddColumn("This is a column.");
            e1.AddColumn("This is a 2nd column.");
            e1.AddColumn("This is the 3rd column.");
            SkillSettings.DoTell("Entry 1 Created.");
            GumpListEntry e2 = new GumpListEntry(0, 0, list, skin.EntryDefaultWidth, skin.EntryDefaultHeight);

            e2.AddColumn("This is r2 c1.");
            e2.AddColumn("this is r2 c2.");
            e2.AddColumn("this is r2 c3.");
            SkillSettings.DoTell("Entry 2 Created.");
            list.Add(e1);
            list.Add(e2);
            SkillSettings.DoTell("Entries added to list.");
            list.AddColumn("1st column.");
            list.AddColumn("2nd column.");
            list.AddColumn("3rd column.");
            SkillSettings.DoTell("List columns added.");
            list.columns = 3;
            list.CommitList();
        }
Exemple #12
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (info.ButtonID == 0 && sender.Mobile.AccessLevel >= SkillSettings.GumpControlLevel)
            {
                return;
            }
            Dictionary <string, int> dict = new Dictionary <string, int>();

            try
            {
                dict.Add("Strength", Int32.Parse(info.GetTextEntry(1000).Text));
                dict.Add("Dexterity", Int32.Parse(info.GetTextEntry(2000).Text));
                dict.Add("Intelligence", Int32.Parse(info.GetTextEntry(3000).Text));
                if (Session != null)
                {
                    bool resend = Session.addStat(dict);
                    if (resend)
                    {
                        sender.Mobile.SendGump(Page.Clone());
                        sender.Mobile.SendGump(new TMAlertGump(Session.CurrentErrorMessage));
                    }
                }
                else
                {
                    SkillSettings.SystemWrite("Invalid Session. Cannot continue."); sender.Mobile.SendGump(new TMAlertGump("You do not appear to be in a Session. Cannot continue.")); return;
                }
            }
            catch (Exception e)
            {
                sender.Mobile.SendGump(Page.Clone());
                sender.Mobile.SendGump(new TMAlertGump("Could not get Stat values. Please reenter."));
                SkillSettings.SystemWrite("Error when acquiring stats data: " + e);
            }
        }
 public static void Configure()
 {
     SkillSettings.SystemWrite("-- // P // -- Configuring Skill Replacement. Custom Skill Gump will " + (UseParallelGump ? "" : "not") + " be used.");
     if (UseParallelGump)
     {
         Server.Network.PacketHandlers.Register(0x34, 10, true, new Server.Network.OnPacketReceive(Server.TMSS.SkillReplacement.MobileQuery2));
     }
 }
Exemple #14
0
        internal void BaseSkinByType(Gump g)
        {
            if (relplug == null)
            {
                SkillSettings.DoTell("Base Type is invalid. Cannot skin.");
            }
            g.AddPage(0);
            string switchby = relplug.getGumpType();

            if (switchby == "Control")
            {
                //this.X = sk.GetCoord("Control", "X", sk ); this.Y = sk.SelectionY;
                g.X = 0; g.Y = 0;
                if (!Skin.WindowInfo.ContainsKey("Control"))
                {
                    SkillSettings.DoTell("No key for Control gump skin."); return;
                }
                WindowInfo inf = Skin.WindowInfo["Control"];
                g.X = inf.X; g.Y = inf.Y;
                //this.AddBackground(sk.GetCoord("Control", "X", sk ), sk.SelectionY, sk.GetCoord("Control", "W", sk ), sk.GetCoord("Control", "H", sk ), sk.SelectBGID);
                g.AddBackground(0, 0, inf.W, inf.H, inf.bgID);
                g.AddImageTiled(Skin.BarSHX, Skin.BarSHY, Skin.BarSHW, Skin.BarSHH, Skin.SelectLineH);
                g.AddHtml(Skin.TMSSX, Skin.TMSSY, 140, 20, "<basefont size=5 face=1 color=#CC0000><Center>TMSS - //4// -</center></basefont>", false, false);
                //<basefont size=5 face=1 color=#CC0000><Center>TM Skill & Stat System v3.0</center></basefont>
            }
            else if (switchby == "Master")
            {
                g.X = 0; g.Y = 0;
                if (!Skin.WindowInfo.ContainsKey("Master"))
                {
                    SkillSettings.DoTell("No key for Master gump skin."); return;
                }
                WindowInfo inf = Skin.WindowInfo["Master"];
                //this.AddBackground(sk.MasterX, sk.MasterY, sk.MasterW, sk.MasterH, sk.MasterBGID);
                g.X = inf.X; g.Y = inf.Y;
                g.AddBackground(0, 0, inf.W, inf.H, inf.bgID);
                g.AddImageTiled(Skin.BarMHX, Skin.BarMHY, Skin.BarMHW, Skin.BarMHH, Skin.MasterLineH);
                g.AddImageTiled(Skin.BarMVX, Skin.BarMVY, Skin.BarMVW, Skin.BarMVH, Skin.MasterLineV);
                g.AddItem(Skin.IconMX, Skin.IconMY, Skin.IconMID, Skin.IconMColor);
            }
            else if (switchby == "Underbar")
            {
                g.X = 0; g.Y = 0;
                if (!Skin.WindowInfo.ContainsKey("Underbar"))
                {
                    SkillSettings.DoTell("No key for Underbar gump skin."); return;
                }
                WindowInfo inf = Skin.WindowInfo["Underbar"];
                g.X = inf.X; g.Y = inf.Y;
                g.AddBackground(0, 0, inf.W, inf.H, inf.bgID);
                //this.AddBackground(sk.sk.GetCoord("Underbar", "X", );, sk.sk.GetCoord("Underbar", "Y", );, sk.HelpW, sk.HelpH, sk.HelpBGID);
            }
            else
            {
                SkillSettings.DoTell("Unknown Gump Type. Cannot apply base skin.");
            }
        }
 public void remProfile(string name)
 {
     if (subProfiles.ContainsKey(name))
     {
         subProfiles.Remove(name);
     }
     else
     {
         SkillSettings.DoTell("SuperProfile does not contain profile " + name);
     }
 }
Exemple #16
0
 public BaseTMSkillItem(int itemid) : base(itemid)
 {
     try
     {
         this.Profile = (SuperSkillProfile)SkillProfileHelper.Supers[SkillSettings.CCProfileName];
         this.Skin    = ((TMSS4Skin)SkinHelper.getSkin(SkillSettings.CCSkinName)).SkinName;
     }
     catch (Exception e)
     { SkillSettings.DoTell("Exception in attempting to set profile: " + e); }
     this.ItemID = itemid;
 }
Exemple #17
0
 public BaseTMSkillItem()
 {
     try
     {
         this.Profile = (SuperSkillProfile)SkillProfileHelper.Supers[SkillSettings.CCProfileName];
         this.Skin    = ((TMSS4Skin)SkinHelper.getSkin(SkillSettings.CCSkinName)).SkinName;
     }
     catch (Exception e)
     { SkillSettings.DoTell("Exception in attempting to set profile: " + e); }
     m_AutoGenerated = false;
 }
 public SkillProfile getProfile(string name)
 {
     if (subProfiles.ContainsKey(name))
     {
         return((SkillProfile)subProfiles[name]);
     }
     else
     {
         SkillSettings.DoTell("No such profile: " + name); return(null);
     }
 }
        private int TranslateInt(int which)
        {
            try
            {
                if (which < miscinfos.Count)
                {
                    return(ParallelSkills.NameLocs[miscinfos[which - 1].Name]);
                }
                else
                {
                    which -= miscinfos.Count;
                }

                if (which < combinfos.Count)
                {
                    return(ParallelSkills.NameLocs[combinfos[which - 1].Name]);
                }
                else
                {
                    which -= combinfos.Count;
                }

                if (which < actiinfos.Count)
                {
                    return(ParallelSkills.NameLocs[actiinfos[which - 1].Name]);
                }
                else
                {
                    which -= actiinfos.Count;
                }

                if (which < loreinfos.Count)
                {
                    return(ParallelSkills.NameLocs[loreinfos[which - 1].Name]);
                }
                else
                {
                    which -= loreinfos.Count;
                }

                if (which < custom.Count)
                {
                    return(ParallelSkills.NameLocs[custom[which - 1].Name]);
                }
                else
                {
                    which -= custom.Count;
                }
            }
            catch (Exception e)
            { SkillSettings.DoTell("Error when translating the location: " + e); }
            return(0);
        }
        private void CommitSession()
        {
            Mobile m = Mobile;

            if (Profile.StatEnable)
            {
                m.Str = m_Stats["Strength"];
                m.Dex = m_Stats["Dexterity"];
                m.Int = m_Stats["Intelligence"];
            }
            if (Profile.SkillEnable)
            {
                if (!NoReset)
                {
                    ResetZero();
                }
                IEnumerator ie = SelectedSkills.GetEnumerator();
                while (ie.MoveNext())
                {
                    Dictionary <string, TMUsedInfo> inf = ((KeyValuePair <string, Dictionary <string, TMUsedInfo> >)ie.Current).Value;
                    IEnumerator subie = inf.GetEnumerator();
                    while (subie.MoveNext())
                    {
                        TMUsedInfo inf2 = ((KeyValuePair <string, TMUsedInfo>)subie.Current).Value;
                        SkillSettings.DoTell("Mobile: " + m + " Skills: " + m.Skills + " SkillID: " + inf2.SkillID + " SkillValue: " + inf2.SkillValue + " Skills[inf2.SkillID] " + m.Skills[inf2.SkillID]);
                        if (m != null && inf2.SkillValue != 0.0 && inf2.SkillID >= 0 && inf2.SkillID < m.Skills.Length)
                        {
                            m.Skills[inf2.SkillID].Base = inf2.SkillValue;
                            SkillSettings.DoTell("BLAH! " + inf2.SkillName);
                        }
                    }
                }
            }
            if (Profile.CapEnable)
            {
                IEnumerator ie = SelectedSkills.GetEnumerator();
                while (ie.MoveNext())
                {
                    Dictionary <string, TMUsedInfo> inf = ((KeyValuePair <string, Dictionary <string, TMUsedInfo> >)ie.Current).Value;
                    IEnumerator subie = inf.GetEnumerator();
                    while (subie.MoveNext())
                    {
                        TMUsedInfo inf2 = ((KeyValuePair <string, TMUsedInfo>)subie.Current).Value;
                        SkillSettings.DoTell("Mobile: " + m + " Skills: " + m.Skills + " SkillID: " + inf2.SkillID + " SkillValue: " + inf2.SkillValue + " Skills[inf2.SkillID] " + m.Skills[inf2.SkillID]);
                        if (m != null && inf2.SkillCap >= 0.0 && inf2.SkillID >= 0 && inf2.SkillID < m.Skills.Length)
                        {
                            m.Skills[inf2.SkillID].Cap = inf2.SkillCap;
                            SkillSettings.DoTell("BLAH! " + inf2.SkillName + "capped at: " + inf2.SkillCap);
                        }
                    }
                }
            }
        }
Exemple #21
0
 public static void DisablePlugin(string section)
 {
     try
     {
         PluginsEnabled.Remove(section);
         PluginsEnabled.Add(section, false);
     }
     catch (Exception e)
     {
         SkillSettings.DoTell("Invalid plugin specified. " + e);
     }
 }
 internal Dictionary <string, TMUsedInfo> HasSelectedItems(string p)
 {
     if (SelectedSkills.ContainsKey(p))
     {
         SkillSettings.DoTell("[G2G] SelectedSkills count: " + SelectedSkills.Count + " name: " + p);
         return(SelectedSkills[p]);
     }
     else
     {
         SkillSettings.DoTell("[NG] SelectedSkills count: " + SelectedSkills.Count + " name: " + p);
         return(new Dictionary <string, TMUsedInfo>());
     }
 }
Exemple #23
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write((int)5);             // version
            writer.Write((bool)HasProfileSet);
            SkillSettings.DoTell2("" + HasProfileSet);

            if (Profile != null && HasProfileSet)
            {
                writer.Write((string)Profile.ProfileName);
                SkillSettings.DoTell2("" + Profile.ProfileName);
            }
            writer.Write(Skin);
        }
Exemple #24
0
 private void Activate()
 {
     this.AddPage(1);
     //The heart of the matter. If a plugin is enabled...
     try
     {
         if ((bool)QueryPageHelper.PluginsEnabled[arg])
         {
             //Try to connect to the plugin's gump code repository.
             try
             {
                 string toAct = "Server.TMSS." + (string)QueryPageHelper.GumpCalls[arg];                        //+"."+ControlPageHelper.GumpCalls[num]+"()";
                 //SkillSettings.doTell( toAct );
                 ObjectHandle handle = Activator.CreateInstance(null, toAct);
                 TMPlugin     theObj = (TMPlugin)handle.Unwrap();
                 relplug  = theObj;
                 GumpType = relplug.getGumpType();
                 if (GumpType != "Underbar" && GumpType != "Master" && Mobile != null && Skin.HelpOn)
                 {
                     Dictionary <string, object> args = new Dictionary <string, object>();
                     args.Add("Skin", this.Skin);
                     args.Add("Mobile", Mobile);
                     args.Add("Get", relplug);
                     associatedHelpGump = new TMQueryPage("TMSS Session Help Gump", args);
                     //Mobile.SendGump(associatedHelpGump);
                 }
                 if (!(relplug is Gump))
                 {
                     BaseSkinByType(this);
                 }
                 theObj.GetGumpCode(this);
             }
             //If you can't, throw this exception.
             catch (Exception e)
             {
                 SkillSettings.DoTell("Plugin errors on use. Please report this error, and do not attempt to use: " + arg + " Exception: " + e);
             }
         }
         //If the plugin is NOT enabled...
         else
         {
             SkillSettings.DoTell("Plugin not enabled: " + arg);
         }
     }
     catch (Exception e)
     {
         SkillSettings.DoTell("Error while creating plugin info. Arg was: " + arg + ". Further info: " + e);
     }
 }
Exemple #25
0
 internal TMQueryPage Clone()
 {
     if (argDictionary != null)
     {
         return(new TMQueryPage(arg, argDictionary));
     }
     else if (Session != null)
     {
         return(new TMQueryPage(arg, Session));
     }
     else
     {
         SkillSettings.DoTell("Unable to clone page, neither argDictionary nor Session are valid.");     return(null);
     }
 }
Exemple #26
0
        public void OnResponse(NetState sender, RelayInfo info)
        {
            #region AccessLevel Check
            Mobile from = sender.Mobile;

            if (from.AccessLevel < SkillSettings.GumpControlLevel)
            {
                from.SendMessage("You don't have sufficient privileges to access that.");
                return;
            }
            #endregion

            if (info.ButtonID == 0)
            {
                Dictionary <string, object> args2 = new Dictionary <string, object>();
                args2.Add("Skin", sk);
                args2.Add("Mobile", from);
                from.SendGump(new TMQueryPage("Main Menu", args2));
            }
            if (info.IsSwitched(200))
            {
                SkillSettings.GumpControlLevel = levels[3];
                SkillSettings.DoTell("Administrator Access Level set.");
            }
            else if (info.IsSwitched(201))
            {
                SkillSettings.GumpControlLevel = levels[2];
            }
            else if (info.IsSwitched(202))
            {
                SkillSettings.GumpControlLevel = levels[1];
            }
            else if (info.IsSwitched(203))
            {
                SkillSettings.GumpControlLevel = levels[0];
            }
            else
            {
                SkillSettings.DoTell("Invalid Access Level.");
            }

            SkillSettings.DoTell("The following are the output of the Gump Settings control plugin: Gump Control Level: " + SkillSettings.GumpControlLevel);
            SaveSettings.SaveSkillSettings();
            Dictionary <string, object> args = new Dictionary <string, object>();
            args.Add("Skin", sk);
            args.Add("Mobile", from);
            from.SendGump(new TMQueryPage("Main Menu", args));
        }
Exemple #27
0
 public static void SkinSelect_OnCommand(CommandEventArgs e)
 {
     if (QueryPageHelper.PluginExists("TMSkinPage"))
     {
         SkillSettings.DoTell("Inside existing section.");
         Dictionary <string, object> args = new Dictionary <string, object>();
         args.Add("Skin", SkinHelper.getSkin(SkillSettings.CCSkinName));
         args.Add("Mobile", e.Mobile);
         TMQueryPage page = new TMQueryPage("TMSS Skin Selector", args);
         //e.Mobile.SendGump( page );
         SkillSettings.DoTell("Gump sent.");
     }
     else
     {
         SkillSettings.DoTell("Plugin does not exist.");
     }
 }
        public TMUsedInfo(string name, double value, double weight, int cap, int id)
        {
            if (name == "")
            {
                SkillSettings.SystemWrite("Invalid name.");
            }
            SkillName = name;

            SkillValue = value;
            if (weight <= 0)
            {
                SkillSettings.SystemWrite("Invalid weight.");
            }
            SkillWeight = weight;

            SkillCap = cap;
            SkillID  = id;
        }
Exemple #29
0
        public static int RegisterSection(string section, string name)
        {
            //SkillSettings.DoTell("Register 1 Called.");
            SkillSettings.DoTell2("Gump Registration - Registering Section: " + name + "...");

            GumpCalls.Add(name, section);
            PluginsEnabled.Add(name, true);
            GumpNames.Add(section, name);
            GumpIDs.Add(name, GumpCalls.Count - 1);
            //GumpCallsByID.Add( GumpCalls.Count-1, name );

            if (SkillSettings.DebugMode2)
            {
                Console.WriteLine(" done.");
            }

            return(GumpCalls.Count - 1);
        }
Exemple #30
0
 public Object GetValueSet()
 {
     if (Session != null && argDictionary == null)
     {
         return(Session);
     }
     else if (Session == null && argDictionary != null)
     {
         return(argDictionary);
     }
     else
     {
         bool sessval = Session == null ? true : false;
         bool argtval = argDictionary == null ? true : false;
         SkillSettings.DoTell("No valid value construct to return: " + sessval + ", " + argtval);
         return(null);
     }
 }