예제 #1
0
파일: RCLogin.cs 프로젝트: pallop/Servuo
        private static void EventSink_Login(LoginEventArgs args)
        {
            Mobile from = args.Mobile;

            /******************Edited for Dynamic Race/Class System v2.0*******************************/

            RCChest      chest = null;
            RCCONTROL    rc    = null;
            PlayerMobile pm    = (PlayerMobile)from;

            int rc_Exists = from.Backpack.GetAmount(typeof(RCCONTROL));

            if (rc_Exists != 0)
            {
                rc = from.Backpack.FindItemByType(typeof(RCCONTROL)) as RCCONTROL;
            }

            if (rc_Exists == 0 || !rc.Active)
            {
                foreach (Item i in World.Items.Values)
                {
                    if (i is RCChest)
                    {
                        chest = i as RCChest;
                        if (chest.Active)
                        {
                            if (pm.AccessLevel == AccessLevel.Player || (pm.AccessLevel != AccessLevel.Player && chest.Staff_Login))
                            {
                                pm.Location = new Point3D(chest.Start_X, chest.Start_Y, chest.Start_Z);
                                pm.Map      = chest.Start_Map;
                            }
                        }
                    }
                }
            }

            /******************************************************************************************/
        }
예제 #2
0
        private static void OnInitRaceClass(CommandEventArgs e)
        {
            Mobile from        = e.Mobile;
            bool   RaceClassOn = false;

            foreach (Item items in World.Items.Values)
            {
                if (items is RCChest)
                {
                    RaceClassOn = true;
                }
            }
            if (RaceClassOn)
            {
                from.SendMessage(6, "Race Class System is Already Active");
            }
            else
            {
                RCChest chest = new RCChest();
                chest.Location = new Point3D(from.X + 1, from.Y + 1, from.Z);
                chest.Map      = from.Map;
                chest.AddItem(new RaceControl());
                chest.AddItem(new ClassControl());

                Container r_bag = new Bag();
                r_bag.Name = "RACES";
                chest.AddItem(r_bag);

                Container c_bag = new Bag();
                c_bag.Name = "CLASSES";
                chest.AddItem(c_bag);

                Container b_bag = new Bag();
                b_bag.Name = "BONUS PACKS";
                c_bag.AddItem(b_bag);
                c_bag.AddItem(new BonusPackControl());
            }
        }
예제 #3
0
        public static bool CanRaise(Mobile from, Stat stat)
        {
            ClassOrb  c_orb = null;
            RCChest   chest = null;
            RCCONTROL rc    = null;

            /*If the System is Inactive, these are the Stat Cap values*/
            int n_str = 125;
            int n_dex = 125;
            int n_int = 125;
            /*********************************************************/
            int rc_Exists = 0;


            if (!(from is BaseCreature))
            {
                rc_Exists = from.Backpack.GetAmount(typeof(RCCONTROL));
            }

            if (rc_Exists != 0)
            {
                rc = from.Backpack.FindItemByType(typeof(RCCONTROL)) as RCCONTROL;

                foreach (Item i in World.Items.Values)
                {
                    if (i is ClassOrb)
                    {
                        c_orb = i as ClassOrb;
                        if (c_orb.ClassName == rc.P_Class)
                        {
                            break;
                        }
                    }
                }

                foreach (Item i in World.Items.Values)
                {
                    if (i is RCChest)
                    {
                        chest = i as RCChest;
                        if (chest.Active)
                        {
                            n_str = c_orb.Str_Cap;
                            n_dex = c_orb.Dex_Cap;
                            n_int = c_orb.Int_Cap;
                        }
                    }
                }
            }
            if (!(from is BaseCreature && ((BaseCreature)from).Controlled))
            {
                if (from.RawStatTotal >= from.StatCap)
                {
                    return(false);
                }
            }

            switch (stat)
            {
            case Stat.Str:
                return(from.StrLock == StatLockType.Up && from.RawStr < 125);

            case Stat.Dex:
                return(from.DexLock == StatLockType.Up && from.RawDex < 125);

            case Stat.Int:
                return(from.IntLock == StatLockType.Up && from.RawInt < 125);
            }

            return(false);
        }