Fixed missing Factions on Animated Statues. Added XP to next level for lvl 40+ characters. Added Dragon AI for CODI Core AI. Tweaked Beholders & some Dragons to use CODI Core AI. Fixed CODI Core NPC onSPawn script to run PRC scripts properly. Full compile. Updated release archive.
83 lines
1.9 KiB
Plaintext
83 lines
1.9 KiB
Plaintext
////////////////////////////////////
|
|
//Created by Genisys / Guile 5/08/08
|
|
////////////////////////////////////
|
|
/*
|
|
|
|
XP Bank (Not an original concept)
|
|
|
|
This script goes in the Action Taken
|
|
event of my DM Conversation to store
|
|
XP in the database for the Player to
|
|
retrieve with any character, in case
|
|
they totally messed up their
|
|
character.
|
|
(Cost 1% of XP and 500 Gp / Level)
|
|
|
|
*/
|
|
////////////////////////////////////
|
|
|
|
void main()
|
|
{
|
|
//Declare Major Variables
|
|
object oPC;
|
|
oPC = GetPCSpeaker();
|
|
int cGold = GetGold(oPC);
|
|
int nLvl = GetHitDice(oPC);
|
|
int nGold = 0; //nLvl * 500;
|
|
int cXP = GetXP(oPC);
|
|
int pXP = (cXP / 100) * 99; //99%
|
|
|
|
|
|
//If the PC has enough gold...
|
|
if(cXP >1)//cGold>nGold)
|
|
{
|
|
//If the PC has at least 100 XP (Required to prevent an error)
|
|
if(pXP > 99)
|
|
{
|
|
//Note this is set for multiplayer, use the script setxp2 for single player!
|
|
string pCD = GetPCPublicCDKey(oPC, FALSE);
|
|
|
|
//Just in case the PC loses thier xp/gold let's write a log entry!
|
|
WriteTimestampedLogEntry("The following Player Has Used the DM Globe" +
|
|
"to store XP / " + GetPCPlayerName(oPC) + "/ " + IntToString(pXP));
|
|
|
|
int rXP = GetCampaignInt("STORED_XP", GetPCPublicCDKey(oPC), GetModule());
|
|
|
|
//////TEMPORARY///////
|
|
int tXP = cXP + rXP; //rXP + pXP;
|
|
|
|
//Store thier XP information first in a nwn database file!
|
|
SetCampaignInt("STORED_XP", GetPCPublicCDKey(oPC), tXP, GetModule());
|
|
|
|
//Take all the player's XP
|
|
SetXP(oPC, 0);
|
|
|
|
//Let's make sure the character is saved!!!!
|
|
DelayCommand(1.0, ExportSingleCharacter(oPC));
|
|
|
|
//Then boot the PC..
|
|
DelayCommand(5.0, BootPC(oPC));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
//If they PC doesn't have enough XP..
|
|
if(pXP<99)
|
|
{
|
|
FloatingTextStringOnCreature("You don't have enough XP!", oPC);
|
|
}
|
|
//If the PC doesn't have enough gold..
|
|
else if(cGold<nGold)
|
|
{
|
|
FloatingTextStringOnCreature("You don't have enough gold!", oPC);
|
|
}
|
|
//In case of errors..
|
|
else
|
|
{
|
|
FloatingTextStringOnCreature("Please notify a DM that there is an error" +
|
|
" with the XP Bank.", oPC);
|
|
}
|
|
}
|
|
//Script End
|
|
}
|