Ejemplo n.º 1
0
        public CreerContratGump(PlayerMobile from, ContratAssassinat contrat)
            : base("", 0, 0)
        {
            m_from    = from;
            m_contrat = contrat;

            m_from.CloseGump(typeof(CreerContratGump));

            AddBackground(0, 0, 400, 410, 5054);

            AddHtml(x + 50, y + (line * scale), 150, 20, "<h3> Commanditaire </h3>", false, false);
            AddHtml(x + 200, y + (line * scale), 150, 20, ": " + ((contrat.Commanditaire != null) ? contrat.Commanditaire.GetNameUsedBy(from) : ""), false, false);

            line++;

            AddButton(x, y + (line * scale), 0xFAE, 0xFB0, 1, GumpButtonType.Reply, 0);
            AddHtml(x + 50, y + (line * scale), 150, 20, "<h3> Cible </h3>", false, false);
            AddHtml(x + 200, y + (line * scale), 150, 20, ": " + ((contrat.Cible != null) ? contrat.Cible.GetNameUsedBy(from) : ""), false, false);

            line += 2;

            AddHtml(x, y + (line * scale), 150, 20, "<h3> Explication </h3>", false, false);
            line++;
            AddBackground(25, y + (line * scale), 350, 175, 5054);
            AddTextEntry(50, y + 25 + (line * scale), 300, 125, 0x7FA, 2, m_contrat.Explication);

            line += 8;

            AddButton(x, y + (line * scale), 0xFAE, 0xFB0, 3, GumpButtonType.Reply, 0);
            AddHtml(x + 50, y + (line * scale), 300, 20, "<h3> Valider et créer le contrat.</h3>", false, false);
        }
Ejemplo n.º 2
0
            public MortContestGump(Mobile from, ContratAssassinat cs, List <Mobile> listePersoPresent)
                : base(0, 0)
            {
                m_From = from;
                m_cs   = cs;
                m_listePersoPresent = listePersoPresent;

                Closable   = false;
                Disposable = true;
                Dragable   = true;
                Resizable  = false;

                AddPage(0);

                //BG
                AddBackground(80, 72, 390, 400, 3600);
                AddBackground(90, 82, 370, 380, 9200);
                AddBackground(100, 92, 350, 355, 3500);
                AddBackground(140, 230, 270, 120, 0xBB8);

                AddHtml(140, 125, 270, 100, "Désirez-vous laisser un message ? \n\nIci vous pouvez décrire quelles ont été les circonstances de votre mort, et pourquoi vous souhaitez contester.", false, false);

                AddTextEntry(140, 240, 265, 120, 0x7FA, 2, "");

                AddHtml(220, 380, 100, 20, "Envoyer", false, false);
                AddButton(280, 380, 0x481, 0x483, 1, GumpButtonType.Reply, 0);
            }
Ejemplo n.º 3
0
 public static void Serialize(GenericWriter writer, ContratAssassinat contrat)
 {
     writer.Write(contrat.Commanditaire);
     writer.Write(contrat.Assassin);
     writer.Write(contrat.Cible);
     writer.Write(contrat.Explication);
 }
Ejemplo n.º 4
0
        public void Serialize(GenericWriter writer)
        {
            writer.Write((int)0); // Version

            writer.Write(m_Achever);
            writer.Write(m_Suicide);
            writer.Write((DateTime)m_lastAchever);
            writer.Write((DateTime)m_lastAssassinat);

            writer.Write((Container)m_Corps);
            writer.Write(m_RisqueDeMort);
            writer.Write(m_EndroitMort);
            writer.Write(m_Mort);

            writer.Write((int)m_MortState);
            writer.Write((int)m_MortEvo);

            writer.Write((DateTime)m_AmeLastFed);
            writer.Write((bool)m_MortVivant);

            if (m_contratListe != null)
            {
                writer.Write(m_contratListe.Count);
                foreach (ContratAssassinat contrat in m_contratListe)
                {
                    ContratAssassinat.Serialize(writer, contrat);
                }
            }
        }
Ejemplo n.º 5
0
            public void Achever_Callback(object state)
            {
                PlayerMobile from = (PlayerMobile)state;

                from.Frozen = false;

                if (startingHits <= from.Hits) // Si le joueur n'a pas perdu d'HP pendant l'achèvement..
                {
                    ContratAssassinat cs = null;
                    for (int i = 0; i < from.MortEngine.ContratListe.Count; i++)
                    {
                        if (from.MortEngine.ContratListe[i].Cible == m_corpseOwner)
                        {
                            cs = from.MortEngine.ContratListe[i];
                            break;
                        }
                    }

                    if (cs == null)
                    {
                        cs = new ContratAssassinat(from, from, m_corpseOwner, "Aucune explication");
                    }

                    // Fais comme si il était mort pour éviter qu'il respawn avant d'avoir répondu au gump de mort.
                    ((PlayerMobile)m_corpseOwner).MortEngine.Mort             = true;
                    ((PlayerMobile)m_corpseOwner).MortEngine.MortCurrentState = MortState.Mourir;

                    m_corpseOwner.SendGump(new MortGump((Mobile)from, cs));
                }
                else
                {
                    from.SendMessage("Vous ne pouvez pas achever quelqu'un en étant en combat !");
                }
            }
