W
weischbier
Guest
So I rewrote my DK part for Singular once more and it turns out totally awesome as long as it worked (3-5k DPS higher)!
BUT all of a sudden it will stop mid fight and then nothing...
Heres my Code:
This totally worked but suddenly not. I changed nothing and I don't use any addons except DBM.
Here's a log View attachment 37835
Since 5800 was released randomly this error occurs too:
So i hope anybody can help me out here.
greetz
Weischbier</float></float></bool>
BUT all of a sudden it will stop mid fight and then nothing...
Heres my Code:
Code:
using System;
using Singular.Dynamics;
using Singular.Helpers;
using Singular.Managers;
using Singular.Settings;
using Styx;
using Styx.Combat.CombatRoutine;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using TreeSharp;
namespace Singular.ClassSpecific.DeathKnight
{
public static class Frost
{
[Class(WoWClass.DeathKnight)]
[Spec(TalentSpec.FrostDeathKnight)]
[Behavior(BehaviorType.Combat)]
[Context(WoWContext.All)]
public static Composite Create_Frost_DeathKnightCombat()
{
return
new PrioritySelector(
DarkSimulacrum(),
Helpers.Common.CreateInterruptSpellCast(ret => CurTarget),
Defense(),
Outbreak(),
PlagueStrike(),
DmgCooldown(),
Obliterate(1),
FrostStrike(1),
Obliterate(2),
FrostStrike(2),
HowlingBlast(1),
FrostStrike(3),
Obliterate(3),
Obliterate(4),
Obliterate(5),
Obliterate(6),
HowlingBlast(2),
Obliterate(7),
HowlingBlast(3),
Obliterate(8),
FrostStrike(4),
HornOfWinter(2)
);
}
[Class(WoWClass.DeathKnight)]
[Behavior(BehaviorType.PreCombatBuffs)]
[Spec(TalentSpec.FrostDeathKnight)]
[Context(WoWContext.All)]
public static Composite Create_Frost_DeathKnightPreCombatBuffs()
{
return
new PrioritySelector(
Presence(),
HornOfWinter(1)
);
}
#region Category: Spells
//internal static bool Keypresser()
//{
// bool IsLeftAltKeyDown = Lua.GetReturnVal<bool>("if IsLeftAltKeyDown() and GetCurrentKeyBoardFocus() == nil then return true end", 0);
// return IsLeftAltKeyDown;
//}
private static LocalPlayer Me
{
get { return StyxWoW.Me; }
}
private static WoWUnit CurTarget
{
get { return StyxWoW.Me.CurrentTarget; }
}
private static WoWUnit Focus
{
get { return StyxWoW.Me.FocusedUnit; }
}
internal static bool Burst
{
get
{
return Me.HasAnyAura("Bloodlust", "Time Warp", "Heroism");
}
}
// Offensive Attacks
internal static Composite DarkSimulacrum()
{
return
new Decorator(
ret => Focus != null,
new Decorator(
ret => Focus.DarkSimThis(),
Spell.Buff("Dark Simulacrum", true, ret => Focus,
ret => Me.FocusedUnit.IsCasting &&
(Me.FocusedUnit.CastingSpellId == 108567 ||
Me.FocusedUnit.CastingSpellId == 110887 ||
Me.FocusedUnit.CastingSpellId == 105289 ||
Me.FocusedUnit.CastingSpellId == 110888),
"Dark Simulacrum")
)
);
}
internal static Composite Outbreak()
{
return
new Decorator(
ret => CurTarget.IsBoss() || CurTarget.BurstThis(),
Spell.Buff("Outbreak", true, ret => CurTarget, "Blood Plague", "Frost Fever")
);
}
internal static Composite PlagueStrike()
{
return
new Decorator(
ret =>
!CurTarget.HasMyAura("Blood Plague"),
Spell.Cast("Plague Strike", ret => CurTarget)
);
}
internal static Composite Obliterate(int rank)
{
return
new PrioritySelector(
new Decorator(
ret => rank == 1 &&
ObjectManager.Me.DeathRuneCount >= 1 &&
ObjectManager.Me.FrostRuneCount >= 1 &&
ObjectManager.Me.UnholyRuneCount >= 1,
Spell.Cast("Obliterate", ret => CurTarget)
),
new Decorator(
ret => rank == 2 &&
(ObjectManager.Me.FrostRuneCount == 2 &&
ObjectManager.Me.DeathRuneCount == 2) ||
(ObjectManager.Me.UnholyRuneCount == 2 &&
ObjectManager.Me.DeathRuneCount == 2) ||
(ObjectManager.Me.FrostRuneCount == 2 &&
ObjectManager.Me.UnholyRuneCount == 2),
Spell.Cast("Obliterate", ret => CurTarget)
),
new Decorator(
ret => rank == 3 &&
Me.HasMyAura("Killing Machine", 1),
Spell.Cast("Obliterate", ret => CurTarget)
),
new Decorator(
ret => rank == 4 &&
ObjectManager.Me.UnholyRuneCount == 2,
Spell.Cast("Obliterate", ret => CurTarget)
),
new Decorator(
ret => rank == 5 &&
ObjectManager.Me.UnholyRuneCount == 1 &&
(GetRuneCooldown(3) < 1 ||
GetRuneCooldown(4) < 1),
Spell.Cast("Obliterate", ret => CurTarget)
),
new Decorator(
ret => rank == 6 &&
ObjectManager.Me.UnholyRuneCount == 1 &&
(GetRuneCooldown(3) < 1 ||
GetRuneCooldown(4) < 1) &&
(ObjectManager.Me.DeathRuneCount +
ObjectManager.Me.FrostRuneCount == 1),
Spell.Cast("Obliterate", ret => CurTarget)
),
new Decorator(
ret => rank == 7 &&
Me.CurrentRunicPower >= 90,
Spell.Cast("Obliterate", ret => CurTarget)
),
new Decorator(
ret => rank == 8 &&
Me.CurrentRunicPower >= 60,
Spell.Cast("Obliterate", ret => CurTarget)
)
);
}
internal static Composite HowlingBlast(int rank)
{
return
new PrioritySelector(
new Decorator(
ret => rank == 1 &&
StyxWoW.Me.HasMyAura("Freezing Fog"),
Spell.Cast("Howling Blast", ret => CurTarget)
),
new Decorator(
ret => rank == 2 &&
StyxWoW.Me.CurrentRunicPower < 90,
Spell.Cast("Howling Blast", ret => CurTarget)
),
new Decorator(
ret => rank == 3 &&
StyxWoW.Me.CurrentRunicPower < 60,
Spell.Cast("Howling Blast", ret => CurTarget)
)
);
}
internal static Composite FrostStrike(int rank)
{
return
new PrioritySelector(
new Decorator(
ret => rank == 1 &&
StyxWoW.Me.CurrentRunicPower >= 120,
Spell.Cast("Frost Strike", ret => CurTarget)
),
new Decorator(
ret => rank == 2 &&
StyxWoW.Me.CurrentRunicPower >= 110,
Spell.Cast("Frost Strike", ret => CurTarget)
),
new Decorator(
ret => rank == 3 &&
StyxWoW.Me.CurrentRunicPower >= 100,
Spell.Cast("Frost Strike", ret => CurTarget)
),
new Decorator(
ret => rank == 4,
Spell.Cast("Frost Strike", ret => CurTarget)
)
);
}
//Buffs/Cooldowns
internal static Composite DmgCooldown()
{
return
new PrioritySelector(
PillarofFrost(),
BloodTap(),
RaiseDead(),
EmpowerRuneWeapon(),
Trinket1(),
Trinket2(),
Tinker9(),
Potion()
);
}
internal static Composite HornOfWinter(int rank)
{
return
new PrioritySelector(
new Decorator(ret => rank == 1,
new Decorator(ret => CurTarget != null,
new Decorator(ret => !CurTarget.IsFriendly,
Spell.BuffSelf(
"Horn of Winter",
ret =>
!StyxWoW.Me.HasAura("Horn of Winter") &&
!StyxWoW.Me.HasAura("Battle Shout") &&
!StyxWoW.Me.HasAura("Roar of Courage"))))
),
new Decorator(ret => rank == 2,
Spell.BuffSelf("Horn of Winter")
)
);
}
internal static Composite Presence()
{
return Spell.BuffSelf(
"Unholy Presence",
ret =>
TalentManager.CurrentSpec == TalentSpec.FrostDeathKnight);
}
internal static Composite PillarofFrost()
{
return
new PrioritySelector(
new Decorator(
ret => SingularSettings.Instance.DeathKnight.UsePillarOfFrost,
new PrioritySelector(
new Decorator(
ret => CurTarget.IsBoss() || CurTarget.BurstThis(),
Spell.BuffSelf("Pillar of Frost")
),
new Decorator(
ret => !CurTarget.DontBurstThis(),
Spell.BuffSelf("Pillar of Frost")
)
)
)
);
}
internal static Composite BloodTap()
{
return
new Decorator(
ret => ObjectManager.Me.DeathRuneCount < 2 &&
GetAllRuneCooldowns(1, 2) > 2,
Spell.BuffSelf("Blood Tap")
);
}
internal static Composite RaiseDead()
{
return
new PrioritySelector(
new Decorator(
ret => SingularSettings.Instance.DeathKnight.UseRaiseDead,
new PrioritySelector(
new Decorator(
ret => CurTarget.IsBoss() || CurTarget.BurstThis(),
new Decorator(
ret => Me.HasMyAura("Pillar of Frost") && Me.HasMyAura("Unholy Strength"),
Spell.Cast("Raise Dead", ret => CurTarget)
)
)
)
)
);
}
internal static Composite EmpowerRuneWeapon()
{
return
new PrioritySelector(
new Decorator(
ret => SingularSettings.Instance.DeathKnight.UseEmpowerRuneWeapon,
new Decorator(
ret => CurTarget.IsBoss() || CurTarget.BurstThis(),
new Decorator(
ret => Me.FrostRuneCount < 1 &&
Me.UnholyRuneCount < 2 &&
Me.DeathRuneCount < 1 &&
Me.CurrentRunicPower < 25 &&
(GetAllRuneCooldowns(1, 2, 3, 4, 5) > 1 ||
GetAllRuneCooldowns(1, 2, 3, 4, 6) > 1 ||
GetAllRuneCooldowns(1, 2, 3, 4, 5, 6) > 1),
Spell.Cast("Empower Rune Weapon", ret => CurTarget)
)
)
)
);
}
//Items/Trinkets/Tinkers
internal static Composite Trinket1()
{
return
new Decorator(
ret => CurTarget.IsBoss() || CurTarget.BurstThis(),
new Decorator(
Item.UseEquippedItem(12)
)
);
}
internal static Composite Trinket2()
{
return
new Decorator(
ret => CurTarget.IsBoss() || CurTarget.BurstThis(),
new Decorator(
Item.UseEquippedItem(13)
)
);
}
internal static Composite Tinker9()
{
return
new Decorator(
ret => Me.HasMyAura("Pillar of Frost"),
new Decorator(
Item.UseEquippedItem(9)
)
);
}
internal static Composite Potion()
{
return
new Decorator(
ret => Burst,
Item.UseItem(58146)
);
}
//Defensive Spells
internal static Composite Defense()
{
return
new PrioritySelector(
AntimagicShell(),
IceboundFortitude(),
GiftoftheNaaru(),
Tinker5()
);
}
internal static Composite Tinker5()
{
return
new Decorator(ret => Me.HealthPercent < 50,
Item.UseEquippedItem(5)
);
}
internal static Composite AntimagicShell()
{
return
new Decorator(
ret => Me.HealthPercent < 80,
Spell.BuffSelf("Anti-Magic Shell")
);
}
internal static Composite IceboundFortitude()
{
return
new Decorator(
ret => Me.HealthPercent < 60,
Spell.BuffSelf("Icebound Fortitude")
);
}
internal static Composite GiftoftheNaaru()
{
return
new Decorator(
ret => Me.HealthPercent < 50,
Spell.BuffSelf("Gift of the Naaru")
);
}
//Test Area
internal static int GetAllRuneCooldowns(params int[] runes)
{
int cooldown = 0;
foreach (int rune in runes)
{
cooldown += GetRuneCooldown(rune);
}
return cooldown;
}
internal static int GetRuneCooldown(int rune)
{
float finish = Lua.GetReturnVal<float>(string.Format("local start, dur, ready = GetRuneCooldown({0}); local finish = start + dur; return finish", rune), 0);
float time_now = Lua.GetReturnVal<float>("return GetTime()", 0);
return (int)Math.Round(finish - time_now);
}
#endregion
}
}
This totally worked but suddenly not. I changed nothing and I don't use any addons except DBM.
Here's a log View attachment 37835
Since 5800 was released randomly this error occurs too:
Code:
System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> Styx.InvalidObjectPointerException: Der Deskriptor kann auf einem falschen Objekt nicht gelesen werden.
bei Styx.WoWInternals.WoWObjects.WoWObject.#eve[T](UInt32 field)
bei Styx.WoWInternals.WoWObjects.WoWObject.#dve[T](Int32 offsetIndex)
bei Styx.WoWInternals.WoWObjects.WoWUnit.get_Level()
bei Honorbuddy.MainWindow.#3Uc()
--- Ende der internen Ausnahmestapel?berwachung ---
bei System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
bei System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
bei System.Delegate.DynamicInvokeImpl(Object[] args)
bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
So i hope anybody can help me out here.
greetz
Weischbier</float></float></bool>
Last edited by a moderator: