#include "nw_i0_generic" location lTarget; object oSpawn; object oTarget; void debug(string dstring) { int isdebug = 0; if (isdebug == 1) SendMessageToPC(GetFirstPC(), dstring); } void TrashObject(object oObject) { debug(GetTag(oObject) + " is in trashobject"); if (GetObjectType(oObject) == OBJECT_TYPE_PLACEABLE) { object oItem = GetFirstItemInInventory(oObject); while (GetIsObjectValid(oItem)) { debug(GetTag(oItem) + " is in trashobject"); TrashObject(oItem); oItem = GetNextItemInInventory(oObject); } } else debug(GetTag(oObject) + " failed to pass as inventory type placeable is getting destroyed"); AssignCommand(oObject, SetIsDestroyable(TRUE, FALSE, FALSE)); DestroyObject(oObject); } void main() { object oPC; oPC = GetFirstPC(); object tPC = oPC; debug("We're starting area cleanup"); while (oPC != OBJECT_INVALID) { if (OBJECT_SELF == GetArea(oPC)) return; else oPC = GetNextPC(); } object oObject = GetFirstObjectInArea(OBJECT_SELF); while (oObject != OBJECT_INVALID) { debug(GetTag(oObject)); if (GetIsEncounterCreature(oObject) && FindSubString(GetTag(oObject), "_BOSS") > -1) DestroyObject(oObject); int iObjectType = GetObjectType(oObject); if(iObjectType == OBJECT_TYPE_ITEM) { TrashObject(oObject); } else if(iObjectType == OBJECT_TYPE_PLACEABLE && GetTag(oObject) == "BodyBag") { TrashObject(oObject); } oObject = GetNextObjectInArea(OBJECT_SELF); { object oPC = GetEnteringObject(); if (!GetIsPC(oPC)) return; if (GetHitDice(oPC) >= 40) { oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "shadeavatar", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "shadeavatar", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); } else if (GetHitDice(oPC) >= 38) { oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "rakshasa", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "rakshasa", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); } else if (GetHitDice(oPC) >= 34) { oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "archon", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "archon", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); } else if (GetHitDice(oPC) >= 30) { oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "hillgiant", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "hillgiant", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); } else if (GetHitDice(oPC) >= 26) { oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ogrewarrior", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ogrewarrior", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); } else if (GetHitDice(oPC) >= 24) { oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ogre", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ogre", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); } else if (GetHitDice(oPC) >= 23) { oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "bugbearwarrior", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "bugbearpawn", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); } else if (GetHitDice(oPC) >= 21) { oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "bugbearpawn", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "bugbearpawn", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); } else if (GetHitDice(oPC) >= 20) { oTarget = GetWaypointByTag("NW_fuck_bioware"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "minotaur", lTarget); oTarget = oSpawn; SetIsTemporaryEnemy(oPC, oTarget); AssignCommand(oTarget, ActionAttack(oPC)); AssignCommand(oTarget, DetermineCombatRound(oPC)); } } } /* onexit script: This script is placed in the onexit event handler for each area. Its purpose is to check for the presence of remaining pc's in and area and if it finds none then it activates a delayed call to an areacleanup script which cleans the area */ { float cleanupdelay = 30.0; //if you change this it alters how long before // the area cleans up, if you do change it INCLUDE THE DECIMAL, or it won't // work if(!GetIsPC(GetExitingObject()) ) { return; } object oPC = GetExitingObject(); if (!GetIsPC(oPC)) return; oPC = GetFirstPC(); while (oPC != OBJECT_INVALID) { if (OBJECT_SELF == GetArea(oPC)) return; else oPC = GetNextPC(); } DelayCommand(cleanupdelay, ExecuteScript("areacleanup", OBJECT_SELF)); } }