Thread Tools Display Modes
05-17-06, 03:52 AM   #1
GizmoC
A Murloc Raider
Join Date: May 2006
Posts: 5
TOTAL health of every party in a raid

Hello

I am new to the modding scene.

Suppose I have a raid, everytime the RAID_ROSTER_UPDATE event is fired, I want to calculate the TOTAL health of each party.

My problem is that the UnitHealth(raidN) does not take into consideration which party "raidN" is in.

So for instance, suppose I have a raid of just 2 people. If one person is in Group1 and the other is in Group5; the raid index of player1 will be raid1 and the raid index of player2 will be raid2.
Ideally, I would like the raid index to exactly correspond to where they are placed inside the raid. That is, if player1 was the first member of Group1 then his raid index would be raid1, whereas, if player2 was the first member of Group2 his raid index would be raid6

Anyway, you get the idea.. I hope.

Appreciate the help
  Reply With Quote
05-17-06, 05:30 AM   #2
wereHamster
A Black Drake
 
wereHamster's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 80
Originally Posted by GizmoC
My problem is that the UnitHealth(raidN) does not take into consideration which party "raidN" is in.
http://www.wowwiki.com/API_GetRaidRosterInfo

Originally Posted by GizmoC
So for instance, suppose I have a raid of just 2 people. If one person is in Group1 and the other is in Group5; the raid index of player1 will be raid1 and the raid index of player2 will be raid2.
Ideally, I would like the raid index to exactly correspond to where they are placed inside the raid. That is, if player1 was the first member of Group1 then his raid index would be raid1, whereas, if player2 was the first member of Group2 his raid index would be raid6
you can't change the unitIDs or raid indexes.
  Reply With Quote
05-17-06, 06:05 AM   #3
GizmoC
A Murloc Raider
Join Date: May 2006
Posts: 5
One more thing,

I want my mod to be able to detect if a player in the raid dies, and then check if that player was a Priest.
Any ideas?
  Reply With Quote
05-17-06, 06:10 AM   #4
GizmoC
A Murloc Raider
Join Date: May 2006
Posts: 5
nm.....dfdgfdfg

Last edited by GizmoC : 05-17-06 at 06:24 AM.
  Reply With Quote
05-17-06, 07:05 AM   #5
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
The raid unit id appears to follow the roster index too btw. I haven't done enough with the raid UI to say for sure. But you could do:

raidGroupHealth = {}
raidGroupHealthMax = {}

local group
for i=1,GetNumRaidMembers() do
_,_,group = GetRaidRosterInfo(i)
raidGroupHealth[group] = (raidGroupHealth[group] or 0) + UnitHealth("raid"..i)
raidGroupHealthMax[group] = (raidGroupHealthMax[group] or 0) + UnitHealthMax("raid"..i)
end

For detecting when players die, there is unfortunately no easy solution. You can watch combat log but it won't catch someone dying far away. One solution is an OnUpdate that periodically checks if anyone is dead (it wouldn't have to check often). Another if everyone is required to use the mod is to send info over a shared chat channel when a person dies. Maybe the best solution is a UNIT_HEALTH event and check if UnitIsDeadOrGhost(arg1).

Last edited by Gello : 05-17-06 at 09:00 AM.
  Reply With Quote
05-17-06, 09:25 AM   #6
GizmoC
A Murloc Raider
Join Date: May 2006
Posts: 5
Originally Posted by Gello
... Another if everyone is required to use the mod is to send info over a shared chat channel when a person dies...
That is exactly what I was thinking.

Is there a way I can make my mod subscribe to the CTRaidAssist channel, and then "scan" the channel for any message that indicates a player death?
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » TOTAL health of every party in a raid


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off