Example #1
0
        /// <summary>
        /// btLoadType 0-召唤 1-新建 2-删除 3-查询数据 4-召唤副将英雄 5-新建副将英雄 6-删除副将英雄
        /// </summary>
        /// <param name="sCharName"></param>
        /// <param name="sMsg"></param>
        /// <param name="PlayObject"></param>
        /// <param name="btLoadType"></param>
        public void AddToLoadHeroRcdList(string sCharName, string sMsg, TPlayObject PlayObject, byte btLoadType)
        {
            TLoadDBInfo LoadRcdInfo = new TLoadDBInfo();

            PlayObject.m_boWaitHeroDate  = true;
            LoadRcdInfo.sAccount         = PlayObject.m_sUserID;
            LoadRcdInfo.sCharName        = sCharName;
            LoadRcdInfo.sIPaddr          = PlayObject.m_sIPaddr;
            LoadRcdInfo.boClinetFlag     = PlayObject.m_boClientFlag;
            LoadRcdInfo.nSessionID       = PlayObject.m_nSessionID;
            LoadRcdInfo.nSoftVersionDate = PlayObject.m_nSoftVersionDate;
            LoadRcdInfo.nPayMent         = PlayObject.m_nPayMent;
            LoadRcdInfo.nPayMode         = PlayObject.m_nPayMode;
            LoadRcdInfo.nSocket          = PlayObject.m_nSocket;
            LoadRcdInfo.nGSocketIdx      = PlayObject.m_nGSocketIdx;
            LoadRcdInfo.nGateIdx         = PlayObject.m_nGateIdx;
            LoadRcdInfo.dwNewUserTick    = HUtil32.GetTickCount();
            LoadRcdInfo.PlayObject       = PlayObject;
            LoadRcdInfo.nReLoadCount     = 0;
            LoadRcdInfo.boIsHero         = true;
            LoadRcdInfo.btLoadDBType     = btLoadType;
            LoadRcdInfo.sMsg             = sMsg;
            LoadRcdInfo.btJob            = PlayObject.m_btDeputyHeroJob;
            HUtil32.EnterCriticalSection(m_UserCriticalSection);
            try
            {
                m_LoadRcdList.Add(LoadRcdInfo);
            }
            finally
            {
                HUtil32.LeaveCriticalSection(m_UserCriticalSection);
            }
        }
Example #2
0
        public override void Run()
        {
            int         nAbs;
            int         nRage = 9999;
            TBaseObject BaseObject;
            TBaseObject TargeTBaseObject = null;

            if (!this.m_boDeath && !this.m_boGhost && (this.m_wStatusTimeArr[Grobal2.POISON_STONE] == 0))
            {
                if ((HUtil32.GetTickCount() - this.m_dwSearchEnemyTick) >= 5000)
                {
                    this.m_dwSearchEnemyTick = HUtil32.GetTickCount();
                    if (this.m_VisibleActors.Count > 0)
                    {
                        for (int I = 0; I < this.m_VisibleActors.Count; I++)
                        {
                            BaseObject = this.m_VisibleActors[I].BaseObject;
                            if (BaseObject.m_boDeath)
                            {
                                continue;
                            }
                            if (this.IsProperTarget(BaseObject))
                            {
                                if (!BaseObject.m_boHideMode || this.m_boCoolEye)
                                {
                                    nAbs = Math.Abs(this.m_nCurrX - BaseObject.m_nCurrX) + Math.Abs(this.m_nCurrY - BaseObject.m_nCurrY);
                                    if (nAbs < nRage)
                                    {
                                        nRage            = nAbs;
                                        TargeTBaseObject = BaseObject;
                                    }
                                }
                            }
                        }
                    }
                    if (TargeTBaseObject != null)
                    {
                        this.SetTargetCreat(TargeTBaseObject);
                    }
                }
                if (((0 - this.m_dwWalkTick) > this.m_nWalkSpeed) && (this.m_TargetCret != null))
                {
                    if ((Math.Abs(this.m_nCurrX - this.m_TargetCret.m_nCurrX) <= 4) && (Math.Abs(this.m_nCurrX - this.m_TargetCret.m_nCurrX) <= 4))
                    {
                        if ((Math.Abs(this.m_nCurrX - this.m_TargetCret.m_nCurrX) <= 2) && (Math.Abs(this.m_nCurrX - this.m_TargetCret.m_nCurrX) <= 2))
                        {
                            if (HUtil32.Random(5) == 0)
                            {
                                this.GetBackPosition(ref this.m_nTargetX, ref this.m_nTargetY);
                            }
                        }
                        else
                        {
                            this.GetBackPosition(ref this.m_nTargetX, ref this.m_nTargetY);
                        }
                    }
                }
            }
            base.Run();
        }
