Added and activated PRCX. Removed unneeded creature ability scripts. Updated Nomeclature library. Full compile.
1099 lines
41 KiB
Plaintext
1099 lines
41 KiB
Plaintext
////////////////////////////////////////////////////////////////////////////////
|
|
// //
|
|
// Markshire's Nomenclature //
|
|
// ms_name_inc.nss //
|
|
// //
|
|
// By Thrym of Markshire 5/21/06 //
|
|
// Updated by: Jaysyn 2026-02-11 13:29:20 //
|
|
// //
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
/*
|
|
// FUNCTION:
|
|
// The Nomenclature is an include file placed in the spawn script
|
|
// nw_c2_default9 designed to assign a name to a generic NPC who may
|
|
// wander towns, roads, shops, etc.
|
|
//
|
|
// Utilizing both SetName and RandomName the system will name the NPC in
|
|
// one of two ways ...
|
|
//
|
|
// "SET_NAME": By setting the variable "SET_NAME" on the NPC and
|
|
// assigning it a string the creature will rename itself upon spawning.
|
|
// This is handy for DM's and builders to create more precisely named
|
|
// creatures for the palette and then generize them upon spawn.
|
|
//
|
|
// eg. Ancient White Dragon in the Creator becomes White Dragon on Spawn.
|
|
//
|
|
// "SET_NAME" = "RANDOM": By setting the same variable to the name "RANDOM"
|
|
// the NPC then is given a random name generated by RACE and GENDER using
|
|
// the RandomName function.
|
|
//
|
|
// eg. Male Dwarven Villager in the Aurora Toolset becomes Gloigan on spawn
|
|
// this time and perhaps Rufus on the next spawned Villager.
|
|
//
|
|
// "NAME_TYPE": Setting this int variable to "1" will cause a Full Name
|
|
// to be generated if the "SET_NAME" is set to "RANDOM".
|
|
//
|
|
// eg. Male Dwarven Villager becomes Gloigan Stonecutter or Rufus Mason.
|
|
//
|
|
// "TITLE": Prepends the defined string to the NPCs name.
|
|
//
|
|
// eg. "Lord" Brown
|
|
//
|
|
// "POSTFIX": Appends the defind string after the NPC's name.
|
|
//
|
|
// eg. Ralph "the Guard"
|
|
//
|
|
|
|
|
|
"RND_ROGUE"
|
|
"RND_BARBARIAN"
|
|
"RND_FIGHTER"
|
|
"RND_CLERIC" : Setting these to "1" will give the NPC a randomized class
|
|
"RND_MAGE" : appropriate postfix
|
|
"RND_DRUID"
|
|
"RND_RANGER"
|
|
|
|
|
|
//
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////*/
|
|
|
|
#include "prc_inc_racial"
|
|
|
|
///// FUNCTION DECLARATIONS ////////////////////////////////////////////////////
|
|
|
|
/**
|
|
* @brief Retrieves the localized name of a class by its class constant.
|
|
*
|
|
* This function looks up the class name from the classes.2da file and
|
|
* retrieves the localized string from the dialog.tlk file.
|
|
*
|
|
* @param nClass The class constant (e.g., CLASS_TYPE_FIGHTER)
|
|
* @return The localized class name, or an empty string if not found
|
|
*/
|
|
string GetClassName(int nClass);
|
|
|
|
/**
|
|
* @brief Returns the class constant of the creature's highest class by level
|
|
*
|
|
* This function iterates through all class positions (1-254) for the specified
|
|
* creature and identifies which class has the highest level. Racial type
|
|
* pseudo-classes are explicitly excluded from consideration.
|
|
*
|
|
* @param oNPC The creature object to examine (defaults to OBJECT_SELF)
|
|
* @return The class constant (e.g., CLASS_TYPE_FIGHTER) of the highest-level class,
|
|
* or -1 if no valid classes are found or if oNPC is invalid
|
|
*
|
|
* @note Uses GetClassByPosition() to check all 254 possible class positions
|
|
* @note Excludes racial pseudo-classes: ABERRATION, ANIMAL, BEAST, CONSTRUCT,
|
|
* DRAGON, ELEMENTAL, FEY, GIANT, HUMANOID, MAGICAL_BEAST, MONSTROUS,
|
|
* OOZE, OUTSIDER, PLANT, SHAPECHANGER, UNDEAD, VERMIN
|
|
* @note This function is used by the naming system to determine class-based titles
|
|
*/
|
|
int GetHighestClassType(object oNPC = OBJECT_SELF);
|
|
|
|
/**
|
|
* @brief Returns a level-based title for the specified class type
|
|
*
|
|
* This function generates appropriate NPC titles based on class type and level.
|
|
* Some titles are gender-specific and will vary between male and female characters.
|
|
* The function is part of the Markshire Nomenclature system for dynamic NPC naming.
|
|
*
|
|
* @param nClassType The class constant (e.g., CLASS_TYPE_FIGHTER)
|
|
* @return A string containing the level-appropriate title, or empty string if not found
|
|
*
|
|
* @note Assumes OBJECT_SELF is the creature being evaluated
|
|
* @note Gender-specific titles use ternary operators for compactness
|
|
* @note Sorcerer and Wizard classes share identical title progressions
|
|
* @note Ranger class has repeating titles at higher levels (21-29 repeat 11-18)
|
|
*
|
|
* Supported Classes:
|
|
* - Barbarian (gender-specific at levels 6, 15, 20, default)
|
|
* - Rogue (no gender variations)
|
|
* - Bard (gender-specific at levels 4, 11, 19, 27)
|
|
* - Sorcerer/Wizard (shared progression)
|
|
* - Cleric (gender-specific at levels 9, 15, 16, 18, default)
|
|
* - Druid (no gender variations)
|
|
* - Fighter (no gender variations)
|
|
* - Monk (no gender variations, extends to level 21)
|
|
* - Paladin (no gender variations, shares Monk progression from level 11)
|
|
* - Ranger (no gender variations, cycles titles at high levels)
|
|
*/
|
|
string GetClassLevelTitle(int nClassType);
|
|
|
|
/**
|
|
* @brief Returns the highest class level of a creature, excluding racial pseudo-classes
|
|
*
|
|
* This function iterates through all possible class types (0-254) for the specified
|
|
* creature and returns the highest class level found. Racial type pseudo-classes
|
|
* are explicitly excluded from consideration.
|
|
*
|
|
* @param oCreature The creature object to examine (defaults to OBJECT_SELF)
|
|
* @return The highest class level (int), or -1 if no valid classes are found
|
|
*
|
|
* @note Iterates through all 254 possible class types
|
|
* @note Excludes racial pseudo-classes: ABERRATION, ANIMAL, BEAST, CONSTRUCT,
|
|
* DRAGON, ELEMENTAL, FEY, GIANT, HUMANOID, MAGICAL_BEAST, MONSTROUS,
|
|
* OOZE, OUTSIDER, PLANT, SHAPECHANGER, UNDEAD, VERMIN
|
|
* @note Uses early termination when GetLevelByClass() returns 0 for efficiency
|
|
* @note This function is used by the naming system to determine class-based titles
|
|
*/
|
|
int GetHighestClassLevel(object oCreature = OBJECT_SELF);
|
|
|
|
/**
|
|
* @brief Generates a random first name based on the NPC's race and gender
|
|
*
|
|
* This function selects an appropriate random first name from the game's
|
|
* name generation tables based on the creature's racial type and gender.
|
|
* Each race/gender combination maps to a specific index in the RandomName
|
|
* function's name tables.
|
|
*
|
|
* @param oNPC The creature object to generate a name for (defaults to OBJECT_SELF)
|
|
* @return A randomly generated first name string appropriate to the race and gender
|
|
*
|
|
* @note Uses MyPRCGetRacialType() for race detection to support PRC races
|
|
* @note Animals use index 0, default/fallback uses -1 for males, 0 for females
|
|
* @note Race First Name Magic Numbers:
|
|
* - Animal: 0
|
|
* - Dwarf: 2 (male), 3 (female)
|
|
* - Elf: 5 (male), 6 (female)
|
|
* - Gnome: 8 (male), 9 (female)
|
|
* - Half-Elf: 11 (male), 12 (female)
|
|
* - Halfling: 14 (male), 15 (female)
|
|
* - Half-Orc: 17 (male), 18 (female)
|
|
* - Human: 20 (male), 21 (female)
|
|
* - Default: -1 (male), 0 (female)
|
|
*/
|
|
string ms_RandomFirstName(object oNPC = OBJECT_SELF);
|
|
|
|
/**
|
|
* @brief Generates a random last name based on the NPC's race
|
|
*
|
|
* This function selects an appropriate random last name from the game's
|
|
* name generation tables based on the creature's racial type. Each race
|
|
* maps to a specific index in the RandomName function's name tables.
|
|
*
|
|
* @param oNPC The creature object to generate a name for (defaults to OBJECT_SELF)
|
|
* @return A randomly generated last name string appropriate to the race
|
|
*
|
|
* @note Uses MyPRCGetRacialType() for race detection to support PRC races
|
|
* @note Race Last Name Magic Numbers:
|
|
* - Dwarf: 4
|
|
* - Elf: 7
|
|
* - Gnome: 10
|
|
* - Half-Elf: 13
|
|
* - Halfling: 16
|
|
* - Half-Orc: 19
|
|
* - Human: 22
|
|
* - Default: 1
|
|
*/
|
|
string ms_RandomLastName(object oNPC = OBJECT_SELF);
|
|
|
|
/**
|
|
* @brief Main NPC naming function for Markshire's Nomenclature system
|
|
*
|
|
* This function handles multiple naming modes for NPCs based on local variables:
|
|
* - Fixed names via SET_NAME variable
|
|
* - Random names based on race and gender when SET_NAME="RANDOM"
|
|
* - Class-based titles via CLASS_TITLE variable
|
|
* - Random class-specific postfixes via RND_* variables
|
|
*
|
|
* @param oNPC The creature object to name (defaults to OBJECT_SELF)
|
|
*
|
|
* @note This function is typically called from spawn scripts (nw_c2_default9)
|
|
* @see ms_RandomFirstName() for random first name generation
|
|
* @see ms_RandomLastName() for random last name generation
|
|
* @see GetClassLevelTitle() for class-based titles
|
|
*
|
|
* Local Variables Used:
|
|
* - SET_NAME (string): Fixed name or "RANDOM" for random generation
|
|
* - TITLE (string): Prefix to prepend to name
|
|
* - POSTFIX (string): Suffix to append to name
|
|
* - BASE_RACE (string): Race name for class title mode
|
|
* - CLASS_TITLE (int): Enable class-based titles
|
|
* - NAME_TYPE (int): 1=full name, 0=first name only
|
|
* - RND_* (int): Enable random class postfixes (PALADIN, MONK, etc.)
|
|
*/
|
|
void ms_Nomenclature(object oNPC = OBJECT_SELF);
|
|
|
|
|
|
///// FUNCTIONS ////////////////////////////////////////////////////////////////
|
|
|
|
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 sTitle = GetLocalString(oNPC, "TITLE");
|
|
string sPostfix = GetLocalString(oNPC, "POSTFIX");
|
|
string sBaseRace = GetLocalString(oNPC, "BASE_RACE");
|
|
|
|
int nGender = GetGender(oNPC);
|
|
int bClassTitle = GetLocalInt(oNPC,"CLASS_TITLE");
|
|
int nHighClass = GetHighestClassLevel(oNPC);
|
|
int nLevel = GetLevelByClass(nHighClass, oNPC);
|
|
|
|
string sClassTitle = GetClassLevelTitle(nHighClass);
|
|
|
|
//:: Handles class level based NPC titles
|
|
if (bClassTitle)
|
|
{
|
|
int nClassType = GetHighestClassType(oNPC);
|
|
sClassTitle = GetClassLevelTitle(nClassType);
|
|
|
|
string sClassName = GetClassName(nClassType);
|
|
|
|
sRandomName = sBaseRace +" "+ sClassTitle;
|
|
DelayCommand(0.0f, SetName(oNPC, (sRandomName)));
|
|
return;
|
|
}
|
|
//:: Handles class based Henchman titles
|
|
int nRndPaladin = GetLocalInt(OBJECT_SELF, "RND_PALADIN");
|
|
if (nRndPaladin == 1)
|
|
{
|
|
int nResult = Random(30) + 1; // Generate a random number between 1 and 30
|
|
switch (nResult)
|
|
{
|
|
case 1: sPostfix = "the Righteous"; break;
|
|
case 2: sPostfix = "the Just"; break;
|
|
case 3: sPostfix = "the Defender"; break;
|
|
case 4: sPostfix = "the Virtuous"; break;
|
|
case 5: sPostfix = "the Crusader"; break;
|
|
case 6: sPostfix = "the Lightbringer"; break;
|
|
case 7: sPostfix = "the Faithful"; break;
|
|
case 8: sPostfix = "the Zealous"; break;
|
|
case 9: sPostfix = "the Beacon"; break;
|
|
case 10: sPostfix = "the Redeemer"; break;
|
|
case 11: sPostfix = "the Shield of Faith"; break;
|
|
case 12: sPostfix = "of the Sacred Flame"; break;
|
|
case 13: sPostfix = "the Lawful"; break;
|
|
case 14: sPostfix = "the Blessed"; break;
|
|
case 15: sPostfix = "the Chosen"; break;
|
|
case 16: sPostfix = "of the Holy Vow"; break;
|
|
case 17: sPostfix = "the Avenger"; break;
|
|
case 18: sPostfix = "the Purifier"; break;
|
|
case 19: sPostfix = "the Divine Hand"; break;
|
|
case 20: sPostfix = "the Sacred Blade"; break;
|
|
case 21: sPostfix = "the Lightforged"; break;
|
|
case 22: sPostfix = "the Protector"; break;
|
|
case 23: sPostfix = "the Illuminated"; break;
|
|
case 24: sPostfix = "of the Silver Oath"; break;
|
|
case 25: sPostfix = "the Guardian"; break;
|
|
case 26: sPostfix = "the Oathbound"; break;
|
|
case 27: sPostfix = "the Valiant"; break;
|
|
case 28: sPostfix = "the Seraphic"; break;
|
|
case 29: sPostfix = "the Golden Knight"; break;
|
|
case 30: sPostfix = "the True"; break;
|
|
}
|
|
}
|
|
|
|
int nRndMonk = GetLocalInt(OBJECT_SELF, "RND_MONK");
|
|
if (nRndMonk == 1)
|
|
{
|
|
int nResult = Random(30) + 1;
|
|
switch (nResult)
|
|
{
|
|
case 1: sPostfix = "the Disciplined"; break;
|
|
case 2: sPostfix = "the Enlightened"; break;
|
|
case 3: sPostfix = "of the Open Palm"; break;
|
|
case 4: sPostfix = "of the Empty Hand"; break;
|
|
case 5: sPostfix = "the Ascetic"; break;
|
|
case 6: sPostfix = "the Calm"; break;
|
|
case 7: sPostfix = "the Wayfarer"; break;
|
|
case 8: sPostfix = "the Iron Fist"; break;
|
|
case 9: sPostfix = "the Centered"; break;
|
|
case 10: sPostfix = "of the Quiet Mind"; break;
|
|
case 11: sPostfix = "the Humble"; break;
|
|
case 12: sPostfix = "the Swift Palm"; break;
|
|
case 13: sPostfix = "the Inner Flame"; break;
|
|
case 14: sPostfix = "the Master"; break;
|
|
case 15: sPostfix = "of the Lotus Path"; break;
|
|
case 16: sPostfix = "the Patient"; break;
|
|
case 17: sPostfix = "the Balanced"; break;
|
|
case 18: sPostfix = "the Serene"; break;
|
|
case 19: sPostfix = "the Watchful"; break;
|
|
case 20: sPostfix = "the Disciple"; break;
|
|
case 21: sPostfix = "the Harmonious"; break;
|
|
case 22: sPostfix = "the Seeker"; break;
|
|
case 23: sPostfix = "the Breathless"; break;
|
|
case 24: sPostfix = "the Stilled Hand"; break;
|
|
case 25: sPostfix = "of Perfect Form"; break;
|
|
case 26: sPostfix = "the Tranquil"; break;
|
|
case 27: sPostfix = "the Unbound"; break;
|
|
case 28: sPostfix = "the Silent Step"; break;
|
|
case 29: sPostfix = "the Mindful"; break;
|
|
case 30: sPostfix = "the Flowing One"; break;
|
|
}
|
|
}
|
|
|
|
int nRndRogue = GetLocalInt(OBJECT_SELF,"RND_ROGUE");
|
|
if (nRndRogue == 1)
|
|
{
|
|
int nResult = Random(30) + 1;
|
|
switch (nResult)
|
|
{
|
|
case 1: sPostfix = "the Quick"; break;
|
|
case 2: sPostfix = "the Quiet"; break;
|
|
case 3: sPostfix = "the Sharp"; break;
|
|
case 4: sPostfix = "the Sneak"; break;
|
|
case 5: sPostfix = "the Rogue"; break;
|
|
case 6: sPostfix = "the Footpad"; break;
|
|
case 7: sPostfix = "the Shadow"; break;
|
|
case 8: sPostfix = "the Nimble"; break;
|
|
case 9: sPostfix = "the Swift"; break;
|
|
case 10: sPostfix = "the Silent"; break;
|
|
case 11: sPostfix = "the Sly"; break;
|
|
case 12: sPostfix = "the Crafty"; break;
|
|
case 13: sPostfix = "the Cunning"; break;
|
|
case 14: sPostfix = "the Elusive"; break;
|
|
case 15: sPostfix = "the Deft"; break;
|
|
case 16: sPostfix = "the Guileful"; break;
|
|
case 17: sPostfix = "the Lurker"; break;
|
|
case 18: sPostfix = "the Trickster"; break;
|
|
case 19: sPostfix = "the Prowler"; break;
|
|
case 20: sPostfix = "the Skulker"; break;
|
|
case 21: sPostfix = "the Phantom"; break;
|
|
case 22: sPostfix = "the Wily"; break;
|
|
case 23: sPostfix = "the Mysterious"; break;
|
|
case 24: sPostfix = "the Furtive"; break;
|
|
case 25: sPostfix = "the Discreet"; break;
|
|
case 26: sPostfix = "the Spy"; break;
|
|
case 27: sPostfix = "the Veiled"; break;
|
|
case 28: sPostfix = "the Artful"; break;
|
|
case 29: sPostfix = "the Sleuth"; break;
|
|
case 30: sPostfix = "the Masked"; break;
|
|
}
|
|
}
|
|
|
|
int nRndBarb = GetLocalInt(OBJECT_SELF,"RND_BARBARIAN");
|
|
if (nRndBarb == 1)
|
|
{
|
|
int nResult = Random(30) + 1;
|
|
switch (nResult)
|
|
{
|
|
case 1: sPostfix = "the Barbarian"; break;
|
|
case 2: sPostfix = "the Destroyer"; break;
|
|
case 3: sPostfix = "of the Plains"; break;
|
|
case 4: sPostfix = "of Bear Clan"; break;
|
|
case 5: sPostfix = "the Rampager"; break;
|
|
case 6: sPostfix = "the Reaver"; break;
|
|
case 7: sPostfix = "the Savage"; break;
|
|
case 8: sPostfix = "the Berserker"; break;
|
|
case 9: sPostfix = "the Untamed"; break;
|
|
case 10: sPostfix = "the Fierce"; break;
|
|
case 11: sPostfix = "the Warbringer"; break;
|
|
case 12: sPostfix = "the Wild"; break;
|
|
case 13: sPostfix = "the Raider"; break;
|
|
case 14: sPostfix = "the Vicious"; break;
|
|
case 15: sPostfix = "the Ruthless"; break;
|
|
case 16: sPostfix = "the Savage"; break;
|
|
case 17: sPostfix = "the Bloodthirsty"; break;
|
|
case 18: sPostfix = "the Warlord"; break;
|
|
case 19: sPostfix = "the Brute"; break;
|
|
case 20: sPostfix = "the Fierce"; break;
|
|
case 21: sPostfix = "the Marauder"; break;
|
|
case 22: sPostfix = "the Howler"; break;
|
|
case 23: sPostfix = "the Ravager"; break;
|
|
case 24: sPostfix = "the Crusher"; break;
|
|
case 25: sPostfix = "the Frenzied"; break;
|
|
case 26: sPostfix = "the Beast"; break;
|
|
case 27: sPostfix = "the Juggernaut"; break;
|
|
case 28: sPostfix = "the Slayer"; break;
|
|
case 29: sPostfix = "the Rager"; break;
|
|
case 30: sPostfix = "the Conqueror"; break;
|
|
}
|
|
}
|
|
|
|
int nRndFight = GetLocalInt(OBJECT_SELF,"RND_FIGHTER");
|
|
if (nRndFight == 1)
|
|
{
|
|
int nResult = Random(30) + 1;
|
|
switch (nResult)
|
|
{
|
|
case 1: sPostfix = "the Strong"; break;
|
|
case 2: sPostfix = "the Stout"; break;
|
|
case 3: sPostfix = "of Harrowdale"; break;
|
|
case 4: sPostfix = "of Tyr"; break;
|
|
case 5: sPostfix = "of Neverwinter"; break;
|
|
case 6: sPostfix = "the Swordhand"; break;
|
|
case 7: sPostfix = "the Valiant"; break;
|
|
case 8: sPostfix = "the Brave"; break;
|
|
case 9: sPostfix = "the Defender"; break;
|
|
case 10: sPostfix = "the Just"; break;
|
|
case 11: sPostfix = "the Noble"; break;
|
|
case 12: sPostfix = "the Gallant"; break;
|
|
case 13: sPostfix = "the Protector"; break;
|
|
case 14: sPostfix = "the Shield"; break;
|
|
case 15: sPostfix = "the Champion"; break;
|
|
case 16: sPostfix = "the Guardian"; break;
|
|
case 17: sPostfix = "the Sentinel"; break;
|
|
case 18: sPostfix = "the Warrior"; break;
|
|
case 19: sPostfix = "the Stalwart"; break;
|
|
case 20: sPostfix = "the Ironclad"; break;
|
|
case 21: sPostfix = "the Blade"; break;
|
|
case 22: sPostfix = "the Swordsman"; break;
|
|
case 23: sPostfix = "the Vanguard"; break;
|
|
case 24: sPostfix = "the Lancer"; break;
|
|
case 25: sPostfix = "the Spearhead"; break;
|
|
case 26: sPostfix = "the Battlemaster"; break;
|
|
case 27: sPostfix = "the Blademaster"; break;
|
|
case 28: sPostfix = "the Warlord"; break;
|
|
case 29: sPostfix = "the Vanquisher"; break;
|
|
case 30: sPostfix = "the Swordmaster"; break;
|
|
}
|
|
}
|
|
|
|
int nRndCleric = GetLocalInt(OBJECT_SELF,"RND_CLERIC");
|
|
if (nRndCleric == 1)
|
|
{
|
|
int nResult = Random(30) + 1;
|
|
switch (nResult)
|
|
{
|
|
case 1: sPostfix = "the Pious"; break;
|
|
case 2: sPostfix = "the Holy"; break;
|
|
case 3: sPostfix = "the Priest"; break;
|
|
case 4: sPostfix = "the Zealous"; break;
|
|
case 5: sPostfix = "of Phlan"; break;
|
|
case 6: sPostfix = "the Wise"; break;
|
|
case 7: sPostfix = "the Devout"; break;
|
|
case 8: sPostfix = "the Faithful"; break;
|
|
case 9: sPostfix = "the Righteous"; break;
|
|
case 10: sPostfix = "the Blessed"; break;
|
|
case 11: sPostfix = "the Pure"; break;
|
|
case 12: sPostfix = "the Sacred"; break;
|
|
case 13: sPostfix = "the Benevolent"; break;
|
|
case 14: sPostfix = "the Virtuous"; break;
|
|
case 15: sPostfix = "the Saintly"; break;
|
|
case 16: sPostfix = "the Healer"; break;
|
|
case 17: sPostfix = "the Anointed"; break;
|
|
case 18: sPostfix = "the Protector"; break;
|
|
case 19: sPostfix = "the Merciful"; break;
|
|
case 20: sPostfix = "the Revered"; break;
|
|
case 21: sPostfix = "the Graceful"; break;
|
|
case 22: sPostfix = "the Watchful"; break;
|
|
case 23: sPostfix = "the Forgiving"; break;
|
|
case 24: sPostfix = "the Humble"; break;
|
|
case 25: sPostfix = "the Divine"; break;
|
|
case 26: sPostfix = "the Preacher"; break;
|
|
case 27: sPostfix = "the Illuminated"; break;
|
|
case 28: sPostfix = "the Mystic"; break;
|
|
case 29: sPostfix = "the Herald"; break;
|
|
case 30: sPostfix = "the Exalted"; break;
|
|
}
|
|
}
|
|
|
|
int nRndMage = GetLocalInt(OBJECT_SELF,"RND_MAGE");
|
|
if (nRndMage == 1)
|
|
{
|
|
int nResult = Random(30) + 1;
|
|
switch (nResult)
|
|
{
|
|
case 1: sPostfix = "the Mad"; break;
|
|
case 2: sPostfix = "the Arcane"; break;
|
|
case 3: sPostfix = "the Black"; break;
|
|
case 4: sPostfix = "the Wizard"; break;
|
|
case 5: sPostfix = "of Waterdeep"; break;
|
|
case 6: sPostfix = "the Mage"; break;
|
|
case 7: sPostfix = "the Enigmatic"; break;
|
|
case 8: sPostfix = "the Mystical"; break;
|
|
case 9: sPostfix = "the Eldritch"; break;
|
|
case 10: sPostfix = "the Runeweaver"; break;
|
|
case 11: sPostfix = "the Sorcerous"; break;
|
|
case 12: sPostfix = "the Seer"; break;
|
|
case 13: sPostfix = "the Arcanist"; break;
|
|
case 14: sPostfix = "the Illustrious"; break;
|
|
case 15: sPostfix = "the Sage"; break;
|
|
case 16: sPostfix = "the Sorcerous"; break;
|
|
case 17: sPostfix = "the Occult"; break;
|
|
case 18: sPostfix = "the Arcane Adept"; break;
|
|
case 19: sPostfix = "the Spellbinder"; break;
|
|
case 20: sPostfix = "the Occultist"; break;
|
|
case 21: sPostfix = "the Conjurer"; break;
|
|
case 22: sPostfix = "the Seer"; break;
|
|
case 23: sPostfix = "the Invoker"; break;
|
|
case 24: sPostfix = "the Mysterious"; break;
|
|
case 25: sPostfix = "the Shrouded"; break;
|
|
case 26: sPostfix = "the Visionary"; break;
|
|
case 27: sPostfix = "the Spellweaver"; break;
|
|
case 28: sPostfix = "the Willbreaker"; break;
|
|
case 29: sPostfix = "the Charmer"; break;
|
|
case 30: sPostfix = "the Elementalist"; break;
|
|
}
|
|
}
|
|
|
|
int nRndBard = GetLocalInt(OBJECT_SELF,"RND_BARD");
|
|
if (nRndBard == 1)
|
|
{
|
|
int nResult = Random(25) + 1;
|
|
switch (nResult)
|
|
{
|
|
case 1: sPostfix = "the Subtle"; break;
|
|
case 2: sPostfix = "the Veiled"; break;
|
|
case 3: sPostfix = "the Shadowed"; break;
|
|
case 4: sPostfix = "the Intriguer"; break;
|
|
case 5: sPostfix = "of Altaruk"; break;
|
|
case 6: sPostfix = "the Elusive"; break;
|
|
case 7: sPostfix = "the Mysterious"; break;
|
|
case 8: sPostfix = "the Cryptic"; break;
|
|
case 9: sPostfix = "the Insidious"; break;
|
|
case 10: sPostfix = "the Quiet"; break;
|
|
case 11: sPostfix = "the Sly"; break;
|
|
case 12: sPostfix = "the Covert"; break;
|
|
case 13: sPostfix = "the Furtive"; break;
|
|
case 14: sPostfix = "the Discreet"; break;
|
|
case 15: sPostfix = "the Subversive"; break;
|
|
case 16: sPostfix = "the Shrouded"; break;
|
|
case 17: sPostfix = "the Obscured"; break;
|
|
case 18: sPostfix = "the Clever"; break;
|
|
case 19: sPostfix = "the Enigmatic"; break;
|
|
case 20: sPostfix = "of Elventree"; break;
|
|
case 21: sPostfix = "of Melvaunt"; break;
|
|
case 22: sPostfix = "of Deepingdale"; break;
|
|
case 23: sPostfix = "of Skullport"; break;
|
|
case 24: sPostfix = "the Crafty"; break;
|
|
case 25: sPostfix = "of Amn"; break;
|
|
}
|
|
}
|
|
|
|
int nRndDruid = GetLocalInt(OBJECT_SELF,"RND_DRUID");
|
|
if (nRndDruid == 1)
|
|
{
|
|
int nResult = Random(25) + 1;
|
|
switch (nResult)
|
|
{
|
|
case 1: sPostfix = "the Druid"; break;
|
|
case 2: sPostfix = "of the Forest"; break;
|
|
case 3: sPostfix = "of the Wild"; break;
|
|
case 4: sPostfix = "the Wolflord"; break;
|
|
case 5: sPostfix = "the Treelord"; break;
|
|
case 6: sPostfix = "the Verdant"; break;
|
|
case 7: sPostfix = "the Earthshaker"; break;
|
|
case 8: sPostfix = "the Feral"; break;
|
|
case 9: sPostfix = "of the Glade"; break;
|
|
case 10: sPostfix = "of the Crystal Forest"; break;
|
|
case 11: sPostfix = "the Thorned"; break;
|
|
case 12: sPostfix = "the Greenwarden"; break;
|
|
case 13: sPostfix = "the Naturebound"; break;
|
|
case 14: sPostfix = "the Forestborn"; break;
|
|
case 15: sPostfix = "the Spiritcaller"; break;
|
|
case 16: sPostfix = "the Leafblade"; break;
|
|
case 17: sPostfix = "the Mossy"; break;
|
|
case 18: sPostfix = "the Grovekeeper"; break;
|
|
case 19: sPostfix = "the Stormbringer"; break;
|
|
case 20: sPostfix = "the Earthshaper"; break;
|
|
case 21: sPostfix = "the Bramble"; break;
|
|
case 22: sPostfix = "of the Black Sands"; break;
|
|
case 23: sPostfix = "of the Silt Sea"; break;
|
|
case 24: sPostfix = "the Spiritbinder"; break;
|
|
case 25: sPostfix = "the Wildheart"; break;
|
|
}
|
|
}
|
|
|
|
int nRndRanger = GetLocalInt(OBJECT_SELF,"RND_RANGER");
|
|
if (nRndRanger == 1)
|
|
{
|
|
int nResult = Random(25) + 1;
|
|
switch (nResult)
|
|
{
|
|
case 1: sPostfix = "the Ranger"; break;
|
|
case 2: sPostfix = "of the Forest"; break;
|
|
case 3: sPostfix = "of the Wild"; break;
|
|
case 4: sPostfix = "the Strider"; break;
|
|
case 5: sPostfix = "the Venger"; break;
|
|
case 6: sPostfix = "the Pathfinder"; break;
|
|
case 7: sPostfix = "the Woodsman"; break;
|
|
case 8: sPostfix = "the Trailblazer"; break;
|
|
case 9: sPostfix = "the Hunter"; break;
|
|
case 10: sPostfix = "the Scout"; break;
|
|
case 11: sPostfix = "the Wayfarer"; break;
|
|
case 12: sPostfix = "the Outrider"; break;
|
|
case 13: sPostfix = "the Seeker"; break;
|
|
case 14: sPostfix = "the Sentinel"; break;
|
|
case 15: sPostfix = "the Forestborn"; break;
|
|
case 16: sPostfix = "the Survivalist"; break;
|
|
case 17: sPostfix = "the Tracker"; break;
|
|
case 18: sPostfix = "the Forager"; break;
|
|
case 19: sPostfix = "the Warder"; break;
|
|
case 20: sPostfix = "the Greenblade"; break;
|
|
case 21: sPostfix = "the Beastmaster"; break;
|
|
case 22: sPostfix = "the Thornhunter"; break;
|
|
case 23: sPostfix = "of the Deepwood"; break;
|
|
case 24: sPostfix = "of the Roughlands"; break;
|
|
case 25: sPostfix = "the Wilderness Guide"; break;
|
|
}
|
|
}
|
|
if (sRandomName != "")
|
|
{
|
|
if (sRandomName == "RANDOM")
|
|
{
|
|
switch (GetLocalInt(oNPC, "NAME_TYPE"))
|
|
{
|
|
case 1: sRandomName = sTitle + " " + ms_RandomFirstName(oNPC) + " " + ms_RandomLastName(oNPC)+ " " + sPostfix; break;
|
|
default: sRandomName = sTitle + " " + ms_RandomFirstName(oNPC) + " " + sPostfix; break;
|
|
}
|
|
}
|
|
|
|
if (bClassTitle)
|
|
{
|
|
sRandomName = sBaseRace +" "+ sTitle;
|
|
}
|
|
|
|
DelayCommand(0.0f, SetName(oNPC, (sRandomName)));
|
|
return;
|
|
}
|
|
}
|
|
|
|
string ms_RandomFirstName(object oNPC = OBJECT_SELF)
|
|
{
|
|
int Gender = GetGender(oNPC);
|
|
int Race = MyPRCGetRacialType(oNPC);
|
|
|
|
string Name;
|
|
|
|
switch (Race)
|
|
{
|
|
case RACIAL_TYPE_ANIMAL: Name = RandomName(0); break;
|
|
case RACIAL_TYPE_DWARF:
|
|
switch (Gender)
|
|
{ default: Name = RandomName(2); break;
|
|
case GENDER_FEMALE: Name = RandomName(3); break; } break;
|
|
case RACIAL_TYPE_ELF:
|
|
switch (Gender)
|
|
{ default: Name = RandomName(5); break;
|
|
case GENDER_FEMALE: Name = RandomName(6); break; } break;
|
|
case RACIAL_TYPE_GNOME:
|
|
switch (Gender)
|
|
{ default: Name = RandomName(8); break;
|
|
case GENDER_FEMALE: Name = RandomName(9); break; } break;
|
|
case RACIAL_TYPE_HALFELF:
|
|
switch (Gender)
|
|
{ default: Name = RandomName(11); break;
|
|
case GENDER_FEMALE: Name = RandomName(12); break; } break;
|
|
case RACIAL_TYPE_HALFLING:
|
|
switch (Gender)
|
|
{ default: Name = RandomName(14); break;
|
|
case GENDER_FEMALE: Name = RandomName(15); break; } break;
|
|
case RACIAL_TYPE_HALFORC:
|
|
switch (Gender)
|
|
{ default: Name = RandomName(17); break;
|
|
case GENDER_FEMALE: Name = RandomName(18); break; } break;
|
|
case RACIAL_TYPE_HUMAN:
|
|
switch (Gender)
|
|
{ default: Name = RandomName(20); break;
|
|
case GENDER_FEMALE: Name = RandomName(21); break; } break;
|
|
default:
|
|
switch (Gender)
|
|
{ default: Name = RandomName(-1); break;
|
|
case GENDER_FEMALE: Name = RandomName(0); break; } break;
|
|
}
|
|
|
|
return Name;
|
|
}
|
|
|
|
string ms_RandomLastName(object oNPC = OBJECT_SELF)
|
|
{
|
|
int Race = MyPRCGetRacialType(oNPC);
|
|
|
|
string Name;
|
|
|
|
switch (Race)
|
|
{
|
|
case RACIAL_TYPE_DWARF: Name = RandomName(4); break;
|
|
case RACIAL_TYPE_ELF: Name = RandomName(7); break;
|
|
case RACIAL_TYPE_GNOME: Name = RandomName(10); break;
|
|
case RACIAL_TYPE_HALFELF: Name = RandomName(13); break;
|
|
case RACIAL_TYPE_HALFLING: Name = RandomName(16); break;
|
|
case RACIAL_TYPE_HALFORC: Name = RandomName(19); break;
|
|
case RACIAL_TYPE_HUMAN: Name = RandomName(22); break;
|
|
default: Name = RandomName(1); break;
|
|
}
|
|
|
|
return Name;
|
|
}
|
|
|
|
int GetHighestClassType(object oNPC = OBJECT_SELF)
|
|
{
|
|
if (!GetIsObjectValid(oNPC)) return -1;
|
|
|
|
int nBestClass = -1;
|
|
int nBestLevel = -1;
|
|
int i;
|
|
int nClass;
|
|
int nLevel;
|
|
int nMaxClasses = 254;
|
|
|
|
i = 1;
|
|
while (i <= nMaxClasses)
|
|
{
|
|
nClass = GetClassByPosition(i, oNPC);
|
|
if (nClass != -1)
|
|
{
|
|
// 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)
|
|
{
|
|
// skip
|
|
}
|
|
else
|
|
{
|
|
nLevel = GetLevelByClass(nClass, oNPC);
|
|
if (nLevel > nBestLevel)
|
|
{
|
|
nBestLevel = nLevel;
|
|
nBestClass = nClass;
|
|
|
|
}
|
|
}
|
|
}
|
|
i = i + 1;
|
|
}
|
|
|
|
return nBestClass;
|
|
}
|
|
|
|
string GetClassLevelTitle(int nClassType)
|
|
{
|
|
object oCreature = OBJECT_SELF;
|
|
|
|
int nLevel = GetLevelByClass(nClassType, oCreature);
|
|
int nGender = GetGender(oCreature);
|
|
|
|
string sTitle;
|
|
|
|
switch (nClassType)
|
|
{
|
|
case CLASS_TYPE_BARBARIAN:
|
|
switch(nLevel)
|
|
{
|
|
case 1: case 2: case 3: sTitle = "Brute"; break;
|
|
case 4: case 5: sTitle = "Vandal"; break;
|
|
case 6: sTitle = (nGender == 1) ? "Plunderess" : "Plunderer"; break;
|
|
case 7: sTitle = "Pillager"; break;
|
|
case 8: sTitle = "Marauder"; break;
|
|
case 9: sTitle = "Reaver"; break;
|
|
case 10: sTitle = "Barbarian"; break;
|
|
case 11: sTitle = "Mauler"; break;
|
|
case 12: sTitle = "Ravager"; break;
|
|
case 13: sTitle = "Slaughterer"; break;
|
|
case 14: sTitle = "Destroyer"; break;
|
|
case 15: sTitle = (nGender == 1) ? "Chieftainess" : "Chieftain"; break;
|
|
case 16: sTitle = "Bloodletter"; break;
|
|
case 17: sTitle = "Rampager"; break;
|
|
case 18: sTitle = "Slayer"; break;
|
|
case 19: sTitle = "Warmonger"; break;
|
|
case 20: sTitle = (nGender == 1) ? "High Chieftainess" : "High Chieftain"; break;
|
|
default: sTitle = (nGender == 1) ? "Conqueress" : "Conqueror"; break;
|
|
}
|
|
break;
|
|
|
|
case CLASS_TYPE_ROGUE:
|
|
switch(nLevel)
|
|
{
|
|
case 1: case 2: case 3: sTitle = "Lookout"; break;
|
|
case 4: case 5: sTitle = "Outlaw"; break;
|
|
case 6: sTitle = "Scalawag"; break;
|
|
case 7: sTitle = "Creeper"; break;
|
|
case 8: sTitle = "Larker"; break;
|
|
case 9: sTitle = "Footpad"; break;
|
|
case 10: sTitle = "Rogue"; break;
|
|
case 11: sTitle = "Cutpurse"; break;
|
|
case 12: sTitle = "Thief"; break;
|
|
case 13: sTitle = "Pilferer"; break;
|
|
case 14: sTitle = "Robber"; break;
|
|
case 15: sTitle = "Sharper"; break;
|
|
case 16: sTitle = "Burglar"; break;
|
|
case 17: sTitle = "Filcher"; break;
|
|
case 18: sTitle = "Scoundrel"; break;
|
|
case 19: sTitle = "Knave"; break;
|
|
case 20: sTitle = "Prowler"; break;
|
|
default: sTitle = "Master Rogue"; break;
|
|
}
|
|
break;
|
|
|
|
case CLASS_TYPE_BARD:
|
|
switch(nLevel)
|
|
{
|
|
case 1: case 2: case 3: sTitle = "Crier"; break;
|
|
case 4: case 5: sTitle = (nGender == 1) ? "Chantress" : "Chanter"; break;
|
|
case 6: sTitle = "Skop"; break;
|
|
case 7: sTitle = "Accompanist"; break;
|
|
case 8: sTitle = "Rhymer"; break;
|
|
case 9: sTitle = "Singer"; break;
|
|
case 10: sTitle = "Balladeer"; break;
|
|
case 11: sTitle = (nGender == 1) ? "Cantoress" : "Cantor"; break;
|
|
case 12: sTitle = "Lutenist"; break;
|
|
case 13: sTitle = "Melodist"; break;
|
|
case 14: sTitle = "Lyrist"; break;
|
|
case 15: sTitle = "Jongleur"; break;
|
|
case 16: sTitle = "Loreweaver"; break;
|
|
case 17: sTitle = "Chronicler"; break;
|
|
case 18: sTitle = "Muse"; break;
|
|
case 19: sTitle = (nGender == 1) ? "Rhapsode" : "Rhapsodist"; break;
|
|
case 20: sTitle = "Bard"; break;
|
|
case 21: sTitle = "Raconteur"; break;
|
|
case 22: sTitle = "Siren"; break;
|
|
case 23: sTitle = "Songsmith"; break;
|
|
case 24: sTitle = "Versifer"; break;
|
|
case 25: sTitle = "Minstrel"; break;
|
|
case 26: sTitle = "Sonneteer"; break;
|
|
case 27: sTitle = (nGender == 1) ? "Trobairitz" : "Troubadour"; break;
|
|
case 28: sTitle = "Citharist"; break;
|
|
case 29: sTitle = "High Minstrel"; break;
|
|
default: sTitle = "Master Bard"; break;
|
|
}
|
|
break;
|
|
|
|
case CLASS_TYPE_SORCERER:
|
|
case CLASS_TYPE_WIZARD:
|
|
switch(nLevel)
|
|
{
|
|
case 1: case 2: case 3: sTitle = "Apprentice"; break;
|
|
case 4: case 5: sTitle = "Adept"; break;
|
|
case 6: sTitle = "Journeymage"; break;
|
|
case 7: sTitle = "Hedge Mage"; break;
|
|
case 8: sTitle = "Magician"; break;
|
|
case 9: sTitle = "Prestidigitator"; break;
|
|
case 10: sTitle = "Wizard"; break;
|
|
case 11: sTitle = "Sage"; break;
|
|
case 12: sTitle = "Visionary"; break;
|
|
case 13: sTitle = "Loremaster"; break;
|
|
case 14: sTitle = "Mage"; break;
|
|
case 15: sTitle = "Fatespinner"; break;
|
|
case 16: sTitle = "Cabalist"; break;
|
|
case 17: sTitle = "Thaumaturge"; break;
|
|
case 18: sTitle = "Theurgist"; break;
|
|
case 19: sTitle = "Augur"; break;
|
|
case 20: sTitle = "Spellbinder"; break;
|
|
default: sTitle = "Archmage"; break;
|
|
}
|
|
break;
|
|
|
|
case CLASS_TYPE_CLERIC:
|
|
switch(nLevel)
|
|
{
|
|
case 1: case 2: case 3: sTitle = "Candidate"; break;
|
|
case 4: case 5: sTitle = "Aspirant"; break;
|
|
case 6: sTitle = "Novice"; break;
|
|
case 7: sTitle = "Acolyte"; break;
|
|
case 8: sTitle = "Initiate"; break;
|
|
case 9: sTitle = (nGender == 1) ? "Priestess" : "Priest"; break;
|
|
case 10: sTitle = "Cleric"; break;
|
|
case 11: sTitle = "Curate"; break;
|
|
case 12: sTitle = "Apostle"; break;
|
|
case 13: sTitle = "Ovate"; break;
|
|
case 14: sTitle = "Missionary"; break;
|
|
case 15: sTitle = (nGender == 1) ? "Canoness" : "Canon"; break;
|
|
case 16: sTitle = (nGender == 1) ? "Abbotess" : "Abbot"; break;
|
|
case 17: sTitle = "Bishop"; break;
|
|
case 18: sTitle = (nGender == 1) ? "Matriarch" : "Patriarch"; break;
|
|
case 19: sTitle = "Preacher"; break;
|
|
default: sTitle = (nGender == 1) ? "High Priestess" : "High Priest"; break;
|
|
}
|
|
break;
|
|
|
|
case CLASS_TYPE_DRUID:
|
|
switch(nLevel)
|
|
{
|
|
case 1: case 2: case 3: sTitle = "Initiate"; break;
|
|
case 4: case 5: sTitle = "Devotee"; break;
|
|
case 6: sTitle = "Beastling"; break;
|
|
case 7: sTitle = "Grovelurker"; break;
|
|
case 8: sTitle = "Shaper"; break;
|
|
case 9: sTitle = "Springwalker"; break;
|
|
case 10: sTitle = "Druid"; break;
|
|
case 11: sTitle = "Naturekin"; break;
|
|
case 12: sTitle = "Treewarden"; break;
|
|
case 13: sTitle = "Auspex"; break;
|
|
case 14: sTitle = "Haruspex"; break;
|
|
case 15: sTitle = "Student of Stones"; break;
|
|
case 16: sTitle = "Student of Waters"; break;
|
|
case 17: sTitle = "Student of Forests"; break;
|
|
case 18: sTitle = "Student of Winds"; break;
|
|
case 19: sTitle = "Student of Changes"; break;
|
|
case 20: sTitle = "Pathwarden"; break;
|
|
default: sTitle = "Archdruid"; break;
|
|
}
|
|
break;
|
|
|
|
case CLASS_TYPE_FIGHTER:
|
|
switch(nLevel)
|
|
{
|
|
case 1: case 2: case 3: sTitle = "Guard"; break;
|
|
case 4: sTitle = "Elite Guard"; break;
|
|
case 5: case 6: sTitle = "Warrior"; break;
|
|
case 7: sTitle = "Elite Warrior"; break;
|
|
case 8: sTitle = "Soldier"; break;
|
|
case 9: sTitle = "Enforcer"; break;
|
|
case 10: sTitle = "Fighter"; break;
|
|
case 11: sTitle = "Skirmisher"; break;
|
|
case 12: sTitle = "Veteran"; break;
|
|
case 13: sTitle = "Armiger"; break;
|
|
case 14: sTitle = "Myrmidon"; break;
|
|
case 15: sTitle = "Hero"; break;
|
|
case 16: sTitle = "Vanguard"; break;
|
|
case 17: sTitle = "Sentinel"; break;
|
|
case 18: sTitle = "Dominator"; break;
|
|
case 19: sTitle = "Warmonger"; break;
|
|
case 20: sTitle = "Champion"; break;
|
|
default: sTitle = "Grandmaster"; break;
|
|
}
|
|
break;
|
|
|
|
case CLASS_TYPE_MONK:
|
|
switch(nLevel)
|
|
{
|
|
case 1: sTitle = "Trainee"; break;
|
|
case 2: sTitle = "Initiate"; break;
|
|
case 3: sTitle = "Novice"; break;
|
|
case 4: sTitle = "Neophyte"; break;
|
|
case 5: sTitle = "Aspirant"; break;
|
|
case 6: sTitle = "Acolyte"; break;
|
|
case 7: sTitle = "Devotee"; break;
|
|
case 8: sTitle = "Disciple"; break;
|
|
case 9: sTitle = "Adept"; break;
|
|
case 10: sTitle = "Ascetic"; break;
|
|
case 11: sTitle = "Pilgrim"; break;
|
|
case 12: sTitle = "Master"; break;
|
|
case 13: sTitle = "Anchorite"; break;
|
|
case 14: sTitle = "Mystic"; break;
|
|
case 15: sTitle = "Meditator"; break;
|
|
case 16: sTitle = "Seeker"; break;
|
|
case 17: sTitle = "Guru"; break;
|
|
case 18: sTitle = "Sensei"; break;
|
|
case 19: sTitle = "Sannyasi"; break;
|
|
case 20: sTitle = "Exemplar"; break;
|
|
case 21: sTitle = "Transcendent"; break;
|
|
default: sTitle = "High Master"; break;
|
|
}
|
|
break;
|
|
|
|
case CLASS_TYPE_PALADIN:
|
|
switch(nLevel)
|
|
{
|
|
case 1: sTitle = "Advocate"; break;
|
|
case 2: sTitle = "Initiate"; break;
|
|
case 3: sTitle = "Squire"; break;
|
|
case 4: sTitle = "Gallant"; break;
|
|
case 5: sTitle = "Emissary"; break;
|
|
case 6: sTitle = "Guardian"; break;
|
|
case 7: sTitle = "Devotee"; break;
|
|
case 8: sTitle = "Disciple"; break;
|
|
case 9: sTitle = "Adept"; break;
|
|
case 10: sTitle = "Ascetic"; break;
|
|
case 11: sTitle = "Pilgrim"; break;
|
|
case 12: sTitle = "Master"; break;
|
|
case 13: sTitle = "Anchorite"; break;
|
|
case 14: sTitle = "Mystic"; break;
|
|
case 15: sTitle = "Meditator"; break;
|
|
case 16: sTitle = "Seeker"; break;
|
|
case 17: sTitle = "Guru"; break;
|
|
case 18: sTitle = "Sensei"; break;
|
|
case 19: sTitle = "Sannyasi"; break;
|
|
case 20: sTitle = "Exemplar"; break;
|
|
case 21: sTitle = "Transcendent"; break;
|
|
default: sTitle = "High Master"; break;
|
|
}
|
|
break;
|
|
|
|
case CLASS_TYPE_RANGER:
|
|
switch(nLevel)
|
|
{
|
|
case 1: case 2: case 3: sTitle = "Greenhorn"; break;
|
|
case 4: case 5: sTitle = "Tenderfoot"; break;
|
|
case 6: sTitle = "Vagrant"; break;
|
|
case 7: sTitle = "Tramp"; break;
|
|
case 8: sTitle = "Nomad"; break;
|
|
case 9: sTitle = "Wanderer"; break;
|
|
case 10: sTitle = "Ranger"; break;
|
|
case 11: sTitle = "Rambler"; break;
|
|
case 12: sTitle = "Traveler"; break;
|
|
case 13: sTitle = "Sojourner"; break;
|
|
case 14: sTitle = "Outrider"; break;
|
|
case 15: sTitle = "Wayfarer"; break;
|
|
case 16: sTitle = "Excursionist"; break;
|
|
case 17: sTitle = "Trekker"; break;
|
|
case 18: sTitle = "Trailblazer"; break;
|
|
case 19: sTitle = "Woodsman"; break;
|
|
case 20: sTitle = "High Ranger"; break;
|
|
default: sTitle = "Ranger Lord"; break;
|
|
}
|
|
break;
|
|
}
|
|
|
|
return sTitle;
|
|
}
|
|
|
|
int GetHighestClassLevel(object oCreature)
|
|
{
|
|
int nHighestLevel = -1;
|
|
int nClassTypes = 254; // Maximum number of class types
|
|
int i;
|
|
|
|
for (i = 0; i <= nClassTypes; i++)
|
|
{
|
|
// Check if the class type is excluded
|
|
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)
|
|
continue;
|
|
|
|
int nLevel = GetLevelByClass(i, oCreature);
|
|
if (nLevel > 0)
|
|
{
|
|
if (nLevel > nHighestLevel)
|
|
{
|
|
nHighestLevel = nLevel;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
break; // Reached an invalid class level, exit the loop
|
|
}
|
|
}
|
|
|
|
return nHighestLevel;
|
|
}
|
|
|
|
//::void main (){} |