Untested, but should work
void RewardPartyXP(int XP, object oTarget,int bAllParty=TRUE)
{
if (bAllParty == TRUE)
{
object oPartyMember = GetFirstFactionMember(oTarget, TRUE);
while (GetIsObjectValid(oPartyMember) == TRUE)
{
//Only give XP to party members in the same area
if( GetArea( oPartyMember) == GetArea( oTarget)) GiveXPToCreature( oPartyMember, XP);
oPartyMember = GetNextFactionMember(oTarget, TRUE);
}
}
else
{
GiveXPToCreature(oTarget, XP);
}
}
void main()
{
object oPC = GetLastOpenedBy();
effect eEffect = EffectVisualEffect(VFX_FNF_IMPLOSION, FALSE);
location lLoc = GetLocation(OBJECT_SELF);
RewardPartyXP(50000, oPC, TRUE);
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, eEffect, lLoc, 0.0f);
DestroyObject(OBJECT_SELF, 0.0f)
}