Beispiel #1
0
        public override void OnTickIdle(ObjNPC npc, float delta)
        {
            if (npc.Scene == null)
            {
                return;
            }

            if (npc.IsDead())
            {
                return;
            }

            if (npc.IsAggressive())
            {
                if (npc.TableNpc.ViewDistance > 0)
                {
                    var target = ScanEnemy(npc, (float)npc.TableNpc.ViewDistance);
                    if (target != null)
                    {
                        npc.EnterState(BehaviorState.Combat);
                        npc.PushHatre(target, 1);
                        npc.AddEnemy(target.ObjId);
                        target.AddEnemy(npc.ObjId);
                    }
                }
            }
        }
        public override void OnTickIdle(ObjNPC npc, float delta)
        {
            if (npc.Scene == null)
            {
                return;
            }

            if (npc.IsDead())
            {
                return;
            }

            if (npc.IsAggressive())
            {
                if (npc.TableNpc.ViewDistance > 0)
                {
                    var target = npc.ScanEnemy((float)npc.TableNpc.ViewDistance);
                    if (target != null)
                    {
                        npc.EnterState(BehaviorState.Combat);
                        npc.PushHatre(target, 1);
                        npc.AddEnemy(target.ObjId);
                        target.AddEnemy(npc.ObjId);

                        // 搜索仇恨组
                        if (npc.tbSceneNpc != null && npc.tbSceneNpc.ChouHenGroupId != -1)
                        {
                            TryToCallPartner(npc, target, 2000);
                        }
                    }
                }
            }
        }
Beispiel #3
0
        private void MainTowerOndamage(ObjNPC npc, ObjCharacter caster, int damage)
        {
            mIsFubenInfoDirty = true;
            var unit2 = mFubenInfoMsg.Units[2];

            if (npc.IsDead() || !npc.Active)
            {
                unit2.Params[0] = 0;
            }
            else
            {
                unit2.Params[0] = npc.GetAttribute(eAttributeType.HpNow) * 100 / npc.GetAttribute(eAttributeType.HpMax);
            }
        }
        public override void OnTickIdle(ObjNPC npc, float delta)
        {
            if (npc.Scene == null)
            {
                return;
            }

            if (npc.IsDead())
            {
                return;
            }

            if (npc.IsAggressive())
            {
                if (npc.TableNpc.ViewDistance > 0)
                {
                    FindNpcEnemy(npc, (float)npc.TableNpc.ViewDistance);
                }
            }
        }