Example #1
0
 public CreateNewActorRequestMessage(string nameOfNewActor, Enums.ActorClass.ClassName selectedClass, Enums.HiddenVillage.Names selectedHiddenVillage, string maskColor)
 {
     _nameOfNewActor        = nameOfNewActor;
     _selectedClass         = selectedClass;
     _selectedHiddenVillage = selectedHiddenVillage;
     _maskColor             = maskColor;
 }
Example #2
0
 public void AddPlayer(Enums.Team.Side side, string _pseudo, Enums.ActorClass.ClassName _className, int _level, Enums.HiddenVillage.Names _hiddenVillage, string _maskColors, int _maxHealth, int _currentHealth, Enums.Rang.official _rang)
 {
     this.teamSide        = side;
     this.pseudo          = _pseudo;
     className            = _className;
     this.level           = _level;
     hiddenVillage        = _hiddenVillage;
     this.maskColorString = _maskColors;
     maxHealth            = _maxHealth;
     this.currentHealth   = _currentHealth;
     this.officialRang    = _rang;
 }
Example #3
0
        void pays_MouseClic(Bmp bmp, MouseEventArgs e)
        {
            Enums.HiddenVillage.Names hidden_Village = (Enums.HiddenVillage.Names)Enum.Parse(typeof(Enums.HiddenVillage.Names), bmp.name);

            if (hidden_Village == Enums.HiddenVillage.Names.konoha)
            {
                cadre_Select_Pays.point = pays_thumbs_points[0];
                paysName.Text           = CommonCode.TranslateText(41) + " : " + Enums.HiddenVillage.Names.konoha;
                paysDescription.Text    = CommonCode.TranslateText(45);
                bonusPays.Text          = CommonCode.TranslateText(52);
                selectedHiddenVillage   = Enums.HiddenVillage.Names.konoha;
            }
            else if (hidden_Village == Enums.HiddenVillage.Names.iwa)
            {
                cadre_Select_Pays.point = pays_thumbs_points[1];
                paysName.Text           = CommonCode.TranslateText(41) + " : " + Enums.HiddenVillage.Names.iwa;
                paysDescription.Text    = CommonCode.TranslateText(46);
                bonusPays.Text          = CommonCode.TranslateText(53);
                selectedHiddenVillage   = Enums.HiddenVillage.Names.iwa;
            }
            else if (hidden_Village == Enums.HiddenVillage.Names.kiri)
            {
                cadre_Select_Pays.point = pays_thumbs_points[2];
                paysName.Text           = CommonCode.TranslateText(41) + " : " + Enums.HiddenVillage.Names.kiri;
                paysDescription.Text    = CommonCode.TranslateText(47);
                bonusPays.Text          = CommonCode.TranslateText(54);
                selectedHiddenVillage   = Enums.HiddenVillage.Names.kiri;
            }
            else if (hidden_Village == Enums.HiddenVillage.Names.kumo)
            {
                cadre_Select_Pays.point = pays_thumbs_points[3];
                paysName.Text           = CommonCode.TranslateText(41) + " : " + Enums.HiddenVillage.Names.kumo;
                paysDescription.Text    = CommonCode.TranslateText(48);
                bonusPays.Text          = CommonCode.TranslateText(55);
                selectedHiddenVillage   = Enums.HiddenVillage.Names.kumo;
            }
            else if (hidden_Village == Enums.HiddenVillage.Names.suna)
            {
                cadre_Select_Pays.point = pays_thumbs_points[4];
                paysName.Text           = CommonCode.TranslateText(41) + " : " + Enums.HiddenVillage.Names.suna;
                paysDescription.Text    = CommonCode.TranslateText(49);
                bonusPays.Text          = CommonCode.TranslateText(56);
                selectedHiddenVillage   = Enums.HiddenVillage.Names.suna;
            }
            paysName.point.X = (infosPlayer.size.Width / 2) - (TextRenderer.MeasureText(paysName.Text, paysName.font).Width / 2);
        }
Example #4
0
        public Actor(string _pseudo, int _level, Enums.Spirit.Name _spirit, Enums.ActorClass.ClassName _className, bool _pvp, int _spiritLvl, Enums.HiddenVillage.Names _hiddenVillage, string _maskColor, int _orientation, Enums.AnimatedActions.Name _action, string _waypoint)
        {
            this.pseudo         = _pseudo;
            this.spirit         = _spirit;
            this.spiritLevel    = _spiritLvl;
            this.level          = _level;
            className           = _className;
            pvpEnabled          = _pvp;
            hiddenVillage       = _hiddenVillage;
            maskColorString     = _maskColor;
            this.directionLook  = _orientation;
            this.animatedAction = _action;

            // seulement quand le joueur est en mouvement alors qu'on viens de se connecter
            if (_waypoint != "null" && _waypoint != "")
            {
                string[] tmpWayPoint = _waypoint.Split(':');
                foreach (string s in tmpWayPoint)
                {
                    wayPoint.Add(new Point(Convert.ToInt32(s.Split(',')[0]), Convert.ToInt32(s.Split(',')[1])));
                }
            }
        }
Example #5
0
        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
        }
Example #6
0
        // 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]);
            }
        }
