yep, that's the one to use

This commit is contained in:
DarthArgus
2015-11-01 06:52:55 -06:00
parent 325fd6e536
commit 4ba77e55bd
2 changed files with 2 additions and 180 deletions
@@ -487,7 +487,7 @@ i i h i f f f f f f f s p
1189605 0 object/static/structure/tatooine/pillar_pristine_small_style_01.iff 0 1328.97 5 1418.91 0.958244 0 0.285952 0 $|
1189606 0 object/static/structure/tatooine/pillar_pristine_small_style_01.iff 0 1328.83 5 1423.42 0.958244 0 0.285952 0 $|
1189607 0 object/static/structure/tatooine/guild_statue_free_style_01.iff 0 1437.88 5 1435.89 0.466913 0 0.884304 0 $|
1189630 0 object/building/tatooine/guild_combat_tatooine_style_01.iff 0 1418 5 1468.59 0.476432 0 0.879211 0 theme_park.script_spawner.spawner_methods.script_spawner_default spawn_table|4|datatables/spawning/building_spawns/tatooine_mos_eisley_war_guild.iff|$|
1189630 0 object/building/tatooine/guild_combat_tatooine_style_01.iff 0 1418 5 1468.59 0.476432 0 0.879211 0 structure.municipal.starport:theme_park.dungeon.generic_spawner spawn_table|4|datatables/spawning/building_spawns/tatooine_mos_eisley_war_guild.iff|$|
1189631 1189630 object/cell/cell.iff 1 0 0 0 1 0 0 0 $|
1189632 1189630 object/cell/cell.iff 2 0 0 0 1 0 0 0 $|
1189633 1189630 object/cell/cell.iff 3 0 0 0 1 0 0 0 $|
@@ -788,7 +788,7 @@ i i h i f f f f f f f s p
1279912 0 object/static/structure/tatooine/wall_ruined_tatooine_large_style_02.iff 0 1512.28 5.03685 1272.43 -0.27502 0.0201192 0.960807 0.0284619 $|
1279914 0 object/static/structure/tatooine/pillar_damaged_large_style_01.iff 0 1497.13 5.05208 1286.6 0.915775 -0.00708065 0.400006 0.0360681 $|
1279952 0 object/building/tatooine/filler_building_block_64x16_style_01.iff 0 1305.33 5 1342.36 0.893108 0 -0.449842 0 $|
1279956 0 object/building/tatooine/guild_commerce_tatooine_style_01.iff 0 1391.72 5 1429.42 -0.281921 0 0.959438 0 theme_park.script_spawner.spawner_methods.script_spawner_default spawn_table|4|datatables/spawning/building_spawns/mos_eisley_mayor_building.iff|$|
1279956 0 object/building/tatooine/guild_commerce_tatooine_style_01.iff 0 1391.72 5 1429.42 -0.281921 0 0.959438 0 structure.municipal.starport:theme_park.dungeon.generic_spawner spawn_table|4|datatables/spawning/building_spawns/mos_eisley_mayor_building.iff|$|
1279957 1279956 object/cell/cell.iff 1 0 0 0 1 0 0 0 $|
1279958 1279956 object/cell/cell.iff 2 0 0 0 1 0 0 0 $|
1279959 1279956 object/cell/cell.iff 3 0 0 0 1 0 0 0 $|
@@ -1,178 +0,0 @@
include library.ai_lib;
include library.combat;
include library.utils;
include library.create;
const int MAX_SPAWN_TRIES = 5;
trigger OnAttach ()
{
messageTo ( self, "beginSpawn", null, 1, false );
return SCRIPT_CONTINUE;
}
trigger OnInitialize ()
{
messageTo ( self, "beginSpawn", null, 1, false );
return SCRIPT_CONTINUE;
}
messageHandler beginSpawn ()
{
string datatable = getStringObjVar (self, "spawn_table");
if ( datatable == null )
{
LOG ("Spawn", "I have no string table. I am " + self);
return SCRIPT_OVERRIDE;
}
int numberOfCreaturesToSpawn = dataTableGetNumRows (datatable);
if ( numberOfCreaturesToSpawn <= 0 )
return SCRIPT_CONTINUE;
int spawnedCount = utils.getIntScriptVar(self, "spawnCount");
obj_id[] spawned = utils.getObjIdArrayScriptVar (self, "spawnList");
if ( spawned == null || spawned.length == 0 )
{
spawned = new obj_id[numberOfCreaturesToSpawn];
}
boolean failed = false;
for (int i = 0; i < spawned.length; ++i)
{
if ( spawned[i] == obj_id.NULL_ID || spawned[i] == null)
{
spawned[i] = spawnActor(datatable, i);
if (spawned[i] == obj_id.NULL_ID)
{
failed = true;
}
}
}
if ( failed )
{
spawnedCount++;
if (spawnedCount <= MAX_SPAWN_TRIES)
messageTo ( self, "beginSpawn", null, 1, false );
}
utils.setScriptVar (self, "spawnList", spawned);
utils.setScriptVar (self, "spawnCount", spawnedCount);
return SCRIPT_CONTINUE;
}
messageHandler tellingMomIDied() {
int actorNum = params.getInt("spawnNumber");
obj_id corpseObjId = params.getObjId("spawnMob");
string datatable = getStringObjVar (self, "spawn_table");
obj_id[] spawned = utils.getObjIdArrayScriptVar (self, "spawnList");
if (datatable == null)
{
return SCRIPT_CONTINUE;
}
if (spawned[actorNum] == corpseObjId)
{
obj_id newActor = spawnActor(datatable, actorNum);
if (isIdValid(newActor))
{
spawned[actorNum] = newActor;
utils.setScriptVar(self, "spawnList", spawned);
}
else
{
messageTo(self, "tellingMomIDied", params, 3, false);
}
}
return SCRIPT_CONTINUE;
}
obj_id spawnActor(string datatable, int x)
{
obj_id self = getSelf();
string spawn = dataTableGetString (datatable, x, "spawns");
float xCoord = dataTableGetFloat (datatable, x, "loc_x");
float yCoord = dataTableGetFloat (datatable, x, "loc_y");
float zCoord = dataTableGetFloat (datatable, x, "loc_z");
location myself = getLocation (self);
string planet = myself.area;
string spawnRoom = dataTableGetString (datatable, x, "room");
obj_id room = getCellId (self, spawnRoom);
if (!isIdValid (room) && (spawnRoom != "world"))
{
return obj_id.NULL_ID;
}
location spawnPoint = new location (xCoord, yCoord, zCoord, planet, room);
obj_id spawnedCreature = null;
spawnedCreature = create.object (spawn, spawnPoint);
if (!isIdValid(spawnedCreature))
return obj_id.NULL_ID;
string scriptOne = dataTableGetString (datatable, x, "script");
if (scriptOne != null && scriptOne != "")
{
attachScript (spawnedCreature, scriptOne);
}
string creatureName = dataTableGetString (datatable, x, "name");
if (creatureName != null && creatureName != "")
{
setName (spawnedCreature, creatureName);
}
string mood = dataTableGetString (datatable, x, "mood");
float yaw = dataTableGetFloat (datatable, x, "yaw");
setYaw (spawnedCreature, yaw);
ai_lib.setDefaultCalmMood (spawnedCreature, mood);
setObjVar (spawnedCreature, "spawn_number", x);
setObjVar (spawnedCreature, "mom", self);
int respawnTime = dataTableGetInt (datatable, x, "respawn_time");
if(respawnTime < 1) {
respawnTime = 300;
}
setObjVar (spawnedCreature, "respawn_time", respawnTime);
string spawnObjVar = dataTableGetString (datatable, x, "spawn_objvar");
string objvarValue = dataTableGetString (datatable, x, "spawn_objvar_value");
string spawnObjVar2 = dataTableGetString (datatable, x, "spawn_objvar2");
string objvarValue2 = dataTableGetString (datatable, x, "spawn_objvar_value2");
if (spawnObjVar != null && spawnObjVar != "")
{
if (objvarValue != null && objvarValue != "")
{
setObjVar (spawnedCreature, spawnObjVar, objvarValue);
}
}
if (spawnObjVar2 != null && spawnObjVar2 != "")
{
if (objvarValue2 != null && objvarValue2 != "")
{
setObjVar (spawnedCreature, spawnObjVar2, objvarValue2);
}
}
return spawnedCreature;
}