void main() { object oUser = OBJECT_SELF; int xpAmount = GetLocalInt( oUser, "MN_GRANTXP" ); object oTarget = GetLocalObject( oUser, "MN_XPTARGET" ); int party = GetLocalInt( oUser, "MN_PARTY" ); if (party) { object oPartyMember; oPartyMember=GetFirstFactionMember(oTarget, TRUE); while (GetIsObjectValid(oPartyMember)==TRUE) { GiveXPToCreature(oPartyMember, xpAmount); SendMessageToPC(oPartyMember, "You have been granted "+ IntToString(xpAmount)+ " XP."); oPartyMember = GetNextFactionMember(oTarget, TRUE); } } else { GiveXPToCreature( oTarget, xpAmount ); SendMessageToPC(oTarget, "You have been granted "+ IntToString(xpAmount)+ " XP."); } DeleteLocalInt( oUser, "MN_GRANTXP" ); DeleteLocalObject( oUser, "MN_XPTARGET" ); DeleteLocalInt( oUser, "MN_PARTY" ); }