Example #1
0
        // contrôles auxiliaires specifique à l'effet en cours
        public static bool Apply(object[] parameters)
        {
            // params = im, spellPos, spellID
            NetIncomingMessage im = parameters[0] as NetIncomingMessage;
            Point spellPos        = parameters[1] as Point;
            int   spellID         = (int)parameters[2];

            Battle _battle = Battle.Battles.Find(f => f.IdBattle == (im.SenderConnection.Tag as Actor).idBattle);
            Actor  pi      = _battle.AllPlayersByOrder.Find(f => f.Pseudo == (im.SenderConnection.Tag as Actor).Pseudo);

            Actor.SpellsInformations spell_player_state = (im.SenderConnection.Tag as Actor).sorts.Find(f => f.SpellId == spellID);
            mysql.spells             spell_template     = (DataBase.DataTables.spells as List <mysql.spells>).Find(f => f.spellID == spellID && f.level == spell_player_state.Level);

            Point playerPos      = pi.map_position;
            Actor playerTargeted = _battle.AllPlayersByOrder.Find(f => f.map_position.X == spellPos.X && f.map_position.Y == spellPos.Y);

            #region check si la case centrale est bien une invocation avec les critères demandés
            // il faut que le sort sois lancé sur l'une des invocations du joueur en cours
            // on cherche si le joueur a une invocation sur le terrain
            Actor piInvoked = _battle.AllPlayersByOrder.Find(f => f.Pseudo.IndexOf("$") != -1 && f.Pseudo.Substring(0, f.Pseudo.IndexOf("$")) == pi.Pseudo && f.map_position.X == spellPos.X && f.map_position.Y == spellPos.Y);
            if (piInvoked == null)
            {
                return(false);
            }

            // check si l'idForSummon est bien celui du flag1
            // on cherche parmis les effet celui du killSummonToBoost pour soustraire le flag1
            Actor.effects effect = spell_player_state.effect.Find(f => f.base_effect.ToString() == "killSummonToBoost");
            if (effect != null)
            {
                int idForSummon = 0;
                if (!int.TryParse(effect.flag1, out idForSummon))
                {
                    return(false);
                }

                if (piInvoked.summonID != idForSummon)
                {
                    return(false);
                }
            }
            #endregion

            return(true);
        }
Example #2
0
        // sort 01 de la classe Naruto
        // contôle specifique au sort
        public static bool spellChecker(object[] parameters)
        {
            int   spellID         = 0;
            Actor pi              = parameters[0] as Actor;
            Point spellPos        = parameters[1] as Point;
            NetIncomingMessage im = parameters[2] as NetIncomingMessage;

            Actor.SpellsInformations infos_sorts = (im.SenderConnection.Tag as Actor).sorts.Find(f => f.SpellId == spellID);
            Battle _battle        = Battle.Battles.Find(f => f.IdBattle == (im.SenderConnection.Tag as Actor).idBattle);
            Point  playerPos      = pi.map_position;
            Actor  playerTargeted = _battle.AllPlayersByOrder.Find(f => f.map_position.X == spellPos.X && f.map_position.Y == spellPos.Y);

            mysql.spells spell = (DataBase.DataTables.spells as List <mysql.spells>).FindLast(f => f.level == infos_sorts.Level);

            int porte = Math.Abs(playerPos.Y - spellPos.Y);

            return(true);
        }
Example #3
0
        public static string Apply(object[] parameters)
        {
            // flag 1 = id de la classe qui se trouve dans la table Classes afin de soustraire les caractèristique de l'invocation
            // flag 2 = caracteristique a booster
            // flag 3 = valeur
            Actor spellCaster = parameters[0] as Actor;
            List <Effects.ZoneEffect.ZoneEffectTemplate> affectedPlayers = parameters[1] as List <Effects.ZoneEffect.ZoneEffectTemplate>;
            int spellID = (int)parameters[2];

            Actor.effects effect   = parameters[3] as Actor.effects;
            bool          cd       = Convert.ToBoolean(parameters[4]);
            Point         spellPos = parameters[5] as Point;

            mysql.spells spell = (DataBase.DataTables.spells as List <mysql.spells>).Find(f => f.spellID == spellID);
            //NetConnection nim = MainClass.netServer.Connections.Find(f => f.Tag != null && (f.Tag as PlayerInfo).Pseudo == spellCaster.Pseudo);

            Actor.SpellsInformations infos_sorts    = spellCaster.sorts.Find(f => f.SpellId == spellID);
            mysql.spells             spell_Template = (DataBase.DataTables.spells as List <mysql.spells>).Find(f => f.spellID == spellID && f.level == infos_sorts.Level);

            Battle _battle = Battle.Battles.Find(f => f.IdBattle == spellCaster.idBattle);

            ////////////////////////////////////////////////////////////////////////
            Enums.Buff.Name pState = (Enums.Buff.Name)Enum.Parse(typeof(Enums.Buff.Name), effect.flag1);

            //string DotonString = ""
            foreach (ZoneEffect.ZoneEffectTemplate affected in affectedPlayers)
            {
                affected.AffectedActor.BuffState.Add(pState);

                // on augemente la puissance des personnages dans la zone
                //spellCaster.doton += sorts.sort(sortID).isbl[spellLvl - 1].piBonus.doton;
                //DotonString += spellCaster.Pseudo + ":" + sorts.sort(sortID).isbl[spellLvl - 1].piBonus.doton + ":" + pi.doton;

                //string dom = "typeRox:etat:sinnin|cd:" + cdAllowed + "|chakra:neutre|deadList:" + playerDead + "|" + DotonString;
            }


            string buffer = "typeRox:etat:sinnin|cd:" + cd + "|chakra:neutre|deadList:|";

            return(buffer);
        }
