RewardPartyXP

From NWN Lexicon



Contents

[edit] RewardPartyXP(int, object, int)

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

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

[edit] Parameters

nXP

Amount of XP to award.

oTarget

Object to award XP.

bAllParty

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


[edit] 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.



[edit] 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.


[edit] Requirements

#include " nw_i0_tool "

[edit] Version

1.61

[edit] Example

<nowiki>#include "nw_i0_generic"
</nowiki>#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);
}

[edit] See Also

functions: 

GiveXPToCreature



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

Personal tools
Categories