Exemple #1
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile      f    = sender.Mobile;
            NubiaPlayer from = f as NubiaPlayer;

            if (info.ButtonID == 99)
            {
                int m = choix;

                Type type = null;
                try
                {
                    type = Classe.GetClasse((ClasseType)m);
                }
                catch (Exception ex)
                {
                    from.SendMessage(ex.Message);
                }
                if (type != null)
                {
                    from.LastClasse = (ClasseType)m;
                    int classeNiv = 1;
                    foreach (Classe cl in from.GetClasses())
                    {
                        if (cl.CType == from.LastClasse)
                        {
                            classeNiv = cl.Niveau + 1;
                        }
                    }
                    //if (creation)
                    //from.GiveNiveau(0);

                    from.MakeClasse(type, classeNiv);

                    //  from.GiveNiveau(from.Niveau + 1);
                }
                else if (creation)
                {
                    from.SendGump(new GumpChoixClasse(m_owner, creation));
                    from.SendMessage(43, "Vous devez choisir une classe");
                }

                from.CloseGump(typeof(GumpChoixClasse));
                if (creation)
                {
                    for (int i = 0; i < from.Skills.Length; i++)
                    {
                        from.Skills[i].Cap  = 20.0;
                        from.Skills[i].Base = 0.0;
                    }
                    from.Frozen = false;
                    from.SendGump(new GumpMenuCreation(from));
                }
                else
                {
                    from.SendGump(new GumpFichePerso(m_owner, m_owner));
                }
                return;
            }
            else
            {
                choix = info.ButtonID - 100;
            }
            from.CloseGump(typeof(GumpChoixClasse));
            from.SendGump(new GumpChoixClasse(m_owner, creation, choix));
        }