Example #4
0
        public static void Apply(object[] parameters)
        {
            Actor spellCaster = parameters[0] as Actor;
            List <Effects.ZoneEffect.ZoneEffectTemplate> affectedPlayers = parameters[1] as List <Effects.ZoneEffect.ZoneEffectTemplate>;
            int spellID = (int)parameters[2];

            Actor.effects effect   = parameters[3] as Actor.effects;
            bool          cd       = Convert.ToBoolean(parameters[4]);
            Point         spellPos = parameters[5] as Point;

            Actor.SpellsInformations infos_sorts    = spellCaster.sorts.Find(f => f.SpellId == spellID);
            mysql.spells             spell_Template = (DataBase.DataTables.spells as List <mysql.spells>).Find(f => f.spellID == spellID && f.level == infos_sorts.Level);

            Battle _battle = Battle.Battles.Find(f => f.IdBattle == spellCaster.idBattle);

            //// ajout du sort dans la liste des envoutements systeme
            if (spellCaster.BuffsList.Exists(f => f.SortID == spellID && f.system))
            {
                // sort trouvé
                Actor.Buff piEnv = spellCaster.BuffsList.Find(f => f.SortID == spellID && f.system);
                piEnv.playerRoxed.Add("null");
            }
            else
            {
                // ajout du sort dans les envoutements
                Actor.Buff piEnv1 = new Actor.Buff();
                piEnv1.SortID           = spellID;
                piEnv1.title            = spell_Template.spellName;
                piEnv1.Debuffable       = false;
                piEnv1.VisibleToPlayers = false;
                piEnv1.playerRoxed.Add("null");         // pas la paine d'ajouter le nom d'un adversaire vus que le sort tap en zone, et na pas l'option relanceParJoueur
                piEnv1.relanceInterval = spell_Template.relanceInterval;
                piEnv1.BuffState       = Enums.Buff.State.Fin;
                piEnv1.relanceParTour  = spell_Template.relanceParTour;
                piEnv1.system          = true;
                piEnv1.Cd     = cd;
                piEnv1.Player = spellCaster.Pseudo;
                spellCaster.BuffsList.Add(piEnv1);
            }
        }
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
        public static string Apply(object[] parameters)
        {
            Actor spellCaster = parameters[0] as Actor;
            //Effects.ZoneEffect.zoneEffectTemplate affected = parameters[1] as Effects.ZoneEffect.zoneEffectTemplate;
            List <Effects.ZoneEffect.ZoneEffectTemplate> affectedPlayers = parameters[1] as List <Effects.ZoneEffect.ZoneEffectTemplate>;
            int spellID = (int)parameters[2];

            Actor.effects effect   = parameters[3] as Actor.effects;
            bool          cd       = Convert.ToBoolean(parameters[4]);
            Point         spellPos = parameters[5] as Point;

            Actor.SpellsInformations infos_sorts    = spellCaster.sorts.Find(f => f.SpellId == spellID);
            mysql.spells             spell_Template = (DataBase.DataTables.spells as List <mysql.spells>).Find(f => f.spellID == spellID && f.level == infos_sorts.Level);

            Battle _battle = Battle.Battles.Find(f => f.IdBattle == spellCaster.idBattle);

            // mise en randome du dom sort
            Random rnd = new Random();
            int    jet = rnd.Next(effect.min, effect.max + 1 + ((cd == true) ? spell_Template.cdDomBonnus : 0));

            int element = 0, equipedElement = 0, elementChakraLevel = 0, domElementFix = 0, resiElementFix = 0, resiElementPercent = 0;

            string buffer = "";

            // si aucun joueur n'est attribué, on envoie comme meme une cmd vide dans la partie dédié, pour que au moin en entre dans la boucle foreach
            if (affectedPlayers.Count() == 0)
            {
                ZoneEffect.ZoneEffectTemplate zet = new ZoneEffect.ZoneEffectTemplate();
                zet.AffectedActor = null;
                affectedPlayers.Add(zet);
            }

            foreach (ZoneEffect.ZoneEffectTemplate affected in affectedPlayers)
            {
                if (spell_Template.element.ToLower() == Enums.Chakra.Element.doton.ToString())
                {
                    element            = spellCaster.doton;
                    equipedElement     = spellCaster.equipedDoton;
                    elementChakraLevel = spellCaster.dotonChakraLevel;
                    domElementFix      = spellCaster.domDotonFix;
                    if (affected.AffectedActor != null)
                    {
                        resiElementFix     = affected.AffectedActor.resiDotonFix;
                        resiElementPercent = affected.AffectedActor.resiDotonPercent;
                    }
                }
                else if (spell_Template.element.ToLower() == Enums.Chakra.Element.futon.ToString())
                {
                    element            = spellCaster.futon;
                    equipedElement     = spellCaster.equipedFuton;
                    elementChakraLevel = spellCaster.futonChakraLevel;
                    domElementFix      = spellCaster.domFutonFix;
                    if (affected.AffectedActor != null)
                    {
                        resiElementFix     = affected.AffectedActor.resiFutonFix;
                        resiElementPercent = affected.AffectedActor.resiFutonPercent;
                    }
                }
                else if (spell_Template.element.ToLower() == Enums.Chakra.Element.katon.ToString())
                {
                    element            = spellCaster.katon;
                    equipedElement     = spellCaster.equipedKaton;
                    elementChakraLevel = spellCaster.katonChakraLevel;
                    domElementFix      = spellCaster.domKatonFix;
                    if (affected.AffectedActor != null)
                    {
                        resiElementFix     = affected.AffectedActor.resiKatonFix;
                        resiElementPercent = affected.AffectedActor.resiKatonPercent;
                    }
                }
                else if (spell_Template.element.ToLower() == Enums.Chakra.Element.raiton.ToString())
                {
                    element            = spellCaster.raiton;
                    equipedElement     = spellCaster.equipedRaiton;
                    elementChakraLevel = spellCaster.raitonChakraLevel;
                    domElementFix      = spellCaster.domRaitonFix;
                    if (affected.AffectedActor != null)
                    {
                        resiElementFix     = affected.AffectedActor.resiRaitonFix;
                        resiElementPercent = affected.AffectedActor.resiRaitonPercent;
                    }
                }
                else if (spell_Template.element.ToLower() == Enums.Chakra.Element.suiton.ToString())
                {
                    element            = spellCaster.suiton;
                    equipedElement     = spellCaster.equipedSuiton;
                    elementChakraLevel = spellCaster.suitonChakraLevel;
                    domElementFix      = spellCaster.domSuitonFix;
                    if (affected.AffectedActor != null)
                    {
                        resiElementFix     = affected.AffectedActor.resiSuitonFix;
                        resiElementPercent = affected.AffectedActor.resiSuitonPercent;
                    }
                }

                int dammage = (100 + element + equipedElement + spellCaster.power + spellCaster.equipedPower);
                dammage = (int)(jet * dammage) / 100;
                dammage = (int)(dammage * (1 + (0.1 * elementChakraLevel)));
                dammage = dammage + domElementFix + spellCaster.domFix;

                if (affected.AffectedActor != null)
                {
                    dammage *= affected.Pertinance / 100;                // pour les sort qui tape en zone, tant que c proche du centre tant que le rox est meilleur

                    // déduire les resistances du joueur
                    dammage -= ((dammage * resiElementPercent) / 100);
                    dammage -= affected.AffectedActor.resiFix - resiElementFix;

                    // application des dom sur le personnage
                    affected.AffectedActor.currentHealth -= dammage;
                    affected.AffectedActor.maxHealth     -= (dammage * 5) / 100;
                }

                // determiner si le ou les joueurs est/sont mort et si le combat est terminé, séparé par : s'il sagit de plusieurs
                string playerDead = "";
                if (affected.AffectedActor != null && affected.AffectedActor.currentHealth <= 0)
                {
                    //recalibrage des pdv a 0 pour eviter tout future problème
                    // joueur KO
                    affected.AffectedActor.currentHealth = 0;
                    playerDead = affected.AffectedActor.Pseudo;

                    // retirer le joueur de la liste des joueurs en vie
                    _battle.DeadPlayers.Add((Actor)(_battle.AllPlayersByOrder.Find(f => f.Pseudo == affected.AffectedActor.Pseudo)).Clone());
                    _battle.AllPlayersByOrder.RemoveAll(f => f.Pseudo == affected.AffectedActor.Pseudo);
                    _battle.SideA.RemoveAll(f => f.Pseudo == affected.AffectedActor.Pseudo);
                    _battle.SideB.RemoveAll(f => f.Pseudo == affected.AffectedActor.Pseudo);
                }

                ////////////////////////////////////////////////
                /// a verifier si le joueur est immunisé contre les dom ou autre pour un futur sort
                /// ////////////////////////////////////////////
                if (dammage < 0)
                {
                    dammage = 0;
                }

                // typerox peux etre rox(déduction),heal(augementation)
                buffer += "typeRox:rox|jet:" + jet + "|cd:" + cd + "|chakra:" + spell_Template.element + "|dom:" + dammage + "|deadList:" + playerDead + "|" + ((affected.AffectedActor != null) ? affected.AffectedActor.Pseudo : "null") + "#";
            }
            if (buffer != "")
            {
                buffer = buffer.Substring(0, buffer.Length - 1);
            }

            return(buffer);
        }
