Added 1:10000 chance to spawn a Paragon version of any creature

Added 1:10000 chance to spawn a Paragon version of any creature.  Full compile.  Updated release archive.
This commit is contained in:
Jaysyn904
2024-12-13 19:40:24 -05:00
parent b0a9d7abac
commit 99262f2dd9
10 changed files with 503 additions and 49 deletions

View File

@@ -53,45 +53,6 @@ void Embiggen(object oNPC, float fIncrease)
SetObjectVisualTransform(OBJECT_SELF, OBJECT_VISUAL_TRANSFORM_SCALE, fIncrease);
}
void EvolvedUndeadCheck(object oUndead)
{
// Check if the creature is undead and intelligent
if (MyPRCGetRacialType(oUndead) != RACIAL_TYPE_UNDEAD || !GetAbilityModifier(ABILITY_INTELLIGENCE, oUndead) > -1)
{
return; // Exit if not an intelligent undead
}
// Get the undead's area and its age
object oArea = GetArea(oUndead);
int iUndeadAge = GetAge(oUndead);
// Base evolution chance: 1% for every 100 years
int iBaseChance = iUndeadAge / 100;
// Add chance modifiers: ancient energy and previous evolutions
int iAncientBoost = GetLocalInt(oArea, "EVO_UNDEAD_BOOST"); // Area-specific boost
int iEvolutionCount = GetLocalInt(oUndead, "UNDEAD_EVOLUTION"); // Previous evolutions
int iChance = iBaseChance + iAncientBoost + iEvolutionCount;
// Roll the dice (1-100)
int iRoll = Random(100) + 1;
// Debug message to monitor rolls and chances
if(DEBUG)
{
DoDebug("Evolution Check: Roll = " + IntToString(iRoll) + ", Chance = " + IntToString(iChance));
}
// Check if the undead evolves
if (iRoll <= iChance)
{
// Apply evolution template
ExecuteScript("make_evolved", oUndead); // Apply template script
}
}
void main()
{
//:: User defined OnSpawn event requested?
@@ -618,16 +579,6 @@ void main()
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, OBJECT_SELF);
}
//:: Setup Evolved Undead
if(iRace == RACIAL_TYPE_UNDEAD)
{
SetAge(OBJECT_SELF, d20(6));
EvolvedUndeadCheck(OBJECT_SELF);
}
//:: Set or Randomize name
ms_Nomenclature(OBJECT_SELF);