What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Proper way to filter enemies.

repka3

New Member
Joined
Aug 17, 2013
Messages
15
Reaction score
0
Hi all,
i'm trying to filters only enemies from a diaUnit list.. Figured out from looking in reference:
Code:
 List<DiaUnit> CurrentValidEnemiesLists = unitsList.Where(
                            o => o.IsValid &&
                                o.CommonData != null &&
                                o.CommonData.IsValid &&
                                (o.ActorType == Zeta.Game.Internals.SNO.ActorType.Monster)&&
                                (
                                o.MonsterInfo.MonsterType==Zeta.Game.Internals.SNO.MonsterType.Beast ||
                                 o.MonsterInfo.MonsterType==Zeta.Game.Internals.SNO.MonsterType.BloodGolem ||
                                  o.MonsterInfo.MonsterType==Zeta.Game.Internals.SNO.MonsterType.CorruptedAngel ||
                                   o.MonsterInfo.MonsterType==Zeta.Game.Internals.SNO.MonsterType.Demon ||
                                    o.MonsterInfo.MonsterType==Zeta.Game.Internals.SNO.MonsterType.Human ||
                                     o.MonsterInfo.MonsterType==Zeta.Game.Internals.SNO.MonsterType.Pandemonium ||
                                        o.MonsterInfo.MonsterType==Zeta.Game.Internals.SNO.MonsterType.Undead 
                                )

                                ).ToList();

Is this correct? Is there another better way?
 
........ just posted and see in the log:
ENEMY type:Monster name:DH_elementalArrow_iceShard2-386621 actsno:135207 ractorguid:1399783520 acdguid:-1 MonsterType:Beast isAlive:False

......................
...................................

Ok, i'm giving up. Someone can tell me a proper way to CHECK from this list
unitsList = ZetaDia.Actors.GetActorsOfType<DiaUnit>(true).Where(u=>(u.IsValid)).ToList();

if unit is attackable enemy? i mean also goblin, everything you can KILL inside a rift for example ? Is this possible without 3500 cascade condition to avoid exception?

Thx
 
how about

var units = ZetaDia.Actors.GetActorsOfType<DiaUnit>().Where(u=> u.IsValid && u.IsAttackable && u.IsAlive).ToList();
 
how about

var units = ZetaDia.Actors.GetActorsOfType<DiaUnit>().Where(u=> u.IsValid && u.IsAttackable && u.IsAlive).ToList();

No :) you got also templar and summoned things. Anyway nvm, found it. Monstertype, valid, teamid=10 and exclude *****, projectile etc..

Thx anyway :)
 
Back
Top