Ejemplo n.º 1
0
        public void GameGird(TPlayObject PlayObject, string[] @Params)
        {
            string      sHumanName = @Params.Length > 0 ? @Params[0] : "";
            string      sCtr       = @Params.Length > 1 ? @Params[1] : "";
            int         nGameGird  = @Params.Length > 2 ? int.Parse(@Params[2]) : 0;
            TPlayObject m_PlayObject;
            char        Ctr = '1';

            if ((sCtr != ""))
            {
                Ctr = sCtr[1];
            }
            if ((sHumanName == "") || !(new ArrayList(new string[] { "=", "+", "-" }).Contains(Ctr)) || (nGameGird < 0) || (nGameGird > 200000000) || ((sHumanName != "") && (sHumanName[0] == '?')))
            {
                if (M2Share.g_Config.boGMShowFailMsg)
                {
                    PlayObject.SysMsg(string.Format(GameMsgDef.g_sGameCommandParamUnKnow, this.Attributes.Name, GameMsgDef.g_sGameCommandGameGirdHelpMsg), TMsgColor.c_Red, TMsgType.t_Hint);
                }
                return;
            }
            m_PlayObject = UserEngine.GetPlayObject(sHumanName);
            if (m_PlayObject == null)
            {
                PlayObject.SysMsg(string.Format(GameMsgDef.g_sNowNotOnLineOrOnOtherServer, new string[] { sHumanName }), TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            switch (sCtr[1])
            {
            case '=':
                m_PlayObject.m_nGAMEGIRD = nGameGird;
                break;

            case '+':
                m_PlayObject.m_nGAMEGIRD += nGameGird;
                break;

            case '-':
                m_PlayObject.m_nGAMEGIRD  -= nGameGird;
                m_PlayObject.m_UseGameGird = nGameGird;
                if (M2Share.g_FunctionNPC != null)      // 灵符使用计数
                {
                    M2Share.g_FunctionNPC.GotoLable(m_PlayObject, "@USEGAMEGIRD", false);
                }
                break;
            }
            if (M2Share.g_boGameLogGameGird)
            {
                M2Share.AddGameDataLog(string.Format(GameMsgDef.g_sGameLogMsg1, M2Share.LOG_GameGird, m_PlayObject.m_sMapName, m_PlayObject.m_nCurrX, m_PlayObject.m_nCurrY, m_PlayObject.m_sCharName, M2Share.g_Config.sGameGird, m_PlayObject.m_nGAMEGIRD, sCtr[1] + "(" + (nGameGird).ToString() + ")", PlayObject.m_sCharName));
            }
            PlayObject.GameGoldChanged();
            m_PlayObject.SysMsg(string.Format(GameMsgDef.g_sGameCommandGameGirdHumanMsg, M2Share.g_Config.sGameGird, nGameGird, m_PlayObject.m_nGAMEGIRD, M2Share.g_Config.sGameGird), TMsgColor.c_Green, TMsgType.t_Hint);
            PlayObject.SysMsg(string.Format(GameMsgDef.g_sGameCommandGameGirdGMMsg, sHumanName, M2Share.g_Config.sGameGird, nGameGird, m_PlayObject.m_nGAMEGIRD, M2Share.g_Config.sGameGird), TMsgColor.c_Green, TMsgType.t_Hint);
        }
Ejemplo n.º 2
0
        public void GamePoint(TPlayObject PlayObject, string[] @Params)
        {
            TPlayObject m_PlayObject;
            char        Ctr        = '1';
            string      sHumanName = @Params.Length > 0 ? @Params[0] : "";
            string      sCtr       = @Params.Length > 1 ? @Params[1] : "";
            var         nPoint     = @Params.Length > 2 ? Convert.ToUInt16(@Params[2]) : 0;

            if (sHumanName == "")
            {
                return;
            }
            if ((sCtr != ""))
            {
                Ctr = sCtr[0];
            }
            if ((sHumanName == "") || !(new ArrayList(new char[] { '=', '+', '-' }).Contains(Ctr)) || (nPoint < 0) || (nPoint > 100000000) ||
                ((sHumanName != "") && (sHumanName[1] == '?')))
            {
                PlayObject.SysMsg(String.Format(GameMsgDef.g_sGameCommandParamUnKnow, this.Attributes.Name,
                                                GameMsgDef.g_sGameCommandGamePointHelpMsg), TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            m_PlayObject = UserEngine.GetPlayObject(sHumanName);
            if (m_PlayObject == null)
            {
                PlayObject.SysMsg(String.Format(GameMsgDef.g_sNowNotOnLineOrOnOtherServer, sHumanName), TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            switch (sCtr[1])
            {
            case '=':
                m_PlayObject.m_nGamePoint = (UInt16)nPoint;
                break;

            case '+':
                m_PlayObject.m_nGamePoint += (UInt16)nPoint;
                break;

            case '-':
                m_PlayObject.m_nGamePoint -= (UInt16)nPoint;
                break;
            }
            if (M2Share.g_boGameLogGamePoint)
            {
                M2Share.AddGameDataLog(String.Format(GameMsgDef.g_sGameLogMsg1, M2Share.LOG_GAMEPOINT, m_PlayObject.m_sMapName, m_PlayObject.m_nCurrX, m_PlayObject.m_nCurrY,
                                                     m_PlayObject.m_sCharName, M2Share.g_Config.sGamePointName, nPoint, sCtr[1], m_PlayObject.m_sCharName));
            }
            PlayObject.GameGoldChanged();
            m_PlayObject.SysMsg(String.Format(GameMsgDef.g_sGameCommandGamePointHumanMsg, nPoint, m_PlayObject.m_nGamePoint), TMsgColor.c_Green, TMsgType.t_Hint);
            PlayObject.SysMsg(String.Format(GameMsgDef.g_sGameCommandGamePointGMMsg, sHumanName, nPoint, m_PlayObject.m_nGamePoint), TMsgColor.c_Green, TMsgType.t_Hint);
        }
Ejemplo n.º 3
0
        public void GameDiaMond(TPlayObject PlayObject, string[] @Params)
        {
            string sHumanName   = @Params.Length > 0 ? @Params[0] : "";
            string sCtr         = @Params.Length > 1 ? @Params[1] : "";
            int    nGameDiaMond = @Params.Length > 2 ? byte.Parse(@Params[2]) : (byte)0;
            char   Ctr          = '1';

            if ((sCtr != ""))
            {
                Ctr = sCtr[1];
            }
            if ((sHumanName == "") || !(new ArrayList(new string[] { "=", "+", "-" }).Contains(Ctr)) || (nGameDiaMond < 0) || (nGameDiaMond > 200000000) || ((sHumanName != "") && (sHumanName[0] == '?')))
            {
                if (GameConfig.boGMShowFailMsg)
                {
                    PlayObject.SysMsg(string.Format(GameMsgDef.g_sGameCommandParamUnKnow, base.Attributes.Name, GameMsgDef.g_sGameCommandGameDiaMondHelpMsg), TMsgColor.c_Red, TMsgType.t_Hint);
                }
                return;
            }
            TPlayObject m_PlayObject = UserEngine.GetPlayObject(sHumanName);

            if (m_PlayObject == null)
            {
                PlayObject.SysMsg(string.Format(GameMsgDef.g_sNowNotOnLineOrOnOtherServer, sHumanName), TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            switch (sCtr[1])
            {
            case '=':
                m_PlayObject.m_nGAMEDIAMOND = nGameDiaMond;
                break;

            case '+':
                m_PlayObject.m_nGAMEDIAMOND += nGameDiaMond;
                break;

            case '-':
                m_PlayObject.m_nGAMEDIAMOND -= nGameDiaMond;
                break;
            }
            if (M2Share.g_boGameLogGameDiaMond)
            {
                M2Share.AddGameDataLog(string.Format(GameMsgDef.g_sGameLogMsg1, M2Share.LOG_GameDiaMond, m_PlayObject.m_sMapName,
                                                     m_PlayObject.m_nCurrX, m_PlayObject.m_nCurrY, m_PlayObject.m_sCharName, GameConfig.sGameDiaMond,
                                                     m_PlayObject.m_nGAMEDIAMOND, sCtr[1] + "(" + (nGameDiaMond).ToString() + ")", m_PlayObject.m_sCharName));
            }
            m_PlayObject.GameGoldChanged();
            m_PlayObject.SysMsg(string.Format(GameMsgDef.g_sGameCommandGameDiaMondHumanMsg, GameConfig.sGameDiaMond, nGameDiaMond, m_PlayObject.m_nGAMEDIAMOND, GameConfig.sGameDiaMond), TMsgColor.c_Green, TMsgType.t_Hint);
            PlayObject.SysMsg(string.Format(GameMsgDef.g_sGameCommandGameDiaMondGMMsg, sHumanName, GameConfig.sGameDiaMond, nGameDiaMond, m_PlayObject.m_nGAMEDIAMOND, GameConfig.sGameDiaMond), TMsgColor.c_Green, TMsgType.t_Hint);
        }
Ejemplo n.º 4
0
        public void GameGold(string[] @Params, TPlayObject PlayObject)
        {
            string sHumanName = @Params.Length > 0 ? @Params[0] : "";
            string sCtr       = @Params.Length > 1 ? @Params[1] : "";
            int    nGold      = @Params.Length > 2 ? int.Parse(@Params[2]) : 0;
            char   Ctr        = '1';

            if ((sCtr != ""))
            {
                Ctr = sCtr[0];
            }
            if ((sHumanName == "") || !(new ArrayList(new char[] { '=', '+', '-' }).Contains(Ctr)) || (nGold < 0) || (nGold > 200000000) || ((sHumanName != "") && (sHumanName[1] == '?')))
            {
                PlayObject.SysMsg(String.Format(GameMsgDef.g_sGameCommandParamUnKnow, this.Attributes.Name, GameMsgDef.g_sGameCommandGameGoldHelpMsg), TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            TPlayObject m_PlayObject = UserEngine.GetPlayObject(sHumanName);

            if (m_PlayObject == null)
            {
                PlayObject.SysMsg(String.Format(GameMsgDef.g_sNowNotOnLineOrOnOtherServer, sHumanName), TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            switch (sCtr[0])
            {
            case '=':
                m_PlayObject.m_nGameGold = nGold;
                break;

            case '+':
                m_PlayObject.m_nGameGold += nGold;
                break;

            case '-':
                m_PlayObject.m_nGameGold -= nGold;
                break;
            }
            if (M2Share.g_boGameLogGameGold)
            {
                M2Share.AddGameDataLog(String.Format(GameMsgDef.g_sGameLogMsg1, M2Share.LOG_GAMEGOLD, m_PlayObject.m_sMapName, m_PlayObject.m_nCurrX, m_PlayObject.m_nCurrY,
                                                     m_PlayObject.m_sCharName, M2Share.g_Config.sGameGoldName, nGold, sCtr[1], PlayObject.m_sCharName));
            }
            PlayObject.GameGoldChanged();
            m_PlayObject.SysMsg(String.Format(GameMsgDef.g_sGameCommandGameGoldHumanMsg, M2Share.g_Config.sGameGoldName, nGold, m_PlayObject.m_nGameGold,
                                              M2Share.g_Config.sGameGoldName), TMsgColor.c_Green, TMsgType.t_Hint);
            PlayObject.SysMsg(String.Format(GameMsgDef.g_sGameCommandGameGoldGMMsg, sHumanName, M2Share.g_Config.sGameGoldName, nGold, m_PlayObject.m_nGameGold,
                                            M2Share.g_Config.sGameGoldName), TMsgColor.c_Green, TMsgType.t_Hint);
        }
Ejemplo n.º 5
0
        /****************************************************************
        ** 函 数 名:ButtonSave_Click
        ** 功能描述:修改数据按钮
        ** 输入参数:无
        ** 输出参数:无
        ** 返 回 值:无
        ** 创 建 人:陶志强
        ** 日    期:2013-4-22
        ** 修 改 人:
        ** 日    期:
        ****************************************************************/
        private void ButtonSave_Click(object sender, EventArgs e)
        {
            int nLevel;
            int nGold;
            int nPKPOINT;
            int nGameGold;
            int nGameDiaMond;
            // 20071226 金刚石
            int nGameGird;
            // 20071226 灵符
            int nLoyal;
            // 英雄的忠诚度(20080109)
            int    nGamePoint;
            int    nCreditPoint;
            int    nBonusPoint;
            bool   boGameMaster;
            bool   boObServer;
            bool   boSuperman;
            string sAutoSendMsg;

            if (PlayObject == null)
            {
                return;
            }
            sAutoSendMsg = EditSayMsg.Text.Trim();
            nLevel       = (int)EditLevel.Value;
            nGold        = (int)EditGold.Value;
            nPKPOINT     = (int)EditPKPoint.Value;
            nGameGold    = (int)EditGameGold.Value;
            nGameDiaMond = (int)EditGameDiaMond.Value;
            // 20071226 金刚石
            nGameGird = (int)EditGameGird.Value;
            // 20071226 灵符
            nLoyal = (int)EditHeroLoyal.Value;
            // 英雄的忠诚度(20080109)
            nGamePoint   = (int)EditGamePoint.Value;
            nCreditPoint = (int)EditCreditPoint.Value;
            nBonusPoint  = (int)EditBonusPoint.Value;
            boGameMaster = CheckBoxGameMaster.Checked;
            boObServer   = CheckBoxObserver.Checked;
            boSuperman   = CheckBoxSuperMan.Checked;

            // (*or (nCreditPoint > High(Integer{Byte}))*)
            // 20080118
            if ((nLevel < 0) || (nLevel > ushort.MaxValue) || (nGold < 0) || (nGold > 200000000) || (nPKPOINT < 0) || (nPKPOINT > 2000000) || (nCreditPoint < 0) || (nBonusPoint < 0) || (nBonusPoint > 20000000) || (nLoyal > 10000))
            {
                MessageBox.Show("输入数据不正确!!!", "错误信息", System.Windows.Forms.MessageBoxButtons.OK);
                return;
            }
            PlayObject.m_sAutoSendMsg = sAutoSendMsg;
            if (PlayObject.m_Abil.Level != nLevel)
            {
                // 等级调整记录日志 20081102
                M2Share.AddGameDataLog("17" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09" + (PlayObject.m_nCurrY).ToString() + "\09" + PlayObject.m_sCharName + "\09" + (PlayObject.m_Abil.Level).ToString() + "\09" + "0" + "\09" + "调整(" + (nLevel).ToString() + ")" + "\09" + "在线人物窗口");
            }
            PlayObject.m_Abil.Level   = (ushort)nLevel;
            PlayObject.m_nGold        = nGold;
            PlayObject.m_nPkPoint     = nPKPOINT;
            PlayObject.m_nGameGold    = nGameGold;
            PlayObject.m_nGAMEDIAMOND = nGameDiaMond;
            // 20071226 金刚石
            PlayObject.m_nGAMEGIRD = nGameGird;
            // 20071226 灵符
            PlayObject.m_nGamePoint    = (ushort)nGamePoint;
            PlayObject.m_btCreditPoint = nCreditPoint;
            PlayObject.m_nBonusPoint   = nBonusPoint;
            PlayObject.m_boAdminMode   = boGameMaster;
            PlayObject.m_boObMode      = boObServer;
            PlayObject.m_boSuperMan    = boSuperman;
            if (PlayObject.m_boTrainingNG)
            {
                PlayObject.m_NGLevel = (byte)EditNGLevel.Value;
                // 20081005 内功等级
                PlayObject.m_ExpSkill69 = (uint)EditExpSkill69.Value;
                // 20081005 内功心法当前经验
                PlayObject.SendNGData();
                // 发送内功数据 20081005
            }
            PlayObject.GoldChanged();
            PlayObject.GameGoldChanged();
            // 20080211
            PlayObject.HasLevelUp(1);
            //#if HEROVERSION = 1
            if (PlayObject.m_MyHero != null)
            {
                nLevel   = (int)EditHeroLevel.Value;
                nPKPOINT = (int)EditHeroPKPoint.Value;
                if (PlayObject.m_MyHero.m_Abil.Level != nLevel)
                {
                    // 等级调整记录日志 20081102
                    M2Share.AddGameDataLog("17" + "\09" + PlayObject.m_MyHero.m_sMapName + "\09" + (PlayObject.m_MyHero.m_nCurrX).ToString() + "\09" + (PlayObject.m_MyHero.m_nCurrY).ToString() + "\09" + PlayObject.m_MyHero.m_sCharName + "\09" + (PlayObject.m_MyHero.m_Abil.Level).ToString() + "\09" + "0" + "\09" + "调整(" + (nLevel).ToString() + ")" + "\09" + "在线人物窗口");
                }
                PlayObject.m_MyHero.m_Abil.Level = (ushort)nLevel;
                PlayObject.m_MyHero.m_nPkPoint   = nPKPOINT;
                ((THeroObject)(PlayObject.m_MyHero)).m_nLoyal = nLoyal;
                // 英雄的忠诚度(20080110)
                if (((THeroObject)(PlayObject.m_MyHero)).m_boTrainingNG)
                {
                    ((THeroObject)(PlayObject.m_MyHero)).m_NGLevel = (byte)EditHeroNGLevel.Value;
                    // 20081005 内功等级
                    ((THeroObject)(PlayObject.m_MyHero)).m_ExpSkill69 = (uint)EditHeroExpSkill69.Value;
                    // 20081005 内功心法当前经验
                    PlayObject.m_MyHero.SendNGData();
                    // 发送内功数据 20081005
                }
                PlayObject.m_MyHero.HasLevelUp(1);
            }
            MessageBox.Show("人物数据已保存。", "提示信息", System.Windows.Forms.MessageBoxButtons.OK);
        }