RewardXP

From NWN Lexicon
Jump to: navigation, search



RewardXP(string, int, object, int, int)

Gives the designated XP to the PC and possible their party using the design rules for XP distribution.

void RewardXP(
    string sJournalTag,
    int nPercentage,
    object oTarget,
    ALIGNMENT_NEUTRAL,
    int bAllParty = TRUE
);

Parameters

sJournalTag

The tag of the journal that has been compeleted and stores the XP potential.

nPercentage

The percentage of the XP to award. (100 for 100%)

oTarget

The PC (and their party possible) to award the XP to.

nQuestAlignment

ALIGNMENT_NEUTRAL )

bAllParty

If all party members should receive experience. (Default: TRUE)


Description

Gives the XP indicated in the journal with the tag sJournalTag to oTarget and if bAllParty is TRUE will give the XP to oTarget's party taking into consideration the alignment of the characters and the alignment of the quest indicated by nQuestAlignment.



Remarks

The PC receives 100% of the experience if they or the quest is of neutral alignment (the default alignment for a quest is neutral); otherwise the PC receives 125% of the experience if they are of the correct alignment (matching the quest's alignment) and 75% if they are of the wrong alignment.


Requirements

#include " nw_i0_plot "

Version

1.61

See Also

constants: 

ALIGNMENT_* Constants



 author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Jonathan Williams