예제 #1
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m_Active)
            {
                if (!m_Creatures && !m.Player)
                {
                    return(true);
                }

                if (m_CombatCheck && SpellHelper.CheckCombat(m))
                {
                    m.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                    return(true);
                }

                if (!m_AllowCriminals && (m.Criminal || Misc.NotorietyHandlers.IsGuardCandidate(m)))
                {
                    m.SendAsciiMessage("Criminals or murderers can't use this teleporter!");
                    return(true);
                }

                if (m_RemoveEventGear && m.IsInEvent)
                {
                    m.IsInEvent = false;
                    m.SendAsciiMessage("You auto supply has been removed.");

                    SupplySystem.RemoveEventGear(m);
                }

                StartTeleport(m);
                return(false);
            }

            return(true);
        }
예제 #2
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m.Alive == false)
            {
                m.SendAsciiMessage("You cannot use that while dead.");
                return(true);
            }

            if (m.AccessLevel >= AccessLevel.Counselor)
            {
                m.SendAsciiMessage("This is not for staff members.");
                return(true);
            }

            if (m is BaseCreature)
            {
                return(Teleport(m));
            }
            else if (m is PlayerMobile)
            {
                if (!m.IsInEvent)
                {
                    if (SupplyType == SupplyType.Custom && !CanUseCustomGear)
                    {
                        PublicOverheadMessage(MessageType.Regular, 906, true, "Custom setup error.");
                        return(false);
                    }

                    //Store our equipment
                    EquipmentStorage playerGear = new EquipmentStorage(m);
                    playerGear.StoreEquip();

                    //Supply the right type of gear
                    SupplySystem.SupplyGear(m, this);

                    //Tag the mobile to be in the event and display a message

                    m.IsInEvent = true;
                    ((PlayerMobile)m).EventType = m_EventType;
                    m.SendAsciiMessage("You have been auto supplied.");
                    return(Teleport(m));
                }
                else
                {
                    m.IsInEvent = false;
                    ((PlayerMobile)m).EventType = EventType.NoEvent;
                    m.SendAsciiMessage("Your auto supply has been removed.");

                    SupplySystem.RemoveEventGear(m);
                    return(Teleport(m));
                }
            }
            return(true);
        }
예제 #3
0
        public virtual void RemovePlayer(Mobile player)
        {
            if (player == null || player.Deleted)
            {
                return;
            }

            if (!Players.Contains(player))
            {
                return;
            }

            if (!player.Alive)
            {
                player.Resurrect();
            }

            if (player is PlayerMobile)
            {
                ((PlayerMobile)player).CurrentEvent = null;
                ((PlayerMobile)player).IsInEvent    = false;
                ((PlayerMobile)player).Score        = 0;
            }

            player.Blessed = false;

            if (player.Map != Map.Internal)
            {
                player.Location = m_Lobby;
                player.Map      = m_LobbyMap;
            }
            else
            {
                player.LogoutLocation = m_Lobby;
                player.LogoutMap      = m_LobbyMap;
            }
            m_Players.Remove(player);

            if (m_PlayerSupplies.ContainsKey((PlayerMobile)player))
            {
                SupplySystem.RemoveEventGear(player);
                EquipmentStorage storage = m_PlayerSupplies[(PlayerMobile)player];
                if (storage != null)
                {
                    storage.OnDoubleClick(player);
                    m_PlayerSupplies.Remove((PlayerMobile)player);
                }
            }
            player.Delta(MobileDelta.Noto);
            SendPlayerGumps();
        }
예제 #4
0
            protected override void OnTick()
            {
                if (DateTime.Now < m_End)
                {
                    m_Mobile.Frozen = true;
                }
                else
                {
                    m_Mobile.Frozen = false;
                    Stop();

                    if (Factions.Sigil.ExistsOn(m_Mobile))
                    {
                        m_Mobile.SendLocalizedMessage(1061632);                           // You can't do that while carrying the sigil.
                        return;
                    }

                    int     idx  = Utility.Random(m_Destination.Locations.Length);
                    Point3D dest = m_Destination.Locations[idx];

                    Region r = Region.Find(dest, Map.Felucca);
                    int    i = 0;

                    while (r is HouseRegion && i < m_Destination.Locations.Length)
                    {
                        idx  = Utility.Random(m_Destination.Locations.Length);
                        dest = m_Destination.Locations[idx];
                        i++;
                    }

                    Map destMap = Map.Felucca;

                    Mobiles.BaseCreature.TeleportPets(m_Mobile, dest, destMap);
                    m_Mobile.MoveToWorld(dest, destMap);

                    if (m_Mobile.IsInEvent)
                    {
                        m_Mobile.IsInEvent = false;
                        m_Mobile.SendAsciiMessage("You auto supply has been removed.");

                        SupplySystem.RemoveEventGear(m_Mobile);
                    }
                }
            }
