Problem.

02/20/2010 05:28 -Shunsui-#1
For some reason iam guessing the loading code does not work because when i claim the month halo and log out, and log back in it dosent show it anymore what can be wrong

This is the NPc that Wirtes it, and it Works Fine when i Checked,

Code:
                            #region Empty Npc In Market
                            case 5090:
                                {
                                    if (Linkback == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Halo testing"));
                                        GC.AddSend(Packets.NPCLink("Trojan", 3));
                                        GC.AddSend(Packets.NPCLink("Monthly", 5));
                                        GC.AddSend(Packets.NPCLink("Owned", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (Linkback == 3)
                                    {
                                        World.SendMsgToAll("SYSTEM", GC.MyChar.Name + " Tested Tro Halo and Works", 2011, 0);
                                        GC.MyChar.StatEff.Add(StatusEffectEn.TopTrojan);
                                        try
                                        {
                                            // Now it should work 100%
                                            StreamWriter sw = new StreamWriter("C:/OldCODB/Tops/TopTrojan.txt");
                                            sw.WriteLine("" + GC.MyChar.EntityID + "#549755813888");
                                            sw.Close();
                                        }
                                        catch (Exception e)
                                        {
                                            Console.WriteLine(e.Message);
                                        }
                                    }
                                    if (Linkback == 5)
                                    {
                                        World.SendMsgToAll("SYSTEM", GC.MyChar.Name + " Tested Month Halo and Works", 2011, 0);
                                        GC.MyChar.StatEff.Add(StatusEffectEn.MonthlyPKChampion);
                                        try
                                        {
                                            // Now it should work 100%
                                            StreamWriter sw = new StreamWriter("C:/OldCODB/Tops/PkMonth.txt");//C:\OldCODB\Tops\PkMonth.txt
                                            sw.WriteLine("" + GC.MyChar.EntityID + "#68719476736");
                                            sw.Close();
                                        }
                                        catch (Exception e)
                                        {
                                            Console.WriteLine(e.Message);
                                        }
                                    }
                                    break;
                                }
                            #endregion
This is What Loads it,
Code:
public static void LoadMonthPK(StatusEffectEn Value, Main.GameClient GC)
        {
            if (File.Exists(@"C:\OldCODB\Tops\PkMonth.txt"))
            {
                string[] AllLines = System.IO.File.ReadAllLines(@"C:\OldCODB\Tops\PkMonth.txt");
                int MonthPK = AllLines.Length;
                for (int x = 0; x < MonthPK; x++)
                {
                    string[] Monthlyz = AllLines[x].Split('#');
                    string CharID = Monthlyz[0];
                    string MonthlyHalo = Monthlyz[1];
                    if (Monthlyz.Contains(GC.MyChar.EntityID.ToString()) && CharID.Contains(GC.MyChar.EntityID.ToString()))
                    {
                        Program.WriteLine(MonthlyHalo); // A check if it reads it right.
                        if (MonthlyHalo == "68719476736")//68719476736
                            GC.MyChar.StatEff.Add(StatusEffectEn.MonthlyPKChampion);
                    }
                }
            }
        }
02/20/2010 05:35 Arcо#2
open up that file and tell me whats in it.
02/20/2010 05:36 salem rey#3
I think arco didnt add the saving in top month,, you should work in your own, i did add a top month in my server in own. and make it perfectly.
02/20/2010 05:37 Arcо#4
Quote:
Originally Posted by salem rey View Post
I think arco didnt add the saving in top month,, you should work in your own, i did add a top month in my server in own. and make it perfectly.
Come to think of it you are right, I didn't.
@Shun
Check teleport.cs and tell me whats in there.
Paste it all here.
02/20/2010 05:58 -Shunsui-#5
Quote:
Originally Posted by .Arco View Post
Come to think of it you are right, I didn't.
@Shun
Check teleport.cs and tell me whats in there.
Paste it all here.
xD, Thanks Alot Fixed it works PERFECTT
02/20/2010 05:58 Arcо#6
Quote:
Originally Posted by -Shunsui- View Post
xD, Thanks Alot Fixed it works PERFECTT
So can we request close?
02/20/2010 06:21 -Shunsui-#7
Yeah.