PlotCanRemoveXP

From NWN Lexicon


Contents

[edit] plotCanRemoveXP(int)

Returns TRUE if the player can afford to lose the indicated amount of XP without losing a level.

void plotCanRemoveXP(
    object oPC
    int nPenalty
);

[edit] Parameters

oPC

The character to check.

nPenalty

The amount of XP to check against.


[edit] Description

Returns TRUE if the player can afford to lose the indicated amount of XP without losing a level. Otherwise it returns FALSE.



[edit] Remarks

The formula this function tests against is: ((nHD * (nHD - 1)) / 2) * 1000; With nHD being oPC's hit dice .


[edit] Requirements

#include " nw_i0_plot "


[edit] Version

???

[edit] Example

// Lets' see if OBJECT_SELF can lose 5322 points of xp.
#include "nw_i0_plot"
 
void main()
{
   int nCheck = plotCanRemoveXP(OBJECT_SELF, 5322);
 
   if(TRUE == nCheck)
   {
      // Do stuff based on the fact the can lose the xp without losing a level.
   }
   else
   {
      // Do stuff based on the fact that they will lose a level if they lose the xp.
   }
}

[edit] See Also

functions: 

GetHitDice



author: Baragg, editors: Mistress, Kolyana

Personal tools
Categories