void ChatArea_LinkClicked(object sender, LinkClickedEventArgs e) { if (e.LinkText.Split('#').Length > 1 && e.LinkText.Split('#')[1] == "P") { // passage au mode private HudHandle.ChannelState("P"); // insertion du nom de l'user qui sera contacté par mp HudHandle.ChatTextBox.Text = e.LinkText.Split('#')[0] + "#"; HudHandle.ChatTextBox.Focus(); HudHandle.ChatTextBox.SelectionStart = HudHandle.ChatTextBox.TextLength; } else { try { System.Diagnostics.Process.Start(e.LinkText); } catch { HudHandle.ChatArea.AppendText((HudHandle.ChatArea.Text == "") ? "" : "\n"); HudHandle.ChatArea.SelectionStart = HudHandle.ChatArea.TextLength; HudHandle.ChatArea.SelectionLength = 0; HudHandle.ChatArea.SelectionColor = Color.Red; HudHandle.ChatArea.AppendText(CommonCode.TranslateText(68)); HudHandle.ChatArea.SelectionColor = HudHandle.ChatArea.ForeColor; } } }
public void Fetch(string[] commandStrings) { #region Mise à jours des valeurs de la vitalité // commandStrings[1] = maxHealth # maxHealth (CommonCode.MyPlayerInfo.instance.ibPlayer.tag as Actor).maxHealth = Convert.ToInt16(commandStrings[1].Split('#')[0]); (CommonCode.MyPlayerInfo.instance.ibPlayer.tag as Actor).currentHealth = Convert.ToInt16(commandStrings[1].Split('#')[1]); HudHandle.UpdateHealth(); #endregion }
public void Fetch(string[] commandStrings) { // mis-à-jour un stat d'un joueur // commandStrings[1]= nomStat#valeur | séparé par pip foreach (string s in commandStrings[1].Split('|')) { FieldInfo statField = (CommonCode.MyPlayerInfo.instance.ibPlayer.tag as Actor).GetType().GetField(s.Split('#')[0], BindingFlags.Public | BindingFlags.Instance); statField.SetValue(CommonCode.MyPlayerInfo.instance.ibPlayer.tag as Actor, Convert.ChangeType(s.Split('#')[1], statField.FieldType)); HudHandle.UpdateHealth(); // il faut mettre a jour les valeurs sur le hud, il faut utiliser les propirété, et lancer un update automatiquement lors d'une nouvelle assignation // il faut pas appeler HudHandle.UpdateHealth()si il s'agit d'autre parametre que maxHealth ou ou currentHealth } }
public void Fetch(string[] commandStrings) { #region // cmd pour update des states apres la cloture du combat et les states de mon joueur seulement // commandStrings[0] = Pseudo#ClasseName#Spirit#SpiritLvl#Pvp#village#MaskColors#Orientation#Level#map#rang //#CurrentPdv#totalPdv#xp#TotalXp#doton#katon#futon#raiton#suiton#chakralvl2 //#chakralvl3#chakralvl4#chakralvl5#chakralvl6#usingDoton#usingKaton#usingFuton#usingRaiton#usingSuiton#equipedDoton //#equipedKaton#equipedFuton#equipedRaiton#suitonEquiped#pc#pm#pe#cd#invoc#Initiative //#job1#job2#specialite1#specialite2#TotalPoid#CurrentPoid#Ryo#resiDoton#resiKaton#resiFuton //#resiRaiton#resiSuiton#esquivePC#esquivePM#esquivePE#esquiveCD#retraitPC#retraitPM#retraitPE#retraitCD //#evasion#blocage#_sorts#resiDotonFix#resiKatonFix#resiFutonFix#resiRaitonFix#resiSuitonFix#resiFix#domDotonFix //#domKatonFix#domFutonFix#domRaitonFix#domSuitonFix#domFix#puissance#puissanceEquiped" // commandStrings[1]= quete // commandStrings[2] = spellPointLeft string[] states = commandStrings[0].Split('#'); string actorName = states[0]; Enums.ActorClass.ClassName className = (Enums.ActorClass.ClassName)Enum.Parse(typeof(Enums.ActorClass.ClassName), states[1]); Enums.Spirit.Name spirit = (Enums.Spirit.Name)Enum.Parse(typeof(Enums.Spirit.Name), states[2]); int spiritLevel = int.Parse(states[3]); bool pvpEnabled = bool.Parse(states[4]); Enums.HiddenVillage.Names hiddenVillage = (Enums.HiddenVillage.Names)Enum.Parse(typeof(Enums.HiddenVillage.Names), states[5]); string maskColorsString = states[6]; string[] maskColors = states[6].Split('/'); int orientation = int.Parse(states[7]); int level = int.Parse(states[8]); string map = states[9]; Enums.Rang.official officialRang = (Enums.Rang.official)Enum.Parse(typeof(Enums.Rang.official), states[10]); int currentHealth = int.Parse(states[11]); int maxHealth = int.Parse(states[12]); int currentXp = int.Parse(states[13]); int maxXp = int.Parse(states[14]); int doton = int.Parse(states[15]); int katon = int.Parse(states[16]); int futon = int.Parse(states[17]); int raiton = int.Parse(states[18]); int suiton = int.Parse(states[19]); int chakra1Level = int.Parse(states[20]); int chakra2Level = int.Parse(states[21]); int chakra3Level = int.Parse(states[22]); int chakra4Level = int.Parse(states[23]); int chakra5Level = int.Parse(states[24]); int usingDoton = int.Parse(states[25]); int usingKaton = int.Parse(states[26]); int usingFuton = int.Parse(states[27]); int usingRaiton = int.Parse(states[28]); int usingSuiton = int.Parse(states[29]); int equipedDoton = int.Parse(states[30]); int equipedKaton = int.Parse(states[31]); int equipedFuton = int.Parse(states[32]); int equipedRaiton = int.Parse(states[33]); int equipedSuiton = int.Parse(states[34]); int originalPc = int.Parse(states[35]); int originalPm = int.Parse(states[36]); int pe = int.Parse(states[37]); int cd = int.Parse(states[38]); int summons = int.Parse(states[39]); int initiative = int.Parse(states[40]); string job1 = states[41]; string job2 = states[42]; string specialty1 = states[43]; string specialty2 = states[44]; int maxWeight = int.Parse(states[45]); int currentWeight = int.Parse(states[46]); int ryo = int.Parse(states[47]); int resiDotonPercent = int.Parse(states[48]); int resiKatonPercent = int.Parse(states[49]); int resiFutonPercent = int.Parse(states[50]); int resiRaitonPercent = int.Parse(states[51]); int resiSuitonPercent = int.Parse(states[52]); int dodgePc = int.Parse(states[53]); int dodgePm = int.Parse(states[54]); int dodgePe = int.Parse(states[55]); int dodgeCd = int.Parse(states[56]); int removePc = int.Parse(states[57]); int removePm = int.Parse(states[58]); int removePe = int.Parse(states[59]); int removeCd = int.Parse(states[60]); int escape = int.Parse(states[61]); int blocage = int.Parse(states[62]); string spells = states[63]; int resiDotonFix = int.Parse(states[64]); int resiKatonFix = int.Parse(states[65]); int resiFutonFix = int.Parse(states[66]); int resiRaitonFix = int.Parse(states[67]); int resiSuitonFix = int.Parse(states[68]); int resiFix = int.Parse(states[69]); int domDotonFix = int.Parse(states[70]); int domKatonFix = int.Parse(states[71]); int domFutonFix = int.Parse(states[72]); int domRaitonFix = int.Parse(states[73]); int domSuitonFix = int.Parse(states[74]); int domFix = int.Parse(states[75]); int power = int.Parse(states[76]); int equipedPower = int.Parse(states[77]); string questString = commandStrings[1]; int spellPointLeft = int.Parse(commandStrings[2]); // creation d'une instance Bmp vide just pour contenir les infos dans le tag CommonCode.MyPlayerInfo.instance.ibPlayer = new Bmp(); CommonCode.MyPlayerInfo.instance.ibPlayer.tag = new Actor(); Actor pi = CommonCode.MyPlayerInfo.instance.ibPlayer.tag as Actor; pi.pseudo = actorName; pi.className = className; pi.spirit = spirit; pi.spiritLevel = spiritLevel; pi.pvpEnabled = pvpEnabled; pi.hiddenVillage = hiddenVillage; pi.maskColorString = maskColorsString; pi.directionLook = orientation; pi.level = level; pi.map = map; pi.officialRang = officialRang; pi.currentHealth = currentHealth; pi.maxHealth = maxHealth; pi.currentXp = currentXp; pi.maxXp = maxXp; pi.doton = doton; pi.katon = katon; pi.futon = futon; pi.raiton = raiton; pi.suiton = suiton; // association des données des chakralvl2,3,4,5 CommonCode.chakra1Level = chakra1Level; CommonCode.chakra2Level = chakra2Level; CommonCode.chakra3Level = chakra3Level; CommonCode.chakra4Level = chakra4Level; CommonCode.chakra5Level = chakra5Level; pi.usingDoton = usingDoton; pi.usingKaton = usingKaton; pi.usingFuton = usingFuton; pi.usingRaiton = usingRaiton; pi.usingSuiton = usingSuiton; pi.equipedDoton = equipedDoton; pi.equipedKaton = equipedKaton; pi.equipedFuton = equipedFuton; pi.equipedRaiton = equipedRaiton; pi.equipedSuiton = equipedSuiton; pi.originalPc = originalPc; pi.originalPm = originalPm; pi.pe = pe; pi.cd = cd; pi.summons = summons; pi.initiative = initiative; pi.job1 = job1; pi.job2 = job2; pi.specialty1 = specialty1; pi.specialty2 = specialty2; pi.maxWeight = maxWeight; pi.currentWeight = currentWeight; pi.ryo = ryo; pi.resiDotonPercent = resiDotonPercent; pi.resiKatonPercent = resiKatonPercent; pi.resiFutonPercent = resiFutonPercent; pi.resiRaitonPercent = resiRaitonPercent; pi.resiSuitonPercent = resiSuitonPercent; pi.dodgePc = dodgePc; pi.dodgePm = dodgePm; pi.dodgePe = dodgePe; pi.dodgeCd = dodgeCd; pi.removePc = removePc; pi.removePm = removePm; pi.removePe = removePe; pi.removeCd = removeCd; pi.escape = escape; pi.blocage = blocage; if (spells != "") { for (int cnt = 0; cnt < spells.Split('|').Length; cnt++) { string tmp_data = spells.Split('|')[cnt]; Actor.SpellsInformations _info_sorts = new Actor.SpellsInformations(); _info_sorts.sortID = Convert.ToInt32(tmp_data.Split(':')[0].ToString()); _info_sorts.emplacement = Convert.ToInt32(tmp_data.Split(':')[1].ToString()); _info_sorts.level = Convert.ToInt32(tmp_data.Split(':')[2]); _info_sorts.colorSort = Convert.ToInt32(tmp_data.Split(':')[3]); pi.spells.Add(_info_sorts); } } pi.resiDotonFix = resiDotonFix; pi.resiKatonFix = resiKatonFix; pi.resiFutonFix = resiFutonFix; pi.resiRaitonFix = resiRaitonFix; pi.resiSuitonFix = resiSuitonFix; pi.resiFix = resiFix; pi.domDotonFix = domDotonFix; pi.domKatonFix = domKatonFix; pi.domFutonFix = domFutonFix; pi.domRaitonFix = domRaitonFix; pi.domSuitonFix = domSuitonFix; pi.domFix = domFix; pi.power = power; pi.equipedPower = equipedPower; // convertir la list de quete en string if (questString != "") { for (int cnt = 0; cnt < questString.Split('/').Length; cnt++) { string _quest = questString.Split('/')[cnt]; Actor.QuestInformations qi = new Actor.QuestInformations(); qi.nom_quete = _quest.Split(':')[0]; qi.totalSteps = Convert.ToInt16(_quest.Split(':')[1]); qi.currentStep = Convert.ToInt16(_quest.Split(':')[2]); qi.submited = Convert.ToBoolean(_quest.Split(':')[3]); pi.Quests.Add(qi); } } CommonCode.CurMap = pi.map; // level MenuStats.StatsLevel.Text = CommonCode.TranslateText(50) + " " + pi.level; // affichage du rang général MenuStats.Rang.Text = CommonCode.officialRangToCurrentLangTranslation(pi.officialRang); // affichage du level Pvp MenuStats.LevelPvp.Text = pi.spiritLevel.ToString(); // affichage du grade Pvp if (spirit != Enums.Spirit.Name.neutral) { MenuStats.GradePvp = new Bmp(@"gfx\general\obj\2\" + pi.spirit + @"\" + MenuStats.LevelPvp.Text + ".dat", new Point(276 + (15 - Convert.ToInt16(MenuStats.LevelPvp.Text)), 2), new Size(40 + Convert.ToInt16(MenuStats.LevelPvp.Text), 20 + Convert.ToInt16(MenuStats.LevelPvp.Text)), "PlayerStats." + pi.spirit, Manager.TypeGfx.Top, true, 1); MenuStats.StatsImg.Child.Add(MenuStats.GradePvp); } // update des pdv HudHandle.UpdateHealth(); MenuStats.Flag = new Bmp(@"gfx\general\obj\1\pays_thumbs.dat", new Point(240, 8), "__Flag", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet("pays_" + pi.hiddenVillage + "_thumbs", 0)); MenuStats.StatsImg.Child.Add(MenuStats.Flag); MenuStats.LFlag.Text = hiddenVillage.ToString(); MenuStats.Fusion1.Text = CommonCode.TranslateText(75); MenuStats.Fusion2.Text = CommonCode.TranslateText(75); MenuStats.NiveauGaugeTxt.Text = CommonCode.TranslateText(50) + " " + pi.level; // NiveauGaugeRecPercent, barre de progression du niveau // calcule du pourcentage du niveau en progression int CurrentProgressLevel = pi.currentXp; int TotalProgressLevel = pi.maxXp; int PercentProgressLevel = 0; if (TotalProgressLevel != 0) { PercentProgressLevel = (CurrentProgressLevel * 100) / TotalProgressLevel; } else { PercentProgressLevel = 100; } MenuStats.NiveauGaugeRecPercent.size.Width = (258 * PercentProgressLevel) / 100; // affichage du label progression lvl MenuStats.NiveauGaugeTxtCurrent.Text = CurrentProgressLevel + "/" + TotalProgressLevel + " (" + PercentProgressLevel + "%)"; MenuStats.NiveauGaugeTxtCurrent.point = new Point(MenuStats.NiveauGaugeRec2.point.X + (MenuStats.NiveauGaugeRec2.size.Width / 2) - (TextRenderer.MeasureText(MenuStats.NiveauGaugeTxtCurrent.Text, MenuStats.NiveauGaugeTxtCurrent.font).Width / 2), MenuStats.NiveauGaugeRec2.point.Y); // raffrechissement du text pour des mesures de changement de langue MenuStats.AffiniteElementaireTxt.Text = CommonCode.TranslateText(76); MenuStats.terreStats.Text = "(" + CommonCode.TranslateText(77) + ")"; MenuStats.FeuStats.Text = "(" + CommonCode.TranslateText(78) + ")"; MenuStats.VentStats.Text = "(" + CommonCode.TranslateText(79) + ")"; MenuStats.FoudreStats.Text = "(" + CommonCode.TranslateText(80) + ")"; MenuStats.EauStats.Text = "(" + CommonCode.TranslateText(81) + ")"; MenuStats.TerrePuissance.Text = "(" + pi.doton + "+" + pi.equipedDoton + ")=" + (pi.doton + pi.equipedDoton); MenuStats.FeuPuissance.Text = "(" + pi.katon + "+" + pi.equipedKaton + ")=" + (pi.katon + pi.equipedKaton); MenuStats.VentPuissance.Text = "(" + pi.futon + "+" + pi.equipedFuton + ")=" + (pi.futon + pi.equipedFuton); MenuStats.FoudrePuissance.Text = "(" + pi.raiton + "+" + pi.equipedRaiton + ")=" + (pi.raiton + pi.equipedRaiton); MenuStats.EauPuissance.Text = "(" + pi.suiton + "+" + pi.equipedSuiton + ")=" + (pi.suiton + pi.equipedSuiton); MenuStats.Lvl1RegleTxt.Text = CommonCode.TranslateText(82); MenuStats.Lvl2RegleTxt.Text = CommonCode.TranslateText(83); MenuStats.Lvl3RegleTxt.Text = CommonCode.TranslateText(84); MenuStats.Lvl4RegleTxt.Text = CommonCode.TranslateText(85); MenuStats.Lvl5RegleTxt.Text = CommonCode.TranslateText(86); MenuStats.Lvl6RegleTxt.Text = CommonCode.TranslateText(87); // affichage de la gauge lvl chakra selon les points MenuStats.Lvl2ReglePts.Text = CommonCode.chakra1Level.ToString(); MenuStats.Lvl3ReglePts.Text = CommonCode.chakra2Level.ToString(); MenuStats.Lvl4ReglePts.Text = CommonCode.chakra3Level.ToString(); MenuStats.Lvl5ReglePts.Text = CommonCode.chakra4Level.ToString(); MenuStats.Lvl6ReglePts.Text = CommonCode.chakra5Level.ToString(); // modification du lvl de l'utilisation de l'element CommonCode.UpdateUsingElement(Enums.Chakra.Element.doton, pi.usingDoton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.katon, pi.usingKaton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.futon, pi.usingFuton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.raiton, pi.usingRaiton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.suiton, pi.equipedSuiton); MenuStats.DotonLvl.Text = pi.usingDoton.ToString(); MenuStats.KatonLvl.Text = pi.usingKaton.ToString(); MenuStats.FutonLvl.Text = pi.usingFuton.ToString(); MenuStats.RaitonLvl.Text = pi.usingRaiton.ToString(); MenuStats.SuitonLvl.Text = pi.usingSuiton.ToString(); // bar de vie selon les pdv 11 current, 12 total int TotalPdv = pi.maxHealth; int CurrentPdv = pi.currentHealth; int X = 0; if (TotalPdv != 0) { X = (CurrentPdv * 100) / TotalPdv; } MenuStats.VieBar.size.Width = (236 * X) / 100; // point de vie dans Menustats MenuStats.VieLabel.Text = CommonCode.TranslateText(88); MenuStats.ViePts.Text = CurrentPdv.ToString() + " / " + TotalPdv + " (" + X + "%)"; //MenuStats.PCLabel.Text = common1.TranslateText(89); MenuStats.PC.Text = pi.originalPc.ToString(); //MenuStats.PMLabel.Text = common1.TranslateText(90); MenuStats.PM.Text = pi.originalPm.ToString(); //MenuStats.PELabel.Text = common1.TranslateText(91); MenuStats.PE.Text = pi.pe.ToString(); //MenuStats.CDLabel.Text = common1.TranslateText(92); MenuStats.CD.Text = pi.cd.ToString(); //MenuStats.InvocLabel.Text = common1.TranslateText(93); MenuStats.Invoc.Text = pi.summons.ToString(); //MenuStats.InitiativeLabel.Text = common1.TranslateText(94); MenuStats.Initiative.Text = pi.initiative.ToString(); MenuStats.Job1Label.Text = CommonCode.TranslateText(95) + " 1"; MenuStats.Specialite1Label.Text = CommonCode.TranslateText(96) + " 1"; MenuStats.Job2Labe1.Text = CommonCode.TranslateText(95) + " 2"; MenuStats.Specialite2Label.Text = CommonCode.TranslateText(96) + " 2"; //////// playerData[41] = job1 //////// playerdata[42] = job2 //////// playerdata[43] = specialite1 //////// playerdata[44] = specialite2 MenuStats.PoidLabel.Text = CommonCode.TranslateText(97); int TotalPoid = pi.maxWeight; int CurrentPoid = pi.currentWeight; int PercentPoid = (CurrentPoid * 100) / TotalPoid; MenuStats.PoidRec.size.Width = (116 * PercentPoid) / 100; MenuStats.Poid.Text = CurrentPoid + " / " + TotalPoid + " (" + PercentPoid + "%)"; MenuStats.Poid.point.X = MenuStats.PoidRec.point.X + 58 - (TextRenderer.MeasureText(MenuStats.Poid.Text, MenuStats.Poid.font).Width / 2); MenuStats.Ryo.Text = CommonCode.MoneyThousendSeparation(pi.ryo.ToString()); MenuStats.resiDotonTxt.Text = pi.resiDotonPercent.ToString() + "%"; MenuStats.resiKatonTxt.Text = pi.resiKatonPercent.ToString() + "%"; MenuStats.resiFutonTxt.Text = pi.resiFutonPercent.ToString() + "%"; MenuStats.resiRaitonTxt.Text = pi.resiRaitonPercent.ToString() + "%"; MenuStats.resiSuitonTxt.Text = pi.resiSuitonPercent.ToString() + "%"; MenuStats.__esquivePC_Txt.Text = pi.dodgePc.ToString(); MenuStats.__esquivePM_Txt.Text = pi.dodgePm.ToString(); MenuStats.__retraitPC_Txt.Text = pi.removePc.ToString(); MenuStats.__retraitPM_Txt.Text = pi.removePm.ToString(); pi.spellPointLeft = spellPointLeft; #endregion }
public void Init() { //MainForm.BackSound.settings.setMode("loop", true); //MainForm.BackSound.URL = @"sfx\openning.mp3"; Manager.manager.Clear(true); System.GC.Collect(); HudHandle.chatboxCleaner(); // pour supprimer l'objet si l'utilisateur été déjà connecté est a deconnecté apres, afin de recréer l'objet lors une nouvelle connexion HudHandle.hudCleaner(); Bmp __optionForm = new Bmp(@"gfx\general\obj\1\all1.dat", new Point(ScreenManager.WindowWidth - 17, 2), "__optionForm", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet("_Main_option", 0)); Manager.manager.GfxTopList.Add(__optionForm); Manager.manager.GfxFixedList.Add(__optionForm); __optionForm.MouseOver += optionForm_MouseOver; __optionForm.MouseOut += optionForm_MouseOut; __optionForm.MouseClic += option_MouseClic; // bouton fermer Bmp __CloseForm = new Bmp(@"gfx\general\obj\1\all1.dat", new Point(ScreenManager.WindowWidth - 17, 20), "__CloseForm", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet("_Main_option", 3)); Manager.manager.GfxTopList.Add(__CloseForm); Manager.manager.GfxFixedList.Add(__CloseForm); __CloseForm.MouseOver += CloseForm_MouseOver; __CloseForm.MouseOut += CloseForm_MouseOut; __CloseForm.MouseClic += CloseForm_MouseClic; // menu "cadre qui encercle le menu" CloseFormMenu = new Rec(Brushes.LightSteelBlue, new Point((Manager.manager.mainForm.Width / 2) - 125, (Manager.manager.mainForm.Height / 2) - 170), new Size(250, 300), "__CloseFormMenu", Manager.TypeGfx.Top, false); CloseFormMenu.MouseOver += CloseFormMenu_MouseOver; Manager.manager.GfxTopList.Add(CloseFormMenu); Manager.manager.GfxFixedList.Add(CloseFormMenu); // 2eme cadre qui encercle le menu Rec CloseFormCadre = new Rec(Brushes.CadetBlue, new Point(10, 10), new Size(230, 280), "__CloseFormCadre", Manager.TypeGfx.Top, true); CloseFormCadre.MouseOver += CloseFormCadre_MouseOver; CloseFormMenu.Child.Add(CloseFormCadre); /////////////// Deconexion Bmp CloseFormDeco = new Bmp(@"gfx\general\obj\1\all1.dat", new Point(20, 23), "__CloseFormDeco", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet("_Main_option", 5)); CloseFormDeco.MouseClic += CloseFormDeco_MouseClic; CloseFormDeco.MouseOver += CloseFormDeco_MouseOver; CloseFormDeco.MouseOut += CloseFormDeco_MouseOut; CloseFormMenu.Child.Add(CloseFormDeco); CloseFormDecoTxt = new Txt(CommonCode.TranslateText(51), new Point(0, 24), "__CloseFormDecoTxt", Manager.TypeGfx.Top, true, new Font("Verdana", 10, FontStyle.Bold), Brushes.White); CloseFormDecoTxt.point.X = (CloseFormMenu.size.Width / 2) - (TextRenderer.MeasureText(CommonCode.TranslateText(51), CloseFormDecoTxt.font).Width / 2) + 2; CloseFormDecoTxt.MouseClic += CloseFormDecoTxt_MouseClic; CloseFormMenu.Child.Add(CloseFormDecoTxt); ////////////// fermeture Bmp CloseApp = new Bmp(@"gfx\general\obj\1\all1.dat", new Point(20, 60), "__CloseApp", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet("_Main_option", 5)); CloseApp.MouseClic += CloseApp_MouseClic; CloseApp.MouseOver += CloseApp_MouseOver; CloseApp.MouseOut += CloseApp_MouseOut; CloseFormMenu.Child.Add(CloseApp); CloseAppTxt = new Txt(CommonCode.TranslateText(44), new Point(0, 62), "__CloseFormDecoTxt", Manager.TypeGfx.Top, true, new Font("Verdana", 10, FontStyle.Bold), Brushes.White); CloseAppTxt.point.X = (CloseFormMenu.size.Width / 2) - (TextRenderer.MeasureText(CommonCode.TranslateText(44), CloseAppTxt.font).Width / 2) + 2; CloseAppTxt.MouseClic += CloseAppTxt_MouseClic; CloseFormMenu.Child.Add(CloseAppTxt); ////////////// retour map selection de joueur Bmp CloseSelectPlayer = new Bmp(@"gfx\general\obj\1\all1.dat", new Point(20, 100), "__CloseSelectPlayer", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet("_Main_option", 5)); CloseSelectPlayer.MouseClic += CloseSelectPlayer_MouseClic; CloseSelectPlayer.MouseOver += CloseSelectPlayer_MouseOver; CloseSelectPlayer.MouseOut += CloseSelectPlayer_MouseOut; CloseFormMenu.Child.Add(CloseSelectPlayer); CloseSelectPlayerTxt = new Txt(CommonCode.TranslateText(19), new Point(0, 102), "__CloseFormDecoTxt", Manager.TypeGfx.Top, true, new Font("Verdana", 10, FontStyle.Bold), Brushes.White); CloseSelectPlayerTxt.point.X = (CloseFormMenu.size.Width / 2) - (TextRenderer.MeasureText(CommonCode.TranslateText(19), CloseSelectPlayerTxt.font).Width / 2) + 2; CloseSelectPlayerTxt.MouseClic += CloseSelectPlayerTxt_MouseClic; CloseFormMenu.Child.Add(CloseSelectPlayerTxt); ////////////// annuler pour supprimer le menu Bmp annulerMenu = new Bmp(@"gfx\general\obj\1\all1.dat", new Point(20, 140), "__annulerMenu", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet("_Main_option", 5)); annulerMenu.MouseClic += annulerMenu_MouseClic; annulerMenu.MouseOver += CloseSelectPlayer_MouseOver; annulerMenu.MouseOut += CloseSelectPlayer_MouseOut; CloseFormMenu.Child.Add(annulerMenu); annulerMenuTxt = new Txt(CommonCode.TranslateText(34), new Point(0, 142), "__annulerMenuTxt", Manager.TypeGfx.Top, true, new Font("Verdana", 10, FontStyle.Bold), Brushes.White); annulerMenuTxt.point.X = (CloseFormMenu.size.Width / 2) - (TextRenderer.MeasureText(CommonCode.TranslateText(34), annulerMenuTxt.font).Width / 2) + 2; annulerMenuTxt.MouseClic += annulerMenuTxt_MouseClic; CloseFormMenu.Child.Add(annulerMenuTxt); CloseFormMenu.visible = false; Bmp map = new Bmp(@"gfx\map\login\bg\1.dat", new Point(0, 0), "map1", Manager.TypeGfx.Bgr, true, 1); map.MouseOver += map_MouseOver; Manager.manager.GfxBgrList.Add(map); CommonCode.CurMap = "LoginMap"; username = new TextBox { Name = "username", Size = new Size(100, 20), Location = new Point(520, 242), Text = "admin", TabIndex = ZOrder.Ctrl() }; username.Focus(); username.KeyUp += username_KeyUp; username.Visible = true; Manager.manager.GfxCtrlList.Add(username); Manager.manager.mainForm.Controls.Add(username); password = new TextBox { Size = new Size(100, 20), Location = new Point(520, 270), Name = "password", Text = "123456", UseSystemPasswordChar = true }; password.KeyUp += password_KeyUp; password.TabIndex = ZOrder.Ctrl(); Manager.manager.mainForm.Controls.Add(password); Manager.manager.GfxCtrlList.Add(password); ConnexionBtn = new Bmp(@"gfx\general\obj\1\all1.dat", new Point(440, 330), "__ConnexionBtn", Manager.TypeGfx.Obj, true, 1, SpriteSheet.GetSpriteSheet("_Main_option", 9)); ConnexionBtn.MouseClic += ConnexionBtn_MouseClic; ConnexionBtn.MouseOver += ConnexionBtn_MouseOver; ConnexionBtn.MouseDown += ConnexionBtn_MouseDown; ConnexionBtn.MouseUp += ConnexionBtn_MouseUp; ConnexionBtn.MouseOut += ConnexionBtn_MouseOut; ConnexionBtn.MouseMove += ConnexionBtn_MouseMove; Manager.manager.GfxObjList.Add(ConnexionBtn); Txt connexionBtnLabel = new Txt(CommonCode.TranslateText(145), Point.Empty, "__connexionBtnLabel", Manager.TypeGfx.Obj, true, new Font("Verdana", 9, FontStyle.Bold), Brushes.White); connexionBtnLabel.point = new Point(ConnexionBtn.point.X + (ConnexionBtn.rectangle.Width / 2) - (TextRenderer.MeasureText(connexionBtnLabel.Text, connexionBtnLabel.font).Width / 2), ConnexionBtn.point.Y + (ConnexionBtn.rectangle.Height / 2) - (TextRenderer.MeasureText(connexionBtnLabel.Text, connexionBtnLabel.font).Height / 2) - 5); connexionBtnLabel.MouseClic += connexionBtnLabel_MouseClic; Manager.manager.GfxObjList.Add(connexionBtnLabel); connexion_stat = new Txt(string.Empty, new Point(0, 306), "__connexion_stat", Manager.TypeGfx.Obj, true, new Font("Verdana", 8, FontStyle.Regular), Brushes.Red); Manager.manager.GfxObjList.Add(connexion_stat); Feu = new Anim(50, 1); for (int cnt = 1; cnt < 26; cnt++) { Feu.AddCell(@"gfx\map\login\anim\1\" + cnt + ".dat", cnt, 0, ScreenManager.WindowHeight - 200); } Feu.Ini(Manager.TypeGfx.Obj, "Fire", true); Feu.Start(); Manager.manager.GfxObjList.Add(Feu); Int16 langueIndex = 0; switch (CommonCode.langue) { case 0: langueIndex = 4; break; case 1: langueIndex = 5; break; case 2: langueIndex = 3; break; } selectedLangue = new Bmp(@"gfx\map\login\obj\" + langueIndex + ".dat", new Point(8, 3), "__selectedLangue", Manager.TypeGfx.Bgr, true, 1); selectedLangue.MouseClic += selectedLangue_MouseClic; selectedLangue.MouseOver += selectedLangue_MouseOver; Manager.manager.GfxBgrList.Add(selectedLangue); MenuLangue = new Anim(50, 1); for (int cnt = 0; cnt < 4; cnt++) { MenuLangue.AddCell(@"gfx\map\login\obj\6.dat", cnt, 4, cnt * 10); } MenuLangue.Ini(Manager.TypeGfx.Obj, true); MenuLangue.visible(false); MenuLangue.AutoResetAnim = false; Manager.manager.GfxObjList.Add(MenuLangue); Bmp ArFlag = new Bmp(@"gfx\map\login\obj\3.dat", new Point(4, 4), "__ArFlag", Manager.TypeGfx.Obj, true, 1); ArFlag.MouseClic += ArFlag_MouseClic; ArFlag.MouseOver += ArFlag_MouseOver; MenuLangue.Child.Add(ArFlag); Bmp FrFlag = new Bmp(@"gfx\map\login\obj\4.dat", new Point(4, 30), "__FrFlag", Manager.TypeGfx.Obj, true, 1); FrFlag.MouseClic += FrFlag_MouseClic; FrFlag.MouseOver += FrFlag_MouseOver; MenuLangue.Child.Add(FrFlag); Bmp EnFlag = new Bmp(@"gfx\map\login\obj\5.dat", new Point(4, 56), "__EnFlag", Manager.TypeGfx.Obj, true, 1); EnFlag.MouseClic += EnFlag_MouseClic; EnFlag.MouseOver += EnFlag_MouseOver; MenuLangue.Child.Add(EnFlag); // affichage du menuStats et hud // affichage du hud chat System.GC.Collect(); // dessin du menuStats MainForm.DrawMenuStats(); // reinitialisation des variable CommonCode.blockNetFlow = false; Manager.manager.mainForm.Cursor = Cursors.Default; Battle.currentCursor = ""; Battle.Clear(); }
// elle contiens tous les données recus par le serveur et qui sont appliqués a tous les map public static void cmd(string stat) { string[] args = stat.Split('•'); if (args[1] == "spellTileGranted") { } if (Battle.state == Enums.battleState.state.started && CommonCode.blockNetFlow) { bool blockCmd = true; if (args.Length == 5 && args[1] == "ChatMessage") { blockCmd = false; } else if (args.Length == 3 && args[1] == "CheckAndUpdateStates") { blockCmd = false; } else if (args.Length == 2 && args[1] == "spellTileNotAllowed") { blockCmd = false; } // bloquer les cmd quand un joueur lance un sort pour ne pas mélanger les animations if (blockCmd) { CommonCode.cmdBlockedBySpellInPRogress.Add(stat); } return; } if (CommonCode.debug) { CommonCode.ChatMsgFormat("S", "null", stat); } if (Manager.manager.mainForm.IsDisposed) { return; } if (args.Length == 5 && args[1] == "ChatMessage") { #region // cmd•ChatMessage•canal•user•message CommonCode.ChatMsgFormat(args[2], args[3], args[4]); #endregion } else if (args.Length == 3 && args[1] == "askingToChallenge") { #region if (!CommonCode.isBusy()) { // reception d'une demande de duel // affichage d'une fenetre d'acceptation ou refus du duel CommonCode.DrawAskingToChallengeMeMenu(args[2]); } #endregion } else if (args.Length == 3 && args[1] == "waitingToChallenge") { CommonCode.DrawAskingToChallengeHimMenu(args[2]); } else if (args.Length == 3 && args[1] == "CancelChallengeRespond") { #region // le jouer qui va etre défié annule cette demande if (CommonCode.ChallengeTo == args[2]) { CommonCode.annulerChallengeHimDlg.visible = false; Manager.manager.GfxTopList.Remove(CommonCode.annulerChallengeHimDlg); CommonCode.annulerChallengeHimDlg = null; CommonCode.ChallengeTo = ""; } #endregion } else if (args.Length == 2 && args[1] == "playerBusyToChallengeYou") { #region // le joueur est occupé // effacement du demande de défie MessageBox.Show(CommonCode.TranslateText(105)); CommonCode.ChallengeTo = ""; #endregion } else if (args.Length == 4 && args[1] == "battleIniNewPos") { #region changement de position d'un joueur lors du temps d'attente du combat // verification si state=initialisation if (Battle.state == Enums.battleState.state.initialisation) { // check si l'utilisateur se trouve parmie les joueurs sideA & sideB if (Battle.SideA.Exists(e => e.pseudo == args[2])) { Point p = new Point(int.Parse(args[3].Split('/')[0]) * 30, int.Parse(args[3].Split('/')[1]) * 30); Bmp ibPlayer = Battle.SideA.Find(e => e.pseudo == args[2]).ibPlayer; ibPlayer.point = new Point(p.X + 15 - (ibPlayer.rectangle.Width / 2), p.Y + 15 - ibPlayer.rectangle.Height); (ibPlayer.tag as Actor).realPosition = new Point(p.X / 30, p.Y / 30); Actor piib = Battle.SideA.Find(f => f.pseudo == args[2]); piib.realPosition = new Point(p.X / 30, p.Y / 30); CommonCode.VerticalSyncZindex(ibPlayer); } else if (Battle.SideB.Exists(e => e.pseudo == args[2])) { Point p = new Point(int.Parse(args[3].Split('/')[0]) * 30, int.Parse(args[3].Split('/')[1]) * 30); Bmp ibPlayer = Battle.SideB.Find(e => e.pseudo == args[2]).ibPlayer; ibPlayer.point = new Point(p.X + 15 - (ibPlayer.rectangle.Width / 2), p.Y + 15 - ibPlayer.rectangle.Height); (ibPlayer.tag as Actor).realPosition = new Point(p.X / 30, p.Y / 30); Actor piib = Battle.SideB.Find(f => f.pseudo == args[2]); piib.realPosition = new Point(p.X / 30, p.Y / 30); CommonCode.VerticalSyncZindex(ibPlayer); } } #endregion } else if (args.Length == 4 && args[1] == "CloseBattle") { #region HudHandle.UpdateHealth(); Battle.CloseBattle(stat); CommonCode.blockNetFlow = false; // liberer le flux au cas ou il été bloqué CommonCode.ChatMsgFormat("S", "null", "blockNetFlow7 = false"); //Network.SendMessage("cmd•CheckAndUpdateStates", true); SyncFeaturesRequestMessage syncFeaturesRequestMessage = new SyncFeaturesRequestMessage(); syncFeaturesRequestMessage.Serialize(); syncFeaturesRequestMessage.Send(); #endregion } else if (args.Length == 3 && args[1] == "change map") { CommonCode.ChangeMap(args[2]); } else if (args.Length == 6 && args[1] == "BattleStarted") { #region // cmd•BattleStats•data (data = info des 2 jours des 2 teams)• + player qui a la main__TimeLeftToPlayRec2 // data = data += _battle.sideA[cnt2].Pseudo + "#" + BattleStatsPDB.reader["classe"].ToString() + "#" + BattleStatsPDB.reader["village"].ToString() + "#" + BattleStatsPDB.reader["MaskColors"].ToString() + "#" + BattleStatsPDB.reader["level"].ToString() + "#" + BattleStatsPDB.reader["rang"].ToString() + "#" + BattleStatsPDB.reader["CurrentPdv"].ToString() + "#" + BattleStatsPDB.reader["TotalPdv"].ToString() + "#" + BattleStatsPDB.reader["doton"].ToString() + "#" + BattleStatsPDB.reader["katon"].ToString() + "#" + BattleStatsPDB.reader["futon"].ToString() + "#" + BattleStatsPDB.reader["raiton"].ToString() + "#" + BattleStatsPDB.reader["suiton"].ToString() + "#" + BattleStatsPDB.reader["usingDoton"].ToString() + "#" + BattleStatsPDB.reader["usingKaton"].ToString() + "#" + BattleStatsPDB.reader["usingFuton"].ToString() + "#" + BattleStatsPDB.reader["usingRaiton"].ToString() + "#" + BattleStatsPDB.reader["usingSuiton"].ToString() + "#" + BattleStatsPDB.reader["equipedDoton"].ToString() + "#" + BattleStatsPDB.reader["equipedKaton"].ToString() + "#" + BattleStatsPDB.reader["equipedFuton"].ToString() + "#" + BattleStatsPDB.reader["equipedRaiton"].ToString() + "#" + BattleStatsPDB.reader["suitonEquiped"].ToString() + "#" + BattleStatsPDB.reader["pc"].ToString() + "#" + BattleStatsPDB.reader["pm"].ToString() + "#" + BattleStatsPDB.reader["pe"].ToString() + "#" + BattleStatsPDB.reader["cd"].ToString() + "#" + BattleStatsPDB.reader["invoc"].ToString() + "#" + BattleStatsPDB.reader["initiative"].ToString() + "#" + BattleStatsPDB.reader["esquivePC"].ToString() + "#" + BattleStatsPDB.reader["esquivePM"].ToString() + "#" + BattleStatsPDB.reader["esquivePE"].ToString() + "#" + BattleStatsPDB.reader["esquiveCD"].ToString() + "#" + BattleStatsPDB.reader["retraitPC"].ToString() + "#" + BattleStatsPDB.reader["retraitPM"].ToString() + "#" + BattleStatsPDB.reader["retraitPE"].ToString() + "#" + BattleStatsPDB.reader["retraitCD"].ToString() + "#" + BattleStatsPDB.reader["evasion"].ToString() + "#" + BattleStatsPDB.reader["blocage"].ToString() + "#" + BattleStatsPDB.reader["puissance"].ToString() + "#" + BattleStatsPDB.reader["puissanceEquiped"].ToString() + "#" + BattleStatsPDB.reader["sorts"] + "|" + sideB.pseudo .... CommonCode.RefreshPlayersDataInBattle(args); //verification si les 2 learders ont la meme initiative, si oui, le variable cmd[4] contiens le nom de l'utilisateur séléctionné aléatoirement Battle.PlayerTurn = args[4]; CommonCode.ReorderAvatarPlayers(args[4]); #region // le serveur annonce le commancement du combat et fournie le temps d'attente pour le déplacement // selection du joueur qui dois jouer en 1er Battle.TimeToPlayInBattle = Convert.ToInt32(args[5]); Battle.TimeLeftToPlay = Convert.ToInt32(args[5]); // affichage du TimeLeftToPlayRec1 HudHandle.TimeLeftToPlayRec1 = new Rec(Brushes.Black, new Point(HudHandle.HealthBarRec1.point.X, HudHandle.HealthBarRec1.point.Y - 38), new Size(38, 38), "__TimeLeftToPlayRec1", Manager.TypeGfx.Top, true); Rec TimeLeftToPlayRec2 = new Rec(Brushes.White, new Point(1, 1), new Size(36, 36), "__TimeLeftToPlayRec2", Manager.TypeGfx.Top, true); TimeLeftToPlayRec2.zindex = 1; HudHandle.TimeLeftToPlayRec1.Child.Add(TimeLeftToPlayRec2); Rec TimeLeftToPlayBar = new Rec(Brushes.Silver, new Point(2, 2), new Size(34, 34), "__TimeLeftToPlayBar", Manager.TypeGfx.Top, true); TimeLeftToPlayBar.zindex = 2; HudHandle.TimeLeftToPlayRec1.Child.Add(TimeLeftToPlayBar); Manager.manager.GfxTopList.Add(HudHandle.TimeLeftToPlayRec1); // affichage du text du temps restant pour jouer "en seconds" HudHandle.TimeLeftToPlayTxt1 = new Txt(Battle.TimeToPlayInBattle.ToString(), new Point(0, HudHandle.TimeLeftToPlayRec1.point.Y + 10), "__TimeLeftToPlayTxt1", Manager.TypeGfx.Top, false, new Font("verdana", 9, FontStyle.Bold), Brushes.Black); Manager.manager.GfxTopList.Add(HudHandle.TimeLeftToPlayTxt1); // effacement des images de positions et du compteur, des fois les cases reste pour des raisons que j'ignore Manager.manager.GfxBgrList.RemoveAll(f => f.Name() == "__validePosT1Rec"); Manager.manager.GfxBgrList.RemoveAll(f => f.Name() == "__validePosT2Rec"); Manager.manager.GfxTopList.RemoveAll(f => f.Name() == "Chrono_TimeOut"); Battle.TimeLeftLabel.visible = false; // éffacement des images de vérrouillage de la position du personnage Manager.manager.GfxObjList.RemoveAll(f => f.Name().Length > 12 && f.Name().Substring(0, 12) == "__posLocked_"); // un thread qui vérifie tout le temps si les animations liés au lancement du sort sont terminé + l'achévement du joueur. .. pour executer les cmd en instance new Thread(new ThreadStart(() => { Thread.CurrentThread.Name = "__Purge_CMD_Thread"; while (!Manager.manager.mainForm.IsDisposed) { if (Battle.state == Enums.battleState.state.idle) { if (CommonCode.cmdBlockedBySpellInPRogress.Count == 0) { break; } else { while (CommonCode.cmdBlockedBySpellInPRogress.Count > 0 && !Manager.manager.mainForm.IsDisposed) { // reinvocation du thread principale pour reprendre la reléve // verification que la fenetre na pas quité Manager.manager.mainForm.BeginInvoke((Action)(() => { network_Command_Dispatcher.cmd(CommonCode.cmdBlockedBySpellInPRogress[0]); CommonCode.cmdBlockedBySpellInPRogress.RemoveAt(0); })); Thread.Sleep(500); } } } else if (!CommonCode.blockNetFlow) { // executer les cmd en instance tant qu'aucun sort n'est lancé ou encours while (CommonCode.cmdBlockedBySpellInPRogress.Count > 0 && !Manager.manager.mainForm.IsDisposed) { if (!CommonCode.blockNetFlow) { Manager.manager.mainForm.BeginInvoke((Action)(() => { if (CommonCode.cmdBlockedBySpellInPRogress.Count > 0) { network_Command_Dispatcher.cmd(CommonCode.cmdBlockedBySpellInPRogress[0]); CommonCode.cmdBlockedBySpellInPRogress.RemoveAt(0); } else { return; } })); Thread.Sleep(500); } else { break; } } } Thread.Sleep(500); } })).Start(); // lancement du thread qui calcule le temps d'attente du jouer if (Battle.TimeLeftToPlayT.Enabled == true) { Battle.TimeLeftToPlayT.Stop(); } Battle.TimeLeftToPlayT.Start(); Battle.state = Enums.battleState.state.started; // thread qui affiche un petit indicateur au dessus du personnage en focus Thread focusPlayer = new Thread(new ThreadStart(CommonCode.FocusPlayerByArrow)); focusPlayer.Start(); CommonCode.turnPast(Battle.PlayerTurn, false); #endregion #endregion } else if (args.Length == 3 && args[1] == "BattleTurnPast") { #region CommonCode.turnPast(args[2], true); #endregion } else if (args.Length == 2 && args[1] == "obstacleFound") { #region // impossible de jouer le sort CommonCode.ChatMsgFormat("S", "", CommonCode.TranslateText(109)); // annulation du waypoint en attente Battle.AllPlayersByOrder.Find(f => f.pseudo == CommonCode.MyPlayerInfo.instance.pseudo).animatedAction = Enums.AnimatedActions.Name.idle; Battle.AllPlayersByOrder.Find(f => f.pseudo == CommonCode.MyPlayerInfo.instance.pseudo).wayPoint.Clear(); #endregion } else if (args.Length == 10 && args[1] == "spellTileGranted") { #region sorts // diminution des pc //PlayerInfo CurPlayerInfo = Battle.AllPlayersByOrder.Find(f => f.Pseudo == commune.MyPlayerInfo.instance.Pseudo); // cmd des sorts lancées // cmd•spellTileGranted•roxor•sortID•posX•posY•spellColor•spellLvl•Dom(jet:x|cd:true ou false|chakra:futon...|dom:total|roxed des dom et # comme séparateur sur plusieurs instance de rox simultanés|deadList:joueurMort1:joueurMort2...|closedBattle:true ou false séparé par # s'il sagit de plusieurs rox en meme temps•PcUsed spells.animSpellAction(args[2], new Point(Convert.ToInt16(args[4]), Convert.ToInt16(args[5])), Convert.ToInt16(args[3]), args[6], Convert.ToInt16(args[7]), args[8], args[9]); #endregion } else if (args.Length == 2 && args[1] == "spellTileNotAllowed") { #region // impossible de jouer le sort CommonCode.ChatMsgFormat("S", "", CommonCode.TranslateText(116)); // annulation du waypoint en attente Battle.AllPlayersByOrder.Find(f => f.pseudo == CommonCode.MyPlayerInfo.instance.pseudo).animatedAction = Enums.AnimatedActions.Name.idle; Battle.AllPlayersByOrder.Find(f => f.pseudo == CommonCode.MyPlayerInfo.instance.pseudo).wayPoint.Clear(); #endregion } else if (args.Length == 2 && args[1] == "spellPointNotEnoughPe") { #region // impossible de jouer le sort CommonCode.ChatMsgFormat("S", "", CommonCode.TranslateText(117)); // annulation du waypoint en attente Battle.AllPlayersByOrder.Find(f => f.pseudo == CommonCode.MyPlayerInfo.instance.pseudo).animatedAction = Enums.AnimatedActions.Name.idle; Battle.AllPlayersByOrder.Find(f => f.pseudo == CommonCode.MyPlayerInfo.instance.pseudo).wayPoint.Clear(); #endregion } else if (args.Length == 2 && args[1] == "spellNotEnoughPc") { #region // impossible de jouer le sort CommonCode.ChatMsgFormat("S", "", CommonCode.TranslateText(122)); #endregion } else if (args.Length == 4 && args[1] == "CheckAndUpdateStates") { #region // cmd pour update des states apres la cloture du combat et les states de mon joueur seulement // "cmd•CheckAndUpdateStates•"Pseudo#ClasseName#Spirit#SpiritLvl#Pvp#village#MaskColors#Orientation#Level#map#rang //#CurrentPdv#totalPdv#xp#TotalXp#doton#katon#futon#raiton#suiton#chakralvl2 //#chakralvl3#chakralvl4#chakralvl5#chakralvl6#usingDoton#usingKaton#usingFuton#usingRaiton#usingSuiton#equipedDoton //#equipedKaton#equipedFuton#equipedRaiton#suitonEquiped#pc#pm#pe#cd#invoc#Initiative //#job1#job2#specialite1#specialite2#TotalPoid#CurrentPoid#Ryo#resiDoton#resiKaton#resiFuton //#resiRaiton#resiSuiton#esquivePC#esquivePM#esquivePE#esquiveCD#retraitPC#retraitPM#retraitPE#retraitCD //#evasion#blocage#_sorts#resiDotonFix#resiKatonFix#resiFutonFix#resiRaitonFix#resiSuitonFix#resiFix#domDotonFix //#domKatonFix#domFutonFix#domRaitonFix#domSuitonFix#domFix#puissance#puissanceEquiped"•quete•null•pi.spellPointLeft string[] states = args[2].Split('#'); string actorName = states[0]; Enums.ActorClass.ClassName className = (Enums.ActorClass.ClassName)Enum.Parse(typeof(Enums.ActorClass.ClassName), states[1]); Enums.Spirit.Name spirit = (Enums.Spirit.Name)Enum.Parse(typeof(Enums.Spirit.Name), states[2]); int spiritLevel = int.Parse(states[3]); bool pvpEnabled = bool.Parse(states[4]); Enums.HiddenVillage.Names hiddenVillage = (Enums.HiddenVillage.Names)Enum.Parse(typeof(Enums.HiddenVillage.Names), states[5]); string maskColorsString = states[6]; string[] maskColors = states[6].Split('/'); int orientation = int.Parse(states[7]); int level = int.Parse(states[8]); string map = states[9]; Enums.Rang.official officialRang = (Enums.Rang.official)Enum.Parse(typeof(Enums.Rang.official), states[10]); int currentHealth = int.Parse(states[11]); int maxHealth = int.Parse(states[12]); int currentXp = int.Parse(states[13]); int maxXp = int.Parse(states[14]); int doton = int.Parse(states[15]); int katon = int.Parse(states[16]); int futon = int.Parse(states[17]); int raiton = int.Parse(states[18]); int suiton = int.Parse(states[19]); int chakra1Level = int.Parse(states[20]); int chakra2Level = int.Parse(states[21]); int chakra3Level = int.Parse(states[22]); int chakra4Level = int.Parse(states[23]); int chakra5Level = int.Parse(states[24]); int usingDoton = int.Parse(states[25]); int usingKaton = int.Parse(states[26]); int usingFuton = int.Parse(states[27]); int usingRaiton = int.Parse(states[28]); int usingSuiton = int.Parse(states[29]); int equipedDoton = int.Parse(states[30]); int equipedKaton = int.Parse(states[31]); int equipedFuton = int.Parse(states[32]); int equipedRaiton = int.Parse(states[33]); int equipedSuiton = int.Parse(states[34]); int originalPc = int.Parse(states[35]); int originalPm = int.Parse(states[36]); int pe = int.Parse(states[37]); int cd = int.Parse(states[38]); int summons = int.Parse(states[39]); int initiative = int.Parse(states[40]); string job1 = states[41]; string job2 = states[42]; string specialty1 = states[43]; string specialty2 = states[44]; int maxWeight = int.Parse(states[45]); int currentWeight = int.Parse(states[46]); int ryo = int.Parse(states[47]); int resiDotonPercent = int.Parse(states[48]); int resiKatonPercent = int.Parse(states[49]); int resiFutonPercent = int.Parse(states[50]); int resiRaitonPercent = int.Parse(states[51]); int resiSuitonPercent = int.Parse(states[52]); int dodgePc = int.Parse(states[53]); int dodgePm = int.Parse(states[54]); int dodgePe = int.Parse(states[55]); int dodgeCd = int.Parse(states[56]); int removePc = int.Parse(states[57]); int removePm = int.Parse(states[58]); int removePe = int.Parse(states[59]); int removeCd = int.Parse(states[60]); int escape = int.Parse(states[61]); int blocage = int.Parse(states[62]); string spells = states[63]; int resiDotonFix = int.Parse(states[64]); int resiKatonFix = int.Parse(states[65]); int resiFutonFix = int.Parse(states[66]); int resiRaitonFix = int.Parse(states[67]); int resiSuitonFix = int.Parse(states[68]); int resiFix = int.Parse(states[69]); int domDotonFix = int.Parse(states[70]); int domKatonFix = int.Parse(states[71]); int domFutonFix = int.Parse(states[72]); int domRaitonFix = int.Parse(states[73]); int domSuitonFix = int.Parse(states[74]); int domFix = int.Parse(states[75]); int power = int.Parse(states[76]); int equipedPower = int.Parse(states[77]); string questString = args[3]; int spellPointLeft = int.Parse(args[4]); // creation d'une instance Bmp vide just pour contenir les infos dans le tag CommonCode.MyPlayerInfo.instance.ibPlayer = new Bmp(); CommonCode.MyPlayerInfo.instance.ibPlayer.tag = new Actor(); Actor pi = CommonCode.MyPlayerInfo.instance.ibPlayer.tag as Actor; pi.pseudo = actorName; pi.className = className; pi.spirit = spirit; pi.spiritLevel = spiritLevel; pi.pvpEnabled = pvpEnabled; pi.hiddenVillage = hiddenVillage; pi.maskColorString = maskColorsString; pi.directionLook = orientation; pi.level = level; pi.map = map; pi.officialRang = officialRang; pi.currentHealth = currentHealth; pi.maxHealth = maxHealth; pi.currentXp = currentXp; pi.maxXp = maxXp; pi.doton = doton; pi.katon = katon; pi.futon = futon; pi.raiton = raiton; pi.suiton = suiton; // association des données des chakralvl2,3,4,5 CommonCode.chakra1Level = chakra1Level; CommonCode.chakra2Level = chakra2Level; CommonCode.chakra3Level = chakra3Level; CommonCode.chakra4Level = chakra4Level; CommonCode.chakra5Level = chakra5Level; pi.usingDoton = usingDoton; pi.usingKaton = usingKaton; pi.usingFuton = usingFuton; pi.usingRaiton = usingRaiton; pi.usingSuiton = usingSuiton; pi.equipedDoton = equipedDoton; pi.equipedKaton = equipedKaton; pi.equipedFuton = equipedFuton; pi.equipedRaiton = equipedRaiton; pi.equipedSuiton = equipedSuiton; pi.originalPc = originalPc; pi.originalPm = originalPm; pi.pe = pe; pi.cd = cd; pi.summons = summons; pi.initiative = initiative; pi.job1 = job1; pi.job2 = job2; pi.specialty1 = specialty1; pi.specialty2 = specialty2; pi.maxWeight = maxWeight; pi.currentWeight = currentWeight; pi.ryo = ryo; pi.resiDotonPercent = resiDotonPercent; pi.resiKatonPercent = resiKatonPercent; pi.resiFutonPercent = resiFutonPercent; pi.resiRaitonPercent = resiRaitonPercent; pi.resiSuitonPercent = resiSuitonPercent; pi.dodgePc = dodgePc; pi.dodgePm = dodgePm; pi.dodgePe = dodgePe; pi.dodgeCd = dodgeCd; pi.removePc = removePc; pi.removePm = removePm; pi.removePe = removePe; pi.removeCd = removeCd; pi.escape = escape; pi.blocage = blocage; if (spells != "") { for (int cnt = 0; cnt < spells.Split('|').Length; cnt++) { string tmp_data = spells.Split('|')[cnt]; Actor.SpellsInformations _info_sorts = new Actor.SpellsInformations(); _info_sorts.sortID = Convert.ToInt32(tmp_data.Split(':')[0].ToString()); _info_sorts.emplacement = Convert.ToInt32(tmp_data.Split(':')[1].ToString()); _info_sorts.level = Convert.ToInt32(tmp_data.Split(':')[2]); _info_sorts.colorSort = Convert.ToInt32(tmp_data.Split(':')[3]); pi.spells.Add(_info_sorts); } } pi.resiDotonFix = resiDotonFix; pi.resiKatonFix = resiKatonFix; pi.resiFutonFix = resiFutonFix; pi.resiRaitonFix = resiRaitonFix; pi.resiSuitonFix = resiSuitonFix; pi.resiFix = resiFix; pi.domDotonFix = domDotonFix; pi.domKatonFix = domKatonFix; pi.domFutonFix = domFutonFix; pi.domRaitonFix = domRaitonFix; pi.domSuitonFix = domSuitonFix; pi.domFix = domFix; pi.power = power; pi.equipedPower = equipedPower; // convertir la list de quete en string if (questString != "") { for (int cnt = 0; cnt < questString.Split('/').Length; cnt++) { string _quest = questString.Split('/')[cnt]; Actor.QuestInformations qi = new Actor.QuestInformations(); qi.nom_quete = _quest.Split(':')[0]; qi.totalSteps = Convert.ToInt16(_quest.Split(':')[1]); qi.currentStep = Convert.ToInt16(_quest.Split(':')[2]); qi.submited = Convert.ToBoolean(_quest.Split(':')[3]); pi.Quests.Add(qi); } } CommonCode.CurMap = pi.map; // level MenuStats.StatsLevel.Text = CommonCode.TranslateText(50) + " " + pi.level; // affichage du rang général MenuStats.Rang.Text = CommonCode.officialRangToCurrentLangTranslation(pi.officialRang); // affichage du level Pvp MenuStats.LevelPvp.Text = pi.spiritLevel.ToString(); // affichage du grade Pvp if (spirit != Enums.Spirit.Name.neutral) { MenuStats.GradePvp = new Bmp(@"gfx\general\obj\2\" + pi.spirit + @"\" + MenuStats.LevelPvp.Text + ".dat", new Point(276 + (15 - Convert.ToInt16(MenuStats.LevelPvp.Text)), 2), new Size(40 + Convert.ToInt16(MenuStats.LevelPvp.Text), 20 + Convert.ToInt16(MenuStats.LevelPvp.Text)), "PlayerStats." + pi.spirit, Manager.TypeGfx.Top, true, 1); MenuStats.StatsImg.Child.Add(MenuStats.GradePvp); } // update des pdv HudHandle.UpdateHealth(); MenuStats.Flag = new Bmp(@"gfx\general\obj\1\pays_thumbs.dat", new Point(240, 8), "__Flag", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet("pays_" + pi.hiddenVillage + "_thumbs", 0)); MenuStats.StatsImg.Child.Add(MenuStats.Flag); MenuStats.LFlag.Text = hiddenVillage.ToString(); MenuStats.Fusion1.Text = CommonCode.TranslateText(75); MenuStats.Fusion2.Text = CommonCode.TranslateText(75); MenuStats.NiveauGaugeTxt.Text = CommonCode.TranslateText(50) + " " + pi.level; // NiveauGaugeRecPercent, barre de progression du niveau // calcule du pourcentage du niveau en progression int CurrentProgressLevel = pi.currentXp; int TotalProgressLevel = pi.maxXp; int PercentProgressLevel = 0; if (TotalProgressLevel != 0) { PercentProgressLevel = (CurrentProgressLevel * 100) / TotalProgressLevel; } else { PercentProgressLevel = 100; } MenuStats.NiveauGaugeRecPercent.size.Width = (258 * PercentProgressLevel) / 100; // affichage du label progression lvl MenuStats.NiveauGaugeTxtCurrent.Text = CurrentProgressLevel + "/" + TotalProgressLevel + " (" + PercentProgressLevel + "%)"; MenuStats.NiveauGaugeTxtCurrent.point = new Point(MenuStats.NiveauGaugeRec2.point.X + (MenuStats.NiveauGaugeRec2.size.Width / 2) - (TextRenderer.MeasureText(MenuStats.NiveauGaugeTxtCurrent.Text, MenuStats.NiveauGaugeTxtCurrent.font).Width / 2), MenuStats.NiveauGaugeRec2.point.Y); // raffrechissement du text pour des mesures de changement de langue MenuStats.AffiniteElementaireTxt.Text = CommonCode.TranslateText(76); MenuStats.terreStats.Text = "(" + CommonCode.TranslateText(77) + ")"; MenuStats.FeuStats.Text = "(" + CommonCode.TranslateText(78) + ")"; MenuStats.VentStats.Text = "(" + CommonCode.TranslateText(79) + ")"; MenuStats.FoudreStats.Text = "(" + CommonCode.TranslateText(80) + ")"; MenuStats.EauStats.Text = "(" + CommonCode.TranslateText(81) + ")"; MenuStats.TerrePuissance.Text = "(" + pi.doton + "+" + pi.equipedDoton + ")=" + (pi.doton + pi.equipedDoton); MenuStats.FeuPuissance.Text = "(" + pi.katon + "+" + pi.equipedKaton + ")=" + (pi.katon + pi.equipedKaton); MenuStats.VentPuissance.Text = "(" + pi.futon + "+" + pi.equipedFuton + ")=" + (pi.futon + pi.equipedFuton); MenuStats.FoudrePuissance.Text = "(" + pi.raiton + "+" + pi.equipedRaiton + ")=" + (pi.raiton + pi.equipedRaiton); MenuStats.EauPuissance.Text = "(" + pi.suiton + "+" + pi.equipedSuiton + ")=" + (pi.suiton + pi.equipedSuiton); MenuStats.Lvl1RegleTxt.Text = CommonCode.TranslateText(82); MenuStats.Lvl2RegleTxt.Text = CommonCode.TranslateText(83); MenuStats.Lvl3RegleTxt.Text = CommonCode.TranslateText(84); MenuStats.Lvl4RegleTxt.Text = CommonCode.TranslateText(85); MenuStats.Lvl5RegleTxt.Text = CommonCode.TranslateText(86); MenuStats.Lvl6RegleTxt.Text = CommonCode.TranslateText(87); // affichage de la gauge lvl chakra selon les points MenuStats.Lvl2ReglePts.Text = CommonCode.chakra1Level.ToString(); MenuStats.Lvl3ReglePts.Text = CommonCode.chakra2Level.ToString(); MenuStats.Lvl4ReglePts.Text = CommonCode.chakra3Level.ToString(); MenuStats.Lvl5ReglePts.Text = CommonCode.chakra4Level.ToString(); MenuStats.Lvl6ReglePts.Text = CommonCode.chakra5Level.ToString(); // modification du lvl de l'utilisation de l'element CommonCode.UpdateUsingElement(Enums.Chakra.Element.doton, pi.usingDoton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.katon, pi.usingKaton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.futon, pi.usingFuton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.raiton, pi.usingRaiton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.suiton, pi.equipedSuiton); MenuStats.DotonLvl.Text = pi.usingDoton.ToString(); MenuStats.KatonLvl.Text = pi.usingKaton.ToString(); MenuStats.FutonLvl.Text = pi.usingFuton.ToString(); MenuStats.RaitonLvl.Text = pi.usingRaiton.ToString(); MenuStats.SuitonLvl.Text = pi.usingSuiton.ToString(); // bar de vie selon les pdv 11 current, 12 total int TotalPdv = pi.maxHealth; int CurrentPdv = pi.currentHealth; int X = 0; if (TotalPdv != 0) { X = (CurrentPdv * 100) / TotalPdv; } MenuStats.VieBar.size.Width = (236 * X) / 100; // point de vie dans Menustats MenuStats.VieLabel.Text = CommonCode.TranslateText(88); MenuStats.ViePts.Text = CurrentPdv.ToString() + " / " + TotalPdv + " (" + X + "%)"; //MenuStats.PCLabel.Text = common1.TranslateText(89); MenuStats.PC.Text = pi.originalPc.ToString(); //MenuStats.PMLabel.Text = common1.TranslateText(90); MenuStats.PM.Text = pi.originalPm.ToString(); //MenuStats.PELabel.Text = common1.TranslateText(91); MenuStats.PE.Text = pi.pe.ToString(); //MenuStats.CDLabel.Text = common1.TranslateText(92); MenuStats.CD.Text = pi.cd.ToString(); //MenuStats.InvocLabel.Text = common1.TranslateText(93); MenuStats.Invoc.Text = pi.summons.ToString(); //MenuStats.InitiativeLabel.Text = common1.TranslateText(94); MenuStats.Initiative.Text = pi.initiative.ToString(); MenuStats.Job1Label.Text = CommonCode.TranslateText(95) + " 1"; MenuStats.Specialite1Label.Text = CommonCode.TranslateText(96) + " 1"; MenuStats.Job2Labe1.Text = CommonCode.TranslateText(95) + " 2"; MenuStats.Specialite2Label.Text = CommonCode.TranslateText(96) + " 2"; //////// playerData[41] = job1 //////// playerdata[42] = job2 //////// playerdata[43] = specialite1 //////// playerdata[44] = specialite2 MenuStats.PoidLabel.Text = CommonCode.TranslateText(97); int TotalPoid = pi.maxWeight; int CurrentPoid = pi.currentWeight; int PercentPoid = (CurrentPoid * 100) / TotalPoid; MenuStats.PoidRec.size.Width = (116 * PercentPoid) / 100; MenuStats.Poid.Text = CurrentPoid + " / " + TotalPoid + " (" + PercentPoid + "%)"; MenuStats.Poid.point.X = MenuStats.PoidRec.point.X + 58 - (TextRenderer.MeasureText(MenuStats.Poid.Text, MenuStats.Poid.font).Width / 2); MenuStats.Ryo.Text = CommonCode.MoneyThousendSeparation(pi.ryo.ToString()); MenuStats.resiDotonTxt.Text = pi.resiDotonPercent.ToString() + "%"; MenuStats.resiKatonTxt.Text = pi.resiKatonPercent.ToString() + "%"; MenuStats.resiFutonTxt.Text = pi.resiFutonPercent.ToString() + "%"; MenuStats.resiRaitonTxt.Text = pi.resiRaitonPercent.ToString() + "%"; MenuStats.resiSuitonTxt.Text = pi.resiSuitonPercent.ToString() + "%"; MenuStats.__esquivePC_Txt.Text = pi.dodgePc.ToString(); MenuStats.__esquivePM_Txt.Text = pi.dodgePm.ToString(); MenuStats.__retraitPC_Txt.Text = pi.removePc.ToString(); MenuStats.__retraitPM_Txt.Text = pi.removePm.ToString(); pi.spellPointLeft = spellPointLeft; #endregion } else if (args.Length == 6 && args[1] == "recheckPosition") // not used { #region /*/cmd•recheckPosition•pseudo•posX,posY•orientatuin•pm rstant si on combat * string[] p = cmd[3].Split(','); * if (Battle.state == "Started") * { * PlayerInfo piib = Battle.AllPlayersByOrder.Find(f => f.Pseudo == cmd[2]); * if(piib != null) * { * Point playerPosition = new Point(Convert.ToInt16(p[0]), Convert.ToInt16(p[1])); * if (piib.realPosition.X != playerPosition.X || piib.realPosition.Y != playerPosition.Y) * { * MessageBox.Show("la position du client n'est pas la meme avec le serveur, en combat\n" + cmd[3]); * } * } * } * else * { * if (commune.AllPlayers.Exists(i => (i.tag as PlayerInfo).Pseudo == cmd[2])) * { * Bmp ibPlayer = commune.AllPlayers.Find(i => (i.tag as PlayerInfo).Pseudo == cmd[2]); * Point playerPosition = new Point(Convert.ToInt16(p[0]), Convert.ToInt16(p[1])); * if ((ibPlayer.tag as PlayerInfo).realPosition.X != playerPosition.X || (ibPlayer.tag as PlayerInfo).realPosition.Y != playerPosition.Y) * { * MessageBox.Show("la position du client n'est pas la meme avec le serveur, hors combat"); * } * } * }*/ #endregion } else if (args.Length == 2 && args[1] == "spellIntervalNotReached") { #region sort ne peux pas être lancé dans le tour actuelle CommonCode.ChatMsgFormat("B", "null", CommonCode.TranslateText(114)); #endregion } else if (args.Length == 2 && args[1] == "spellRelanceParTourReached") { #region CommonCode.ChatMsgFormat("B", "null", CommonCode.TranslateText(150)); #endregion } else if (args.Length == 2 && args[1] == "spellRelanceParJoueurReached") { #region CommonCode.ChatMsgFormat("B", "null", CommonCode.TranslateText(151)); #endregion } else if (args.Length == 4 && args[1] == "BattlePosLocked") { #region joueur qui block sa position en étant en combat et en mode initialisation //cmd•BattlePosLocked•player•true or false pour lancer le combat Bmp __posLocked = new Bmp(@"gfx\general\obj\1\all1.dat", Point.Empty, "__posLocked_" + args[2], Manager.TypeGfx.Obj, true, 1, SpriteSheet.GetSpriteSheet("_Main_option", 61)); List <Actor> Lpiib = new List <Actor>(); Lpiib.AddRange(Battle.SideA); Lpiib.AddRange(Battle.SideB); Actor targetedPlayer = Lpiib.Find(f => f.pseudo == args[2]); if (targetedPlayer == null) { return; } Point p = new Point(targetedPlayer.ibPlayer.point.X + (targetedPlayer.ibPlayer.rectangle.Width / 2) - (__posLocked.rectangle.Width / 2), targetedPlayer.ibPlayer.point.Y - __posLocked.rectangle.Height - 5); __posLocked.zindex = targetedPlayer.ibPlayer.zindex; __posLocked.point = p; Manager.manager.GfxObjList.Add(__posLocked); if (args[3] == "True") { // le combat commance suite au validation des pos Battle.timeleft = 0; } #endregion } else if (args.Length == 3 && args[1] == "BattlePosUnlocked") { #region debloquage de la position en mode initialisation Manager.manager.GfxObjList.RemoveAll(f => f.Name().Length > 12 && f.Name() == "__posLocked_" + args[2]); #endregion } else if (args.Length == 2 && args[1] == "lockedPosition") { #region position verrouillé, quand un joueur a verrouillé sa pos et apres demande de la changer CommonCode.ChatMsgFormat("B", "null", CommonCode.TranslateText(152)); #endregion } else if (args.Length == 2 && args[1] == "spellNotEnoughInvoc") { #region pas assez de points d'invocation CommonCode.ChatMsgFormat("S", "", CommonCode.TranslateText(154)); #endregion } else if (args.Length == 2 && args[1] == "spellNeedEtatSennin") { #region pas assez de points d'invocation CommonCode.ChatMsgFormat("S", "", CommonCode.TranslateText(155)); #endregion } else if (args.Length > 2 && args[1] == "submitedQuest") { #region on cherche la quete chez le joueur // "cmd•submitedQuest•FirstFight•submited" Actor.QuestInformations qi = (CommonCode.MyPlayerInfo.instance.ibPlayer.tag as Actor).Quests.Find(f => f.nom_quete == args[2]); if (qi != null) { qi.submited = true; qi.currentStep = qi.totalSteps; if (args[2] == "FirstFight") { // 1ere quete contre iruka CommonCode.ChatMsgFormat("I", "System", CommonCode.TranslateText(184).Replace("%q%", qi.nom_quete)); } } else { MessageBox.Show("une incoherance est trouvé sur le systeme des quete."); } #endregion } else if (args.Length > 2 && args[1] == "beganQuete") { #region ajouter une quete au joueur //"cmd•beganQuete•nom quete" Actor.QuestInformations qi = new Actor.QuestInformations(); qi.nom_quete = args[2]; (CommonCode.MyPlayerInfo.instance.ibPlayer.tag as Actor).Quests.Add(qi); CommonCode.ChatMsgFormat("I", "System", CommonCode.TranslateText(183).Replace("%q%", qi.nom_quete)); #endregion } else if (args.Length == 5 && args[1] == "upgradedSpell") { #region augementation du level d'un sort //cmd•upgradedSpell•sortID•level•spellPointsLeft Actor pi = CommonCode.MyPlayerInfo.instance.ibPlayer.tag as Actor; int sortID = Convert.ToInt16(args[2]); int sortLvl = Convert.ToInt16(args[3]); pi.spells.Find(f => f.sortID == sortID).level = sortLvl; pi.spellPointLeft = Convert.ToInt16(args[4]); // on check si le panneau affichage de sort est present pour augementer le sort visuellement if (Manager.manager.GfxTopList.Exists(f => f.Name() == "__showSpellsParent")) { MainForm.drawSpellsMenuInParent(); // mise à jours des points de sorts disponible au cas ou un changement à eu lieu // cadre général parent Rec showSpellsParent = Manager.manager.GfxTopList.Find(f => f.Name() == "__showSpellsParent") as Rec; Txt spellPointsLeftValue = showSpellsParent.Child.Find(f => f.Name() == "__spellPointsLeftValue") as Txt; spellPointsLeftValue.Text = pi.spellPointLeft.ToString(); } #endregion } else if (args.Length == 3 && args[1] == "spellHandlerNotFound") { // cmd•spellHandlerNotFound•" + spell.spellName CommonCode.ChatMsgFormat("I", "System", CommonCode.TranslateText(191) + " " + args[2]); } else if (args.Length == 2 && args[1] == "spellTargetNotAllowed") { // cmd•spellHandlerNotFound•" + spell.spellName CommonCode.ChatMsgFormat("I", "System", CommonCode.TranslateText(192) + " " + args[1]); } }
public void Fetch(string[] commandStrings) { /*SelectActorGrantedResponseMessage• * string buffer = actor.Pseudo + "#" + actor.ClasseName + "#" + actor.Spirit + "#" + * actor.SpiritLvl.ToString() + "#" + actor.Pvp.ToString() + "#" + actor.village + "#" + actor.MaskColors + "#" + * actor.Orientation.ToString() + "#" + actor.Level.ToString() + "#" + actor.map + "#" + actor.rang.ToString() + * "#" + actor.currentHealth.ToString() + "#" + actor.totalHealth.ToString() + "#" + actor.xp.ToString() + * "#" + totalXp + "#" + actor.doton.ToString() + "#" + actor.katon.ToString() + "#" + * actor.futon.ToString() + "#" + actor.raiton.ToString() + "#" + actor.suiton.ToString() + "#" + * MainClass.chakralvl2 + "#" + MainClass.chakralvl3 + "#" + MainClass.chakralvl4 + "#" + * MainClass.chakralvl5 + "#" + MainClass.chakralvl6 + "#" + actor.usingDoton.ToString() + "#" + * actor.usingKaton.ToString() + "#" + actor.usingFuton.ToString() + "#" + actor.usingRaiton.ToString() + * "#" + actor.usingSuiton.ToString() + "#" + actor.equipedDoton.ToString() + "#" + * actor.equipedKaton.ToString() + "#" + actor.equipedFuton.ToString() + "#" + * actor.equipedRaiton.ToString() + "#" + actor.suitonEquiped.ToString() + "#" + * actor.original_Pc.ToString() + "#" + actor.original_Pm.ToString() + "#" + actor.pe.ToString() + "#" + * actor.cd.ToString() + "#" + actor.invoc.ToString() + "#" + actor.Initiative.ToString() + "#" + * actor.job1 + "#" + actor.job2 + "#" + actor.specialite1 + "#" + * actor.specialite2 + "#" + actor.TotalPoid.ToString() + "#" + actor.CurrentPoid.ToString() + * "#" + actor.Ryo.ToString() + "#" + actor.resiDotonPercent.ToString() + "#" + * actor.resiKatonPercent.ToString() + "#" + actor.resiFutonPercent.ToString() + "#" + * actor.resiRaitonPercent.ToString() + "#" + actor.resiSuitonPercent.ToString() + "#" + * actor.dodgePC.ToString() + "#" + actor.dodgePM.ToString() + "#" + actor.dodgePE.ToString() + "#" + * actor.dodgeCD.ToString() + "#" + actor.removePC.ToString() + "#" + actor.removePM.ToString() + "#" + * actor.removePE.ToString() + "#" + actor.removeCD.ToString() + "#" + actor.escape.ToString() + "#" + * actor.blocage.ToString() + "#" + _sorts + "#" + actor.resiDotonFix + "#" + actor.resiKatonFix + "#" + * actor.resiFutonFix + "#" + actor.resiRaitonFix + "#" + actor.resiSuitonFix + "#" + actor.resiFix + "#" + * actor.domDotonFix + "#" + actor.domKatonFix + "#" + actor.domFutonFix + "#" + actor.domRaitonFix + "#" + * actor.domSuitonFix + "#" + actor.domFix + "#" + actor.power + "#" + actor.powerEquiped + * "•" + quete + * "•inBattle•" + actor.spellPointLeft; */ #region reception des données du joueur qui a été selectionné dans la liste des joueurs // cmd[2] = Pseudo#ClasseName#Spirit#SpiritLvl#Pvp#village#MaskColors#Orientation#Level#map#rang#CurrentPdv#totalPdv#CurrentXP#TotalXp#doton#katon#futon#raiton#suiton#chakralvl2#chakralvl3#chakralvl4#chakralvl5#chakralvl6#usingDoton#usingKaton#usingFuton#usingRaiton#usingSuiton#equipedDoton#equipedKaton#equipedFuton#equipedRaiton#suitonEquiped#pc#pm#pe#cd#invoc#Initiative#job1#job2#specialite1#specialite2#TotalPoid#CurrentPoid#Ryo#resiDoton#resiKaton#resiFuton#resiRaiton#resiSuiton#evasion#blockage#sorts#resiDotonFix#resiKatonFix#resiFutonFix#resiRaitonFix#resiSuitonFix#resiFix#domDotonFix#domKatonFix#domFutonFix#domRaitonFix#domSuitonFix#domFix#puissance#puissanceEquiped string[] playerData = commandStrings[1].Split('#'); string actorName = playerData[0]; Enums.ActorClass.ClassName className = (Enums.ActorClass.ClassName)Enum.Parse(typeof(Enums.ActorClass.ClassName), playerData[1]); Enums.Spirit.Name spirit = (Enums.Spirit.Name)Enum.Parse(typeof(Enums.Spirit.Name), playerData[2]); int spiritLevel = int.Parse(playerData[3]); bool pvpEnabled = bool.Parse(playerData[4]); Enums.HiddenVillage.Names hiddenVillage = (Enums.HiddenVillage.Names)Enum.Parse(typeof(Enums.HiddenVillage.Names), playerData[5]); string maskColorsString = playerData[6]; string[] maskColors = playerData[6].Split('/'); int orientation = int.Parse(playerData[7]); int level = int.Parse(playerData[8]); string map = playerData[9]; Enums.Rang.official officialRang = (Enums.Rang.official)Enum.Parse(typeof(Enums.Rang.official), playerData[10]); int currentHealth = int.Parse(playerData[11]); int maxHealth = int.Parse(playerData[12]); int currentXp = int.Parse(playerData[13]); int maxXp = int.Parse(playerData[14]); int doton = int.Parse(playerData[15]); int katon = int.Parse(playerData[16]); int futon = int.Parse(playerData[17]); int raiton = int.Parse(playerData[18]); int suiton = int.Parse(playerData[19]); int chakra1Level = int.Parse(playerData[20]); int chakra2Level = int.Parse(playerData[21]); int chakra3Level = int.Parse(playerData[22]); int chakra4Level = int.Parse(playerData[23]); int chakra5Level = int.Parse(playerData[24]); int usingDoton = int.Parse(playerData[25]); int usingKaton = int.Parse(playerData[26]); int usingFuton = int.Parse(playerData[27]); int usingRaiton = int.Parse(playerData[28]); int usingSuiton = int.Parse(playerData[29]); int equipedDoton = int.Parse(playerData[30]); int equipedKaton = int.Parse(playerData[31]); int equipedFuton = int.Parse(playerData[32]); int equipedRaiton = int.Parse(playerData[33]); int equipedSuiton = int.Parse(playerData[34]); int originalPc = int.Parse(playerData[35]); int originalPm = int.Parse(playerData[36]); int pe = int.Parse(playerData[37]); int cd = int.Parse(playerData[38]); int summon = int.Parse(playerData[39]); int initiative = int.Parse(playerData[40]); string job1 = playerData[41]; string job2 = playerData[42]; string specialty1 = playerData[43]; string specialty2 = playerData[44]; int maxWeight = int.Parse(playerData[45]); int currentWeight = int.Parse(playerData[46]); int ryo = int.Parse(playerData[47]); int resiDotonPercent = int.Parse(playerData[48]); int resiKatonPercent = int.Parse(playerData[49]); int resiFutonPercent = int.Parse(playerData[50]); int resiRaitonPercent = int.Parse(playerData[51]); int resiSuitonPercent = int.Parse(playerData[52]); int dodgePc = int.Parse(playerData[53]); int dodgePm = int.Parse(playerData[54]); int dodgePe = int.Parse(playerData[55]); int dodgeCd = int.Parse(playerData[56]); int removePc = int.Parse(playerData[57]); int removePm = int.Parse(playerData[58]); int removePe = int.Parse(playerData[59]); int removeCd = int.Parse(playerData[60]); int escape = int.Parse(playerData[61]); int blocage = int.Parse(playerData[62]); string spells = playerData[63]; int resiDotonFix = int.Parse(playerData[64]); int resiKatonFix = int.Parse(playerData[65]); int resiFutonFix = int.Parse(playerData[66]); int resiRaitonFix = int.Parse(playerData[67]); int resiSuitonFix = int.Parse(playerData[68]); int resiFix = int.Parse(playerData[69]); int domDotonFix = int.Parse(playerData[70]); int domKatonFix = int.Parse(playerData[71]); int domFutonFix = int.Parse(playerData[72]); int domRaitonFix = int.Parse(playerData[73]); int domSuitonFix = int.Parse(playerData[74]); int domFix = int.Parse(playerData[75]); int power = int.Parse(playerData[76]); int equipedPower = int.Parse(playerData[77]); string quest = commandStrings[2]; bool inBattle = bool.Parse(commandStrings[3]); // ce variable est controlé dans chaque map "Start + _0_0_0" pour voir si le joueur est en combat, c'est au niveau des map que le system decoReco fonction, il faut penser a retirer ce systeme des map et de le mettre ici, voir map Start "if (CommonCode.MyPlayerInfo.instance.Event == "inBattle")" et map _0_0_0 int spellPointLeft = int.Parse(commandStrings[4]); new System.Threading.Thread((() => { // on affiche une fenetre de chargement // compteur pour voir si le temps passé est sufisant pour voir le chargement, si non on oblige le joueur a patienter le reste du temps détérminé pour l'animation qui est de 300 miliseconds Benchmark.Start(); Bmp loadingParent = new Bmp(@"gfx\general\artwork\loading\" + className + ".dat", new Point(0, 0), "__loadingParent", Manager.TypeGfx.Bgr, true, 1); loadingParent.zindex = 100; Manager.manager.GfxTopList.Add(loadingParent); // barre de chargement Bmp loadingGif = new Bmp(@"gfx\general\obj\1\loading1.dat", Point.Empty, "__loadingGif", Manager.TypeGfx.Bgr, true); loadingGif.point = new Point((ScreenManager.WindowWidth / 2) - (loadingGif.rectangle.Width / 2), ScreenManager.WindowHeight - 50); loadingParent.Child.Add(loadingGif); Txt loadingLabel = new Txt(CommonCode.TranslateText(187), Point.Empty, "__loadingLabel", Manager.TypeGfx.Top, true, new Font("Verdana", 10, FontStyle.Bold), Brushes.White); loadingLabel.point = new Point((ScreenManager.WindowWidth / 2) - (TextRenderer.MeasureText(loadingLabel.Text, loadingLabel.font).Width / 2), 610); loadingParent.Child.Add(loadingLabel); Anim LoadingSystemStart = new Anim(15, 1); for (int cnt = 0; cnt < 15; cnt++) { LoadingSystemStart.AddCell(@"gfx\general\obj\1\LoadingSystem.dat", 0, 300 + (cnt * 12), 550, 25 + (cnt * 2), 25 + (cnt * 2), 0.1F * (Convert.ToSingle(cnt)), 15); } LoadingSystemStart.AddCell(@"gfx\general\obj\1\LoadingSystem.dat", 0, 300 + (15 * 12), 550, 25 + (15 * 2), 25 + (15 * 2), 0.1F * (Convert.ToSingle(15)), 15); LoadingSystemStart.Ini(Manager.TypeGfx.Top, "__LoadingSystemStart", true); LoadingSystemStart.AutoResetAnim = false; LoadingSystemStart.Start(); loadingParent.Child.Add(LoadingSystemStart); ///////////////////////////////////////////////////////////// CommonCode.MyPlayerInfo.instance.ibPlayer = new Bmp(); CommonCode.MyPlayerInfo.instance.ibPlayer.tag = new Actor(); Actor actor = (Actor)CommonCode.MyPlayerInfo.instance.ibPlayer.tag; actor.pseudo = actorName; actor.className = className; actor.spirit = spirit; actor.spiritLevel = spiritLevel; actor.pvpEnabled = pvpEnabled; actor.hiddenVillage = hiddenVillage; actor.maskColorString = maskColorsString; actor.directionLook = orientation; actor.level = level; actor.map = map; actor.officialRang = officialRang; actor.currentHealth = currentHealth; actor.maxHealth = maxHealth; actor.currentXp = currentXp; actor.maxXp = maxXp; actor.doton = doton; actor.katon = katon; actor.futon = futon; actor.raiton = raiton; actor.suiton = suiton; // association des données des chakralvl2,3,4,5 CommonCode.chakra1Level = chakra1Level; CommonCode.chakra2Level = chakra2Level; CommonCode.chakra3Level = chakra3Level; CommonCode.chakra4Level = chakra4Level; CommonCode.chakra5Level = chakra5Level; actor.usingDoton = usingDoton; actor.usingKaton = usingKaton; actor.usingFuton = usingFuton; actor.usingRaiton = usingRaiton; actor.usingSuiton = usingSuiton; actor.equipedDoton = equipedDoton; actor.equipedKaton = equipedKaton; actor.equipedFuton = equipedFuton; actor.equipedRaiton = equipedRaiton; actor.equipedSuiton = equipedSuiton; actor.originalPc = originalPc; actor.originalPm = originalPm; actor.pe = pe; actor.cd = cd; actor.summons = summon; actor.initiative = initiative; actor.job1 = job1; actor.job2 = job2; actor.specialty1 = specialty1; actor.specialty2 = specialty2; actor.maxWeight = maxWeight; actor.currentWeight = currentWeight; actor.ryo = ryo; actor.resiDotonPercent = resiDotonPercent; actor.resiKatonPercent = resiKatonPercent; actor.resiFutonPercent = resiFutonPercent; actor.resiRaitonPercent = resiRaitonPercent; actor.resiSuitonPercent = resiSuitonPercent; actor.dodgePc = dodgePc; actor.dodgePm = dodgePm; actor.dodgePe = dodgePe; actor.dodgeCd = dodgeCd; actor.removePc = removePc; actor.removePm = removePm; actor.removePe = removePe; actor.removeCd = removeCd; actor.escape = escape; actor.blocage = blocage; string _sorts = spells; if (_sorts != "") { for (int cnt = 0; cnt < _sorts.Split('|').Length; cnt++) { string tmp_data = _sorts.Split('|')[cnt]; Actor.SpellsInformations _info_sorts = new Actor.SpellsInformations(); _info_sorts.sortID = Convert.ToInt32(tmp_data.Split(':')[0]); _info_sorts.emplacement = Convert.ToInt32(tmp_data.Split(':')[1]); _info_sorts.level = Convert.ToInt32(tmp_data.Split(':')[2]); _info_sorts.colorSort = Convert.ToInt32(tmp_data.Split(':')[3]); actor.spells.Add(_info_sorts); } } actor.resiDotonFix = resiDotonFix; actor.resiKatonFix = resiKatonFix; actor.resiFutonFix = resiFutonFix; actor.resiRaitonFix = resiRaitonFix; actor.resiSuitonFix = resiSuitonFix; actor.resiFix = resiFix; // supression des sorts s'il sont déja été affiché avant if (HudHandle.all_sorts.Child.Count > 0) { HudHandle.all_sorts.Child.Clear(); } // affichage des sorts foreach (Actor.SpellsInformations t in actor.spells) { Bmp __spell = new Bmp(@"gfx\general\obj\1\spells.dat", new Point(MMORPG.spells.spellPositions[t.emplacement].X, MMORPG.spells.spellPositions[t.emplacement].Y), "__spell", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet(t.sortID + "_spell", 0)); // attachement des infos du sort au tag de l'image __spell.tag = t; __spell.MouseMove += MMORPG.Battle.__spell_MouseMove; __spell.MouseOut += CommonCode.CursorDefault_MouseOut; __spell.MouseClic += MMORPG.Battle.__spell_MouseClic; HudHandle.all_sorts.Child.Add(__spell); } actor.domDotonFix = domDotonFix; actor.domKatonFix = domKatonFix; actor.domFutonFix = domFutonFix; actor.domRaitonFix = domRaitonFix; actor.domSuitonFix = domSuitonFix; actor.domFix = domFix; actor.power = power; actor.equipedPower = equipedPower; CommonCode.CurMap = actor.map; Benchmark.End(); System.Threading.Thread.Sleep(225); loadingLabel.Text = CommonCode.TranslateText(188); loadingLabel.point = new Point((ScreenManager.WindowWidth / 2) - (TextRenderer.MeasureText(loadingLabel.Text, loadingLabel.font).Width / 2), 610); ////////////////// mode designe LoadingSystemStart.Visible(false); loadingParent.Child.Remove(LoadingSystemStart); Anim LoadingSystemEnd = new Anim(15, 1); for (int cnt = 0; cnt < 15; cnt++) { LoadingSystemEnd.AddCell(@"gfx\general\obj\1\LoadingSystem.dat", 0, LoadingSystemStart.img.point.X + (cnt * 12), 550, 25 + ((15 - cnt) * 2), 25 + ((15 - cnt) * 2), 0.1F * (Convert.ToSingle(15 - cnt)), 15); } LoadingSystemEnd.Ini(Manager.TypeGfx.Top, "__LoadingSystemEnd", true); LoadingSystemEnd.AutoResetAnim = false; LoadingSystemEnd.Start(); loadingParent.Child.Add(LoadingSystemEnd); Anim LoadingGfxStart = new Anim(15, 1); for (int cnt = 0; cnt < 15; cnt++) { LoadingGfxStart.AddCell(@"gfx\general\obj\1\GrayPaletteColor.dat", 0, 300 + (cnt * 12), 550, 25 + (cnt * 2), 25 + (cnt * 2), 0.1F * (Convert.ToSingle(cnt)), 15); } LoadingGfxStart.AddCell(@"gfx\general\obj\1\paletteColor.dat", 0, 300 + (15 * 12), 550, 25 + (15 * 2), 25 + (15 * 2), 0.1F * (Convert.ToSingle(15)), 15); LoadingGfxStart.Ini(Manager.TypeGfx.Top, "__paletteColor", true); LoadingGfxStart.AutoResetAnim = false; LoadingGfxStart.Start(); loadingParent.Child.Add(LoadingGfxStart); loadingLabel.Text = CommonCode.TranslateText(189); loadingLabel.point = new Point((ScreenManager.WindowWidth / 2) - (TextRenderer.MeasureText(loadingLabel.Text, loadingLabel.font).Width / 2), 610); ///////////////// affichage des composants du tableau stats // affichage de l'avatar MenuStats.ThumbsAvatar = new Bmp(@"gfx\general\classes\" + actor.className + ".dat", new Point(15, 10), "ThumbsAvatar", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet("avatar_" + actor.className, 0)); MenuStats.ThumbsAvatar.tag = CommonCode.MyPlayerInfo.instance.ibPlayer.tag; CommonCode.ApplyMaskColorToClasse(MenuStats.ThumbsAvatar); MenuStats.StatsImg.Child.Add(MenuStats.ThumbsAvatar); // affichage du nom du personnage MenuStats.StatsPlayerName.Text = actor.pseudo[0].ToString().ToUpper() + actor.pseudo.Substring(1, actor.pseudo.Length - 1); // level MenuStats.StatsLevel.Text = CommonCode.TranslateText(50) + " " + actor.level; // affichage du rang général MenuStats.Rang.Text = CommonCode.officialRangToCurrentLangTranslation(actor.officialRang); // affichage du level Pvp MenuStats.LevelPvp.Text = actor.spiritLevel.ToString(); // affichage du grade Pvp if (spirit != Enums.Spirit.Name.neutral) { MenuStats.GradePvp = new Bmp(@"gfx\general\obj\2\" + actor.spirit + @"\" + MenuStats.LevelPvp.Text + ".dat", new Point(276 + (15 - Convert.ToInt16(MenuStats.LevelPvp.Text)), 2), new Size(40 + Convert.ToInt16(MenuStats.LevelPvp.Text), 20 + Convert.ToInt16(MenuStats.LevelPvp.Text)), "PlayerStats." + actor.spirit, Manager.TypeGfx.Top, true, 1); MenuStats.StatsImg.Child.Add(MenuStats.GradePvp); } // update des pdv,Pc HudHandle.UpdateHealth(); HudHandle.UpdatePc(); HudHandle.UpdatePm(); MenuStats.Flag = new Bmp(@"gfx\general\obj\1\pays_thumbs.dat", new Point(240, 8), "__Flag", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet("pays_" + actor.hiddenVillage + "_thumbs", 0)); MenuStats.StatsImg.Child.Add(MenuStats.Flag); MenuStats.LFlag.Text = playerData[5]; MenuStats.Fusion1.Text = CommonCode.TranslateText(75); MenuStats.Fusion2.Text = CommonCode.TranslateText(75); MenuStats.NiveauGaugeTxt.Text = CommonCode.TranslateText(50) + " " + actor.level; // NiveauGaugeRecPercent, barre de progression du niveau // calcule du pourcentage du niveau en progression int CurrentProgressLevel = actor.currentXp; int TotalProgressLevel = actor.maxXp; int PercentProgressLevel; if (TotalProgressLevel != 0) { PercentProgressLevel = (CurrentProgressLevel * 100) / TotalProgressLevel; } else { PercentProgressLevel = 100; } MenuStats.NiveauGaugeRecPercent.size.Width = (258 * PercentProgressLevel) / 100; // affichage du label progression lvl MenuStats.NiveauGaugeTxtCurrent.Text = CurrentProgressLevel + "/" + TotalProgressLevel + " (" + PercentProgressLevel + "%)"; MenuStats.NiveauGaugeTxtCurrent.point = new Point(MenuStats.NiveauGaugeRec2.point.X + (MenuStats.NiveauGaugeRec2.size.Width / 2) - (TextRenderer.MeasureText(MenuStats.NiveauGaugeTxtCurrent.Text, MenuStats.NiveauGaugeTxtCurrent.font).Width / 2), MenuStats.NiveauGaugeRec2.point.Y); // raffrechissement du text pour des mesures de changement de langue MenuStats.AffiniteElementaireTxt.Text = CommonCode.TranslateText(76); MenuStats.terreStats.Text = "(" + CommonCode.TranslateText(77) + ")"; MenuStats.FeuStats.Text = "(" + CommonCode.TranslateText(78) + ")"; MenuStats.VentStats.Text = "(" + CommonCode.TranslateText(79) + ")"; MenuStats.FoudreStats.Text = "(" + CommonCode.TranslateText(80) + ")"; MenuStats.EauStats.Text = "(" + CommonCode.TranslateText(81) + ")"; MenuStats.TerrePuissance.Text = "(" + actor.doton + "+" + actor.equipedDoton + ")=" + (actor.doton + actor.equipedDoton); MenuStats.FeuPuissance.Text = "(" + actor.katon + "+" + actor.equipedKaton + ")=" + (actor.katon + actor.equipedKaton); MenuStats.VentPuissance.Text = "(" + actor.futon + "+" + actor.equipedFuton + ")=" + (actor.futon + actor.equipedFuton); MenuStats.FoudrePuissance.Text = "(" + actor.raiton + "+" + actor.equipedRaiton + ")=" + (actor.raiton + actor.equipedRaiton); MenuStats.EauPuissance.Text = "(" + actor.suiton + "+" + actor.equipedSuiton + ")=" + (actor.suiton + actor.equipedSuiton); MenuStats.Lvl1RegleTxt.Text = CommonCode.TranslateText(82); MenuStats.Lvl2RegleTxt.Text = CommonCode.TranslateText(83); MenuStats.Lvl3RegleTxt.Text = CommonCode.TranslateText(84); MenuStats.Lvl4RegleTxt.Text = CommonCode.TranslateText(85); MenuStats.Lvl5RegleTxt.Text = CommonCode.TranslateText(86); MenuStats.Lvl6RegleTxt.Text = CommonCode.TranslateText(87); // affichage de la gauge lvl chakra selon les points MenuStats.Lvl2ReglePts.Text = CommonCode.chakra1Level.ToString(); MenuStats.Lvl3ReglePts.Text = CommonCode.chakra2Level.ToString(); MenuStats.Lvl4ReglePts.Text = CommonCode.chakra3Level.ToString(); MenuStats.Lvl5ReglePts.Text = CommonCode.chakra4Level.ToString(); MenuStats.Lvl6ReglePts.Text = CommonCode.chakra5Level.ToString(); // modification du lvl de l'utilisation de l'element CommonCode.UpdateUsingElement(Enums.Chakra.Element.doton, actor.usingDoton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.katon, actor.usingKaton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.futon, actor.usingFuton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.raiton, actor.usingRaiton); CommonCode.UpdateUsingElement(Enums.Chakra.Element.suiton, actor.equipedSuiton); MenuStats.DotonLvl.Text = actor.usingDoton.ToString(); MenuStats.KatonLvl.Text = actor.usingKaton.ToString(); MenuStats.FutonLvl.Text = actor.usingFuton.ToString(); MenuStats.RaitonLvl.Text = actor.usingRaiton.ToString(); MenuStats.SuitonLvl.Text = actor.usingSuiton.ToString(); // bar de vie selon les pdv 11 current, 12 total int _maxHealth = actor.maxHealth; int _currentHealth = actor.currentHealth; int X = 0; if (_maxHealth != 0) { X = (_currentHealth * 100) / _maxHealth; } MenuStats.VieBar.size.Width = (236 * X) / 100; // point de vie dans Menustats MenuStats.VieLabel.Text = CommonCode.TranslateText(88); MenuStats.ViePts.Text = _currentHealth.ToString() + " / " + _maxHealth + " (" + X + "%)"; MenuStats.PC.Text = actor.originalPc.ToString(); MenuStats.PM.Text = actor.originalPm.ToString(); MenuStats.PE.Text = actor.pe.ToString(); MenuStats.CD.Text = actor.cd.ToString(); MenuStats.Invoc.Text = actor.summons.ToString(); MenuStats.Initiative.Text = actor.initiative.ToString(); MenuStats.Puissance.Text = (actor.power + actor.equipedPower).ToString(); MenuStats.DomFix.Text = actor.domFix.ToString(); MenuStats.Job1Label.Text = CommonCode.TranslateText(95) + " 1"; MenuStats.Specialite1Label.Text = CommonCode.TranslateText(96) + " 1"; MenuStats.Job2Labe1.Text = CommonCode.TranslateText(95) + " 2"; MenuStats.Specialite2Label.Text = CommonCode.TranslateText(96) + " 2"; MenuStats.PoidLabel.Text = CommonCode.TranslateText(97); int TotalPoid = actor.maxWeight; int CurrentPoid = actor.currentWeight; int PercentPoid = (CurrentPoid * 100) / TotalPoid; MenuStats.PoidRec.size.Width = (116 * PercentPoid) / 100; MenuStats.Poid.Text = CurrentPoid + " / " + TotalPoid + " (" + PercentPoid + "%)"; MenuStats.Poid.point.X = MenuStats.PoidRec.point.X + 58 - (TextRenderer.MeasureText(MenuStats.Poid.Text, MenuStats.Poid.font).Width / 2); MenuStats.Ryo.Text = CommonCode.MoneyThousendSeparation(actor.ryo.ToString()); MenuStats.resiDotonTxt.Text = actor.resiDotonPercent.ToString() + "%"; MenuStats.resiKatonTxt.Text = actor.resiKatonPercent.ToString() + "%"; MenuStats.resiFutonTxt.Text = actor.resiFutonPercent.ToString() + "%"; MenuStats.resiRaitonTxt.Text = actor.resiRaitonPercent.ToString() + "%"; MenuStats.resiSuitonTxt.Text = actor.resiSuitonPercent.ToString() + "%"; MenuStats.__esquivePC_Txt.Text = actor.dodgePc.ToString(); MenuStats.__esquivePM_Txt.Text = actor.dodgePm.ToString(); MenuStats.__retraitPC_Txt.Text = actor.removePc.ToString(); MenuStats.__retraitPM_Txt.Text = actor.removePm.ToString(); // quete // convertir la list de quete en string if (quest != "") { for (int cnt = 0; cnt < quest.Split('/').Length; cnt++) { string quete = quest.Split('/')[cnt]; Actor.QuestInformations qi = new Actor.QuestInformations(); qi.nom_quete = quete.Split(':')[0]; qi.totalSteps = Convert.ToInt16(quete.Split(':')[1]); qi.currentStep = Convert.ToInt16(quete.Split(':')[2]); qi.submited = Convert.ToBoolean(quete.Split(':')[3]); actor.Quests.Add(qi); } } // verification si le joueur été en combat pour le rediriger vers ce joueur if (inBattle) { CommonCode.MyPlayerInfo.instance.pseudo = actor.pseudo; CommonCode.MyPlayerInfo.instance.Event = "inBattle"; } actor.spellPointLeft = spellPointLeft; ///// effacement du menu loading loadingLabel.Text = CommonCode.TranslateText(190); loadingLabel.point = new Point((ScreenManager.WindowWidth / 2) - (TextRenderer.MeasureText(loadingLabel.Text, loadingLabel.font).Width / 2), 610); System.Threading.Thread.Sleep(2000); // changement de map Manager.manager.mainForm.BeginInvoke((Action)(() => { CommonCode.ChangeMap(actor.map); // affichage du hud Manager.manager.GfxTopList.Remove(loadingParent); })); //////////////////////// affichage du hud Manager.manager.mainForm.BeginInvoke((Action)(() => { //////////// menu des sorts MainForm.drawSpellStatesMenuOnce(); HudHandle.HudVisibility(true); // affichage du hud })); })).Start(); #endregion }
void SendBtn_MouseClic(Bmp bmp, MouseEventArgs e) { RichTextBoxEx ChatArea = MainForm.chatBox.Controls.Find("ChatArea", false)[0] as RichTextBoxEx; if (HudHandle.SelectedCanalTxt.Text == "P" && HudHandle.ChatTextBox.TextLength > CommonCode.MyPlayerInfo.instance.pseudo.Length && HudHandle.ChatTextBox.Text.Substring(0, CommonCode.MyPlayerInfo.instance.pseudo.Length) == CommonCode.MyPlayerInfo.instance.pseudo) { ChatArea.AppendText((ChatArea.Text == "") ? "" : "\n"); ChatArea.SelectionStart = ChatArea.TextLength; ChatArea.SelectionLength = 0; ChatArea.SelectionColor = Color.Red; ChatArea.AppendText(CommonCode.TranslateText(28)); ChatArea.SelectionColor = ChatArea.ForeColor; } else if (HudHandle.ChatTextBox.Text != "") { if (HudHandle.SelectedCanalTxt.Text == "P" && HudHandle.ChatTextBox.Text.Split('#').Count() == 2) { // affichage du texte envoyé en mp en chat general ChatArea.AppendText((ChatArea.Text == "") ? "" : "\n"); ChatArea.SelectionStart = ChatArea.TextLength; ChatArea.SelectionLength = 0; ChatArea.SelectionColor = Color.Green; // pour recuperer le reste du texte quand l'utilisateur ajoute un # qui s'ajoute a celui du pseudo#...# string tmpMsg = ""; if (HudHandle.ChatTextBox.Text.Split('#').Length >= 2) { for (int cnt = 1; cnt < HudHandle.ChatTextBox.Text.Split('#').Length; cnt++) { tmpMsg += HudHandle.ChatTextBox.Text.Split('#')[cnt] + "#"; } tmpMsg = tmpMsg.Substring(0, tmpMsg.Length - 1); } ///////////////////// l'heur ChatArea.SelectionStart = ChatArea.TextLength; ChatArea.SelectionLength = 0; ChatArea.SelectionColor = Color.Green; ChatArea.AppendText("[" + DateTime.Now.ToString("HH:mm:ss") + "] "); ////////////////////////////////////////////////////// ChatArea.AppendText(CommonCode.TranslateText(3) + " "); ChatArea.InsertLink(" " + HudHandle.ChatTextBox.Text.Split('#')[0]); ChatArea.AppendText(" : "); // recherche l'existance d'un lien dans le text if (tmpMsg.IndexOf("[l/]") != -1 && tmpMsg.IndexOf("[\\l]") != -1 && tmpMsg.Length > 12) { // le texte contiens un lien // affichage du texte qui precede la balise ouverture de lien ChatArea.AppendText(tmpMsg.Substring(0, tmpMsg.IndexOf("[l/]")) + " "); string tmpMsg2 = tmpMsg.Substring(tmpMsg.IndexOf("[l/]") + 4, tmpMsg.IndexOf("[\\l]") - tmpMsg.IndexOf("[l/]") - 4); ChatArea.InsertLink(tmpMsg2); int pos1 = tmpMsg.IndexOf("[\\l]") + 4; string str1 = tmpMsg.Substring(pos1, tmpMsg.Length - pos1); ChatArea.AppendText(str1); } else { ChatArea.AppendText(tmpMsg); } ChatArea.SelectionColor = ChatArea.ForeColor; } Network.SendMessage("cmd•ChatMessage•" + HudHandle.SelectedCanalTxt.Text + "•" + HudHandle.ChatTextBox.Text, true); // enregistrement des messages sur le chatlog MainForm.ChatLog.Add(HudHandle.ChatTextBox.Text + "•" + HudHandle.SelectedCanalTxt.Text); HudHandle.ChatTextBox.Text = ""; HudHandle.ChannelState("G"); } }