Esempio n. 1
0
 public static void ReadAccountNode(XmlElement parent)
 {
     Console.Write("  Account: {0}... ", parent.GetAttribute("Username"));
     try
     {
         SR_RuneAccount acc = new SR_RuneAccount(parent.GetAttribute("Username"));
         if (parent.HasChildNodes)
         {
             XmlElement child = parent.FirstChild as XmlElement;
             acc.AddRune(ReadRuneNode(child));
             while (child.NextSibling != null)
             {
                 child = child.NextSibling as XmlElement;
                 acc.AddRune(ReadRuneNode(child));
             }
             /*foreach( XmlElement child in parent.GetElementsByTagName("Runebook") )
             if( child != null )
             acc.AddRune(ReadRunebookNode(child));
             foreach( XmlElement child in parent.GetElementsByTagName("Rune") )
             if( child != null )
             acc.AddRune(ReadRuneNode(child));*/
         }
     }
     catch
     {
         Console.WriteLine("failed.");
     }
     Console.WriteLine("done.");
 }
Esempio n. 2
0
        public static void ReadAccountNode(XmlElement parent)
        {
            Console.Write("  Account: {0}... ", parent.GetAttribute("Username"));
            try
            {
                SR_RuneAccount acc = new SR_RuneAccount(parent.GetAttribute("Username"));
                if (parent.HasChildNodes)
                {
                    XmlElement child = parent.FirstChild as XmlElement;
                    acc.AddRune(ReadRuneNode(child));
                    while (child.NextSibling != null)
                    {
                        child = child.NextSibling as XmlElement;
                        acc.AddRune(ReadRuneNode(child));
                    }

                    /*foreach( XmlElement child in parent.GetElementsByTagName("Runebook") )
                     * if( child != null )
                     * acc.AddRune(ReadRunebookNode(child));
                     * foreach( XmlElement child in parent.GetElementsByTagName("Rune") )
                     * if( child != null )
                     * acc.AddRune(ReadRuneNode(child));*/
                }
            }
            catch
            {
                Console.WriteLine("failed.");
            }
            Console.WriteLine("done.");
        }
Esempio n. 3
0
        public static void NewRuneAcc(SR_RuneAccount acc)
        {
            acc.Clear();

            acc.AddRune(AddTree(GoGump.Felucca, Map.Felucca));
            acc.AddRune(AddTree(GoGump.Trammel, Map.Trammel));
            acc.AddRune(AddTree(GoGump.Ilshenar, Map.Ilshenar));
        }
Esempio n. 4
0
        public static void AddInfo(SR_RuneAccount runeAccount)
        {
            for (int i = 0; i < Info.Count; i++)
                if (Info[i].Username == runeAccount.Username)
                    Info.RemoveAt(i);

            Info.Add(runeAccount);
        }
Esempio n. 5
0
        public static void WriteAccountNode(SR_RuneAccount a, XmlTextWriter xml)
        { 
            xml.WriteStartElement("RuneAccount");

            xml.WriteAttributeString("Username", a.Username);
            for (int i = 0; i < a.Count; i++)
                WriteRuneNode(a.Runes[i], xml);

            xml.WriteEndElement();
        }
Esempio n. 6
0
        public static void NewRuneAcc(SR_RuneAccount acc)
        {
            acc.Clear();

            acc.AddRune(AddTree(GoGump.Felucca, Map.Felucca));
            acc.AddRune(AddTree(GoGump.Trammel, Map.Trammel));
            acc.AddRune(AddTree(GoGump.Ilshenar, Map.Ilshenar));
            acc.AddRune(AddTree(GoGump.Malas, Map.Malas));
            acc.AddRune(AddTree(GoGump.Tokuno, Map.Tokuno));
            //acc.AddRune( AddTree( GoGump.TerMur, Map.TerMur ) );
        }
Esempio n. 7
0
        public static void WriteAccountNode(SR_RuneAccount a, XmlTextWriter xml)
        {
            xml.WriteStartElement("RuneAccount");

            xml.WriteAttributeString("Username", a.Username);
            for (int i = 0; i < a.Count; i++)
            {
                WriteRuneNode(a.Runes[i], xml);
            }

            xml.WriteEndElement();
        }