Example #3
0
        private bool Think()
        {
            bool result = false;
            int  nOldX;
            int  nOldY;

            if ((HUtil32.GetTickCount() - m_dwThinkTick) > 3000)
            {
                m_dwThinkTick = HUtil32.GetTickCount();
                if (m_PEnvir.GetXYObjCount(m_nCurrX, m_nCurrY) >= 2)
                {
                    m_boDupMode = true;
                }
                if (!IsProperTarget(m_TargetCret))
                {
                    m_TargetCret = null;
                }
            }
            if (m_boDupMode)
            {
                nOldX = m_nCurrX;
                nOldY = m_nCurrY;
                WalkTo((byte)HUtil32.Random(8), false);
                if ((nOldX != m_nCurrX) || (nOldY != m_nCurrY))
                {
                    m_boDupMode = false;
                    result      = true;
                }
            }
            return(result);
        }
Example #4
0
        public override bool AttackTarget()
        {
            bool result = false;
            byte btDir  = 0;

            if (m_TargetCret == null)
            {
                return(result);
            }
            if (TargetInSpitRange(m_TargetCret, ref btDir))
            {
                if ((HUtil32.GetTickCount() - m_dwHitTick) > m_nNextHitTime)
                {
                    m_dwHitTick         = HUtil32.GetTickCount();
                    m_dwTargetFocusTick = HUtil32.GetTickCount();
                    SpitAttack(btDir);
                    BreakHolySeizeMode();
                }
                result = true;
                return(result);
            }
            if (m_TargetCret.m_PEnvir == m_PEnvir)
            {
                if ((Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 11) && (Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 11))
                {
                    SetTargetXY(m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY);
                }
            }
            else
            {
                DelTargetCreat();
            }
            return(result);
        }
Example #5
0
        // 物理攻击
        new public virtual bool AttackTarget()
        {
            bool result;
            int  nPower;

            result = false;
            if (m_TargetCret == null)
            {
                return(result);
            }
            if (HUtil32.GetTickCount() - m_dwHitTick > m_nNextHitTime)
            {
                m_dwHitTick = HUtil32.GetTickCount();
                if ((Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 2) && (Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 2))
                {
                    m_dwTargetFocusTick = HUtil32.GetTickCount();
                    nPower = GetAttackPower(HUtil32.LoWord(m_WAbil.DC), ((short)HUtil32.HiWord(m_WAbil.DC) - HUtil32.LoWord(m_WAbil.DC)));
                    HitMagAttackTarget(m_TargetCret, nPower / 2, nPower / 2, true);
                    result = true;
                    return(result);
                }
                if (m_TargetCret.m_PEnvir == m_PEnvir)
                {
                    if ((Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 11) && (Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 11))
                    {
                        SetTargetXY(m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY);
                    }
                }
                else
                {
                    DelTargetCreat();
                }
            }
            return(result);
        }
Example #6
0
 public TEvent(TEnvirnoment tEnvir, int nTX, int nTY, int nType, uint dwETime, bool boVisible)
 {
     m_dwOpenStartTick = HUtil32.GetTickCount();
     m_nEventType      = nType;
     m_nEventParam     = 0;
     m_dwContinueTime  = dwETime;
     m_boVisible       = boVisible;
     m_boClosed        = false;
     m_Envir           = tEnvir;
     m_nX            = nTX;
     m_nY            = nTY;
     m_boActive      = true;
     m_nDamage       = 0;
     m_OwnBaseObject = null;
     m_dwRunStart    = HUtil32.GetTickCount();
     m_dwRunTick     = 500;
     if ((m_Envir != null) && m_boVisible)
     {
         m_Envir.AddToMap(m_nX, m_nY, Grobal2.OS_EVENTOBJECT, this);
     }
     else
     {
         m_boVisible = false;
     }
 }
