//
// Spawn Camp
//
//
// CampNumP
// CampNumC
// CampRadius
// CampTrigger
// CampTriggerScript
//
// RW       : Random Walk
// SF       : Spawn Facing Camp
// SG       : Spawn Group
// LT00     : Loot Table
// CD000|T0 : Corpse Decay
// PL0|T00  : Placeable Trap Disabled
// DT000    : Death Script
// RH000    : Return Home
//
//
#include "inc_debug"

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);
//
//
void SetCampSpawn(object oCamp, string sCamp, location lCamp)
{
//:: Declare major variables
	int nDifficulty = 0;
    int nTotalPCs = 0;
	
	object oArea = GetArea(OBJECT_SELF);

//:: Cycle through PCs in Area
    object oPC = GetFirstObjectInArea(oArea);
	
//:: Get number of PCs in party	
	while (oPC != OBJECT_INVALID)
	{
		if (GetIsPC(oPC) || 
			(GetMaster(oPC) != OBJECT_INVALID && 
			GetMaster(GetMaster(oPC)) == OBJECT_INVALID))  //:: Only PCs & Henchmen count.
            {
                nTotalPCs++;
            }
            oPC = GetNextObjectInArea(oArea);
    }

//:: Calculate difficluty		
	if (nTotalPCs >= 5) 
		{nDifficulty = nDifficulty + (nTotalPCs-3) / 2;}
	
	if (nDifficulty >= 8)
		{(nDifficulty == 8);}
	
	if (nDifficulty <= 0)
		{(nDifficulty == 0);}

	if (DEBUG) DelayCommand(0.0f, SpeakString("Difficulty Level is: "+IntToString(nDifficulty), TALKVOLUME_SHOUT));
		
//
// Place Custom Camps Here
// -------------------------------------------

//:: Boneklaw patrol
	if (sCamp == "boneklaw_patrol")
    {
	//:: Set Number of Placeables
		int nPlcNum = 0;
        SetLocalInt(oCamp, "CampNumP", nPlcNum);

    //:: Set Number of Creatures
		int nSpawnNum = 2 + nDifficulty + d3(2);		
        SetLocalInt(oCamp, "CampNumC", nSpawnNum);
		
	//:: Set Radius of Camp
        SetLocalFloat(oCamp, "CampRadius", 10.0);

        // Set Creature 0 to be Trigger
        // Script 00 : Kill him and the Camp Despawns
        // SetLocalString(oCamp, "CampTrigger", "C0");
        // SetLocalInt(oCamp, "CampTriggerScript", 0);

	//:: Set Placeable 0 to be Camp Center
        SetLocalString(oCamp, "CampCenter", "P0");

	//:: Set Placeable 0 and Spawn Flags
	//:: First Placeable always Spawns at Center of Camp
	//:: If CampCenter Is Not Set
        //SetLocalString(oCamp, "CampP0", "poa_corpse001");
        //SetLocalString(oCamp, "CampP0_Flags", "SP_SF");

		// Set Creature 0 and Spawn Flags
		SetLocalString(oCamp, "CampC0", "grp_boneklaw");
		SetLocalString(oCamp, "CampC0_Flags", "SP_RW_SG");

		// Set Creature 1 and Spawn Flags
		SetLocalString(oCamp, "CampC1", "grp_boneklaw");
		SetLocalString(oCamp, "CampC1_Flags", "SP_RW_SG");
		
		// Set Creature 2 and Spawn Flags
		SetLocalString(oCamp, "CampC2", "grp_boneklaw");
		SetLocalString(oCamp, "CampC2_Flags", "SP_RW_SG");
		
		// Set Creature 3 and Spawn Flags
		SetLocalString(oCamp, "CampC3", "grp_boneklaw");
		SetLocalString(oCamp, "CampC3_Flags", "SP_RW_SG");

		// Set Creature 4 and Spawn Flags
		SetLocalString(oCamp, "CampC4", "grp_boneklaw");
		SetLocalString(oCamp, "CampC4_Flags", "SP_RW_SG");

		// Set Creature 5 and Spawn Flags
		SetLocalString(oCamp, "CampC5", "grp_boneklaw");
		SetLocalString(oCamp, "CampC5_Flags", "SP_RW_SG");
		
		// Set Creature 6 and Spawn Flags
		SetLocalString(oCamp, "CampC6", "grp_boneklaw");
		SetLocalString(oCamp, "CampC6_Flags", "SP_RW_SG");

		// Set Creature 7 and Spawn Flags
		SetLocalString(oCamp, "CampC7", "grp_boneklaw");
		SetLocalString(oCamp, "CampC7_Flags", "SP_RW_SG");					

		// Set Creature 8 and Spawn Flags
		SetLocalString(oCamp, "CampC8", "grp_boneklaw");
		SetLocalString(oCamp, "CampC8_Flags", "SP_RW_SG");

		// Set Creature 9 and Spawn Flags
		SetLocalString(oCamp, "CampC9", "grp_boneklaw");
		SetLocalString(oCamp, "CampC9_Flags", "SP_RW_SG");
		
		// Set Creature 10 and Spawn Flags
		SetLocalString(oCamp, "CampC10", "grp_boneklaw");
		SetLocalString(oCamp, "CampC10_Flags", "SP_RW_SG");					
	
    }
//:: Boneklaw patrol

//:: Ghouls, Ghasts & supper
	if (sCamp == "ghoul_feast")
    {
	//:: Set Number of Placeables
		int nPlcNum = 2 + d4(1);
        SetLocalInt(oCamp, "CampNumP", nPlcNum);

    //:: Set Number of Creatures
		int nSpawnNum = 1 + nDifficulty + d4(2);		
        SetLocalInt(oCamp, "CampNumC", nSpawnNum);
		
	//:: Set Radius of Camp
        SetLocalFloat(oCamp, "CampRadius", 2.0);

        // Set Creature 0 to be Trigger
        // Script 00 : Kill him and the Camp Despawns
        // SetLocalString(oCamp, "CampTrigger", "C0");
        // SetLocalInt(oCamp, "CampTriggerScript", 0);

	//:: Set Placeable 0 to be Camp Center
        SetLocalString(oCamp, "CampCenter", "P0");

	//:: Set Placeable 0 and Spawn Flags
	//:: First Placeable always Spawns at Center of Camp
	//:: If CampCenter Is Not Set
        SetLocalString(oCamp, "CampP0", "poa_corpse001");
        SetLocalString(oCamp, "CampP0_Flags", "SP_SF");

        // Set Placeable 1 and Spawn Flags
        SetLocalString(oCamp, "CampP1", "plc_bloodstain");
        SetLocalString(oCamp, "CampP1_Flags", "SP_PL0");
		
        // Set Placeable 2 and Spawn Flags
        SetLocalString(oCamp, "CampP2", "plc_bloodstain");
        SetLocalString(oCamp, "CampP2_Flags", "SP_PL0");

        // Set Placeable 3 and Spawn Flags
        SetLocalString(oCamp, "CampP3", "plc_bloodstain");
        SetLocalString(oCamp, "CampP3_Flags", "SP_PL0");			

        // Set Placeable 4 and Spawn Flags
        SetLocalString(oCamp, "CampP4", "plc_bloodstain");
        SetLocalString(oCamp, "CampP4_Flags", "SP_PL0");	
		
		// Set Creature 0 and Spawn Flags
		SetLocalString(oCamp, "CampC0", "grp_ghasts");
		SetLocalString(oCamp, "CampC0_Flags", "SP_RW_SG");

		// Set Creature 1 and Spawn Flags
		SetLocalString(oCamp, "CampC1", "grp_ghasts");
		SetLocalString(oCamp, "CampC1_Flags", "SP_SF_SG");
		
		// Set Creature 2 and Spawn Flags
		SetLocalString(oCamp, "CampC2", "grp_ghasts");
		SetLocalString(oCamp, "CampC2_Flags", "SP_SF_SG");
		
		// Set Creature 3 and Spawn Flags
		SetLocalString(oCamp, "CampC3", "grp_ghasts");
		SetLocalString(oCamp, "CampC3_Flags", "SP_SF_SG");

		// Set Creature 4 and Spawn Flags
		SetLocalString(oCamp, "CampC4", "grp_ghasts");
		SetLocalString(oCamp, "CampC4_Flags", "SP_RW_SG");

		// Set Creature 5 and Spawn Flags
		SetLocalString(oCamp, "CampC5", "grp_ghasts");
		SetLocalString(oCamp, "CampC5_Flags", "SP_SF_SG");
		
		// Set Creature 6 and Spawn Flags
		SetLocalString(oCamp, "CampC6", "grp_ghasts");
		SetLocalString(oCamp, "CampC6_Flags", "SP_SF_SG");

		// Set Creature 7 and Spawn Flags
		SetLocalString(oCamp, "CampC7", "grp_ghasts");
		SetLocalString(oCamp, "CampC7_Flags", "SP_SF_SG");					

		// Set Creature 8 and Spawn Flags
		SetLocalString(oCamp, "CampC8", "grp_ghasts");
		SetLocalString(oCamp, "CampC8_Flags", "SP_SF_SG");

		// Set Creature 9 and Spawn Flags
		SetLocalString(oCamp, "CampC9", "grp_ghasts");
		SetLocalString(oCamp, "CampC9_Flags", "SP_SF_SG");
		
		// Set Creature 10 and Spawn Flags
		SetLocalString(oCamp, "CampC10", "grp_ghasts");
		SetLocalString(oCamp, "CampC10_Flags", "SP_SF_SG");					

		// Set Creature 11 and Spawn Flags
		SetLocalString(oCamp, "CampC11", "grp_ghasts");
		SetLocalString(oCamp, "CampC11_Flags", "SP_SF_SG");

		// Set Creature 12 and Spawn Flags
		SetLocalString(oCamp, "CampC12", "grp_ghasts");
		SetLocalString(oCamp, "CampC12_Flags", "SP_SF_SG");		
    }
//:: Ghouls, Ghasts & supper

//:: Shadow Gang
	if (sCamp == "shadow_gang")
    {
	//:: Set Number of Placeables
		int nPlcNum = 0;
        SetLocalInt(oCamp, "CampNumP", nPlcNum);

    //:: Set Number of Creatures
		int nSpawnNum = 1 + nDifficulty + d4(2);		
        SetLocalInt(oCamp, "CampNumC", nSpawnNum);
		
	//:: Set Radius of Camp
        SetLocalFloat(oCamp, "CampRadius", 2.0);

        // Set Creature 0 to be Trigger
        // Script 00 : Kill him and the Camp Despawns
        // SetLocalString(oCamp, "CampTrigger", "C0");
        // SetLocalInt(oCamp, "CampTriggerScript", 0);

	//:: Set Placeable 0 to be Camp Center
        SetLocalString(oCamp, "CampCenter", "P0");

	//:: Set Placeable 0 and Spawn Flags
	//:: First Placeable always Spawns at Center of Camp
	//:: If CampCenter Is Not Set
        //SetLocalString(oCamp, "CampP0", "poa_corpse001");
        //SetLocalString(oCamp, "CampP0_Flags", "SP_SF");

		// Set Creature 0 and Spawn Flags
		SetLocalString(oCamp, "CampC0", "grp_shadow");
		SetLocalString(oCamp, "CampC0_Flags", "SP_RW_SG");

		// Set Creature 1 and Spawn Flags
		SetLocalString(oCamp, "CampC1", "grp_shadow");
		SetLocalString(oCamp, "CampC1_Flags", "SP_RW_SG");
		
		// Set Creature 2 and Spawn Flags
		SetLocalString(oCamp, "CampC2", "grp_shadow");
		SetLocalString(oCamp, "CampC2_Flags", "SP_RW_SG");
		
		// Set Creature 3 and Spawn Flags
		SetLocalString(oCamp, "CampC3", "grp_shadow");
		SetLocalString(oCamp, "CampC3_Flags", "SP_RW_SG");

		// Set Creature 4 and Spawn Flags
		SetLocalString(oCamp, "CampC4", "grp_shadow");
		SetLocalString(oCamp, "CampC4_Flags", "SP_RW_SG");

		// Set Creature 5 and Spawn Flags
		SetLocalString(oCamp, "CampC5", "grp_shadow");
		SetLocalString(oCamp, "CampC5_Flags", "SP_RW_SG");
		
		// Set Creature 6 and Spawn Flags
		SetLocalString(oCamp, "CampC6", "grp_shadow");
		SetLocalString(oCamp, "CampC6_Flags", "SP_RW_SG");

		// Set Creature 7 and Spawn Flags
		SetLocalString(oCamp, "CampC7", "grp_shadow");
		SetLocalString(oCamp, "CampC7_Flags", "SP_RW_SG");					

		// Set Creature 8 and Spawn Flags
		SetLocalString(oCamp, "CampC8", "grp_shadow");
		SetLocalString(oCamp, "CampC8_Flags", "SP_RW_SG");

		// Set Creature 9 and Spawn Flags
		SetLocalString(oCamp, "CampC9", "grp_shadow");
		SetLocalString(oCamp, "CampC9_Flags", "SP_RW_SG");
		
		// Set Creature 10 and Spawn Flags
		SetLocalString(oCamp, "CampC10", "grp_shadow");
		SetLocalString(oCamp, "CampC10_Flags", "SP_RW_SG");					

		// Set Creature 11 and Spawn Flags
		SetLocalString(oCamp, "CampC11", "grp_shadow");
		SetLocalString(oCamp, "CampC11_Flags", "SP_RW_SG");

		// Set Creature 12 and Spawn Flags
		SetLocalString(oCamp, "CampC12", "grp_shadow");
		SetLocalString(oCamp, "CampC12_Flags", "SP_RW_SG");		
    }
//:: Shadow Gang

//:: Crypt Chanter & Wraith gang
	if (sCamp == "camp_chanter")
    {
	//:: Set Number of Placeables
		int nPlcNum = 0;
        SetLocalInt(oCamp, "CampNumP", nPlcNum);

    //:: Set Number of Creatures
		int nSpawnNum = 2 + nDifficulty + d4(2);		
        SetLocalInt(oCamp, "CampNumC", nSpawnNum);
		
	//:: Set Radius of Camp
        SetLocalFloat(oCamp, "CampRadius", 10.0);

        // Set Creature 0 to be Trigger
        // Script 00 : Kill him and the Camp Despawns
        // SetLocalString(oCamp, "CampTrigger", "C0");
        // SetLocalInt(oCamp, "CampTriggerScript", 0);

	//:: Set Placeable 0 to be Camp Center
        SetLocalString(oCamp, "CampCenter", "P0");

	//:: Set Placeable 0 and Spawn Flags
	//:: First Placeable always Spawns at Center of Camp
	//:: If CampCenter Is Not Set
        //SetLocalString(oCamp, "CampP0", "poa_corpse001");
        //SetLocalString(oCamp, "CampP0_Flags", "SP_SF");

		// Set Creature 0 and Spawn Flags
		SetLocalString(oCamp, "CampC0", "grp_chanter");
		SetLocalString(oCamp, "CampC0_Flags", "SP_RW_SG");

		// Set Creature 1 and Spawn Flags
		SetLocalString(oCamp, "CampC1", "grp_wraith");
		SetLocalString(oCamp, "CampC1_Flags", "SP_RW_SG");
		
		// Set Creature 2 and Spawn Flags
		SetLocalString(oCamp, "CampC2", "grp_wraith");
		SetLocalString(oCamp, "CampC2_Flags", "SP_RW_SG");
		
		// Set Creature 3 and Spawn Flags
		SetLocalString(oCamp, "CampC3", "grp_wraith");
		SetLocalString(oCamp, "CampC3_Flags", "SP_RW_SG");

		// Set Creature 4 and Spawn Flags
		SetLocalString(oCamp, "CampC4", "grp_wraith");
		SetLocalString(oCamp, "CampC4_Flags", "SP_RW_SG");

		// Set Creature 5 and Spawn Flags
		SetLocalString(oCamp, "CampC5", "grp_wraith");
		SetLocalString(oCamp, "CampC5_Flags", "SP_RW_SG");
		
		// Set Creature 6 and Spawn Flags
		SetLocalString(oCamp, "CampC6", "grp_wraith");
		SetLocalString(oCamp, "CampC6_Flags", "SP_RW_SG");

		// Set Creature 7 and Spawn Flags
		SetLocalString(oCamp, "CampC7", "grp_wraith");
		SetLocalString(oCamp, "CampC7_Flags", "SP_RW_SG");					

		// Set Creature 8 and Spawn Flags
		SetLocalString(oCamp, "CampC8", "grp_wraith");
		SetLocalString(oCamp, "CampC8_Flags", "SP_RW_SG");

		// Set Creature 9 and Spawn Flags
		SetLocalString(oCamp, "CampC9", "grp_wraith");
		SetLocalString(oCamp, "CampC9_Flags", "SP_RW_SG");
		
		// Set Creature 10 and Spawn Flags
		SetLocalString(oCamp, "CampC10", "grp_wraith");
		SetLocalString(oCamp, "CampC10_Flags", "SP_RW_SG");					

		// Set Creature 11 and Spawn Flags
		SetLocalString(oCamp, "CampC11", "grp_wraith");
		SetLocalString(oCamp, "CampC11_Flags", "SP_RW_SG");

		// Set Creature 12 and Spawn Flags
		SetLocalString(oCamp, "CampC12", "grp_wraith");
		SetLocalString(oCamp, "CampC12_Flags", "SP_RW_SG");		
    }
//:: Crypt Chanter & Wraith gang

//:: Hulking Corpse
	if (sCamp == "camp_hulkcorpse")
    {
	//:: Set Number of Placeables
		int nPlcNum = 0;
        SetLocalInt(oCamp, "CampNumP", nPlcNum);

    //:: Set Number of Creatures
		int nSpawnNum = 1 + nDifficulty;		
        SetLocalInt(oCamp, "CampNumC", nSpawnNum);
		
	//:: Set Radius of Camp
        SetLocalFloat(oCamp, "CampRadius", 10.0);

        // Set Creature 0 to be Trigger
        // Script 00 : Kill him and the Camp Despawns
        // SetLocalString(oCamp, "CampTrigger", "C0");
        // SetLocalInt(oCamp, "CampTriggerScript", 0);

	//:: Set Placeable 0 to be Camp Center
        SetLocalString(oCamp, "CampCenter", "P0");

	//:: Set Placeable 0 and Spawn Flags
	//:: First Placeable always Spawns at Center of Camp
	//:: If CampCenter Is Not Set
        //SetLocalString(oCamp, "CampP0", "poa_corpse001");
        //SetLocalString(oCamp, "CampP0_Flags", "SP_SF");

		// Set Creature 0 and Spawn Flags
		SetLocalString(oCamp, "CampC0", "grp_hulkcorpse");
		SetLocalString(oCamp, "CampC0_Flags", "SP_RW_SG");

		// Set Creature 1 and Spawn Flags
		SetLocalString(oCamp, "CampC1", "grp_hulkcorpse");
		SetLocalString(oCamp, "CampC1_Flags", "SP_RW_SG");
		
		// Set Creature 2 and Spawn Flags
		SetLocalString(oCamp, "CampC2", "grp_hulkcorpse");
		SetLocalString(oCamp, "CampC2_Flags", "SP_RW_SG");
		
		// Set Creature 3 and Spawn Flags
		SetLocalString(oCamp, "CampC3", "grp_hulkcorpse");
		SetLocalString(oCamp, "CampC3_Flags", "SP_RW_SG");

		// Set Creature 4 and Spawn Flags
		SetLocalString(oCamp, "CampC4", "grp_hulkcorpse");
		SetLocalString(oCamp, "CampC4_Flags", "SP_RW_SG");

		// Set Creature 5 and Spawn Flags
		SetLocalString(oCamp, "CampC5", "grp_hulkcorpse");
		SetLocalString(oCamp, "CampC5_Flags", "SP_RW_SG");
				
    }
//:: Hulking Corpse

//:: Cinderspawn gang
	if (sCamp == "camp_cinder")
    {
	//:: Set Number of Placeables
		int nPlcNum = 2 + d6(2);
        SetLocalInt(oCamp, "CampNumP", nPlcNum);

    //:: Set Number of Creatures
		int nSpawnNum = 1 + nDifficulty + d3(1);		
        SetLocalInt(oCamp, "CampNumC", nSpawnNum);
		
	//:: Set Radius of Camp
        SetLocalFloat(oCamp, "CampRadius", 10.0);

        // Set Creature 0 to be Trigger
        // Script 00 : Kill him and the Camp Despawns
        // SetLocalString(oCamp, "CampTrigger", "C0");
        // SetLocalInt(oCamp, "CampTriggerScript", 0);

	//:: Set Placeable 0 to be Camp Center
        SetLocalString(oCamp, "CampCenter", "P0");

	//:: Set Placeable 0 and Spawn Flags
	//:: First Placeable always Spawns at Center of Camp
	//:: If CampCenter Is Not Set
        SetLocalString(oCamp, "CampP0", "plc_dustplume");
        SetLocalString(oCamp, "CampP0_Flags", "SP_SF");

        // Set Placeable 1 and Spawn Flags
        SetLocalString(oCamp, "CampP1", "plc_flamelarge");
        SetLocalString(oCamp, "CampP1_Flags", "SP_PL0");
		
        // Set Placeable 2 and Spawn Flags
        SetLocalString(oCamp, "CampP2", "plc_flamelarge");
        SetLocalString(oCamp, "CampP2_Flags", "SP_PL0");

        // Set Placeable 3 and Spawn Flags
        SetLocalString(oCamp, "CampP3", "plc_dustplume");
        SetLocalString(oCamp, "CampP3_Flags", "SP_PL0");			

        // Set Placeable 4 and Spawn Flags
        SetLocalString(oCamp, "CampP4", "plc_flamemedium");
        SetLocalString(oCamp, "CampP4_Flags", "SP_PL0");

        // Set Placeable 5 and Spawn Flags
        SetLocalString(oCamp, "CampP5", "plc_flamelarge");
        SetLocalString(oCamp, "CampP5_Flags", "SP_PL0");

        // Set Placeable 6 and Spawn Flags
        SetLocalString(oCamp, "CampP6", "plc_dustplume");
        SetLocalString(oCamp, "CampP6_Flags", "SP_PL0");

        // Set Placeable 7 and Spawn Flags
        SetLocalString(oCamp, "CampP7", "plc_flamemedium");
        SetLocalString(oCamp, "CampP7_Flags", "SP_PL0");

        // Set Placeable 8 and Spawn Flags
        SetLocalString(oCamp, "CampP8", "plc_flamelarge");
        SetLocalString(oCamp, "CampP8_Flags", "SP_PL0");			

        // Set Placeable 9 and Spawn Flags
        SetLocalString(oCamp, "CampP9", "plc_flamelarge");
        SetLocalString(oCamp, "CampP9_Flags", "SP_PL0");

        // Set Placeable 10 and Spawn Flags
        SetLocalString(oCamp, "CampP10", "plc_flamelarge");
        SetLocalString(oCamp, "CampP10_Flags", "SP_PL0");

        // Set Placeable 11 and Spawn Flags
        SetLocalString(oCamp, "CampP11", "plc_flamemedium");
        SetLocalString(oCamp, "CampP11_Flags", "SP_PL0");

        // Set Placeable 12 and Spawn Flags
        SetLocalString(oCamp, "CampP12", "plc_flamelarge");
        SetLocalString(oCamp, "CampP12_Flags", "SP_PL0");
		
		// Set Creature 0 and Spawn Flags
		SetLocalString(oCamp, "CampC0", "grp_cinder");
		SetLocalString(oCamp, "CampC0_Flags", "SP_RW_SG");

		// Set Creature 1 and Spawn Flags
		SetLocalString(oCamp, "CampC1", "grp_cinder");
		SetLocalString(oCamp, "CampC1_Flags", "SP_RW_SG");
		
		// Set Creature 2 and Spawn Flags
		SetLocalString(oCamp, "CampC2", "grp_cinder");
		SetLocalString(oCamp, "CampC2_Flags", "SP_RW_SG");
		
		// Set Creature 3 and Spawn Flags
		SetLocalString(oCamp, "CampC3", "grp_cinder");
		SetLocalString(oCamp, "CampC3_Flags", "SP_RW_SG");

		// Set Creature 4 and Spawn Flags
		SetLocalString(oCamp, "CampC4", "grp_cinder");
		SetLocalString(oCamp, "CampC4_Flags", "SP_RW_SG");
    }
//:: Cinderspawn gang

//:: Wight pack
	if (sCamp == "wight_pack")
    {
	//:: Set Number of Placeables
		int nPlcNum = 0;
        SetLocalInt(oCamp, "CampNumP", nPlcNum);

    //:: Set Number of Creatures
		int nSpawnNum = 2 + nDifficulty + d3(3);		
        SetLocalInt(oCamp, "CampNumC", nSpawnNum);
		
	//:: Set Radius of Camp
        SetLocalFloat(oCamp, "CampRadius", 10.0);

        // Set Creature 0 to be Trigger
        // Script 00 : Kill him and the Camp Despawns
        // SetLocalString(oCamp, "CampTrigger", "C0");
        // SetLocalInt(oCamp, "CampTriggerScript", 0);

	//:: Set Placeable 0 to be Camp Center
        SetLocalString(oCamp, "CampCenter", "P0");

	//:: Set Placeable 0 and Spawn Flags
	//:: First Placeable always Spawns at Center of Camp
	//:: If CampCenter Is Not Set
        //SetLocalString(oCamp, "CampP0", "poa_corpse001");
        //SetLocalString(oCamp, "CampP0_Flags", "SP_SF");

		// Set Creature 0 and Spawn Flags
		SetLocalString(oCamp, "CampC0", "grp_wight");
		SetLocalString(oCamp, "CampC0_Flags", "SP_RW_SG");

		// Set Creature 1 and Spawn Flags
		SetLocalString(oCamp, "CampC1", "grp_wight");
		SetLocalString(oCamp, "CampC1_Flags", "SP_RW_SG");
		
		// Set Creature 2 and Spawn Flags
		SetLocalString(oCamp, "CampC2", "grp_wight");
		SetLocalString(oCamp, "CampC2_Flags", "SP_RW_SG");
		
		// Set Creature 3 and Spawn Flags
		SetLocalString(oCamp, "CampC3", "grp_wight");
		SetLocalString(oCamp, "CampC3_Flags", "SP_RW_SG");

		// Set Creature 4 and Spawn Flags
		SetLocalString(oCamp, "CampC4", "grp_wight");
		SetLocalString(oCamp, "CampC4_Flags", "SP_RW_SG");

		// Set Creature 5 and Spawn Flags
		SetLocalString(oCamp, "CampC5", "grp_wight");
		SetLocalString(oCamp, "CampC5_Flags", "SP_RW_SG");
		
		// Set Creature 6 and Spawn Flags
		SetLocalString(oCamp, "CampC6", "grp_wight");
		SetLocalString(oCamp, "CampC6_Flags", "SP_RW_SG");

		// Set Creature 7 and Spawn Flags
		SetLocalString(oCamp, "CampC7", "grp_wight");
		SetLocalString(oCamp, "CampC7_Flags", "SP_RW_SG");					

		// Set Creature 8 and Spawn Flags
		SetLocalString(oCamp, "CampC8", "grp_wight");
		SetLocalString(oCamp, "CampC8_Flags", "SP_RW_SG");

		// Set Creature 9 and Spawn Flags
		SetLocalString(oCamp, "CampC9", "grp_wight");
		SetLocalString(oCamp, "CampC9_Flags", "SP_RW_SG");
		
		// Set Creature 10 and Spawn Flags
		SetLocalString(oCamp, "CampC10", "grp_wight");
		SetLocalString(oCamp, "CampC10_Flags", "SP_RW_SG");					
	
    }
//:: Wight pack

//:: Wraith rift
	if (sCamp == "wraith_rift")
    {
	//:: Set Number of Placeables
		int nPlcNum = 2 + d4(1);
        SetLocalInt(oCamp, "CampNumP", nPlcNum);

    //:: Set Number of Creatures
		int nSpawnNum = 2 + nDifficulty + d3(3);		
        SetLocalInt(oCamp, "CampNumC", nSpawnNum);
		
	//:: Set Radius of Camp
        SetLocalFloat(oCamp, "CampRadius", 1.0);

        // Set Creature 0 to be Trigger
        // Script 00 : Kill him and the Camp Despawns
        // SetLocalString(oCamp, "CampTrigger", "C0");
        // SetLocalInt(oCamp, "CampTriggerScript", 0);

	//:: Set Placeable 0 to be Camp Center
        SetLocalString(oCamp, "CampCenter", "P0");

	//:: Set Placeable 0 and Spawn Flags
	//:: First Placeable always Spawns at Center of Camp
	//:: If CampCenter Is Not Set
        SetLocalString(oCamp, "CampP0", "wraith_rift001");
        SetLocalString(oCamp, "CampP0_Flags", "SP_SF");

        // Set Placeable 1 and Spawn Flags
        SetLocalString(oCamp, "CampP1", "plc_magicpurple");
        SetLocalString(oCamp, "CampP1_Flags", "SP_PL0");
		
        // Set Placeable 2 and Spawn Flags
        SetLocalString(oCamp, "CampP2", "plc_magicpurple");
        SetLocalString(oCamp, "CampP2_Flags", "SP_PL0");

        // Set Placeable 3 and Spawn Flags
        SetLocalString(oCamp, "CampP3", "plc_magicpurple");
        SetLocalString(oCamp, "CampP3_Flags", "SP_PL0");			

        // Set Placeable 4 and Spawn Flags
        SetLocalString(oCamp, "CampP4", "plc_magicpurple");
        SetLocalString(oCamp, "CampP4_Flags", "SP_PL0");	
		
        // Set Placeable 5 and Spawn Flags
        SetLocalString(oCamp, "CampP5", "plc_magicpurple");
        SetLocalString(oCamp, "CampP5_Flags", "SP_PL0");
		
		// Set Creature 0 and Spawn Flags
		SetLocalString(oCamp, "CampC0", "grp_wraith");
		SetLocalString(oCamp, "CampC0_Flags", "SP_RW_SG");

		// Set Creature 1 and Spawn Flags
		SetLocalString(oCamp, "CampC1", "grp_wraith");
		SetLocalString(oCamp, "CampC1_Flags", "SP_SF_SG");
		
		// Set Creature 2 and Spawn Flags
		SetLocalString(oCamp, "CampC2", "grp_wraith");
		SetLocalString(oCamp, "CampC2_Flags", "SP_SF_SG");
		
		// Set Creature 3 and Spawn Flags
		SetLocalString(oCamp, "CampC3", "grp_wraith");
		SetLocalString(oCamp, "CampC3_Flags", "SP_SF_SG");

		// Set Creature 4 and Spawn Flags
		SetLocalString(oCamp, "CampC4", "grp_wraith");
		SetLocalString(oCamp, "CampC4_Flags", "SP_RW_SG");

		// Set Creature 5 and Spawn Flags
		SetLocalString(oCamp, "CampC5", "grp_wraith");
		SetLocalString(oCamp, "CampC5_Flags", "SP_SF_SG");
		
		// Set Creature 6 and Spawn Flags
		SetLocalString(oCamp, "CampC6", "grp_wraith");
		SetLocalString(oCamp, "CampC6_Flags", "SP_SF_SG");

		// Set Creature 7 and Spawn Flags
		SetLocalString(oCamp, "CampC7", "grp_wraith");
		SetLocalString(oCamp, "CampC7_Flags", "SP_SF_SG");					

		// Set Creature 8 and Spawn Flags
		SetLocalString(oCamp, "CampC8", "grp_wraith");
		SetLocalString(oCamp, "CampC8_Flags", "SP_SF_SG");

		// Set Creature 9 and Spawn Flags
		SetLocalString(oCamp, "CampC9", "grp_wraith");
		SetLocalString(oCamp, "CampC9_Flags", "SP_SF_SG");
		
		// Set Creature 10 and Spawn Flags
		SetLocalString(oCamp, "CampC10", "grp_wraith");
		SetLocalString(oCamp, "CampC10_Flags", "SP_SF_SG");		
    }
//:: Wraith rift


    // Example Camp
    // One Campfire and 4 Goblins
    if (sCamp == "goblincamp")
    {

        // Set Number of Placeables
        SetLocalInt(oCamp, "CampNumP", 2);
        // Set Number of Creatures
        SetLocalInt(oCamp, "CampNumC", 4);
        // Set Radius of Camp
        SetLocalFloat(oCamp, "CampRadius", 10.0);

        // Set Creature 0 to be Trigger
        // Script 00 : Kill him and the Camp Despawns
        SetLocalString(oCamp, "CampTrigger", "C0");
        SetLocalInt(oCamp, "CampTriggerScript", 0);

        // Set Placeable 0 to be Camp Center
        SetLocalString(oCamp, "CampCenter", "P0");

        // Set Placeable 0 and Spawn Flags
        // First Placeable always Spawns at Center of Camp
        // If CampCenter Is Not Set
        SetLocalString(oCamp, "CampP0", "plc_campfrwspit");
        SetLocalString(oCamp, "CampP0_Flags", "SP_SF");

        // Set Placeable 1 and Spawn Flags
        SetLocalString(oCamp, "CampP1", "plc_chest1");
        SetLocalString(oCamp, "CampP1_Flags", "SP_PL3T80P30");

        // Set Creature 0 and Spawn Flags
        SetLocalString(oCamp, "CampC0", "NW_GOBCHIEFB");
        SetLocalString(oCamp, "CampC0_Flags", "SP_RW_CD60_RH30");

        // Set Creature 1 and Spawn Flags
        SetLocalString(oCamp, "CampC1", "goblins_low");
        SetLocalString(oCamp, "CampC1_Flags", "SP_SF_SG_CD60_RH");

        // Set Creature 2 and Spawn Flags
        SetLocalString(oCamp, "CampC2", "goblins_low");
        SetLocalString(oCamp, "CampC2_Flags", "SP_SF_SG_CD60_RH");

        // Set Creature 3 and Spawn Flags
        SetLocalString(oCamp, "CampC3", "goblins_low");
        SetLocalString(oCamp, "CampC3_Flags", "SP_SF_SG_CD60_RH");
    }
    else if (sCamp == "demoncamp")
    {

        // Set Number of Placeables
        SetLocalInt(oCamp, "CampNumP", 2);
        // Set Number of Creatures
        SetLocalInt(oCamp, "CampNumC", 4);
        // Set Radius of Camp
        SetLocalFloat(oCamp, "CampRadius", 5.0);

        // Set Creature 0 to be Trigger
        // Script 00 : Kill him and the Camp Despawns
        SetLocalString(oCamp, "CampTrigger", "C0");
        SetLocalInt(oCamp, "CampTriggerScript", 0);

        // Set Placeable 0 to be Camp Center
        SetLocalString(oCamp, "CampCenter", "P0");

        // Set Placeable 0 and Spawn Flags
        // First Placeable always Spawns at Center of Camp
        // If CampCenter Is Not Set
        SetLocalString(oCamp, "CampP0", "plc_campfrwspit");
        SetLocalString(oCamp, "CampP0_Flags", "SP_SF");

        // Set Placeable 1 and Spawn Flags
        SetLocalString(oCamp, "CampP1", "plc_chest1");
        SetLocalString(oCamp, "CampP1_Flags", "SP_PL3T80P30");

        // Set Creature 0 and Spawn Flags
        SetLocalString(oCamp, "CampC0", "NW_DEMON");
        SetLocalString(oCamp, "CampC0_Flags", "SP_RW");

        // Set Creature 1 and Spawn Flags
        SetLocalString(oCamp, "CampC1", "NW_DEMON");
        SetLocalString(oCamp, "CampC1_Flags", "SP_SF");

        // Set Creature 2 and Spawn Flags
        SetLocalString(oCamp, "CampC2", "NW_DEMON");
        SetLocalString(oCamp, "CampC2_Flags", "SP_SF");

        // Set Creature 3 and Spawn Flags
        SetLocalString(oCamp, "CampC3", "NW_DEMON");
        SetLocalString(oCamp, "CampC3_Flags", "SP_SF");
    }
    //


// -------------------------------------------
//
}