本文整理汇总了C#中WoWUnit类的典型用法代码示例。如果您正苦于以下问题:C# WoWUnit类的具体用法?C# WoWUnit怎么用?C# WoWUnit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WoWUnit类属于命名空间,在下文中一共展示了WoWUnit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LogCast
public static void LogCast(string sname, WoWUnit unit, double health, double dist)
{
if (unit.IsMe)
Logger.Write("Casting {0} on Me @ {1:F1}%", sname, health);
else
Logger.Write("Casting {0} on {1} @ {2:F1}% at {3:F1} yds", sname, unit.SafeName(), health, dist);
}
示例2: WillChainHealHop
/// <summary>
/// WillChainHealHop()
/// Tests whether casting Chain Lightning on 'healTarget' results in a minimum
/// of 2 hops (3 people healed.)
/// </summary>
/// <param name="healTarget"></param>
/// <returns></returns>
public static bool WillChainHealHop(WoWUnit healTarget)
{
double threshhold = SingularSettings.Instance.Shaman.RAF_ChainHeal_Health;
if (healTarget == null)
return false;
var t = (from o in ObjectManager.ObjectList
where o is WoWPlayer && healTarget.Location.Distance(o.Location) < 12
let p = o.ToPlayer()
where p != null
&& p.IsHorde == StyxWoW.Me.IsHorde
&& !p.IsPet
&& p != healTarget
&& p.IsAlive
&& p.HealthPercent < threshhold
let c = (from oo in ObjectManager.ObjectList
where oo is WoWPlayer && p.Location.Distance(oo.Location) < 12
let pp = oo.ToPlayer()
where pp != null
&& pp.IsHorde == p.IsHorde
&& !pp.IsPet
&& pp.IsAlive
&& pp.HealthPercent < threshhold
select pp).Count()
orderby c descending, p.Distance ascending
select new { Player = p, Count = c }).FirstOrDefault();
if (t == null || t.Count < 3)
return false;
return true;
}
示例3: CastIfHasBuff
public bool CastIfHasBuff(WoWGlobal wowinfo, WoWUnit unit) {
if (unit.HasBuff(this.ID)) {
this.SendCast();
return true;
}
return false;
}
示例4: ActualMaxRange
/// <summary>
/// Returns maximum spell range based on hitbox of unit.
/// </summary>
/// <param name="spell"></param>
/// <param name="unit"></param>
/// <returns>Maximum spell range</returns>
public static float ActualMaxRange(this WoWSpell spell, WoWUnit unit)
{
if (spell.MaxRange == 0)
return 0;
// 0.3 margin for error
return unit != null ? spell.MaxRange + unit.CombatReach + 1f : spell.MaxRange;
}
示例5: formatslog
private void formatslog(string type, string reason, string spell, WoWUnit target)
{
System.Drawing.Color textcolor;
switch (type)
{
case "Heal":
textcolor = Color.Green;
break;
case "Cleanse":
textcolor = Color.Magenta;
break;
case "Buff":
textcolor = Color.Brown;
break;
case "OhShit":
textcolor = Color.Red;
break;
case "Mana":
textcolor = Color.Blue;
break;
case "DPS":
textcolor = Color.Violet;
break;
case "Utility":
textcolor = Color.Orange;
break;
default:
textcolor = Color.Black;
break;
}
slog(textcolor, reason + ": casting {0} on {1} at distance {2} with type {3} at hp {4}", spell, privacyname(target), Round(target.Distance), type, Round(target.HealthPercent));
}
示例6: ValidUnit
static bool ValidUnit(WoWUnit p)
{
if (IgnoreMobs.Contains(p.Entry))
return false;
// Ignore shit we can't select/attack
if (!p.CanSelect || !p.Attackable)
return false;
// Ignore friendlies!
if (p.IsFriendly)
return false;
// Duh
if (p.Dead)
return false;
// Dummies/bosses are valid by default. Period.
if (p.IsTrainingDummy() || p.IsBoss())
return true;
// If its a pet, lets ignore it please.
if (p.IsPet || p.OwnedByRoot != null)
return false;
// And ignore critters/non-combat pets
if (p.IsNonCombatPet || p.IsCritter)
return false;
return true;
}
示例7: CanCastFortitudeOn
private static bool CanCastFortitudeOn(WoWUnit unit)
{
//return !unit.HasAura("Blood Pact") &&
return !unit.HasAura("Power Word: Fortitude") &&
!unit.HasAura("Qiraji Fortitude") &&
!unit.HasAura("Commanding Shout");
}
示例8: DoMovement
private static void DoMovement(WoWUnit Target)
{
// Thought i might try add this, just to see if this might catch wow's error
// prob a longggggggggg shot, but worth the try.
// -> my thoughts, if theres something to catch, maybe it wont crash wow it self?, but im guessing hb will still cause crash
try
{
// If we are > 2, we need to get closer to them at all costs.
if (Target.Distance > 2)
{
ClickToMove.MoveTo(Target.Location);
return;
}
//// If player not moving and we not behind, lets get behind
//if ((Target.MovementInfo.CurrentSpeed == 0) && (!Target.MeIsSafelyBehind))
//{
// WoWPoint BehindLocation = WoWMathHelper.CalculatePointBehind(Target.Location, Target.Rotation, 1.5f);
// ClickToMove.MoveTo(BehindLocation);
//}
//// If where behind them and not facing them, Face them
//if ((Target.MeIsSafelyBehind) && (!Me.IsSafelyFacing(Target)))
//{
// Target.Face();
//}
} catch (Exception) { }
}
示例9: CastOnTarget
public override Task<bool> CastOnTarget(WoWUnit target)
{
base.Conditions.Clear();
InitializeBase();
base.Conditions.Add(_energy);
base.Conditions.Add(new TargetNotAuraUpCondition(target, Spell));
return base.CastOnTarget(target);
}
示例10: CastOnTarget
public override Task<bool> CastOnTarget(WoWUnit target)
{
base.Conditions.Clear();
InitializeBase();
Conditions.Add(Energy);
Conditions.Add(new BooleanCondition(target != null && target.IsWithinMeleeRange));
return base.CastOnTarget(target);
}
示例11: GetCombatTimeLeft
/// <summary>
/// Returns the estimated combat time left for this unit. (Time until death)
/// If the unit is invalid; TimeSpan.MinValue is returned.
/// </summary>
/// <param name="u"></param>
/// <returns></returns>
public static TimeSpan GetCombatTimeLeft(WoWUnit u)
{
if (DpsInfos.ContainsKey(u.Guid))
{
return DpsInfos[u.Guid].CombatTimeLeft;
}
return TimeSpan.MinValue;
}
示例12: CastOnTarget
public override Task<bool> CastOnTarget(WoWUnit target)
{
Conditions.Clear();
InitializeBase();
Conditions.Add(new InMeeleRangeCondition());
Conditions.Add(new BooleanCondition(Me.ComboPoints <= 2));
Conditions.Add(new BooleanCondition(SettingsManager.Instance.UseMFD));
return base.CastOnTarget(target);
}
示例13: GetDps
/// <summary>
/// Returns the current DPS on a specific unit, or -1 if the unit is not currently being tracked, or doesn't exist.
/// </summary>
/// <param name="u"></param>
/// <returns></returns>
public static double GetDps(WoWUnit u)
{
if (DpsInfos.ContainsKey(u.Guid))
{
return DpsInfos[u.Guid].CurrentDps;
}
// -1 is a fail case.
return -1;
}
示例14: FindUnit
public static UnitOracle FindUnit(WoWUnit unit)
{
try {
// CLU.DebugLog(Color.GreenYellow, "[CLU-ORACLE] " + CLU.Version + ": FindUnit [" + unit + "] = [" + unit.Guid + "]");
return instances[unit.Guid];
} catch {
return null;
}
}
示例15: ReCast
public override bool ReCast(WoWGlobal wowinfo, WoWUnit unit) {
if (!unit.HasBuff(this.ID) && !wowinfo.SpellIsPending && wowinfo.HasRunesFor(cost)) {
this.SendCast();
return true;
}
else {
return false;
}
}