Example #7
0
 /****************************************************************
 ** 函 数 名:TfrmViewOnlineHuman_Load
 ** 功能描述:窗体载入事件
 ** 输入参数:无
 ** 输出参数:无
 ** 返 回 值:无
 ** 创 建 人:陶志强
 ** 日    期:2013-4-21
 ** 修 改 人:
 ** 日    期:
 ****************************************************************/
 private void TfrmViewOnlineHuman_Load(object sender, EventArgs e)
 {
     ViewList = new List <TPlayObject>();
     GridHuman.Columns.Add("序号", 80);
     GridHuman.Columns.Add("人物名称", 80);
     GridHuman.Columns.Add("性别", 80);
     GridHuman.Columns.Add("职业", 80);
     GridHuman.Columns.Add("等级", 80);
     GridHuman.Columns.Add("内功等级", 80);
     GridHuman.Columns.Add("地图", 80);
     GridHuman.Columns.Add("座标", 80);
     GridHuman.Columns.Add("登录帐号", 80);
     GridHuman.Columns.Add("登录IP", 80);
     GridHuman.Columns.Add("权限", 80);
     GridHuman.Columns.Add("所在地区", 80);
     GridHuman.Columns.Add(M2Share.g_Config.sGameGoldName, 80);
     GridHuman.Columns.Add(M2Share.g_Config.sGamePointName, 80);
     GridHuman.Columns.Add(M2Share.g_Config.sPayMentPointName, 80);
     GridHuman.Columns.Add("离线挂机", 80);
     GridHuman.Columns.Add("自动回复", 80);
     GridHuman.Columns.Add("未处理消息", 80);
     GridHuman.Columns.Add(M2Share.g_Config.sGameDiaMond, 80);
     GridHuman.Columns.Add(M2Share.g_Config.sGameGird, 80);
     if (M2Share.UserEngine != null)
     {
         this.Text = string.Format(" [在线人数:{0}]", M2Share.UserEngine.PlayObjectCount);
     }
     dwTimeOutTick = HUtil32.GetTickCount();
     GetOnlineList();
     RefGridSession();
     Timer.Enabled = true;
 }
Example #8
0
        /****************************************************************
        ** 函 数 名:Button1_Click
        ** 功能描述:踢出离线挂机按钮
        ** 输入参数:无
        ** 输出参数:无
        ** 返 回 值:无
        ** 创 建 人:陶志强
        ** 日    期:2013-4-21
        ** 修 改 人:
        ** 日    期:
        ****************************************************************/
        private void Button1_Click(object sender, EventArgs e)
        {
            int I;

            try
            {
                HUtil32.EnterCriticalSection(M2Share.ProcessHumanCriticalSection);
                for (I = 0; I < M2Share.UserEngine.m_PlayObjectList.Count; I++)
                {
                    if (M2Share.UserEngine.m_PlayObjectList[I].m_boNotOnlineAddExp)
                    {
                        M2Share.UserEngine.m_PlayObjectList[I].m_boNotOnlineAddExp = false;
                        M2Share.UserEngine.m_PlayObjectList[I].m_boPlayOffLine     = false;
                        M2Share.UserEngine.m_PlayObjectList[I].m_boKickFlag        = true;
                    }
                }
            }
            finally
            {
                HUtil32.LeaveCriticalSection(M2Share.ProcessHumanCriticalSection);
            }
            dwTimeOutTick = HUtil32.GetTickCount();
            GetOnlineList();
            RefGridSession();
        }
