Exemple #1
0
 public BaseTMSkillTicket(Mobile owner)
     : base("A Skill Ticket")
 {
     this.ItemID  = 0x14F0;
     this.Profile = (SuperSkillProfile)SkillProfileHelper.getProfile(SkillSettings.CCProfileName);
     this.Skin    = SkillSettings.CCSkinName;
     this.Owner   = owner;
 }
        public void addProfile(string name)
        {
            if (subProfiles.ContainsKey(name))
            {
                subProfiles.Remove(name);
            }

            subProfiles.Add(name, SkillProfileHelper.getProfile(name));
        }
Exemple #3
0
        internal static TMSkillSession SessionGenerate(CommandEventArgs e)
        {
            BaseTMSkillItem item = new BaseTMSkillItem(1001);

            item.Profile = (SuperSkillProfile)SkillProfileHelper.getProfile(SkillSettings.CCProfileName);
            item.Skin    = CCSkinName;
            TMSkillSession Session = new TMSkillSession(e.Mobile, item);

            return(Session);
        }
Exemple #4
0
 public static void SessionTest_OnCommand(CommandEventArgs e)
 {
     if (QueryPageHelper.PluginExists("TMMaster"))
     {
         BaseTMSkillItem item = new BaseTMSkillItem(1001);
         item.Profile = (SuperSkillProfile)SkillProfileHelper.getProfile(SkillSettings.CCProfileName);
         item.Skin    = CCSkinName;
         TMSkillSession Session = new TMSkillSession(e.Mobile, item);
     }
 }
Exemple #5
0
        public static void SkillSession_OnCommand(CommandEventArgs e)
        {
            BaseTMSkillItem item = new BaseTMSkillItem(0xedd);

            item.Profile = (SuperSkillProfile)SkillProfileHelper.getProfile("defaultInternal");
            item.Skin    = CCSkinName;
            TMSkillSession session = new TMSkillSession(e.Mobile, item);

            session.Start();
        }
        public static void SaveSelf(SuperSkillProfile profile)
        {
            if (!Directory.Exists("TMSS/SkillProfiles"))
            {
                Directory.CreateDirectory("TMSS/SkillProfiles");
            }

            string FileName = profile.ProfileName + ".spr";

            string path = @"TMSS/SkillProfiles/[SUPER]" + FileName;

            if (File.Exists(path))
            {
                File.Delete(path);
            }
            DateTime start = DateTime.Now;
            bool     G     = !File.Exists(path);

            Console.Write(" - Saving TMSS Super Skill Profile " + profile.ProfileName + "...");
            XmlWriterSettings settings = new XmlWriterSettings();

            settings.Indent      = true;
            settings.IndentChars = "	";

            XmlWriter write = XmlWriter.Create(path, settings);

            //Writing
            write.WriteStartElement("TMSuperProfile");
            IEnumerator val = profile.getProfileList();

            write.WriteStartElement("ProfileName");
            write.WriteValue(profile.ProfileName);
            write.WriteEndElement();

            write.WriteStartElement("Count");
            write.WriteValue(profile.subProfiles.Count);
            write.WriteEndElement();

            while (val.MoveNext())
            {
                write.WriteStartElement("SubProfile");
                write.WriteValue(((KeyValuePair <string, SkillProfile>)val.Current).Value.ProfileName);
                write.WriteEndElement();
            }
            write.WriteEndElement();
            write.Close();
            SkillProfileHelper.SkillProfileSaver(profile);
            Console.WriteLine("done");
        }
Exemple #7
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;
     }
 }
Exemple #8
0
        public override void Deserialize(GenericReader reader)
        {
            try
            {
                base.Deserialize(reader);
                int version = reader.ReadInt();

                if (version == 5)
                {
                    HasProfileSet = reader.ReadBool();
                    SkillSettings.DoTell2("" + HasProfileSet);

                    if (HasProfileSet)
                    {
                        string temp = reader.ReadString();
                        if (temp != null)
                        {
                            SkillSettings.DoTell2(temp);
                            if (SkillProfileHelper.ProfileExists(temp))
                            {
                                Profile = (SuperSkillProfile)SkillProfileHelper.getProfile(temp);
                            }
                        }
                        else
                        {
                            HasProfileSet = false;
                        }
                    }
                    Skin = reader.ReadString();
                }
                else
                {
                    SkillSettings.DoTell2("Version is unknown.");
                }
            }
            catch (Exception e)
            {
                SkillSettings.DoTell("W. T. F. " + e);
            }
        }
        public static void LoadSelf(FileInfo fileName)
        {
            string path = fileName.FullName;

            if (!File.Exists(path))
            {
                Console.WriteLine("ERROR: Super Profile Not Found "); return;
            }

            XmlReaderSettings settings = new XmlReaderSettings();
            XmlReader         read     = XmlReader.Create(path, settings);

            read.ReadStartElement("TMSuperProfile");

            read.ReadStartElement("ProfileName");
            string name = read.ReadContentAsString();

            read.ReadEndElement();
            SkillSettings.SystemWrite("Loading SuperProfile " + name);
            SuperSkillProfile profile = new SuperSkillProfile(name);

            read.ReadStartElement("Count");
            int count = read.ReadContentAsInt();

            read.ReadEndElement();
            int curr = 0;

            while (curr < count)
            {
                read.ReadStartElement("SubProfile");
                profile.addProfile((string)read.ReadContentAsString());                //.ReadContentAsString());
                read.ReadEndElement();
                curr++;
            }
            read.ReadEndElement();
            read.Close();
            SkillProfileHelper.SkillProfileLoader(profile.ProfileName, false);
            RegisterSuperProfile(profile);
        }
