This function can be usefull for your profiles, return the number of players having same target as you:
Code:
function Pressure(t)
local pressure = 1
local group = "party"
local members = GetNumPartyMembers()
if GetNumRaidMembers() > 0 then group = "raid" members = GetNumRaidMembers() pressure = pressure -1 end
for i = 1, members do
local member = group..tostring(i)
if UnitGroupRolesAssigned(member) ~= "HEALER" and UnitIsUnit(t,member..t) and not UnitIsDeadOrGhost(member)
then pressure = pressure + 1 end
end
return pressure
end
Why we need this?
We dont want to cast DoTs when the unit is about to die. To solve this next code can be used
Code:
if UnitHealth("target") > UnitHealthMax("player") then return true end
Wont cast spell if target current hp is lower than player max hp.
Scenario: Our char max hp is 140k and we dps a mob with 1000k. Playing a Hunter MM we cast Serpent Sting on the target, but if DoT expires when 140k left on him dont want to cast DoT again because he ll die to fast to make it worth. This value works fine when we are playing solo, but depend number on people in group target ll die faster, to solve this done the function above to use this way...
Code:
if UnitHealth("target") > UnitHealthMax("player")*Pressure("target") then return true end
Some example data with a character havin 140k hp:
Playing solo wont cast spell if target goes below 140k hp
Playing on a party, 4 players have same target as you: 140*4 = 560k
Playing on a 10 man raid: 7 players have same target as you: 140*7 = 980k
Player on a 25 man raid: 19 players have same target as you: 140*19 = 2660k