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:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user