10-03-2013, 20:10
public unsafe void Fonction_Get_et_Calcul_Value_Rayon()
{
Calcule_Get_Min_X = OriginX - 50.0f;
Calcule_Get_Max_X = OriginX + 50.0f;
Calcule_Get_Min_Y = OriginY - 50.0f;
Calcule_Get_Max_Y = OriginY + 50.0f;
Calcule_Get_Min_Z = OriginZ - 50.0f;
Calcule_Get_Max_Z = OriginZ + 50.0f;
string NomMap = GetDvar("mapname");
string Flag_Position = "admin\\AdminProServerTEKNO\\Flag_Position.txt";
FileStream stream;
FileMode Mode_Ecriture;
if (File.Exists(Flag_Position)) Mode_Ecriture = FileMode.Append;
else
{
SaveNum = 1;
Mode_Ecriture = FileMode.CreateNew;
}
stream = File.Open(Flag_Position, Mode_Ecriture, FileAccess.Write, FileShare.None);
StreamWriter EcritureDeLaLigne = new StreamWriter(stream);//new StreamWriter(stream, System.Text.Encoding.Unicode);
EcritureDeLaLigne.WriteLine("Save N: " + SaveNum);
EcritureDeLaLigne.WriteLine("Carte: " + NomMap);
EcritureDeLaLigne.WriteLine("***********************************************************");
if (des == true)
{
EcritureDeLaLigne.WriteLine("Teleport_Flag[" + NumObjStruc + "].Go_Flag_X = " + OriginX + "f;");
EcritureDeLaLigne.WriteLine("Teleport_Flag[" + NumObjStruc + "].Go_Flag_Y = " + OriginY + "f;");
EcritureDeLaLigne.WriteLine("Teleport_Flag[" + NumObjStruc + "].Go_Flag_Z = " + OriginZ + "f;");
NumObjStruc ++;
des = false;
}
if (ent == true)
{
EcritureDeLaLigne.WriteLine("Teleport_Flag_Area[" + NumObjStruc + "].Min_X = " + Calcule_Get_Min_X + "f;");
EcritureDeLaLigne.WriteLine("Teleport_Flag_Area[" + NumObjStruc + "].Max_X = " + Calcule_Get_Max_X + "f;");
EcritureDeLaLigne.WriteLine("Teleport_Flag_Area[" + NumObjStruc + "].Min_Y = " + Calcule_Get_Min_Y + "f;");
EcritureDeLaLigne.WriteLine("Teleport_Flag_Area[" + NumObjStruc + "].Max_Y = " + Calcule_Get_Max_Y + "f;");
EcritureDeLaLigne.WriteLine("Teleport_Flag_Area[" + NumObjStruc + "].Min_Z = " + Calcule_Get_Min_Z + "f;");
EcritureDeLaLigne.WriteLine("Teleport_Flag_Area[" + NumObjStruc + "].Max_Z = " + Calcule_Get_Max_Z + "f;");
EcritureDeLaLigne.WriteLine("Fonction_Create_Icone(" + OriginX + "f," + OriginY + "f," + OriginZ + "f,211);");
ent = false;
}
EcritureDeLaLigne.WriteLine(" ");
EcritureDeLaLigne.WriteLine("Fonction_Create_Object(" + OriginX + "f, " + OriginY + "f, " + OriginZ + "f, 0f, 0f, 0f, Flag);");
EcritureDeLaLigne.WriteLine("-------------------------------------------------------");
EcritureDeLaLigne.WriteLine("- [~~INFO~~] -");
EcritureDeLaLigne.WriteLine("-Code de creation Teleport ver un flag -");
EcritureDeLaLigne.WriteLine("-CommandClass/FONCTION EXTERNE/FONCTION_TELEPORT/ -");
EcritureDeLaLigne.WriteLine("-Value_Teleport_by_Map. -");
EcritureDeLaLigne.WriteLine("-Code de creation d'objet -");
EcritureDeLaLigne.WriteLine("-CommandClass/FONCTION EXTERNE/FONCTION Create object -");
EcritureDeLaLigne.WriteLine("-/Declaration et variable/Value_Object_by_Map. -");
EcritureDeLaLigne.WriteLine("-------------------------------------------------------");
EcritureDeLaLigne.WriteLine("=====================================================================================================");
EcritureDeLaLigne.WriteLine(" ");
EcritureDeLaLigne.Flush();
EcritureDeLaLigne.Close();
SaveNum++;
}
{
Calcule_Get_Min_X = OriginX - 50.0f;
Calcule_Get_Max_X = OriginX + 50.0f;
Calcule_Get_Min_Y = OriginY - 50.0f;
Calcule_Get_Max_Y = OriginY + 50.0f;
Calcule_Get_Min_Z = OriginZ - 50.0f;
Calcule_Get_Max_Z = OriginZ + 50.0f;
string NomMap = GetDvar("mapname");
string Flag_Position = "admin\\AdminProServerTEKNO\\Flag_Position.txt";
FileStream stream;
FileMode Mode_Ecriture;
if (File.Exists(Flag_Position)) Mode_Ecriture = FileMode.Append;
else
{
SaveNum = 1;
Mode_Ecriture = FileMode.CreateNew;
}
stream = File.Open(Flag_Position, Mode_Ecriture, FileAccess.Write, FileShare.None);
StreamWriter EcritureDeLaLigne = new StreamWriter(stream);//new StreamWriter(stream, System.Text.Encoding.Unicode);
EcritureDeLaLigne.WriteLine("Save N: " + SaveNum);
EcritureDeLaLigne.WriteLine("Carte: " + NomMap);
EcritureDeLaLigne.WriteLine("***********************************************************");
if (des == true)
{
EcritureDeLaLigne.WriteLine("Teleport_Flag[" + NumObjStruc + "].Go_Flag_X = " + OriginX + "f;");
EcritureDeLaLigne.WriteLine("Teleport_Flag[" + NumObjStruc + "].Go_Flag_Y = " + OriginY + "f;");
EcritureDeLaLigne.WriteLine("Teleport_Flag[" + NumObjStruc + "].Go_Flag_Z = " + OriginZ + "f;");
NumObjStruc ++;
des = false;
}
if (ent == true)
{
EcritureDeLaLigne.WriteLine("Teleport_Flag_Area[" + NumObjStruc + "].Min_X = " + Calcule_Get_Min_X + "f;");
EcritureDeLaLigne.WriteLine("Teleport_Flag_Area[" + NumObjStruc + "].Max_X = " + Calcule_Get_Max_X + "f;");
EcritureDeLaLigne.WriteLine("Teleport_Flag_Area[" + NumObjStruc + "].Min_Y = " + Calcule_Get_Min_Y + "f;");
EcritureDeLaLigne.WriteLine("Teleport_Flag_Area[" + NumObjStruc + "].Max_Y = " + Calcule_Get_Max_Y + "f;");
EcritureDeLaLigne.WriteLine("Teleport_Flag_Area[" + NumObjStruc + "].Min_Z = " + Calcule_Get_Min_Z + "f;");
EcritureDeLaLigne.WriteLine("Teleport_Flag_Area[" + NumObjStruc + "].Max_Z = " + Calcule_Get_Max_Z + "f;");
EcritureDeLaLigne.WriteLine("Fonction_Create_Icone(" + OriginX + "f," + OriginY + "f," + OriginZ + "f,211);");
ent = false;
}
EcritureDeLaLigne.WriteLine(" ");
EcritureDeLaLigne.WriteLine("Fonction_Create_Object(" + OriginX + "f, " + OriginY + "f, " + OriginZ + "f, 0f, 0f, 0f, Flag);");
EcritureDeLaLigne.WriteLine("-------------------------------------------------------");
EcritureDeLaLigne.WriteLine("- [~~INFO~~] -");
EcritureDeLaLigne.WriteLine("-Code de creation Teleport ver un flag -");
EcritureDeLaLigne.WriteLine("-CommandClass/FONCTION EXTERNE/FONCTION_TELEPORT/ -");
EcritureDeLaLigne.WriteLine("-Value_Teleport_by_Map. -");
EcritureDeLaLigne.WriteLine("-Code de creation d'objet -");
EcritureDeLaLigne.WriteLine("-CommandClass/FONCTION EXTERNE/FONCTION Create object -");
EcritureDeLaLigne.WriteLine("-/Declaration et variable/Value_Object_by_Map. -");
EcritureDeLaLigne.WriteLine("-------------------------------------------------------");
EcritureDeLaLigne.WriteLine("=====================================================================================================");
EcritureDeLaLigne.WriteLine(" ");
EcritureDeLaLigne.Flush();
EcritureDeLaLigne.Close();
SaveNum++;
}