Ejemplo n.º 6
0
        public MortEngine(PlayerMobile m, GenericReader reader)
        {
            mobile = m;

            int version = reader.ReadInt();

            m_Achever        = reader.ReadBool();
            m_Suicide        = reader.ReadBool();
            m_lastAchever    = reader.ReadDateTime();
            m_lastAssassinat = reader.ReadDateTime();
            m_Corps          = (Container)reader.ReadItem();
            m_RisqueDeMort   = reader.ReadBool();
            m_EndroitMort    = reader.ReadPoint3D();
            m_Mort           = reader.ReadBool();

            m_MortState = (MortState)reader.ReadInt();
            m_MortEvo   = (MortEvo)reader.ReadInt();

            m_AmeLastFed = reader.ReadDateTime();
            m_MortVivant = reader.ReadBool();

            if (!mobile.Alive && !m_Mort)
            {
                m_RisqueDeMort = false;

                EvanouieTimer timer = new EvanouieTimer(mobile, m_Corps, (int)mobile.Direction, this.RisqueDeMort);
                m_TimerEvanouie = timer;
                timer.Start();
            }

            if (m_RisqueDeMort)
            {
                RisqueDeMortTimer timer = new RisqueDeMortTimer(mobile);
                m_TimerMort = timer;
                timer.Start();
            }

            if (m_MortVivant)
            {
                MortVivantEvoTimer timer = new MortVivantEvoTimer(mobile);
                m_MortVivantTimer = timer;
                timer.Start();
            }

            if (m_contratListe == null)
            {
                m_contratListe = new List <ContratAssassinat>();
            }

            int count = reader.ReadInt();

            for (int i = 0; i < count; i++)
            {
                m_contratListe.Add(ContratAssassinat.Deserialize(reader));
            }
        }
Ejemplo n.º 7
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if ((info.GetTextEntry(2)).Text != "")
            {
                m_contrat.Explication = (info.GetTextEntry(2)).Text;
            }

            switch (info.ButtonID)
            {
            case 0:
            {
                m_from.CloseGump(typeof(CreerContratGump));
                return;
            }

            case 1:
            {
                m_from.Target = new CibleTarget(m_from, m_contrat);         // Cible
                break;
            }

            // case 2 == Explication.
            case 3:
            {
                if (m_contrat.Commanditaire != null)
                {
                    if (m_contrat.Cible != null)
                    {
                        if (m_contrat.Explication != ContratAssassinat.DefaultExplication())
                        {
                            m_from.MortEngine.ContratListe.Add(m_contrat);         // Confirmer le contrat.
                            return;
                        }
                        else
                        {
                            m_from.SendMessage("Vous devez donner une explication.");
                        }
                    }
                    else
                    {
                        m_from.SendMessage("Vous devez choisir une cible!");
                    }
                }
                else
                {
                    m_from.SendMessage("Arvendor scripte mal.");
                }
                m_from.SendGump(new CreerContratGump(m_from, m_contrat));
                break;
            }
            }
        }
Ejemplo n.º 8
0
        public MortGump(Mobile from, ContratAssassinat cs)
            : base(0, 0)
        {
            m_From = from;
            m_cs   = cs;

            // Prise en mémoire des personnes autour du corps, lorsque le personnage a été achevé.
            List <Mobile> listePersoPresent = new List <Mobile>();

            foreach (Mobile m in m_cs.Cible.Corpse.GetMobilesInRange(20))
            {
                m_listePersoPresent.Add(m);
            }

            Closable   = false;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            AddPage(0);

            //BG
            AddBackground(80, 72, 390, 185, 3600);
            AddBackground(90, 82, 370, 165, 9200);
            AddBackground(100, 92, 350, 140, 3500);

            AddHtml(140, 115, 200, 20, "<h1><basefont color=#025a>Vous avez été achevé !<basefont></h1>", false, false);

            AddHtml(140, 155, 300, 20, "Souhaitez-vous contester votre mort ? ", false, false);

            AddHtml(190, 180, 100, 20, "Oui", false, false);
            AddButton(220, 180, 0x481, 0x483, 1, GumpButtonType.Reply, 0);

            AddHtml(320, 180, 100, 20, "Non", false, false);
            AddButton(350, 180, 0x47E, 0x480, 2, GumpButtonType.Reply, 0);
        }
Ejemplo n.º 9
0
 public CibleTarget(PlayerMobile from, ContratAssassinat contrat)
     : base(10, false, TargetFlags.None)
 {
     m_from    = from;
     m_contrat = contrat;
 }