gdoubleok
Member
- Joined
- Jul 9, 2010
- Messages
- 150
- Reaction score
- 0
should be short now, i have automate all settings stuff![]()
is there any good wiz support in this update with co-routines?

should be short now, i have automate all settings stuff![]()
i will do exactly like trinity for now, i've make a new skill meta system like this:is there any good wiz support in this update with co-routines?<3
/// <summary>
/// This is the default skill meta for the Companion skill
/// </summary>
[XmlElement("Companion")]
public class Companion : SkillMetaTest
{
#region Companion meta
#region Instance
private static Companion _instance;
public static Companion Instance
{
get { return _instance ?? (_instance = new Companion()); }
set { _instance = value; }
}
#endregion
#region Construtors
public Companion() :
base("CompanionMeta")
{ }
#endregion
public override string DisplayName { get { return "Companion meta"; } }
public override Skill Skill { get { return Skills.DemonHunter.Companion; } }
public override int DefaultRange { get { return 0; } }
public override int MaxRange { get { return 0; } }
/// <summary>
/// The target types allowed by the skill
/// </summary>
public override TargetTypeFlags TargetTypeFlags
{
get { return GroupTargetTypeFlags.Any; }
}
/// <summary>
/// Get specific skill behavior depend of range and target.
/// </summary>
/// <param name="range"> The context range to check. </param>
/// <param name="target"> The target to handle. </param>
/// <returns>
/// The result behavior.
/// </returns>
public override async Task<Behavior> GetBehavior(int range, VinciObject target)
{
// Can cast part
CanCast = async (cRange, cTarget) =>
{
if (!await Skill.CanCast())
return Return(false, "CantCast");
if (!OffCooldown && Skill.TimeSinceUse < ForceCooldown)
return Return(false, "ForceCooldown");
if (cTarget.IsTrash && !CastOnTrashAllowed)
return Return(false, "!CastOnTrashAllowed");
if (cTarget.IsEliteRareUnique && !CastOnEliteAllowed)
return Return(false, "!CastOnEliteAllowed");
if (cTarget.Unit.IsBoss && !CastOnBossAllowed)
return Return(false, "!CastOnBossAllowed");
if (Runes.DemonHunter.SpiderCompanion.IsActive)
{
if (Context.TargetUtils.ClusterExists(SpiderCompanionClusterPackRadius, SpiderCompanionClusterPackSize))
return Return(true, "SpiderCompanionCluster");
if (Context.TargetUtils.EliteOrTrashInRange(SpiderCompanionEliteRange))
return Return(true, "SpiderCompanionElite");
}
if (Runes.DemonHunter.BatCompanion.IsActive && Context.Player.PrimaryResourceMissing >= BatCompanionRessourceMissing)
return Return(true, "BatCompanionRessourceMissing");
if (Runes.DemonHunter.BoarCompanion.IsActive && ((Context.TargetUtils.ClusterExists(20f, 4) && Context.TargetUtils.EliteOrTrashInRange(20f)) || (Context.Target.IsBossOrEliteRareUnique && Context.Target.Distance <= 20f)))
return Return(true, "BoarCompanion");
if (Runes.DemonHunter.FerretCompanion.IsActive && Context.GlobesCache.HealthGlobeExist && Context.GlobesCache.HealthGlobe.Distance <= 60f && Context.Player.CurrentHealthPct < Context.CombatUtils.PotionLimit)
return Return(true, "FerretCompanion");
if (Runes.DemonHunter.WolfCompanion.IsActive && (Context.TargetUtils.AnyElitesInRange(50f) || Context.TargetUtils.AnyMobsInRange(40f, 8)))
return Return(true, "WolfCompanion");
if (OffCooldown && Context.TargetUtils.AnyMobsInRange(50f))
return Return(true, "OffCooldown");
return Return(false, "EndCheck");
};
// Behavior part
if (await CanCast(range, target))
{
if (await Skill.Cast())
{
LastPost += " => SuccessfullyCast !";
return Behaviors.Continue(this);
}
LastPost += " => CastFailed !";
}
return Behaviors.Null;
}
#region Empty things
/// <summary>
/// Execute something like a movement.
/// </summary>
/// <param name="target"> The position to handle. </param>
/// <returns>
/// If the task was executed something.
/// </returns>
public override Task<bool> GetBehavior(Vector3 target)
{
return TaskHelpers.EmptyTaskBool;
}
/// <summary>
/// Called on enable event
/// </summary>
public override Task OnInitialize()
{
return TaskHelpers.EmptyTask;
}
/// <summary>
/// Called on disable event
/// </summary>
public override Task OnDispose()
{
return TaskHelpers.EmptyTask;
}
#endregion
#region XmlFields
private int _spiderCompanionClusterPackSize;
private int _spiderCompanionClusterPackRadius;
private int _spiderCompanionEliteRange;
private int _batCompanionRessourceMissing;
#endregion
#region XmlProperties
[Setting]
[DefaultValue(4)]
[Limit(0, 20)]
[TickFrequency(1)]
[XmlElement("SpiderCompanionClusterPackSize")]
[DisplayName("Min trash pack size")]
[Description("Minimum cluster pack size to valid cast")]
[Category("Specific - SpiderCompanion")]
public int SpiderCompanionClusterPackSize
{
get { return _spiderCompanionClusterPackSize; }
set { _spiderCompanionClusterPackSize = value; OnPropertyChanged("SpiderCompanionClusterPackSize"); }
}
[Setting]
[DefaultValue(25)]
[Limit(0, 80)]
[TickFrequency(2.5)]
[XmlElement("SpiderCompanionClusterPackRadius")]
[DisplayName("Min trash pack radius")]
[Description("Minimum cluster pack radius to valid cast")]
[Category("Specific - SpiderCompanion")]
public int SpiderCompanionClusterPackRadius
{
get { return _spiderCompanionClusterPackRadius; }
set { _spiderCompanionClusterPackRadius = value; OnPropertyChanged("SpiderCompanionClusterPackRadius"); }
}
[Setting]
[DefaultValue(25)]
[Limit(0, 80)]
[TickFrequency(2.5)]
[XmlElement("SpiderCompanionEliteRange")]
[DisplayName("Elite range")]
[Description("Minimum distance from an elite to valid cast")]
[Category("Specific - SpiderCompanion")]
public int SpiderCompanionEliteRange
{
get { return _spiderCompanionEliteRange; }
set { _spiderCompanionEliteRange = value; OnPropertyChanged("SpiderCompanionEliteRange"); }
}
[Setting]
[DefaultValue(60)]
[Limit(0, 500)]
[TickFrequency(5)]
[XmlElement("BatCompanionRessourceMissing")]
[DisplayName("Max primary ressource missing")]
[Description("Maximum primary ressource missing to valid cast")]
[Category("Specific - BatCompanion")]
public int BatCompanionRessourceMissing
{
get { return _batCompanionRessourceMissing; }
set { _batCompanionRessourceMissing = value; OnPropertyChanged("BatCompanionRessourceMissing"); }
}
#endregion
#endregion
}
i will do exactly like trinity for now, i've make a new skill meta system like this:
Code:/// <summary> /// This is the default skill meta for the Companion skill /// </summary> [XmlElement("Companion")] public class Companion : SkillMetaTest { #region Companion meta #region Instance private static Companion _instance; public static Companion Instance { get { return _instance ?? (_instance = new Companion()); } set { _instance = value; } } #endregion #region Construtors public Companion() : base("CompanionMeta") { } #endregion public override string DisplayName { get { return "Companion meta"; } } public override Skill Skill { get { return Skills.DemonHunter.Companion; } } public override int DefaultRange { get { return 0; } } public override int MaxRange { get { return 0; } } /// <summary> /// The target types allowed by the skill /// </summary> public override TargetTypeFlags TargetTypeFlags { get { return GroupTargetTypeFlags.Any; } } /// <summary> /// Get specific skill behavior depend of range and target. /// </summary> /// <param name="range"> The context range to check. </param> /// <param name="target"> The target to handle. </param> /// <returns> /// The result behavior. /// </returns> public override async Task<Behavior> GetBehavior(int range, VinciObject target) { // Can cast part CanCast = async (cRange, cTarget) => { if (!await Skill.CanCast()) return Return(false, "CantCast"); if (!OffCooldown && Skill.TimeSinceUse < ForceCooldown) return Return(false, "ForceCooldown"); if (cTarget.IsTrash && !CastOnTrashAllowed) return Return(false, "!CastOnTrashAllowed"); if (cTarget.IsEliteRareUnique && !CastOnEliteAllowed) return Return(false, "!CastOnEliteAllowed"); if (cTarget.Unit.IsBoss && !CastOnBossAllowed) return Return(false, "!CastOnBossAllowed"); if (Runes.DemonHunter.SpiderCompanion.IsActive) { if (Context.TargetUtils.ClusterExists(SpiderCompanionClusterPackRadius, SpiderCompanionClusterPackSize)) return Return(true, "SpiderCompanionCluster"); if (Context.TargetUtils.EliteOrTrashInRange(SpiderCompanionEliteRange)) return Return(true, "SpiderCompanionElite"); } if (Runes.DemonHunter.BatCompanion.IsActive && Context.Player.PrimaryResourceMissing >= BatCompanionRessourceMissing) return Return(true, "BatCompanionRessourceMissing"); if (Runes.DemonHunter.BoarCompanion.IsActive && ((Context.TargetUtils.ClusterExists(20f, 4) && Context.TargetUtils.EliteOrTrashInRange(20f)) || (Context.Target.IsBossOrEliteRareUnique && Context.Target.Distance <= 20f))) return Return(true, "BoarCompanion"); if (Runes.DemonHunter.FerretCompanion.IsActive && Context.GlobesCache.HealthGlobeExist && Context.GlobesCache.HealthGlobe.Distance <= 60f && Context.Player.CurrentHealthPct < Context.CombatUtils.PotionLimit) return Return(true, "FerretCompanion"); if (Runes.DemonHunter.WolfCompanion.IsActive && (Context.TargetUtils.AnyElitesInRange(50f) || Context.TargetUtils.AnyMobsInRange(40f, 8))) return Return(true, "WolfCompanion"); if (OffCooldown && Context.TargetUtils.AnyMobsInRange(50f)) return Return(true, "OffCooldown"); return Return(false, "EndCheck"); }; // Behavior part if (await CanCast(range, target)) { if (await Skill.Cast()) { LastPost += " => SuccessfullyCast !"; return Behaviors.Continue(this); } LastPost += " => CastFailed !"; } return Behaviors.Null; } #region Empty things /// <summary> /// Execute something like a movement. /// </summary> /// <param name="target"> The position to handle. </param> /// <returns> /// If the task was executed something. /// </returns> public override Task<bool> GetBehavior(Vector3 target) { return TaskHelpers.EmptyTaskBool; } /// <summary> /// Called on enable event /// </summary> public override Task OnInitialize() { return TaskHelpers.EmptyTask; } /// <summary> /// Called on disable event /// </summary> public override Task OnDispose() { return TaskHelpers.EmptyTask; } #endregion #region XmlFields private int _spiderCompanionClusterPackSize; private int _spiderCompanionClusterPackRadius; private int _spiderCompanionEliteRange; private int _batCompanionRessourceMissing; #endregion #region XmlProperties [Setting] [DefaultValue(4)] [Limit(0, 20)] [TickFrequency(1)] [XmlElement("SpiderCompanionClusterPackSize")] [DisplayName("Min trash pack size")] [Description("Minimum cluster pack size to valid cast")] [Category("Specific - SpiderCompanion")] public int SpiderCompanionClusterPackSize { get { return _spiderCompanionClusterPackSize; } set { _spiderCompanionClusterPackSize = value; OnPropertyChanged("SpiderCompanionClusterPackSize"); } } [Setting] [DefaultValue(25)] [Limit(0, 80)] [TickFrequency(2.5)] [XmlElement("SpiderCompanionClusterPackRadius")] [DisplayName("Min trash pack radius")] [Description("Minimum cluster pack radius to valid cast")] [Category("Specific - SpiderCompanion")] public int SpiderCompanionClusterPackRadius { get { return _spiderCompanionClusterPackRadius; } set { _spiderCompanionClusterPackRadius = value; OnPropertyChanged("SpiderCompanionClusterPackRadius"); } } [Setting] [DefaultValue(25)] [Limit(0, 80)] [TickFrequency(2.5)] [XmlElement("SpiderCompanionEliteRange")] [DisplayName("Elite range")] [Description("Minimum distance from an elite to valid cast")] [Category("Specific - SpiderCompanion")] public int SpiderCompanionEliteRange { get { return _spiderCompanionEliteRange; } set { _spiderCompanionEliteRange = value; OnPropertyChanged("SpiderCompanionEliteRange"); } } [Setting] [DefaultValue(60)] [Limit(0, 500)] [TickFrequency(5)] [XmlElement("BatCompanionRessourceMissing")] [DisplayName("Max primary ressource missing")] [Description("Maximum primary ressource missing to valid cast")] [Category("Specific - BatCompanion")] public int BatCompanionRessourceMissing { get { return _batCompanionRessourceMissing; } set { _batCompanionRessourceMissing = value; OnPropertyChanged("BatCompanionRessourceMissing"); } } #endregion #endregion }
Create a new meta is now realy easy, i will ask to community to update every skill behavior,
the Ui is generate auto with this code, no longer need to create xaml element etc, realy hop the community should help me to create all skill metas
Okay since there isn't any type of installation instructions for whatever reason being, Can someone please walk me through how to install this plugin? I extracted it to the plugin folder but i keep getting compiling errors. Would greatly appreciate any advice because there are no instructions apparently.
i continue the job, beta soon i hope
![]()
i continue the job, beta soon i hope
can help ???
when i download all replace my old trinity with fork Demonbuddy not showing any trinity ><
the fork project is discontinued for now, i work on a new plugin to replace Trinity, a beta should be ready soon.