include library.poi; void spawnBossMobiles(obj_id poiBaseObject, obj_id[] objLargeMobSpawners) { LOG("uber", "SPAWN BOSS MOBILES FUNCTION"); string lairType = getStringObjVar( poiBaseObject, "spawning.lairType" ); // the name of the uber lair to make /// we need to make X number of mobs at y locations // we also make z large mobs // first string lairDatatable = "datatables/uberlair/" + lairType + ".iff"; string[] strLargeMobs = dataTableGetStringColumnNoDefaults(lairDatatable, "strLargeMobs"); string[] strLargeMobScript= dataTableGetStringColumnNoDefaults(lairDatatable, "strLargeMobScripts"); // 1st we make our large mobs! LOG("uberlairs", "objLargeMobSpawners length is "+objLargeMobSpawners.length); for(int intI = 0; intI0) { attachScript(objMob, strLargeMobScript[0]); setObjVar(objMob, "uberlair.strScript", strLargeMobScript[0]); } setObjVar(objMob, "uberlair.strType", strMobToSpawn); setObjVar(objMob, "uberlair.locSpawnLocation", locSpawnLocation); setObjVar(objMob, "uberlair.objParent", poiBaseObject); } return; } void spawnNpcLairMobiles( obj_id poiBaseObject, obj_id[] objMobSpawners) { const int SPAWNS_PER_EVENT = 3; string lairType = getStringObjVar( poiBaseObject, "spawning.lairType" ); // the name of the uber lair to make /// we need to make X number of mobs at y locations // we also make z large mobs // first LOG("uber", "SPAWN_NPC_LAIR_MOBILS"); if(objMobSpawners==null) { LOG("DESIGNER_FATAL", "lair of "+lairType+" has no mob spawners in the theater it uses"); return; } string lairDatatable = "datatables/uberlair/" + lairType + ".iff"; string[] strMobs = dataTableGetStringColumnNoDefaults(lairDatatable, "strMobs"); string[] strMobScript = dataTableGetStringColumnNoDefaults(lairDatatable, "strMobScripts"); int intMaxSpawns[] = dataTableGetIntColumnNoDefaults(lairDatatable, "intMobCount"); int intMobCount = intMaxSpawns[0]; intMaxSpawns = dataTableGetIntColumnNoDefaults(lairDatatable, "intTotalMobs"); int intTotalMobs = intMaxSpawns[0]; setObjVar(poiBaseObject, "intTotalMobs", intTotalMobs); int intIndex = getIntObjVar(poiBaseObject, "intSpawnIndex"); // so we can queueu int intCounter = 0; // so we can do X per cycle for(int intI = intIndex; intISPAWNS_PER_EVENT) { setObjVar(poiBaseObject, "intSpawnIndex", intI); messageTo(poiBaseObject, "spawnMobiles", null, 3, false); return; } if(strMobs.length==0) { LOG("DESIGNER_FATAL", lairType+" has large mob spawners but no large mobs!"); break; } string strMobToSpawn = strMobs[rand(0, strMobs.length-1)]; location locSpawnLocation = getLocation(objMobSpawners[rand(0,objMobSpawners.length-1)]); locSpawnLocation.x = locSpawnLocation.x + rand(-2,2); locSpawnLocation.z = locSpawnLocation.z + rand(-2,2); obj_id objMob = poi.createObject(poiBaseObject, strMobToSpawn,locSpawnLocation); ai_lib.setDefaultCalmBehavior(objMob, ai_lib.BEHAVIOR_SENTINEL); if(strMobScript.length>0) { attachScript(objMob, strMobScript[0]); setObjVar(objMob, "uberlair.strScript", strMobScript[0]); } setObjVar(objMob, "uberlair.strType", strMobToSpawn); setObjVar(objMob, "uberlair.locSpawnLocation", locSpawnLocation); setObjVar(objMob, "uberlair.objParent", poiBaseObject); intCounter = intCounter+1; } setObjVar(poiBaseObject, "intSpawnCount", intMobCount); // if we get here we're doine spawning all of our things. removeObjVar(poiBaseObject, "intSpawnIndex"); messageTo(poiBaseObject, "spawnFormations", null, 3, false); return; } void respawnMobile(obj_id poiBaseObject, location locSpawnLocation, string strMobToSpawn, string strScript) { // SPAWN 1 int intTotalMobs = getIntObjVar(poiBaseObject, "intTotalMobs"); int intCurrentSpawnCount = getIntObjVar(poiBaseObject, "intSpawnCount"); intCurrentSpawnCount = intCurrentSpawnCount+1; if(intCurrentSpawnCount>intTotalMobs) { return; } obj_id objMob = poi.createObject(poiBaseObject, strMobToSpawn,locSpawnLocation); ai_lib.setDefaultCalmBehavior(objMob, ai_lib.BEHAVIOR_SENTINEL); if(strScript!=null) { attachScript(objMob, strScript); } setObjVar(poiBaseObject, "intSpawnCount", intCurrentSpawnCount); return; } void createFormations(obj_id objParent) { LOG("uber", "SPAWN_formations FUNCTION"); string lairType = getStringObjVar( objParent, "spawning.lairType" ); // the name of the uber lair to make string lairDatatable = "datatables/uberlair/" + lairType + ".iff"; LOG("uber", "lairDatatable is "+lairDatatable); string[] strFormations = dataTableGetStringColumnNoDefaults(lairDatatable, "strFormations"); location[] locOffsets = getPatrolOffsets(getLocation(objParent), 50); for(int intI = 0; intI