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,
This is What Loads it,
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
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);
}
}
}
}