Beispiel #1
0
        public static double GetCaracMod(NubiaMobile from, DndStat stat, bool bypass)
        {
            //Table des modificateur.
            //J'ai multiplier par 5 le niveau nessecaire pour obtenir le modificateur
            //Donc un 20 dnd équivaut a 100 Nubia
            //100 donnera +5.0
            double mod = 0;

            if (stat == DndStat.Dexterite)
            {
                mod = from.Dex;
            }
            else if (stat == DndStat.Force)
            {
                mod = from.Str;
            }
            else if (stat == DndStat.Intelligence)
            {
                mod = from.Int;
            }
            else if (stat == DndStat.Sagesse)
            {
                mod = from.Sag;
            }
            else if (stat == DndStat.Charisme)
            {
                mod = from.Cha;
            }
            else if (stat == DndStat.Constitution)
            {
                mod = from.Cons;
            }

            mod /= 2;
            mod -= 5;
            if (stat == DndStat.Dexterite && !bypass)
            {
                int limit = GetDexArmorLimite(from);
                if (mod > limit)
                {
                    mod = limit;
                }
            }
            //    Console.WriteLine("- Bonus de Carac: {0} / +{1}", c, (int)mod);
            return(mod);
        }
Beispiel #2
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile      f    = sender.Mobile;
            NubiaPlayer from = f as NubiaPlayer;

            //if( info.ButtonID == 40

            /*  if (info.ButtonID == 90) //Choix de don
             * {
             *    bool can = false;
             *    ClasseType cl = ClasseType.None;
             *    for (int i = -1; i < (int)ClasseType.Maximum; i++)
             *    {
             *        if (mOwner.DonCredits.ContainsKey((ClasseType)i))
             *        {
             *            if (mOwner.DonCredits[(ClasseType)i] > 0)
             *            {
             *                can = true;
             *                cl = (ClasseType)i;
             *            }
             *
             *        }
             *    }
             *    if( can )
             *        from.SendGump(new GumpDonChoix(from, cl ));
             * }
             * else*/if (info.ButtonID == 100) //Nouvelle classe
            {
                from.SendGump(new GumpChoixClasse(from, false));
            }
            else if (info.ButtonID >= 50 && info.ButtonID < 75) //Baisser classe
            {
                Classe c = null;
                try { c = classes[info.ButtonID - 50]; }
                catch (Exception ex) { }
                if (c != null)
                {
                    from.MakeClasse(c.GetType(), c.Niveau - 1);
                }
                from.SendGump(new GumpFichePerso(mOwner, mViewer));
            }
            else if (info.ButtonID >= 75 && info.ButtonID < 100) //Augmenter classe
            {
                Classe c = null;
                try { c = classes[info.ButtonID - 75]; }
                catch (Exception ex) { }
                if (c != null)
                {
                    from.MakeClasse(c.GetType(), c.Niveau + 1);
                }
                from.SendGump(new GumpFichePerso(mOwner, mViewer));
            }
            else if (info.ButtonID >= 200 && info.ButtonID < 250) //Augmenter stat
            {
                DndStat stat = (DndStat)(info.ButtonID - 200);
                switch (stat)
                {
                case DndStat.Force: from.RawStr++; break;

                case DndStat.Dexterite: from.RawDex++; break;

                case DndStat.Constitution: from.RawCons++; break;

                case DndStat.Intelligence: from.RawInt++; break;

                case DndStat.Sagesse: from.RawSag++; break;

                case DndStat.Charisme: from.RawCha++; break;
                }
                from.SendGump(new GumpFichePerso(mOwner, mViewer));
            }
            else if (info.ButtonID >= 250 && info.ButtonID < 300) //maitrises
            {
                ArmeTemplate t = (ArmeTemplate)(info.ButtonID - 250);
                mOwner.increaseMaitrise(t);
                from.SendGump(new GumpFichePerso(mOwner, mViewer));
            }
        }
Beispiel #3
0
 public static double GetCaracMod(NubiaMobile from, DndStat stat)
 {
     return(GetCaracMod(from, stat, false));
 }
Beispiel #4
0
 public static bool CaracModIsLimited(NubiaMobile from, DndStat stat)
 {
     return(GetCaracMod(from, stat, true) > GetCaracMod(from, stat, false));
 }