Exemplo n.º 1
0
        public void SuperTing(TPlayObject PlayObject, string[] @Params)
        {
            string             sHumanName = @Params.Length > 0 ? @Params[0] : "";
            string             sRange     = @Params.Length > 1 ? @Params[1] : "";
            TPlayObject        m_PlayObject;
            TPlayObject        MoveHuman;
            List <TPlayObject> HumanList;

            if ((sRange == "") || (sHumanName == "") || ((sHumanName != "") && (sHumanName[1] == '?')))
            {
                PlayObject.SysMsg(String.Format(GameMsgDef.g_sGameCommandParamUnKnow, this.Attributes.Name, GameMsgDef.g_sGameCommandSuperTingHelpMsg), TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            int nRange = HUtil32._MAX(10, HUtil32.Str_ToInt(sRange, 2));

            m_PlayObject = UserEngine.GetPlayObject(sHumanName);
            if (m_PlayObject != null)
            {
                HumanList = new List <TPlayObject>();
                UserEngine.GetMapRageHuman(m_PlayObject.m_PEnvir, m_PlayObject.m_nCurrX, m_PlayObject.m_nCurrY, nRange, HumanList);
                for (int I = 0; I < HumanList.Count; I++)
                {
                    MoveHuman = HumanList[I];
                    if (MoveHuman != PlayObject)
                    {
                        MoveHuman.MapRandomMove(MoveHuman.m_sHomeMap, 0);
                    }
                }
                HUtil32.Dispose(HumanList);
            }
            else
            {
                PlayObject.SysMsg(String.Format(GameMsgDef.g_sNowNotOnLineOrOnOtherServer, sHumanName), TMsgColor.c_Red, TMsgType.t_Hint);
            }
        }
Exemplo n.º 2
0
        public void MapMoveHuman(TPlayObject PlayObject, string[] @Params)
        {
            string             sSrcMap = @Params.Length > 0 ? @Params[0] : "";
            string             sDenMap = @Params.Length > 1 ? @Params[1] : "";
            List <TPlayObject> HumanList;
            TPlayObject        MoveHuman;

            if ((sDenMap == "") || (sSrcMap == "") || ((sSrcMap != "") && (sSrcMap[0] == '?')))
            {
                PlayObject.SysMsg(String.Format(GameMsgDef.g_sGameCommandParamUnKnow, this.Attributes.Name, GameMsgDef.g_sGameCommandMapMoveHelpMsg), TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            TEnvirnoment SrcEnvir = M2Share.g_MapManager.FindMap(sSrcMap);
            TEnvirnoment DenEnvir = M2Share.g_MapManager.FindMap(sDenMap);

            if ((SrcEnvir == null))
            {
                PlayObject.SysMsg(String.Format(GameMsgDef.g_sGameCommandMapMoveMapNotFound, sSrcMap), TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            if ((DenEnvir == null))
            {
                PlayObject.SysMsg(String.Format(GameMsgDef.g_sGameCommandMapMoveMapNotFound, sDenMap), TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            HumanList = new List <TPlayObject>();
            UserEngine.GetMapRageHuman(SrcEnvir, SrcEnvir.m_nWidth / 2, SrcEnvir.m_nHeight / 2, 1000, HumanList);
            for (int I = 0; I < HumanList.Count; I++)
            {
                MoveHuman = HumanList[I];
                if (MoveHuman != PlayObject)
                {
                    MoveHuman.MapRandomMove(sDenMap, 0);
                }
            }
            HUtil32.Dispose(HumanList);
        }