Esempio n. 8
0
        public static void AddInfo(SR_RuneAccount runeAccount)
        {
            for (int i = 0; i < Info.Count; i++)
            {
                if (Info[i].Username == runeAccount.Username)
                {
                    Info.RemoveAt(i);
                }
            }

            Info.Add(runeAccount);
        }
Esempio n. 9
0
        public SR_Gump( SR_RuneAccount runeAcc )
            : base(0, 27)
        {
            RuneAcc = runeAcc;

            int count = 0;
            if( RuneAcc.ChildRune == null )
                count = RuneAcc.Count;
            else
                count = RuneAcc.ChildRune.Count;

            int RunebooksH = 0,
                RunebooksW = 0;

            int tier = -1;
            if( RuneAcc.ChildRune != null )
                tier = RuneAcc.ChildRune.Tier;

            if( tier > -1 )
            {
                if( tier == 0 )
                {
                    RunebooksH = 42;
                    RunebooksW = 278;
                }
                else
                {
                    RunebooksH = 37 + 42;
                    RunebooksW = 278 + (tier*5);
                }
            }

            int RunesH = 10*2;

            if( count > 10 )
                count = 10;
            if( count > 0 )
                RunesH += (count*22);
            if( count > 1 )
                RunesH += ((count-1)*5);

            DisplayHeader();
            if( tier > -1 )
                DisplayRunebooks( 42, RunebooksH, RunebooksW, tier );
            DisplayAddNew( 42 + RunebooksH + RunesH );
            DisplayRunes( 42 + RunebooksH, RunesH );
        }
Esempio n. 10
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Joeku's Staff Runebook: Loading...");
            Console.WriteLine("  Migrating data from version 1.00... ");
            int count = reader.ReadInt();

            for (int i = 0; i < count; i++)
            {
                SR_RuneAccount.Deserialize(reader, version);
            }
            Console.WriteLine();

            this.Delete();
        }
Esempio n. 11
0
        public static SR_RuneAccount FetchInfo( string username )
        {
            SR_RuneAccount runeAcc = null;

            for( int i = 0; i < SR_Main.Count; i++ )
                if( SR_Main.Info[i].Username == username )
                {
                    runeAcc = SR_Main.Info[i];
                    break;
                }

            if( runeAcc == null )
            {
                runeAcc = new SR_RuneAccount( username );
                NewRuneAcc( runeAcc );
            }

            return runeAcc;
        }
Esempio n. 12
0
        public static SR_RuneAccount FetchInfo(string username)
        {
            SR_RuneAccount runeAcc = null;

            for (int i = 0; i < SR_Main.Count; i++)
            {
                if (SR_Main.Info[i].Username == username)
                {
                    runeAcc = SR_Main.Info[i];
                    break;
                }
            }

            if (runeAcc == null)
            {
                runeAcc = new SR_RuneAccount(username);
                NewRuneAcc(runeAcc);
            }

            return(runeAcc);
        }
Esempio n. 13
0
 public static void Send(Mobile mob, SR_RuneAccount runeAcc)
 {
     mob.CloseGump(typeof(SR_Gump));
     mob.SendGump(new SR_Gump(runeAcc));
 }
Esempio n. 14
0
        public SR_Gump(SR_RuneAccount runeAcc)
            : base(0, 27)
        {
            this.RuneAcc = runeAcc;

            int count = 0;

            if (this.RuneAcc.ChildRune == null)
            {
                count = this.RuneAcc.Count;
            }
            else
            {
                count = this.RuneAcc.ChildRune.Count;
            }

            int RunebooksH = 0,
                RunebooksW = 0;

            int tier = -1;

            if (this.RuneAcc.ChildRune != null)
            {
                tier = this.RuneAcc.ChildRune.Tier;
            }

            if (tier > -1)
            {
                if (tier == 0)
                {
                    RunebooksH = 42;
                    RunebooksW = 278;
                }
                else
                {
                    RunebooksH = 37 + 42;
                    RunebooksW = 278 + (tier * 5);
                }
            }

            int RunesH = 10 * 2;

            if (count > 10)
            {
                count = 10;
            }
            if (count > 0)
            {
                RunesH += (count * 22);
            }
            if (count > 1)
            {
                RunesH += ((count - 1) * 5);
            }

            this.DisplayHeader();
            if (tier > -1)
            {
                this.DisplayRunebooks(42, RunebooksH, RunebooksW, tier);
            }
            this.DisplayAddNew(42 + RunebooksH + RunesH);
            this.DisplayRunes(42 + RunebooksH, RunesH);
        }