Example #7
0
        public void Fetch(string[] commandStrings)
        {
            // vérifier la chronologie des infos commandStrings
            #region commencement du combat en mode initialisation "préparation"
            if (MMORPG.Battle.state == Enums.battleState.state.idle)
            {
                // cmd[8] dois correspondre a BattleType selon la cmd, mais ici ca coincide avec BattleState ?!!
                string[] playersData    = commandStrings[1].Split('|');
                string[] startPositions = commandStrings[2].Split('|');
                MMORPG.Battle.TimeLeftLabel.tag = commandStrings[3]; // cmd[4] = max timeleft
                MMORPG.Battle.BattleType        = commandStrings[4]; // il faut changer BattleTypede string à Enum
                Enums.battleState.state battleState = (Enums.battleState.state)Enum.Parse(typeof(Enums.battleState.state), commandStrings[4]);
                List <string>           sideA       = commandStrings[5].Split('#').ToList();
                List <string>           sideB       = commandStrings[6].Split('#').ToList();
                // il reste 3 autres variable que le client ne prend pas en charge a voir pourquoi

                MMORPG.Battle.state = battleState;
                // il y a 2 affectation a ce variable MMORPG.Battle.state ici et dans la ligne 781, a verifier si cette valeur change lors du passage entre ces 2 lignes
                //StartDuelBattleResponseMessage
                //pseudo#classe#level#village#MaskColors#TotalPdv#CurrentPdv#rang|pseudo#classe#level#village                    //#MaskColors#TotalPdv#CurrentPdv#rang
                //ValidePos
                //waitTime
                //BattleType
                //sideA(p1t1#position1t1X,position1t1Y)
                //sideB(p1t2#position1t2X,position1t2Y)

                //pos du sideA comme 10/5#15/5
                //pos du sideB comme 10/5#15/5#13/3 séparés par #

                // effacement du menu tamisé
                // effacer le menu de demande de défie SI le menu vraiment affiché, au cas ou un défie est lancé avec un PNJ, il ya pas de menu tamisé vus qu'on attend pas que le joueur accepte ou pas
                if (CommonCode.annulerChallengeMeDlg != null)
                {
                    CommonCode.annulerChallengeMeDlg.visible = false;
                    Manager.manager.GfxTopList.Remove(CommonCode.annulerChallengeMeDlg);
                    // supression du case a coché
                    if (Manager.manager.mainForm.Controls.Find("ignorerCB", false).Count() != 0)
                    {
                        Manager.manager.mainForm.Controls.Find("ignorerCB", false)[0].Visible = false;
                        Manager.manager.mainForm.Controls.Find("ignorerCB", false)[0]         = null;
                        Manager.manager.mainForm.Controls.Remove(Manager.manager.mainForm.Controls.Find("ignorerCB", false)[0]);
                    }
                    CommonCode.annulerChallengeMeDlg.Child.Clear();
                    CommonCode.annulerChallengeMeDlg = null;
                }
                else if (CommonCode.annulerChallengeHimDlg != null)
                {
                    // effacement du rec parent de la liste graphics
                    CommonCode.annulerChallengeHimDlg.visible = false;
                    Manager.manager.GfxTopList.Remove(CommonCode.annulerChallengeHimDlg);
                    CommonCode.annulerChallengeHimDlg.Child.Clear();
                    CommonCode.annulerChallengeHimDlg = null;
                }

                // supression des joueurs present dans le map
                List <Bmp> allPlayersExceptChallenged = CommonCode.AllActorsInMap.FindAll(f => (f.tag as Actor).pseudo != CommonCode.ChallengeTo && (f.tag as Actor).pseudo != CommonCode.MyPlayerInfo.instance.pseudo);
                for (int cnt = allPlayersExceptChallenged.Count; cnt > 0; cnt--)
                {
                    allPlayersExceptChallenged[cnt - 1].visible = false;
                    CommonCode.AllActorsInMap.Remove(allPlayersExceptChallenged[cnt - 1]);
                    allPlayersExceptChallenged.RemoveAt(cnt - 1);
                }
                CommonCode.annulerChallengeHimDlg = null;
                CommonCode.annulerChallengeMeDlg  = null;
                CommonCode.ChallengeTo            = "";

                // initialisation du combat
                // affichage des joueurs

                //pseudo#classe#level#village#MaskColors#TotalPdv#CurrentPdv#rang#initiative#doton#katon
                //#futon#raiton#siuton#usingDoton#usingKaton#usingFuton#usingRaiton#usingSuiton#equipedDoton#equipedKaton
                //#equipedFuton#equipedRaiton#suitonEquiped#pc#pm#pe#cd#invoc#resiDoton#resiKaton
                //#resiFuton#resiRaiton#resiSuiton#esquivePC#esquivePM#esquivePE#esquiveCD#retraitCD#retraitPM#retraitPE
                //#retraitCD#evasion#blocage
                // | séparateur entre les teams, / séparateur entre les membres d'une meme team

                //////////////  Team A ////////////////////////////
                for (int cnt = 0; cnt < playersData[0].Split(':').Count(); cnt++)
                {
                    string[] states = playersData[0].Split(':');

                    /////////// dispatch states
                    string actorName = states[0];
                    Enums.ActorClass.ClassName className = (Enums.ActorClass.ClassName)Enum.Parse(typeof(Enums.ActorClass.ClassName), states[1]);
                    int level = int.Parse(states[2]);
                    Enums.HiddenVillage.Names hiddenVillage = (Enums.HiddenVillage.Names)Enum.Parse(typeof(Enums.HiddenVillage.Names), states[3]);
                    string              maskColorsString    = states[4];
                    string[]            maskColors          = states[4].Split('/');
                    int                 maxHealth           = int.Parse(states[5]);
                    int                 currentHealth       = int.Parse(states[6]);
                    Enums.Rang.official officialRang        = (Enums.Rang.official)Enum.Parse(typeof(Enums.Rang.official), states[7]);
                    int                 initiative          = int.Parse(states[8]);
                    int                 doton             = int.Parse(states[9]);
                    int                 katon             = int.Parse(states[10]);
                    int                 futon             = int.Parse(states[11]);
                    int                 raiton            = int.Parse(states[12]);
                    int                 suiton            = int.Parse(states[13]);
                    int                 usingDoton        = int.Parse(states[14]);
                    int                 usingKaton        = int.Parse(states[15]);
                    int                 usingFuton        = int.Parse(states[16]);
                    int                 usingRaiton       = int.Parse(states[17]);
                    int                 usingSuiton       = int.Parse(states[18]);
                    int                 equipedDoton      = int.Parse(states[19]);
                    int                 equipedKaton      = int.Parse(states[20]);
                    int                 equipedFuton      = int.Parse(states[21]);
                    int                 equipedRaiton     = int.Parse(states[22]);
                    int                 equipedSuiton     = int.Parse(states[23]);
                    int                 originalPc        = int.Parse(states[24]);
                    int                 originalPm        = int.Parse(states[25]);
                    int                 pe                = int.Parse(states[26]);
                    int                 cd                = int.Parse(states[27]);
                    int                 summons           = int.Parse(states[28]);
                    int                 resiDotonPercent  = int.Parse(states[29]);
                    int                 resiKatonPercent  = int.Parse(states[30]);
                    int                 resiFutonPercent  = int.Parse(states[31]);
                    int                 resiRaitonPercent = int.Parse(states[32]);
                    int                 resiSuitonPercent = int.Parse(states[33]);
                    int                 dodgePc           = int.Parse(states[34]);
                    int                 dodgePm           = int.Parse(states[35]);
                    int                 dodgePe           = int.Parse(states[36]);
                    int                 dodgeCd           = int.Parse(states[37]);
                    int                 removePc          = int.Parse(states[38]);
                    int                 removePm          = int.Parse(states[39]);
                    int                 removePe          = int.Parse(states[40]);
                    int                 removeCd          = int.Parse(states[41]);
                    int                 escape            = int.Parse(states[42]);
                    int                 blocage           = int.Parse(states[43]);
                    Enums.Species.Name  species           = (Enums.Species.Name)Enum.Parse(typeof(Enums.Species.Name), states[44]);
                    int                 orientation       = int.Parse(states[45]);
                    //////////////////////////////////////////////////////////

                    Actor pit1 = new Actor();
                    pit1.teamSide        = Enums.Team.Side.A;
                    pit1.pseudo          = actorName;
                    pit1.className       = className;
                    pit1.level           = level;
                    pit1.hiddenVillage   = hiddenVillage;
                    pit1.maskColorString = maskColorsString;
                    pit1.maxHealth       = maxHealth;
                    pit1.currentHealth   = currentHealth;
                    pit1.officialRang    = officialRang;
                    pit1.initiative      = initiative;
                    pit1.doton           = doton;
                    pit1.katon           = futon;
                    pit1.futon           = futon;
                    pit1.raiton          = raiton;
                    pit1.suiton          = suiton;
                    pit1.usingDoton      = usingDoton;
                    pit1.usingFuton      = usingFuton;
                    pit1.usingKaton      = usingKaton;
                    pit1.usingRaiton     = usingRaiton;
                    pit1.usingSuiton     = usingSuiton;
                    pit1.equipedDoton    = equipedDoton;
                    pit1.equipedKaton    = equipedKaton;
                    pit1.equipedFuton    = equipedFuton;
                    pit1.equipedRaiton   = equipedRaiton;
                    pit1.equipedSuiton   = equipedSuiton;
                    pit1.originalPc      = originalPc;
                    pit1.originalPm      = originalPm;
                    pit1.pe                = pe;
                    pit1.cd                = cd;
                    pit1.summons           = summons;
                    pit1.resiDotonPercent  = resiDotonPercent;
                    pit1.resiKatonPercent  = resiKatonPercent;
                    pit1.resiFutonPercent  = resiFutonPercent;
                    pit1.resiRaitonPercent = resiRaitonPercent;
                    pit1.resiSuitonPercent = resiSuitonPercent;
                    pit1.dodgePc           = dodgePc;
                    pit1.dodgePm           = dodgePm;
                    pit1.dodgePe           = dodgePe;
                    pit1.dodgeCd           = dodgeCd;
                    pit1.removePc          = removePc;
                    pit1.removePm          = removePm;
                    pit1.removePe          = removePe;
                    pit1.removeCd          = removeCd;
                    pit1.escape            = escape;
                    pit1.blocage           = blocage;
                    pit1.species           = species;
                    pit1.directionLook     = orientation;

                    // si le joueur n'est pas humain comme PNJ, alors il faut créer à nouveau l'image ou dupliquer celle déja présante sur la map, ou meme utiliser celle sur la map
                    if (pit1.species != Enums.Species.Name.Human)
                    {
                        // le joueur étant déja supprimé de la liste common1.AllPlayers lors du nétoyage de l'ecran pour le combat, il faut recréer le pointeur, cad l'ajouter a la liste
                        // j'ai intentionnelement laissé le joueur se supprimer au lieu de faire une exeption pour garder un code uniforme et qui dépand pas des situations, donc vaux mieux recréer le pointeur
                        Bmp __pnj = new Bmp(@"gfx\general\classes\" + pit1.className + ".dat", Point.Empty, "__pnj", Manager.TypeGfx.Obj, true, 1, SpriteSheet.GetSpriteSheet(pit1.className.ToString(), 0));
                        __pnj.MouseMove += CommonCode.CursorHand_MouseMove;
                        __pnj.MouseOver += CommonCode.ibPlayers_MouseOver;
                        __pnj.MouseOut  += CommonCode.ibPlayers_MouseOut;
                        __pnj.tag        = pit1;
                        CommonCode.AllActorsInMap.Add(__pnj);
                        CommonCode.VerticalSyncZindex(__pnj);
                        Manager.manager.GfxObjList.Add(__pnj);
                    }
                    else if (pit1.species == Enums.Species.Name.Summon)
                    {
                        // le joueur étant déja supprimé de la liste common1.AllPlayers lors du nétoyage de l'ecran pour le combat, il faut recréer le pointeur, cad l'ajouter a la liste
                        // j'ai intentionnelement laissé le joueur se supprimer au lieu de faire une exeption pour garder un code uniforme et qui dépand pas des situations, donc vaux mieux recréer le pointeur
                        Bmp __invok = new Bmp(@"gfx\general\classes\" + pit1.className + ".dat", Point.Empty, "__pnj", Manager.TypeGfx.Obj, true, 1, SpriteSheet.GetSpriteSheet(pit1.className.ToString(), 0));
                        __invok.MouseMove += CommonCode.CursorHand_MouseMove;
                        __invok.MouseOver += CommonCode.ibPlayers_MouseOver;
                        __invok.MouseOut  += CommonCode.ibPlayers_MouseOut;
                        __invok.tag        = pit1;
                        CommonCode.AllActorsInMap.Add(__invok);
                        CommonCode.VerticalSyncZindex(__invok);
                        Manager.manager.GfxObjList.Add(__invok);
                    }

                    pit1.ibPlayer = CommonCode.AllActorsInMap.Find(f => (f.tag as Actor).pseudo == pit1.pseudo);
                    (pit1.ibPlayer.tag as Actor).directionLook = pit1.directionLook;
                    CommonCode.AdjustPositionAndDirection(pit1.ibPlayer, pit1.ibPlayer.point);     // remet le joueur bien aligné sur la grille et lui applique un mask de couleur

                    MMORPG.Battle.SideA.Add(pit1);
                }

                ///////////////////// Team B ///////////////////////////////////
                for (int cnt = 0; cnt < playersData[1].Split(':').Count(); cnt++)
                {
                    string[] states = playersData[1].Split(':');

                    /////////// dispatch states
                    string actorName = states[0];
                    Enums.ActorClass.ClassName className = (Enums.ActorClass.ClassName)Enum.Parse(typeof(Enums.ActorClass.ClassName), states[1]);
                    int level = int.Parse(states[2]);
                    Enums.HiddenVillage.Names hiddenVillage = (Enums.HiddenVillage.Names)Enum.Parse(typeof(Enums.HiddenVillage.Names), states[3]);
                    string              maskColorsString    = states[4];
                    string[]            maskColors          = states[4].Split('/');
                    int                 maxHealth           = int.Parse(states[5]);
                    int                 currentHealth       = int.Parse(states[6]);
                    Enums.Rang.official officialRang        = (Enums.Rang.official)Enum.Parse(typeof(Enums.Rang.official), states[7]);
                    int                 initiative          = int.Parse(states[8]);
                    int                 doton             = int.Parse(states[9]);
                    int                 katon             = int.Parse(states[10]);
                    int                 futon             = int.Parse(states[11]);
                    int                 raiton            = int.Parse(states[12]);
                    int                 suiton            = int.Parse(states[13]);
                    int                 usingDoton        = int.Parse(states[14]);
                    int                 usingKaton        = int.Parse(states[15]);
                    int                 usingFuton        = int.Parse(states[16]);
                    int                 usingRaiton       = int.Parse(states[17]);
                    int                 usingSuiton       = int.Parse(states[18]);
                    int                 equipedDoton      = int.Parse(states[19]);
                    int                 equipedKaton      = int.Parse(states[20]);
                    int                 equipedFuton      = int.Parse(states[21]);
                    int                 equipedRaiton     = int.Parse(states[22]);
                    int                 equipedSuiton     = int.Parse(states[23]);
                    int                 originalPc        = int.Parse(states[24]);
                    int                 originalPm        = int.Parse(states[25]);
                    int                 pe                = int.Parse(states[26]);
                    int                 cd                = int.Parse(states[27]);
                    int                 summons           = int.Parse(states[28]);
                    int                 resiDotonPercent  = int.Parse(states[29]);
                    int                 resiKatonPercent  = int.Parse(states[30]);
                    int                 resiFutonPercent  = int.Parse(states[31]);
                    int                 resiRaitonPercent = int.Parse(states[32]);
                    int                 resiSuitonPercent = int.Parse(states[33]);
                    int                 dodgePc           = int.Parse(states[34]);
                    int                 dodgePm           = int.Parse(states[35]);
                    int                 dodgePe           = int.Parse(states[36]);
                    int                 dodgeCd           = int.Parse(states[37]);
                    int                 removePc          = int.Parse(states[38]);
                    int                 removePm          = int.Parse(states[39]);
                    int                 removePe          = int.Parse(states[40]);
                    int                 removeCd          = int.Parse(states[41]);
                    int                 escape            = int.Parse(states[42]);
                    int                 blocage           = int.Parse(states[43]);
                    Enums.Species.Name  species           = (Enums.Species.Name)Enum.Parse(typeof(Enums.Species.Name), states[44]);
                    int                 orientation       = int.Parse(states[45]);
                    //////////////////////////////////////////////////////

                    Actor pit2 = new Actor();
                    pit2.teamSide        = Enums.Team.Side.A;
                    pit2.pseudo          = actorName;
                    pit2.className       = className;
                    pit2.level           = level;
                    pit2.hiddenVillage   = hiddenVillage;
                    pit2.maskColorString = maskColorsString;
                    pit2.maxHealth       = maxHealth;
                    pit2.currentHealth   = currentHealth;
                    pit2.officialRang    = officialRang;
                    pit2.initiative      = initiative;
                    pit2.doton           = doton;
                    pit2.katon           = futon;
                    pit2.futon           = futon;
                    pit2.raiton          = raiton;
                    pit2.suiton          = suiton;
                    pit2.usingDoton      = usingDoton;
                    pit2.usingFuton      = usingFuton;
                    pit2.usingKaton      = usingKaton;
                    pit2.usingRaiton     = usingRaiton;
                    pit2.usingSuiton     = usingSuiton;
                    pit2.equipedDoton    = equipedDoton;
                    pit2.equipedKaton    = equipedKaton;
                    pit2.equipedFuton    = equipedFuton;
                    pit2.equipedRaiton   = equipedRaiton;
                    pit2.equipedSuiton   = equipedSuiton;
                    pit2.originalPc      = originalPc;
                    pit2.originalPm      = originalPm;
                    pit2.pe                = pe;
                    pit2.cd                = cd;
                    pit2.summons           = summons;
                    pit2.resiDotonPercent  = resiDotonPercent;
                    pit2.resiKatonPercent  = resiKatonPercent;
                    pit2.resiFutonPercent  = resiFutonPercent;
                    pit2.resiRaitonPercent = resiRaitonPercent;
                    pit2.resiSuitonPercent = resiSuitonPercent;
                    pit2.dodgePc           = dodgePc;
                    pit2.dodgePm           = dodgePm;
                    pit2.dodgePe           = dodgePe;
                    pit2.dodgeCd           = dodgeCd;
                    pit2.removePc          = removePc;
                    pit2.removePm          = removePm;
                    pit2.removePe          = removePe;
                    pit2.removeCd          = removeCd;
                    pit2.escape            = escape;
                    pit2.blocage           = blocage;
                    pit2.species           = species;
                    pit2.directionLook     = orientation;

                    // si le joueur n'est humain comme PNJ, alors il faut créer à nouveau l'image ou dupliquer celle déja présante sur la map, ou meme utiliser celle sur la map
                    if (pit2.species == Enums.Species.Name.Pnj)
                    {
                        // le joueur étant déja supprimé de la liste common1.AllPlayers lors du nétoyage de l'ecran pour le combat, il faut recréer le pointeur, cad l'ajouter a la liste
                        // j'ai intentionnelement laissé le joueur se supprimer au lieu de faire une exeption pour garder un code uniforme et qui dépand pas des situations, donc vaux mieux recréer le pointeur
                        Bmp __pnj = new Bmp(@"gfx\general\classes\" + pit2.className + ".dat", Point.Empty, "__pnj", Manager.TypeGfx.Obj, true, 1, SpriteSheet.GetSpriteSheet(pit2.className.ToString(), 0));
                        __pnj.MouseMove += CommonCode.CursorHand_MouseMove;
                        __pnj.MouseOver += CommonCode.ibPlayers_MouseOver;
                        __pnj.MouseOut  += CommonCode.ibPlayers_MouseOut;
                        __pnj.tag        = pit2;
                        CommonCode.AllActorsInMap.Add(__pnj);
                        CommonCode.VerticalSyncZindex(__pnj);
                        Manager.manager.GfxObjList.Add(__pnj);
                    }
                    else if (pit2.species == Enums.Species.Name.Summon)
                    {
                        // le joueur étant déja supprimé de la liste common1.AllPlayers lors du nétoyage de l'ecran pour le combat, il faut recréer le pointeur, cad l'ajouter a la liste
                        // j'ai intentionnelement laissé le joueur se supprimer au lieu de faire une exeption pour garder un code uniforme et qui dépand pas des situations, donc vaux mieux recréer le pointeur
                        Bmp __invok = new Bmp(@"gfx\general\classes\" + pit2.className + ".dat", Point.Empty, "__pnj", Manager.TypeGfx.Obj, true, 1, SpriteSheet.GetSpriteSheet(pit2.className.ToString(), 0));
                        __invok.MouseMove += CommonCode.CursorHand_MouseMove;
                        __invok.MouseOver += CommonCode.ibPlayers_MouseOver;
                        __invok.MouseOut  += CommonCode.ibPlayers_MouseOut;
                        __invok.tag        = pit2;
                        CommonCode.AllActorsInMap.Add(__invok);
                        CommonCode.VerticalSyncZindex(__invok);
                        Manager.manager.GfxObjList.Add(__invok);
                    }

                    pit2.ibPlayer = CommonCode.AllActorsInMap.Find(f => (f.tag as Actor).pseudo == pit2.pseudo);
                    (pit2.ibPlayer.tag as Actor).directionLook = pit2.directionLook;
                    CommonCode.AdjustPositionAndDirection(pit2.ibPlayer, pit2.ibPlayer.point);

                    MMORPG.Battle.SideB.Add(pit2);
                }
                ///////////////////////////////////////////////////////////////////

                // affichage des positions valide pour les 2 teams
                string[] dataT1 = startPositions[0].Split('#');
                for (int cnt1 = 0; cnt1 < dataT1.Count(); cnt1++)
                {
                    string[] data1 = dataT1[cnt1].Split('/');
                    MMORPG.Battle.ValidePosT1.Add(new Point(Convert.ToInt16(data1[0]) * 30, Convert.ToInt16(data1[1]) * 30));
                }

                string[] dataT2 = startPositions[1].Split('#');
                for (int cnt1 = 0; cnt1 < dataT2.Count(); cnt1++)
                {
                    string[] data1 = dataT2[cnt1].Split('/');
                    MMORPG.Battle.ValidePosT2.Add(new Point(Convert.ToInt16(data1[0]) * 30, Convert.ToInt16(data1[1]) * 30));
                }



                // dessin des positions valides dans le map
                MMORPG.Battle.DrawBattleValidePos();

                // image du chronometre timeout
                Bmp Chrono_TimeOut = new Bmp(@"gfx\general\obj\1\all1.dat", new Point(ScreenManager.WindowWidth - 100, 50), "Chrono_TimeOut", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet("_Main_option", 23));
                Manager.manager.GfxTopList.Add(Chrono_TimeOut);

                //timer de temps restant
                MMORPG.Battle.TimeLeftLabel.zindex = Chrono_TimeOut.zindex + 1;
                Manager.manager.GfxTopList.Add(MMORPG.Battle.TimeLeftLabel);

                //lancement du thread du la barre de progression du timeleft
                Thread timeLeftT = new Thread(new ThreadStart(CommonCode.timeLeftForBattle));


                timeLeftT.Start();



                for (int cnt = 0; cnt < sideA.Count; cnt++)
                {
                    Bmp   bmp = CommonCode.AllActorsInMap.Find(f => (f.tag as Actor).pseudo == sideA[cnt].Split('|')[0]);
                    Point p   = new Point(Convert.ToInt16(sideA[cnt].Split('|')[1].Split('/')[0]), Convert.ToInt16(sideA[cnt].Split('|')[1].Split('/')[1]));
                    bmp.point = new Point((p.X * 30) + 15 - (bmp.rectangle.Width / 2), (p.Y * 30) + 15 - bmp.rectangle.Height);
                    CommonCode.ApplyMaskColorToClasse(bmp);
                    (bmp.tag as Actor).realPosition = p;
                    Actor piib = MMORPG.Battle.SideA.Find(f => f.pseudo == sideA[cnt].Split('|')[0]);
                    piib.realPosition = p;
                    CommonCode.VerticalSyncZindex(bmp);
                }

                for (int cnt = 0; cnt < sideB.Count; cnt++)
                {
                    Bmp   bmp = CommonCode.AllActorsInMap.Find(f => (f.tag as Actor).pseudo == sideB[cnt].Split('|')[0]);
                    Point p   = new Point(Convert.ToInt16(sideB[cnt].Split('|')[1].Split('/')[0]), Convert.ToInt16(sideB[cnt].Split('|')[1].Split('/')[1]));
                    bmp.point = new Point((p.X * 30) + 15 - (bmp.rectangle.Width / 2), (p.Y * 30) + 15 - bmp.rectangle.Height);
                    CommonCode.ApplyMaskColorToClasse(bmp);
                    (bmp.tag as Actor).realPosition = p;
                    Actor piib = MMORPG.Battle.SideB.Find(f => f.pseudo == sideB[cnt].Split('|')[0]);
                    piib.realPosition = p;
                    CommonCode.VerticalSyncZindex(bmp);
                }
                MMORPG.Battle.state = battleState;

                // il faut ajouter les 2 bouton, pour quiter le combat et pour valider sa position
                HudHandle._passer_La_Main_btn       = new Bmp(@"gfx\general\obj\1\all1.dat", new Point(HudHandle.ChatTextBox.Location.X + HudHandle.ChatTextBox.Width + 50, 578), "_passer_La_Main_btn", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet("_Main_option", 25));
                HudHandle._passer_La_Main_btn.point = new Point(HudHandle.HealthBarRec1.point.X - HudHandle._passer_La_Main_btn.rectangle.Size.Width - 10, ScreenManager.WindowHeight - HudHandle._passer_La_Main_btn.rectangle.Height - 3);
                HudHandle._passer_La_Main_btn.EscapeGfxWhileMouseMove = true;
                HudHandle._passer_La_Main_btn.EscapeGfxWhileMouseClic = true;
                HudHandle._passer_La_Main_btn.MouseMove += CommonCode.CursorHand_MouseMove;
                HudHandle._passer_La_Main_btn.MouseOut  += CommonCode.CursorDefault_MouseOut;
                HudHandle._passer_La_Main_btn.MouseClic += _passer_La_Main_btn_MouseClic;
                Manager.manager.GfxTopList.Add(HudHandle._passer_La_Main_btn);

                // label pour passer la main
                Txt _passer_La_Main_Lbl = new Txt(CommonCode.TranslateText(110), new Point(0, 2), "_passer_La_Main_Lbl", Manager.TypeGfx.Top, true, new Font("verdana", 9), Brushes.Yellow);
                _passer_La_Main_Lbl.point.X = 5 + (HudHandle._passer_La_Main_btn.rectangle.Width - TextRenderer.MeasureText(_passer_La_Main_Lbl.Text, _passer_La_Main_Lbl.font).Width) / 2;
                HudHandle._passer_La_Main_btn.Child.Add(_passer_La_Main_Lbl);

                // bouton pour quiter le combat
                HudHandle._quiter_le_combat            = new Bmp(@"gfx\general\obj\1\all1.dat", new Point(HudHandle.ChatTextBox.Location.X + HudHandle.ChatTextBox.Width + 30, 580), "_quiter_le_combat", Manager.TypeGfx.Top, true, 1, SpriteSheet.GetSpriteSheet("_Main_option", 26));
                HudHandle._quiter_le_combat.point      = new Point(HudHandle._passer_La_Main_btn.point.X - HudHandle._quiter_le_combat.rectangle.Width + 5, ScreenManager.WindowHeight - HudHandle._quiter_le_combat.rectangle.Height - 3);
                HudHandle._quiter_le_combat.MouseMove += CommonCode.CursorHand_MouseMove;
                HudHandle._quiter_le_combat.MouseOut  += CommonCode.CursorDefault_MouseOut;
                HudHandle._quiter_le_combat.MouseClic += _quiter_le_combat_MouseClic;
                Manager.manager.GfxTopList.Add(HudHandle._quiter_le_combat);
            }
            #endregion
        }
Example #8
0
        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
        }
        public void Fetch(string[] commandStrings)
        {
            Txt[] lPseudo    = MMORPG.GameStates.SelectPlayer.lPseudo;
            Txt[] lLvlPlayer = MMORPG.GameStates.SelectPlayer.lLvlPlayer;
            Txt[] lLvlSpirit = MMORPG.GameStates.SelectPlayer.lLvlSpirit;
            Bmp[] ibPlayers  = MMORPG.GameStates.SelectPlayer.ibPlayers;
            Bmp[] delete     = MMORPG.GameStates.SelectPlayer.delete;
            Bmp[] village    = MMORPG.GameStates.SelectPlayer.village;

            #region liste les joueurs que le joueur a crée
            string[] players = commandStrings[1].Split('|');

            for (int cnt = 0; cnt < players.Length; cnt++)
            {
                // pseudo,level,spirit,classe,pvp,spiritLvl,village,MaskColors,null,null

                string[]                   states           = players[cnt].Split('#');
                string                     actorName        = states[0];
                int                        level            = int.Parse(states[1]);
                Enums.Spirit.Name          spirit           = (Enums.Spirit.Name)Enum.Parse(typeof(Enums.Spirit.Name), states[2]);
                Enums.ActorClass.ClassName actorClass       = (Enums.ActorClass.ClassName)Enum.Parse(typeof(Enums.ActorClass.ClassName), states[3]);
                bool                       pvpEnabled       = Convert.ToBoolean(Convert.ToInt16(states[4]));
                int                        spiritLevel      = int.Parse(states[5]);
                Enums.HiddenVillage.Names  hiddenVillage    = (Enums.HiddenVillage.Names)Enum.Parse(typeof(Enums.HiddenVillage.Names), states[6]);
                string                     maskColorsString = states[7];
                // states 8 + 9 not used

                lPseudo[cnt].Text = actorName;
                ibPlayers[cnt].Child.Add(lPseudo[cnt]);

                lLvlPlayer[cnt].Text = CommonCode.TranslateText(50) + " " + level;


                ibPlayers[cnt].Child.Add(lLvlPlayer[cnt]);

                ibPlayers[cnt].ChangeBmp(@"gfx\general\classes\" + actorClass + ".dat", SpriteSheet.GetSpriteSheet(actorClass.ToString(), 0));
                Manager.manager.GfxObjList.Add(ibPlayers[cnt]);

                ibPlayers[cnt].tag = new Actor(actorName, level, spirit, actorClass, pvpEnabled, spiritLevel, hiddenVillage, maskColorsString, 0, Enums.AnimatedActions.Name.idle, "null");

                //////// alignement neutral ou ange ou demon
                if (spirit != Enums.Spirit.Name.neutral)
                {
                    Bmp spiritBmp = new Bmp(@"gfx\general\obj\2\" + spirit + @"\" + spiritLevel + ".dat", new Point(0, 0), "spirit." + actorName, Manager.TypeGfx.Obj, true, 1);
                    spiritBmp.point = new Point((ibPlayers[cnt].rectangle.Width / 2) - (spiritBmp.rectangle.Width / 2), -spiritBmp.rectangle.Height);
                    ibPlayers[cnt].Child.Add(spiritBmp);

                    lLvlPlayer[cnt].point = new Point((ibPlayers[cnt].rectangle.Width / 2) - ((TextRenderer.MeasureText(lLvlPlayer[cnt].Text, lLvlPlayer[cnt].font).Width) / 2), -spiritBmp.rectangle.Height - 15);
                    lPseudo[cnt].point    = new Point((ibPlayers[cnt].rectangle.Width / 2) - (TextRenderer.MeasureText(lPseudo[cnt].Text, lPseudo[cnt].font).Width / 2) + 5, lLvlPlayer[cnt].point.Y - 15);
                    lLvlSpirit[cnt].Text  = spiritLevel.ToString();
                    lLvlSpirit[cnt].point = new Point((ibPlayers[cnt].rectangle.Width / 2) - (TextRenderer.MeasureText(lLvlSpirit[cnt].Text, lLvlSpirit[cnt].font).Width / 2) + 2, -spiritBmp.rectangle.Y - (spiritBmp.rectangle.Height / 2) - (TextRenderer.MeasureText(lLvlSpirit[cnt].Text, lLvlSpirit[cnt].font).Height / 2));
                    ibPlayers[cnt].Child.Add(lLvlSpirit[cnt]);

                    if (pvpEnabled)
                    {
                        Bmp PvpOn = new Bmp(@"gfx\map\SelectPlayer\obj\1.dat", new Point(ibPlayers[cnt].point.X + (ibPlayers[cnt].rectangle.Width / 2) - 24, ibPlayers[cnt].point.Y + ibPlayers[cnt].rectangle.Height + 30), "PvpOn", Manager.TypeGfx.Obj, true, 1);
                        PvpOn.point = new Point((ibPlayers[cnt].rectangle.Width / 2) - (PvpOn.rectangle.Width / 2), ibPlayers[cnt].rectangle.Height + 30);
                        ibPlayers[cnt].Child.Add(PvpOn);
                    }
                }
                else
                {
                    lLvlPlayer[cnt].point = new Point((ibPlayers[cnt].rectangle.Width / 2) - ((TextRenderer.MeasureText(lLvlPlayer[cnt].Text, lLvlPlayer[cnt].font).Width) / 2), -20);
                    lPseudo[cnt].point    = new Point((ibPlayers[cnt].rectangle.Width / 2) - ((TextRenderer.MeasureText(states[0], lPseudo[cnt].font).Width) / 2) + 2, -35);
                }

                village[cnt]       = new Bmp(@"gfx\general\obj\1\pays_thumbs.dat", new Point(0, 0), "village " + hiddenVillage, Manager.TypeGfx.Obj, true, 1, SpriteSheet.GetSpriteSheet("pays_" + hiddenVillage + "_thumbs", 0));
                village[cnt].point = new Point((ibPlayers[cnt].rectangle.Width / 2) - (village[cnt].rectangle.Width / 2), lPseudo[cnt].point.Y - village[cnt].rectangle.Height);
                ibPlayers[cnt].Child.Add(village[cnt]);

                // coloriage du personnage
                CommonCode.ApplyMaskColorToClasse(ibPlayers[cnt]);

                delete[cnt].point   = new Point((ibPlayers[cnt].rectangle.Width / 2) - (delete[cnt].rectangle.Width / 2), village[cnt].point.Y - 20);
                delete[cnt].visible = true;

                ibPlayers[cnt].name = actorName;
            }
            #endregion
        }
        public void Fetch(string[] commandStrings)
        {
            #region
            //JoinBattleResponseMessage•playersDatasideA•playersDatasideB•battleStartPositions.Map("Start") + "•" + MainClass.InitialisationBattleWaitTime + "•" + _battle.timestamp

            string sideAData = commandStrings[0];
            // currentPlayerInfo.Pseudo + "#" + currentPlayerInfo.classeName + "#" + currentPlayerInfo.Level + "#" + currentPlayerInfo.village + "#" + currentPlayerInfo.MaskColors + "#" + currentPlayerInfo.totalHealth + "#" + currentPlayerInfo.currentHealth + "#" + currentPlayerInfo.officialRang + "|";     | séparateur entre les states des joueurs
            string sideBData = commandStrings[1];
            // currentPlayerInfo.Pseudo + "#" + currentPlayerInfo.classeName + "#" + currentPlayerInfo.Level + "#" + currentPlayerInfo.village + "#" + currentPlayerInfo.MaskColors + "#" + currentPlayerInfo.totalHealth + "#" + currentPlayerInfo.currentHealth + "#" + currentPlayerInfo.officialRang + "|";     | séparateur entre les states des joueurs
            string battleStartPositions         = commandStrings[2];
            string initialisationBattleWaitTime = commandStrings[3];
            string timestamp = commandStrings[4];       // sert a rien a supprimer peux etre du sereur, ATTENTION le decoReco ne marche pas quand le temps de préparation a écoulé, il faut prévoir une autre cmd

            if (MMORPG.Battle.state == Enums.battleState.state.idle)
            {
                MMORPG.Battle.state = Enums.battleState.state.initialisation;
                //pseudo#classe#level#village#MaskColors#TotalPdv#CurrentPdv#rang|pseudo#classe#level#village#MaskColors#TotalPdv#CurrentPdv#rang•ValidePos•sideA#p1t1#position1t1X,position1t1Y•sideB#p1t2#position1t2X,position1t2Y

                #region données joueurs
                //pseudo#classe#level#village#MaskColors#TotalPdv#CurrentPdv#rang
                // | séparateur d'instance
                string[] sideA = sideAData.Split('|');
                foreach (string t in sideA)
                {
                    string[] states = t.Split('#');

                    string actorName = states[0];
                    Enums.ActorClass.ClassName className = (Enums.ActorClass.ClassName)Enum.Parse(typeof(Enums.ActorClass.ClassName), states[1]);
                    int level = int.Parse(states[2]);
                    Enums.HiddenVillage.Names hiddenVillage = (Enums.HiddenVillage.Names)Enum.Parse(typeof(Enums.HiddenVillage.Names), states[3]);
                    string maskColorsString          = states[4];
                    int    maxHealth                 = int.Parse(states[5]);
                    int    currentHealth             = int.Parse(states[6]);
                    Enums.Rang.official officialRang = (Enums.Rang.official)Enum.Parse(typeof(Enums.Rang.official), states[7]);

                    Actor piibt1 = new Actor();
                    piibt1.AddPlayer(Enums.Team.Side.A, actorName, className, level, hiddenVillage, maskColorsString, maxHealth, currentHealth, officialRang);
                    piibt1.ibPlayer = CommonCode.AllActorsInMap.Find(f => ((Actor)f.tag).pseudo == actorName);
                    CommonCode.AdjustPositionAndDirection(piibt1.ibPlayer, piibt1.ibPlayer.point);
                    MMORPG.Battle.SideA.Add(piibt1);
                }

                string[] sideB = sideBData.Split('|');
                foreach (string t in sideB)
                {
                    string[] states = t.Split('#');

                    string playerName = states[0];
                    Enums.ActorClass.ClassName className = (Enums.ActorClass.ClassName)Enum.Parse(typeof(Enums.ActorClass.ClassName), states[1]);
                    int level = int.Parse(states[2]);
                    Enums.HiddenVillage.Names hiddenVillage = (Enums.HiddenVillage.Names)Enum.Parse(typeof(Enums.HiddenVillage.Names), states[3]);
                    string maskColorsString          = states[4];
                    int    maxHealth                 = int.Parse(states[5]);
                    int    currentHealth             = int.Parse(states[6]);
                    Enums.Rang.official officialRang = (Enums.Rang.official)Enum.Parse(typeof(Enums.Rang.official), states[7]);

                    Actor piibt2 = new Actor();
                    piibt2.AddPlayer(Enums.Team.Side.A, playerName, className, level, hiddenVillage, maskColorsString, maxHealth, currentHealth, officialRang);
                    piibt2.ibPlayer = CommonCode.AllActorsInMap.Find(f => ((Actor)f.tag).pseudo == playerName);
                    CommonCode.AdjustPositionAndDirection(piibt2.ibPlayer, piibt2.ibPlayer.point);
                    MMORPG.Battle.SideB.Add(piibt2);
                }
                #endregion

                #region données des positions valide pour les 2 teams
                string[] _battleStartPositions = battleStartPositions.Split('|');

                string[] dataT1 = _battleStartPositions[0].Split('#');
                foreach (string t in dataT1)
                {
                    string[] data2 = t.Split('/');
                    MMORPG.Battle.ValidePosT1.Add(new Point(Convert.ToInt16(data2[0]) * 30, Convert.ToInt16(data2[1]) * 30));
                }

                string[] dataT2 = _battleStartPositions[1].Split('#');
                foreach (string t in dataT2)
                {
                    string[] data2 = t.Split('/');
                    MMORPG.Battle.ValidePosT2.Add(new Point(Convert.ToInt16(data2[0]) * 30, Convert.ToInt16(data2[1]) * 30));
                }
                #endregion

                // dessin des positions valides dans le map
                MMORPG.Battle.DrawBattleValidePos();

                // cette cmd est introuvable, comment est se que le client récupére les données de positionnement des joueurs ??
                Network.SendMessage("cmd•getPlayersPositionInBattle", true);

                // image du chronometre timeout
                Manager.manager.GfxTopList.Add(MMORPG.Battle.Chrono_TimeOut);

                //timer de temps restant
                Manager.manager.GfxTopList.Add(MMORPG.Battle.TimeLeftLabel);

                //lancement du thread du la barre de progression du timeleft
                Thread timeLeftT = new Thread(CommonCode.timeLeftForBattle);
                MMORPG.Battle.TimeLeftLabel.tag = initialisationBattleWaitTime;
                timeLeftT.Start();
            }
            #endregion
        }
Example #11
0
        public void Fetch(string[] commandStrings)
        {
            #region MapData
            // commandStrings[1] = pseudo#classe#pvp:spirit:spiritLvl#village#MaskColors#map_position#orientation#level#action#waypoint#TotalPdv#CurrentPdv#rang   | separateur entre plusieurs joueurs
            // pvp=0 donc mode pvp off, si pvp = 1 mode pvp on

            string[] playersInfos = commandStrings[1].Split('|');

            foreach (string t in playersInfos)
            {
                string[] states = t.Split('#');

                string actorName = states[0];
                Enums.ActorClass.ClassName className = (Enums.ActorClass.ClassName)Enum.Parse(typeof(Enums.ActorClass.ClassName), states[1]);
                bool pvpEnabled          = states[2].Split(':')[0] == "1";
                Enums.Spirit.Name spirit = (Enums.Spirit.Name)Enum.Parse(typeof(Enums.Spirit.Name), states[2].Split(':')[1]);
                int spiritLevel          = int.Parse(states[2].Split(':')[2]);
                Enums.HiddenVillage.Names hiddenVillage = (Enums.HiddenVillage.Names)Enum.Parse(typeof(Enums.HiddenVillage.Names), states[3]);
                string maskColors  = states[4];
                Point  mapPoint    = new Point(int.Parse(states[5].Split('/')[0]), int.Parse(states[5].Split('/')[1]));
                int    orientation = int.Parse(states[6]);
                int    level       = int.Parse(states[7]);
                Enums.AnimatedActions.Name action = (Enums.AnimatedActions.Name)Enum.Parse(typeof(Enums.AnimatedActions.Name), states[8]);
                string waypoint      = states[9];
                int    maxHealth     = int.Parse(states[10]);
                int    currentHealth = int.Parse(states[11]);

                // cette valeur n'est pas utilisé dans le jeu puisque le rang n'est pas encore affiché, il faut prévoir un truc pour montrer les rang de chaque joueur, ou pas si le rang dois etre caché, ptet que le rang est caché mais permet d'afficher le joueur avec un ora spécial
                Enums.Rang.official officialRang = (Enums.Rang.official)Enum.Parse(typeof(Enums.Rang.official), states[12]);

                // supprimer tout les anciennes instances qui correspond a ce joueur pour eviter un doublons ou une erreur de la part du serveur ou client s'il n'envoie pas la cmd de deconnexion du joeur au abonnés
                if (CommonCode.AllActorsInMap.Count(i => ((Actor)i.tag).pseudo == actorName) > 0)
                {
                    Bmp allPlayers = CommonCode.AllActorsInMap.Find(f => ((Actor)f.tag).pseudo == actorName);
                    allPlayers.visible = false;
                    CommonCode.AllActorsInMap.Remove(allPlayers);
                    CommonCode.AllActorsInMap.RemoveAll(i => ((Actor)i.tag).pseudo == actorName);
                }

                // affichage du personnage + position + orientation
                Bmp ibPlayers = new Bmp(@"gfx\general\classes\" + className + ".dat", Point.Empty, "Player_" + actorName, Manager.TypeGfx.Obj, true, 1, SpriteSheet.GetSpriteSheet(className.ToString(), CommonCode.ConvertToClockWizeOrientation(orientation)));
                ibPlayers.point      = new Point((mapPoint.X * 30) + 15 - (ibPlayers.rectangle.Width / 2), (mapPoint.Y * 30) - (ibPlayers.rectangle.Height) + 15);
                ibPlayers.MouseOver += CommonCode.ibPlayers_MouseOver;
                ibPlayers.MouseOut  += CommonCode.ibPlayers_MouseOut;
                ibPlayers.MouseMove += CommonCode.CursorHand_MouseMove;
                ibPlayers.MouseClic += CommonCode.ibPlayers_MouseClic;
                CommonCode.VerticalSyncZindex(ibPlayers);
                ibPlayers.TypeGfx = Manager.TypeGfx.Obj;
                Manager.manager.GfxObjList.Add(ibPlayers);

                ibPlayers.tag = CommonCode.MyPlayerInfo.instance.pseudo != actorName ? new Actor(actorName, level, !pvpEnabled ? Enums.Spirit.Name.neutral : spirit, className, pvpEnabled, !pvpEnabled ? 0 : spiritLevel, hiddenVillage, maskColors, orientation, action, waypoint) : CommonCode.MyPlayerInfo.instance.ibPlayer.tag;
                Actor actor = (Actor)ibPlayers.tag;
                actor.realPosition = mapPoint;
                actor.officialRang = officialRang;

                // affichage des ailles
                if (actor.pvpEnabled)
                {
                    if (actor.spirit != Enums.Spirit.Name.neutral)
                    {
                        Bmp _spirit = new Bmp(@"gfx\general\obj\2\" + actor.spirit + @"\" + actor.spiritLevel + ".dat", Point.Empty, "spirit_" + ibPlayers.name, Manager.TypeGfx.Obj, false, 1);
                        _spirit.point = new Point((ibPlayers.rectangle.Width / 2) - (_spirit.rectangle.Width / 2), -_spirit.rectangle.Height);
                        ibPlayers.Child.Add(_spirit);

                        Txt lPseudo = new Txt(actor.pseudo, Point.Empty, "lPseudo_" + ibPlayers.name, Manager.TypeGfx.Obj, false, new Font("Verdana", 10, FontStyle.Regular), Brushes.Red);
                        lPseudo.point = new Point((ibPlayers.rectangle.Width / 2) - (TextRenderer.MeasureText(lPseudo.Text, lPseudo.font).Width / 2) + 5, -_spirit.rectangle.Height - 15);
                        ibPlayers.Child.Add(lPseudo);

                        Txt lLvlSpirit = new Txt(actor.spiritLevel.ToString(), Point.Empty, "lLvlSpirit_" + ibPlayers.name, Manager.TypeGfx.Obj, false, new Font("Verdana", 10, FontStyle.Bold), Brushes.Red);
                        lLvlSpirit.point = new Point((ibPlayers.rectangle.Width / 2) - (TextRenderer.MeasureText(lLvlSpirit.Text, lLvlSpirit.font).Width / 2) + 2, -_spirit.rectangle.Y - (_spirit.rectangle.Height / 2) - (TextRenderer.MeasureText(lLvlSpirit.Text, lLvlSpirit.font).Height / 2));
                        ibPlayers.Child.Add(lLvlSpirit);

                        Bmp village = new Bmp(@"gfx\general\obj\1\pays_thumbs.dat", Point.Empty, "village_" + actor.hiddenVillage, Manager.TypeGfx.Obj, false, 1, SpriteSheet.GetSpriteSheet("pays_" + actor.hiddenVillage + "_thumbs", 0));
                        village.point = new Point((ibPlayers.rectangle.Width / 2) - (village.rectangle.Width / 2), lPseudo.point.Y - village.rectangle.Height + 2);
                        ibPlayers.Child.Add(village);
                    }
                }
                else
                {
                    Txt lPseudo = new Txt(actor.pseudo, Point.Empty, "lPseudo_" + ibPlayers.name, Manager.TypeGfx.Obj, false, new Font("Verdana", 10, FontStyle.Regular), Brushes.Red);
                    lPseudo.point = new Point((ibPlayers.rectangle.Width / 2) - (TextRenderer.MeasureText(lPseudo.Text, lPseudo.font).Width / 2) + 5, -15);
                    ibPlayers.Child.Add(lPseudo);

                    Bmp village = new Bmp(@"gfx\general\obj\1\pays_thumbs.dat", Point.Empty, "village_" + actor.hiddenVillage, Manager.TypeGfx.Obj, false, 1, SpriteSheet.GetSpriteSheet("pays_" + actor.hiddenVillage + "_thumbs", 0));
                    village.point = new Point((ibPlayers.rectangle.Width / 2) - (village.rectangle.Width / 2), lPseudo.point.Y - village.rectangle.Height + 2);
                    ibPlayers.Child.Add(village);
                }

                // coloriage du personnage et attachement du maskColor au personnage
                CommonCode.ApplyMaskColorToClasse(ibPlayers);

                // pointeur vers l'image ibplayer de notre joueur s'il s'agit de son personnage
                if (CommonCode.MyPlayerInfo.instance.pseudo == actor.pseudo)
                {
                    CommonCode.MyPlayerInfo.instance.ibPlayer = ibPlayers;
                }

                // ajout du personnage dans la liste des joueurs
                CommonCode.AllActorsInMap.Add(ibPlayers);

                // lancement de l'animation de mouvement si le joueur a un waypoint
                if (actor.wayPoint.Count > 0)
                {
                    //mouvement du personnage
                    // thread a part
                    Thread tAnimAction = new Thread(() => CommonCode.AnimAction(ibPlayers, actor.wayPoint, actor.wayPoint.Count > 5 ? 20 : 50));
                    tAnimAction.Start();
                }

                // affectation des pdv
                actor.maxHealth     = maxHealth;
                actor.currentHealth = currentHealth;
            }
            #endregion
        }
        public void Fetch(string[] commandStrings)
        {
            #region
            // connexion d'un joueur
            // pseudo#classe#pvp:spirit:spiritLvl#village#MaskColors#map_position#orientation#level#action#waypoint   - separateur entre plusieurs joueurs
            // pvp=0 donc mode pvp off, si pvp = 1 mode pvp on
            string[] data = commandStrings[1].Split('#');

            string playerName = data[0];
            Enums.ActorClass.ClassName className = (Enums.ActorClass.ClassName)Enum.Parse(typeof(Enums.ActorClass.ClassName), data[1]);
            bool pvpEnabled          = bool.Parse(data[2].Split(':')[0]);
            Enums.Spirit.Name spirit = (Enums.Spirit.Name)Enum.Parse(typeof(Enums.Spirit.Name), data[2].Split(':')[1]);
            int spiritLevel          = int.Parse(data[2].Split(':')[2]);
            Enums.HiddenVillage.Names hiddenVillage = (Enums.HiddenVillage.Names)Enum.Parse(typeof(Enums.HiddenVillage.Names), data[3]);
            string   maskColorsString = data[4];
            string[] maskColors       = maskColorsString.Split('/');
            Point    mapPosition      = new Point(Convert.ToInt16(data[5].Split('/')[0]), Convert.ToInt16(data[5].Split('/')[1]));
            int      directionLook    = int.Parse(data[6]);
            int      level            = int.Parse(data[7]);
            Enums.AnimatedActions.Name animatedAction = (data[8] != "") ? (Enums.AnimatedActions.Name)Enum.Parse(typeof(Enums.AnimatedActions.Name), data[8]) : Enums.AnimatedActions.Name.idle;
            string waypoint = data[9];

            // verifier si le personnage est deja present pour ne pas créer un doublons, si par erreur le serveur n'envoie pas une cmd de deconnexion du client ou SessionZero
            if (CommonCode.AllActorsInMap.Exists(f => ((Actor)f.tag).pseudo == playerName && ((Actor)f.tag).pseudo != CommonCode.MyPlayerInfo.instance.pseudo))
            {
                Bmp tmpBmp = CommonCode.AllActorsInMap.Find(f => ((Actor)f.tag).pseudo == playerName);
                tmpBmp.visible = false;
                Manager.manager.GfxObjList.RemoveAll(f => f != null && f.GetType() == typeof(Bmp) && f.Tag() != null && f.Tag().GetType() == typeof(Actor) && ((Actor)f.Tag()).pseudo == playerName);
                CommonCode.AllActorsInMap.Remove(CommonCode.AllActorsInMap.Find(f => ((Actor)f.tag).pseudo == playerName));
            }

            // affichage du personnage + position + orientation
            Bmp ibPlayers = new Bmp(@"gfx\general\classes\" + className + ".dat", Point.Empty, "Player_" + playerName, 0, true, 1, SpriteSheet.GetSpriteSheet(className.ToString(), CommonCode.ConvertToClockWizeOrientation(directionLook)));
            ibPlayers.MouseOver += CommonCode.ibPlayers_MouseOver;
            ibPlayers.MouseOut  += CommonCode.ibPlayers_MouseOut;
            ibPlayers.MouseMove += CommonCode.CursorHand_MouseMove;
            ibPlayers.MouseClic += CommonCode.ibPlayers_MouseClic;
            Manager.manager.GfxObjList.Add(ibPlayers);

            // attachement des données
            ibPlayers.tag = new Actor(playerName, level, !pvpEnabled ? Enums.Spirit.Name.neutral : spirit, className, pvpEnabled, !pvpEnabled ? 0 : spiritLevel, hiddenVillage, maskColorsString, directionLook, animatedAction, waypoint);
            Actor pi = (Actor)ibPlayers.tag;
            pi.realPosition = mapPosition;

            CommonCode.AdjustPositionAndDirection(ibPlayers, new Point(mapPosition.X * 30, mapPosition.Y * 30));
            CommonCode.VerticalSyncZindex(ibPlayers);

            // affichage des ailles
            if (pi.pvpEnabled)
            {
                if (pi.spirit != Enums.Spirit.Name.neutral)
                {
                    Bmp spiritBmp = new Bmp(@"gfx\general\obj\2\" + pi.spirit + @"\" + pi.spiritLevel + ".dat", Point.Empty, "spirit_" + ibPlayers.name, Manager.TypeGfx.Obj, false, 1);
                    spiritBmp.point = new Point((ibPlayers.rectangle.Width / 2) - (spiritBmp.rectangle.Width / 2), -spiritBmp.rectangle.Height);
                    ibPlayers.Child.Add(spiritBmp);

                    Txt lPseudo = new Txt(pi.pseudo, Point.Empty, "lPseudo_" + ibPlayers.name, Manager.TypeGfx.Obj, false, new Font("Verdana", 10, FontStyle.Regular), Brushes.Red);
                    lPseudo.point = new Point((ibPlayers.rectangle.Width / 2) - (TextRenderer.MeasureText(lPseudo.Text, lPseudo.font).Width / 2) + 5, -spiritBmp.rectangle.Height - 15);
                    ibPlayers.Child.Add(lPseudo);

                    Txt lLvlSpirit = new Txt(pi.spiritLevel.ToString(), Point.Empty, "lLvlSpirit_" + ibPlayers.name, Manager.TypeGfx.Obj, false, new Font("Verdana", 10, FontStyle.Bold), Brushes.Red);
                    lLvlSpirit.point = new Point((ibPlayers.rectangle.Width / 2) - (TextRenderer.MeasureText(lLvlSpirit.Text, lLvlSpirit.font).Width / 2) + 2, -spiritBmp.rectangle.Y - (spiritBmp.rectangle.Height / 2) - (TextRenderer.MeasureText(lLvlSpirit.Text, lLvlSpirit.font).Height / 2));
                    ibPlayers.Child.Add(lLvlSpirit);

                    Bmp village = new Bmp(@"gfx\general\obj\1\pays_thumbs.dat", Point.Empty, "village_" + pi.hiddenVillage, Manager.TypeGfx.Obj, false, 1, SpriteSheet.GetSpriteSheet("pays_" + pi.hiddenVillage + "_thumbs", 0));
                    village.point = new Point((ibPlayers.rectangle.Width / 2) - (village.rectangle.Width / 2), lPseudo.point.Y - village.rectangle.Height + 2);
                    ibPlayers.Child.Add(village);
                }
            }
            else
            {
                Txt lPseudo = new Txt(pi.pseudo, Point.Empty, "lPseudo_" + ibPlayers.name, Manager.TypeGfx.Obj, false, new Font("Verdana", 10, FontStyle.Regular), Brushes.Red);
                lPseudo.point = new Point((ibPlayers.rectangle.Width / 2) - (TextRenderer.MeasureText(lPseudo.Text, lPseudo.font).Width / 2) + 5, -15);
                ibPlayers.Child.Add(lPseudo);

                Bmp village = new Bmp(@"gfx\general\obj\1\pays_thumbs.dat", Point.Empty, "village_" + pi.hiddenVillage, Manager.TypeGfx.Obj, false, 1, SpriteSheet.GetSpriteSheet("pays_" + pi.hiddenVillage + "_thumbs", 0));
                village.point = new Point((ibPlayers.rectangle.Width / 2) - (village.rectangle.Width / 2), lPseudo.point.Y - village.rectangle.Height + 2);
                ibPlayers.Child.Add(village);
            }

            // coloriage selon le MaskColors
            if (maskColors[0] != "null")
            {
                Color tmpColor = Color.FromArgb(Convert.ToInt16(maskColors[0].Split('-')[0]), Convert.ToInt16(maskColors[0].Split('-')[1]), Convert.ToInt16(maskColors[0].Split('-')[2]));
                CommonCode.SetPixelToClass(className, tmpColor, 1, ibPlayers);
            }

            if (maskColors[1] != "null")
            {
                Color tmpColor = Color.FromArgb(Convert.ToInt16(maskColors[1].Split('-')[0]), Convert.ToInt16(maskColors[1].Split('-')[1]), Convert.ToInt16(maskColors[1].Split('-')[2]));
                CommonCode.SetPixelToClass(className, tmpColor, 2, ibPlayers);
            }

            if (maskColors[2] != "null")
            {
                Color tmpColor = Color.FromArgb(Convert.ToInt16(maskColors[2].Split('-')[0]), Convert.ToInt16(maskColors[2].Split('-')[1]), Convert.ToInt16(maskColors[2].Split('-')[2]));
                CommonCode.SetPixelToClass(className, tmpColor, 3, ibPlayers);
            }

            // ajout du joueur dans la liste des joueurs
            CommonCode.ApplyMaskColorToClasse(ibPlayers);
            CommonCode.AllActorsInMap.Add(ibPlayers);
            #endregion
        }