Jump to content

Looking for assistance with a method idea


Apexx

Recommended Posts

Hey everyone, I am in need of some big brained math experts to possibly help me translate some information to a C# method. 
I have here some bits and pieces of the Ovale Spell Priority addon, and I like the idea that used for the Shadow Priest's DoTs to check if the target will die in a certain time?:

TargetDeadIn(more 6)

Looking into the Lua files, I find the function inside Condition.lua:

	TargetDeadIn = function(condition)
		local deadAt = getTargetDead()
		if condition[1] == "more" then
			return 0, addTime(deadAt, -condition[2])
		else
			return addTime(deadAt, -condition[2]), nil
		end
	end,

as well as

local function getTargetDead()
	local second = math.floor(Ovale.maintenant)
	if targetGUID~=UnitGUID("target") then
		lastSaved = nil
		targetGUID = UnitGUID("target")
		savedHealth = {}
	end
	local newHealth = UnitHealth("target")
	if UnitHealthMax("target")==1 then
		return Ovale.maintenant + 10000
	end
	if second~=lastSaved and targetGUID then
		lastSaved = second
		local mod10 = second % 10
		local prevHealth = savedHealth[mod10]
		savedHealth[mod10] = newHealth
		if prevHealth and prevHealth>newHealth then
			lastSPD = 10/(prevHealth-newHealth)
--			print("dps = " .. (1/lastSPD))
		end
	end
	-- Rough estimation
	return Ovale.maintenant + newHealth * lastSPD
end

If you have any input, I would love to see what you have to say, and thanks for reading!

Edited by Apexx
Link to comment
Share on other sites

11 hours ago, Talamin said:

could you be more specific what the point is behind this? You want to estimate if it´s worth to reapply your Dots on a Target? 

That is what the function above checks for, yes.

Link to comment
Share on other sites

hmm, your Spells have a Base Damage per Tick. 

I would take the Basedamage and compare it to the actual health. Let´s say you have a Target with 1000 Health, but the Basedamage of your ShadowWord: Pain is 300 per Tick (total of 5 Ticks) it´s not worth to cast it. On the other side, when you "wand" the target down like every SPriest does while leveling, a DoT comes in Hand. So in General, there are different Ways to Achieve what you want:
1. Read the dmg Output out of Combatlog of the Spell you desire and compare this against the enemy health
2. Calculate the Base Damage of the Spell you want to see and compare this against the enemy health
3. Limit your Dot´s, compared to the Health again, flat to the kind of Mob you are Facing (Normal Grind, Trash in Dungeon, Bossfight in Dungeon)

4. Maybe some more...

Actually i try to understand the Point of the Addon above. In the AIO we did Point 3. We checked for the kind of Target we have actually and this is the Trigger for the Rotation. Like in ShadowWord:Pain (Bossfight: Ignore Health, Trashmobs in Dungeon: 5%, Grindmobs outside Dungeon 30% <-- Because we Wand them down). 

Hope i could give you a rough idea what i am talking about. If you need something more specific, let me know.

Link to comment
Share on other sites

  • 5 months later...

Looking back at this thread today and here is a rough method that I came up with:

public float TargetTimeToDie;

private double damagePerSecond;
private double targetPreviousHealth;
private Timer timerDPS = new robotManager.Helpful.Timer(1000);

 

private void FightEvents_OnFightLoop(WoWUnit unit, System.ComponentModel.CancelEventArgs cancelable)
{
    if (timerDPS.IsReady)
    {
        if (ObjectManager.Target.Health < targetPreviousHealth)
        {
            //How much damage was done since the last second
            //Helpers.LogDebug($"targetCurrentHealth({ObjectManager.Target.Health}) - previousHealth({previousHealth})");
            damagePerSecond = System.Math.Abs(targetPreviousHealth - ObjectManager.Target.Health);

            TargetTimeToDie = (float)System.Math.Round(ObjectManager.Target.Health/ damagePerSecond, 1);
            Helpers.LogDebug($"Target will die in ~{TargetTimeToDie} second(s).");
        }
        targetPreviousHealth = ObjectManager.Target.Health;
    }
}

 

Usage (Maybe you do not want to use large cooldowns on the target if they will die in such time. Or do not place totems, etc..):

if (TargetTimeToDie < 10.0f) return;
Edited by Apexx
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...