Esempio n. 15
0
 public SR_NewRuneTarget(SR_RuneAccount runeAcc) : base(12, true, TargetFlags.None)
 {
     RuneAcc = runeAcc;
 }
Esempio n. 16
0
 public SR_NewRuneTarget(SR_RuneAccount runeAcc)
     : base(12, true, TargetFlags.None)
 {
     this.RuneAcc = runeAcc;
 }
Esempio n. 17
0
 public SR_NewRunePrompt(SR_RuneAccount runeAcc)
 {
     this.RuneAcc = runeAcc;
     this.IsRunebook = true;
 }
Esempio n. 18
0
 public static void Send( Mobile mob, SR_RuneAccount runeAcc )
 {
     mob.CloseGump( typeof( SR_Gump ) );
     mob.SendGump( new SR_Gump( runeAcc ) );
 }
Esempio n. 19
0
		public SR_NewRunePrompt( SR_RuneAccount runeAcc )
		{
			RuneAcc = runeAcc;
			IsRunebook = true;
		}
Esempio n. 20
0
        public static void NewRuneAcc( SR_RuneAccount acc )
        {
            acc.Clear();

            acc.AddRune( AddTree( GoGump.Felucca, Map.Felucca ) );
            acc.AddRune( AddTree( GoGump.Trammel, Map.Trammel ) );
            acc.AddRune( AddTree( GoGump.Ilshenar, Map.Ilshenar ) );
            acc.AddRune( AddTree( GoGump.Malas, Map.Malas ) );
            acc.AddRune( AddTree( GoGump.Tokuno, Map.Tokuno ) );
            acc.AddRune( AddTree( GoGump.TerMur, Map.TerMur ) );
        }
Esempio n. 21
0
		public SR_NewRunePrompt( SR_RuneAccount runeAcc, Point3D targetLoc, Map targetMap )
		{
			RuneAcc = runeAcc;
			TargetLoc = targetLoc;
			TargetMap = targetMap;
		}
Esempio n. 22
0
 public SR_NewRunePrompt(SR_RuneAccount runeAcc)
 {
     this.RuneAcc    = runeAcc;
     this.IsRunebook = true;
 }
Esempio n. 23
0
 public SR_NewRunePrompt(SR_RuneAccount runeAcc, Point3D targetLoc, Map targetMap)
 {
     this.RuneAcc   = runeAcc;
     this.TargetLoc = targetLoc;
     this.TargetMap = targetMap;
 }
Esempio n. 24
0
        public SR_Gump(Mobile m, SR_RuneAccount runeAcc)
            : base(0, 27)
        {
            RuneAcc = runeAcc;

            int count = 0;

            if (RuneAcc.ChildRune == null)
            {
                count = RuneAcc.Count;
            }
            else
            {
                count = RuneAcc.ChildRune.Count;
            }

            int RunebooksH = 0,
                RunebooksW = 0;

            int tier = -1;

            if (RuneAcc.ChildRune != null)
            {
                tier = RuneAcc.ChildRune.Tier;
            }

            if (tier > -1)
            {
                if (tier == 0)
                {
                    RunebooksH = 42;
                    RunebooksW = 278;
                }
                else
                {
                    RunebooksH = 37 + 42;
                    RunebooksW = 278 + (tier * 5);
                }
            }

            int RunesH = 10 * 2;

            if (count > 10)
            {
                count = 10;
            }
            if (count > 0)
            {
                RunesH += (count * 22);
            }
            if (count > 1)
            {
                RunesH += ((count - 1) * 5);
            }

            DisplayHeader();

            int labelHue = m != null && m.NetState != null && m.NetState.IsEnhancedClient ? 2101 : 2100;

            if (tier > -1)
            {
                DisplayRunebooks(42, RunebooksH, RunebooksW, tier, labelHue);
            }

            DisplayAddNew(42 + RunebooksH + RunesH, labelHue);
            DisplayRunes(42 + RunebooksH, RunesH, labelHue);
        }
 public SR_NewRunePrompt(SR_RuneAccount runeAcc)
 {
     RuneAcc    = runeAcc;
     IsRunebook = true;
 }