示例#1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (from == null || targeted == null || m_gauntlet == null || m_team == 0)
                {
                    return;
                }

                if (targeted is IPoint3D)
                {
                    IPoint3D p = targeted as IPoint3D;

                    CTFBase newbase = m_gauntlet.FindBase(m_team);

                    if (newbase == null)
                    {
                        newbase = new CTFBase(m_gauntlet, m_team);
                        // add the base to the gauntlet list
                        m_gauntlet.HomeBases.Add(newbase);
                    }

                    newbase.MoveToWorld(new Point3D(p), from.Map);

                    // clear all acceptances
                    m_gauntlet.ResetAcceptance();

                    // refresh all gumps
                    RefreshAllGumps(m_gauntlet, true);

                    // refresh the gump with the new member
                    //from.SendGump( new CTFGump( m_gauntlet, from));
                }
            }
示例#2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (from == null || targeted == null || m_gauntlet == null || m_list == null)
                {
                    return;
                }

                if (targeted is Mobile && ((Mobile)targeted).Player)
                {
                    Mobile pm = targeted as Mobile;

                    // make sure they qualify
                    if (!m_gauntlet.CheckQualify(pm))
                    {
                        return;
                    }

                    // see if they are already in the game
                    if (m_gauntlet.Participants != null)
                    {
                        foreach (CTFGauntlet.ChallengeEntry entry in m_gauntlet.Participants)
                        {
                            if (pm == entry.Participant)
                            {
                                XmlPoints.SendText(from, 100548, pm.Name);                                  // "{0} has already been added to the game."
                                return;
                            }
                        }
                    }

                    m_list.Add(new CTFGauntlet.ChallengeEntry(pm));

                    XmlPoints.SendText(from, 100549, pm.Name);                       // "You have added {0} to the challenge."

                    XmlPoints.SendText(pm, 100550, m_gauntlet.Name);                 // "You have been invited to participate in {0}."

                    // clear all acceptances
                    m_gauntlet.ResetAcceptance();

                    // refresh all gumps
                    RefreshAllGumps(m_gauntlet, true);
                }
            }