Example #7
0
        public static void Apply(Actor spellCaster, Battle _battle, Point spellPos, int spellID)
        {
            NetConnection nim = MainClass.netServer.Connections.Find(f => f.Tag != null && (f.Tag as Actor).Pseudo == spellCaster.Pseudo);

            Actor.SpellsInformations infos_sorts    = spellCaster.sorts.Find(f => f.SpellId == spellID);
            mysql.spells             spell_Template = (DataBase.DataTables.spells as List <mysql.spells>).Find(f => f.spellID == spellID && f.level == infos_sorts.Level);

            #region ZoneEffect qui permet la recherche de tous les joueurs prises dans l'effet selon la zone d'effet
            Type typeZoneEffect = Type.GetType("SERVER.Effects.ZoneEffect." + spell_Template.zoneEffect);
            System.Reflection.MethodInfo zoneEffect = typeZoneEffect.GetMethod("affected");

            object[] parameters = new object[4];
            parameters[0] = _battle;
            parameters[1] = spellPos;
            parameters[2] = spell_Template;
            parameters[3] = spellCaster;

            List <Effects.ZoneEffect.ZoneEffectTemplate> affectedPlayers;

            if (zoneEffect != null)
            {
                affectedPlayers = zoneEffect.Invoke(null, new object[] { parameters }) as List <Effects.ZoneEffect.ZoneEffectTemplate>;
            }
            else
            {
                affectedPlayers = new List <Effects.ZoneEffect.ZoneEffectTemplate>();
            }
            #endregion

            string buffer = "";

            #region CD
            int cdRequird = spell_Template.cd;
            int cdBonnus  = spell_Template.cdDomBonnus;
            int cdLeft    = cdRequird - spellCaster.cd;
            if (cdLeft <= 0)
            {
                cdLeft = 1;
            }

            Random rnd = new Random();

            // mise en 1/2 si le nombre cd est inférieur ou égale à 1
            bool cd = false;
            if (cdLeft <= 1)
            {
                cdLeft = 1;
            }

            // tentative de cd
            int rndCD = rnd.Next(0, cdLeft + 1);
            if (rndCD == 0)
            {
                cd = true;
            }

            #endregion

            #region balayage sur tout les effet (check target type et execution du handler du sort)
            foreach (Actor.effects current_effect in infos_sorts.effect)
            {
                #region check target type
                Actor centralFocus = _battle.AllPlayersByOrder.Find(f => f.map_position.X == spellPos.X && f.map_position.Y == spellPos.Y);
                Enums.spell_effect_target.targets target = CommonCode.TargetParser(spellCaster, centralFocus);
                if (!current_effect.targets.Exists(f => f == target))
                {
                    CommonCode.SendMessage("cmd•spellTargetNotAllowed", nim, true);
                    break;
                }
                #endregion

                #region buffer
                int minDice = current_effect.min;
                int maxDice = current_effect.max;

                Type t2 = Type.GetType("SERVER.Effects.Handlers." + current_effect.base_effect);
                if (t2 == null)
                {
                    Console.WriteLine("le handler pour SERVER.Effecrs.Handlers." + current_effect.base_effect + " n'existe pas");
                    return;
                }
                System.Reflection.MethodInfo TypeEffect = t2.GetMethod("Apply");

                object[] parameters2 = new object[6];
                parameters2[0] = spellCaster;
                parameters2[1] = affectedPlayers;
                parameters2[2] = spellID;
                parameters2[3] = current_effect;
                parameters2[4] = cd;
                parameters2[5] = spellPos;

                if (TypeEffect != null)
                {
                    buffer += (string)TypeEffect.Invoke(null, new object[] { parameters2 }) + "#";
                }

                if (buffer != "")
                {
                    buffer = buffer.Substring(0, buffer.Length - 1);
                }
                #endregion
            }
            #endregion

            #region inscription dans les envoutements
            foreach (Actor.effects current_effect in infos_sorts.effect)
            {
                Type buffHandler = Type.GetType("SERVER.Buff." + current_effect.base_effect);
                if (buffHandler != null)
                {
                    System.Reflection.MethodInfo buffHandlerApply = buffHandler.GetMethod("Apply");

                    object[] parameters2 = new object[6];
                    parameters2[0] = spellCaster;
                    parameters2[1] = affectedPlayers;
                    parameters2[2] = spellID;
                    parameters2[3] = current_effect;
                    parameters2[4] = cd;
                    parameters2[5] = spellPos;

                    if (buffHandlerApply != null)
                    {
                        buffHandlerApply.Invoke(null, new object[] { parameters2 });
                    }
                }
                else
                {
                }
            }
            #endregion

            #region diminution des pc
            spellCaster.currentPc -= spell_Template.pc;
            #endregion

            #region envoie de la command à tous les joueurs
            List <Actor> humans_in_battle = _battle.AllPlayersByOrder.FindAll(f => f.species == Species.Name.Human);

            // envoie d'une cmd a tous les abonnés au combats
            for (int cnt2 = 0; cnt2 < humans_in_battle.Count; cnt2++)
            {
                // envoie d'une requette a tous les personnages
                NetConnection humainNim = MainClass.netServer.Connections.Find(f => f.Tag != null && (f.Tag as Actor).Pseudo == humans_in_battle[cnt2].Pseudo);
                if (nim != null && humainNim != null)
                {
                    CommonCode.SendMessage("cmd•spellTileGranted•" + spellCaster.Pseudo + "•" + spellID + "•" + spellPos.X + "•" + spellPos.Y + "•" + infos_sorts.SpellColor + "•" + infos_sorts.Level + "•" + buffer + "•PcUsed:" + spell_Template.pc, humainNim, true);
                    Console.WriteLine("<--cmd•spellTileGranted•" + spellCaster.Pseudo + "•" + spellID + "•" + spellPos.X + "•" + spellPos.Y + "•" + infos_sorts.SpellColor + "•" + infos_sorts.Level + "•" + buffer + "•PcUsed:" + spell_Template.pc + " to " + (humainNim.Tag as Actor).Pseudo);
                }
            }
            #endregion
            //////////////////////////////////////////////////////////////////////////////////

            ///////////////////// cloture du combat s'il n y a personne
            if (buffer != "")
            {
                for (int cnt2 = 0; cnt2 < buffer.Split('#').Length; cnt2++)
                {
                    string dom2 = buffer.Split('#')[cnt2];
                    if (dom2.Split('|')[0] == "typeRox:rox")
                    {
                        string deadPlayer = dom2.Split('|')[5].Split(':')[1];
                        if (deadPlayer != "")
                        {
                            // supprimer le joueur de la liste des joueurs actifs
                            // check si le combat est terminé
                            Actor _playerTargeted = _battle.DeadPlayers.Find(f => f.Pseudo == deadPlayer);
                            if (CommonCode.IsClosedBattle(_battle, _playerTargeted))
                            {
                                _battle.State = Enums.battleState.state.closed;
                            }
                            else
                            {
                                Console.WriteLine("nothing !!!");
                            }
                        }
                    }
                }
            }
            ///////////////////////////////////////////////////////////////
        }
