Setup onSpawn Evolved Undead template
Setup onSpawn Evolved Undead template. Started baseitem work for new iprop forge system. Full compile. Updated release archive.
This commit is contained in:
@@ -27,6 +27,44 @@ void ReallyEquipItemInSlot(object oNPC, object oItem, int nSlot)
|
||||
}
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
//:: Initialize Major Variables
|
||||
@@ -47,10 +85,6 @@ void main()
|
||||
object oSkelly;
|
||||
object oPC = GetFirstObjectInArea(oArea);
|
||||
|
||||
//:: Set threatlevel name text
|
||||
SetThreatLevel(OBJECT_SELF);
|
||||
|
||||
|
||||
//:: Check if the creature is an animal, beast, construct, or ooze, which should never carry treasure
|
||||
if (iRacial == RACIAL_TYPE_ANIMAL ||
|
||||
iRacial == RACIAL_TYPE_BEAST ||
|
||||
@@ -101,6 +135,17 @@ void main()
|
||||
{
|
||||
nAveragePCLevel = 2;
|
||||
}
|
||||
|
||||
//:: Setup Evolved Undead
|
||||
if(iRacial == RACIAL_TYPE_UNDEAD)
|
||||
{
|
||||
SetAge(OBJECT_SELF, d20(6));
|
||||
|
||||
EvolvedUndeadCheck(OBJECT_SELF);
|
||||
}
|
||||
|
||||
//:: Set threatlevel name text
|
||||
SetThreatLevel(OBJECT_SELF);
|
||||
|
||||
//:: Only active during Halloween week.
|
||||
if ((sMonthDay == "10/24") ||
|
||||
|
Reference in New Issue
Block a user