There isn't one. You have to do it thru the OnDeath event of the creatures. When they die, set an object type variable on the encounter to keep track of the last player to kill one of the encounter spawns. If a pet makes the kill you should determine who his master is first and use that. When OnExhausted fires, the variable will be pointing to the PC (or master if it was a pet) who killed the last one. So simply read the PC from the variable, give him his XP, then destroy the variable for the next time the encounter spawns (assuming it repeats).
Of course in MP, if there are 2 PCs and one of them kills 6 of the 7 creatures spawned and then the other PC kills the last one, the second PC will get credit for the whole encounter even though he did hardly anything compared with the first guy...so IMHO that isn't a particularly fair thing to do, and it would encourage players to put little effort into the battle until only one is left because that's where all the XP is. More PCs = more complex to determine who did the most work. Also, unless all the monsters are identical, the last one killed may or may not have been the toughest one, so that adds another level of complexity to it. Because of this, in MP I would advise against trying to figure out who should get credit for the whole encounter. Just award everyone in the area the same amount if you must award XP for killing them all.
Since you're doing SP the simplest way to handle it is GetFirstPC and there is no good reason not to do that in SP I can think of.
Modifié par Axe_Murderer, 12 juillet 2011 - 05:50 .