예제 #5
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from != m_Owner)
            {
                from.SendAsciiMessage("Only the owner can equip this.");
                return;
            }

            if (from.Mounted)
            {
                from.SendMessage("Can not equip while being mounted.");
                return;
            }

            if (from.HasTrade)
            {
                from.SendMessage("Can not equip while having a trade up.");
                return;
            }

            //This is most likley not needed, but anyways.
            if (from.IsInEvent)
            {
                from.IsInEvent = false;
                from.SendAsciiMessage("You auto supply has been removed.");

                SupplySystem.RemoveEventGear(from);
            }

            for (int i = 0; i < m_EquippedItems.Count; ++i)
            {
                if (!m_EquippedItems[i].IsChildOf(this))
                {
                    continue;
                }

                if (from.FindItemOnLayer(m_EquippedItems[i].Layer) != null)
                {
                    if (from.Backpack != null)
                    {
                        from.AddToBackpack(from.FindItemOnLayer(m_EquippedItems[i].Layer));
                    }
                    else if (m_Owner.BankBox != null)
                    {
                        from.BankBox.DropItem(from.FindItemOnLayer(m_EquippedItems[i].Layer));
                    }
                }

                from.EquipItem(m_EquippedItems[i]);
            }

            for (int i = 0; i < m_BackpackContent.Count; ++i)
            {
                if (m_BackpackContent[i].ItemStored != null)
                {
                    if (!m_BackpackContent[i].ItemStored.IsChildOf(this))
                    {
                        continue;
                    }

                    if (from.Backpack != null)
                    {
                        AddToPack(m_BackpackContent[i]);
                    }
                    else if (from.BankBox != null)
                    {
                        from.BankBox.DropItem(m_BackpackContent[i].ItemStored);
                    }
                }
            }

            if (Items.Count < 1)
            {
                Delete();
            }
        }
예제 #6
0
        public void RemovePlayer(Mobile m, bool kicked)
        {
            SupplySystem.RemoveEventGear(m);
            m.IsInEvent = false;
            m.Frozen    = false;

            if (!m.Alive && m is PlayerMobile)
            {
                ((PlayerMobile)m).ForceResurrect();
            }

            m.MoveToWorld(m_LeaveLocation, m_LeaveMap);

            if (m_MountCollection.ContainsKey(m.Serial))
            {
                BaseCreature bc = m_MountCollection[m.Serial];
                if (bc != null)
                {
                    bc.ControlTarget = m;
                    bc.ControlOrder  = OrderType.Stay;
                    bc.SetControlMaster(m);
                    bc.SummonMaster = m;
                    bc.IsStabled    = false;
                    bc.MoveToWorld(m.Location, m.Map);
                    m.Stabled.Remove(bc);

                    m.Aggressed.Clear();
                    m.Aggressors.Clear();

                    m.Hits = m.HitsMax;
                    m.Stam = m.StamMax;
                    m.Mana = m.ManaMax;

                    m.DamageEntries.Clear();

                    m.Combatant = null;
                }
            }

            if (m_Contestants.Contains(m))
            {
                m_Contestants.Remove(m);
            }

            if (m.NetState != null)
            {
                if (kicked)
                {
                    m.SendMessage(38, "You have been kicked from the deathmatch");
                }
                else
                {
                    m.SendMessage(38, "You have left the deathmatch");
                }
            }

            DMHorse.TryRemoveHorse(m);

            if (m_ResurrectionTimers.ContainsKey(m.Serial))
            {
                Timer t = m_ResurrectionTimers[m.Serial];
                if (t != null)
                {
                    t.Stop();
                    m_ResurrectionTimers.Remove(m.Serial);
                }
            }

            //Only print the message if the match is onging
            if (!m_Started)
            {
                return;
            }

            string leaveMessage = "";

            if (kicked)
            {
                leaveMessage = string.Format("{0} has been kicked from a deathmatch", m.Name);
            }
            else
            {
                leaveMessage = string.Format("{0} has left a deathmatch", m.Name);
            }
            PvpCore.SendMessage(Contestants, leaveMessage, true);
        }