Example #9
0
        /// <summary>
        /// 添加会话
        /// </summary>
        /// <param name="sData"></param>
        private void ProcessAddSession(string sData)
        {
            string            sAccount = string.Empty;
            string            s10      = string.Empty;
            string            s14      = string.Empty;
            string            s18      = string.Empty;
            string            sIPaddr  = string.Empty;
            TGlobaSessionInfo GlobaSessionInfo;

            sData                        = HUtil32.GetValidStr3(sData, ref sAccount, new string[] { "/" });
            sData                        = HUtil32.GetValidStr3(sData, ref s10, new string[] { "/" });
            sData                        = HUtil32.GetValidStr3(sData, ref s14, new string[] { "/" });
            sData                        = HUtil32.GetValidStr3(sData, ref s18, new string[] { "/" });
            sData                        = HUtil32.GetValidStr3(sData, ref sIPaddr, new string[] { "/" });
            GlobaSessionInfo             = new TGlobaSessionInfo();
            GlobaSessionInfo.sAccount    = sAccount;
            GlobaSessionInfo.sIPaddr     = sIPaddr;
            GlobaSessionInfo.nSessionID  = HUtil32.Str_ToInt(s10, 0);
            GlobaSessionInfo.n24         = HUtil32.Str_ToInt(s14, 0);
            GlobaSessionInfo.boStartPlay = false;
            GlobaSessionInfo.boLoadRcd   = false;
            //GlobaSessionInfo.boHeroLoadRcd = false;
            GlobaSessionInfo.dwAddTick = HUtil32.GetTickCount();
            GlobaSessionInfo.dAddDate  = DateTime.Now;
            //GlobaSessionInfo.boRandomCode = false;
            GlobaSessionList.Add(GlobaSessionInfo);
        }
        public override void Run()
        {
            int nPower;

            try
            {
                if (!m_boDeath && !m_boGhost && (m_wStatusTimeArr[Grobal2.POISON_STONE] == 0))
                {
                    if ((m_TargetCret != null) && (HUtil32.GetTickCount() - m_dwHitTick > m_nNextHitTime) && (Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 2) && (Math.Abs(m_nCurrY - m_TargetCret.m_nCurrY) <= 2))
                    {
                        m_dwHitTick = HUtil32.GetTickCount();
                        if ((HUtil32.Random(4) == 0))// 癫狂状态
                        {
                            if ((M2Share.g_EventManager.GetEvent(m_PEnvir, m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY, Grobal2.ET_FIRE) == null))
                            {
                                MagMakeFireCross(this, GetAttackPower(HUtil32.LoWord(m_WAbil.DC), ((short)HUtil32.HiWord(m_WAbil.DC) - HUtil32.LoWord(m_WAbil.DC))), 4, m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY);// 火墙
                            }
                            else if ((HUtil32.Random(4) == 0))
                            {
                                if (IsProperTarget(m_TargetCret))
                                {
                                    if (HUtil32.Random(m_TargetCret.m_btAntiPoison + 7) <= 6)                                                                  // 施毒
                                    {
                                        nPower = GetAttackPower(HUtil32.LoWord(m_WAbil.DC), ((short)HUtil32.HiWord(m_WAbil.DC) - HUtil32.LoWord(m_WAbil.DC))); // 中毒类型 - 绿毒
                                        m_TargetCret.SendDelayMsg(this, Grobal2.RM_POISON, Grobal2.POISON_DECHEALTH, nPower, Parse(this), 4, "", 150);
                                    }
                                }
                            }
                            else
                            {
                                AttackTarget();// 物理攻击
                            }
                        }
                        else
                        {
                            if (HUtil32.Random(4) == 0)
                            {
                                if (IsProperTarget(m_TargetCret))
                                {
                                    if (HUtil32.Random(m_TargetCret.m_btAntiPoison + 7) <= 6)                                                                  // 施毒
                                    {
                                        nPower = GetAttackPower(HUtil32.LoWord(m_WAbil.DC), ((short)HUtil32.HiWord(m_WAbil.DC) - HUtil32.LoWord(m_WAbil.DC))); // 中毒类型 - 绿毒
                                        m_TargetCret.SendDelayMsg(this, Grobal2.RM_POISON, Grobal2.POISON_DECHEALTH, nPower, Parse(this), 4, "", 150);
                                    }
                                }
                            }
                            else if ((Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 2) && (Math.Abs(m_nCurrY - m_TargetCret.m_nCurrY) <= 2))
                            {
                                AttackTarget();// 物理攻击
                            }
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TSalamanderATMonster.Run");
            }
            base.Run();
        }
        public void SpirtStart(string[] @Params, TPlayObject PlayObject)
        {
            string sParam1 = @Params.Length > 0 ? @Params[0] : "";

            if ((PlayObject.m_btPermission < 6))
            {
                return;
            }
            if ((sParam1 != "") && (sParam1[0] == '?'))
            {
                PlayObject.SysMsg("此命令用于开始祈祷生效宝宝叛变。", TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            int  nTime  = HUtil32.Str_ToInt(sParam1, -1);
            uint dwTime = 0;

            if (nTime > 0)
            {
                dwTime = (uint)nTime * 1000;
            }
            else
            {
                dwTime = M2Share.g_Config.dwSpiritMutinyTime;
            }
            M2Share.g_dwSpiritMutinyTick = HUtil32.GetTickCount() + dwTime;
            PlayObject.SysMsg("祈祷叛变已开始。持续时长 " + dwTime / 1000 + " 秒。", TMsgColor.c_Green, TMsgType.t_Hint);
        }
Example #12
0
        /// <summary>
        /// 添加到加载角色队列里面
        /// </summary>
        /// <param name="sAccount"></param>
        /// <param name="sChrName"></param>
        /// <param name="sIPaddr"></param>
        /// <param name="boFlag"></param>
        /// <param name="nSessionID"></param>
        /// <param name="nPayMent"></param>
        /// <param name="nPayMode"></param>
        /// <param name="nSoftVersionDate"></param>
        /// <param name="nSocket"></param>
        /// <param name="nGSocketIdx"></param>
        /// <param name="nGateIdx"></param>
        public void AddToLoadRcdList(string sAccount, string sChrName, string sIPaddr, bool boFlag, int nSessionID, int nPayMent, int nPayMode, int nSoftVersionDate, int nSocket, int nGSocketIdx, int nGateIdx)
        {
            TLoadDBInfo LoadRcdInfo = new TLoadDBInfo();

            LoadRcdInfo.sAccount         = sAccount;
            LoadRcdInfo.sCharName        = sChrName;
            LoadRcdInfo.sIPaddr          = sIPaddr;
            LoadRcdInfo.boClinetFlag     = boFlag;
            LoadRcdInfo.nSessionID       = nSessionID;
            LoadRcdInfo.nSoftVersionDate = nSoftVersionDate;
            LoadRcdInfo.nPayMent         = nPayMent;
            LoadRcdInfo.nPayMode         = nPayMode;
            LoadRcdInfo.nSocket          = nSocket;
            LoadRcdInfo.nGSocketIdx      = nGSocketIdx;
            LoadRcdInfo.nGateIdx         = nGateIdx;
            LoadRcdInfo.dwNewUserTick    = HUtil32.GetTickCount();
            LoadRcdInfo.PlayObject       = null;
            LoadRcdInfo.nReLoadCount     = 0;
            LoadRcdInfo.boIsHero         = false;
            HUtil32.EnterCriticalSection(m_UserCriticalSection);
            try
            {
                m_LoadRcdList.Add(LoadRcdInfo);
            }
            finally
            {
                HUtil32.LeaveCriticalSection(m_UserCriticalSection);
            }
        }
Example #13
0
        private void NewSession(string sAccount, string sIPaddr, int nSessionID, int nPayMent, int nPayMode)
        {
            TSessInfo SessInfo;

            SessInfo                = new TSessInfo();
            SessInfo.sAccount       = sAccount;
            SessInfo.sIPaddr        = sIPaddr;
            SessInfo.nSessionID     = nSessionID;
            SessInfo.nPayMent       = nPayMent;
            SessInfo.nPayMode       = nPayMode;
            SessInfo.nSessionStatus = 0;
            SessInfo.dwStartTick    = HUtil32.GetTickCount();
            SessInfo.dwActiveTick   = HUtil32.GetTickCount();
            SessInfo.nRefCount      = 1;

            //m_SessionList.__Lock();
            try
            {
                m_SessionList.Add(SessInfo);
            }
            finally
            {
                // m_SessionList.UnLock();
            }
        }
Example #14
0
        public override bool Operate(TProcessMessage ProcessMsg)
        {
            bool result = false;

            try
            {
                result = false;
                if ((ProcessMsg.wIdent == Grobal2.RM_STRUCK) || (ProcessMsg.wIdent == Grobal2.RM_MAGSTRUCK))
                {
                    if (GetObject <TTrainer>(ProcessMsg.BaseObject) == this)
                    {
                        n56C   += ProcessMsg.wParam;
                        m_dw568 = HUtil32.GetTickCount();
                        n570++;
                        this.ProcessSayMsg("破坏力为 " + ProcessMsg.wParam + ",平均值为 " + (n56C / n570).ToString());
                    }
                }
                if (ProcessMsg.wIdent == Grobal2.RM_MAGSTRUCK)
                {
                    result = base.Operate(ProcessMsg);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TTrainer.Operate");
            }
            return(result);
        }
Example #15
0
        public override bool AttackTarget()
        {
            bool result = false;
            byte bt06   = 0;

            if (this.GetAttackDir(this.m_TargetCret, ref bt06))
            {
                if ((HUtil32.GetTickCount() - this.m_dwHitTick) > this.m_nNextHitTime)
                {
                    this.m_dwHitTick         = (uint)HUtil32.GetTickCount();
                    this.m_dwTargetFocusTick = (uint)HUtil32.GetTickCount();
                    this.Attack(this.m_TargetCret, bt06);
                    this.m_WAbil.HP = 0;// 死亡
                }
                result = true;
            }
            else
            {
                if (this.m_TargetCret.m_PEnvir == this.m_PEnvir)
                {
                    if ((Math.Abs(this.m_nCurrX - this.m_TargetCret.m_nCurrX) <= 11) && (Math.Abs(this.m_nCurrX - this.m_TargetCret.m_nCurrX) <= 11))
                    {
                        this.SetTargetXY(this.m_TargetCret.m_nCurrX, this.m_TargetCret.m_nCurrY);
                    }
                }
                else
                {
                    this.DelTargetCreat();
                }
            }
            return(result);
        }
Example #16
0
 public override void Run()
 {
     try
     {
         if (!this.m_boGhost && !this.m_boDeath && (this.m_wStatusTimeArr[Grobal2.POISON_STONE] == 0))
         {
             if ((HUtil32.GetTickCount() - this.m_dwWalkTick) > this.m_nWalkSpeed)
             {
                 this.m_dwWalkTick = HUtil32.GetTickCount();
                 if (m_boLight)// 发亮
                 {
                     if ((HUtil32.GetTickCount() - this.m_dwSearchEnemyTick) > m_dwLightTime)
                     {
                         this.m_dwSearchEnemyTick = HUtil32.GetTickCount();
                         m_dwLightTime            = 2500;// 发光时长
                         m_boLight = false;
                     }
                 }
                 if (m_boAttick && !m_boLight && (s_AttickXY != ""))
                 {
                     if (AttackTarget())     // 可以攻击
                     {
                         m_boAttick = false; // 处理攻击代码
                     }
                 }
             }
         }
         base.Run();
     }
     catch
     {
         M2Share.MainOutMessage("{异常} TFireDragonGuard.Run");
     }
 }
        public void TestStatus(string[] @Params, TPlayObject PlayObject)
        {
            if (@Params == null)
            {
                return;
            }
            int nType = @Params.Length > 0 ? int.Parse(@Params[0]) : 0;
            int nTime = @Params.Length > 1 ? int.Parse(@Params[1]) : 0;

            if ((PlayObject.m_btPermission < 6))
            {
                return;
            }

            //if ((!(nType >= Grobal2.ushort.GetLowerBound(0) && nType<= Grobal2.ushort.GetUpperBound(0))) || (nTime < 0))
            //{
            //    this.SysMsg("命令格式: @" + sCmd + " 类型(0..11) 时长", TMsgColor.c_Red, TMsgType.t_Hint);
            //    return;
            //}
            PlayObject.m_wStatusTimeArr[nType]  = Convert.ToByte(nTime * 1000);
            PlayObject.m_dwStatusArrTick[nType] = HUtil32.GetTickCount();
            PlayObject.m_nCharStatus            = PlayObject.GetCharStatus();
            PlayObject.StatusChanged("");
            PlayObject.SysMsg(string.Format("状态编号:{0} 时间长度: {1} 秒", nType, nTime), TMsgColor.c_Green, TMsgType.t_Hint);
        }
Example #18
0
        /// <summary>
        /// 被击中
        /// </summary>
        /// <param name="hiter"></param>
        public virtual void Struck(TBaseObject hiter)
        {
            byte btDir = 0;

            this.m_dwStruckTick = HUtil32.GetTickCount();
            if (hiter != null)
            {
                if ((this.m_TargetCret == null) || this.GetAttackDir(this.m_TargetCret, ref btDir) || (HUtil32.Random(6) == 0))
                {
                    if (this.IsProperTarget(hiter))
                    {
                        this.SetTargetCreat(hiter);
                    }
                }
            }
            if (this.m_boAnimal) // 是动物
            {
                this.m_nMeatQuality = this.m_nMeatQuality - HUtil32.Random(300);
                if (this.m_nMeatQuality < 0)
                {
                    this.m_nMeatQuality = 0;
                }
            }
            this.m_dwHitTick = Convert.ToUInt32(this.m_dwHitTick + (150 - HUtil32._MIN(130, this.m_Abil.Level * 4)));
        }
Example #19
0
 public void ConnectMsgServer()
 {
     MsgClient.Address = M2Share.g_Config.sMsgSrvAddr;
     MsgClient.Port    = M2Share.g_Config.nMsgSrvPort;
     MsgClient.Connect(MsgClient.Address, MsgClient.Port);
     dw2D4Tick = HUtil32.GetTickCount();
 }
Example #20
0
        // 远距离使用冰咆哮 5*5范围
        public override bool AttackTarget()
        {
            bool result = false;

            if (m_TargetCret == null)
            {
                return(result);
            }
            if (HUtil32.GetTickCount() - m_dwHitTick > m_nNextHitTime)
            {
                m_dwHitTick = HUtil32.GetTickCount();
                if ((Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 5) && (Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 5))
                {
                    m_dwTargetFocusTick = HUtil32.GetTickCount();
                    m_btDirection       = M2Share.GetNextDirection(m_nCurrX, m_nCurrY, m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY);
                    M2Share.MagicManager.MagBigExplosion(this, GetAttackPower(HUtil32.LoWord(m_WAbil.DC), ((short)HUtil32.HiWord(m_WAbil.DC) - HUtil32.LoWord(m_WAbil.DC))),
                                                         m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY, M2Share.g_Config.nSnowWindRange, MagicConst.SKILL_SNOWWIND);
                    SendRefMsg(Grobal2.RM_LIGHTING, 1, m_nCurrX, m_nCurrY, Parse(m_TargetCret), "");
                    result = true;
                    return(result);
                }
                if (m_TargetCret.m_PEnvir == m_PEnvir)
                {
                    if ((Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 11) && (Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 11))
                    {
                        SetTargetXY(m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY);
                    }
                }
                else
                {
                    DelTargetCreat();
                }
            }
            return(result);
        }
        public override bool AttackTarget()
        {
            bool result = false;
            byte btDir  = 0;

            if (m_TargetCret != null)
            {
                if (TargetInSpitRange(m_TargetCret, ref btDir))
                {
                    m_dwHitTick         = HUtil32.GetTickCount();
                    m_dwTargetFocusTick = HUtil32.GetTickCount();
                    this.Attack(m_TargetCret, btDir);
                    result = true;
                }
                if (m_TargetCret.m_PEnvir == m_PEnvir)
                {
                    if ((Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 11) && (Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 11))
                    {
                        SetTargetXY(m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY);
                    }
                }
                else
                {
                    DelTargetCreat();
                }
            }
            return(result);
        }
Example #22
0
 public TTrainer()
     : base()
 {
     m_dw568             = HUtil32.GetTickCount();
     this.m_btAntiPoison = 0;
     n56C = 0;
     n570 = 0;
 }
Example #23
0
 public void AppearNow()
 {
     boIsFirst         = false;
     m_boFixedHideMode = false;
     SendRefMsg(Grobal2.RM_DIGUP, m_btDirection, m_nCurrX, m_nCurrY, 0, "");
     RecalcAbilitys();
     m_dwWalkTick  = m_dwWalkTick + 800;
     dwDigDownTick = HUtil32.GetTickCount();
 }
Example #24
0
 public TDigOutZombi()
     : base()
 {
     m_nViewRange      = 7;
     m_dwSearchTime    = Convert.ToUInt32(HUtil32.Random(1500) + 2500);
     m_dwSearchTick    = HUtil32.GetTickCount();
     m_btRaceServer    = 95;
     m_boFixedHideMode = true;
 }
Example #25
0
 public TStoneMineEvent(TEnvirnoment Envir, int nX, int nY, int nType)
     : base(Envir, nX, nY, nType, 0, false)
 {
     this.m_Envir.AddToMapMineEvent(nX, nY, Grobal2.OS_EVENTOBJECT, this);
     this.m_boVisible     = false;
     m_nMineCount         = HUtil32.Random(200);
     m_dwAddStoneMineTick = HUtil32.GetTickCount();
     this.m_boActive      = false;
     m_nAddStoneCount     = HUtil32.Random(80);
 }
Example #26
0
 public void Open()
 {
     //frmHumanInfo = new TfrmHumanInfo();
     dwTimeOutTick = HUtil32.GetTickCount();
     //GetOnlineList();
     //RefGridSession();
     Timer.Enabled = true;
     this.ShowDialog();
     Timer.Enabled = false;
 }
Example #27
0
 public TCowKingMonster()
     : base()
 {
     m_dwSearchTime = Convert.ToUInt32(HUtil32.Random(1500) + 500);
     dw558          = HUtil32.GetTickCount();
     bo2BF          = true;
     n560           = 0;
     bo55C          = false;
     bo55D          = false;
 }
Example #28
0
 public override void Die()
 {
     base.Die();
     if (nZilKillCount > 0)
     {
         dw558 = HUtil32.GetTickCount();
         dw560 = Convert.ToUInt32(HUtil32.Random(20) + 4 * 1000);
     }
     nZilKillCount -= 1;
 }
Example #29
0
        public override void Run()
        {
            int nPower = 0;

            try
            {
                if (!m_boDeath && !m_boGhost && (m_wStatusTimeArr[Grobal2.POISON_STONE] == 0))
                {
                    // 走路间隔
                    if ((HUtil32.GetTickCount() - m_dwWalkTick > m_nWalkSpeed) && (m_TargetCret != null) && (!m_TargetCret.m_boDeath))
                    {
                        // 目标不为空
                        if (boIsSpiderMagic)
                        {
                            // 喷出网后,延时1100毫秒显示目标的效果
                            if (HUtil32.GetTickCount() - m_dwSpiderMagicTick > 1100)
                            {
                                boIsSpiderMagic = false;// 是否喷出蜘蛛网
                                SpiderMagicAttack(nPower / 2, m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY, 3);
                                base.Run();
                                return;
                            }
                        }
                        if ((Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 2) && (Math.Abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 2))
                        {
                            if ((HUtil32.Random(4) == 0) && (m_TargetCret.m_wStatusTimeArr[Grobal2.STATE_LOCKRUN] == 0))
                            {
                                // 喷出蜘蛛网
                                if (HUtil32.GetTickCount() - m_dwHitTick > m_nNextHitTime)
                                {
                                    m_dwHitTick = HUtil32.GetTickCount();
                                    nPower      = GetAttackPower(HUtil32.LoWord(m_WAbil.DC), ((short)HUtil32.HiWord(m_WAbil.DC) - HUtil32.LoWord(m_WAbil.DC)));
                                    SendRefMsg(Grobal2.RM_LIGHTING, 1, m_nCurrX, m_nCurrY, Parse(m_TargetCret), "");
                                    m_dwSpiderMagicTick = HUtil32.GetTickCount(); // 喷出蜘蛛网计时,用于延时处理目标身上的小网显示
                                    boIsSpiderMagic     = true;                   // 是否喷出蜘蛛网
                                }
                            }
                            else
                            {
                                AttackTarget();
                            }
                        }
                        else
                        {
                            this.GotoTargetXY();
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TYanLeiWangSpider.Run");
            }
            base.Run();
        }
Example #30
0
 public TDualAxeMonster()
     : base()
 {
     this.m_nViewRange   = 5;
     this.m_nRunTime     = 250;
     this.m_dwSearchTime = 3000;
     m_nAttackCount      = 0;
     m_nAttackMax        = 2;
     this.m_dwSearchTick = HUtil32.GetTickCount();
     this.m_btRaceServer = 87;
 }