Exemple #10
0
        //This is a major method that runs *gasp!* once, during the first compile of TMSS 4.0
        public static void RunOnce()
        {
            Console.WriteLine(" - //4// - Beginning Setup.");
            if (!HasRun)
            {
                #region Gumps
                GumpControlLevel = AccessLevel.GameMaster;
                AdminAccessLevel = AccessLevel.Administrator;
                #endregion

                #region Hues

                //*************************************
                //Hue Settings:------------------------
                //*************************************

                //This sets the color for all basic TM Skill System items.
                //Default: 0x60 (light blue)
                SkillHue = 0x60;

                //This sets the color for all Stat-related special TM SkillSystem items
                //default: 0x483 (green tailor BOD color)
                StatHue = 0x483;

                //This sets the color for the CenterStone item.
                //Default: 1153 (white)
                CenterHue = 1153;

                //END hue settings *******************

                #endregion

                #region CC

                //******************************************
                //Don't change this. This is the "safe" name.
                CCProfileName   = "Default Profile";
                CCSkinName      = "Unnamed Skin";
                ControlSkinName = "Unnamed Skin";
                //******End Central Control Settings****************//
                #endregion

                #region Messages

                //***********************************
                //Message Settings===================
                //***********************************
                //This is your shard's name
                //default: ????
                //******************************************************
                //IF YOU SET THIS, YOU MUST ALSO SET ITS BOOL TO TRUE!!!
                //******************************************************
                try
                {
                    ShardName = Server.Misc.ServerList.ServerName;
                }
                catch (Exception e)
                {
                    ShardName = "TMSS //4// Enabled Shard!";
                    SkillSettings.DoTell(" Problem getting Shard Name: " + e);
                }
                //The bool that prints your shard.
                //default: false
                IsSharded = false;


                //This message is sent to a user that attempts to use a skillticket that is not theirs.
                //default: "This is not your ticket. Shame on you! You have to use your ticket."
                NotYoursMessage = "This is not your ticket. Shame on you! You have to use your ticket.";

                //This message is sent to an owner that double-clicks their ticket.
                //default: "This is a Skill Ticket. Use a Skill Stone to get your skills."
                HowToUseMessage = "This is a Skill Ticket. Use a Skill Stone to get your skills.";

                //This message is sent to a user that doesn't have a skillticket on a skillstone use attempt.
                //default: "You need a Skill Ticket to use that."
                NoTicketMessage = "You need a Skill or Cap Ticket to use that.";
                //These are the messages for Shard and NoShard above.
                Shard   = "Welcome to " + ShardName + ". This will help you set your skills.";
                NoShard = "Welcome. This ticket will help you set your skills.";

                //END newbie message settings *********

                #endregion

                #region Finalization
                SkillProfileHelper.GenInitialProfile();
                GenerateDefaultSkin(CCSkinName);
                SkinHelper.LoadSkin(CCSkinName, typeof(TMSS4Skin), true);
                SkinHelper.LoadSkin("Skill Skin", typeof(SkillSkin), true);
                HasRun = true;
                SaveSettings.SaveSkillSettings();
                #endregion
            }
            else
            {
                return;
            }
        }
Exemple #11
0
 public static void ProfileReload_OnCommand(CommandEventArgs e)
 {
     SkillProfileHelper.SkillProfileInitializer();
 }
 internal static void RegisterSuperProfile(SuperSkillProfile sprofile)
 {
     //SuperProfileHelper.SaveSelf(sprofile);
     SkillProfileHelper.AddNewProfile(sprofile, true);
 }
Exemple #13
0
 public BaseTMSkillTicket(string name) : base(name)
 {
     this.ItemID  = 0x14F0;
     this.Profile = (SuperSkillProfile)SkillProfileHelper.getProfile(SkillSettings.CCProfileName);
     this.Skin    = SkillSettings.CCSkinName;
 }
Exemple #14
0
 public BaseTMSkillTicket(int itemid) : base(itemid)
 {
     this.ItemID  = itemid;
     this.Profile = (SuperSkillProfile)SkillProfileHelper.getProfile(SkillSettings.CCProfileName);
     this.Skin    = SkillSettings.CCSkinName;
 }
Exemple #15
0
 public virtual int getProfile( )
 {
     return(SkillProfileHelper.getProfileID(Profile.ProfileName));
 }
Exemple #16
0
 public virtual void setProfile(string profile)
 {
     Profile            = (SuperSkillProfile)SkillProfileHelper.getProfile(profile);
     this.HasProfileSet = true;
 }