예제 #7
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m.AccessLevel >= AccessLevel.Counselor)
            {
                m.SendAsciiMessage("This is not for staff members.");
                return(true);
            }

            if (m is BaseCreature)
            {
                return(Teleport(m));
            }
            if (m is PlayerMobile)
            {
                if (!m.Alive)
                {
                    ((PlayerMobile)m).ForceResurrect();
                    return(false);
                }

                if (!m.IsInEvent || m_Game != null)
                {
                    if (m_Game != null && m_TeamID != -1)
                    {
                        //Store our equipment
                        EquipmentStorage playerGear = new EquipmentStorage(m);
                        playerGear.StoreEquip();

                        //Supply the right type of gear
                        SupplySystem.SupplyGear(m, this);

                        CWTeam team = (CWTeam)m_Game.Teams[m_TeamID - 1];
                        //m_Game.SwitchTeams(m, team);

                        m.SendMessage("You have joined {0}!", team.Name);

                        //Tag the mobile to be in the event and display a message
                        m.IsInEvent = true;
                        m.SendAsciiMessage("You have been auto supplied.");

                        if (m_Game != null && m_Game.Running)
                        {
                            return(Teleport(m));
                        }
                    }
                    else
                    {
                        m.SendMessage("The game has not started yet.");
                        return(false);
                    }
                }
                else
                {
                    m.IsInEvent = false;
                    m.SendAsciiMessage("Your auto supply has been removed.");

                    SupplySystem.RemoveEventGear(m);
                    return(Teleport(m));
                }
            }
            return(true);
        }
예제 #8
0
        public void HandleDeath(Mobile m)
        {
            if (!m_Started)
            {
                return;
            }

            List <Mobile> opponents = new List <Mobile>();
            List <Mobile> referees  = new List <Mobile>();

            Rectangle2D area = GetArea(m);

            // Rob - remove and stop the Match or EndMatch timer
            if (m_MatchTimers.ContainsKey(area))
            {
                Timer t = m_MatchTimers[area];
                t.Stop();
                m_MatchTimers.Remove(area);
            }
            // end Rob
            IPooledEnumerable eable = JoinMap.GetMobilesInBounds(area);

            foreach (Mobile mob in eable)
            {
                if (mob != m && Contestants.Contains(mob))
                {
                    opponents.Add(mob);
                }
                else if (mob is Referee)
                {
                    referees.Add(mob);
                }
            }

            eable.Free();

            for (int i = 0; i < opponents.Count && opponents.Count <= 1; ++i)
            {
                Mobile mob = opponents[i];
                UpdateScores(m, mob);
                mob.MoveToWorld(WinLocation, WinMap);
                FixPlayer(mob);
                mob.Blessed = true;
                Fighting.Remove(mob);
                Winners.Add(mob);

                //Rob -re-add gear in case gear was removed
                if (ForceEnd == ForceEndType.ItemRemoval && NeedRestock.Contains(mob))
                {
                    SupplySystem.RemoveEventGear(mob);
                    SupplySystem.SupplyGear(mob, EventSupplier);
                    NeedRestock.Remove(mob);
                    mob.SendAsciiMessage("You have been resupplied!");
                }
            }

            NeedRestock.Remove(m); // loser doesn't need a restock
            // end - Rob

            for (int i = 0; i < referees.Count; ++i)
            {
                Mobile mob = referees[i];
                mob.Delete();
            }

            Timer.DelayCall(TimeSpan.FromSeconds(1), new TimerStateCallback(ResurrectPlayer), m);

            HandleCorpse(m);

            Fighting.Remove(m);
            RemovePlayer(m, true, false);

            m.LastKiller = null;

            AddFighters(false);
        }
