Beispiel #1
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);
            // list.Add(String.Format("Rang: {0}\n",));
            string infos = "";

            if (mUtilisation == 0)
            {
                infos += "Cassé\n";
            }

            infos += String.Format("Déclenchement: {0}\nDégats: {1}\nPortée: {2}m",
                                   mDeclencheur.ToString(),
                                   DndHelper.nomDe(mDegat, mNbrLancer),
                                   (double)(mRange * 1.5));
            if (mPoisonning)
            {
                infos += "\nEmpoisonné";
            }
            infos += "\nAmorcé: ";
            if (mAmorce)
            {
                infos += "oui";
            }
            else
            {
                infos += "non";
            }
            list.Add(infos);
        }
Beispiel #2
0
 private bool checkReflexe(Mobile m)
 {
     if (m is NubiaMobile)
     {
         NubiaMobile mob  = m as NubiaMobile;
         int         roll = DndHelper.rollDe(De.vingt);
         roll += mob.getBonusReflexe(SortEnergie.Piege);
         if (m is NubiaPlayer)
         {
             if (((NubiaPlayer)mob).hasDon(DonEnum.SensPieges))
             {
                 roll += ((NubiaPlayer)mob).getDonNiveau(DonEnum.SensPieges);
             }
         }
         if (roll >= mDD)
         {
             m.Emote("*Evite le piège*");
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
Beispiel #3
0
            protected override void OnTick()
            {
                if (mOwner != null && mViewer != null && mBlessure != null)
                {
                    if (mViewer.Competences[CompType.Chirurgie].roll(mBlessure.DD + malus))
                    {
                        int val = DndHelper.rollDe(De.vingt) + (int)DndHelper.GetCaracMod(mViewer, DndStat.Sagesse)
                                  + (int)(DndHelper.GetCaracMod(mViewer, DndStat.Intelligence) / 2)
                                  + (int)(DndHelper.GetCaracMod(mViewer, DndStat.Dexterite) / 2);
                        mBlessure.SoinStatut += val;
                        mViewer.SendMessage("Vous soignez {0} avez succès", mOwner.Name);
                        if (mOwner != mViewer)
                        {
                            mViewer.SendMessage("{0} vous soigne avez succès", mOwner.Name);
                        }

                        mViewer.GiveXP(50);
                    }
                    else
                    {
                        if (Utility.Random(20) + (int)DndHelper.GetCaracMod(mOwner, DndStat.Constitution) < mBlessure.DD)
                        {
                            int degat = DndHelper.rollDe(De.quatre) + (int)mBlessure.BGravite;
                            if (mBlessure.SoinStatut > 5)
                            {
                                mBlessure.SoinStatut -= 5;
                            }
                            mOwner.SendMessage("Les soins vous font affreusement souffrir!");

                            mOwner.Damage(degat, mViewer);

                            if (mViewer.Backpack != null && Utility.Random(50) == 1)
                            {
                                MedecineKit kit = (MedecineKit)mViewer.Backpack.FindItemByType(typeof(MedecineKit));
                                if (kit != null)
                                {
                                    mViewer.SendMessage("Vous cassez vous outils");
                                    kit.Delete();
                                }
                            }
                        }
                        else
                        {
                            mOwner.SendMessage("Les soins sont raté, mais vous encaissez la douleur");
                        }

                        if (mOwner != mViewer)
                        {
                            mViewer.SendMessage("Vous ratez vos soins");
                        }
                        mViewer.GiveXP(25);

                        if (mOwner.BlessureList.Count > 0)
                        {
                            mViewer.SendGump(new GumpBlessure(mOwner, mViewer));
                        }
                    }
                }
            }
Beispiel #4
0
 public override void OnUse(NubiaPlayer p)
 {
     if (DndHelper.GetBiggerArmor(p) == null || DndHelper.GetBiggerArmor(p).ModelType < ArmorModelType.Maille)
     {
         new SpeedContext(p, SpeedContext.SpeedState.Fast, "Course");
         new InternalTimer(p).Start();
     }
     else
     {
         p.SendMessage("Votre armure est trop encombrante pour courir");
     }
 }
Beispiel #5
0
        public virtual int getBonusVigueur(SortEnergie ecole)
        {
            int bonus = 0;

            foreach (BaseBuff b in BuffList)
            {
                bonus += b.getSauvegarde(SauvegardeEnum.Vigueur, ecole);
            }
            foreach (BaseDebuff d in DebuffList)
            {
                bonus += d.getSauvegarde(SauvegardeEnum.Vigueur, ecole);
            }

            bonus += (int)DndHelper.GetCaracMod(this, DndStat.Constitution);

            return(bonus);
        }
Beispiel #6
0
        public virtual int getBonusReflexe(SortEnergie ecole)
        {
            int bonus = 0;

            foreach (BaseBuff b in BuffList)
            {
                bonus += b.getSauvegarde(SauvegardeEnum.Reflexe, ecole);
            }
            foreach (BaseDebuff d in DebuffList)
            {
                bonus += d.getSauvegarde(SauvegardeEnum.Reflexe, ecole);
            }

            bonus += (int)DndHelper.GetCaracMod(this, DndStat.Dexterite);

            return(bonus);
        }
Beispiel #7
0
        public RageMaitreBerserkBuff(NubiaMobile caster)
            : base(caster, caster, 20736,
                   3 + (int)DndHelper.GetCaracMod(caster, DndStat.Constitution, true), "Rage de Maitre Berserker")
        {
            mStr  = 8;
            mCons = 8;
            Sauvegardes.Add(new SauvegardeMod(4, SauvegardeEnum.Volonte));

            mCA = -2;
            if (caster is NubiaPlayer)
            {
                if (((NubiaPlayer)caster).hasDon(DonEnum.VolonteIndomptable))
                {
                    Sauvegardes.Add(new SauvegardeMod(2, SauvegardeEnum.Volonte, new SortEnergie[] { SortEnergie.Mental }));
                }
            }
            m_descrip = "Vous entrez dans une rage folle !";
        }
Beispiel #8
0
        public int CheckForOpportuniteResult(NubiaMobile agressor) //Attention, agressor peut être null
        {
            if (!agressor.getCanDoOpportunite())
            {
                return(0);
            }

            //Backstab !
            if (NubiaHelper.LookAt(agressor, this) &&
                (NubiaHelper.GetDirectionFrom((int)Direction) == NubiaHelper.GetDirectionFrom((int)agressor.Direction) ||
                 agressor.Hidden))
            {
                ExposeToOpportunite();
            }
            if (CheckForOpportunite() && agressor != null)
            {
                /*1d20 + Bonus Reflexes + Modificateur dexterité
                 *  contre
                 *  1d20 + Bonus Reflexes + Modificateur dexterité - 8 */
                int rollDef = Utility.RandomMinMax(1, 20);
                int rollAgr = Utility.RandomMinMax(1, 20);

                if (agressor.Weapon is BaseRanged)
                {
                    rollAgr -= 10;
                }

                int difference = (rollAgr + agressor.getBonusReflexe() + (int)DndHelper.GetCaracMod(agressor, DndStat.Dexterite))
                                 -
                                 (rollDef + getBonusReflexe() + (int)DndHelper.GetCaracMod(this, DndStat.Dexterite) - 8);

                agressor.mLastOpportuniteAction = DateTime.Now;
                if (difference <= 0)
                {
                    agressor.SendMessage("Vous ratez une attaque d'opportunité");
                }

                return(difference);
            }
            else
            {
                return(0);
            }
        }
Beispiel #9
0
        protected virtual void OnDeclenchement(NubiaMobile m)
        {
            int degats = DndHelper.rollDe(mDegat, mNbrLancer);

            foreach (NubiaMobile mob in this.GetMobilesInRange(mRange))
            {
                if (DndHelper.rollDe(De.vingt) + m.getBonusReflexe(SortEnergie.Piege) < mDD)
                {
                    mob.ActionRevelation();
                    mob.FixedParticles(mEffectID, 7, 5, 0, EffectLayer.Head);
                    mob.Damage(degats);
                    if (mPoisonning && DndHelper.rollDe(De.vingt) + m.getBonusVigueur(SortEnergie.Piege) < mDD)
                    {
                        mob.Poison = mPoison;
                    }
                }
                else
                {
                    mob.Emote("*évite le piège*");
                }
            }
        }
Beispiel #10
0
        public int intRoll(bool silent)
        {
            if (mOwner.NextSkillTime > DateTime.Now)
            {
                if (!silent)
                {
                    mOwner.SendMessage("vous devez attendre pour utiliser une compétence");
                }
                return(1);
            }
            int roll = DndHelper.rollDe(De.vingt);

            //Bonus Malus
            roll += mOwner.getBonusRoll();
            //Maitrise de la comp
            roll += (int)getMaitrise();

            if (mOwner is NubiaPlayer)
            {
                ((NubiaPlayer)mOwner).GiveXP(roll);
            }

            return(roll);
        }
Beispiel #11
0
 public bool Etourdir(NubiaMobile attacker)
 {
     if (attacker == null)
     {
         mLastEtourdiTime = DateTime.Now;
     }
     else
     {
         //Jet de force contre jet de vigueur.
         int agRoll  = Utility.RandomMinMax(1, 20) + (int)DndHelper.GetCaracMod(attacker, DndStat.Force);
         int defRoll = Utility.RandomMinMax(1, 20) + getBonusVigueur();
         if (agRoll > defRoll)
         {
             mLastEtourdiTime = DateTime.Now;
             Stam            -= agRoll - defRoll;
             Freeze(WorldData.TimeTour());
         }
         else
         {
             return(false);
         }
     }
     return(true);
 }
Beispiel #12
0
        public GumpFichePerso(NubiaPlayer _owner, NubiaPlayer _viewer)
            : base("Fiche de personnage", 520, 420, 250)
        {
            Closable = true;
            mOwner   = _owner;
            mViewer  = _viewer;

            int y     = YBase;
            int x     = XBase;
            int line  = 0;
            int scale = 22;
            int decal = 5;

            x += 5;

            AddBackground(x - 5, y, 240, 150 + (scale * mOwner.GetClasses().Count), 3000);
            AddLabel(x, y + line * scale, ColorText, "Nom: ");
            AddLabel(x + 50, y + line * scale, ColorTextLight, mOwner.Name);
            line++;
            AddLabel(x, y + line * scale, ColorText, "Race: ");
            if (mOwner.Race != null)
            {
                AddLabel(x + 50, y + line * scale, ColorTextLight, mOwner.Race.Name);
            }
            line++;


            AddLabel(x, y + line * scale, ColorText, "Moral: ");
            int colMoral = ColorText;

            if (mOwner.CurrentMoral > Moral.Normal)
            {
                colMoral = ColorTextGreen;
            }
            else if (mOwner.CurrentMoral < Moral.Normal)
            {
                colMoral = ColorTextRed;
            }
            AddLabel(x + 50, y + line * scale, colMoral, mOwner.MoralString);
            line++;
            /* Barre d'XP */
            AddLabel(x, y + (line * scale), ColorText, "Experience: ");

            int XpTot = 0;

            for (int n = 0; n < mOwner.Niveau; n++)
            {
                XpTot += XPHelper.GetXpForLevel(n);
            }
            int XpActuel = mOwner.XP - XpTot;

            Console.WriteLine("Experience : {0} / {1}", XpActuel, XPHelper.GetXpForLevel(mOwner.Niveau + 1));
            double ratio = ((double)XpActuel / (double)XPHelper.GetXpForLevel(mOwner.Niveau + 1));

            Console.WriteLine("Ratio: " + ratio);
            int largeurXp = (int)(ratio * Width);

            AddImage(x + 70, y + (line * scale) + 5, 0x809);
            AddImageTiled(x + 70, y + (line * scale) + 5, largeurXp, 8, 0x808);
            line++;

            //CLASSES
            bool canUp = false;

            if (mOwner.NivClassDispo > 0)
            {
                AddLabel(x, y + (line * scale), ColorTextGreen, "Repartissez vos points de classes!");
                canUp = true;
                line++;
            }

            classes = new Classe[mOwner.GetClasses().Count];
            mOwner.GetClasses().CopyTo(classes, 0);
            for (int i = 0; i < classes.Length; i++) //50+i baisser, 75+i augmenter
            {
                //AddButton(x, y + (line * scale), 0x1467, 0x1467, 50 + i, GumpButtonType.Reply, 0);
                if (canUp && canUpClasse(mOwner, classes[i]) && mOwner.Dons.canUpClasse())
                {
                    AddButton(x + 15, y + (line * scale), 0x1468, 0x1468, 75 + i, GumpButtonType.Reply, 0);
                }
                AddLabel(x + 20 + (canUp ? 15 : 0), y + (line * scale), ColorTextYellow, classes[i].CType.ToString() + " niveau " + classes[i].Niveau.ToString());
                line++;
            }
            if (classes.Length < 2 && canUp && canMultiClasse(mOwner) && mOwner.Dons.canUpClasse())  //Nouvelle classe 100
            {
                AddButton(x, y + (line * scale), 0x1468, 0x1468, 100, GumpButtonType.Reply, 0);
                AddLabel(x + 20, y + (line * scale), ColorTextLight, "Choisir une nouvelle classe");
                line++;
            }


            //ARMURES
            AddImage(x, y + (line * scale), 0x5200);
            AddLabel(x + 50, y + (line * scale), ColorText, "Classe d'armure: ");
            AddLabel(x + 150, y + (line * scale), (mOwner.CA > 0 ? ColorTextYellow : ColorTextRed), (mOwner.CA > 0 ? "+" : "") + mOwner.CA);
            line++;
            // AddLabel(XCol + 50, y + (line * scale), ColorText, "Armures: ");
            string armorList = "Aucune armure";

            if (mOwner.ArmorAllow >= NubiaArmorType.Legere)
            {
                armorList = "Légères";
            }
            if (mOwner.ArmorAllow >= NubiaArmorType.Intermediaire)
            {
                armorList += ", Intermédiaires";
            }
            if (mOwner.ArmorAllow >= NubiaArmorType.Lourde)
            {
                armorList += ", Lourdes";
            }
            AddLabel(x + 50, y + (line * scale), ColorTextLight, armorList);

            line++;



            AddBackground(x - 5, y + line * scale + 20, 240, 160, 3000);


            line++;
            int xCharac = x + 100;
            int xMod    = xCharac + 20;

            bool canUpCharac = (mOwner.RawStr + mOwner.RawDex + mOwner.RawCons + mOwner.RawInt + mOwner.RawSag + mOwner.RawCha) < DndHelper.getTotalStat(mOwner.Niveau);

            if (canUpCharac)
            {
                AddLabel(x, y + line * scale, ColorTextGreen, "Point de charactéristique dispo: " + (DndHelper.getTotalStat(mOwner.Niveau) - (mOwner.RawStr + mOwner.RawDex + mOwner.RawCons + mOwner.RawInt + mOwner.RawSag + mOwner.RawCha)).ToString());
                line++;
            }

            //Force
            int    colorCharac     = ColorTextGray;
            double modCharac       = DndHelper.GetCaracMod(mOwner, DndStat.Force);
            bool   isCharacLimited = DndHelper.CaracModIsLimited(mOwner, DndStat.Force);

            if (modCharac < 0 || isCharacLimited)
            {
                colorCharac = ColorTextRed;
            }
            else if (modCharac > 0)
            {
                colorCharac = ColorTextLight;
            }
            if (canUpCharac && mOwner.RawStr < mOwner.Niveau + 15)
            {
                AddSimpleButton(x, y + line * scale, 200 + (int)DndStat.Force, "Force: ");
            }
            else
            {
                AddLabel(x, y + (line * scale), ColorText, "Force: ");
            }
            AddLabel(xCharac, y + (line * scale), ColorText, mOwner.RawStr.ToString());
            AddLabel(xMod, y + (line * scale), colorCharac, "/ " + (modCharac >= 0 ? "+" : "") + modCharac.ToString());
            line++;
            //Dexterite
            colorCharac     = ColorTextGray;
            modCharac       = DndHelper.GetCaracMod(mOwner, DndStat.Dexterite);
            isCharacLimited = DndHelper.CaracModIsLimited(mOwner, DndStat.Dexterite);
            if (modCharac < 0 || isCharacLimited)
            {
                colorCharac = ColorTextRed;
            }
            else if (modCharac > 0)
            {
                colorCharac = ColorTextLight;
            }
            if (canUpCharac && mOwner.RawDex < mOwner.Niveau + 15)
            {
                AddSimpleButton(x, y + line * scale, 200 + (int)DndStat.Dexterite, "Dextérité: ");
            }
            else
            {
                AddLabel(x, y + (line * scale), ColorText, "Dextérité: ");
            }
            AddLabel(xCharac, y + (line * scale), ColorText, mOwner.RawDex.ToString());
            AddLabel(xMod, y + (line * scale), colorCharac, "/ " + (modCharac >= 0 ? "+" : "") + modCharac.ToString());
            line++;
            //Consitution
            colorCharac     = ColorTextGray;
            modCharac       = DndHelper.GetCaracMod(mOwner, DndStat.Constitution);
            isCharacLimited = DndHelper.CaracModIsLimited(mOwner, DndStat.Constitution);
            if (modCharac < 0 || isCharacLimited)
            {
                colorCharac = ColorTextRed;
            }
            else if (modCharac > 0)
            {
                colorCharac = ColorTextLight;
            }
            if (canUpCharac && mOwner.RawCons < mOwner.Niveau + 15)
            {
                AddSimpleButton(x, y + line * scale, 200 + (int)DndStat.Constitution, "Constitution: ");
            }
            else
            {
                AddLabel(x, y + (line * scale), ColorText, "Constitution: ");
            }
            AddLabel(xCharac, y + (line * scale), ColorText, mOwner.Cons.ToString());
            AddLabel(xMod, y + (line * scale), colorCharac, "/ " + (modCharac >= 0 ? "+" : "") + modCharac.ToString());
            line++;
            //Intelligence
            colorCharac     = ColorTextGray;
            modCharac       = DndHelper.GetCaracMod(mOwner, DndStat.Intelligence);
            isCharacLimited = DndHelper.CaracModIsLimited(mOwner, DndStat.Intelligence);
            if (modCharac < 0 || isCharacLimited)
            {
                colorCharac = ColorTextRed;
            }
            else if (modCharac > 0)
            {
                colorCharac = ColorTextLight;
            }
            if (canUpCharac && mOwner.RawInt < mOwner.Niveau + 15)
            {
                AddSimpleButton(x, y + line * scale, 200 + (int)DndStat.Intelligence, "Intelligence: ");
            }
            else
            {
                AddLabel(x, y + (line * scale), ColorText, "Intelligence: ");
            }
            AddLabel(xCharac, y + (line * scale), ColorText, mOwner.Int.ToString());
            AddLabel(xMod, y + (line * scale), colorCharac, "/ " + (modCharac >= 0 ? "+" : "") + modCharac.ToString());
            line++;
            //Sagesme
            colorCharac     = ColorTextGray;
            modCharac       = DndHelper.GetCaracMod(mOwner, DndStat.Sagesse);
            isCharacLimited = DndHelper.CaracModIsLimited(mOwner, DndStat.Sagesse);
            if (modCharac < 0 || isCharacLimited)
            {
                colorCharac = ColorTextRed;
            }
            else if (modCharac > 0)
            {
                colorCharac = ColorTextLight;
            }
            if (canUpCharac && mOwner.RawSag < mOwner.Niveau + 15)
            {
                AddSimpleButton(x, y + line * scale, 200 + (int)DndStat.Sagesse, "Sagesse: ");
            }
            else
            {
                AddLabel(x, y + (line * scale), ColorText, "Sagesse: ");
            }
            AddLabel(xCharac, y + (line * scale), ColorText, mOwner.Sag.ToString());
            AddLabel(xMod, y + (line * scale), colorCharac, "/ " + (modCharac >= 0 ? "+" : "") + modCharac.ToString());
            line++;
            //Charisme
            colorCharac     = ColorTextGray;
            modCharac       = DndHelper.GetCaracMod(mOwner, DndStat.Charisme);
            isCharacLimited = DndHelper.CaracModIsLimited(mOwner, DndStat.Charisme);
            if (modCharac < 0 || isCharacLimited)
            {
                colorCharac = ColorTextRed;
            }
            else if (modCharac > 0)
            {
                colorCharac = ColorTextLight;
            }
            if (canUpCharac && mOwner.RawCha < mOwner.Niveau + 15)
            {
                AddSimpleButton(x, y + line * scale, 200 + (int)DndStat.Charisme, "Charisme: ");
            }
            else
            {
                AddLabel(x, y + (line * scale), ColorText, "Charisme: ");
            }
            AddLabel(xCharac, y + (line * scale), ColorText, mOwner.Cha.ToString());
            AddLabel(xMod, y + (line * scale), colorCharac, "/ " + (modCharac >= 0 ? "+" : "") + modCharac.ToString());
            line++;



            /// LIENS

            /*     AddSimpleButton(x, y + line * scale, 40, "Afficher les compétences");
             *   line++;
             *   AddSimpleButton(x, y + line * scale, 41, "Afficher les dons");
             *   line++;
             *   bool magie = false;
             *
             *   foreach (Classe c in mOwner.Classes.Values)
             *   {
             *       if (c.Mage == MageType.Hybrid || c.Mage == MageType.Pur)
             *           magie = true;
             *   }
             *
             *   if (magie)
             *   {
             *       AddSimpleButton(x, y + line * scale, 42, "Afficher la magie");
             *       line++;
             *   }
             *
             *   AddSimpleButton(x, y + line * scale, 43, "Afficher les réputations");
             *   line++;*/



            /**
             *
             * 2ND COLONNE
             *
             * Previous = 2322, 2323
             *
             * PrevFleche = 4014, 4015
             * NextFleche = 4005, 4006
             *
             * */


            /*
             *
             * */

            int xprev     = XCol;
            int xnext     = XCol + 200;
            int yprevnext = y;

            line = 0;
            // PAGE 1

            /*    AddPage(1);
             *  AddButton(xprev, yprevnext, 4014, 4015, 5, GumpButtonType.Page, 1);
             *  AddButton(xnext, yprevnext, 4005, 4006, 6, GumpButtonType.Page, 2);*/
            AddLabel(XCol, y + line * scale, ColorTextYellow, "Bonus & Maitrises d'armes");
            line++;

            AddLabel(XCol, y + line * scale, ColorTextLight, "Bonus aux jets:");
            line++;
            AddLabel(XCol, y + line * scale, ColorText, "Attaque:");
            string attaquebonii = "";

            for (int i = 0; i < mOwner.BonusAttaque.Length; i++)
            {
                attaquebonii += "+" + mOwner.BonusAttaque[i] + (i < mOwner.BonusAttaque.Length - 1 ? " / " : "");
            }
            AddLabel(XCol + 60, y + line * scale, ColorTextYellow, attaquebonii);

            line++;
            AddLabel(XCol, y + line * scale, ColorText, "Reflexe:");
            AddLabel(XCol + 60, y + line * scale, ColorTextYellow, "+" + mOwner.getBonusReflexe().ToString());

            line++;
            AddLabel(XCol, y + line * scale, ColorText, "Volonté:");
            AddLabel(XCol + 60, y + line * scale, ColorTextYellow, "+" + mOwner.getBonusVolonte().ToString());

            line++;
            AddLabel(XCol, y + line * scale, ColorText, "Vigueur:");
            AddLabel(XCol + 60, y + line * scale, ColorTextYellow, "+" + mOwner.getBonusVigueur().ToString());

            // MAITRISES d'ARMES

            line++;
            AddLabel(XCol, y + line * scale, ColorTextLight, "Maitrises d'armes");
            int maitrise_depense = mOwner.PtsMaitriseTotal();
            int maitrise_max     = DndHelper.getMaitriseMax(mOwner.Niveau);
            int maitrise_total   = DndHelper.getTotalMaitrise(mOwner.Niveau);
            int maitrise_restant = maitrise_total - maitrise_depense;

            if (maitrise_restant > 0)
            {
                AddLabel(XCol + 150, y + line * scale, ColorTextGreen, "Disponible(s): " + (maitrise_restant).ToString());
            }
            int maitrise_line = 1;
            int maitriseX     = 0;

            scale -= 3;
            for (int i = 0; i < (int)ArmeTemplate.Maximum; i++)
            {
                if ((int)ArmeTemplate.Maximum == i)
                {
                    continue;
                }
                bool canIncrease = false;
                canIncrease = (maitrise_restant > 0) && mOwner.getMaitrise((ArmeTemplate)i) < maitrise_max;
                string maitriseName = NubiaWeapon.getTemplateString((ArmeTemplate)i);
                int    mcol         = ColorText;
                int    mvalue       = mOwner.getMaitrise((ArmeTemplate)i);
                if (mvalue > 0)
                {
                    mcol = ColorTextLight;
                }
                int buttonDecal = 0;
                if (canIncrease)
                {
                    buttonDecal = 15;
                    AddSimpleButton(XCol + maitriseX, 15 + y + 5 + (maitrise_line + line) * scale, 250 + i, maitriseName, mcol);
                }
                else
                {
                    AddLabel(XCol + maitriseX, 15 + y + 5 + (maitrise_line + line) * scale, mcol, maitriseName);
                }

                for (int v = 0; v < mvalue; v++)
                {
                    AddImage(XCol + 90 + maitriseX + buttonDecal + (13 * v), 17 + y + 5 + (maitrise_line + line) * scale, 9022);
                }

                maitrise_line++;
            }

            // DONS
            // PAGE 2


            /*
             * int totalLines = 2; // DndHelper.getDonTotal(mOwner.Niveau);
             * foreach (DonEnum don in mOwner.Dons.Dons)
             * {
             *  if (don == DonEnum.DonSupClasse)
             *      totalLines += mOwner.getDonNiveau(DonEnum.DonSupClasse);
             *  totalLines++;
             * }
             *
             *
             *
             * line = 1;
             * int page = 2;
             * int linePerPage = 19;
             * int totalPage = totalLines / 19 + page;
             * // int donsDispo = DndHelper.getDonTotal(mOwner.Niveau);
             *
             *
             *
             * foreach (DonEnum don in mOwner.Dons.Dons)
             * {
             *  if (line > linePerPage)
             *  {
             *      page++;
             *      line = 1;
             *  }
             *
             *  if (line == 1)
             *  {
             *      AddPage(page);
             *      AddButton(xprev, yprevnext, 4014, 4015, 5, GumpButtonType.Page, page-1);
             *    //  if( page < totalPage )
             *          AddButton(xnext, yprevnext, 4005, 4006, 6, GumpButtonType.Page, page + 1);
             *    //  else
             *   //       AddButton(xnext, yprevnext, 4005, 4006, 6, GumpButtonType.Page, page );
             *
             *      AddLabel(XCol, y + line * scale, ColorTextYellow, "Dons du personnage");
             *      line++;
             *
             *      int dsup = 0;
             *      for (int i = -1; i < (int)ClasseType.Maximum; i++)
             *      {
             *
             *          if (mOwner.DonCredits.ContainsKey((ClasseType)i))
             *          {
             *              if (mOwner.DonCredits[(ClasseType)i] > 0)
             *              {
             *                  dsup += mOwner.DonCredits[(ClasseType)i];
             *              }
             *          }
             *
             *      }
             *      if (dsup > 0)
             *      {
             *          AddSimpleButton(XCol, y + line * scale, 90, "Choisir un don ( " + dsup + " disponibles )", ColorTextGreen);
             *          line++;
             *      }
             *  }
             *  if (don == DonEnum.DonSupClasse)
             *      continue;
             *
             *  int niv = mOwner.getDonNiveau(don);
             *  if (niv > 0)
             *  {
             *      string dname = "";
             *      if (BaseDon.DonBank.ContainsKey(don.ToString().ToLower()))
             *          dname = BaseDon.DonBank[don.ToString().ToLower()].Name;
             *      else
             *          dname = don.ToString();
             *
             *      AddLabel(XCol, y + line * scale, ColorText, dname + (niv > 1 ? " (Rang:" + niv.ToString() + ")" : ""));
             *
             *      BaseDon rdon = null;
             *      if( BaseDon.DonBank.ContainsKey( don.ToString().ToLower() )){
             *          rdon = BaseDon.DonBank[don.ToString().ToLower()];
             *          if (rdon.CanUse)
             *          {
             *              line++;
             *              AddLabel(XCol + 20, y + line * scale, ColorTextGray, "(Utilisation: .don " + don.ToString() + ")");
             *          }
             *      }
             *
             *
             *      line++;
             *  }
             *
             * }*/

            /*
             * page++;
             * AddPage(page);
             * line = 1;
             * AddButton(xprev, yprevnext, 4014, 4015, 5, GumpButtonType.Page, page - 1);
             * AddLabel(XCol, y + line * scale, ColorTextYellow, "Magie");
             * line++;
             * line++;
             * AddLabel(XCol, y + line * scale, ColorText, "Niveau de sort maxi: " + mOwner.getLevelMagie());
             * line++;
             * AddLabel(XCol, y + line * scale, ColorText, "Points d'apprentissage: " + mOwner.getTotalPtsApprentissage());
             * line++;
             * AddLabel(XCol, y + line * scale, ColorText, "Points de creation: " + mOwner.getTotalPtsCreation());
             * line++;*/
        }
Beispiel #13
0
        public double getPureMaitrise()
        {
            double maitrise = (isCompetenceClasse ? mAchat : ((double)mAchat / 2.0)) + DndHelper.GetCaracMod(mOwner, SType, !LimitedByArmor);

            maitrise = Math.Round(maitrise, 2);

            return(maitrise);
        }
Beispiel #14
0
        public async Task RollAsync([Summary("Dice number and size. Input format: `XdY` where X is number of rolls and Y is the die type (e.g. `1d20`)")] string dice_roll = null)
        {
            //Check for input to command
            if (string.IsNullOrEmpty(dice_roll))
            {
                await ServiceReplyAsync(error_message);
                await ServiceReplyAsync("Here is a completely random roll ya big idiot:");

                //Random Roll
                Random random = new Random();

                dice_roll = "1d" + random.Next(1000000).ToString();
            }

            string[] substrings = dice_roll.Split("d");

            //Check input format
            if (substrings.Length != 2)
            {
                await ServiceReplyAsync(error_message);

                return;
            }

            int roll_count  = 0;
            int dice_amount = 0;
            int curr_roll   = 0;
            int roll_sum    = 0;
            int min_roll    = 1000000;
            int max_roll    = 0;

            //Convert roll amount and dice size to integers
            bool valid_roll_count  = int.TryParse(substrings[0], out roll_count);
            bool valid_dice_amount = int.TryParse(substrings[1], out dice_amount);

            if (valid_roll_count == false || valid_dice_amount == false)
            {
                await ServiceReplyAsync(error_message);

                return;
            }

            if (roll_count <= 0 || roll_count > 100)
            {
                await ServiceReplyAsync(oblivion);

                return;
            }

            List <int> roll_list = new List <int>();

            //Commence rolling using DndHelper.DiceRoll
            for (int i = 0; i < roll_count; i++)
            {
                curr_roll = DndHelper.RollDice(dice_amount);

                //Update maximum roll
                if (curr_roll > max_roll)
                {
                    max_roll = curr_roll;
                }

                if (curr_roll < min_roll)
                {
                    min_roll = curr_roll;
                }

                roll_list.Add(curr_roll);

                roll_sum = roll_sum + curr_roll;
            }

            //Print results
            await ServiceReplyAsync("**Results:** " + string.Join(", ", roll_list));

            if (roll_count > 1)
            {
                await ServiceReplyAsync("**Min:** " + min_roll.ToString());
                await ServiceReplyAsync("**Max:** " + max_roll.ToString());

                await ServiceReplyAsync("**Roll Sum:** " + roll_sum.ToString());
            }
        }