Fixed Greater Mummy AI. Added more sarcophaguses to the Labyrinth. Fixed Crypt Chanter aura (maybe?). Full compile. Updated release archive.
2153 lines
64 KiB
Plaintext
2153 lines
64 KiB
Plaintext
//
|
|
// Spawn Groups
|
|
//
|
|
//
|
|
// nChildrenSpawned
|
|
// : Number of Total Children ever Spawned
|
|
//
|
|
// nSpawnCount
|
|
// : Number of Children currently Alive
|
|
//
|
|
// nSpawnNumber
|
|
// : Number of Children to Maintain at Spawn
|
|
//
|
|
// nRandomWalk
|
|
// : Walking Randomly? TRUE/FALSE
|
|
//
|
|
// nPlaceable
|
|
// : Spawning Placeables? TRUE/FALSE
|
|
//
|
|
//
|
|
int ParseFlagValue(string sName, string sFlag, int nDigits, int nDefault);
|
|
int ParseSubFlagValue(string sName, string sFlag, int nDigits, string sSubFlag, int nSubDigits, int nDefault);
|
|
object GetChildByTag(object oSpawn, string sChildTag);
|
|
object GetChildByNumber(object oSpawn, int nChildNum);
|
|
object GetSpawnByID(int nSpawnID);
|
|
void DeactivateSpawn(object oSpawn);
|
|
void DeactivateSpawnsByTag(string sSpawnTag);
|
|
void DeactivateAllSpawns();
|
|
void DespawnChildren(object oSpawn);
|
|
void DespawnChildrenByTag(object oSpawn, string sSpawnTag);
|
|
//
|
|
//
|
|
|
|
string GetTemplateByCR(int nCR, string sGroupType)
|
|
{
|
|
string sRetTemplate;
|
|
|
|
if (sGroupType == "outdoor")
|
|
{
|
|
switch (nCR)
|
|
{
|
|
case 1:
|
|
switch(d6(1))
|
|
{
|
|
case 1: sRetTemplate = "NW_SKELETON"; break;
|
|
case 2: sRetTemplate = "NW_ZOMBIE01"; break;
|
|
case 3: sRetTemplate = "NW_NIXIE"; break;
|
|
case 4: sRetTemplate = "NW_ORCA"; break;
|
|
case 5: sRetTemplate = "NW_ORCB"; break;
|
|
case 6: sRetTemplate = "NW_BTLFIRE"; break;
|
|
}
|
|
break;
|
|
case 2:
|
|
switch(d4(1))
|
|
{
|
|
case 1: sRetTemplate = "NW_KOBOLD004"; break;
|
|
case 2: sRetTemplate = "NW_KOBOLD005"; break;
|
|
case 3: sRetTemplate = "NW_KOBOLD003"; break;
|
|
case 4: sRetTemplate = "NW_PIXIE"; break;
|
|
}
|
|
break;
|
|
case 3:
|
|
switch(d4(1))
|
|
{
|
|
case 1: sRetTemplate = "NW_BTLBOMB"; break;
|
|
case 2: sRetTemplate = "NW_BTLFIRE002"; break;
|
|
case 3: sRetTemplate = "NW_BTLSTINK"; break;
|
|
case 4: sRetTemplate = "NW_NYMPH"; break;
|
|
}
|
|
break;
|
|
default:
|
|
sRetTemplate = "";
|
|
break;
|
|
}
|
|
}
|
|
|
|
else if (sGroupType == "crypt")
|
|
{
|
|
switch (nCR)
|
|
{
|
|
case 1:
|
|
switch(d4(1))
|
|
{
|
|
case 1:
|
|
case 2: sRetTemplate = "NW_SKELETON"; break;
|
|
case 3: sRetTemplate = "NW_ZOMBIE01"; break;
|
|
case 4: sRetTemplate = "NW_ZOMBIE02"; break;
|
|
}
|
|
break;
|
|
case 2:
|
|
sRetTemplate = "NW_GHOUL";
|
|
break;
|
|
case 3:
|
|
sRetTemplate = "NW_SHADOW";
|
|
break;
|
|
default:
|
|
sRetTemplate = "";
|
|
break;
|
|
} }
|
|
|
|
else
|
|
{
|
|
// unknown group type
|
|
sRetTemplate = "";
|
|
}
|
|
|
|
return sRetTemplate;
|
|
}
|
|
|
|
|
|
// Convert a given EL equivalent and its encounter level,
|
|
// return the corresponding CR
|
|
float ConvertELEquivToCR(float fEquiv, float fEncounterLevel)
|
|
{
|
|
float fCR, fEquivSq, fTemp;
|
|
|
|
if (fEquiv == 0.0)
|
|
{
|
|
return 0.0;
|
|
}
|
|
|
|
fEquivSq = fEquiv * fEquiv;
|
|
fTemp = log(fEquivSq);
|
|
fTemp /= log(2.0);
|
|
fCR = fEncounterLevel + fTemp;
|
|
|
|
return fCR;
|
|
}
|
|
|
|
// Convert a given CR to its encounter level equivalent per DMG page 101.
|
|
float ConvertCRToELEquiv(float fCR, float fEncounterLevel)
|
|
{
|
|
if (fCR > fEncounterLevel || fCR < 1.0)
|
|
{
|
|
return 1.;
|
|
}
|
|
|
|
float fEquiv, fExponent, fDenom;
|
|
|
|
fExponent = fEncounterLevel - fCR;
|
|
fExponent *= 0.5;
|
|
fDenom = pow(2.0, fExponent);
|
|
fEquiv = 1.0 / fDenom;
|
|
|
|
return fEquiv;
|
|
}
|
|
|
|
string SpawnGroup(object oSpawn, string sTemplate)
|
|
{
|
|
// Initialize
|
|
string sRetTemplate;
|
|
|
|
// Initialize Values
|
|
int nSpawnNumber = GetLocalInt(oSpawn, "f_SpawnNumber");
|
|
int nRandomWalk = GetLocalInt(oSpawn, "f_RandomWalk");
|
|
int nPlaceable = GetLocalInt(oSpawn, "f_Placeable");
|
|
int nChildrenSpawned = GetLocalInt(oSpawn, "ChildrenSpawned");
|
|
int nSpawnCount = GetLocalInt(oSpawn, "SpawnCount");
|
|
|
|
//
|
|
// Only Make Modifications Between These Lines
|
|
// -------------------------------------------
|
|
|
|
if (GetStringLeft(sTemplate, 7) == "scaled_")
|
|
{
|
|
float fEncounterLevel;
|
|
int nScaledInProgress = GetLocalInt(oSpawn, "ScaledInProgress");
|
|
string sGroupType = GetStringRight(sTemplate, GetStringLength(sTemplate) - 7);
|
|
|
|
// First Time in for this encounter?
|
|
if (! nScaledInProgress)
|
|
{
|
|
|
|
// First time in - find the party level
|
|
int nTotalPCs = 0;
|
|
int nTotalPCLevel = 0;
|
|
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE)
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs == 0)
|
|
{
|
|
fEncounterLevel = 0.0;
|
|
}
|
|
else
|
|
{
|
|
fEncounterLevel = IntToFloat(nTotalPCLevel) / IntToFloat(nTotalPCs);
|
|
}
|
|
|
|
// Save this for subsequent calls
|
|
SetLocalFloat(oSpawn, "ScaledEncounterLevel", fEncounterLevel);
|
|
|
|
// We're done when the CRs chosen add up to the
|
|
// desired encounter level
|
|
SetLocalInt(oSpawn, "ScaledCallCount", 0);
|
|
SetLocalInt(oSpawn, "ScaledInProgress", TRUE);
|
|
}
|
|
|
|
|
|
fEncounterLevel = GetLocalFloat(oSpawn, "ScaledEncounterLevel");
|
|
int nScaledCallCount = GetLocalInt(oSpawn, "ScaledCallCount");
|
|
|
|
// For simplicity, I'm not supporting creatures with CR < 1.0)
|
|
if (fEncounterLevel < 1.0)
|
|
{
|
|
// We're done... No creatures have CR low enough to add to this encounter
|
|
sRetTemplate = "";
|
|
}
|
|
|
|
else
|
|
{
|
|
// randomly choose a CR at or below the remaining (uncovered) encounter
|
|
// level
|
|
int nCR = Random(FloatToInt(fEncounterLevel)) + 1;
|
|
|
|
// cap to the largest CR we currently support in GetTemplateByCR
|
|
if (nCR > 3)
|
|
{
|
|
nCR = 3;
|
|
}
|
|
|
|
sRetTemplate = GetTemplateByCR(nCR, sGroupType);
|
|
|
|
|
|
// Convert CR to Encounter Level equivalent so it can be correctly
|
|
// subtracted. This does the real scaling work
|
|
float fELEquiv = ConvertCRToELEquiv(IntToFloat(nCR), fEncounterLevel);
|
|
float fElRemaining = 1.0 - fELEquiv;
|
|
|
|
fEncounterLevel = ConvertELEquivToCR(fElRemaining, fEncounterLevel);
|
|
SetLocalFloat(oSpawn, "ScaledEncounterLevel", fEncounterLevel);
|
|
}
|
|
|
|
nScaledCallCount++;
|
|
SetLocalInt(oSpawn, "ScaledCallCount", nScaledCallCount);
|
|
|
|
nSpawnNumber = GetLocalInt(oSpawn, "f_SpawnNumber");
|
|
|
|
if (nScaledCallCount >= nSpawnNumber)
|
|
{
|
|
// reset...
|
|
SetLocalInt(oSpawn, "ScaledInProgress", FALSE);
|
|
}
|
|
}
|
|
|
|
// cr_militia
|
|
if (sTemplate == "cr_militia")
|
|
{
|
|
switch(d2(1))
|
|
{
|
|
case 1:
|
|
sRetTemplate = "cr_militia_m";
|
|
break;
|
|
case 2:
|
|
sRetTemplate = "cr_militia_f";
|
|
break;
|
|
}
|
|
}
|
|
//
|
|
|
|
// pg_guard
|
|
if (sTemplate == "pg_guard")
|
|
{
|
|
switch(d2(1))
|
|
{
|
|
case 1:
|
|
sRetTemplate = "pg_guard_m";
|
|
break;
|
|
case 2:
|
|
sRetTemplate = "pg_guard_f";
|
|
break;
|
|
}
|
|
}
|
|
//
|
|
|
|
// Goblins
|
|
if (sTemplate == "goblins_low")
|
|
{
|
|
if (d2(1) == 1)
|
|
{
|
|
sRetTemplate = "NW_GOBLINA";
|
|
}
|
|
else
|
|
{
|
|
sRetTemplate = "NW_GOBLINB";
|
|
}
|
|
}
|
|
//
|
|
|
|
// Goblins and Boss
|
|
if (sTemplate == "gobsnboss")
|
|
{
|
|
int nIsBossSpawned = GetLocalInt(oSpawn, "IsBossSpawned");
|
|
if (nIsBossSpawned == TRUE)
|
|
{
|
|
// Find the Boss
|
|
object oBoss = GetChildByTag(oSpawn, "NW_GOBCHIEFA");
|
|
|
|
// Check if Boss is Alive
|
|
if (oBoss != OBJECT_INVALID && GetIsDead(oBoss) == FALSE)
|
|
{
|
|
// He's alive, spawn a Peon to keep him Company
|
|
sRetTemplate = "NW_GOBLINA";
|
|
}
|
|
else
|
|
{
|
|
// He's dead, Deactivate Camp!
|
|
SetLocalInt(oSpawn, "SpawnDeactivated", TRUE);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// No Boss, so Let's Spawn Him
|
|
sRetTemplate = "NW_GOBCHIEFA";
|
|
SetLocalInt(oSpawn, "IsBossSpawned", TRUE);
|
|
}
|
|
}
|
|
//
|
|
|
|
// Scaled Encounter
|
|
if (sTemplate == "scaledgobs")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE)
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs == 0)
|
|
{
|
|
nAveragePCLevel = 0;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something with CR 1
|
|
case 1:
|
|
sRetTemplate = "cr1creature";
|
|
break;
|
|
//
|
|
|
|
// Spawn Something with CR 5
|
|
case 5:
|
|
sRetTemplate = "cr5creature";
|
|
break;
|
|
//
|
|
}
|
|
}
|
|
//
|
|
|
|
// Pirates and Boss
|
|
if (sTemplate == "pirates")
|
|
{
|
|
// Delay the Spawn for 45 Minutes
|
|
if (GetLocalInt(oSpawn, "DelayEnded") == FALSE)
|
|
{
|
|
if (GetLocalInt(oSpawn, "DelayStarted") == FALSE)
|
|
{
|
|
// Start the Delay
|
|
SetLocalInt(oSpawn, "DelayStarted", TRUE);
|
|
DelayCommand(20.0, SetLocalInt(oSpawn, "DelayEnded", TRUE));
|
|
}
|
|
sRetTemplate = "";
|
|
return sRetTemplate;
|
|
}
|
|
int nIsBossSpawned = GetLocalInt(oSpawn, "IsBossSpawned");
|
|
if (nIsBossSpawned == TRUE)
|
|
{
|
|
// Find the Boss
|
|
object oBoss = GetChildByTag(oSpawn, "NW_GOBCHIEFA");
|
|
|
|
// Check if Boss is Alive
|
|
if (oBoss != OBJECT_INVALID && GetIsDead(oBoss) == FALSE)
|
|
{
|
|
// He's alive, spawn a Peon to keep him Company
|
|
sRetTemplate = "NW_GOBLINA";
|
|
}
|
|
else
|
|
{
|
|
// He's dead, Deactivate Camp!
|
|
SetLocalInt(oSpawn, "SpawnDeactivated", TRUE);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// No Boss, so Let's Spawn Him
|
|
sRetTemplate = "NW_GOBCHIEFA";
|
|
SetLocalInt(oSpawn, "IsBossSpawned", TRUE);
|
|
}
|
|
}
|
|
//
|
|
|
|
// Advanced Scaled Encounter
|
|
if (sTemplate == "advscaled")
|
|
{
|
|
//Initalize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
|
|
//Cycle through PCs in area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE)
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs == 0)
|
|
{
|
|
nAveragePCLevel = 0;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
|
|
//Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
//Spawn Something with CR 1
|
|
case 1:
|
|
switch (d6())
|
|
{
|
|
case 1: sRetTemplate = "cr1example1";
|
|
case 2: sRetTemplate = "cr1example2";
|
|
case 3: sRetTemplate = "cr1example3";
|
|
case 4: sRetTemplate = "cr1example4";
|
|
case 5: sRetTemplate = "cr1example5";
|
|
case 6: sRetTemplate = "cr1example6";
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
//
|
|
|
|
// Encounters
|
|
if (sTemplate == "encounter")
|
|
{
|
|
// Declare Variables
|
|
int nCounter, nCounterMax;
|
|
string sCurrentTemplate;
|
|
|
|
// Retreive and Increment Counter
|
|
nCounter = GetLocalInt(oSpawn, "GroupCounter");
|
|
nCounterMax = GetLocalInt(oSpawn, "CounterMax");
|
|
nCounter++;
|
|
|
|
// Retreive CurrentTemplate
|
|
sCurrentTemplate = GetLocalString(oSpawn, "CurrentTemplate");
|
|
|
|
// Check CounterMax
|
|
if (nCounter > nCounterMax)
|
|
{
|
|
sCurrentTemplate = "";
|
|
nCounter = 1;
|
|
}
|
|
|
|
if (sCurrentTemplate != "")
|
|
{
|
|
// Spawn Another CurrentTemplate
|
|
sRetTemplate = sCurrentTemplate;
|
|
}
|
|
else
|
|
{
|
|
// Choose New CurrentTemplate and CounterMax
|
|
switch (Random(2))
|
|
{
|
|
// Spawn 1-4 NW_DOGs
|
|
case 0:
|
|
sRetTemplate = "NW_DOG";
|
|
nCounterMax = Random(4) + 1;
|
|
break;
|
|
}
|
|
// Record New CurrentTemplate and CounterMax
|
|
SetLocalString(oSpawn, "CurrentTemplate", sRetTemplate);
|
|
SetLocalInt(oSpawn, "CounterMax", nCounterMax);
|
|
}
|
|
|
|
// Record Counter
|
|
SetLocalInt(oSpawn, "GroupCounter", nCounter);
|
|
}
|
|
//
|
|
|
|
//
|
|
if (sTemplate == "kobolds")
|
|
{
|
|
int nKobold = Random(6) + 1;
|
|
sRetTemplate = "NW_KOBOLD00" + IntToString(nKobold);
|
|
}
|
|
//
|
|
//Sily's Groups
|
|
if (sTemplate == "sily_goblin_scout")
|
|
{
|
|
switch(d2(1))
|
|
{
|
|
case 1:
|
|
sRetTemplate = "an_goblin";
|
|
break;
|
|
case 2:
|
|
sRetTemplate = "an_goblin2";
|
|
break;
|
|
}
|
|
}
|
|
|
|
//:: Scaled group - Flesh & Bone Undead
|
|
if (sTemplate == "grp_flesh")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
/*
|
|
Flesh & Bone Undead
|
|
nw_wight - Wight: 04 HD / CR4
|
|
BONEBAT001 - Bonebat: 04 HD / CR5
|
|
PLAGUEBLIGHT001 - Plague Blight: 06 HD / CR6
|
|
PLAGUEBLIGHT002 - Plague Blight: 09 HD / CR9
|
|
WHEEP001 - Wheep: 10 HD / CR10
|
|
PLAGUEBLIGHT003 - Plague Blight: 12 HD / CR11
|
|
BLOODAMNIOTE001 - Blood Amniote: 10 HD / CR12
|
|
PLAGUEBLIGHT004 - Plague Blight: 15 HD / CR14
|
|
nw_mohrg - Mohrg: 14 HD / CR14
|
|
BONEKLAW001 - Boneklaw: 10 HD / CR16
|
|
PLAGUEBLIGHT005 - Plague Blight: 18 HD / CR17
|
|
SLAUGHTERWIGHT01 - Slaughter Wight: 18 HD / CR21
|
|
BONEKLAW002 - Boneklaw: 14 HD / CR21
|
|
BONEYARD001 - Boneyard: 17 HD / CR22
|
|
BLASPHEME001 - Blaspheme: 18 HD / CR23
|
|
SLAUGHTERWIGHT02 - Slaughter Wight: 21 HD / CR23
|
|
BONEKLAW003 - Boneklaw: 18 HD / CR25
|
|
SLAUGHTERWIGHT03 - Slaughter Wight: 24 HD / CR27
|
|
BONEKLAW004 - Boneklaw: 22 HD / CR28
|
|
BLASPHEME002 - Blaspheme: 22 HD / CR28
|
|
SLAUGHTERWIGHT04 - Slaughter Wight: 28 HD / CR29
|
|
BONEYARD002 - Boneyard: 21 HD / CR30
|
|
BLASPHEME003 - Blaspheme: 26 HD / CR32
|
|
BONEYARD003 - Boneyard: 25 HD / CR34
|
|
ANGELOFDECAY001 - Angel of Decay: 26 HD / CR36
|
|
BLASPHEME004 - Blaspheme: 30 HD / CR37
|
|
ANGELOFDECAY002 - Angel of Decay: 30 HD / CR40
|
|
WINTERWIGHT001 - Winterwight: 32 HD / CR41
|
|
BLASPHEME005 - Blaspheme: 34 HD / CR42
|
|
ANGELOFDECAY003 - Angel of Decay: 34 HD / CR44
|
|
ANGELOFDECAY004 - Angel of Decay: 38 HD / CR46
|
|
HUNEFER001 - Hunefer: 50 HD / CR48
|
|
ANGELOFDECAY005 - Angel of Decay: 42 HD / CR49
|
|
BONEYARD008 - Boneyard: 50 HD / CR62
|
|
HUNEFER002 - Hunefer: 54 HD / CR75
|
|
|
|
|
|
*/
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something with CR 4
|
|
case 1: case 2: case 3: case 4:
|
|
sRetTemplate = "nw_wight"; //:: Wight: 04 HD / CR4
|
|
break;
|
|
//
|
|
// Spawn Something with CR 5
|
|
case 5:
|
|
sRetTemplate = "bonebat001"; //:: Bonebat: 04 HD / CR5
|
|
break;
|
|
//
|
|
// Spawn Something with CR 6-7
|
|
case 6: case 7:
|
|
sRetTemplate = "plagueblight001"; //:: Plague Blight: 06 HD / CR6
|
|
break;
|
|
//
|
|
// Spawn Something with CR 8-9
|
|
case 8: case 9:
|
|
sRetTemplate = "plagueblight002"; //:: Plague Blight: 09 HD / CR9
|
|
break;
|
|
//
|
|
// Spawn Something with CR 10
|
|
case 10:
|
|
sRetTemplate = "wheep001"; //:: Wheep: 10 HD / CR10
|
|
break;
|
|
//
|
|
// Spawn Something with CR 11
|
|
case 11:
|
|
sRetTemplate = "plagueblight003"; //:: Plague Blight: 12 HD / CR11
|
|
break;
|
|
//
|
|
// Spawn Something with CR 12
|
|
case 12:
|
|
sRetTemplate = "bloodamniote001"; //:: Blood Amniote: 10 HD / CR12
|
|
break;
|
|
//
|
|
// Spawn Something with CR 13-14
|
|
case 13: case 14:
|
|
{
|
|
int nRandom = d2(1);
|
|
|
|
if(nRandom == 1)
|
|
{
|
|
sRetTemplate = "plagueblight004"; //:: Plague Blight: 15 HD / CR14
|
|
}
|
|
else
|
|
{
|
|
sRetTemplate = "nw_mohrg"; //:: Mohrg: 14 HD / CR14
|
|
}
|
|
break;
|
|
}
|
|
//
|
|
// Spawn Something with CR 15-16
|
|
case 15: case 16:
|
|
sRetTemplate = "boneklaw001"; //:: Boneklaw: 10 HD / CR16
|
|
break;
|
|
//
|
|
// Spawn Something with CR 17-18
|
|
case 17: case 18:
|
|
sRetTemplate = "plagueblight005"; //:: Plague Blight: 18 HD / CR17
|
|
break;
|
|
//
|
|
// Spawn Something with CR 19-21
|
|
case 19: case 20: case 21:
|
|
{
|
|
int nRandom = d2(1);
|
|
|
|
if(nRandom == 1)
|
|
{
|
|
sRetTemplate = "slaughterwight01"; //:: Slaughter Wight: 18 HD / CR21
|
|
}
|
|
else
|
|
{
|
|
sRetTemplate = "boneklaw002"; //:: Boneklaw: 14 HD / CR21
|
|
}
|
|
break;
|
|
}
|
|
//
|
|
// Spawn Something with CR 22
|
|
case 22:
|
|
sRetTemplate = "boneyard001"; //:: Boneyard: 17 HD / CR22
|
|
break;
|
|
//
|
|
// Spawn Something with CR 23
|
|
case 23:
|
|
{
|
|
int nRandom = d2(1);
|
|
|
|
if(nRandom == 1)
|
|
{
|
|
sRetTemplate = "blaspheme001"; //:: Blaspheme: 18 HD / CR23
|
|
}
|
|
else
|
|
{
|
|
sRetTemplate = "slaughterwight02"; //:: Slaughter Wight: 21 HD / CR23
|
|
}
|
|
break;
|
|
}
|
|
//
|
|
// Spawn Something with CR 24-25
|
|
case 24: case 25:
|
|
sRetTemplate = "boneklaw003"; //:: Boneklaw: 18 HD / CR25
|
|
break;
|
|
//
|
|
// Spawn Something with CR 26-27
|
|
case 26: case 27:
|
|
sRetTemplate = "slaughterwight03"; //:: Slaughter Wight: 24 HD / CR27
|
|
break;
|
|
//
|
|
// Spawn Something with CR 28
|
|
case 28:
|
|
{
|
|
int nRandom = d2(1);
|
|
|
|
if(nRandom == 1)
|
|
{
|
|
sRetTemplate = "boneklaw004"; //:: Boneklaw: 22 HD / CR28
|
|
}
|
|
else
|
|
{
|
|
sRetTemplate = "blaspheme002"; //:: Blaspheme: 22 HD / CR28
|
|
}
|
|
break;
|
|
}
|
|
//
|
|
// Spawn Something with CR 29
|
|
case 29:
|
|
sRetTemplate = "slaughterwight04"; //:: Slaughter Wight: 28 HD / CR29
|
|
break;
|
|
//
|
|
// Spawn Something with CR 30
|
|
case 30:
|
|
sRetTemplate = "boneyard002"; //:: Boneyard: 21 HD / CR30
|
|
break;
|
|
//
|
|
// Spawn Something with CR 31-32
|
|
case 31: case 32:
|
|
sRetTemplate = "blaspheme003"; //:: Blaspheme: 26 HD / CR32
|
|
break;
|
|
//
|
|
// Spawn Something with CR 33-34
|
|
case 33: case 34:
|
|
sRetTemplate = "boneyard003"; //:: Boneyard: 25 HD / CR34
|
|
break;
|
|
//
|
|
// Spawn Something with CR 35-36
|
|
case 35: case 36:
|
|
sRetTemplate = "angelofdecay001"; //:: Angel of Decay: 26 HD / CR36
|
|
break;
|
|
//
|
|
// Spawn Something with CR 37
|
|
case 37:
|
|
sRetTemplate = "blaspheme004"; //:: Blaspheme: 30 HD / CR37
|
|
break;
|
|
//
|
|
// Spawn Something with CR 38-40
|
|
case 38: case 39: case 40:
|
|
sRetTemplate = "angelofdecay002"; //:: Angel of Decay: 30 HD / CR40
|
|
break;
|
|
//
|
|
// Spawn Something with CR 41
|
|
case 41:
|
|
sRetTemplate = "winterwight001"; //:: Winterwight: 32 HD / CR41
|
|
break;
|
|
//
|
|
// Spawn Something with CR 42
|
|
case 42:
|
|
sRetTemplate = "blaspheme005"; //:: Blaspheme: 34 HD / CR42
|
|
break;
|
|
//
|
|
// Spawn Something with CR 43-44
|
|
case 43: case 44:
|
|
sRetTemplate = "angelofdecay003"; //:: Angel of Decay: 34 HD / CR44
|
|
break;
|
|
//
|
|
// Spawn Something with CR 45-46
|
|
case 45: case 46:
|
|
sRetTemplate = "angelofdecay004"; //:: Angel of Decay: 38 HD / CR46
|
|
break;
|
|
//
|
|
// Spawn Something with CR 47-48
|
|
case 47: case 48:
|
|
sRetTemplate = "hunefer001"; //:: Hunefer: 50 HD / CR48
|
|
break;
|
|
//
|
|
// Spawn Something with CR 49-50
|
|
case 49: case 50:
|
|
sRetTemplate = "angelofdecay005"; //:: Angel of Decay: 42 HD / CR49
|
|
break;
|
|
//
|
|
// Default
|
|
default:
|
|
{
|
|
int nRandom = d2(1);
|
|
|
|
if(nRandom == 1)
|
|
{
|
|
sRetTemplate = "boneyard008"; //:: Boneyard: 50 HD / CR62
|
|
}
|
|
else
|
|
{
|
|
sRetTemplate = "hunefer002"; //:: Hunefer: 54 HD / CR75
|
|
}
|
|
break;
|
|
}
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Flesh & Bone Undead
|
|
|
|
//:: Scaled group - Incorporeal Undead
|
|
if (sTemplate == "grp_ghostly")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
/*
|
|
Incorporeal Undead
|
|
ar_shadowrat001 - Shadow Rat, Common: .5 HD / CR2
|
|
haunt - Haunt: 01 HD / CR3
|
|
ar_shadowrat002 - Shadow Rat, Dire: 01 HD / CR3
|
|
shadow003 - Shadow: 01 HD / CR3
|
|
nw_shadow - Shadow: 03 HD / CR4
|
|
ar_shadowrat003 - Shadow Rat, Dire: 04 HD / CR5
|
|
nw_spectre - Spectre 07 HD / CR6
|
|
nw_wraith - Wraith: 05 HD / CR7
|
|
cryptchanter001 - Crypt Chanter: 07 HD / CR8
|
|
spectre001 - Rift Wraith: 15 HD / CR9
|
|
shadow002 - Shadow: 09 HD / CR11
|
|
voidwraith001 - Voidwraith: 06 HD / CR13
|
|
ar_wraith002 - Wraith: 10 HD / CR14
|
|
cryptchanter002 - Crypt Chanter: 12 HD / CR14
|
|
damnedspirit - Damned Spirit: 15 HD / CR17
|
|
quickling002 - Ethereal Cutpurse: 15 HD / CR17
|
|
voidwraith002 - Voidwraith: 09 HD / CR18
|
|
cryptchanter003 - Crypt Chanter: 17 HD / CR19
|
|
dreamvestige001 - Dream Vestige: 17 HD / CR23
|
|
ar_wraith003 - Wraith, Dread: 16 HD / CR24
|
|
voidwraith003 - Voidwraith: 12 HD / CR27
|
|
dreamvestige002 - Dream Vestige: 21 HD / CR28
|
|
ar_wraith004 - Wraith, Dread: 20 HD / CR29
|
|
dreamvestige003 - Dream Vestige: 21 HD / CR32
|
|
nightwalker001 - Nightwalker: 21 HD / CR32
|
|
voidwraith004 - Voidwraith: 15 HD / CR33
|
|
ar_wraith005 - Wraith, Dread: 24 HD / CR35
|
|
roguespectre - Rogue Spectre: 30 HD / CR37
|
|
voidwraith005 - Voidwraith: 18 HD / CR40
|
|
ar_wraith006 - Wraith, Dread: 28 HD / CR40
|
|
ar_wraith007 - Wraith, Dread: 32 HD / CR45
|
|
demonshadow1 - Demonic Shadow Fiend: 46 HD / CR46
|
|
dw_ghost001 - Dwarven Ghost, Wizard: 30 HD / CR 50
|
|
|
|
*/
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something with CR 2
|
|
case 1: case 2:
|
|
sRetTemplate = "ar_shadowrat001"; //:: Shadow Rat, Common: .5 HD / CR2
|
|
break;
|
|
//
|
|
// Spawn Something with CR 3
|
|
case 3:
|
|
{
|
|
int nRandom = d3(1);
|
|
|
|
if(nRandom == 1)
|
|
{
|
|
sRetTemplate = "haunt"; //:: Haunt: 01 HD / CR3
|
|
}
|
|
else if (nRandom == 2)
|
|
{
|
|
sRetTemplate = "ar_shadowrat002"; //:: Shadow Rat, Dire: 01 HD / CR3
|
|
}
|
|
else
|
|
{
|
|
sRetTemplate = "shadow003"; //:: Shadow: 01 HD / CR3
|
|
}
|
|
break;
|
|
}
|
|
//
|
|
// Spawn Something with CR 4
|
|
case 4:
|
|
sRetTemplate = "nw_shadow"; //:: Shadow: 03 HD / CR4
|
|
break;
|
|
//
|
|
// Spawn Something with CR 5
|
|
case 5:
|
|
sRetTemplate = "ar_shadowrat003"; //:: Shadow Rat, Dire: 04 HD / CR5
|
|
break;
|
|
//
|
|
// Spawn Something with CR 6
|
|
case 6:
|
|
sRetTemplate = "nw_spectre"; //:: Spectre 07 HD / CR6
|
|
break;
|
|
//
|
|
// Spawn Something with CR 7
|
|
case 7:
|
|
sRetTemplate = "nw_wraith"; //:: Wraith: 05 HD / CR7
|
|
break;
|
|
//
|
|
// Spawn Something with CR 8
|
|
case 8:
|
|
sRetTemplate = "cryptchanter001"; //:: Crypt Chanter: 07 HD / CR8
|
|
break;
|
|
//
|
|
// Spawn Something with CR 9
|
|
case 9:
|
|
sRetTemplate = "spectre001"; //:: Rift Wraith: 15 HD / CR9
|
|
break;
|
|
//
|
|
// Spawn Something with CR 10-11
|
|
case 10: case 11:
|
|
sRetTemplate = "shadow002"; //:: Shadow: 09 HD / CR11
|
|
break;
|
|
//
|
|
// Spawn Something with CR 12-13
|
|
case 12: case 13:
|
|
sRetTemplate = "voidwraith001"; //:: Voidwraith: 06 HD / CR13
|
|
break;
|
|
//
|
|
// Spawn Something with CR 14
|
|
case 14:
|
|
sRetTemplate = "ar_wraith002"; //:: Wraith: 10 HD / CR14
|
|
break;
|
|
//
|
|
// Spawn Something with CR 15-17
|
|
case 15: case 16: case 17:
|
|
{
|
|
int nRandom = d2(1);
|
|
|
|
if(nRandom == 1)
|
|
{
|
|
sRetTemplate = "damnedspirit"; //:: Damned Spirit: 15 HD / CR17
|
|
}
|
|
else
|
|
{
|
|
sRetTemplate = "quickling002"; //:: Ethereal Cutpurse: 15 HD / CR17
|
|
}
|
|
break;
|
|
}
|
|
//
|
|
// Spawn Something with CR 18
|
|
case 18:
|
|
sRetTemplate = "voidwraith002"; //:: Voidwraith: 09 HD / CR18
|
|
break;
|
|
//
|
|
// Spawn Something with CR 19
|
|
case 19:
|
|
sRetTemplate = "cryptchanter003"; //:: Crypt Chanter: 17 HD / CR19
|
|
break;
|
|
//
|
|
// Spawn Something with CR 20-23
|
|
case 20: case 21: case 22: case 23:
|
|
sRetTemplate = "dreamvestige001"; //:: Dream Vestige: 17 HD / CR23
|
|
break;
|
|
//
|
|
// Spawn Something with CR 24
|
|
case 24:
|
|
sRetTemplate = "ar_wraith003"; //:: Wraith, Dread: 16 HD / CR24
|
|
break;
|
|
//
|
|
// Spawn Something with CR 25-27
|
|
case 25: case 26: case 27:
|
|
sRetTemplate = "voidwraith003"; //:: Voidwraith: 12 HD / CR27
|
|
break;
|
|
//
|
|
// Spawn Something with CR 28
|
|
case 28:
|
|
sRetTemplate = "dreamvestige002"; //:: Dream Vestige: 21 HD / CR28
|
|
break;
|
|
//
|
|
// Spawn Something with CR 29
|
|
case 29:
|
|
sRetTemplate = "ar_wraith004"; //:: Wraith, Dread: 20 HD / CR29
|
|
break;
|
|
//
|
|
// Spawn Something with CR 30-32
|
|
case 30: case 31: case 32:
|
|
{
|
|
int nRandom = d2(1);
|
|
|
|
if(nRandom == 1)
|
|
{
|
|
sRetTemplate = "dreamvestige003"; //:: Dream Vestige: 21 HD / CR32
|
|
}
|
|
else
|
|
{
|
|
sRetTemplate = "nightwalker001"; //:: Nightwalker: 21 HD / CR32
|
|
}
|
|
break;
|
|
}
|
|
//
|
|
// Spawn Something with CR 33
|
|
case 33:
|
|
sRetTemplate = "voidwraith004"; //:: Voidwraith: 15 HD / CR33
|
|
break;
|
|
//
|
|
// Spawn Something with CR 34-35
|
|
case 34: case 35:
|
|
sRetTemplate = "ar_wraith005"; //:: Wraith, Dread: 24 HD / CR35
|
|
break;
|
|
//
|
|
// Spawn Something with CR 36-37
|
|
case 36: case 37:
|
|
sRetTemplate = "roguespectre"; //:: Rogue Spectre: 30 HD / CR37
|
|
break;
|
|
//
|
|
// Spawn Something with CR 38-40
|
|
case 38: case 39: case 40:
|
|
{
|
|
int nRandom = d2(1);
|
|
|
|
if(nRandom == 1)
|
|
{
|
|
sRetTemplate = "voidwraith005"; //:: Voidwraith: 18 HD / CR40
|
|
}
|
|
else
|
|
{
|
|
sRetTemplate = "ar_wraith006"; //:: Wraith, Dread: 28 HD / CR40
|
|
}
|
|
break;
|
|
}
|
|
//
|
|
// Spawn Something with CR 41-45
|
|
case 41: case 42: case 43: case 44: case 45:
|
|
sRetTemplate = "ar_wraith007"; //:: Wraith, Dread: 32 HD / CR45
|
|
break;
|
|
//
|
|
// Spawn Something with CR 46
|
|
case 46:
|
|
sRetTemplate = "demonshadow1"; //:: Demonic Shadow Fiend: 46 HD / CR46
|
|
break;
|
|
//
|
|
// Default
|
|
default:
|
|
{
|
|
int nRandom = d3(1);
|
|
|
|
if(nRandom == 1)
|
|
{
|
|
sRetTemplate = "ar_wraith007"; //:: Wraith, Dread: 32 HD / CR45
|
|
}
|
|
else if(nRandom == 2)
|
|
{
|
|
sRetTemplate = "demonshadow1"; //:: Demonic Shadow Fiend: 46 HD / CR46
|
|
}
|
|
else
|
|
{
|
|
sRetTemplate = "dw_ghost001"; //:: Dwarven Ghost, Wizard: 30 HD / CR 50
|
|
}
|
|
break;
|
|
}
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Incorporeal Undead
|
|
|
|
|
|
//:://////////////////////////////////////////////
|
|
//:: Individual scaled spawns below
|
|
//::
|
|
//:://////////////////////////////////////////////
|
|
|
|
//:: Scaled group - Angel of Decay
|
|
if (sTemplate == "grp_aod")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 36
|
|
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10:
|
|
case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19:
|
|
case 20: case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29:
|
|
case 30: case 31: case 32: case 33: case 34: case 35: case 36:
|
|
sRetTemplate = "angelofdecay001"; //:: Angel of Decay: 26 HD / CR36
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 40
|
|
case 37: case 38: case 39: case 40:
|
|
sRetTemplate = "angelofdecay001"; //:: Angel of Decay: 30 HD / CR40
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 44
|
|
case 41: case 42: case 43: case 44:
|
|
sRetTemplate = "angelofdecay003"; //:: Angel of Decay: 34 HD / CR44
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 48
|
|
case 45: case 46: case 47: case 48:
|
|
sRetTemplate = "angelofdecay004"; //:: Angel of Decay: 38 HD / CR48
|
|
break;
|
|
//
|
|
// Spawn the Default mob
|
|
default:
|
|
sRetTemplate = "angelofdecay005"; //:: Angel of Decay: 42 HD / CR49
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Angel of Decay
|
|
|
|
//:: Scaled group - Blaspheme
|
|
if (sTemplate == "grp_blaspheme")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 24
|
|
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10:
|
|
case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19:
|
|
case 20: case 21: case 22: case 23: case 24:
|
|
sRetTemplate = "blaspheme001"; //:: blaspheme001 / CR23
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 29
|
|
case 25: case 26: case 27: case 28: case 29:
|
|
sRetTemplate = "blaspheme002"; //:: Blaspheme: 22 HD / CR28
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 33
|
|
case 30: case 31: case 32: case 33:
|
|
sRetTemplate = "blaspheme003"; //:: Blaspheme: 26 HD / CR32
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 40
|
|
case 34: case 35: case 36: case 37: case 38: case 39: case 40:
|
|
sRetTemplate = "blaspheme004"; //:: Blaspheme: 30 HD / CR37
|
|
break;
|
|
//
|
|
// Spawn the Default mob
|
|
default:
|
|
sRetTemplate = "blaspheme005"; //:: Blaspheme: 34 HD / CR42
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Blaspheme
|
|
|
|
//:: Scaled group - Bleakborn
|
|
if (sTemplate == "grp_bleakborn")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 24
|
|
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
|
|
sRetTemplate = "bleakborn001"; //:: Bleakborn: 06 HD / CR9
|
|
break;
|
|
//
|
|
// Spawn the Default mob
|
|
default:
|
|
sRetTemplate = "bleakborn002"; //:: Bleakborn: 10 HD / CR13
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Bleakborn
|
|
|
|
//:: Scaled group - Boneklaw
|
|
if (sTemplate == "grp_boneklaw")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 16
|
|
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10:
|
|
case 11: case 12: case 13: case 14: case 15: case 16:
|
|
sRetTemplate = "boneclaw001"; //:: Boneklaw: 10 HD / CR16
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 21
|
|
case 17: case 18: case 19: case 20: case 21:
|
|
sRetTemplate = "boneclaw002"; //:: Boneklaw: 14 HD / CR21
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 25
|
|
case 22: case 23: case 24: case 25:
|
|
sRetTemplate = "boneclaw003"; //:: Boneklaw: 18 HD / CR25
|
|
break;
|
|
//
|
|
// Spawn the Default mob
|
|
default:
|
|
sRetTemplate = "boneclaw004"; //:: Boneklaw: 22 HD / CR28
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Boneklaw
|
|
|
|
//:: Scaled group - Boneyard
|
|
if (sTemplate == "grp_boneyard")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 23
|
|
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10:
|
|
case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19:
|
|
case 20: case 21: case 22: case 23:
|
|
sRetTemplate = "boneyard001"; //:: Boneyard: 17 HD / CR23
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 30
|
|
case 24: case 25: case 26: case 27: case 28: case 29: case 30:
|
|
sRetTemplate = "boneyard002"; //:: Boneklaw: 14 HD / CR21
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 34-49
|
|
case 31: case 32: case 33: case 34: case 35: case 36: case 37: case 38: case 39: case 40:
|
|
case 41: case 42: case 43: case 44: case 45: case 46: case 47: case 48: case 49:
|
|
sRetTemplate = "boneyard003"; //:: Boneklaw: 18 HD / CR25
|
|
break;
|
|
//
|
|
// Spawn the Default mob
|
|
default:
|
|
sRetTemplate = "boneyard008"; //:: Boneyard: 50 HD / CR62
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Boneyard
|
|
|
|
//:: Scaled group - Cinderspawn
|
|
if (sTemplate == "grp_cinder")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 15
|
|
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10:
|
|
case 11: case 12: case 13: case 14: case 15:
|
|
sRetTemplate = "cinderspawn001"; //:: Cinderspawn: 10 HD / CR14
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 21
|
|
case 16: case 17: case 18: case 19: case 20: case 21:
|
|
sRetTemplate = "cinderspawn002"; //:: Cinderspawn: 14 HD / CR20
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 26
|
|
case 22: case 23: case 24: case 25: case 26:
|
|
sRetTemplate = "cinderspawn003"; //:: Cinderspawn: 18 HD / CR25
|
|
break;
|
|
// Spawn Something up to CR 31
|
|
case 27: case 28: case 29: case 30: case 31:
|
|
sRetTemplate = "cinderspawn004"; //:: Cinderspawn: 22 HD / CR30
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 32-41
|
|
case 32: case 33: case 34: case 35: case 36: case 37: case 38: case 39: case 40:
|
|
case 41:
|
|
sRetTemplate = "cinderspawn005"; //:: Cinderspawn: 26 HD / CR35
|
|
break;
|
|
//
|
|
// Spawn the Default mob
|
|
default:
|
|
sRetTemplate = "cinderspawn006"; //:: Cinderspawn: 30 HD / CR41
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Cinderspawn
|
|
|
|
//:: Scaled group - Crypt Chanter
|
|
if (sTemplate == "grp_chanter")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 8
|
|
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
|
|
sRetTemplate = "cryptchanter001"; //:: Crypt Chanter: 07 HD / CR8
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 14
|
|
case 9: case 10: case 11: case 12: case 13: case 14:
|
|
sRetTemplate = "cryptchanter002"; //:: Crypt Chanter: 12 HD / CR14
|
|
break;
|
|
//
|
|
// Spawn the Default mob
|
|
default:
|
|
sRetTemplate = "cryptchanter003"; //:: Crypt Chanter: 17 HD / CR19
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Crypt Chanter
|
|
|
|
//:: Scaled group - Dream Vestige
|
|
if (sTemplate == "grp_vestige")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 23
|
|
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10:
|
|
case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19:
|
|
case 20: case 21: case 22: case 23:
|
|
sRetTemplate = "dreamvestige001"; //:: Dream Vestige: 17 HD / CR23
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 28
|
|
case 25: case 26: case 27: case 28:
|
|
sRetTemplate = "dreamvestige002"; //:: Dream Vestige: 21 HD / CR28
|
|
break;
|
|
//
|
|
// Spawn the Default mob
|
|
default:
|
|
sRetTemplate = "dreamvestige003"; //:: Dream Vestige: 25 HD / CR32
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Dream Vestige
|
|
|
|
//:: Scaled group - Ghouls & Ghasts
|
|
if (sTemplate == "grp_ghasts")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something with CR 1-4
|
|
case 1: case 2: case 3: case 4:
|
|
sRetTemplate = "nw_ghoul"; //:: Ghoul: 02 HD / CR3
|
|
break;
|
|
//
|
|
// Spawn Something with CR 5-8
|
|
case 5: case 6: case 7: case 8:
|
|
sRetTemplate = "NW_GHAST"; //:: Ghast: 04 HD / CR5
|
|
break;
|
|
//
|
|
// Spawn Something with 9-10
|
|
case 9: case 10:
|
|
sRetTemplate = "GHAST003"; //:: Ghast: 05 HD / CR7
|
|
break;
|
|
//
|
|
// Spawn Default
|
|
default:
|
|
sRetTemplate = "GHAST002"; //:: Ghast: 08 HD / CR10
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Ghouls & Ghasts
|
|
|
|
//:: Scaled group - Hulking Corpse
|
|
if (sTemplate == "grp_hulkcorpse")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 18
|
|
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10:
|
|
case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18:
|
|
sRetTemplate = "hulkcorpse001"; //:: Hulking Corpse: 20 HD / CR17
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 22
|
|
case 19: case 20: case 21: case 22:
|
|
sRetTemplate = "hulkcorpse002"; //:: Hulking Corpse: 24 HD / CR20
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 26
|
|
case 23: case 24: case 25: case 26:
|
|
sRetTemplate = "hulkcorpse003"; //:: Hulking Corpse: 28 HD / CR23
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 30
|
|
case 27: case 28: case 29: case 30:
|
|
sRetTemplate = "hulkcorpse004"; //:: Hulking Corpse: 32 HD / CR27
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 34
|
|
case 31: case 32: case 33: case 34:
|
|
sRetTemplate = "hulkcorpse005"; //:: Hulking Corpse: 36 HD / CR29
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 36
|
|
case 35: case 36:
|
|
sRetTemplate = "hulkcorpse006"; //:: Hulking Corpse: 40 HD / CR32
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 38
|
|
case 37: case 38:
|
|
sRetTemplate = "hulkcorpse007"; //:: Hulking Corpse: 44 HD / CR35
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 40
|
|
case 39: case 40:
|
|
sRetTemplate = "hulkcorpse008"; //:: Hulking Corpse: 48 HD / CR38
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 44
|
|
case 41: case 42: case 43: case 44:
|
|
sRetTemplate = "hulkcorpse009"; //:: Hulking Corpse: 52 HD / CR41
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 48
|
|
case 45: case 46: case 47: case 48:
|
|
sRetTemplate = "hulkcorpse010"; //:: Hulking Corpse: 56 HD / CR44
|
|
break;
|
|
//
|
|
// Spawn the Default mob
|
|
default:
|
|
sRetTemplate = "hulkcorpse011"; //:: Hulking Corpse: 60 HD / CR47
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Hulking Corpse
|
|
|
|
//:: Scaled group - Mummy
|
|
if (sTemplate == "grp_mummy")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 5
|
|
case 1: case 2: case 3: case 4: case 5:
|
|
sRetTemplate = "nw_mummy"; //:: Mummy: 06HD / CR5
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 10
|
|
case 6: case 7: case 8: case 9: case 10:
|
|
{
|
|
int nRandom = d2(1);
|
|
|
|
if(nRandom == 1)
|
|
{
|
|
sRetTemplate = "nw_mumcleric"; //:: Greater Mummy: 12 HD / CR10
|
|
}
|
|
else
|
|
{
|
|
sRetTemplate = "nw_mumfight"; //:: Warrior Mummy: 12 HD / CR10
|
|
}
|
|
break;
|
|
}
|
|
//
|
|
// Spawn Something up to CR 11-18
|
|
case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18:
|
|
sRetTemplate = "nw_mummyboss"; //:: Mummy Lord: 12 HD / CR11
|
|
break;
|
|
//
|
|
// Spawn the Default mob
|
|
default:
|
|
sRetTemplate = "poa_mummy001"; //:: Greater Mummy of Orcus: 25 HD / CR19
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Mummy
|
|
|
|
//:: Scaled group - Plague Blight
|
|
if (sTemplate == "grp_blight")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 8
|
|
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
|
|
sRetTemplate = "plagueblight001"; //:: Plague Blight: 06 HD / CR6
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 11
|
|
case 9: case 10: case 11:
|
|
sRetTemplate = "plagueblight002"; //:: Plague Blight: 09 HD / CR9
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 13
|
|
case 12: case 13:
|
|
sRetTemplate = "plagueblight003"; //:: Plague Blight: 12 HD / CR11
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 16
|
|
case 14: case 15: case 16:
|
|
sRetTemplate = "plagueblight004"; //:: Plague Blight: 15 HD / CR14
|
|
break;
|
|
//
|
|
// Spawn the Default mob
|
|
default:
|
|
sRetTemplate = "plagueblight005"; //:: Plague Blight: 18 HD / CR17
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Plague Blight
|
|
|
|
//:: Scaled group - Shadow
|
|
if (sTemplate == "grp_shadow")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 3
|
|
case 1: case 2: case 3:
|
|
{
|
|
int nRandom = d3(1);
|
|
|
|
if(nRandom == 1)
|
|
{
|
|
sRetTemplate = "haunt"; //:: Haunt: 01 HD / CR3
|
|
}
|
|
else if (nRandom == 2)
|
|
{
|
|
sRetTemplate = "ar_shadowrat002"; //:: Shadow Rat, Dire: 01 HD / CR3
|
|
}
|
|
else
|
|
{
|
|
sRetTemplate = "shadow003"; //:: Shadow: 01 HD / CR3
|
|
}
|
|
break;
|
|
}
|
|
//
|
|
// Spawn Something with CR 4
|
|
case 4:
|
|
sRetTemplate = "nw_shadow"; //:: Shadow: 03 HD / CR4
|
|
break;
|
|
//
|
|
// Spawn Something with CR 5-9
|
|
case 5: case 6: case 7: case 8: case 9:
|
|
sRetTemplate = "ar_shadowrat003"; //:: Shadow Rat, Dire: 04 HD / CR5
|
|
break;
|
|
//
|
|
// Spawn Something with CR 10-40
|
|
case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19:
|
|
case 20: case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29:
|
|
case 30: case 31: case 32: case 33: case 34: case 35: case 36: case 37: case 38: case 39:
|
|
case 40:
|
|
sRetTemplate = "shadow002"; //:: Shadow: 09 HD / CR11
|
|
break;
|
|
//
|
|
// Spawn Default Mob
|
|
default:
|
|
sRetTemplate = "demonshadow1"; //:: Demonic Shadow Fiend: 46 HD / CR46
|
|
break;
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Shadow
|
|
|
|
//:: Scaled group - Voidwraith
|
|
if (sTemplate == "grp_void")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 13
|
|
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10:
|
|
case 11: case 12: case 13:
|
|
sRetTemplate = "voidwraith001"; //:: Voidwraith: 06 HD / CR13
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 18
|
|
case 14: case 15: case 16: case 17: case 18:
|
|
sRetTemplate = "voidwraith002"; //:: Voidwraith: 09 HD / CR18
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 27
|
|
case 19: case 20: case 21: case 22: case 23:case 25: case 26: case 27:
|
|
sRetTemplate = "voidwraith003"; //:: Voidwraith: 12 HD / CR27
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 33
|
|
case 28: case 29: case 30: case 31: case 32: case 33:
|
|
sRetTemplate = "voidwraith004"; //:: Voidwraith: 15 HD / CR33
|
|
break;
|
|
//
|
|
// Spawn the Default mob
|
|
default:
|
|
sRetTemplate = "voidwraith005"; //:: Voidwraith: 18 HD / CR40
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Voidwraith
|
|
|
|
//:: Scaled group - Wight
|
|
if (sTemplate == "grp_wight")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 5
|
|
case 1: case 2: case 3: case 4: case 5:
|
|
sRetTemplate = "nw_wight"; //:: Wight: 04 HD / CR4
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 9
|
|
case 6: case 7: case 8: case 9:
|
|
sRetTemplate = "ra_wight002"; //:: Wight: 08 HD / CR8
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 13
|
|
case 10: case 11: case 12: case 13:
|
|
sRetTemplate = "ra_wight003"; //:: Wight, Advanced: 12 HD / CR12
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 18
|
|
case 14: case 15: case 16: case 17: case 18:
|
|
sRetTemplate = "ra_wight004"; //:: Wight, Advanced: 16 HD / CR16
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 22
|
|
case 19: case 20: case 21: case 22:
|
|
sRetTemplate = "slaughterwight01"; //:: Slaughter Wight: 18 HD / CR21
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 24
|
|
case 23: case 24:
|
|
sRetTemplate = "slaughterwight02"; //:: Slaughter Wight: 21 HD / CR23
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 28
|
|
case 25: case 26: case 27: case 28:
|
|
sRetTemplate = "slaughterwight03"; //:: Slaughter Wight: 24 HD / CR27
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 42:
|
|
case 29: case 30: case 31: case 32: case 33: case 34: case 35: case 36: case 37: case 38:
|
|
case 39: case 40: case 41: case 42: case 43: case 44: case 45: case 46: case 47: case 48:
|
|
case 49: case 50:
|
|
sRetTemplate = "slaughterwight04"; //:: Slaughter Wight: 28 HD / CR29
|
|
break;
|
|
//
|
|
// Spawn the Default mob
|
|
default:
|
|
sRetTemplate = "winterwight001"; //:: Winterwight: 32 HD / CR41
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Wight
|
|
|
|
//:: Scaled group - Wraith
|
|
if (sTemplate == "grp_wraith")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 10
|
|
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10:
|
|
sRetTemplate = "nw_wraith"; //:: Wraith: 05 HD / CR7
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 16
|
|
case 11: case 12: case 13: case 14: case 15: case 16:
|
|
sRetTemplate = "ar_wraith002"; //:: Wraith: 10 HD / CR14
|
|
break;
|
|
//
|
|
// Spawn the Default mob
|
|
default:
|
|
sRetTemplate = "ar_wraith008"; //:: Wraith, Advanced: 14 HD / CR19
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Wraith
|
|
|
|
//:: Scaled group - Wraith, Dread
|
|
if (sTemplate == "grp_dread")
|
|
{
|
|
// Initialize Variables
|
|
int nTotalPCs;
|
|
int nTotalPCLevel;
|
|
int nAveragePCLevel;
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
// Cycle through PCs in Area
|
|
object oPC = GetFirstObjectInArea(oArea);
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
|
{
|
|
nTotalPCs++;
|
|
nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC);
|
|
}
|
|
oPC = GetNextObjectInArea(oArea);
|
|
}
|
|
if (nTotalPCs > 0)
|
|
{
|
|
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
|
}
|
|
else
|
|
{
|
|
nAveragePCLevel = 3;
|
|
}
|
|
// Select a Creature to Spawn
|
|
switch (nAveragePCLevel)
|
|
{
|
|
// Spawn Something up to CR 24
|
|
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10:
|
|
case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19:
|
|
case 20: case 21: case 22: case 23: case 24:
|
|
sRetTemplate = "ar_wraith003"; //:: Wraith, Dread: 16 HD / CR24
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 29
|
|
case 25: case 26: case 27: case 28: case 29:
|
|
sRetTemplate = "ar_wraith004"; //:: Wraith, Dread: 20 HD / CR29
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 35
|
|
case 30: case 31: case 32: case 33: case 34: case 35:
|
|
sRetTemplate = "ar_wraith005"; //:: Wraith, Dread: 24 HD / CR35
|
|
break;
|
|
//
|
|
// Spawn Something up to CR 40
|
|
case 36: case 37: case 38: case 39: case 40:
|
|
sRetTemplate = "ar_wraith006"; //:: Wraith, Dread: 28 HD / CR40
|
|
break;
|
|
//
|
|
// Spawn the Default mob
|
|
default:
|
|
sRetTemplate = "ar_wraith007"; //:: Wraith, Dread: 32 HD / CR45
|
|
break;
|
|
//
|
|
}
|
|
|
|
}
|
|
//:: End Scaled group - Wraith, Dread
|
|
|
|
|
|
// -------------------------------------------
|
|
// Only Make Modifications Between These Lines
|
|
//
|
|
return sRetTemplate;
|
|
}
|