[Release]SaveHalos

01/19/2010 04:06 Arcо#1
Well since many are asking for it here it is.
Credits to me and whoever helped me with this.
I forgot who it was >.<
Well first you are going to OldCODB and make a folder called Tops.
In the folder create ten text files and name them each this:
TopWarrior
TopNinja
TopTrojan
TopArcher
TopWater
TopFire
TopLeader
TopDeputy
PkMonth
PkWeek

Before anything else go to the TOP of datbase.cs and insert this:
Code:
using NewestCOServer.Game;
After that go to database.cs and search for
Code:
Features.QuizShow.AllQuestions.Clear();
Under that next } put this.
Code:
        public static void LoadTopLeader(StatusEffectEn Value, Main.GameClient GC)
        {
            if (File.Exists(@"C:\OldCODB\Tops\TopLeader.txt"))
            {
                string[] AllLines = System.IO.File.ReadAllLines(@"C:\OldCODB\Tops\TopLeader.txt");
                int TopLeader = AllLines.Length;
                for (int x = 0; x < TopLeader; x++)
                {
                    string[] TopGuildLeaderz = AllLines[x].Split('#');
                    string CharID = TopGuildLeaderz[0];
                    string GuildHalo = TopGuildLeaderz[1];
                    if (TopGuildLeaderz.Contains(GC.MyChar.EntityID.ToString()) && CharID.Contains(GC.MyChar.EntityID.ToString()))
                    {
                        Program.WriteLine(GuildHalo); // A check if it reads it right.
                        if (GuildHalo == "17179869184")
                        GC.MyChar.StatEff.Add(StatusEffectEn.TopGuildLeader);
                    }
                }
            }
        }
        public static void LoadTopDeputy(StatusEffectEn Value, Main.GameClient GC)
        {
            if (File.Exists(@"C:\OldCODB\Tops\TopDeputy.txt"))
            {
                string[] AllLines = System.IO.File.ReadAllLines(@"C:\OldCODB\Tops\TopDeputy.txt");
                int TopDeputy = AllLines.Length;
                for (int x = 0; x < TopDeputy; x++)
                {
                    string[] TopGuildDeputyz = AllLines[x].Split('#');
                    string CharID = TopGuildDeputyz[0];
                    string DeputyHalo = TopGuildDeputyz[1];
                    if (TopGuildDeputyz.Contains(GC.MyChar.EntityID.ToString()) && CharID.Contains(GC.MyChar.EntityID.ToString()))
                    {
                        Program.WriteLine(DeputyHalo); // A check if it reads it right.
                        if (DeputyHalo == "34359738368")
                            GC.MyChar.StatEff.Add(StatusEffectEn.TopDeputyLeader);
                    }
                }
            }
        }
        public static void LoadPkWeek(StatusEffectEn Value, Main.GameClient GC)
        {
            if (File.Exists(@"C:\OldCODB\Tops\PkWeek.txt"))
            {
                string[] AllLines = System.IO.File.ReadAllLines(@"C:\OldCODB\Tops\PkWeek.txt");
                int PkWeek = AllLines.Length;
                for (int x = 0; x < PkWeek; x++)
                {
                    string[] WeeklyPK = AllLines[x].Split('#');
                    string CharID = WeeklyPK[0];
                    string WeekHalo = WeeklyPK[1];
                    if (WeeklyPK.Contains(GC.MyChar.EntityID.ToString()) && CharID.Contains(GC.MyChar.EntityID.ToString()))
                    {
                        Program.WriteLine(WeekHalo); // A check if it reads it right.
                        if (WeekHalo == "137438953472")
                            GC.MyChar.StatEff.Add(StatusEffectEn.WeeklyPKChampion);
                    }
                }
            }
        }
        public static void LoadTopTrojan(StatusEffectEn Value, Main.GameClient GC)
        {
            if (File.Exists(@"C:\OldCODB\Tops\TopTrojan .txt"))
            {
                string[] AllLines = System.IO.File.ReadAllLines(@"C:\OldCODB\Tops\TopTrojan.txt");
                int TopTrojan = AllLines.Length;
                for (int x = 0; x < TopTrojan; x++)
                {
                    string[] TopTro = AllLines[x].Split('#');
                    string CharID = TopTro[0];
                    string TroHalo = TopTro[1];
                    if (TopTro.Contains(GC.MyChar.EntityID.ToString()) && CharID.Contains(GC.MyChar.EntityID.ToString()))
                    {
                        Program.WriteLine(TroHalo); // A check if it reads it right.
                        if (TroHalo == "549755813888")
                            GC.MyChar.StatEff.Add(StatusEffectEn.TopTrojan);
                    }
                }
            }
        }
        public static void LoadTopWarrior(StatusEffectEn Value, Main.GameClient GC)
        {
            if (File.Exists(@"C:\OldCODB\Tops\TopWarrior.txt"))
            {
                string[] AllLines = System.IO.File.ReadAllLines(@"C:\OldCODB\Tops\TopWarrior.txt");
                int TopWarrior = AllLines.Length;
                for (int x = 0; x < TopWarrior; x++)
                {
                    string[] TopWar = AllLines[x].Split('#');
                    string CharID = TopWar[0];
                    string WarHalo = TopWar[1];
                    if (TopWar.Contains(GC.MyChar.EntityID.ToString()) && CharID.Contains(GC.MyChar.EntityID.ToString()))
                    {
                        Program.WriteLine(WarHalo); // A check if it reads it right.
                        if (WarHalo == "274877906944")
                            GC.MyChar.StatEff.Add(StatusEffectEn.TopWarrior);
                    }
                }
            }
        }
        public static void LoadTopArcher(StatusEffectEn Value, Main.GameClient GC)
        {
            if (File.Exists(@"C:\OldCODB\Tops\TopArcher.txt"))
            {
                string[] AllLines = System.IO.File.ReadAllLines(@"C:\OldCODB\Tops\TopArcher.txt");
                int TopArcher = AllLines.Length;
                for (int x = 0; x < TopArcher; x++)
                {
                    string[] TopArch = AllLines[x].Split('#');
                    string CharID = TopArch[0];
                    string ArchHalo = TopArch[1];
                    if (TopArch.Contains(GC.MyChar.EntityID.ToString()) && CharID.Contains(GC.MyChar.EntityID.ToString()))
                    {
                        Program.WriteLine(ArchHalo); // A check if it reads it right.
                        if (ArchHalo == "1099511627776")
                            GC.MyChar.StatEff.Add(StatusEffectEn.TopArcher);
                    }
                }
            }
        }
        public static void LoadTopNinja(StatusEffectEn Value, Main.GameClient GC)
        {
            if (File.Exists(@"C:\OldCODB\Tops\TopNinja.txt"))
            {
                string[] AllLines = System.IO.File.ReadAllLines(@"C:\OldCODB\Tops\TopNinja.txt");
                int TopNinja = AllLines.Length;
                for (int x = 0; x < TopNinja; x++)
                {
                    string[] TopNin = AllLines[x].Split('#');
                    string CharID = TopNin[0];
                    string NinHalo = TopNin[1];
                    if (TopNin.Contains(GC.MyChar.EntityID.ToString()) && CharID.Contains(GC.MyChar.EntityID.ToString()))
                    {
                        Program.WriteLine(NinHalo); // A check if it reads it right.
                        if (NinHalo == "8796093022208")
                            GC.MyChar.StatEff.Add(StatusEffectEn.TopNinja);
                    }
                }
            }
        }
        public static void LoadTopFire(StatusEffectEn Value, Main.GameClient GC)
        {
            if (File.Exists(@"C:\OldCODB\Tops\TopFire.txt"))
            {
                string[] AllLines = System.IO.File.ReadAllLines(@"C:\OldCODB\Tops\TopFire.txt");
                int TopFire = AllLines.Length;
                for (int x = 0; x < TopFire; x++)
                {
                    string[] TopFirez = AllLines[x].Split('#');
                    string CharID = TopFirez[0];
                    string FireHalo = TopFirez[1];
                    if (TopFirez.Contains(GC.MyChar.EntityID.ToString()) && CharID.Contains(GC.MyChar.EntityID.ToString()))
                    {
                        Program.WriteLine(FireHalo); // A check if it reads it right.
                        if (FireHalo == "4398046511104")
                            GC.MyChar.StatEff.Add(StatusEffectEn.TopFireTaoist);
                    }
                }
            }
        }
        public static void LoadTopWater(StatusEffectEn Value, Main.GameClient GC)
        {
            if (File.Exists(@"C:\OldCODB\Tops\TopWater.txt"))
            {
                string[] AllLines = System.IO.File.ReadAllLines(@"C:\OldCODB\Tops\TopWater.txt");
                int TopWater = AllLines.Length;
                for (int x = 0; x < TopWater; x++)
                {
                    string[] TopWaterz = AllLines[x].Split('#');
                    string CharID = TopWaterz[0];
                    string WaterHalo = TopWaterz[1];
                    if (TopWaterz.Contains(GC.MyChar.EntityID.ToString()) && CharID.Contains(GC.MyChar.EntityID.ToString()))
                    {
                        Program.WriteLine(WaterHalo); // A check if it reads it right.
                        if (WaterHalo == "2199023255552")
                            GC.MyChar.StatEff.Add(StatusEffectEn.TopWaterTaoist);
                    }
                }
            }
        }