Example #8
0
        public static Actor Apply(Actor spellCaster, mysql.summon summon, mysql.spells spell_Template, Actor.effects effect)
        {
            // si la classe PlayerInfo est modifié comme l'ajout d'un nouveau champ, il faut ajouter son attribution ici
            Actor pi = new Actor();

            pi.blocage           = MnemonicStatsDispatcher.Int_Apply(summon.blocage, spellCaster.blocage);
            pi.cd                = MnemonicStatsDispatcher.Int_Apply(summon.cd, spellCaster.cd);
            pi.BuffsList         = new List <Actor.Buff>();
            pi.maxHealth         = MnemonicStatsDispatcher.Int_Apply(summon.TotalPdv, spellCaster.maxHealth);
            pi.currentHealth     = MnemonicStatsDispatcher.Int_Apply(summon.TotalPdv, spellCaster.maxHealth);
            pi.currentPc         = MnemonicStatsDispatcher.Int_Apply(summon.pc, spellCaster.originalPc);
            pi.currentPm         = MnemonicStatsDispatcher.Int_Apply(summon.pm, spellCaster.originalPm);
            pi.classeName        = spellCaster.classeName;
            pi.domDotonFix       = MnemonicStatsDispatcher.Int_Apply(summon.domDotonFix, spellCaster.domDotonFix);
            pi.domFix            = MnemonicStatsDispatcher.Int_Apply(summon.domFix, spellCaster.domFix);
            pi.domFutonFix       = MnemonicStatsDispatcher.Int_Apply(summon.domFutonFix, spellCaster.domFutonFix);
            pi.domKatonFix       = MnemonicStatsDispatcher.Int_Apply(summon.domKatonFix, spellCaster.domKatonFix);
            pi.domRaitonFix      = MnemonicStatsDispatcher.Int_Apply(summon.domRaitonFix, spellCaster.domRaitonFix);
            pi.domSuitonFix      = MnemonicStatsDispatcher.Int_Apply(summon.domSuitonFix, spellCaster.domSuitonFix);
            pi.doton             = MnemonicStatsDispatcher.Int_Apply(summon.doton, spellCaster.doton);
            pi.dodgeCD           = MnemonicStatsDispatcher.Int_Apply(summon.dodgeCD, spellCaster.dodgeCD);
            pi.dodgePC           = MnemonicStatsDispatcher.Int_Apply(summon.dodgePC, spellCaster.dodgePC);
            pi.dodgePE           = MnemonicStatsDispatcher.Int_Apply(summon.dodgePE, spellCaster.dodgePE);
            pi.dodgePM           = MnemonicStatsDispatcher.Int_Apply(summon.dodgePM, spellCaster.dodgePM);
            pi.escape            = MnemonicStatsDispatcher.Int_Apply(summon.escape, spellCaster.escape);
            pi.futon             = MnemonicStatsDispatcher.Int_Apply(summon.futon, spellCaster.futon);
            pi.idBattle          = spellCaster.idBattle;
            pi.summons           = MnemonicStatsDispatcher.Int_Apply(summon.summons, spellCaster.summons);
            pi.katon             = MnemonicStatsDispatcher.Int_Apply(summon.katon, spellCaster.katon);
            pi.level             = spell_Template.level;
            pi.maskColorString   = MnemonicStatsDispatcher.Str_Apply(summon.MaskColors, spellCaster.maskColorString);
            pi.map               = spellCaster.map;
            pi.directionLook     = 0;
            pi.originalPc        = MnemonicStatsDispatcher.Int_Apply(summon.pc, spellCaster.originalPc);
            pi.originalPm        = MnemonicStatsDispatcher.Int_Apply(summon.pm, spellCaster.originalPm);
            pi.owner             = spellCaster.Pseudo;
            pi.pe                = MnemonicStatsDispatcher.Int_Apply(summon.pe, spellCaster.pe);
            pi.Pseudo            = MnemonicStatsDispatcher.Str_Apply(summon.name, spellCaster.Pseudo);;
            pi.raiton            = MnemonicStatsDispatcher.Int_Apply(summon.raiton, spellCaster.raiton);
            pi.resiDotonFix      = MnemonicStatsDispatcher.Int_Apply(summon.resiDotonFix, spellCaster.resiDotonFix);
            pi.resiDotonPercent  = MnemonicStatsDispatcher.Int_Apply(summon.resiDotonPercent, spellCaster.resiDotonPercent);
            pi.resiFix           = MnemonicStatsDispatcher.Int_Apply(summon.resiFix, spellCaster.resiFix);
            pi.resiFutonFix      = MnemonicStatsDispatcher.Int_Apply(summon.resiFutonFix, spellCaster.resiFutonFix);
            pi.resiFutonPercent  = MnemonicStatsDispatcher.Int_Apply(summon.resiFix, spellCaster.resiFix);
            pi.resiKatonFix      = MnemonicStatsDispatcher.Int_Apply(summon.resiKatonFix, spellCaster.resiKatonFix);
            pi.resiKatonPercent  = MnemonicStatsDispatcher.Int_Apply(summon.resiKatonPercent, spellCaster.resiKatonPercent);
            pi.resiRaitonFix     = MnemonicStatsDispatcher.Int_Apply(summon.resiRaitonFix, spellCaster.resiRaitonFix);
            pi.resiRaitonPercent = MnemonicStatsDispatcher.Int_Apply(summon.resiRaitonPercent, spellCaster.resiRaitonPercent);
            pi.resiSuitonFix     = MnemonicStatsDispatcher.Int_Apply(summon.resiSuitonFix, spellCaster.resiSuitonFix);
            pi.resiSuitonPercent = MnemonicStatsDispatcher.Int_Apply(summon.resiFix, spellCaster.resiFix);
            pi.removeCD          = MnemonicStatsDispatcher.Int_Apply(summon.retraitCD, spellCaster.removeCD);
            pi.removePC          = MnemonicStatsDispatcher.Int_Apply(summon.retraitPC, spellCaster.removePC);
            pi.removePE          = MnemonicStatsDispatcher.Int_Apply(summon.retraitPE, spellCaster.removePE);
            pi.removePM          = MnemonicStatsDispatcher.Int_Apply(summon.retraitPM, spellCaster.removePM);
            pi.sexe              = spellCaster.sexe;

            for (int cnt = 0; cnt < summon.sorts.Split('/').Length; cnt++)
            {
                string tmp_data = summon.sorts.Split('/')[cnt];
                Actor.SpellsInformations _info_sorts = new Actor.SpellsInformations();
                _info_sorts.SpellId    = Convert.ToInt32(tmp_data.Split(':')[0]);
                _info_sorts.SpellPlace = Convert.ToInt32(tmp_data.Split(':')[1]);
                _info_sorts.Level      = Convert.ToInt32(tmp_data.Split(':')[2]);
                _info_sorts.SpellColor = Convert.ToInt32(tmp_data.Split(':')[3]);
                _info_sorts.effect     = Cryptography.crypted_data.effects_decoder(_info_sorts.SpellId, _info_sorts.Level);
                pi.sorts.Add(_info_sorts);
            }

            pi.species   = Species.Name.Summon;
            pi.suiton    = MnemonicStatsDispatcher.Int_Apply(summon.suiton, spellCaster.suiton);
            pi.maxHealth = MnemonicStatsDispatcher.Int_Apply(summon.TotalPdv, spellCaster.maxHealth);
            pi.teamSide  = spellCaster.teamSide;
            int.TryParse(effect.flag2, out pi.summonID);
            pi.visible = true;

            return(pi);
        }
