I have been wanting to get Curse on Hit working myself, since it can be extremely powerful both offensively and defensively. What i ended up doing was basically copy/pasta'ing the entire cursing logic from OldRoutine. Renamed a few variables, and set my Curse on Hit key. Been running a few hours now and all seems to work perfectly fine for my Poison Arrow build. Hotkey is simply linked to my level 1 Frenzy > Curse on Hit > Greater Multiple Projectiles > Chain > Vulnerability.
Code:
// Curse on Hit Adjustments
var Curse_On_Hit = myPos.Distance(cachedPosition) < OldRoutineSettings.Instance.MaxRangeRange &&
(cachedRarity >= Rarity.Magic || cachedMobsNearForCurse >= 4);
if (Curse_On_Hit)
{
var skill = LokiPoe.InGameState.SkillBarPanel.Slot([COLOR="#FF0000"]1[/COLOR]);
if (skill.CanUse() &&
cachedIsCursable &&
cachedCurseCount < LokiPoe.Me.TotalCursesAllowed &&
!bestTarget.HasAura("[COLOR="#FF0000"]Vulnerability[/COLOR]"))
{
//await DisableAlwaysHiglight();
var err1 = LokiPoe.InGameState.SkillBarPanel.UseAt([COLOR="#FF0000"]1[/COLOR], false, cachedPosition);
if (err1 == LokiPoe.InGameState.UseError.None)
return true;
Log.ErrorFormat("[Logic] Use returned {0} for {1}.", err1, skill.Name);
}
}
Red text is what each user will have to edit manually. 1-7 depending on which hotkey you decide to use and you will have to change the name of the curse / debuff you are applying to the mob.
The above code will curse:
1. All Magic Enemies
2. All Rare Enemies
3. All Bosses
4. Any cluster of 4+ (any enemy type)
SideNotes:
1. I dont know what
await DisableAlwaysHiglight(); is used for. I have it commented out for now.
Tested with it enabled and disabled and i see no difference.
2. I dont know what the true / false represents in: LokiPoe.InGameState.SkillBarPanel.UseAt(1,
false, cachedPosition);
3. I havent tested this on a melee character yet. So i dont know how its going to interact with the MaxRangeRange. Works fine for ranged so far. Worst case you may have to change MaxRangeRange to MaxMeleeRange if you are playing a melee class, or set MaxRangeRange to the max distance of whatever skill you are using. IE: If you are using Leap Slam and Leap Slam has a range of 20 yards, set MaxRangeRange to 20 (i dont know the actual range of Leap Slam, just an example).
If toNyx, darkbluefirefly, pushedx, ExVault, or any of the other regular devs around here want to weigh on the correct settings for these things, would appreciate it. As of now, i see no difference between true/false and removing the await DisableAlwaysHighlight.