Alangara_PRC8/_module/nss/mn_xprod_award.nss
Jaysyn904 86feb9ca6f Initial commit
Initial commit.
2024-06-05 21:21:06 -04:00

31 lines
878 B
Plaintext

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" );
}