Register for your free account! | Forgot your password?

You last visited: Today at 11:21

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release]SaveHalos

Discussion on [Release]SaveHalos within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
[Release]SaveHalos

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.
Arcо is offline  
Thanks
29 Users
Old 01/19/2010, 04:11   #2
 
elite*gold: 0
Join Date: Jan 2010
Posts: 7
Received Thanks: 0
If you wanna be a ******* **** i'll remove my thanks
#removed
Zestro is offline  
Old 01/19/2010, 04:15   #3
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
<3
copz1337 is offline  
Old 01/19/2010, 04:17   #4
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
Quote:
Originally Posted by copz1337 View Post
<3
Lol waiting for this one weren't ya?
Arcо is offline  
Thanks
3 Users
Old 01/19/2010, 04:22   #5
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
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
copz1337 is offline  
Old 01/19/2010, 04:23   #6
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
#reported,
Please keep off topic stuff off of a thread and keep it in pms.
When're you gonna learn?
Arcо is offline  
Thanks
2 Users
Old 01/19/2010, 04:24   #7
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
Quote:
Originally Posted by copz1337 View Post
im sure you enjoyed that.
What errors are you getting exactly.
Arcо is offline  
Thanks
2 Users
Old 01/19/2010, 04:26   #8
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
Eh, dun feel like gettin infracted just yet:]
Arcо is offline  
Thanks
2 Users
Old 01/19/2010, 04:27   #9
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Quote:
Originally Posted by Hepatitis C View Post
What errors are you getting exactly.
Er can't explain lol, want to tv?
copz1337 is offline  
Old 01/19/2010, 04:28   #10
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
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.
Arcо is offline  
Thanks
2 Users
Old 01/19/2010, 04:39   #11
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
i'll do this tomorrow i g2g right now. nice release.
copz1337 is offline  
Old 01/19/2010, 04:41   #12
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
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.
Arcо is offline  
Thanks
2 Users
Old 01/19/2010, 05:10   #13
 
gulpi_de_gulat's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 71
Received Thanks: 40
very good bro i like this :P
gulpi_de_gulat is offline  
Old 01/19/2010, 05:37   #14
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
Quote:
Originally Posted by gulpi_de_gulat View Post
very good bro i like this :P
Thanks:]
Glad you like it:]
Arcо is offline  
Thanks
2 Users
Old 01/19/2010, 07:32   #15
 
NoFatChicks's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 62
Received Thanks: 0
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.
NoFatChicks is offline  
Reply




All times are GMT +1. The time now is 11:21.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.