예제 #9
0
        public void RemovePlayer(Mobile m, bool defeated, bool kicked)
        {
            SupplySystem.RemoveEventGear(m);
            m.IsInEvent = false;
            m.Blessed   = false;

            m.MoveToWorld(LeaveLocation, LeaveMap);

            if (Contestants.Contains(m))
            {
                Contestants.Remove(m);
            }

            if (Fighting.Contains(m))
            {
                Fighting.Remove(m);
            }

            if (Winners.Contains(m))
            {
                Winners.Remove(m);
            }

            // Rob
            if (NeedRestock.Contains(m))
            {
                NeedRestock.Remove(m);
            }
            // end Rob

            if (m.NetState != null)
            {
                if (defeated)
                {
                    m.SendAsciiMessage(38, "You have been defeated");
                }
                else if (kicked)
                {
                    m.SendAsciiMessage(38, "You have been kicked from the tournament");
                }
                else
                {
                    m.SendAsciiMessage(38, "You have left the tournament");
                }
            }

            //Only print the message if the match is onging
            if (!m_Started)
            {
                return;
            }

            string leaveMessage;

            if (defeated)
            {
                leaveMessage = string.Format("{0} has been defeated", m.Name);
            }
            else if (kicked)
            {
                leaveMessage = string.Format("{0} has been kicked from a tournament", m.Name);
            }
            else
            {
                leaveMessage = string.Format("{0} has left a tournament", m.Name);
            }

            TournamentCore.SendMessage(Contestants, leaveMessage, true);
        }
예제 #10
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            PageType type = (PageType)(-1);

            switch (info.ButtonID)
            {
            case 0:                                    // Close/Cancel
            {
                from.SendLocalizedMessage(501235, ""); // Help request aborted.

                break;
            }

            case 1:                     // General question
            {
                type = PageType.Question;
                break;
            }

            case 2:                     // Stuck
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house != null && house.IsAosRules)
                {
                    from.Location = house.BanLocation;
                }
                else if (from.Region.IsPartOf(typeof(Jail)))
                {
                    from.SendLocalizedMessage(1114345, "", 0x35);     // You'll need a better jailbreak plan than that!
                }
                else if (Sigil.ExistsOn(from))
                {
                    from.SendLocalizedMessage(1061632);                               // You can't do that while carrying the sigil.
                }
                else if (from.CanUseStuckMenu() && from.Region.CanUseStuckMenu(from))
                {
                    StuckMenu menu = new StuckMenu(from, from, true);

                    menu.BeginClose();

                    from.SendGump(menu);
                }
                else
                {
                    type = PageType.Stuck;
                }

                break;
            }

            case 3:                     // Report bug or contact Origin
            {
                type = PageType.Bug;
                break;
            }

            case 4:                     // Game suggestion
            {
                type = PageType.Suggestion;
                break;
            }

            case 5:                     // Account management
            {
                type = PageType.Account;
                break;
            }

            case 6:                     // Other
            {
                type = PageType.Other;
                break;
            }

            case 7:                     // Harassment: verbal/exploit
            {
                type = PageType.VerbalHarassment;
                break;
            }

            case 8:                     // Harassment: physical
            {
                type = PageType.PhysicalHarassment;
                break;
            }

            case 9:                     // Young player transport
            {
                if (IsYoung(from))
                {
                    if (from.Region.IsPartOf(typeof(Jail)))
                    {
                        from.SendLocalizedMessage(1114345, "", 0x35);     // You'll need a better jailbreak plan than that!
                    }
                    else if (from.CanUseStuckMenu() && from.Region.CanUseStuckMenu(from))
                    {
                        from.MoveToWorld(new Point3D(1426, 1696, 0), Map.Felucca);

                        if (from.IsInEvent)
                        {
                            from.IsInEvent = false;
                            from.SendAsciiMessage("You auto supply has been removed.");

                            SupplySystem.RemoveEventGear(from);
                        }
                    }
                    else
                    {
                        from.SendAsciiMessage("You cannot use the young player transport system from where you are");
                    }
                }

                break;
            }
            }

            if (type != (PageType)(-1) && PageQueue.CheckAllowedToPage(from))
            {
                from.SendGump(new PagePromptGump(from, type));
            }
        }