Example #9
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
        }
Example #10
0
        public static void Apply(object[] parameters)
        {
            Actor spellCaster = parameters[0] as Actor;
            List <Effects.ZoneEffect.ZoneEffectTemplate> affectedPlayers = parameters[1] as List <Effects.ZoneEffect.ZoneEffectTemplate>;
            int spellID = (int)parameters[2];

            Actor.effects effect   = parameters[3] as Actor.effects;
            bool          cd       = Convert.ToBoolean(parameters[4]);
            Point         spellPos = parameters[5] as Point;

            Actor.SpellsInformations infos_sorts    = spellCaster.sorts.Find(f => f.SpellId == spellID);
            mysql.spells             spell_Template = (DataBase.DataTables.spells as List <mysql.spells>).Find(f => f.spellID == spellID && f.level == infos_sorts.Level);

            Battle _battle = Battle.Battles.Find(f => f.IdBattle == spellCaster.idBattle);

            #region inscription dans les envoutements
            //// ajout du sort dans la liste des envoutements systeme "non debufable"
            if (spellCaster.BuffsList.Exists(f => f.SortID == spellID && f.system))
            {
                // sort trouvé
                Actor.Buff piEnv = spellCaster.BuffsList.Find(f => f.SortID == spellID && f.system);
                foreach (Effects.ZoneEffect.ZoneEffectTemplate affectedPlayerTemplate in affectedPlayers)
                {
                    if (affectedPlayerTemplate.AffectedActor != null)
                    {
                        piEnv.playerRoxed.Add(affectedPlayerTemplate.AffectedActor.Pseudo);
                    }
                    else
                    {
                        piEnv.playerRoxed.Add("null");
                    }
                }
            }
            else
            {
                // ajout du sort dans les envoutements
                Actor.Buff piEnv1 = new Actor.Buff();
                piEnv1.SortID           = spellID;
                piEnv1.title            = spell_Template.spellName;
                piEnv1.Debuffable       = false;
                piEnv1.VisibleToPlayers = false;
                if (affectedPlayers.Count > 0)
                {
                    foreach (Effects.ZoneEffect.ZoneEffectTemplate affectedPlayerTemplate in affectedPlayers)
                    {
                        if (affectedPlayerTemplate.AffectedActor != null)
                        {
                            piEnv1.playerRoxed.Add(affectedPlayerTemplate.AffectedActor.Pseudo);
                        }
                        else
                        {
                            piEnv1.playerRoxed.Add("null");
                        }
                    }
                }
                else
                {
                    piEnv1.playerRoxed.Add("null");
                }
                piEnv1.relanceInterval = spell_Template.relanceInterval;
                piEnv1.BuffState       = Enums.Buff.State.Fin;
                piEnv1.relanceParTour  = spell_Template.relanceParTour;
                piEnv1.system          = true;
                piEnv1.Cd     = cd;
                piEnv1.Player = spellCaster.Pseudo;
                spellCaster.BuffsList.Add(piEnv1);
            }
            #endregion
        }
