public void RestBonuPoint(TPlayObject PlayObject, string[] @Params)
        {
            string sHumName = @Params.Length > 0 ? @Params[0] : "";
            int    nTotleUsePoint;

            if (sHumName == "")
            {
                PlayObject.SysMsg("命令格式: @" + this.Attributes.Name + " 人物名称", TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            TPlayObject m_PlayObject = UserEngine.GetPlayObject(sHumName);

            if (m_PlayObject != null)
            {
                nTotleUsePoint = m_PlayObject.m_BonusAbil.DC + m_PlayObject.m_BonusAbil.MC + m_PlayObject.m_BonusAbil.SC + m_PlayObject.m_BonusAbil.AC + m_PlayObject.m_BonusAbil.MAC
                                 + m_PlayObject.m_BonusAbil.HP + m_PlayObject.m_BonusAbil.MP + m_PlayObject.m_BonusAbil.Hit + m_PlayObject.m_BonusAbil.Speed + m_PlayObject.m_BonusAbil.X2;
                m_PlayObject.m_nBonusPoint += nTotleUsePoint;
                m_PlayObject.SendMsg(m_PlayObject, Grobal2.RM_ADJUST_BONUS, 0, 0, 0, 0, "");
                m_PlayObject.HasLevelUp(0);
                m_PlayObject.SysMsg("分配点数已复位!!!", TMsgColor.c_Red, TMsgType.t_Hint);
                PlayObject.SysMsg(sHumName + " 的分配点数已复位.", TMsgColor.c_Green, TMsgType.t_Hint);
            }
            else
            {
                PlayObject.SysMsg(String.Format(GameMsgDef.g_sNowNotOnLineOrOnOtherServer, sHumName), TMsgColor.c_Red, TMsgType.t_Hint);
            }
        }
Esempio n. 2
0
        public void ChangeLevel(TPlayObject PlayObject, string[] @Params)
        {
            if (@Params == null)
            {
                return;
            }
            string sParam1 = @Params.Length > 0 ? @Params[0] : "";
            int    nOLevel;
            int    nLevel;

            if (((sParam1 != "") && (sParam1[0] == '?')))
            {
                if (GameConfig.boGMShowFailMsg)
                {
                    PlayObject.SysMsg(string.Format(GameMsgDef.g_sGameCommandParamUnKnow, this.Attributes.Name, ""), TMsgColor.c_Red, TMsgType.t_Hint);
                }
                return;
            }
            nLevel  = HUtil32.Str_ToInt(sParam1, 1);
            nOLevel = PlayObject.m_Abil.Level;
            PlayObject.m_Abil.Level = (ushort)HUtil32._MIN(M2Share.MAXUPLEVEL, nLevel);
            PlayObject.HasLevelUp(1);// 等级调整记录日志
            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" + "0");
            if (GameConfig.boShowMakeItemMsg)
            {
                M2Share.MainOutMessage(string.Format(GameMsgDef.g_sGameCommandLevelConsoleMsg, PlayObject.m_sCharName, nOLevel, PlayObject.m_Abil.Level));
            }
        }
Esempio n. 3
0
        public void AdjuestExp(string[] @Params, TPlayObject PlayObject)
        {
            string sHumanName = @Params.Length > 0 ? @Params[0] : "";
            string sExp       = @Params.Length > 1 ? @Params[1] : "";
            uint   dwExp      = 0;
            uint   dwOExp     = 0;

            if ((sHumanName == ""))
            {
                PlayObject.SysMsg("命令格式: @" + this.Attributes.Name + " 人物名称 经验值", TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            dwExp = (uint)HUtil32.Str_ToInt(sExp, 0);
            TPlayObject m_PlayObject = UserEngine.GetPlayObject(sHumanName);

            if (m_PlayObject != null)
            {
                dwOExp = PlayObject.m_Abil.Exp;
                m_PlayObject.m_Abil.Exp = dwExp;
                m_PlayObject.HasLevelUp(m_PlayObject.m_Abil.Level - 1);
                PlayObject.SysMsg(sHumanName + " 经验调整完成。", TMsgColor.c_Green, TMsgType.t_Hint);
                if (M2Share.g_Config.boShowMakeItemMsg)
                {
                    M2Share.MainOutMessage("[经验调整] " + PlayObject.m_sCharName + '(' + m_PlayObject.m_sCharName + ' ' + dwOExp + " -> " + m_PlayObject.m_Abil.Exp + ')');
                }
            }
            else
            {
                PlayObject.SysMsg(String.Format(GameMsgDef.g_sNowNotOnLineOrOnOtherServer, sHumanName), TMsgColor.c_Red, TMsgType.t_Hint);
            }
        }
Esempio n. 4
0
 private void RecalcHuman()
 {
     PlayObject.RecalcLevelAbilitys();
     PlayObject.RecalcAbilitys();
     PlayObject.CompareSuitItem(false);
     // 套装与身上装备对比 20080729
     PlayObject.HasLevelUp(0);
 }
Esempio n. 5
0
        public void AdjuestLevel(string[] @Params, TPlayObject PlayObject)
        {
            if (@Params == null)
            {
                return;
            }
            string sHumanName = @Params.Length > 0 ? @Params[0] : "";
            int    nLevel     = @Params.Length > 1 ? int.Parse(@Params[1]) : 0;
            int    nOLevel;

            if (sHumanName == "")
            {
                PlayObject.SysMsg("命令格式: @" + this.Attributes.Name + " 人物名称 等级", TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            if (sHumanName == "")
            {
                if (M2Share.g_Config.boGMShowFailMsg)
                {
                    PlayObject.SysMsg("命令格式: @" + this.Attributes.Name + " 人物名称 等级", TMsgColor.c_Red, TMsgType.t_Hint);
                }
                return;
            }
            TPlayObject m_PlayObject = UserEngine.GetPlayObject(sHumanName);

            if (m_PlayObject != null)
            {
                nOLevel = m_PlayObject.m_Abil.Level;
                //PlayObject.m_Abil.Level = HUtil32._MAX(1, HUtil32._MIN(M2Share.MAXUPLEVEL, nLevel));
                m_PlayObject.HasLevelUp(1);// 等级调整记录日志
                M2Share.AddGameDataLog("17" + "\09" + m_PlayObject.m_sMapName + "\09" + (m_PlayObject.m_nCurrX).ToString() + "\09" + (m_PlayObject.m_nCurrY).ToString() + "\09"
                                       + m_PlayObject.m_sCharName + "\09" + (m_PlayObject.m_Abil.Level).ToString() + "\09" + PlayObject.m_sCharName + "\09" + "+(" + (nLevel).ToString() + ")" + "\09" + "0");
                PlayObject.SysMsg(sHumanName + " 等级调整完成。", TMsgColor.c_Green, TMsgType.t_Hint);
                if (M2Share.g_Config.boShowMakeItemMsg)
                {
                    M2Share.MainOutMessage("[等级调整] " + PlayObject.m_sCharName + "(" + m_PlayObject.m_sCharName + " " + (nOLevel).ToString() + " -> " + m_PlayObject.m_Abil.Level + ")");
                }
            }
            else
            {
                PlayObject.SysMsg(string.Format(GameMsgDef.g_sNowNotOnLineOrOnOtherServer, new string[] { sHumanName }), TMsgColor.c_Red, TMsgType.t_Hint);
            }
        }
        public void DelBonuPoint(TPlayObject PlayObject, string[] @Params)
        {
            string sHumName = @Params.Length > 0 ? @Params[0] : "";

            if (sHumName == "")
            {
                PlayObject.SysMsg("命令格式: @" + this.Attributes.Name + " 人物名称", TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            TPlayObject m_PlayObject = UserEngine.GetPlayObject(sHumName);

            if (m_PlayObject != null)
            {
                m_PlayObject.m_nBonusPoint = 0;
                m_PlayObject.SendMsg(PlayObject, Grobal2.RM_ADJUST_BONUS, 0, 0, 0, 0, "");
                m_PlayObject.HasLevelUp(0);
                m_PlayObject.SysMsg("分配点数已清除!!!", TMsgColor.c_Red, TMsgType.t_Hint);
                PlayObject.SysMsg(sHumName + " 的分配点数已清除.", TMsgColor.c_Green, TMsgType.t_Hint);
            }
            else
            {
                PlayObject.SysMsg(String.Format(GameMsgDef.g_sNowNotOnLineOrOnOtherServer, sHumName), TMsgColor.c_Red, TMsgType.t_Hint);
            }
        }
Esempio n. 7
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);
        }