RewardPartyXP(int, object, int)

Gives experience to a PC and (optionally) all party members.

void RewardPartyXP(
    int nXP,
    object oTarget,
    int bAllParty = TRUE
);

Parameters

nXP

Amount of XP to award.

oTarget

Object to award XP.

bAllParty

If TRUE, award XP to all party members. (Default: TRUE)


Description

If bAllParty is FALSE, this is equivalent to GiveXPToCreature(XP, oTarget);

If bAllParty is TRUE, this function cycles through oTarget's faction (party) and awards XP to each party member.



Remarks

XP is awarded equally to each party member, not divided between them.

You cannot use a negative number for nXP. Instead, use SetXP for all party members.


Requirements

#include "nw_i0_tool"

Version

1.61

Example

#include "nw_i0_generic"
#include "nw_i0_tool"

// Area OnEnter script
// (perhaps if entry is only gained by some difficult 
// encounter or serious cunning).
//
// Rewards the PC and every party member with the XP
// set in the Journal editor.
void main() 
{
     object oPC = GetEnteringObject();
     if (! GetIsPC(oPC)) return;
     RewardPartyXP(GetJournalQuestExperience("hard_to_reach"), oPC, TRUE);
}

See Also

functions: AddJournalQuestEntry | GiveXPToCreature
categories: Experience Functions | Party Functions | PC Only Functions


 author: Iskander Merriman, editor: Lilac Soul, additional contributor(s): Lilac Soul