It's going to be something like this:
//oKiller being the player who killed some creature
object oKiller = WHATEVER KILLED SOMETHING, HOWEVER YOU GET THAT;
location lKiller = GetLocation(oKiller);
//Finding objects near the player that killed something
object oParty = GetFirstObjectInShape(SHAPE_SPHERE, fRadius, lKiller);
while(GetIsObjectValid(oTarget))
{
//If the object is a player
if(GetIsPC(oTarget))
{
//If the player is not an enemy
if(GetIsReactionTypeFriendly(oParty) || GetIsReactionTypeNeutral(oParty))
{
//If you want to do things like figure out who the highest level character is, party average level or whatever, you need to do it in this loop.
//This first loop is for collecting information.
}
}
oParty = GetNextObjectInShape(SHAPE_SPHERE, fRadius, lTarget);
}
//Loop again with the same rules
oParty = GetFirstObjectInShape(SHAPE_SPHERE, fRadius, lKiller);
while(GetIsObjectValid(oTarget))
{
if(GetIsPC(oTarget))
{
if(GetIsReactionTypeFriendly(oParty) || GetIsReactionTypeNeutral(oParty))
{
//Give experience based on your scaling rules or whatever.
}
}
oParty = GetNextObjectInShape(SHAPE_SPHERE, fRadius, lTarget);
}
Our system takes other things into consideration such as whether or not the player could perceive the enemy when it died, so if the player is blinded they cannot receive experience, but that is the basic structure of what you're going to be looking at.