本文整理汇总了C#中Zone.ObjInZone方法的典型用法代码示例。如果您正苦于以下问题:C# Zone.ObjInZone方法的具体用法?C# Zone.ObjInZone怎么用?C# Zone.ObjInZone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zone
的用法示例。
在下文中一共展示了Zone.ObjInZone方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: mobsCountInZone
private int mobsCountInZone(Zone zone, uint[] ids)
{
int result = 0;
foreach (var m in host.getCreatures())
{
if (ids.Contains(m.creatureId) && zone.ObjInZone(m))
result++;
}
return result;
}
示例2: GetBestNearestMob
//Try to find best mob in farm zone.
public Creature GetBestNearestMob(Zone zone)
{
Creature mob = null;
double dist = 999999;
foreach (var obj in getCreatures())
{
//If creature Npc and we can attack him and creature alive and distance to this creature less than other and creature have 100% hp or creature want to kill out character.
if (obj.type == BotTypes.Npc && isAttackable(obj) && (obj.firstHitter == null || obj.firstHitter == me) && isAlive(obj) && me.dist(obj) < dist && zone.ObjInZone(obj)
&& (hpp(obj) == 100 || obj.aggroTarget == me))
{
mob = obj;
dist = me.dist(obj);
}
}
return mob;
}
示例3: getNearestMob
private Creature getNearestMob(Zone zone)
{
double minDist = 999999;
Creature bestCreature = null;
foreach (var creature in host.getCreatures())
{
if (creature.creatureId == 3364 && host.isAlive(creature) && zone.ObjInZone(creature))
{
if (minDist > host.me.dist(creature))
{
minDist = host.me.dist(creature);
bestCreature = creature;
}
}
}
return bestCreature;
}
示例4: GetNearestCreaturesInZoneById
internal Creature GetNearestCreaturesInZoneById(Zone zone, List<uint> creatureId)
{
try
{
Creature creature = null;
var tempCreatures = host.getCreatures();
double minDist = 999999;
for (int i = 0; i < tempCreatures.Count; i++)
{
if (creatureId.Exists(c => c == tempCreatures[i].creatureId) && host.dist(tempCreatures[i]) < minDist && zone.ObjInZone(tempCreatures[i]))
{
minDist = host.dist(tempCreatures[i]);
creature = tempCreatures[i];
}
}
return creature;
}
catch (Exception error)
{
}
return null;
}
示例5: getDoodadsCountInZone
public int getDoodadsCountInZone(Zone zone, uint phaseId)
{
int result = 0;
foreach (var doodad in host.getDoodads())
{
if (doodad.phaseId == phaseId && zone.ObjInZone(doodad))
result++;
}
return result;
}