Example #11
0
        public static string Apply(object[] parameters)
        {
            // flag1 = id des states qui se trouve dans la table summon
            // flag2 = idForSummon

            Actor spellCaster = parameters[0] as Actor;
            List <Effects.ZoneEffect.ZoneEffectTemplate> affectedPlayers = parameters[1] as List <Effects.ZoneEffect.ZoneEffectTemplate>;
            int spellID = (int)parameters[2];

            Actor.effects effect   = parameters[3] as Actor.effects;
            bool          cd       = Convert.ToBoolean(parameters[4]);
            Point         spellPos = parameters[5] as Point;

            Actor.SpellsInformations infos_sorts    = spellCaster.sorts.Find(f => f.SpellId == spellID);
            mysql.spells             spell_Template = (DataBase.DataTables.spells as List <mysql.spells>).Find(f => f.spellID == spellID && f.level == infos_sorts.Level);
            Battle _battle = Battle.Battles.Find(f => f.IdBattle == spellCaster.idBattle);

            Lidgren.Network.NetConnection nim = MainClass.netServer.Connections.Find(f => (f.Tag as Actor).Pseudo == spellCaster.Pseudo);

            // check si le joueur a assez de point d'invocation, pour cela, on dois calculer combiens d'invoc il a déja invoqué
            int sumOfInvoc = _battle.AllPlayersByOrder.FindAll(f => f.Pseudo.IndexOf(spellCaster.Pseudo + "$") != -1).Count;

            if (spellCaster.summons <= sumOfInvoc)
            {
                // pas assez de point d'invocation
                CommonCode.SendMessage("cmd•spellNotEnoughInvoc", nim, true);
                Console.WriteLine("<--cmd•spellNotEnoughInvoc to " + spellCaster.Pseudo);
                return("");
            }

            int isAllowedSpellArea = Fight.spellsChecker.isAllowedSpellArea(spell_Template.pe, spellCaster.map_position, spellCaster, _battle, spellPos, 0, false, true);

            if (isAllowedSpellArea == 0)
            {
                // spell autorisé
            }
            else if (isAllowedSpellArea == 1)
            {
                // spell non autorisé, case obstacle
                CommonCode.SendMessage("cmd•spellTileNotAllowed", nim, true);
                Console.WriteLine("<--cmd•spellTileNotAllowed to " + spellCaster.Pseudo);
                return("");
            }
            else if (isAllowedSpellArea == 2)
            {
                // spell non autorisé, pas de porté
                CommonCode.SendMessage("cmd•spellPointNotEnoughPe", nim, true);
                return("");
            }
            else if (isAllowedSpellArea == -1)
            {
                // impossible de determiner la direction, normalement ca deverai le deviner
                return("");
            }

            // creation d'un clone
            mysql.summon _summon = (DataBase.DataTables.summon as List <mysql.summon>).Find(f => f.template_id == Convert.ToInt32(effect.flag1));
            Actor        __clone_jutsu_naruto = Summon.StatsDispatcher.Apply(spellCaster, _summon, spell_Template, effect);

            // creation d'un id aleatoire pour l'invocation
            string rndStr = "";

            // check si le nom de l'invoc est déja dans la liste des joueurs pour eviter un doublons
            while (true)
            {
                rndStr = CommonCode.ReturnRandomId();
                if (!_battle.AllPlayersByOrder.Exists(f => f.Pseudo == __clone_jutsu_naruto.Pseudo + "$" + rndStr))
                {
                    break;
                }
            }

            __clone_jutsu_naruto.Pseudo       = __clone_jutsu_naruto.Pseudo + "$" + rndStr; // separateur entre le nom et le id de l'invocation
            __clone_jutsu_naruto.map_position = spellPos;


            // insert dans la liste
            int index = _battle.AllPlayersByOrder.FindIndex(f => f.Pseudo == spellCaster.Pseudo);

            _battle.AllPlayersByOrder.Insert(index + 1, __clone_jutsu_naruto);

            string buffer = "";

            // conversion des rawdata sort en base64
            string encryptedSpellsRaw = Cryptography.Algo.Encoding.Base64Encode(_summon.sorts);

            //rawData = "typeRox:addInvoc|name:x|cd:x|totalPdv:x";
            string piRaw = __clone_jutsu_naruto.Pseudo + ":" + __clone_jutsu_naruto.classeName + ":" + __clone_jutsu_naruto.spirit + ":" + __clone_jutsu_naruto.spiritLvl.ToString() + ":" + __clone_jutsu_naruto.Pvp.ToString() + ":" + __clone_jutsu_naruto.hiddenVillage + ":" + __clone_jutsu_naruto.maskColorString + ":" + __clone_jutsu_naruto.directionLook.ToString() + ":" + __clone_jutsu_naruto.level.ToString() + ":" + __clone_jutsu_naruto.map + ":" + __clone_jutsu_naruto.officialRang.ToString() + ":" + __clone_jutsu_naruto.currentHealth.ToString() + ":" + __clone_jutsu_naruto.maxHealth.ToString() + ":" + __clone_jutsu_naruto.doton.ToString() + ":" + __clone_jutsu_naruto.katon.ToString() + ":" + __clone_jutsu_naruto.futon.ToString() + ":" + __clone_jutsu_naruto.raiton.ToString() + ":" + __clone_jutsu_naruto.suiton.ToString() + ":" + /*MainClass.chakralvl2*/ 0 + ":" + /*MainClass.chakralvl3*/ 0 + ":" + /*MainClass.chakralvl4*/ 0 + ":" + /*MainClass.chakralvl5*/ 0 + ":" + /*MainClass.chakralvl6*/ 0 + ":" + /*pi.usingDoton.ToString()*/ 0 + ":" + /*pi.usingKaton.ToString()*/ 0 + ":" + /*pi.usingFuton.ToString()*/ 0 + ":" + /*pi.usingRaiton.ToString()*/ 0 + ":" + /*pi.usingSuiton.ToString()*/ 0 + ":" + /*pi.dotonEquiped.ToString()*/ 0 + ":" + /*pi.katonEquiped.ToString()*/ 0 + ":" + /*pi.futonEquiped.ToString()*/ 0 + ":" + /*pi.raitonEquiped.ToString()*/ 0 + ":" + /*pi.suitonEquiped.ToString()*/ 0 + ":" + __clone_jutsu_naruto.originalPc.ToString() + ":" + __clone_jutsu_naruto.originalPm.ToString() + ":" + __clone_jutsu_naruto.pe.ToString() + ":" + __clone_jutsu_naruto.cd.ToString() + ":" + __clone_jutsu_naruto.summons.ToString() + ":" + __clone_jutsu_naruto.initiative.ToString() + ":" + __clone_jutsu_naruto.resiDotonPercent.ToString() + ":" + __clone_jutsu_naruto.resiKatonPercent.ToString() + ":" + __clone_jutsu_naruto.resiFutonPercent.ToString() + ":" + __clone_jutsu_naruto.resiRaitonPercent.ToString() + ":" + __clone_jutsu_naruto.resiSuitonPercent.ToString() + ":" + __clone_jutsu_naruto.dodgePC.ToString() + ":" + __clone_jutsu_naruto.dodgePM.ToString() + ":" + __clone_jutsu_naruto.dodgePE.ToString() + ":" + __clone_jutsu_naruto.dodgeCD.ToString() + ":" + __clone_jutsu_naruto.removePC.ToString() + ":" + __clone_jutsu_naruto.removePM.ToString() + ":" + __clone_jutsu_naruto.removePE.ToString() + ":" + __clone_jutsu_naruto.removeCD.ToString() + ":" + __clone_jutsu_naruto.escape.ToString() + ":" + __clone_jutsu_naruto.blocage.ToString() + ":" + encryptedSpellsRaw + ":" + __clone_jutsu_naruto.resiDotonFix + ":" + __clone_jutsu_naruto.resiKatonFix + ":" + __clone_jutsu_naruto.resiFutonFix + ":" + __clone_jutsu_naruto.resiRaitonFix + ":" + __clone_jutsu_naruto.resiSuitonFix + ":" + __clone_jutsu_naruto.resiFix + ":" + __clone_jutsu_naruto.domDotonFix + ":" + __clone_jutsu_naruto.domKatonFix + ":" + __clone_jutsu_naruto.domFutonFix + ":" + __clone_jutsu_naruto.domRaitonFix + ":" + __clone_jutsu_naruto.domSuitonFix + ":" + __clone_jutsu_naruto.domFix + ":" + __clone_jutsu_naruto.power + ":" + __clone_jutsu_naruto.equipedPower;

            buffer = "typeRox:addInvoc|" + piRaw + "|cd:" + cd;

            return(buffer);
        }