2025/12/15 Update

Updated PEPS.
Added respawn pop-up for petrification.
Updated Markshire Nomeclature for NPC names / titles.
Hooked up new PRC8 GUI event.
Updated nim tools.
This commit is contained in:
Jaysyn904
2025-12-15 20:29:46 -05:00
parent 718217b291
commit 7598075698
365 changed files with 19309 additions and 15702 deletions

View File

@@ -4,7 +4,7 @@
// ms_name_inc.nss //
// //
// By Thrym of Markshire 5/21/06 //
// Updated by: Jaysyn 2021/12/03 //
// Updated by: Jaysyn 2025-09-04 21:26:03 //
// //
////////////////////////////////////////////////////////////////////////////////
/*
@@ -60,12 +60,10 @@
#include "prc_inc_racial"
///// FUNCTION DECLARATIONS ////////////////////////////////////////////////////
//:: Function to get the class type with the highest level
int GetHighestClassType(object oCreature);
int GetHighestClassType(object oNPC = OBJECT_SELF);
//:: Returns class level based NPC titles
string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF);
@@ -91,9 +89,25 @@ void ms_Nomenclature(object oNPC = OBJECT_SELF);
///// FUNCTIONS ////////////////////////////////////////////////////////////////
// Function to get the name of a class
string GetClassName(int nClass)
{
// Look up the StrRef as a string in spells.2da
string sStrRef = Get2DAString("classes", "Name", nClass);
// Convert to an integer
int nStrRef = StringToInt(sStrRef);
// Look up the name in the dialog.tlk file
string sClassName = GetStringByStrRef(nStrRef);
// return the spell's name
return sClassName;
}
void ms_Nomenclature(object oNPC = OBJECT_SELF)
{
string sRandomName = GetLocalString(oNPC, "SET_NAME");
string sRandomName = GetLocalString(oNPC, "SET_NAME");
string sTitle = GetLocalString(oNPC, "TITLE");
string sPostfix = GetLocalString(oNPC, "POSTFIX");
string sBaseRace = GetLocalString(oNPC, "BASE_RACE");
@@ -101,14 +115,17 @@ void ms_Nomenclature(object oNPC = OBJECT_SELF)
int bClassTitle = GetLocalInt(oNPC,"CLASS_TITLE");
//:: Handles class level based NPC titles
if (bClassTitle)
{
int nClassType = GetHighestClassType(oNPC);
sClassTitle = GetClassLevelTitle(nClassType, oNPC);
string sClassName = GetClassName(nClassType);
FloatingTextStringOnCreature("Title: " + sClassTitle, oNPC);
sRandomName = sBaseRace +" "+ sClassTitle;
DelayCommand(0.0f, SetName(oNPC, (sRandomName)));
return;
}
//:: Handles class based Henchman titles
@@ -966,7 +983,7 @@ void ms_Nomenclature(object oNPC = OBJECT_SELF)
if (sRandomName != "")
{
if (sRandomName == "RANDOM")
if (sRandomName == "RANDOM")
{
switch (GetLocalInt(oNPC, "NAME_TYPE"))
{
@@ -974,13 +991,8 @@ void ms_Nomenclature(object oNPC = OBJECT_SELF)
default: sRandomName = sTitle + " " + ms_RandomFirstName(oNPC) + " " + sPostfix; break;
}
}
if (bClassTitle)
{
sRandomName = sBaseRace +" "+ sClassTitle;
}
SetName(oNPC, (sRandomName));
DelayCommand(0.0f, SetName(oNPC, (sRandomName)));
return;
}
}
@@ -1053,64 +1065,71 @@ string ms_RandomLastName(object oNPC = OBJECT_SELF)
return Name;
}
//:: Function to get the class type with the highest level
int GetHighestClassType(object oCreature)
// Returns the class constant (int) for the creature's highest class by level.
// Skips racial type pseudo-classes. Returns -1 if none.
int GetHighestClassType(object oNPC = OBJECT_SELF)
{
int nHighestLevel = -1;
int nHighestClass = -1;
int nClassTypes = 254; // maximum
object oPC = GetFirstPC();
if (!GetIsObjectValid(oNPC)) return -1;
int i = 0;
while (i <= nClassTypes)
int nBestClass = -1;
int nBestLevel = -1;
int i;
int nClass;
int nLevel;
int nMaxClasses = 254;
i = 1;
while (i <= nMaxClasses)
{
// Exclude racial/monster pseudo-classes
if (i == CLASS_TYPE_ABERRATION ||
i == CLASS_TYPE_ANIMAL ||
i == CLASS_TYPE_BEAST ||
i == CLASS_TYPE_CONSTRUCT ||
i == CLASS_TYPE_DRAGON ||
i == CLASS_TYPE_ELEMENTAL ||
i == CLASS_TYPE_FEY ||
i == CLASS_TYPE_GIANT ||
i == CLASS_TYPE_HUMANOID ||
i == CLASS_TYPE_MAGICAL_BEAST ||
i == CLASS_TYPE_MONSTROUS ||
i == CLASS_TYPE_OOZE ||
i == CLASS_TYPE_OUTSIDER ||
i == CLASS_TYPE_PLANT ||
i == CLASS_TYPE_SHAPECHANGER ||
i == CLASS_TYPE_UNDEAD ||
i == CLASS_TYPE_VERMIN)
nClass = GetClassByPosition(i, oNPC);
if (nClass != -1)
{
i++;
continue;
}
int nLevel = GetLevelByClass(i, oCreature);
if (nLevel > 0)
{
if (nLevel > nHighestLevel)
// skip racial types
if (nClass == CLASS_TYPE_ABERRATION ||
nClass == CLASS_TYPE_ANIMAL ||
nClass == CLASS_TYPE_BEAST ||
nClass == CLASS_TYPE_CONSTRUCT ||
nClass == CLASS_TYPE_DRAGON ||
nClass == CLASS_TYPE_ELEMENTAL ||
nClass == CLASS_TYPE_FEY ||
nClass == CLASS_TYPE_GIANT ||
nClass == CLASS_TYPE_HUMANOID ||
nClass == CLASS_TYPE_MAGICAL_BEAST ||
nClass == CLASS_TYPE_MONSTROUS ||
nClass == CLASS_TYPE_OOZE ||
nClass == CLASS_TYPE_OUTSIDER ||
nClass == CLASS_TYPE_PLANT ||
nClass == CLASS_TYPE_SHAPECHANGER ||
nClass == CLASS_TYPE_UNDEAD ||
nClass == CLASS_TYPE_VERMIN)
{
nHighestLevel = nLevel;
nHighestClass = i;
// skip
}
else
{
nLevel = GetLevelByClass(nClass, oNPC);
if (nLevel > nBestLevel)
{
nBestLevel = nLevel;
nBestClass = nClass;
}
}
}
i++;
i = i + 1;
}
if (nHighestClass != -1)
{
FloatingTextStringOnCreature("Highest Level class is " + IntToString(nHighestClass) +
" at level " + IntToString(nHighestLevel) + ".", oCreature);
}
return nHighestClass;
return nBestClass;
}
//:: Returns class level based NPC titles
string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF)
{
string sTitle;
object oPC = GetFirstPC();
string sTitle;
int nLevel = GetLevelByClass(nClassType, oNPC);
int nGender = GetGender(oNPC);
@@ -1842,4 +1861,4 @@ string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF)
return sTitle;
}
//::void main (){}
//::void main (){}