Now go to teleport.cs and search for
Code:
if (Game.World.KOBoard[0].Name == GC.MyChar.Name)
And above that put:
Code:
                  Game.StatusEffect StatusEffect = new NewestCOServer.Game.StatusEffect(GC.MyChar);
                  Database.LoadTopLeader(StatusEffect.Value, GC);
                  Database.LoadTopDeputy(StatusEffect.Value, GC);
                  Database.LoadTopArcher(StatusEffect.Value, GC);
                  Database.LoadTopWarrior(StatusEffect.Value, GC);
                  Database.LoadTopTrojan(StatusEffect.Value, GC);
                  Database.LoadTopNinja(StatusEffect.Value, GC);
                  Database.LoadTopFire(StatusEffect.Value, GC);
                  Database.LoadTopWater(StatusEffect.Value, GC);
Here is an example of how to use these saves:
Code:
                            #region GWArenaNPC
                            case 380:
                                {
                                    if (Linkback == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Do you want enter the guild arena?"));
                                        GC.AddSend(Packets.NPCLink("Yes.", 1));
                                        GC.AddSend(Packets.NPCLink("I am the winning Guild Leader!", 2));
                                        GC.AddSend(Packets.NPCLink("But I'm a Deputy Leader and I want the Deputy Leader Halo.", 3));
                                        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    else if (Linkback == 1)
                                    {
                                        GC.MyChar.Teleport(1038, 350, 350);
                                    }
                                    else if (Linkback == 2)
                                    {
                                        if (GC.MyChar.MyGuild == Features.GuildWars.LastWinner && (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader))
                                        {

                                            GC.MyChar.CPs += 4500;
                                            World.SendMsgToAll("SYSTEM", GC.MyChar.Name + " has claimed 4500 CPs and the TopGuildLeader Halo for winning GuildWar!", 2011, 0);

                                            GC.MyChar.StatEff.Add(StatusEffectEn.TopGuildLeader); 
                                            try
                                            {
                                                StreamWriter sw = new StreamWriter("C:\\OldCODB/Tops/TopLeader.txt");
                                                sw.WriteLine("" + GC.MyChar.EntityID + "#17179869184");
                                                sw.Close();
                                            }
                                            catch (Exception e)
                                            {
                                                Console.WriteLine(e.Message);
                                            }
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You already claimed your 4500 cps! Get out of here!"));
                                            GC.AddSend(Packets.NPCLink("Sorry", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else
                                    {
                                        GC.AddSend(Packets.NPCSay("You are not in the Top Guild!"));
                                        GC.AddSend(Packets.NPCLink("Oh sorry", 255));
                                        GC.AddSend(Packets.NPCSetFace(30));
                                        GC.AddSend(Packets.NPCFinish());
                                    }

                                    if (Linkback == 3)
                                    {
                                        if (GC.MyChar.MyGuild == Features.GuildWars.LastWinner && (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.DeputyManager))
                                        {
                                            World.SendMsgToAll("SYSTEM", GC.MyChar.Name + " has claimed the TopDeputyLeader Halo!", 2011, 0);
                                            GC.MyChar.StatEff.Add(StatusEffectEn.TopDeputyLeader);
                                            try
                                            {
                                                // Now it should work 100%
                                                StreamWriter sw = new StreamWriter("C:\\OldCODB/Tops/TopDeputy.txt");
                                                sw.WriteLine("" + GC.MyChar.EntityID + "#34359738368");
                                                sw.Close();
                                            }
                                            catch (Exception e)
                                            {
                                                Console.WriteLine(e.Message);
                                            }
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not in the Top Guild!"));
                                            GC.AddSend(Packets.NPCLink("Oh sorry", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    break;
                                }
                                    
                                
                            #endregion
And there is save haloes!
Enjoy!
Btw:One problem!
Cannot save more than one TopDLHalo.
01/19/2010 04:11 Zestro#2
If you wanna be a fucking dick i'll remove my thanks
#removed
01/19/2010 04:15 copz1337#3
<3
01/19/2010 04:17 Arcо#4
Quote:
Originally Posted by copz1337 View Post
<3
Lol waiting for this one weren't ya?
01/19/2010 04:22 copz1337#5
Quote:
Originally Posted by Hepatitis C View Post
Lol waiting for this one weren't ya?
Don't know tbh, anyway im getting error after error lol
01/19/2010 04:23 Arcо#6
#reported,
Please keep off topic stuff off of a thread and keep it in pms.
When're you gonna learn?
01/19/2010 04:24 Arcо#7
Quote:
Originally Posted by copz1337 View Post
im sure you enjoyed that.
What errors are you getting exactly.
01/19/2010 04:26 Arcо#8
Eh, dun feel like gettin infracted just yet:]
01/19/2010 04:27 copz1337#9
Quote:
Originally Posted by Hepatitis C View Post
What errors are you getting exactly.
Er can't explain lol, want to tv?
01/19/2010 04:28 Arcо#10
Quote:
Originally Posted by copz1337 View Post
Er can't explain lol, want to tv?

Don't got tv on this comp.
Can't dl anything.
Can't even do msn.
Try to explain the best you can.
01/19/2010 04:39 copz1337#11
i'll do this tomorrow i g2g right now. nice release.
01/19/2010 04:41 Arcо#12
Quote:
Originally Posted by copz1337 View Post
i'll do this tomorrow i g2g right now. nice release.
Alright just message me with whatever problems you are facing and I surely will help you out :]

Quote:
Originally Posted by Zestro View Post
#reported
Spam
Lol'd.
01/19/2010 05:10 gulpi_de_gulat#13
very good bro i like this :P
01/19/2010 05:37 Arcо#14
Quote:
Originally Posted by gulpi_de_gulat View Post
very good bro i like this :P
Thanks:]
Glad you like it:]
01/19/2010 07:32 NoFatChicks#15
Quote:
Originally Posted by Hepatitis C View Post

Enjoy!


Thank you. The first two steps make some errors shows up:


-First (database.cs).. the void to put under> Features.QuizShow.AllQuestions.Clear();
basicaly the errors was about theese lines (all halos):

GC.MyChar.StatEff.Add(StatusEffectEn.TopDeputyLead er);

it says the "StatusEffectEn" is incorrect, something like it.

-Second (telport.cs).. the lines to put above> if (Game.World.KOBoard[0].Name == GC.MyChar.Name)
here error too.. says some words on lines are incorrect(in all lines)



I created the folders and replaced the guild director code for urs and as far i tested its saving the top GL and GL halos (sure, DL only one saving)

Note: the source source i use isnt urs so thats can be the reason of the errors i listed cuz i noted in teleport.cs for example.. above that line is alredy a code with lines similars to urs.


Anyway, Thanks for it. Helpful release.