Example #1
0
        public MonsterObject(uint _id,int nAi_Id,short x,short y,bool isCreateTypeId = true)
        {
            mTarget = null;
            id = _id;
            type = OBJECTTYPE.MONSTER;
            attr = new GameStruct.MonterAttribute();
            mRebirthTime = 1000; //默认复活时间
            if (isCreateTypeId)
            {
                typeid = IDManager.CreateTypeId(type);
            }
            mInitPoint = new GameStruct.Point();
            mInitPoint.x = x;
            mInitPoint.y = y;
            m_Ai = CreateAi(nAi_Id);

            mnDieMagicTick = System.Environment.TickCount;
            mDieMagicInfo = null;
            attr.life = attr.life_max = 0;
            mAliveTime = new GameBase.Core.TimeOut();
            mAliveTime.SetInterval(mRebirthTime);

            this.SetPoint(x, y);
               // ai = new AI.BaseAI(this);
            Alive();
        }
Example #2
0
        public PlayerPK(PlayerObject _play)
        {
            play = _play;

            mDecTime = new GameBase.Core.TimeOut();
            mDecTime.SetInterval(Define.PK_DEC_TIME);

            mnNameType = GetNameType();
        }
Example #3
0
 public PlayerFight(PlayerObject _play)
 {
     play = _play;
     mAutoTarget = null;
     mnAutoAttackTick = System.Environment.TickCount;
     mnLastAttackTick = System.Environment.TickCount;
     mnYanHunQiangIndex = mnYanHunQiangExIndex = 0;
     mListQiShiTuanGuard = null;
     mLiuXingYunHuoTime = null;
 }
 public ScriptTimerManager()
 {
     mListInfo = new List<ScriptTimerInfo>();
     mClearTagTick = System.Environment.TickCount;
     mRunTick = System.Environment.TickCount;
     mListPlayTimeOut = new List<PlayTimeOut>();
     mPlayTimeOut = new GameBase.Core.TimeOut();
     mPlayTimeOut.SetInterval(1000);
     mPlayTimeOut.Update();
 }
Example #5
0
        public PlayerMagic(PlayerObject _play)
        {
            play = _play;
            mDicMagic = new Dictionary<uint, GameStruct.RoleMagicInfo>();

            mNormalAttackSpeed = new GameBase.Core.TimeOut();
            mNormalAttackSpeed.SetInterval(GameBase.Config.Define.ROLE_ATTACK_SPEED);
            mNormalAttackSpeed.Update();
            mMoveSpeed = new GameBase.Core.TimeOut();
            mMoveSpeed.SetInterval(GameBase.Config.Define.ROLE_MOVE_SPEED);
            mMoveSpeed.Update();
            mMagicAttackSpeed = new List<GameBase.Core.TimeOut>();
        }
Example #6
0
        public MingGuoShengNv(PlayerObject _play, short x, short y, byte dir, uint _id, int nAi_Id)
            : base(_id, nAi_Id,x,y, false)
        {
            type = OBJECTTYPE.CALLOBJECT;
            typeid = IDManager.CreateTypeId(OBJECTTYPE.GUARDKNIGHT);
            SetPoint(x, y);
            mRebirthTime = 0;//不允许复活

            mPlay = _play;
            SetDir(dir);
            mnRefreshTick = System.Environment.TickCount;
            mMagicAttackTime = new GameBase.Core.TimeOut();
            mMagicAttackTime.SetInterval(5);
        }
Example #7
0
        public PlayerTimer(PlayerObject _play)
        {
            mi64Effect = 0;
            mi64EffectEx = 0;
            play = _play;

            mXpTime = new GameBase.Core.TimeOut();
            mXpTime.SetInterval(Define.XP_ADD_SECS);
            mXpTime.Update();
            mnXpVal = 0;

            mSPTime = new GameBase.Core.TimeOut();
            mSPTime.SetInterval(Define.SP_ADD_SECS);
            mSPTime.Update();
            mListStatus = new List<GameStruct.RoleStatus>();
            mObject_CALL = null;
        }
Example #8
0
        public EudemonObject(RoleData_Eudemon info,PlayerObject _play)
        {
            type = OBJECTTYPE.EUDEMON;
            mInfo = info;
            play = _play;
            mPlayObject = new Dictionary<uint, PlayerObject>();
            typeid = info.GetTypeID();
            mMonsterInfo = EudemonObject.GetMonsterInfo(play, info.itemid);
            mbIsCombo = false;
            mAttackSpeed = new GameBase.Core.TimeOut();
            mAttackSpeed.SetInterval(GameBase.Config.Define.ROLE_ATTACK_SPEED);
            mAttackSpeed.Update();

            mMagicAttackSpeed = new List<GameBase.Core.TimeOut>();
            this.SetRiding(false);
            this.SetState(EUDEMONSTATE.NROMAL);
        }
Example #9
0
        public void Run()
        {
            AutoAttack();

            //法师- 凝聚流星陨火
            if (play.GetJob() == JOB.MAGE)
            {
                if (play.GetMagicSystem().IsLiuXingYunHuo()
                    && mnLiuXingYunHuoCount < Define.LIUXINGYUNHUO_MAX_COUNT
                    && play.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_YUANSUZHANGKONG) != null)
                {
                    if (mLiuXingYunHuoTime == null)
                    {
                        mLiuXingYunHuoTime = new GameBase.Core.TimeOut();
                        mLiuXingYunHuoTime.SetInterval(Define.LIUXINGYUNHUO_TIME);

                        mnLiuXingYunHuoCount++;
                        play.ChangeAttribute(UserAttribute.LIUXINGYUNHUO, mnLiuXingYunHuoCount);
                    }
                    if (mLiuXingYunHuoTime.ToNextTime())
                    {
                        mnLiuXingYunHuoCount++;
                        play.ChangeAttribute(UserAttribute.LIUXINGYUNHUO, mnLiuXingYunHuoCount);

                    }
                }
            }
        }
Example #10
0
        public bool CheckMagicAttackSpeed(ushort magicid, byte magiclv)
        {
            GameStruct.MagicTypeInfo type = ConfigManager.Instance().GetMagicTypeInfo(magicid, magiclv);

            if (type == null) return false;
            if (type.delay_ms == 0) return true;
            bool bFind = false;
            bool bError = false;
            GameBase.Core.TimeOut time = null;
            for (int i = 0; i < mMagicAttackSpeed.Count; i++)
            {
                time = mMagicAttackSpeed[i];
                if ((ushort)time.GetObject() == magicid)
                {
                    if (time.ToNextTime())
                    {
                        bFind = true;
                        break;
                    }
                    else bError = true;
                }
            }

            //把其他的技能施法速度更新一遍
            for (int i = 0; i < mMagicAttackSpeed.Count; i++) { mMagicAttackSpeed[i].Update(); }
            if (!bFind && bError == false)
            {
                time = new GameBase.Core.TimeOut();
                time.SetInterval(type.delay_ms);
                time.SetObject(magicid);
                time.Update();
                mMagicAttackSpeed.Add(time);
                return true;
            }

            return bFind;
        }
        public int time_id; //定时器的id

        #endregion Fields

        #region Constructors

        public PlayTimeOut()
        {
            time_id = 0;
             callback_scripte_id = 0;
             id = 0;
             TimeOut = new GameBase.Core.TimeOut();
             IsOnline = true;
        }