Hi.
I wanted to create a combat routine myself but i always get a compile error when starting DB.
It´s quite simple. My plan was to take the default Barb "use anything when ready" and put it together with "use whirlwind when walking" from BarbarianWastesRolling, because the generic routine uses skills when ready but isnt whirlwinding all the time to move faster...
https://github.com/BosslandGmbH/Trinity/blob/master/Routines/Barbarian/BarbarianDefault.cs
https://github.com/BosslandGmbH/Trinity/blob/master/Routines/Barbarian/BarbarianWastesRolling.cs
Is it possible to find the mistake?
Ty in advance.
I wanted to create a combat routine myself but i always get a compile error when starting DB.
It´s quite simple. My plan was to take the default Barb "use anything when ready" and put it together with "use whirlwind when walking" from BarbarianWastesRolling, because the generic routine uses skills when ready but isnt whirlwinding all the time to move faster...
https://github.com/BosslandGmbH/Trinity/blob/master/Routines/Barbarian/BarbarianDefault.cs
https://github.com/BosslandGmbH/Trinity/blob/master/Routines/Barbarian/BarbarianWastesRolling.cs
Code:
using Trinity.Framework.Helpers;
using System.ComponentModel;
using System.Linq;
using System.Windows.Controls;
using Trinity.Components.Combat.Resources;
using Trinity.Framework;
using Trinity.Framework.Actors.ActorTypes;
using Trinity.Framework.Objects;
using Trinity.Framework.Reference;
using Trinity.UI;
using Zeta.Common;
using Zeta.Game;
namespace Trinity.Routines.Barbarian
{
public sealed class BarbarianWW : BarbarianBase, IRoutine
{
#region Definition
public string DisplayName => "Wastes + BulKathos + WW";
public string Description => "WW all the way";
public string Author => "yakfou";
public string Version => "1.0";
public Build BuildRequirements => null;
//public Build BuildRequirements => new Build
//{
// Sets = new Dictionary<Set, SetBonus>
// {
// { Sets.WrathOfTheWastes, SetBonus.Third },
// { Sets.BulKathossOath, SetBonus.First },
// },
// Skills = new Dictionary<Skill, Rune>
// {
// { Skills.Barbarian.Whirlwind, null },
// },
//};
#endregion
public TrinityPower GetOffensivePower()
{
TrinityPower power;
TrinityActor target;
if (TrySpecialPower(out power))
return power;
if (TrySecondaryPower(out power))
return power;
// Zoom around
if (Skills.Barbarian.Whirlwind.CanCast())
{
var destination = Player.CurrentHealthPct > 0.6f
? TargetUtil.GetZigZagTarget(CurrentTarget.Position, 60f, true)
: Avoider.SafeSpot;
return Whirlwind(destination);
}
return null;
}
public TrinityPower GetDefensivePower() => GetBuffPower();
public TrinityPower GetDestructiblePower() => DefaultDestructiblePower();
protected override bool ShouldWrathOfTheBerserker()
{
return IsInCombat && base.ShouldWrathOfTheBerserker();
}
public TrinityPower GetBuffPower()
{
if (ShouldBattleRage())
return BattleRage();
if (ShouldIgnorePain())
return IgnorePain();
if (ShouldThreateningShout())
return ThreateningShout();
if (ShouldWarCry())
return WarCry();
if (ShouldCallOfTheAncients())
return CallOfTheAncients();
if (AllowedToUse(Settings.WrathOfTheBerserker, Skills.Barbarian.WrathOfTheBerserker) && ShouldWrathOfTheBerserker())
return WrathOfTheBerserker();
return null;
}
public TrinityPower GetMovementPower(Vector3 destination)
{
var destinationPortal =
Core.Actors.FirstOrDefault(g => g.IsPortal && g.Position.DistanceSqr(destination) < 5 * 5);
if (destinationPortal != null)
return Walk(destination);
// All walking is replaced by Whirlwind if possible.
if (Skills.Barbarian.Whirlwind.CanCast() && !Player.IsInTown)
{
if (CurrentTarget == null || !(CurrentTarget.IsGizmo && CurrentTarget.RadiusDistance <= 1f))
return Whirlwind(destination);
}
return Walk(destination);
}
#region Settings
public override int ClusterSize => Settings.ClusterSize;
public override float EmergencyHealthPct => Settings.EmergencyHealthPct;
IDynamicSetting IRoutine.RoutineSettings => Settings;
public BarbarianWWSettings Settings { get; } = new BarbarianWWSettings();
public sealed class BarbarianWWSettings : NotifyBase, IDynamicSetting
{
private int _clusterSize;
private float _emergencyHealthPct;
[DefaultValue(6)]
public int ClusterSize
{
get { return _clusterSize; }
set { SetField(ref _clusterSize, value); }
}
[DefaultValue(0.4f)]
public float EmergencyHealthPct
{
get { return _emergencyHealthPct; }
set { SetField(ref _emergencyHealthPct, value); }
}
#region IDynamicSetting
public string GetName() => GetType().Name;
public UserControl GetControl() => UILoader.LoadXamlByFileName<UserControl>(GetName() + ".xaml");
public object GetDataContext() => this;
public string GetCode() => JsonSerializer.Serialize(this);
public void ApplyCode(string code) => JsonSerializer.Deserialize(code, this, true);
public void Reset() => LoadDefaults();
public void Save() { }
#endregion
}
#endregion
}
}
Is it possible to find the mistake?
Ty in advance.