Example #1
0
        public override void OnEnterCombat(ObjNPC npc)
        {
            npc.BornPosition  = npc.GetPosition();
            npc.BornDirection = npc.GetDirection();

            //保存下进入战斗时的位置,距离这个位置太远了就要回家
            mBackPosition = npc.GetPosition();

            //获得目标
            var enemy = npc.Scene.FindCharacter(npc.LastEnemyId);

            if (null != enemy)
            {
                npc.TurnFaceTo(enemy.GetPosition());
            }

            npc.BroadcastDirection();

            //保存普攻数据
            if (-1 != npc.NormalSkillId)
            {
                mTableNormalSkill = Table.GetSkill(npc.NormalSkillId);

                //计算普攻技能距离
                mSkillDistance = SkillManager.GetSkillDistance((SkillTargetType)mTableNormalSkill.TargetType,
                                                               mTableNormalSkill.TargetParam);

                //上来先来个cd,要不攻击者一攻击怪一瞬间怪就反击
                GenNextNormalAttackTime();
            }

            mNoMoveTime = 0;
        }
Example #2
0
        public override void OnEnterCombat(ObjNPC npc)
        {
            base.OnEnterCombat(npc);

            npc.BornPosition  = npc.GetPosition();
            npc.BornDirection = npc.GetDirection();

            //保存下进入战斗时的位置,距离这个位置太远了就要回家
            mBackPosition = npc.GetPosition();
        }