コード例 #1
0
ファイル: Teleporter.cs プロジェクト: rberiot/imaginenation
        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 EquipmentStorage Supply(Mobile m)
        {
            EquipmentStorage playerGear = new EquipmentStorage(m);

            playerGear.StoreEquip();

            //Supply the right type of gear
            SupplySystem.SupplyGear(m, this);
            return(playerGear);
        }
コード例 #3
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);
        }
コード例 #4
0
ファイル: SchoolKinds.aspx.cs プロジェクト: BehnamAbdy/Setad
 private void SetControls(SupplySystem.SchoolKind schKind)
 {
     if (schKind != null)
     {
         this.hdnKindId.Value = schKind.SchoolKindID.ToString();
         this.txtSchoolKindName.Text = schKind.SchoolKindName;
     }
     else
     {
         this.hdnKindId.Value = null;
         this.txtSchoolKindName.Text = null;
     }
 }
コード例 #5
0
 private void SetControls(SupplySystem.REP_RepositoryType rpType)
 {
     if (rpType != null)
     {
         this.txtTypeName.Text = rpType.TypeName;
         this.hdnRepositoryTypeId.Value = rpType.RepositoryTypeID.ToString();
     }
     else
     {
         this.hdnRepositoryTypeId.Value = null;
         this.txtTypeName.Text = null;
     }
 }
コード例 #6
0
ファイル: Units.aspx.cs プロジェクト: BehnamAbdy/Setad
 private void SetControls(SupplySystem.REP_Unit unit)
 {
     if (unit != null)
     {
         this.txtUnitName.Text = unit.UnitName;
         this.hdnUnitId.Value = unit.UnitID.ToString();
     }
     else
     {
         this.hdnUnitId.Value = null;
         this.txtUnitName.Text = null;
     }
 }
コード例 #7
0
ファイル: StuffTypes.aspx.cs プロジェクト: BehnamAbdy/Setad
 private void SetControls(SupplySystem.REP_StuffType stuffType)
 {
     if (stuffType != null)
     {
         this.txtTypeName.Text = stuffType.TypeName;
         this.hdnStuffTypeId.Value = stuffType.StuffTypeID.ToString();
     }
     else
     {
         this.hdnStuffTypeId.Value = null;
         this.txtTypeName.Text = null;
     }
 }
コード例 #8
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();
        }
コード例 #9
0
ファイル: StuckMenu.cs プロジェクト: rberiot/imaginenation
            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);
                    }
                }
            }
コード例 #10
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();
            }
        }
コード例 #11
0
ファイル: DMStone.cs プロジェクト: rberiot/imaginenation
        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);
        }
コード例 #12
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);
        }
コード例 #13
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);
        }
コード例 #14
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);
        }
コード例 #15
0
ファイル: HelpGump.cs プロジェクト: rberiot/imaginenation
        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));
            }
        }
コード例 #16
0
ファイル: Paging.cs プロジェクト: BehnamAbdy/Setad
 private short GetGirlsCount(SupplySystem.School sch)
 {
     short count = 0;
     foreach (SupplySystem.SchoolSubLevel ssl in sch.SchoolLevels.First<SupplySystem.SchoolLevel>(slv => slv.LockOutDate == null).SchoolSubLevels)
     {
         count += ssl.GirlsCount.GetValueOrDefault();
     }
     return count;
 }
コード例 #17
0
ファイル: Stuffs.aspx.cs プロジェクト: BehnamAbdy/Setad
 private void SetControls(SupplySystem.REP_Stuff stuff)
 {
     if (stuff != null)
     {
         this.hdnStuffId.Value = stuff.StuffID.ToString();
         this.txtGoodName.Text = stuff.StuffName;
         this.drpStuffTypes.SelectedValue = stuff.StuffTypeID.ToString();
         this.txtTechnicalInfo.Text = stuff.TechnicalInfo;
         this.drpFirstUnit.SelectedValue = stuff.PrimaryUnitID.ToString();
         this.drpSecondUnit.SelectedValue = stuff.SecondaryUnitID.ToString();
         this.drpThirdUnit.SelectedValue = stuff.ThirdUnitID.ToString();
         this.txtFirstConversionCoefficient.Text = stuff.FirstConversionCoefficient.ToString();
         this.txtSecondConversionCoefficient.Text = stuff.SecondConversionCoefficient.ToString();
         this.txtProducerCompany.Text = stuff.ProducerCompany;
         this.txtProducerCountry.Text = stuff.ProducerCountry;
         this.txtCapacity.Text = stuff.Capacity;
         this.txtColor.Text = stuff.Color;
         this.txtSize.Text = stuff.Size;
     }
     else
     {
         this.hdnStuffId.Value = null;
         this.txtGoodName.Text = null;
         this.drpStuffTypes.SelectedIndex = 0;
         this.txtTechnicalInfo.Text = null;
         this.drpFirstUnit.SelectedIndex = 0;
         this.drpSecondUnit.SelectedIndex = 0;
         this.drpThirdUnit.SelectedIndex = 0;
         this.txtFirstConversionCoefficient.Text = null;
         this.txtSecondConversionCoefficient.Text = null;
         this.txtProducerCompany.Text = null;
         this.txtProducerCountry.Text = null;
         this.txtCapacity.Text = null;
         this.txtColor.Text = null;
         this.txtSize.Text = null;
     }
 }
コード例 #18
0
 public void BreakExternal()
 {
     SupplySystem.FuckUp();
 }
コード例 #19
0
 public void FixExternal()
 {
     SupplySystem.FuckDown();
 }