PoA_PRC8/_module/_removed files/everpclevelup.nss
Jaysyn904 151d074880 Added "Removed Files" folder
Added "Removed Files" folder in case we needed to review any of them.
2022-10-10 10:39:34 -04:00

163 lines
6.0 KiB
Plaintext

//Script Name: everpclevelup
//////////////////////////////////////////
//Created By: Genisys (Guile)
//Created On: 5/20/08 (Updated 8/10/08)
/////////////////////////////////////////
/*
This OnPlayerLevelUp Module Event script
must be in your Module Event, it does
quite a few things when the PC levels
up, and there are optional settings
below, so please read this fully!
*/
////////////////////////////////////////
//Some of the functions below are other
//scripters work & bioware functions
///////////////////////////////////////
//Required Include (Do not touch!)
#include "fky_chat_inc"
//////////////////////////////////////////////////
//PROTOTYPE DECLARED
void SendMessageToAllPC(string sMessage);
//Main Script
void main()
{
//Declare Major Variables
object oPC = GetPCLevellingUp();
object oPP = oPC;
object oTarget;
oTarget = oPC;
int nInt;
nInt = GetObjectType(oTarget);
int nHD = GetHitDice(oPC);
effect eEffect;
location lSaved = GetLocation(oPP);
//If it's not a PC stop the script
if (!GetIsPC(oPC)) return;
//////////////SIMTOOLS//////////////////////////////////////////////////////
//If you are not using sim tools, then delete the // below this line
// /*
//These functions are for SimTools by FunkySwerve (Higher Ground)
if (ENABLE_LANGUAGES)//check to see if they gained a level in a language class, and if so, add that language
{
object oPC = GetPCLevellingUp();
if (USING_NWNX_DB)
{
if ((GetLevelByClass(CLASS_TYPE_RANGER, oPC) || GetLevelByClass(CLASS_TYPE_DRUID, oPC)) && (!GetLocalInt(oPC, "FKY_CHAT_LANG37")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG37", TRUE);
SetPersistentInt(oPC, "FKY_CHAT_LANG37", TRUE);
}
if (GetLevelByClass(CLASS_TYPE_ROGUE, oPC) && (!GetLocalInt(oPC, "FKY_CHAT_LANG44")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG44", TRUE);
SetPersistentInt(oPC, "FKY_CHAT_LANG44", TRUE);
}
if (GetLevelByClass(CLASS_TYPE_ASSASSIN, oPC) && (!GetLocalInt(oPC, "FKY_CHAT_LANG5")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG5", TRUE);
SetPersistentInt(oPC, "FKY_CHAT_LANG5", TRUE);
}
if (GetLevelByClass(CLASS_TYPE_DRUID, oPC) && (!GetLocalInt(oPC, "FKY_CHAT_LANG14")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG14", TRUE);
SetPersistentInt(oPC, "FKY_CHAT_LANG14", TRUE);
}
}
else
{
object oStorage = GetItemPossessedBy(oPC, TAG_OF_LANGUAGE_STORAGE_OBJECT);
if ((GetLevelByClass(CLASS_TYPE_RANGER, oPC) || GetLevelByClass(CLASS_TYPE_DRUID, oPC)) && (!GetLocalInt(oPC, "FKY_CHAT_LANG37")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG37", TRUE);
SetLocalInt(oStorage, "FKY_CHAT_LANG37", TRUE);
}
if (GetLevelByClass(CLASS_TYPE_ROGUE, oPC) && (!GetLocalInt(oPC, "FKY_CHAT_LANG44")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG44", TRUE);
SetLocalInt(oStorage, "FKY_CHAT_LANG44", TRUE);
}
if (GetLevelByClass(CLASS_TYPE_ASSASSIN, oPC) && (!GetLocalInt(oPC, "FKY_CHAT_LANG5")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG5", TRUE);
SetLocalInt(oStorage, "FKY_CHAT_LANG5", TRUE);
}
if (GetLevelByClass(CLASS_TYPE_DRUID, oPC) && (!GetLocalInt(oPC, "FKY_CHAT_LANG14")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG14", TRUE);
SetLocalInt(oStorage, "FKY_CHAT_LANG14", TRUE);
}
}
}
// DON'T TOUCH THIS LINE! */
///////////PLAYER LOCATION SAVING////////////////////////////////////////
//These functions save the location of the player, the control for this
//option are in the "startingjump" script which must go in your loading
//area for your module's starting area..
//Store the PC's current location..
//Type // at the start of both functions below to deactive it.
SetCampaignLocation(GetName(GetModule()), "SAVED_LOC", lSaved, oPP);
//Tell the PC thier location was saved..
SendMessageToPC(oPC, "Location Saved.");
////////////AUTOMATIC CHARACTER SAVING ON LEVEL UP OPTION///////////////////
//Delete the // on the next 2 lines below to activate Automatic Character Saving.
// DelayCommand(2.0, ExportSingleCharacter(oPC));
// FloatingTextStringOnCreature("Your character was saved!", oPC);
//////////////////////////////////////////////////////////////////////////////
if(nHD == 5 || nHD == 10 || nHD == 15 || nHD == 20 ||
nHD == 25 || nHD == 30 || nHD == 35 || nHD == 40)
{
SendMessageToAllPC(GetName(oPC) + " has reached level " + IntToString(nHD)
+ " Congratulations!");
if(nHD == 40)
{
//Lets make them concealed 40%
eEffect = EffectConcealment(40);
eEffect = SupernaturalEffect(eEffect);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);
//Make all level 40 PCs glow like a ghost
ApplyEffectToObject(DURATION_TYPE_PERMANENT,
SupernaturalEffect(EffectVisualEffect(VFX_DUR_GLOW_WHITE)), oPC);
}
}
//Apply a visual effect of knock each time a PC levels up :)
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_KNOCK), oTarget);
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_KNOCK), GetLocation(oTarget));
//////////////ANTI-CHEATING OPTION/////////////////////////////////////////
//This function scans the PC who just leveled up to see if they are playing
//a legal character or not, just delete the // below to use
//DelayCommand(2.0, ExecuteScript("cheatercheck4", oPC));
////////////////////////////////////////////////////////////////////////////
//Main Script End
}
//PROTOTYPE DEFINED
void SendMessageToAllPC(string sMessage)
{
object oPC = GetFirstPC();
while(GetIsObjectValid(oPC))
{
SendMessageToPC(oPC, sMessage);
oPC = GetNextPC();
}
}