i am writing up a pluging to see what the pulse is like atm.
yeah im using alot of functions in my CC, alot of "searching" for players, does 3 types im thinking thats whats slowing it down
other than that i really dont have any loops.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Styx;
using Styx.Combat.CombatRoutine;
using Styx.Helpers;
using Styx.Logic;
using Styx.Logic.Combat;
using Styx.Logic.Pathing;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using HBPVPDruid.Misc;
namespace HBPVPDruid
{
// We want to
// #1 priority ( Flag Carrier [ CanSee(traceline), In Range] ) if is one
// #2 Loop threw every player (put dots on em)
// #3 when all have dots, find lowest hp person, then we rape him?
public static class GetTargetPlayer
{
public static bool SingleTarget = false;
public static WoWPlayer TargetPlayer()
{
// Reset this
SingleTarget = false;
WoWPlayer Player = null;
// If there is a flag carrier return the flag carrier
if (ObjectManager.Me.Faction.Name == "Horde") Player = EnemyHordeFlagCarrier();
if (ObjectManager.Me.Faction.Name == "Alliance") Player = EnemyAllianceFlagCarrier();
if (Player != null) Misc.Misc.DebugLog("[Target] Targeting Flag Carrier");
if (Player != null) SingleTarget = true;
if (Player != null) return Player;
// If enemy needed dot
Player = PlayerToDot();
if (Player != null) Misc.Misc.DebugLog("[Target] Targeting Random Player To Dot");
if (Player != null) return Player;
// Single Target spam
Player = EnemyLowestHealth();
if (Misc.Misc.EnemysAroundMe <= 1) SingleTarget = true;
if (Player != null) Misc.Misc.DebugLog("[Target] Targeting Single Player");
return Player;
}
#region GetPlayer
private static WoWPlayer EnemyAllianceFlagCarrier()
{
return (from Unit in ObjectManager.GetObjectsOfType<WoWPlayer>(false)
where Unit.IsAlive
where Unit.Distance < 35
where !Unit.IsFriendly
where !Unit.IsPet
where Misc.Misc.HasSpellID(23333)
where Unit.InLineOfSight
select Unit).FirstOrDefault();
}
private static WoWPlayer EnemyHordeFlagCarrier()
{
return (from Unit in ObjectManager.GetObjectsOfType<WoWPlayer>(false)
where Unit.IsAlive
where Unit.Distance < 40
where !Unit.IsFriendly
where !Unit.IsPet
where Misc.Misc.HasSpellID(23335)
where Unit.InLineOfSight
select Unit).FirstOrDefault();
}
private static WoWPlayer EnemyLowestHealth()
{
return (from Unit in ObjectManager.GetObjectsOfType<WoWPlayer>(false)
orderby Unit.HealthPercent
where Unit.IsAlive
where Unit.Distance < 40
where !Unit.IsFriendly
where !Unit.IsPet
where Unit.InLineOfSight
select Unit).FirstOrDefault(); ;
}
private static WoWPlayer PlayerToDot()
{
return (from Unit in ObjectManager.GetObjectsOfType<WoWPlayer>(false)
orderby Unit.HealthPercent
where Unit.IsAlive
where Unit.Distance < 40
where !Unit.IsFriendly
where !Unit.IsPet
where Unit.InLineOfSight
where !Unit.HasAura("Insect Swarm") || !Unit.HasAura("Moonfire") || !Unit.HasAura("Sunfire")
select Unit).FirstOrDefault();
}
#endregion
}
}
Maybe the way to go is via plugin,
Code:
[4:33:21 PM:937] [PVPDruidMovement By SwInY] Pulse Timer: [402]
[4:33:22 PM:343] [PVPDruidMovement By SwInY] Pulse Timer: [401]
[4:33:22 PM:734] [PVPDruidMovement By SwInY] Pulse Timer: [403]
[4:33:23 PM:203] [PVPDruidMovement By SwInY] Pulse Timer: [461]
[4:33:23 PM:609] [PVPDruidMovement By SwInY] Pulse Timer: [402]
[4:33:24 PM:78] [PVPDruidMovement By SwInY] Pulse Timer: [467]
[4:33:24 PM:531] [PVPDruidMovement By SwInY] Pulse Timer: [463]
[4:33:25 PM:406] [PVPDruidMovement By SwInY] Pulse Timer: [867]
[4:33:25 PM:875] [PVPDruidMovement By SwInY] Pulse Timer: [468]
[4:33:26 PM:453] [PVPDruidMovement By SwInY] Pulse Timer: [583]
[4:33:26 PM:921] [PVPDruidMovement By SwInY] Pulse Timer: [469]
[4:33:27 PM:343] [PVPDruidMovement By SwInY] Pulse Timer: [418]
[4:33:27 PM:718] [PVPDruidMovement By SwInY] Pulse Timer: [383]
going to loose alot of what i want to do tho