who isn't sick of converting the freaking scripts? this negates the need

This commit is contained in:
DarthArgus
2015-11-24 09:27:45 -06:00
parent 2e64106bc8
commit bbee2d328c
11077 changed files with 2604347 additions and 3425075 deletions
@@ -0,0 +1,78 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.locations;
import script.library.create;
import script.library.ai_lib;
import script.library.utils;
public class base_newbie_creature_spawner extends script.base_script
{
public base_newbie_creature_spawner()
{
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
deltadictionary spawn = self.getScriptVars();
int maxPop = getMaxPop();
int count = utils.getIntScriptVar(self, "count");
String whatToSpawn;
if (count < 0)
{
count = 0;
CustomerServiceLog("SPAWNER_OVERLOAD", "Count went below 0 on " + self + " in base_newbie_creature_spawner script.");
}
for (; count < maxPop; ++count)
{
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
whatToSpawn = pickCreature();
count++;
utils.setScriptVar(self, "count", count);
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
return;
}
public String pickCreature() throws InterruptedException
{
return "crazed_durni";
}
public int getMaxPop() throws InterruptedException
{
return 1;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 10f, 10f, 10f, 10f);
return goodLoc;
}
public void doDeathRespawn(obj_id self) throws InterruptedException
{
int count = utils.getIntScriptVar(self, "count");
count = count - 1;
if (count < 0)
{
count = 0;
CustomerServiceLog("SPAWNER_OVERLOAD", "Count went below 0 on " + self + " in base_newbie_creature_spawner script.");
}
utils.setScriptVar(self, "count", count);
spawnCreatures(self);
return;
}
}
@@ -1,76 +0,0 @@
include library.locations;
include library.create;
include library.ai_lib;
include library.utils;
void spawnCreatures(obj_id self)
{
deltadictionary spawn = self.getScriptVars();
int maxPop = getMaxPop();
int count = utils.getIntScriptVar(self, "count");
string whatToSpawn;
if (count < 0)
{
count = 0;
CustomerServiceLog ("SPAWNER_OVERLOAD", "Count went below 0 on " + self + " in base_newbie_creature_spawner script.");
}
for(;count < maxPop; ++count)
{
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
//LOG("Newbie_Spawn", "WARNING: locations.getGoodLocationAroundLocation failed.");
//continue;
}
whatToSpawn = pickCreature();
count++;
utils.setScriptVar(self, "count", count);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
return;
}
string pickCreature()
{
return "crazed_durni";
}
int getMaxPop()
{
return 1;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 10f, 10f, 10f, 10f);
return goodLoc;
}
void doDeathRespawn(obj_id self)
{
int count = utils.getIntScriptVar(self, "count");
count = count - 1;
if (count < 0)
{
count = 0;
CustomerServiceLog ("SPAWNER_OVERLOAD", "Count went below 0 on " + self + " in base_newbie_creature_spawner script.");
}
utils.setScriptVar(self, "count", count);
spawnCreatures(self);
return;
}
@@ -0,0 +1,59 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class corellia_easy extends script.creature_spawner.base_newbie_creature_spawner
{
public corellia_easy()
{
}
public static final boolean SPAWNER_DISABLED = true;
public int OnInitialize(obj_id self) throws InterruptedException
{
if (!SPAWNER_DISABLED)
{
spawnCreatures(self);
}
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
public String pickCreature() throws InterruptedException
{
String creature = "corellian_butterfly_drone";
int choice = rand(1, 4);
switch (choice)
{
case 1:
creature = "corellian_butterfly_drone";
break;
case 2:
creature = "corellian_butterfly";
break;
case 3:
creature = "durni";
break;
case 4:
creature = "gubbur";
break;
default:
creature = "gubbur";
break;
}
return creature;
}
public int getMaxPop() throws InterruptedException
{
int maxPop = 6;
return maxPop;
}
}
@@ -1,50 +0,0 @@
inherits creature_spawner.base_newbie_creature_spawner;
const boolean SPAWNER_DISABLED = true;
trigger OnInitialize()
{
if ( !SPAWNER_DISABLED )
{
spawnCreatures(self);
}
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
// overloading these two functions.
string pickCreature()
{
string creature = "corellian_butterfly_drone";
int choice = rand (1,4);
switch (choice)
{
case 1:
creature = "corellian_butterfly_drone";
break;
case 2:
creature = "corellian_butterfly";
break;
case 3:
creature = "durni";
break;
case 4:
creature = "gubbur";
break;
default:
creature = "gubbur";
break;
}
return creature;
}
int getMaxPop()
{
int maxPop = 6;
return maxPop;
}
@@ -0,0 +1,56 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class corellia_hard extends script.creature_spawner.base_newbie_creature_spawner
{
public corellia_hard()
{
}
public static final boolean SPAWNER_DISABLED = true;
public int OnInitialize(obj_id self) throws InterruptedException
{
if (!SPAWNER_DISABLED)
{
spawnCreatures(self);
}
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
public String pickCreature() throws InterruptedException
{
String creature = "crazed_durni";
int choice = rand(1, 3);
switch (choice)
{
case 1:
creature = "crazed_durni";
break;
case 2:
creature = "gurrcat";
break;
case 3:
creature = "sand_panther_cub";
break;
default:
creature = "sand_panther_cub";
break;
}
return creature;
}
public int getMaxPop() throws InterruptedException
{
int maxPop = 3;
return maxPop;
}
}
@@ -1,47 +0,0 @@
inherits creature_spawner.base_newbie_creature_spawner;
const boolean SPAWNER_DISABLED = true;
trigger OnInitialize()
{
if ( !SPAWNER_DISABLED )
{
spawnCreatures(self);
}
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
// overloading these two functions.
string pickCreature()
{
string creature = "crazed_durni";
int choice = rand (1,3);
switch (choice)
{
case 1:
creature = "crazed_durni";
break;
case 2:
creature = "gurrcat";
break;
case 3:
creature = "sand_panther_cub";
break;
default:
creature = "sand_panther_cub";
break;
}
return creature;
}
int getMaxPop()
{
int maxPop = 3;
return maxPop;
}
@@ -0,0 +1,59 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class corellia_medium extends script.creature_spawner.base_newbie_creature_spawner
{
public corellia_medium()
{
}
public static final boolean SPAWNER_DISABLED = true;
public int OnInitialize(obj_id self) throws InterruptedException
{
if (!SPAWNER_DISABLED)
{
spawnCreatures(self);
}
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
public String pickCreature() throws InterruptedException
{
String creature = "corellian_butterfly";
int choice = rand(1, 4);
switch (choice)
{
case 1:
creature = "corellian_butterfly";
break;
case 2:
creature = "corellian_butterfly_worker";
break;
case 3:
creature = "vynock";
break;
case 4:
creature = "scavenger_rat";
break;
default:
creature = "vynock";
break;
}
return creature;
}
public int getMaxPop() throws InterruptedException
{
int maxPop = 4;
return maxPop;
}
}
@@ -1,50 +0,0 @@
inherits creature_spawner.base_newbie_creature_spawner;
const boolean SPAWNER_DISABLED = true;
trigger OnInitialize()
{
if ( !SPAWNER_DISABLED )
{
spawnCreatures(self);
}
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
// overloading these two functions.
string pickCreature()
{
string creature = "corellian_butterfly";
int choice = rand (1,4);
switch (choice)
{
case 1:
creature = "corellian_butterfly";
break;
case 2:
creature = "corellian_butterfly_worker";
break;
case 3:
creature = "vynock";
break;
case 4:
creature = "scavenger_rat";
break;
default:
creature = "vynock";
break;
}
return creature;
}
int getMaxPop()
{
int maxPop = 4;
return maxPop;
}
@@ -0,0 +1,157 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.create;
import script.library.locations;
import script.library.spawning;
import script.library.utils;
public class corellia_npc_easy extends script.base_script
{
public corellia_npc_easy()
{
}
public static final boolean SPAWNER_DISABLED = true;
public int OnInitialize(obj_id self) throws InterruptedException
{
if (!SPAWNER_DISABLED)
{
spawnCreatures(self);
LOG("NewbieSpawn", "Spawning Init: " + self);
}
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
LOG("NewbieSpawn", "Spawning Anew: " + self);
String whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 4;
if (hasObjVar(self, "pop"))
{
maxPop = getIntObjVar(self, "pop");
if (maxPop > 20)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "MaxPop of Spawner " + self + " was greater than 20. It was " + maxPop + " in fact.");
}
}
int count = utils.getIntScriptVar(self, "count");
LOG("NewbieSpawn", "Count = " + count);
while (count < maxPop)
{
LOG("NewbieSpawn", "spawning #" + count);
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
if (!utils.hasScriptVar(self, "myCreations"))
{
Vector myCreations = new Vector();
myCreations.setSize(0);
utils.addElement(myCreations, spawned);
utils.setScriptVar(self, "myCreations", myCreations);
}
else
{
Vector theList = utils.getResizeableObjIdArrayScriptVar(self, "myCreations");
if (theList.size() >= maxPop)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add(spawned);
utils.setScriptVar(self, "myCreations", theList);
}
}
if (hasObjVar(self, "useCityWanderScript"))
{
attachScript(spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar(self, "count", count);
}
return;
}
public String pickCreature() throws InterruptedException
{
int choice = rand(1, 17);
String creature = "meatlump_buffoon";
switch (choice)
{
case 1:
creature = "swooper_gangmember";
break;
case 2:
case 3:
case 4:
case 5:
creature = "ragtag_kook";
break;
case 6:
case 7:
case 8:
case 9:
creature = "ragtag_loon";
break;
case 10:
case 11:
case 12:
case 13:
creature = "meatlump_fool";
break;
case 14:
case 15:
case 16:
case 17:
creature = "meatlump_buffoon";
break;
default:
creature = "meatlump_buffoon";
break;
}
return creature;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
if (params == null || params.isEmpty())
{
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,160 +0,0 @@
include library.ai_lib;
include library.create;
include library.locations;
include library.spawning;
include library.utils;
const boolean SPAWNER_DISABLED = true;
trigger OnInitialize()
{
if ( !SPAWNER_DISABLED )
{
spawnCreatures(self);
LOG("NewbieSpawn", "Spawning Init: " + self);
}
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
LOG("NewbieSpawn", "Spawning Anew: " + self);
//deltadictionary spawn = self.getScriptVars();
//string whatToSpawn = spawn.getString("creatureToSpawn");
string whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
//spawn.put("creatureToSpawn", whatToSpawn);
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 4;
if ( hasObjVar(self, "pop") )
{
maxPop = getIntObjVar (self, "pop");
if (maxPop > 20)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "MaxPop of Spawner " + self + " was greater than 20. It was " + maxPop + " in fact.");
}
}
//int count = spawn.getInt("count");
int count = utils.getIntScriptVar(self, "count");
LOG("NewbieSpawn", "Count = " + count);
while (count < maxPop)
{
LOG("NewbieSpawn", "spawning #" + count);
location goodLoc = pickLocation();
if(goodLoc == null)
goodLoc = getLocation(self);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
if (!utils.hasScriptVar (self, "myCreations"))
{
resizeable obj_id[] myCreations = new obj_id[0];
utils.addElement (myCreations, spawned);
utils.setScriptVar (self, "myCreations", myCreations);
}
else
{
resizeable obj_id[] theList = utils.getResizeableObjIdArrayScriptVar (self, "myCreations");
if (theList.length >= maxPop)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add (spawned);
utils.setScriptVar (self, "myCreations", theList);
}
}
// Allow some NPCs to be placed in a city and use city waypoints.
if ( hasObjVar(self, "useCityWanderScript") )
{
attachScript (spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar (self, "count", count);
}
return;
}
string pickCreature()
{
int choice = rand (1,17);
string creature = "meatlump_buffoon";
switch (choice)
{
case 1:
creature = "swooper_gangmember";
break;
case 2:
case 3:
case 4:
case 5:
creature = "ragtag_kook";
break;
case 6:
case 7:
case 8:
case 9:
creature = "ragtag_loon";
break;
case 10:
case 11:
case 12:
case 13:
creature = "meatlump_fool";
break;
case 14:
case 15:
case 16:
case 17:
creature = "meatlump_buffoon";
break;
default:
creature = "meatlump_buffoon";
break;
}
return creature;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
messageHandler creatureDied()
{
if(params == null || params.isEmpty())
{
LOG ("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId ("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,139 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.create;
import script.library.locations;
import script.library.spawning;
import script.library.utils;
public class corellia_npc_hard extends script.base_script
{
public corellia_npc_hard()
{
}
public static final boolean SPAWNER_DISABLED = true;
public int OnInitialize(obj_id self) throws InterruptedException
{
if (!SPAWNER_DISABLED)
{
spawnCreatures(self);
LOG("NewbieSpawn", "Spawning Init: " + self);
}
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
LOG("NewbieSpawn", "Spawning Anew: " + self);
String whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if (hasObjVar(self, "pop"))
{
maxPop = getIntObjVar(self, "pop");
}
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
if (!utils.hasScriptVar(self, "myCreations"))
{
Vector myCreations = new Vector();
myCreations.setSize(0);
utils.addElement(myCreations, spawned);
utils.setScriptVar(self, "myCreations", myCreations);
}
else
{
Vector theList = utils.getResizeableObjIdArrayScriptVar(self, "myCreations");
if (theList.size() >= maxPop)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add(spawned);
utils.setScriptVar(self, "myCreations", theList);
}
}
if (hasObjVar(self, "useCityWanderScript"))
{
attachScript(spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar(self, "count", count);
}
return;
}
public String pickCreature() throws InterruptedException
{
int choice = rand(1, 5);
String creature = "ragtag_maniac";
switch (choice)
{
case 1:
creature = "meatlump_oaf";
break;
case 2:
creature = "meatlump_cretin";
break;
case 3:
creature = "flail_enforcer";
break;
case 4:
creature = "flail_cutthroat";
break;
case 5:
creature = "ragtag_maniac";
break;
default:
creature = "flail_cutthroat";
break;
}
return creature;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
if (params == null || params.isEmpty())
{
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,142 +0,0 @@
include library.ai_lib;
include library.create;
include library.locations;
include library.spawning;
include library.utils;
const boolean SPAWNER_DISABLED = true;
trigger OnInitialize()
{
if ( !SPAWNER_DISABLED )
{
spawnCreatures(self);
LOG("NewbieSpawn", "Spawning Init: " + self);
}
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
LOG("NewbieSpawn", "Spawning Anew: " + self);
//deltadictionary spawn = self.getScriptVars();
//string whatToSpawn = spawn.getString("creatureToSpawn");
string whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
//spawn.put("creatureToSpawn", whatToSpawn);
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if ( hasObjVar(self, "pop") )
{
maxPop = getIntObjVar (self, "pop");
}
//int count = spawn.getInt("count");
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
// debugSpeakMsg (self, "spawning #" + count);
location goodLoc = pickLocation();
if(goodLoc == null)
goodLoc = getLocation(self);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
if (!utils.hasScriptVar (self, "myCreations"))
{
resizeable obj_id[] myCreations = new obj_id[0];
utils.addElement (myCreations, spawned);
utils.setScriptVar (self, "myCreations", myCreations);
}
else
{
resizeable obj_id[] theList = utils.getResizeableObjIdArrayScriptVar (self, "myCreations");
if (theList.length >= maxPop)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add (spawned);
utils.setScriptVar (self, "myCreations", theList);
}
}
// Allow some NPCs to be placed in a city and use city waypoints.
if ( hasObjVar(self, "useCityWanderScript") )
{
attachScript (spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar (self, "count", count);
}
return;
}
string pickCreature()
{
int choice = rand (1,5);
string creature = "ragtag_maniac";
switch (choice)
{
case 1:
creature = "meatlump_oaf";
break;
case 2:
creature = "meatlump_cretin";
break;
case 3:
creature = "flail_enforcer";
break;
case 4:
creature = "flail_cutthroat";
break;
case 5:
creature = "ragtag_maniac";
break;
default:
creature = "flail_cutthroat";
break;
}
return creature;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
messageHandler creatureDied()
{
if(params == null || params.isEmpty())
{
LOG ("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId ("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,139 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.create;
import script.library.locations;
import script.library.spawning;
import script.library.utils;
public class corellia_npc_medium extends script.base_script
{
public corellia_npc_medium()
{
}
public static final boolean SPAWNER_DISABLED = true;
public int OnInitialize(obj_id self) throws InterruptedException
{
if (!SPAWNER_DISABLED)
{
spawnCreatures(self);
LOG("NewbieSpawn", "Spawning Init: " + self);
}
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
LOG("NewbieSpawn", "Spawning Anew: " + self);
String whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if (hasObjVar(self, "pop"))
{
maxPop = getIntObjVar(self, "pop");
}
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
if (!utils.hasScriptVar(self, "myCreations"))
{
Vector myCreations = new Vector();
myCreations.setSize(0);
utils.addElement(myCreations, spawned);
utils.setScriptVar(self, "myCreations", myCreations);
}
else
{
Vector theList = utils.getResizeableObjIdArrayScriptVar(self, "myCreations");
if (theList.size() >= maxPop)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add(spawned);
utils.setScriptVar(self, "myCreations", theList);
}
}
if (hasObjVar(self, "useCityWanderScript"))
{
attachScript(spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar(self, "count", count);
}
return;
}
public String pickCreature() throws InterruptedException
{
int choice = rand(1, 5);
String creature = "corsec_rogue";
switch (choice)
{
case 1:
creature = "ragtag_lunatic";
break;
case 2:
creature = "meatlump_stooge";
break;
case 3:
creature = "meatlump_clod";
break;
case 4:
creature = "corsec_rogue";
break;
case 5:
creature = "swooper_leader";
break;
default:
creature = "swooper_leader";
break;
}
return creature;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
if (params == null || params.isEmpty())
{
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,142 +0,0 @@
include library.ai_lib;
include library.create;
include library.locations;
include library.spawning;
include library.utils;
const boolean SPAWNER_DISABLED = true;
trigger OnInitialize()
{
if ( !SPAWNER_DISABLED )
{
spawnCreatures(self);
LOG("NewbieSpawn", "Spawning Init: " + self);
}
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
LOG("NewbieSpawn", "Spawning Anew: " + self);
//deltadictionary spawn = self.getScriptVars();
//string whatToSpawn = spawn.getString("creatureToSpawn");
string whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
//spawn.put("creatureToSpawn", whatToSpawn);
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if ( hasObjVar(self, "pop") )
{
maxPop = getIntObjVar (self, "pop");
}
//int count = spawn.getInt("count");
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
// debugSpeakMsg (self, "spawning #" + count);
location goodLoc = pickLocation();
if(goodLoc == null)
goodLoc = getLocation(self);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
if (!utils.hasScriptVar (self, "myCreations"))
{
resizeable obj_id[] myCreations = new obj_id[0];
utils.addElement (myCreations, spawned);
utils.setScriptVar (self, "myCreations", myCreations);
}
else
{
resizeable obj_id[] theList = utils.getResizeableObjIdArrayScriptVar (self, "myCreations");
if (theList.length >= maxPop)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add (spawned);
utils.setScriptVar (self, "myCreations", theList);
}
}
// Allow some NPCs to be placed in a city and use city waypoints.
if ( hasObjVar(self, "useCityWanderScript") )
{
attachScript (spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar (self, "count", count);
}
return;
}
string pickCreature()
{
int choice = rand (1,5);
string creature = "corsec_rogue";
switch (choice)
{
case 1:
creature = "ragtag_lunatic";
break;
case 2:
creature = "meatlump_stooge";
break;
case 3:
creature = "meatlump_clod";
break;
case 4:
creature = "corsec_rogue";
break;
case 5:
creature = "swooper_leader";
break;
default:
creature = "swooper_leader";
break;
}
return creature;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
messageHandler creatureDied()
{
if(params == null || params.isEmpty())
{
LOG ("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId ("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,28 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class death_msg extends script.base_script
{
public death_msg()
{
}
public int OnDestroy(obj_id self) throws InterruptedException
{
String creatureTemplate = getTemplateName(self);
LOG("Newbie_Spawn", "Message in onDestroy: Creature died of type - " + creatureTemplate);
dictionary webster = new dictionary();
webster.put("deadGuy", self);
obj_id mom = getObjIdObjVar(self, "creater");
int randSpawn = rand(180, 360);
messageTo(mom, "creatureDied", webster, randSpawn, false);
LOG("Newbie_Spawn", "Message in onDestroy: Sending message to mom - " + mom + " from self - " + self);
return SCRIPT_CONTINUE;
}
}
@@ -1,32 +0,0 @@
/*
trigger OnIncapacitated(obj_id attacker)
{
obj_id mom = getObjIdObjVar (self, "creater");
messageTo (mom, "creatureDied", null, 0, true);
LOG("DeathMother", "Message from Incap");
return SCRIPT_CONTINUE;
}
*/
trigger OnDestroy()
{
string creatureTemplate = getTemplateName(self);
LOG("Newbie_Spawn", "Message in onDestroy: Creature died of type - "+ creatureTemplate);
dictionary webster = new dictionary();
webster.put ("deadGuy", self);
obj_id mom = getObjIdObjVar (self, "creater");
/*
**Creating a delay in the Death Message - originally there was no delay which created**
**an instant respawn situation. Players repeatedly farmed these areas because of the**
** high rate of respawn. **
*/
int randSpawn = rand(180, 360);
messageTo (mom, "creatureDied", webster, randSpawn, false);
LOG("Newbie_Spawn", "Message in onDestroy: Sending message to mom - "+ mom + " from self - " + self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,52 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.locations;
import script.library.create;
import script.library.ai_lib;
public class droid_vendor_spawner extends script.base_script
{
public droid_vendor_spawner()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
if (!hasObjVar(self, "started_spawning"))
{
spawnVendor(self);
setObjVar(self, "started_spawning", 1);
}
return SCRIPT_CONTINUE;
}
public void spawnVendor(obj_id self) throws InterruptedException
{
String creatureToSpawn = "farmer";
location goodLoc = getLocation(self);
obj_id spawned = create.object(creatureToSpawn, goodLoc);
create.addDestroyMessage(spawned, "creatureDied", 10.0f, self);
attachScript(spawned, "beta.droid_vendor");
setObjVar(self, "myVendor", spawned);
}
public int OnDestroy(obj_id self) throws InterruptedException
{
obj_id vendor = getObjIdObjVar(self, "myVendor");
if (isIdValid(vendor))
{
destroyObject(vendor);
}
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
spawnVendor(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,40 +0,0 @@
include library.locations;
include library.create;
include library.ai_lib;
trigger OnInitialize()
{
if (!hasObjVar (self, "started_spawning"))
{
spawnVendor(self);
setObjVar (self, "started_spawning", 1);
}
return SCRIPT_CONTINUE;
}
void spawnVendor(obj_id self)
{
string creatureToSpawn = "farmer";
location goodLoc = getLocation( self );
obj_id spawned = create.object (creatureToSpawn, goodLoc);
create.addDestroyMessage( spawned, "creatureDied", 10.0f, self );
attachScript( spawned, "beta.droid_vendor" );
setObjVar( self, "myVendor", spawned );
}
trigger OnDestroy()
{
obj_id vendor = getObjIdObjVar( self, "myVendor" );
if ( isIdValid( vendor ) )
{
destroyObject( vendor );
}
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
spawnVendor(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,47 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.locations;
import script.library.create;
import script.library.ai_lib;
import script.library.utils;
public class jedi_sentinel_dark_spawner extends script.base_script
{
public jedi_sentinel_dark_spawner()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
String whatToSpawn = "dark_jedi_sentinel";
location here = getLocation(self);
obj_id spawned = create.object(whatToSpawn, here);
attachScript(spawned, "theme_park.npc_died.npc_died");
setObjVar(spawned, "spawner", self);
setObjVar(spawned, "useOnIncapTrigger", true);
float spawnedYaw = getYaw(self);
setYaw(spawned, spawnedYaw);
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_SENTINEL);
}
return;
}
public int npcDied(obj_id self, dictionary params) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,36 +0,0 @@
include library.locations;
include library.create;
include library.ai_lib;
include library.utils;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
string whatToSpawn = "dark_jedi_sentinel";
location here = getLocation (self);
obj_id spawned = create.object (whatToSpawn, here);
attachScript (spawned, "theme_park.npc_died.npc_died");
setObjVar (spawned, "spawner", self);
setObjVar (spawned, "useOnIncapTrigger", true);
float spawnedYaw = getYaw(self);
setYaw(spawned, spawnedYaw);
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_SENTINEL);
}
return;
}
messageHandler npcDied()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,47 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.locations;
import script.library.create;
import script.library.ai_lib;
import script.library.utils;
public class jedi_sentinel_light_spawner extends script.base_script
{
public jedi_sentinel_light_spawner()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
String whatToSpawn = "light_jedi_sentinel";
location here = getLocation(self);
obj_id spawned = create.object(whatToSpawn, here);
attachScript(spawned, "theme_park.npc_died.npc_died");
setObjVar(spawned, "spawner", self);
setObjVar(spawned, "useOnIncapTrigger", true);
float spawnedYaw = getYaw(self);
setYaw(spawned, spawnedYaw);
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_SENTINEL);
}
return;
}
public int npcDied(obj_id self, dictionary params) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,36 +0,0 @@
include library.locations;
include library.create;
include library.ai_lib;
include library.utils;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
string whatToSpawn = "light_jedi_sentinel";
location here = getLocation (self);
obj_id spawned = create.object (whatToSpawn, here);
attachScript (spawned, "theme_park.npc_died.npc_died");
setObjVar (spawned, "spawner", self);
setObjVar (spawned, "useOnIncapTrigger", true);
float spawnedYaw = getYaw(self);
setYaw(spawned, spawnedYaw);
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_SENTINEL);
}
return;
}
messageHandler npcDied()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,53 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.locations;
import script.library.create;
public class krayt_graveyard extends script.base_script
{
public krayt_graveyard()
{
}
public int OnAttach(obj_id self) throws InterruptedException
{
doKraytSpawn();
return SCRIPT_CONTINUE;
}
public void doKraytSpawn() throws InterruptedException
{
obj_id self = getSelf();
if (hasObjVar(self, "Krayt"))
{
return;
}
else
{
location here = getLocation(self);
location dragon = locations.getGoodLocationAroundLocation(here, 100f, 100f, 100f, 100f);
obj_id kd = create.object("canyon_krayt_dragon", dragon);
setObjVar(kd, "creater", self);
setObjVar(self, "Krayt", kd);
attachScript(kd, "creature_spawner.death_msg");
return;
}
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
messageTo(self, "spawnNew", null, 30, true);
return SCRIPT_CONTINUE;
}
public int spawnNew(obj_id self, dictionary params) throws InterruptedException
{
removeObjVar(self, "Krayt");
doKraytSpawn();
return SCRIPT_CONTINUE;
}
}
@@ -1,40 +0,0 @@
include library.locations;
include library.create;
trigger OnAttach()
{
doKraytSpawn();
return SCRIPT_CONTINUE;
}
void doKraytSpawn()
{
obj_id self = getSelf();
if (hasObjVar (self, "Krayt"))
{
return;
}
else
{
location here = getLocation (self);
location dragon = locations.getGoodLocationAroundLocation(here, 100f, 100f, 100f, 100f);
obj_id kd = create.object ("canyon_krayt_dragon", dragon);
setObjVar (kd, "creater", self);
setObjVar (self, "Krayt", kd);
attachScript (kd, "creature_spawner.death_msg");
return;
}
}
messageHandler creatureDied()
{
messageTo (self, "spawnNew", null, 30, true);
return SCRIPT_CONTINUE;
}
messageHandler spawnNew()
{
removeObjVar (self, "Krayt");
doKraytSpawn();
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,52 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class naboo_easy extends script.creature_spawner.base_newbie_creature_spawner
{
public naboo_easy()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
public String pickCreature() throws InterruptedException
{
String creature = "flesh_eating_chuba";
int choice = rand(1, 3);
switch (choice)
{
case 1:
creature = "flesh_eating_chuba";
break;
case 2:
creature = "capper_spineflap";
break;
case 3:
creature = "diseased_nuna";
break;
default:
creature = "diseased_nuna";
break;
}
return creature;
}
public int getMaxPop() throws InterruptedException
{
int maxPop = 6;
return maxPop;
}
}
@@ -1,42 +0,0 @@
inherits creature_spawner.base_newbie_creature_spawner;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
// overloading these two functions.
string pickCreature()
{
string creature = "flesh_eating_chuba";
int choice = rand (1,3);
switch (choice)
{
case 1:
creature = "flesh_eating_chuba";
break;
case 2:
creature = "capper_spineflap";
break;
case 3:
creature = "diseased_nuna";
break;
default:
creature = "diseased_nuna";
break;
}
return creature;
}
int getMaxPop()
{
int maxPop = 6;
return maxPop;
}
@@ -0,0 +1,52 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class naboo_hard extends script.creature_spawner.base_newbie_creature_spawner
{
public naboo_hard()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
public String pickCreature() throws InterruptedException
{
String creature = "nuna";
int choice = rand(1, 3);
switch (choice)
{
case 1:
creature = "nuna";
break;
case 2:
creature = "rabid_shaupaut";
break;
case 3:
creature = "narglatch_cub";
break;
default:
creature = "narglatch_cub";
break;
}
return creature;
}
public int getMaxPop() throws InterruptedException
{
int maxPop = 3;
return maxPop;
}
}
@@ -1,42 +0,0 @@
inherits creature_spawner.base_newbie_creature_spawner;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
// overloading these two functions.
string pickCreature()
{
string creature = "nuna";
int choice = rand (1,3);
switch (choice)
{
case 1:
creature = "nuna";
break;
case 2:
creature = "rabid_shaupaut";
break;
case 3:
creature = "narglatch_cub";
break;
default:
creature = "narglatch_cub";
break;
}
return creature;
}
int getMaxPop()
{
int maxPop = 3;
return maxPop;
}
@@ -0,0 +1,52 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class naboo_medium extends script.creature_spawner.base_newbie_creature_spawner
{
public naboo_medium()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
public String pickCreature() throws InterruptedException
{
String creature = "fanned_rawl";
int choice = rand(1, 3);
switch (choice)
{
case 1:
creature = "fanned_rawl";
break;
case 2:
creature = "nightspider";
break;
case 3:
creature = "flewt";
break;
default:
creature = "flewt";
break;
}
return creature;
}
public int getMaxPop() throws InterruptedException
{
int maxPop = 4;
return maxPop;
}
}
@@ -1,42 +0,0 @@
inherits creature_spawner.base_newbie_creature_spawner;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
// overloading these two functions.
string pickCreature()
{
string creature = "fanned_rawl";
int choice = rand (1,3);
switch (choice)
{
case 1:
creature = "fanned_rawl";
break;
case 2:
creature = "nightspider";
break;
case 3:
creature = "flewt";
break;
default:
creature = "flewt";
break;
}
return creature;
}
int getMaxPop()
{
int maxPop = 4;
return maxPop;
}
@@ -0,0 +1,133 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.create;
import script.library.locations;
import script.library.spawning;
import script.library.utils;
public class naboo_npc_easy extends script.base_script
{
public naboo_npc_easy()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
LOG("NewbieSpawn", "Spawning Init: " + self);
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
LOG("NewbieSpawn", "Spawning Anew: " + self);
String whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 4;
if (hasObjVar(self, "pop"))
{
maxPop = getIntObjVar(self, "pop");
}
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
LOG("NewbieSpawn", "spawning #" + count);
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
if (!utils.hasScriptVar(self, "myCreations"))
{
Vector myCreations = new Vector();
myCreations.setSize(0);
utils.addElement(myCreations, spawned);
utils.setScriptVar(self, "myCreations", myCreations);
}
else
{
Vector theList = utils.getResizeableObjIdArrayScriptVar(self, "myCreations");
if (theList.size() >= maxPop)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add(spawned);
utils.setScriptVar(self, "myCreations", theList);
}
}
if (hasObjVar(self, "useCityWanderScript"))
{
attachScript(spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar(self, "count", count);
}
return;
}
public String pickCreature() throws InterruptedException
{
int choice = rand(1, 4);
String creature = "mummer_bully";
switch (choice)
{
case 1:
creature = "skaak_tipper_prowler";
break;
case 2:
creature = "skaak_tipper_mugger";
break;
case 3:
creature = "mummer_thug";
break;
case 4:
creature = "mummer_bully";
break;
default:
creature = "mummer_bully";
break;
}
return creature;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
if (params == null || params.isEmpty())
{
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,135 +0,0 @@
include library.ai_lib;
include library.create;
include library.locations;
include library.spawning;
include library.utils;
trigger OnInitialize()
{
spawnCreatures(self);
LOG("NewbieSpawn", "Spawning Init: " + self);
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
LOG("NewbieSpawn", "Spawning Anew: " + self);
//deltadictionary spawn = self.getScriptVars();
//string whatToSpawn = spawn.getString("creatureToSpawn");
string whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
//spawn.put("creatureToSpawn", whatToSpawn);
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 4;
if ( hasObjVar(self, "pop") )
{
maxPop = getIntObjVar (self, "pop");
}
//int count = spawn.getInt("count");
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
LOG("NewbieSpawn", "spawning #" + count);
location goodLoc = pickLocation();
if(goodLoc == null)
goodLoc = getLocation(self);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
if (!utils.hasScriptVar (self, "myCreations"))
{
resizeable obj_id[] myCreations = new obj_id[0];
utils.addElement (myCreations, spawned);
utils.setScriptVar (self, "myCreations", myCreations);
}
else
{
resizeable obj_id[] theList = utils.getResizeableObjIdArrayScriptVar (self, "myCreations");
if (theList.length >= maxPop)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add (spawned);
utils.setScriptVar (self, "myCreations", theList);
}
}
// Allow some NPCs to be placed in a city and use city waypoints.
if ( hasObjVar(self, "useCityWanderScript") )
{
attachScript (spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar (self, "count", count);
}
return;
}
string pickCreature()
{
int choice = rand (1,4);
string creature = "mummer_bully";
switch (choice)
{
case 1:
creature = "skaak_tipper_prowler";
break;
case 2:
creature = "skaak_tipper_mugger";
break;
case 3:
creature = "mummer_thug";
break;
case 4:
creature = "mummer_bully";
break;
default:
creature = "mummer_bully";
break;
}
return creature;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
messageHandler creatureDied()
{
if(params == null || params.isEmpty())
{
LOG ("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId ("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,130 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.create;
import script.library.locations;
import script.library.spawning;
import script.library.utils;
public class naboo_npc_hard extends script.base_script
{
public naboo_npc_hard()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
String whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if (hasObjVar(self, "pop"))
{
maxPop = getIntObjVar(self, "pop");
}
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
if (!utils.hasScriptVar(self, "myCreations"))
{
Vector myCreations = new Vector();
myCreations.setSize(0);
utils.addElement(myCreations, spawned);
utils.setScriptVar(self, "myCreations", myCreations);
}
else
{
Vector theList = utils.getResizeableObjIdArrayScriptVar(self, "myCreations");
if (theList.size() >= maxPop)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add(spawned);
utils.setScriptVar(self, "myCreations", theList);
}
}
if (hasObjVar(self, "useCityWanderScript"))
{
attachScript(spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar(self, "count", count);
}
return;
}
public String pickCreature() throws InterruptedException
{
int choice = rand(1, 4);
String creature = "mauler_acolyte";
switch (choice)
{
case 1:
creature = "mauler_acolyte";
break;
case 2:
creature = "plasma_thief_leader";
break;
case 3:
creature = "skaak_tipper_swindler";
break;
case 4:
creature = "skaak_tipper_crook";
break;
default:
creature = "skaak_tipper_crook";
break;
}
return creature;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
if (params == null || params.isEmpty())
{
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,135 +0,0 @@
include library.ai_lib;
include library.create;
include library.locations;
include library.spawning;
include library.utils;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
// debugSpeakMsg (self, "Spawning Anew");
//deltadictionary spawn = self.getScriptVars();
//string whatToSpawn = spawn.getString("creatureToSpawn");
string whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
//spawn.put("creatureToSpawn", whatToSpawn);
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if ( hasObjVar(self, "pop") )
{
maxPop = getIntObjVar (self, "pop");
}
//int count = spawn.getInt("count");
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
// debugSpeakMsg (self, "spawning #" + count);
location goodLoc = pickLocation();
if(goodLoc == null)
goodLoc = getLocation(self);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
if (!utils.hasScriptVar (self, "myCreations"))
{
resizeable obj_id[] myCreations = new obj_id[0];
utils.addElement (myCreations, spawned);
utils.setScriptVar (self, "myCreations", myCreations);
}
else
{
resizeable obj_id[] theList = utils.getResizeableObjIdArrayScriptVar (self, "myCreations");
if (theList.length >= maxPop)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add (spawned);
utils.setScriptVar (self, "myCreations", theList);
}
}
// Allow some NPCs to be placed in a city and use city waypoints.
if ( hasObjVar(self, "useCityWanderScript") )
{
attachScript (spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar (self, "count", count);
}
return;
}
string pickCreature()
{
int choice = rand (1,4);
string creature = "mauler_acolyte";
switch (choice)
{
case 1:
creature = "mauler_acolyte";
break;
case 2:
creature = "plasma_thief_leader";
break;
case 3:
creature = "skaak_tipper_swindler";
break;
case 4:
creature = "skaak_tipper_crook";
break;
default:
creature = "skaak_tipper_crook";
break;
}
return creature;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
messageHandler creatureDied()
{
if(params == null || params.isEmpty())
{
LOG ("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId ("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,133 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.create;
import script.library.locations;
import script.library.spawning;
import script.library.utils;
public class naboo_npc_medium extends script.base_script
{
public naboo_npc_medium()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
String whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if (hasObjVar(self, "pop"))
{
maxPop = getIntObjVar(self, "pop");
}
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
if (!utils.hasScriptVar(self, "myCreations"))
{
Vector myCreations = new Vector();
myCreations.setSize(0);
utils.addElement(myCreations, spawned);
utils.setScriptVar(self, "myCreations", myCreations);
}
else
{
Vector theList = utils.getResizeableObjIdArrayScriptVar(self, "myCreations");
if (theList.size() >= maxPop)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add(spawned);
utils.setScriptVar(self, "myCreations", theList);
}
}
if (hasObjVar(self, "useCityWanderScript"))
{
attachScript(spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar(self, "count", count);
}
return;
}
public String pickCreature() throws InterruptedException
{
int choice = rand(1, 5);
String creature = "skaak_tipper_bandit";
switch (choice)
{
case 1:
creature = "plasma_bandit";
break;
case 2:
creature = "skaak_tipper_bandit";
break;
case 3:
creature = "mummer_punk";
break;
case 4:
creature = "mummer_ruffian";
break;
case 5:
creature = "plasma_thief";
break;
default:
creature = "mummer_ruffian";
break;
}
return creature;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
if (params == null || params.isEmpty())
{
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,138 +0,0 @@
include library.ai_lib;
include library.create;
include library.locations;
include library.spawning;
include library.utils;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
// debugSpeakMsg (self, "Spawning Anew");
//deltadictionary spawn = self.getScriptVars();
//string whatToSpawn = spawn.getString("creatureToSpawn");
string whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
//spawn.put("creatureToSpawn", whatToSpawn);
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if ( hasObjVar(self, "pop") )
{
maxPop = getIntObjVar (self, "pop");
}
//int count = spawn.getInt("count");
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
// debugSpeakMsg (self, "spawning #" + count);
location goodLoc = pickLocation();
if(goodLoc == null)
goodLoc = getLocation(self);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
if (!utils.hasScriptVar (self, "myCreations"))
{
resizeable obj_id[] myCreations = new obj_id[0];
utils.addElement (myCreations, spawned);
utils.setScriptVar (self, "myCreations", myCreations);
}
else
{
resizeable obj_id[] theList = utils.getResizeableObjIdArrayScriptVar (self, "myCreations");
if (theList.length >= maxPop)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add (spawned);
utils.setScriptVar (self, "myCreations", theList);
}
}
// Allow some NPCs to be placed in a city and use city waypoints.
if ( hasObjVar(self, "useCityWanderScript") )
{
attachScript (spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar (self, "count", count);
}
return;
}
string pickCreature()
{
int choice = rand (1,5);
string creature = "skaak_tipper_bandit";
switch (choice)
{
case 1:
creature = "plasma_bandit";
break;
case 2:
creature = "skaak_tipper_bandit";
break;
case 3:
creature = "mummer_punk";
break;
case 4:
creature = "mummer_ruffian";
break;
case 5:
creature = "plasma_thief";
break;
default:
creature = "mummer_ruffian";
break;
}
return creature;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
messageHandler creatureDied()
{
if(params == null || params.isEmpty())
{
LOG ("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId ("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,405 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.create;
import script.ai.ai_combat;
import script.library.ai_lib;
public class rebels_vs_imperials_yavin4 extends script.base_script
{
public rebels_vs_imperials_yavin4()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
if (!hasObjVar(self, "imperialPoints"))
{
}
{
setObjVar(self, "imperialPoints", 0);
setObjVar(self, "rebelPoints", 0);
}
messageTo(self, "startOver", null, 0, true);
return SCRIPT_CONTINUE;
}
public int startOver(obj_id self, dictionary params) throws InterruptedException
{
location r1 = new location(4017, 34, -6284, "yavin4", null);
obj_id rebel1 = create.object("rebel_corporal", r1);
create.addDestroyMessage(rebel1, "rebelDied", 10, self);
setMovementRun(rebel1);
r1.z = r1.z - 2;
obj_id rebel2 = create.object("rebel_first_lieutenant", r1);
create.addDestroyMessage(rebel2, "rebelDied", 10, self);
setMovementRun(rebel2);
r1.x = r1.x + 5;
obj_id rebel3 = create.object("rebel_sergeant", r1);
create.addDestroyMessage(rebel3, "rebelDied", 10, self);
setMovementRun(rebel3);
r1.z = r1.z - 2;
obj_id rebel4 = create.object("rebel_commando", r1);
create.addDestroyMessage(rebel4, "rebelDied", 10, self);
setMovementRun(rebel4);
location r2 = new location(4039, 34, -6385, "yavin4", null);
obj_id rebel5 = create.object("rebel_commando", r2);
create.addDestroyMessage(rebel5, "rebelDied", 10, self);
setMovementRun(rebel5);
r2.z = r2.z - 2;
obj_id rebel6 = create.object("rebel_trooper", r2);
create.addDestroyMessage(rebel6, "rebelDied", 10, self);
setMovementRun(rebel6);
r2.x = r2.x + 5;
obj_id rebel7 = create.object("rebel_major_general", r2);
create.addDestroyMessage(rebel7, "rebelDied", 10, self);
setMovementRun(rebel7);
r2.z = r2.z - 2;
obj_id rebel8 = create.object("rebel_general", r2);
create.addDestroyMessage(rebel8, "rebelDied", 10, self);
setMovementRun(rebel8);
location r3 = new location(4028, 34, -6334, "yavin4", null);
obj_id rebel9 = create.object("rebel_commando", r3);
create.addDestroyMessage(rebel9, "rebelDied", 10, self);
setMovementRun(rebel5);
r3.z = r3.z - 2;
obj_id rebel10 = create.object("rebel_trooper", r3);
create.addDestroyMessage(rebel10, "rebelDied", 10, self);
setMovementRun(rebel6);
r3.x = r3.x + 5;
obj_id rebel11 = create.object("rebel_major_general", r3);
create.addDestroyMessage(rebel11, "rebelDied", 10, self);
setMovementRun(rebel7);
r3.z = r3.z - 2;
obj_id rebel12 = create.object("rebel_general", r3);
create.addDestroyMessage(rebel12, "rebelDied", 10, self);
setMovementRun(rebel8);
location overHere = new location(4017, 37, -6300, "yavin4", null);
ai_lib.aiPathTo(rebel1, overHere);
overHere.x = overHere.x + 1;
ai_lib.aiPathTo(rebel2, overHere);
overHere.x = overHere.x + 1;
ai_lib.aiPathTo(rebel3, overHere);
overHere.x = overHere.x + 1;
ai_lib.aiPathTo(rebel4, overHere);
location overThere = new location(4044, 34, -6300, "yavin4", null);
ai_lib.aiPathTo(rebel5, overThere);
overThere.z = overThere.z + 1;
ai_lib.aiPathTo(rebel6, overThere);
overThere.z = overThere.z + 1;
ai_lib.aiPathTo(rebel7, overThere);
overThere.z = overThere.z + 1;
ai_lib.aiPathTo(rebel8, overThere);
location elseWhere = new location(4030, 34, -6300, "yavin4", null);
ai_lib.aiPathTo(rebel5, elseWhere);
elseWhere.x = elseWhere.x + 1;
ai_lib.aiPathTo(rebel6, elseWhere);
elseWhere.x = elseWhere.x + 1;
ai_lib.aiPathTo(rebel7, elseWhere);
elseWhere.x = elseWhere.x + 1;
ai_lib.aiPathTo(rebel8, elseWhere);
location imp1 = new location(4042, 0, -6278, "yavin4", null);
obj_id stormtrooper1 = create.object("stormtrooper_squad_leader", imp1);
create.addDestroyMessage(stormtrooper1, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior(stormtrooper1, ai_lib.BEHAVIOR_SENTINEL);
location imp2 = new location(4021, 0, -6278, "yavin4", null);
obj_id stormtrooper2 = create.object("stormtrooper", imp2);
create.addDestroyMessage(stormtrooper2, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior(stormtrooper2, ai_lib.BEHAVIOR_SENTINEL);
location imp3 = new location(4031, 0, -6274, "yavin4", null);
obj_id stormtrooper3 = create.object("at_st", imp3);
create.addDestroyMessage(stormtrooper3, "atstDied", 10, self);
attachScript(stormtrooper3, "creature.yavin4_atst");
location imp4 = new location(4003, 0, -6261, "yavin4", null);
obj_id stormtrooper4 = create.object("stormtrooper", imp4);
create.addDestroyMessage(stormtrooper4, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior(stormtrooper4, ai_lib.BEHAVIOR_SENTINEL);
location imp5 = new location(4042, 0, -6262, "yavin4", null);
obj_id stormtrooper5 = create.object("stormtrooper", imp5);
create.addDestroyMessage(stormtrooper5, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior(stormtrooper5, ai_lib.BEHAVIOR_SENTINEL);
location imp6 = new location(4056, 0, -6246, "yavin4", null);
obj_id stormtrooper6 = create.object("stormtrooper", imp6);
create.addDestroyMessage(stormtrooper6, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior(stormtrooper6, ai_lib.BEHAVIOR_SENTINEL);
location imp7 = new location(4004, 0, -6242, "yavin4", null);
obj_id stormtrooper7 = create.object("stormtrooper", imp7);
create.addDestroyMessage(stormtrooper7, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior(stormtrooper7, ai_lib.BEHAVIOR_SENTINEL);
location imp8 = new location(4019, 0, -6263, "yavin4", null);
obj_id stormtrooper8 = create.object("imperial_colonel", imp8);
create.addDestroyMessage(stormtrooper8, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior(stormtrooper8, ai_lib.BEHAVIOR_SENTINEL);
location imp9 = new location(4021, 0, -6260, "yavin4", null);
obj_id stormtrooper9 = create.object("stormtrooper_medic", imp9);
create.addDestroyMessage(stormtrooper9, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior(stormtrooper9, ai_lib.BEHAVIOR_SENTINEL);
location imp10 = new location(4022, 0, -6261, "yavin4", null);
obj_id stormtrooper10 = create.object("stormtrooper_sniper", imp10);
create.addDestroyMessage(stormtrooper10, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior(stormtrooper10, ai_lib.BEHAVIOR_SENTINEL);
location imp11 = new location(4005, 0, -6263, "yavin4", null);
obj_id stormtrooper11 = create.object("scout_trooper", imp11);
create.addDestroyMessage(stormtrooper11, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior(stormtrooper11, ai_lib.BEHAVIOR_SENTINEL);
location imp12 = new location(4021, 0, -6256, "yavin4", null);
obj_id stormtrooper12 = create.object("scout_trooper", imp12);
create.addDestroyMessage(stormtrooper12, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior(stormtrooper12, ai_lib.BEHAVIOR_SENTINEL);
setObjVar(self, "rebels", 8);
setObjVar(self, "imperials", 7);
setObjVar(self, "atst", 1);
location rallyPointVader = new location(4017, 37, -6300, "yavin4", null);
ai_lib.aiPathTo(stormtrooper1, rallyPointVader);
rallyPointVader.x = rallyPointVader.x + 1;
ai_lib.aiPathTo(stormtrooper2, rallyPointVader);
rallyPointVader.x = rallyPointVader.x + 1;
ai_lib.aiPathTo(stormtrooper4, rallyPointVader);
location rallyPointMara = new location(4044, 34, -6300, "yavin4", null);
ai_lib.aiPathTo(stormtrooper5, rallyPointMara);
rallyPointMara.z = rallyPointMara.z + 1;
ai_lib.aiPathTo(stormtrooper6, rallyPointMara);
rallyPointMara.z = rallyPointMara.z + 1;
ai_lib.aiPathTo(stormtrooper7, rallyPointMara);
rallyPointMara.z = rallyPointMara.z + 1;
ai_lib.aiPathTo(stormtrooper8, rallyPointMara);
location rallyPointEmperor = new location(4030, 34, -6300, "yavin4", null);
ai_lib.aiPathTo(stormtrooper9, rallyPointEmperor);
rallyPointEmperor.x = rallyPointEmperor.x + 1;
ai_lib.aiPathTo(stormtrooper10, rallyPointEmperor);
rallyPointEmperor.x = rallyPointEmperor.x + 1;
ai_lib.aiPathTo(stormtrooper11, rallyPointEmperor);
rallyPointEmperor.x = rallyPointEmperor.x + 1;
ai_lib.aiPathTo(stormtrooper12, rallyPointEmperor);
return SCRIPT_CONTINUE;
}
public int imperialDied(obj_id self, dictionary params) throws InterruptedException
{
obj_id dead = params.getObjId("object");
int imperials = getIntObjVar(self, "imperials");
String newImp = "";
if (imperials < 12)
{
location imp = getImperialLocation();
imp.x = imp.x + rand(-3, 3);
imp.z = imp.z + rand(-3, 3);
newImp = getImperial();
obj_id stormtrooper12 = create.object(newImp, imp);
create.addDestroyMessage(stormtrooper12, "imperialDied", 10, self);
ai_lib.aiPathTo(stormtrooper12, getRebelDestination());
}
int rebelPoints = getIntObjVar(self, "rebelPoints");
rebelPoints = rebelPoints + 1;
setObjVar(self, "rebelPoints", rebelPoints);
return SCRIPT_CONTINUE;
}
public int rebelDied(obj_id self, dictionary params) throws InterruptedException
{
obj_id dead = params.getObjId("object");
String newReb = "";
int rebels = getIntObjVar(self, "rebels");
if (rebels < 12)
{
newReb = getRebel();
obj_id rebel1 = create.object(newReb, getRebelStart());
create.addDestroyMessage(rebel1, "rebelDied", 10, self);
setMovementRun(rebel1);
ai_lib.aiPathTo(rebel1, getRebelDestination());
}
int impPoints = getIntObjVar(self, "imperialPoints");
impPoints = impPoints + 1;
setObjVar(self, "imperialPoints", impPoints);
destroyObject(dead);
return SCRIPT_CONTINUE;
}
public int atstDied(obj_id self, dictionary params) throws InterruptedException
{
messageTo(self, "spawnATST", null, 8, true);
return SCRIPT_CONTINUE;
}
public int spawnATST(obj_id self, dictionary params) throws InterruptedException
{
obj_id dead = params.getObjId("object");
location imp3 = new location(4031, 0, -6274, "yavin4", null);
obj_id stormtrooper3 = create.object("at_st", imp3);
create.addDestroyMessage(stormtrooper3, "atstDied", 10, self);
attachScript(stormtrooper3, "creature.yavin4_atst");
int rebelPoints = getIntObjVar(self, "rebelPoints");
rebelPoints = rebelPoints + 1;
setObjVar(self, "rebelPoints", rebelPoints);
destroyObject(dead);
return SCRIPT_CONTINUE;
}
public String getRebel() throws InterruptedException
{
int randomRebel = rand(1, 8);
String rebel = "rebel_trooper";
switch (randomRebel)
{
case 1:
rebel = "rebel_corporal";
break;
case 2:
rebel = "rebel_sergeant";
break;
case 3:
rebel = "rebel_general";
break;
case 4:
rebel = "rebel_corporal";
break;
case 5:
rebel = "rebel_sergeant";
break;
case 6:
rebel = "rebel_major_general";
break;
case 7:
rebel = "rebel_commando";
break;
case 8:
rebel = "rebel_commando";
break;
}
return rebel;
}
public location getRebelStart() throws InterruptedException
{
location r1 = new location(4017, 34, -6284, "yavin4", null);
location r2 = new location(4039, 34, -6385, "yavin4", null);
location r3 = new location(4028, 34, -6334, "yavin4", null);
int randomLoc = rand(1, 3);
location rebel = getLocation(getSelf());
switch (randomLoc)
{
case 1:
rebel = r1;
break;
case 2:
rebel = r2;
break;
case 3:
rebel = r3;
break;
}
return rebel;
}
public location getRebelDestination() throws InterruptedException
{
location overHere = new location(4017, 37, -6300, "yavin4", null);
location overThere = new location(4044, 34, -6300, "yavin4", null);
location elseWhere = new location(4030, 34, -6300, "yavin4", null);
int randomLoc = rand(1, 3);
location rebel = getLocation(getSelf());
switch (randomLoc)
{
case 1:
rebel = overHere;
break;
case 2:
rebel = overThere;
break;
case 3:
rebel = elseWhere;
break;
}
return rebel;
}
public location getImperialLocation() throws InterruptedException
{
location imp1 = new location(4042, 0, -6278, "yavin4", null);
location imp2 = new location(4021, 0, -6278, "yavin4", null);
location imp3 = new location(4031, 0, -6274, "yavin4", null);
location imp4 = new location(4003, 0, -6261, "yavin4", null);
location imp5 = new location(4042, 0, -6262, "yavin4", null);
location imp6 = new location(4056, 0, -6246, "yavin4", null);
location imp7 = new location(4004, 0, -6242, "yavin4", null);
location imp8 = new location(4019, 0, -6263, "yavin4", null);
location imp9 = new location(4021, 0, -6260, "yavin4", null);
location imp10 = new location(4022, 0, -6261, "yavin4", null);
location imp11 = new location(4005, 0, -6263, "yavin4", null);
location imp12 = new location(4021, 0, -6256, "yavin4", null);
int randomLoc = rand(1, 12);
location imp = getLocation(getSelf());
switch (randomLoc)
{
case 1:
imp = imp1;
break;
case 2:
imp = imp2;
break;
case 3:
imp = imp3;
break;
case 4:
imp = imp4;
break;
case 5:
imp = imp5;
break;
case 6:
imp = imp6;
break;
case 7:
imp = imp7;
break;
case 8:
imp = imp8;
break;
case 9:
imp = imp9;
break;
case 10:
imp = imp10;
break;
case 11:
imp = imp11;
break;
case 12:
imp = imp12;
break;
}
return imp;
}
public String getImperial() throws InterruptedException
{
int randomimperial = rand(1, 8);
String imperial = "imperial_trooper";
switch (randomimperial)
{
case 1:
imperial = "scout_trooper";
break;
case 2:
imperial = "stormtrooper";
break;
case 3:
imperial = "stormtrooper_squad_leader";
break;
case 4:
imperial = "stormtrooper_sniper";
break;
case 5:
imperial = "stormtrooper_medic";
break;
case 6:
imperial = "imperial_colonel";
break;
case 7:
imperial = "stormtrooper";
break;
case 8:
imperial = "stormtrooper";
break;
}
return imperial;
}
}
@@ -1,438 +0,0 @@
include library.create;
include ai.ai_combat;
include library.ai_lib;
trigger OnInitialize()
{
if (!hasObjVar (self, "imperialPoints"));
{
setObjVar (self, "imperialPoints", 0);
setObjVar (self, "rebelPoints", 0);
}
messageTo(self, "startOver", null, 0, true);
return SCRIPT_CONTINUE;
}
messageHandler startOver ()
{
location r1 = new location (4017, 34, -6284, "yavin4", null);
obj_id rebel1 = create.object ("rebel_corporal", r1);
create.addDestroyMessage (rebel1, "rebelDied", 10, self);
setMovementRun (rebel1);
r1.z = r1.z - 2;
obj_id rebel2 = create.object ("rebel_first_lieutenant", r1);
create.addDestroyMessage (rebel2, "rebelDied", 10, self);
setMovementRun (rebel2);
r1.x = r1.x + 5;
obj_id rebel3 = create.object ("rebel_sergeant", r1);
create.addDestroyMessage (rebel3, "rebelDied", 10, self);
setMovementRun (rebel3);
r1.z = r1.z - 2;
obj_id rebel4 = create.object ("rebel_commando", r1);
create.addDestroyMessage (rebel4, "rebelDied", 10, self);
setMovementRun (rebel4);
location r2 = new location (4039, 34, -6385, "yavin4", null);
obj_id rebel5 = create.object ("rebel_commando", r2);
create.addDestroyMessage (rebel5, "rebelDied", 10, self);
setMovementRun (rebel5);
r2.z = r2.z - 2;
obj_id rebel6 = create.object ("rebel_trooper", r2);
create.addDestroyMessage (rebel6, "rebelDied", 10, self);
setMovementRun (rebel6);
r2.x = r2.x + 5;
obj_id rebel7 = create.object ("rebel_major_general", r2);
create.addDestroyMessage (rebel7, "rebelDied", 10, self);
setMovementRun (rebel7);
r2.z = r2.z - 2;
obj_id rebel8 = create.object ("rebel_general", r2);
create.addDestroyMessage (rebel8, "rebelDied", 10, self);
setMovementRun (rebel8);
location r3 = new location (4028, 34, -6334, "yavin4", null);
obj_id rebel9 = create.object ("rebel_commando", r3);
create.addDestroyMessage (rebel9, "rebelDied", 10, self);
setMovementRun (rebel5);
r3.z = r3.z - 2;
obj_id rebel10 = create.object ("rebel_trooper", r3);
create.addDestroyMessage (rebel10, "rebelDied", 10, self);
setMovementRun (rebel6);
r3.x = r3.x + 5;
obj_id rebel11 = create.object ("rebel_major_general", r3);
create.addDestroyMessage (rebel11, "rebelDied", 10, self);
setMovementRun (rebel7);
r3.z = r3.z - 2;
obj_id rebel12 = create.object ("rebel_general", r3);
create.addDestroyMessage (rebel12, "rebelDied", 10, self);
setMovementRun (rebel8);
location overHere = new location (4017, 37, -6300, "yavin4", null);
ai_lib.aiPathTo (rebel1, overHere);
overHere.x = overHere.x + 1;
ai_lib.aiPathTo (rebel2, overHere);
overHere.x = overHere.x + 1;
ai_lib.aiPathTo (rebel3, overHere);
overHere.x = overHere.x + 1;
ai_lib.aiPathTo (rebel4, overHere);
location overThere = new location (4044, 34, -6300, "yavin4", null);
ai_lib.aiPathTo (rebel5, overThere);
overThere.z = overThere.z + 1;
ai_lib.aiPathTo (rebel6, overThere);
overThere.z = overThere.z + 1;
ai_lib.aiPathTo (rebel7, overThere);
overThere.z = overThere.z + 1;
ai_lib.aiPathTo (rebel8, overThere);
location elseWhere = new location (4030, 34, -6300, "yavin4", null);
ai_lib.aiPathTo (rebel5, elseWhere);
elseWhere.x = elseWhere.x + 1;
ai_lib.aiPathTo (rebel6, elseWhere);
elseWhere.x = elseWhere.x + 1;
ai_lib.aiPathTo (rebel7, elseWhere);
elseWhere.x = elseWhere.x + 1;
ai_lib.aiPathTo (rebel8, elseWhere);
location imp1 = new location (4042, 0, -6278, "yavin4", null);
obj_id stormtrooper1 = create.object ("stormtrooper_squad_leader", imp1);
create.addDestroyMessage (stormtrooper1, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior( stormtrooper1, ai_lib.BEHAVIOR_SENTINEL );
location imp2 = new location (4021, 0, -6278, "yavin4", null);
obj_id stormtrooper2 = create.object ("stormtrooper", imp2);
create.addDestroyMessage (stormtrooper2, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior( stormtrooper2, ai_lib.BEHAVIOR_SENTINEL );
location imp3 = new location (4031, 0, -6274, "yavin4", null);
obj_id stormtrooper3 = create.object ("at_st", imp3);
create.addDestroyMessage (stormtrooper3, "atstDied", 10, self);
attachScript (stormtrooper3, "creature.yavin4_atst");
location imp4 = new location (4003, 0, -6261, "yavin4", null);
obj_id stormtrooper4 = create.object ("stormtrooper", imp4);
create.addDestroyMessage (stormtrooper4, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior( stormtrooper4, ai_lib.BEHAVIOR_SENTINEL );
location imp5 = new location (4042, 0, -6262, "yavin4", null);
obj_id stormtrooper5 = create.object ("stormtrooper", imp5);
create.addDestroyMessage (stormtrooper5, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior( stormtrooper5, ai_lib.BEHAVIOR_SENTINEL );
location imp6 = new location (4056, 0, -6246, "yavin4", null);
obj_id stormtrooper6 = create.object ("stormtrooper", imp6);
create.addDestroyMessage (stormtrooper6, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior( stormtrooper6, ai_lib.BEHAVIOR_SENTINEL );
location imp7 = new location (4004, 0, -6242, "yavin4", null);
obj_id stormtrooper7 = create.object ("stormtrooper", imp7);
create.addDestroyMessage (stormtrooper7, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior( stormtrooper7, ai_lib.BEHAVIOR_SENTINEL );
location imp8 = new location (4019, 0, -6263, "yavin4", null);
obj_id stormtrooper8 = create.object ("imperial_colonel", imp8);
create.addDestroyMessage (stormtrooper8, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior( stormtrooper8, ai_lib.BEHAVIOR_SENTINEL );
location imp9 = new location (4021, 0, -6260, "yavin4", null);
obj_id stormtrooper9 = create.object ("stormtrooper_medic", imp9);
create.addDestroyMessage (stormtrooper9, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior( stormtrooper9, ai_lib.BEHAVIOR_SENTINEL );
location imp10 = new location (4022, 0, -6261, "yavin4", null);
obj_id stormtrooper10 = create.object ("stormtrooper_sniper", imp10);
create.addDestroyMessage (stormtrooper10, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior( stormtrooper10, ai_lib.BEHAVIOR_SENTINEL );
location imp11 = new location (4005, 0, -6263, "yavin4", null);
obj_id stormtrooper11 = create.object ("scout_trooper", imp11);
create.addDestroyMessage (stormtrooper11, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior( stormtrooper11, ai_lib.BEHAVIOR_SENTINEL );
location imp12 = new location (4021, 0, -6256, "yavin4", null);
obj_id stormtrooper12 = create.object ("scout_trooper", imp12);
create.addDestroyMessage (stormtrooper12, "imperialDied", 10, self);
ai_lib.setDefaultCalmBehavior( stormtrooper12, ai_lib.BEHAVIOR_SENTINEL );
setObjVar (self, "rebels", 8);
setObjVar (self, "imperials", 7);
setObjVar (self, "atst", 1);
location rallyPointVader = new location (4017, 37, -6300, "yavin4", null);
ai_lib.aiPathTo (stormtrooper1, rallyPointVader);
rallyPointVader.x = rallyPointVader.x + 1;
ai_lib.aiPathTo (stormtrooper2, rallyPointVader);
rallyPointVader.x = rallyPointVader.x + 1;
ai_lib.aiPathTo (stormtrooper4, rallyPointVader);
location rallyPointMara = new location (4044, 34, -6300, "yavin4", null);
ai_lib.aiPathTo (stormtrooper5, rallyPointMara);
rallyPointMara.z = rallyPointMara.z + 1;
ai_lib.aiPathTo (stormtrooper6, rallyPointMara);
rallyPointMara.z = rallyPointMara.z + 1;
ai_lib.aiPathTo (stormtrooper7, rallyPointMara);
rallyPointMara.z = rallyPointMara.z + 1;
ai_lib.aiPathTo (stormtrooper8, rallyPointMara);
location rallyPointEmperor = new location (4030, 34, -6300, "yavin4", null);
ai_lib.aiPathTo (stormtrooper9, rallyPointEmperor);
rallyPointEmperor.x = rallyPointEmperor.x + 1;
ai_lib.aiPathTo (stormtrooper10, rallyPointEmperor);
rallyPointEmperor.x = rallyPointEmperor.x + 1;
ai_lib.aiPathTo (stormtrooper11, rallyPointEmperor);
rallyPointEmperor.x = rallyPointEmperor.x + 1;
ai_lib.aiPathTo (stormtrooper12, rallyPointEmperor);
return SCRIPT_CONTINUE;
}
messageHandler imperialDied()
{
obj_id dead = params.getObjId ("object");
int imperials = getIntObjVar (self, "imperials");
string newImp = "";
if (imperials < 12)
{
location imp = getImperialLocation();
imp.x = imp.x + rand(-3,3);
imp.z = imp.z + rand(-3,3);
newImp = getImperial();
obj_id stormtrooper12 = create.object (newImp, imp);
create.addDestroyMessage (stormtrooper12, "imperialDied", 10, self);
ai_lib.aiPathTo (stormtrooper12, getRebelDestination());
}
int rebelPoints = getIntObjVar (self, "rebelPoints");
rebelPoints = rebelPoints + 1;
setObjVar (self, "rebelPoints", rebelPoints);
return SCRIPT_CONTINUE;
}
messageHandler rebelDied ()
{
obj_id dead = params.getObjId ("object");
string newReb = "";
int rebels = getIntObjVar (self, "rebels");
if (rebels < 12)
{
newReb = getRebel();
obj_id rebel1 = create.object (newReb, getRebelStart());
create.addDestroyMessage (rebel1, "rebelDied", 10, self);
setMovementRun (rebel1);
ai_lib.aiPathTo (rebel1, getRebelDestination());
}
int impPoints = getIntObjVar (self, "imperialPoints");
impPoints = impPoints + 1;
setObjVar (self, "imperialPoints", impPoints);
destroyObject (dead);
return SCRIPT_CONTINUE;
}
messageHandler atstDied ()
{
// This message handler adds a small delay before re-creating the AT-ST
messageTo(self, "spawnATST", null, 8, true);
return SCRIPT_CONTINUE;
}
messageHandler spawnATST ()
{
obj_id dead = params.getObjId ("object");
location imp3 = new location (4031, 0, -6274, "yavin4", null);
obj_id stormtrooper3 = create.object ("at_st", imp3);
create.addDestroyMessage (stormtrooper3, "atstDied", 10, self);
attachScript (stormtrooper3, "creature.yavin4_atst");
//setMaxAttrib(stormtrooper3, HEALTH, 500);
//setAttrib( stormtrooper3, HEALTH, 200);
int rebelPoints = getIntObjVar (self, "rebelPoints");
rebelPoints = rebelPoints + 1;
setObjVar (self, "rebelPoints", rebelPoints);
destroyObject (dead);
return SCRIPT_CONTINUE;
}
string getRebel ()
{
int randomRebel = rand(1,8);
string rebel = "rebel_trooper";
switch (randomRebel)
{
case 1:
rebel = "rebel_corporal";
break;
case 2:
rebel = "rebel_sergeant";
break;
case 3:
rebel = "rebel_general";
break;
case 4:
rebel = "rebel_corporal";
break;
case 5:
rebel = "rebel_sergeant";
break;
case 6:
rebel = "rebel_major_general";
break;
case 7:
rebel = "rebel_commando";
break;
case 8:
rebel = "rebel_commando";
break;
}
return rebel;
}
location getRebelStart()
{
location r1 = new location (4017, 34, -6284, "yavin4", null);
location r2 = new location (4039, 34, -6385, "yavin4", null);
location r3 = new location (4028, 34, -6334, "yavin4", null);
int randomLoc = rand (1,3);
location rebel = getLocation (getSelf());
switch (randomLoc)
{
case 1:
rebel = r1;
break;
case 2:
rebel = r2;
break;
case 3:
rebel = r3;
break;
}
return rebel;
}
location getRebelDestination()
{
location overHere = new location (4017, 37, -6300, "yavin4", null);
location overThere = new location (4044, 34, -6300, "yavin4", null);
location elseWhere = new location (4030, 34, -6300, "yavin4", null);
int randomLoc = rand (1,3);
location rebel = getLocation (getSelf());
switch (randomLoc)
{
case 1:
rebel = overHere;
break;
case 2:
rebel = overThere;
break;
case 3:
rebel = elseWhere;
break;
}
return rebel;
}
location getImperialLocation()
{
location imp1 = new location (4042, 0, -6278, "yavin4", null);
location imp2 = new location (4021, 0, -6278, "yavin4", null);
location imp3 = new location (4031, 0, -6274, "yavin4", null);
location imp4 = new location (4003, 0, -6261, "yavin4", null);
location imp5 = new location (4042, 0, -6262, "yavin4", null);
location imp6 = new location (4056, 0, -6246, "yavin4", null);
location imp7 = new location (4004, 0, -6242, "yavin4", null);
location imp8 = new location (4019, 0, -6263, "yavin4", null);
location imp9 = new location (4021, 0, -6260, "yavin4", null);
location imp10 = new location (4022, 0, -6261, "yavin4", null);
location imp11 = new location (4005, 0, -6263, "yavin4", null);
location imp12 = new location (4021, 0, -6256, "yavin4", null);
int randomLoc = rand (1,12);
location imp = getLocation (getSelf());
switch (randomLoc)
{
case 1:
imp = imp1;
break;
case 2:
imp = imp2;
break;
case 3:
imp = imp3;
break;
case 4:
imp = imp4;
break;
case 5:
imp = imp5;
break;
case 6:
imp = imp6;
break;
case 7:
imp = imp7;
break;
case 8:
imp = imp8;
break;
case 9:
imp = imp9;
break;
case 10:
imp = imp10;
break;
case 11:
imp = imp11;
break;
case 12:
imp = imp12;
break;
}
return imp;
}
string getImperial ()
{
int randomimperial = rand(1,8);
string imperial = "imperial_trooper";
switch (randomimperial)
{
case 1:
imperial = "scout_trooper";
break;
case 2:
imperial = "stormtrooper";
break;
case 3:
imperial = "stormtrooper_squad_leader";
break;
case 4:
imperial = "stormtrooper_sniper";
break;
case 5:
imperial = "stormtrooper_medic";
break;
case 6:
imperial = "imperial_colonel";
break;
case 7:
imperial = "stormtrooper";
break;
case 8:
imperial = "stormtrooper";
break;
}
return imperial;
}
@@ -0,0 +1,55 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class rori_easy extends script.creature_spawner.base_newbie_creature_spawner
{
public rori_easy()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
public String pickCreature() throws InterruptedException
{
String creature = "frail_squall";
int choice = rand(1, 4);
switch (choice)
{
case 1:
creature = "flesh_eating_chuba";
break;
case 2:
creature = "nightspider";
break;
case 3:
creature = "frail_squall";
break;
case 4:
creature = "frail_squall";
break;
default:
creature = "flesh_eating_chuba";
break;
}
return creature;
}
public int getMaxPop() throws InterruptedException
{
int maxPop = 6;
return maxPop;
}
}
@@ -1,45 +0,0 @@
inherits creature_spawner.base_newbie_creature_spawner;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
// overloading these two functions.
string pickCreature()
{
string creature = "frail_squall";
int choice = rand (1,4);
switch (choice)
{
case 1:
creature = "flesh_eating_chuba";
break;
case 2:
creature = "nightspider";
break;
case 3:
creature = "frail_squall";
break;
case 4:
creature = "frail_squall";
break;
default:
creature = "flesh_eating_chuba";
break;
}
return creature;
}
int getMaxPop()
{
int maxPop = 6;
return maxPop;
}
@@ -0,0 +1,58 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class rori_hard extends script.creature_spawner.base_newbie_creature_spawner
{
public rori_hard()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
public String pickCreature() throws InterruptedException
{
String creature = "wormed_vrobal";
int choice = rand(1, 5);
switch (choice)
{
case 1:
creature = "wormed_vrobal";
break;
case 2:
creature = "bark_mite";
break;
case 3:
creature = "vir_vur";
break;
case 4:
creature = "squall_female";
break;
case 5:
creature = "squall_male";
break;
default:
creature = "bark_mite";
break;
}
return creature;
}
public int getMaxPop() throws InterruptedException
{
int maxPop = 3;
return maxPop;
}
}
@@ -1,48 +0,0 @@
inherits creature_spawner.base_newbie_creature_spawner;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
// overloading these two functions.
string pickCreature()
{
string creature = "wormed_vrobal";
int choice = rand (1,5);
switch (choice)
{
case 1:
creature = "wormed_vrobal";
break;
case 2:
creature = "bark_mite";
break;
case 3:
creature = "vir_vur";
break;
case 4:
creature = "squall_female";
break;
case 5:
creature = "squall_male";
break;
default:
creature = "bark_mite";
break;
}
return creature;
}
int getMaxPop()
{
int maxPop = 3;
return maxPop;
}
@@ -0,0 +1,58 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class rori_medium extends script.creature_spawner.base_newbie_creature_spawner
{
public rori_medium()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
public String pickCreature() throws InterruptedException
{
String creature = "vrobalet";
int choice = rand(1, 5);
switch (choice)
{
case 1:
creature = "vrobalet";
break;
case 2:
creature = "timid_vir_vur";
break;
case 3:
creature = "flewt";
break;
case 4:
creature = "vrobalet";
break;
case 5:
creature = "timid_vir_vur";
break;
default:
creature = "timid_vir_vur";
break;
}
return creature;
}
public int getMaxPop() throws InterruptedException
{
int maxPop = 4;
return maxPop;
}
}
@@ -1,48 +0,0 @@
inherits creature_spawner.base_newbie_creature_spawner
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
// overloading these two functions.
string pickCreature()
{
string creature = "vrobalet";
int choice = rand (1,5);
switch (choice)
{
case 1:
creature = "vrobalet";
break;
case 2:
creature = "timid_vir_vur";
break;
case 3:
creature = "flewt";
break;
case 4:
creature = "vrobalet";
break;
case 5:
creature = "timid_vir_vur";
break;
default:
creature = "timid_vir_vur";
break;
}
return creature;
}
int getMaxPop()
{
int maxPop = 4;
return maxPop;
}
@@ -0,0 +1,133 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.create;
import script.library.locations;
import script.library.spawning;
import script.library.utils;
public class rori_npc_easy extends script.base_script
{
public rori_npc_easy()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
LOG("NewbieSpawn", "Spawning Init: " + self);
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
LOG("NewbieSpawn", "Spawning Anew: " + self);
String whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 4;
if (hasObjVar(self, "pop"))
{
maxPop = getIntObjVar(self, "pop");
}
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
LOG("NewbieSpawn", "spawning #" + count);
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
if (!utils.hasScriptVar(self, "myCreations"))
{
Vector myCreations = new Vector();
myCreations.setSize(0);
utils.addElement(myCreations, spawned);
utils.setScriptVar(self, "myCreations", myCreations);
}
else
{
Vector theList = utils.getResizeableObjIdArrayScriptVar(self, "myCreations");
if (theList.size() >= maxPop)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add(spawned);
utils.setScriptVar(self, "myCreations", theList);
}
}
if (hasObjVar(self, "useCityWanderScript"))
{
attachScript(spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar(self, "count", count);
}
return;
}
public String pickCreature() throws InterruptedException
{
int choice = rand(1, 4);
String creature = "garyn_prowler";
switch (choice)
{
case 1:
creature = "garyn_prowler";
break;
case 2:
creature = "gundark_crook";
break;
case 3:
creature = "cobral_mugger";
break;
case 4:
creature = "gundark_hooligan";
break;
default:
creature = "cobral_mugger";
break;
}
return creature;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
if (params == null || params.isEmpty())
{
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,136 +0,0 @@
include library.ai_lib;
include library.create;
include library.locations;
include library.spawning;
include library.utils;
trigger OnInitialize()
{
spawnCreatures(self);
LOG("NewbieSpawn", "Spawning Init: " + self);
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
LOG("NewbieSpawn", "Spawning Anew: " + self);
//deltadictionary spawn = self.getScriptVars();
//string whatToSpawn = spawn.getString("creatureToSpawn");
string whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
//spawn.put("creatureToSpawn", whatToSpawn);
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 4;
if ( hasObjVar(self, "pop") )
{
maxPop = getIntObjVar (self, "pop");
}
//int count = spawn.getInt("count");
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
LOG("NewbieSpawn", "spawning #" + count);
location goodLoc = pickLocation();
if(goodLoc == null)
goodLoc = getLocation(self);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
if (!utils.hasScriptVar (self, "myCreations"))
{
resizeable obj_id[] myCreations = new obj_id[0];
utils.addElement (myCreations, spawned);
utils.setScriptVar (self, "myCreations", myCreations);
}
else
{
resizeable obj_id[] theList = utils.getResizeableObjIdArrayScriptVar (self, "myCreations");
if (theList.length >= maxPop)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add (spawned);
utils.setScriptVar (self, "myCreations", theList);
}
}
// Allow some NPCs to be placed in a city and use city waypoints.
if ( hasObjVar(self, "useCityWanderScript") )
{
attachScript (spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar (self, "count", count);
}
return;
}
string pickCreature()
{
int choice = rand (1,4);
string creature = "garyn_prowler";
switch (choice)
{
case 1:
creature = "garyn_prowler";
break;
case 2:
creature = "gundark_crook";
break;
case 3:
creature = "cobral_mugger";
break;
case 4:
creature = "gundark_hooligan";
break;
default:
creature = "cobral_mugger";
break;
}
return creature;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
messageHandler creatureDied()
{
if(params == null || params.isEmpty())
{
LOG ("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId ("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,133 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.create;
import script.library.locations;
import script.library.spawning;
import script.library.utils;
public class rori_npc_hard extends script.base_script
{
public rori_npc_hard()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
String whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if (hasObjVar(self, "pop"))
{
maxPop = getIntObjVar(self, "pop");
}
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
if (!utils.hasScriptVar(self, "myCreations"))
{
Vector myCreations = new Vector();
myCreations.setSize(0);
utils.addElement(myCreations, spawned);
utils.setScriptVar(self, "myCreations", myCreations);
}
else
{
Vector theList = utils.getResizeableObjIdArrayScriptVar(self, "myCreations");
if (theList.size() >= maxPop)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add(spawned);
utils.setScriptVar(self, "myCreations", theList);
}
}
if (hasObjVar(self, "useCityWanderScript"))
{
attachScript(spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar(self, "count", count);
}
return;
}
public String pickCreature() throws InterruptedException
{
int choice = rand(1, 5);
String creature = "gundark_raider";
switch (choice)
{
case 1:
creature = "gundark_raider";
break;
case 2:
creature = "gundark_ruffian";
break;
case 3:
creature = "garyn_mugger";
break;
case 4:
creature = "cobral_thug";
break;
case 5:
creature = "garyn_pirate";
break;
default:
creature = "garyn_pirate";
break;
}
return creature;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
if (params == null || params.isEmpty())
{
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,138 +0,0 @@
include library.ai_lib;
include library.create;
include library.locations;
include library.spawning;
include library.utils;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
// debugSpeakMsg (self, "Spawning Anew");
//deltadictionary spawn = self.getScriptVars();
//string whatToSpawn = spawn.getString("creatureToSpawn");
string whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
//spawn.put("creatureToSpawn", whatToSpawn);
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if ( hasObjVar(self, "pop") )
{
maxPop = getIntObjVar (self, "pop");
}
//int count = spawn.getInt("count");
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
// debugSpeakMsg (self, "spawning #" + count);
location goodLoc = pickLocation();
if(goodLoc == null)
goodLoc = getLocation(self);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
if (!utils.hasScriptVar (self, "myCreations"))
{
resizeable obj_id[] myCreations = new obj_id[0];
utils.addElement (myCreations, spawned);
utils.setScriptVar (self, "myCreations", myCreations);
}
else
{
resizeable obj_id[] theList = utils.getResizeableObjIdArrayScriptVar (self, "myCreations");
if (theList.length >= maxPop)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add (spawned);
utils.setScriptVar (self, "myCreations", theList);
}
}
// Allow some NPCs to be placed in a city and use city waypoints.
if ( hasObjVar(self, "useCityWanderScript") )
{
attachScript (spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar (self, "count", count);
}
return;
}
string pickCreature()
{
int choice = rand (1,5);
string creature = "gundark_raider";
switch (choice)
{
case 1:
creature = "gundark_raider";
break;
case 2:
creature = "gundark_ruffian";
break;
case 3:
creature = "garyn_mugger";
break;
case 4:
creature = "cobral_thug";
break;
case 5:
creature = "garyn_pirate";
break;
default:
creature = "garyn_pirate";
break;
}
return creature;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
messageHandler creatureDied()
{
if(params == null || params.isEmpty())
{
LOG ("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId ("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,136 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.create;
import script.library.locations;
import script.library.spawning;
import script.library.utils;
public class rori_npc_medium extends script.base_script
{
public rori_npc_medium()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
String whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if (hasObjVar(self, "pop"))
{
maxPop = getIntObjVar(self, "pop");
}
int count = utils.getIntScriptVar(self, "count");
LOG("sissynoid", "Spawn Creature - Retrieving Count - (" + count + ")");
while (count < maxPop)
{
LOG("sissynoid", "Spawn Creature - Count(" + count + ")" + " MaxPop(" + maxPop + ")");
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
if (!utils.hasScriptVar(self, "myCreations"))
{
Vector myCreations = new Vector();
myCreations.setSize(0);
utils.addElement(myCreations, spawned);
utils.setScriptVar(self, "myCreations", myCreations);
}
else
{
Vector theList = utils.getResizeableObjIdArrayScriptVar(self, "myCreations");
if (theList.size() >= maxPop)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
LOG("sissynoid", "theList is in VIOLATION!");
return;
}
else
{
theList.add(spawned);
utils.setScriptVar(self, "myCreations", theList);
}
}
if (hasObjVar(self, "useCityWanderScript"))
{
attachScript(spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
LOG("sissynoid", "Spawn Creature - Incrementing Count(" + count + ")");
utils.setScriptVar(self, "count", count);
LOG("sissynoid", "Spawn Creature - Setting Count(" + count + ")");
}
return;
}
public String pickCreature() throws InterruptedException
{
int choice = rand(1, 4);
String creature = "garyn_thief";
switch (choice)
{
case 1:
creature = "gundark_rogue";
break;
case 2:
creature = "cobral_hooligan";
break;
case 3:
creature = "garyn_thief";
break;
case 4:
creature = "gundark_desperado";
break;
default:
creature = "gundark_rogue";
break;
}
return creature;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
if (params == null || params.isEmpty())
{
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId("deadGuy");
LOG("sissynoid", "Spawner " + self + " is replacing Mob(" + deadNpc + ")");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,139 +0,0 @@
include library.ai_lib;
include library.create;
include library.locations;
include library.spawning;
include library.utils;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
// debugSpeakMsg (self, "Spawning Anew");
//deltadictionary spawn = self.getScriptVars();
//string whatToSpawn = spawn.getString("creatureToSpawn");
string whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
//spawn.put("creatureToSpawn", whatToSpawn);
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if ( hasObjVar(self, "pop") )
{
maxPop = getIntObjVar (self, "pop");
}
//int count = spawn.getInt("count");
int count = utils.getIntScriptVar(self, "count");
LOG("sissynoid", "Spawn Creature - Retrieving Count - (" + count + ")");
while (count < maxPop)
{
LOG("sissynoid", "Spawn Creature - Count(" + count + ")" + " MaxPop("+ maxPop +")");
// debugSpeakMsg (self, "spawning #" + count);
location goodLoc = pickLocation();
if(goodLoc == null)
goodLoc = getLocation(self);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
if (!utils.hasScriptVar (self, "myCreations"))
{
resizeable obj_id[] myCreations = new obj_id[0];
utils.addElement (myCreations, spawned);
utils.setScriptVar (self, "myCreations", myCreations);
}
else
{
resizeable obj_id[] theList = utils.getResizeableObjIdArrayScriptVar (self, "myCreations");
if (theList.length >= maxPop)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
LOG("sissynoid", "theList is in VIOLATION!");
return;
}
else
{
theList.add (spawned);
utils.setScriptVar (self, "myCreations", theList);
}
}
// Allow some NPCs to be placed in a city and use city waypoints.
if ( hasObjVar(self, "useCityWanderScript") )
{
attachScript (spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
LOG("sissynoid", "Spawn Creature - Incrementing Count("+ count +")");
utils.setScriptVar (self, "count", count);
LOG("sissynoid", "Spawn Creature - Setting Count("+ count +")");
}
return;
}
string pickCreature()
{
int choice = rand (1,4);
string creature = "garyn_thief";
switch (choice)
{
case 1:
creature = "gundark_rogue";
break;
case 2:
creature = "cobral_hooligan";
break;
case 3:
creature = "garyn_thief";
break;
case 4:
creature = "gundark_desperado";
break;
default:
creature = "gundark_rogue";
break;
}
return creature;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
messageHandler creatureDied()
{
if(params == null || params.isEmpty())
{
LOG ("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId ("deadGuy");
LOG ("sissynoid", "Spawner " + self + " is replacing Mob(" + deadNpc + ")");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,32 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class sarlacc_dathomir_spawner extends script.base_script
{
public sarlacc_dathomir_spawner()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
location sarlaccPit = new location(-2078.08f, 8f, 3143.75f, "dathomir", null);
obj_id sarlacc = createObject("object/mobile/sarlacc.iff", sarlaccPit);
setObjVar(sarlacc, "creater", self);
attachScript(sarlacc, "creature_spawner.death_msg");
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
location sarlaccPit = new location(-2078.08f, 8f, 3143.75f, "dathomir", null);
obj_id sarlacc = createObject("object/mobile/sarlacc.iff", sarlaccPit);
setObjVar(sarlacc, "creater", self);
attachScript(sarlacc, "creature_spawner.death_msg");
return SCRIPT_CONTINUE;
}
}
@@ -1,18 +0,0 @@
trigger OnInitialize()
{
location sarlaccPit = new location ( -2078.08f, 8f, 3143.75f, "dathomir", null);
obj_id sarlacc = createObject ( "object/mobile/sarlacc.iff", sarlaccPit );
setObjVar ( sarlacc, "creater", self);
attachScript ( sarlacc, "creature_spawner.death_msg");
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
location sarlaccPit = new location ( -2078.08f, 8f, 3143.75f, "dathomir", null);
obj_id sarlacc = createObject ( "object/mobile/sarlacc.iff", sarlaccPit );
setObjVar ( sarlacc, "creater", self);
attachScript ( sarlacc, "creature_spawner.death_msg");
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,32 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class sarlacc_spawner extends script.base_script
{
public sarlacc_spawner()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
location sarlaccPit = new location(-6173, 14, -3361, "tatooine", null);
obj_id sarlacc = createObject("object/mobile/sarlacc.iff", sarlaccPit);
setObjVar(sarlacc, "creater", self);
attachScript(sarlacc, "creature_spawner.death_msg");
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
location sarlaccPit = new location(-6173, 14, -3361, "tatooine", null);
obj_id sarlacc = createObject("object/mobile/sarlacc.iff", sarlaccPit);
setObjVar(sarlacc, "creater", self);
attachScript(sarlacc, "creature_spawner.death_msg");
return SCRIPT_CONTINUE;
}
}
@@ -1,18 +0,0 @@
trigger OnInitialize()
{
location sarlaccPit = new location ( -6173, 14, -3361, "tatooine", null);
obj_id sarlacc = createObject ( "object/mobile/sarlacc.iff", sarlaccPit );
setObjVar ( sarlacc, "creater", self);
attachScript ( sarlacc, "creature_spawner.death_msg");
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
location sarlaccPit = new location ( -6173, 14, -3361, "tatooine", null);
obj_id sarlacc = createObject ( "object/mobile/sarlacc.iff", sarlaccPit );
setObjVar ( sarlacc, "creater", self);
attachScript ( sarlacc, "creature_spawner.death_msg");
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,33 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class talus_easy extends script.creature_spawner.base_newbie_creature_spawner
{
public talus_easy()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
return SCRIPT_CONTINUE;
}
public String pickCreature() throws InterruptedException
{
return null;
}
public int getMaxPop() throws InterruptedException
{
int maxPop = 0;
return maxPop;
}
}
@@ -1,25 +0,0 @@
inherits creature_spawner.base_newbie_creature_spawner;
trigger OnInitialize()
{
// spawnCreatures(self);
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
// doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
// overloading these two functions.
string pickCreature()
{
return null;
}
int getMaxPop()
{
int maxPop = 0;
return maxPop;
}
@@ -0,0 +1,33 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class talus_hard extends script.creature_spawner.base_newbie_creature_spawner
{
public talus_hard()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
return SCRIPT_CONTINUE;
}
public String pickCreature() throws InterruptedException
{
return null;
}
public int getMaxPop() throws InterruptedException
{
int maxPop = 0;
return maxPop;
}
}
@@ -1,25 +0,0 @@
inherits creature_spawner.base_newbie_creature_spawner;
trigger OnInitialize()
{
// spawnCreatures(self);
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
// doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
// overloading these two functions.
string pickCreature()
{
return null;
}
int getMaxPop()
{
int maxPop = 0;
return maxPop;
}
@@ -0,0 +1,33 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class talus_medium extends script.creature_spawner.base_newbie_creature_spawner
{
public talus_medium()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
return SCRIPT_CONTINUE;
}
public String pickCreature() throws InterruptedException
{
return null;
}
public int getMaxPop() throws InterruptedException
{
int maxPop = 0;
return maxPop;
}
}
@@ -1,25 +0,0 @@
inherits creature_spawner.base_newbie_creature_spawner;
trigger OnInitialize()
{
// spawnCreatures(self);
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
// doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
// overloading these two functions.
string pickCreature()
{
return null;
}
int getMaxPop()
{
int maxPop = 0;
return maxPop;
}
@@ -0,0 +1,133 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.create;
import script.library.locations;
import script.library.spawning;
import script.library.utils;
public class talus_npc_easy extends script.base_script
{
public talus_npc_easy()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
LOG("NewbieSpawn", "Spawning Init: " + self);
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
LOG("NewbieSpawn", "Spawning Anew: " + self);
String whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 4;
if (hasObjVar(self, "pop"))
{
maxPop = getIntObjVar(self, "pop");
}
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
LOG("NewbieSpawn", "spawning #" + count);
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
if (!utils.hasScriptVar(self, "myCreations"))
{
Vector myCreations = new Vector();
myCreations.setSize(0);
utils.addElement(myCreations, spawned);
utils.setScriptVar(self, "myCreations", myCreations);
}
else
{
Vector theList = utils.getResizeableObjIdArrayScriptVar(self, "myCreations");
if (theList.size() >= maxPop)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add(spawned);
utils.setScriptVar(self, "myCreations", theList);
}
}
if (hasObjVar(self, "useCityWanderScript"))
{
attachScript(spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar(self, "count", count);
}
return;
}
public String pickCreature() throws InterruptedException
{
int choice = rand(1, 4);
String creature = "chunker_nitwit";
switch (choice)
{
case 1:
creature = "chunker_nitwit";
break;
case 2:
creature = "chunker_punk";
break;
case 3:
creature = "sleemo_hoodlum";
break;
case 4:
creature = "sleemo_punk";
break;
default:
creature = "sleemo_hoodlum";
break;
}
return creature;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
if (params == null || params.isEmpty())
{
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,136 +0,0 @@
include library.ai_lib;
include library.create;
include library.locations;
include library.spawning;
include library.utils;
trigger OnInitialize()
{
spawnCreatures(self);
LOG("NewbieSpawn", "Spawning Init: " + self);
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
LOG("NewbieSpawn", "Spawning Anew: " + self);
//deltadictionary spawn = self.getScriptVars();
//string whatToSpawn = spawn.getString("creatureToSpawn");
string whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
//spawn.put("creatureToSpawn", whatToSpawn);
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 4;
if ( hasObjVar(self, "pop") )
{
maxPop = getIntObjVar (self, "pop");
}
//int count = spawn.getInt("count");
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
LOG("NewbieSpawn", "spawning #" + count);
location goodLoc = pickLocation();
if(goodLoc == null)
goodLoc = getLocation(self);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
if (!utils.hasScriptVar (self, "myCreations"))
{
resizeable obj_id[] myCreations = new obj_id[0];
utils.addElement (myCreations, spawned);
utils.setScriptVar (self, "myCreations", myCreations);
}
else
{
resizeable obj_id[] theList = utils.getResizeableObjIdArrayScriptVar (self, "myCreations");
if (theList.length >= maxPop)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add (spawned);
utils.setScriptVar (self, "myCreations", theList);
}
}
// Allow some NPCs to be placed in a city and use city waypoints.
if ( hasObjVar(self, "useCityWanderScript") )
{
attachScript (spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar (self, "count", count);
}
return;
}
string pickCreature()
{
int choice = rand (1,4);
string creature = "chunker_nitwit";
switch (choice)
{
case 1:
creature = "chunker_nitwit";
break;
case 2:
creature = "chunker_punk";
break;
case 3:
creature = "sleemo_hoodlum";
break;
case 4:
creature = "sleemo_punk";
break;
default:
creature = "sleemo_hoodlum";
break;
}
return creature;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
messageHandler creatureDied()
{
if(params == null || params.isEmpty())
{
LOG ("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId ("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,130 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.create;
import script.library.locations;
import script.library.spawning;
import script.library.utils;
public class talus_npc_hard extends script.base_script
{
public talus_npc_hard()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
String whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if (hasObjVar(self, "pop"))
{
maxPop = getIntObjVar(self, "pop");
}
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
if (!utils.hasScriptVar(self, "myCreations"))
{
Vector myCreations = new Vector();
myCreations.setSize(0);
utils.addElement(myCreations, spawned);
utils.setScriptVar(self, "myCreations", myCreations);
}
else
{
Vector theList = utils.getResizeableObjIdArrayScriptVar(self, "myCreations");
if (theList.size() >= maxPop)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add(spawned);
utils.setScriptVar(self, "myCreations", theList);
}
}
if (hasObjVar(self, "useCityWanderScript"))
{
attachScript(spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar(self, "count", count);
}
return;
}
public String pickCreature() throws InterruptedException
{
int choice = rand(1, 4);
String creature = "chunker_bully";
switch (choice)
{
case 1:
creature = "sleemo_vandal";
break;
case 2:
creature = "chunker_bully";
break;
case 3:
creature = "aakuan_follower";
break;
case 4:
creature = "binayre_hooligan";
break;
default:
creature = "aakuan_follower";
break;
}
return creature;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
if (params == null || params.isEmpty())
{
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,135 +0,0 @@
include library.ai_lib;
include library.create;
include library.locations;
include library.spawning;
include library.utils;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
// debugSpeakMsg (self, "Spawning Anew");
//deltadictionary spawn = self.getScriptVars();
//string whatToSpawn = spawn.getString("creatureToSpawn");
string whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
//spawn.put("creatureToSpawn", whatToSpawn);
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if ( hasObjVar(self, "pop") )
{
maxPop = getIntObjVar (self, "pop");
}
//int count = spawn.getInt("count");
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
// debugSpeakMsg (self, "spawning #" + count);
location goodLoc = pickLocation();
if(goodLoc == null)
goodLoc = getLocation(self);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
if (!utils.hasScriptVar (self, "myCreations"))
{
resizeable obj_id[] myCreations = new obj_id[0];
utils.addElement (myCreations, spawned);
utils.setScriptVar (self, "myCreations", myCreations);
}
else
{
resizeable obj_id[] theList = utils.getResizeableObjIdArrayScriptVar (self, "myCreations");
if (theList.length >= maxPop)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add (spawned);
utils.setScriptVar (self, "myCreations", theList);
}
}
// Allow some NPCs to be placed in a city and use city waypoints.
if ( hasObjVar(self, "useCityWanderScript") )
{
attachScript (spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar (self, "count", count);
}
return;
}
string pickCreature()
{
int choice = rand (1,4);
string creature = "chunker_bully";
switch (choice)
{
case 1:
creature = "sleemo_vandal";
break;
case 2:
creature = "chunker_bully";
break;
case 3:
creature = "aakuan_follower";
break;
case 4:
creature = "binayre_hooligan";
break;
default:
creature = "aakuan_follower";
break;
}
return creature;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
messageHandler creatureDied()
{
if(params == null || params.isEmpty())
{
LOG ("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId ("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,130 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.create;
import script.library.locations;
import script.library.spawning;
import script.library.utils;
public class talus_npc_medium extends script.base_script
{
public talus_npc_medium()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
String whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if (hasObjVar(self, "pop"))
{
maxPop = getIntObjVar(self, "pop");
}
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
if (!utils.hasScriptVar(self, "myCreations"))
{
Vector myCreations = new Vector();
myCreations.setSize(0);
utils.addElement(myCreations, spawned);
utils.setScriptVar(self, "myCreations", myCreations);
}
else
{
Vector theList = utils.getResizeableObjIdArrayScriptVar(self, "myCreations");
if (theList.size() >= maxPop)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add(spawned);
utils.setScriptVar(self, "myCreations", theList);
}
}
if (hasObjVar(self, "useCityWanderScript"))
{
attachScript(spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar(self, "count", count);
}
return;
}
public String pickCreature() throws InterruptedException
{
int choice = rand(1, 4);
String creature = "sleemo_delinquent";
switch (choice)
{
case 1:
creature = "chunker_mooch";
break;
case 2:
creature = "chunker_swindler";
break;
case 3:
creature = "sleemo_delinquent";
break;
case 4:
creature = "sleemo_scamp";
break;
default:
creature = "sleemo_scamp";
break;
}
return creature;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
if (params == null || params.isEmpty())
{
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,135 +0,0 @@
include library.ai_lib;
include library.create;
include library.locations;
include library.spawning;
include library.utils;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
// debugSpeakMsg (self, "Spawning Anew");
//deltadictionary spawn = self.getScriptVars();
//string whatToSpawn = spawn.getString("creatureToSpawn");
string whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
//spawn.put("creatureToSpawn", whatToSpawn);
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if ( hasObjVar(self, "pop") )
{
maxPop = getIntObjVar (self, "pop");
}
//int count = spawn.getInt("count");
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
// debugSpeakMsg (self, "spawning #" + count);
location goodLoc = pickLocation();
if(goodLoc == null)
goodLoc = getLocation(self);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
if (!utils.hasScriptVar (self, "myCreations"))
{
resizeable obj_id[] myCreations = new obj_id[0];
utils.addElement (myCreations, spawned);
utils.setScriptVar (self, "myCreations", myCreations);
}
else
{
resizeable obj_id[] theList = utils.getResizeableObjIdArrayScriptVar (self, "myCreations");
if (theList.length >= maxPop)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add (spawned);
utils.setScriptVar (self, "myCreations", theList);
}
}
// Allow some NPCs to be placed in a city and use city waypoints.
if ( hasObjVar(self, "useCityWanderScript") )
{
attachScript (spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar (self, "count", count);
}
return;
}
string pickCreature()
{
int choice = rand (1,4);
string creature = "sleemo_delinquent";
switch (choice)
{
case 1:
creature = "chunker_mooch";
break;
case 2:
creature = "chunker_swindler";
break;
case 3:
creature = "sleemo_delinquent";
break;
case 4:
creature = "sleemo_scamp";
break;
default:
creature = "sleemo_scamp";
break;
}
return creature;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
messageHandler creatureDied()
{
if(params == null || params.isEmpty())
{
LOG ("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId ("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,73 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class tatooine_easy extends script.creature_spawner.base_newbie_creature_spawner
{
public tatooine_easy()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
public String pickCreature() throws InterruptedException
{
String creature = "minor_worrt";
int choice = rand(1, 14);
switch (choice)
{
case 1:
case 2:
case 3:
creature = "minor_worrt";
break;
case 4:
case 5:
case 6:
creature = "kreetle";
break;
case 7:
case 8:
creature = "rill";
break;
case 9:
case 10:
creature = "lesser_desert_womprat";
break;
case 11:
creature = "worrt";
break;
case 12:
creature = "rockmite";
break;
case 13:
creature = "mound_mite";
break;
case 14:
creature = "womprat";
break;
default:
creature = "minor_worrt";
break;
}
return creature;
}
public int getMaxPop() throws InterruptedException
{
int maxPop = 8;
return maxPop;
}
}
@@ -1,63 +0,0 @@
inherits creature_spawner.base_newbie_creature_spawner;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
// overloading these two functions.
string pickCreature()
{
string creature = "minor_worrt";
int choice = rand (1,14);
switch (choice)
{
case 1:
case 2:
case 3:
creature = "minor_worrt";
break;
case 4:
case 5:
case 6:
creature = "kreetle";
break;
case 7:
case 8:
creature = "rill";
break;
case 9:
case 10:
creature = "lesser_desert_womprat";
break;
case 11:
creature = "worrt";
break;
case 12:
creature = "rockmite";
break;
case 13:
creature = "mound_mite";
break;
case 14:
creature = "womprat";
break;
default:
creature = "minor_worrt";
break;
}
return creature;
}
int getMaxPop()
{
int maxPop = 8;
return maxPop;
}
@@ -0,0 +1,52 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class tatooine_hard extends script.creature_spawner.base_newbie_creature_spawner
{
public tatooine_hard()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
public String pickCreature() throws InterruptedException
{
String creature = "womprat";
int choice = rand(1, 3);
switch (choice)
{
case 1:
creature = "mound_mite";
break;
case 2:
creature = "desert_squill";
break;
case 3:
creature = "womprat";
break;
default:
creature = "womprat";
break;
}
return creature;
}
public int getMaxPop() throws InterruptedException
{
int maxPop = 3;
return maxPop;
}
}
@@ -1,42 +0,0 @@
inherits creature_spawner.base_newbie_creature_spawner;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
// overloading these two functions.
string pickCreature()
{
string creature = "womprat";
int choice = rand (1,3);
switch (choice)
{
case 1:
creature = "mound_mite";
break;
case 2:
creature = "desert_squill";
break;
case 3:
creature = "womprat";
break;
default:
creature = "womprat";
break;
}
return creature;
}
int getMaxPop()
{
int maxPop = 3;
return maxPop;
}
@@ -0,0 +1,52 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
public class tatooine_medium extends script.creature_spawner.base_newbie_creature_spawner
{
public tatooine_medium()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
public String pickCreature() throws InterruptedException
{
String creature = "rockmite";
int choice = rand(1, 3);
switch (choice)
{
case 1:
creature = "rockmite";
break;
case 2:
creature = "mound_mite";
break;
case 3:
creature = "worrt";
break;
default:
creature = "worrt";
break;
}
return creature;
}
public int getMaxPop() throws InterruptedException
{
int maxPop = 4;
return maxPop;
}
}
@@ -1,42 +0,0 @@
inherits creature_spawner.base_newbie_creature_spawner;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
messageHandler creatureDied()
{
doDeathRespawn(self);
return SCRIPT_CONTINUE;
}
// overloading these two functions.
string pickCreature()
{
string creature = "rockmite";
int choice = rand (1,3);
switch (choice)
{
case 1:
creature = "rockmite";
break;
case 2:
creature = "mound_mite";
break;
case 3:
creature = "worrt";
break;
default:
creature = "worrt";
break;
}
return creature;
}
int getMaxPop()
{
int maxPop = 4;
return maxPop;
}
@@ -0,0 +1,142 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.create;
import script.library.locations;
import script.library.spawning;
import script.library.utils;
public class tatooine_npc_easy extends script.base_script
{
public tatooine_npc_easy()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
LOG("NewbieSpawn", "Spawning Init: " + self);
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
LOG("NewbieSpawn", "Spawning Anew: " + self);
String whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 4;
if (hasObjVar(self, "pop"))
{
maxPop = getIntObjVar(self, "pop");
}
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
LOG("NewbieSpawn", "spawning #" + count);
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
if (!utils.hasScriptVar(self, "myCreations"))
{
Vector myCreations = new Vector();
myCreations.setSize(0);
utils.addElement(myCreations, spawned);
utils.setScriptVar(self, "myCreations", myCreations);
}
else
{
Vector theList = utils.getResizeableObjIdArrayScriptVar(self, "myCreations");
if (theList.size() >= maxPop)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add(spawned);
utils.setScriptVar(self, "myCreations", theList);
}
}
if (hasObjVar(self, "useCityWanderScript"))
{
attachScript(spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar(self, "count", count);
}
return;
}
public String pickCreature() throws InterruptedException
{
int choice = rand(1, 7);
String creature = "desert_swooper";
switch (choice)
{
case 1:
creature = "desert_swooper";
break;
case 2:
creature = "desert_swooper";
break;
case 3:
creature = "desert_swooper_leader";
break;
case 4:
creature = "desert_swooper_leader";
break;
case 5:
creature = "jabbas_swooper";
break;
case 6:
creature = "jabba_scout";
break;
case 7:
creature = "jabbas_swooper";
break;
default:
creature = "desert_swooper";
break;
}
return creature;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
if (params == null || params.isEmpty())
{
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,146 +0,0 @@
include library.ai_lib;
include library.create;
include library.locations;
include library.spawning;
include library.utils;
trigger OnInitialize()
{
spawnCreatures(self);
LOG("NewbieSpawn", "Spawning Init: " + self);
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
LOG("NewbieSpawn", "Spawning Anew: " + self);
//deltadictionary spawn = self.getScriptVars();
//string whatToSpawn = spawn.getString("creatureToSpawn");
string whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
//spawn.put("creatureToSpawn", whatToSpawn);
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 4;
if ( hasObjVar(self, "pop") )
{
maxPop = getIntObjVar (self, "pop");
}
//int count = spawn.getInt("count");
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
LOG("NewbieSpawn", "spawning #" + count);
location goodLoc = pickLocation();
if(goodLoc == null)
goodLoc = getLocation(self);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
if (!utils.hasScriptVar (self, "myCreations"))
{
resizeable obj_id[] myCreations = new obj_id[0];
utils.addElement (myCreations, spawned);
utils.setScriptVar (self, "myCreations", myCreations);
}
else
{
resizeable obj_id[] theList = utils.getResizeableObjIdArrayScriptVar (self, "myCreations");
if (theList.length >= maxPop)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add (spawned);
utils.setScriptVar (self, "myCreations", theList);
}
}
// Allow some NPCs to be placed in a city and use city waypoints.
if ( hasObjVar(self, "useCityWanderScript") )
{
attachScript (spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar (self, "count", count);
}
return;
}
string pickCreature()
{
int choice = rand (1,7);
string creature = "desert_swooper";
switch (choice)
{
case 1:
creature = "desert_swooper";
break;
case 2:
creature = "desert_swooper";
break;
case 3:
creature = "desert_swooper_leader";
break;
case 4:
creature = "desert_swooper_leader";
break;
case 5:
creature = "jabbas_swooper";
break;
case 6:
creature = "jabba_scout";
break;
case 7:
creature = "jabbas_swooper";
break;
default:
creature = "desert_swooper";
break;
}
return creature;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
messageHandler creatureDied()
{
if(params == null || params.isEmpty())
{
LOG ("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId ("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,151 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.create;
import script.library.locations;
import script.library.spawning;
import script.library.utils;
public class tatooine_npc_hard extends script.base_script
{
public tatooine_npc_hard()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
String whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if (hasObjVar(self, "pop"))
{
maxPop = getIntObjVar(self, "pop");
}
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
if (!utils.hasScriptVar(self, "myCreations"))
{
Vector myCreations = new Vector();
myCreations.setSize(0);
utils.addElement(myCreations, spawned);
utils.setScriptVar(self, "myCreations", myCreations);
}
else
{
Vector theList = utils.getResizeableObjIdArrayScriptVar(self, "myCreations");
if (theList.size() >= maxPop)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add(spawned);
utils.setScriptVar(self, "myCreations", theList);
}
}
if (hasObjVar(self, "useCityWanderScript"))
{
attachScript(spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar(self, "count", count);
}
return;
}
public String pickCreature() throws InterruptedException
{
int choice = rand(1, 11);
String creature = "jabba_enforcer";
switch (choice)
{
case 1:
creature = "jabba_thief";
break;
case 2:
creature = "trandoshan_slaver";
break;
case 3:
creature = "tusken_commoner";
break;
case 4:
creature = "valarian_thief";
break;
case 5:
creature = "valarian_henchman";
break;
case 6:
creature = "jabba_enforcer";
break;
case 7:
creature = "desert_demon_brawler";
break;
case 8:
creature = "desert_demon_marksman";
break;
case 9:
creature = "gunrunner";
break;
case 10:
creature = "dune_stalker_marksman";
break;
case 11:
creature = "dune_stalker_brawler ";
break;
default:
creature = "tusken_commoner";
break;
}
return creature;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
if (params == null || params.isEmpty())
{
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,157 +0,0 @@
include library.ai_lib;
include library.create;
include library.locations;
include library.spawning;
include library.utils;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
// debugSpeakMsg (self, "Spawning Anew");
//deltadictionary spawn = self.getScriptVars();
//string whatToSpawn = spawn.getString("creatureToSpawn");
string whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
//spawn.put("creatureToSpawn", whatToSpawn);
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if ( hasObjVar(self, "pop") )
{
maxPop = getIntObjVar (self, "pop");
}
//int count = spawn.getInt("count");
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
// debugSpeakMsg (self, "spawning #" + count);
location goodLoc = pickLocation();
if(goodLoc == null)
goodLoc = getLocation(self);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
if (!utils.hasScriptVar (self, "myCreations"))
{
resizeable obj_id[] myCreations = new obj_id[0];
utils.addElement (myCreations, spawned);
utils.setScriptVar (self, "myCreations", myCreations);
}
else
{
resizeable obj_id[] theList = utils.getResizeableObjIdArrayScriptVar (self, "myCreations");
if (theList.length >= maxPop)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add (spawned);
utils.setScriptVar (self, "myCreations", theList);
}
}
// Allow some NPCs to be placed in a city and use city waypoints.
if ( hasObjVar(self, "useCityWanderScript") )
{
attachScript (spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar (self, "count", count);
}
return;
}
string pickCreature()
{
int choice = rand (1,11);
string creature = "jabba_enforcer";
switch (choice)
{
case 1:
creature = "jabba_thief";
break;
case 2:
creature = "trandoshan_slaver";
break;
case 3:
creature = "tusken_commoner";
break;
case 4:
creature = "valarian_thief";
break;
case 5:
creature = "valarian_henchman";
break;
case 6:
creature = "jabba_enforcer";
break;
case 7:
creature = "desert_demon_brawler";
break;
case 8:
creature = "desert_demon_marksman";
break;
case 9:
creature = "gunrunner";
break;
case 10:
creature = "dune_stalker_marksman";
break;
case 11:
creature = "dune_stalker_brawler ";
break;
default:
creature = "tusken_commoner";
break;
}
return creature;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
messageHandler creatureDied()
{
if(params == null || params.isEmpty())
{
LOG ("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId ("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,145 @@
package script.creature_spawner;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.create;
import script.library.locations;
import script.library.spawning;
import script.library.utils;
public class tatooine_npc_medium extends script.base_script
{
public tatooine_npc_medium()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
public void spawnCreatures(obj_id self) throws InterruptedException
{
String whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if (hasObjVar(self, "pop"))
{
maxPop = getIntObjVar(self, "pop");
}
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
location goodLoc = pickLocation();
if (goodLoc == null)
{
goodLoc = getLocation(self);
}
obj_id spawned = create.object(whatToSpawn, goodLoc);
attachScript(spawned, "creature_spawner.death_msg");
setObjVar(spawned, "creater", self);
if (!utils.hasScriptVar(self, "myCreations"))
{
Vector myCreations = new Vector();
myCreations.setSize(0);
utils.addElement(myCreations, spawned);
utils.setScriptVar(self, "myCreations", myCreations);
}
else
{
Vector theList = utils.getResizeableObjIdArrayScriptVar(self, "myCreations");
if (theList.size() >= maxPop)
{
CustomerServiceLog("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add(spawned);
utils.setScriptVar(self, "myCreations", theList);
}
}
if (hasObjVar(self, "useCityWanderScript"))
{
attachScript(spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar(self, "count", count);
}
return;
}
public String pickCreature() throws InterruptedException
{
int choice = rand(1, 9);
String creature = "evil_nomad";
switch (choice)
{
case 1:
creature = "cannibal";
break;
case 2:
creature = "desert_demon";
break;
case 3:
creature = "spice_fiend";
break;
case 4:
creature = "valarian_thug";
break;
case 5:
creature = "valarian_swooper_leader";
break;
case 6:
creature = "jabba_thief";
break;
case 7:
creature = "evil_nomad";
break;
case 8:
creature = "jabba_thug";
break;
case 9:
creature = "jabbas_swooper_leader";
break;
default:
creature = "valarian_swooper_leader";
break;
}
return creature;
}
public location pickLocation() throws InterruptedException
{
location here = getLocation(getSelf());
here.x = here.x + rand(-5, 5);
here.z = here.z + rand(-5, 5);
location goodLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
{
if (params == null || params.isEmpty())
{
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
}
@@ -1,150 +0,0 @@
include library.ai_lib;
include library.create;
include library.locations;
include library.spawning;
include library.utils;
trigger OnInitialize()
{
spawnCreatures(self);
return SCRIPT_CONTINUE;
}
void spawnCreatures(obj_id self)
{
// debugSpeakMsg (self, "Spawning Anew");
//deltadictionary spawn = self.getScriptVars();
//string whatToSpawn = spawn.getString("creatureToSpawn");
string whatToSpawn = utils.getStringScriptVar(self, "creatureToSpawn");
if (whatToSpawn == null)
{
whatToSpawn = pickCreature();
//spawn.put("creatureToSpawn", whatToSpawn);
utils.setScriptVar(self, "creatureToSpawn", whatToSpawn);
}
int maxPop = 3;
if ( hasObjVar(self, "pop") )
{
maxPop = getIntObjVar (self, "pop");
}
//int count = spawn.getInt("count");
int count = utils.getIntScriptVar(self, "count");
while (count < maxPop)
{
// debugSpeakMsg (self, "spawning #" + count);
location goodLoc = pickLocation();
if(goodLoc == null)
goodLoc = getLocation(self);
obj_id spawned = create.object (whatToSpawn, goodLoc);
attachScript (spawned, "creature_spawner.death_msg");
setObjVar (spawned, "creater", self);
if (!utils.hasScriptVar (self, "myCreations"))
{
resizeable obj_id[] myCreations = new obj_id[0];
utils.addElement (myCreations, spawned);
utils.setScriptVar (self, "myCreations", myCreations);
}
else
{
resizeable obj_id[] theList = utils.getResizeableObjIdArrayScriptVar (self, "myCreations");
if (theList.length >= maxPop)
{
CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full.");
return;
}
else
{
theList.add (spawned);
utils.setScriptVar (self, "myCreations", theList);
}
}
// Allow some NPCs to be placed in a city and use city waypoints.
if ( hasObjVar(self, "useCityWanderScript") )
{
attachScript (spawned, "city.city_wander");
}
else
{
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_LOITER);
}
count++;
utils.setScriptVar (self, "count", count);
}
return;
}
string pickCreature()
{
int choice = rand (1,9);
string creature = "evil_nomad";
switch (choice)
{
case 1:
creature = "cannibal";
break;
case 2:
creature = "desert_demon";
break;
case 3:
creature = "spice_fiend";
break;
case 4:
creature = "valarian_thug";
break;
case 5:
creature = "valarian_swooper_leader";
break;
case 6:
creature = "jabba_thief";
break;
case 7:
creature = "evil_nomad";
break;
case 8:
creature = "jabba_thug";
break;
case 9:
creature = "jabbas_swooper_leader";
break;
default:
creature = "valarian_swooper_leader";
break;
}
return creature;
}
location pickLocation ()
{
location here = getLocation (getSelf());
here.x = here.x + rand (-5,5);
here.z = here.z + rand (-5,5);
location goodLoc = locations.getGoodLocationAroundLocation (here, 1f, 1f, 1.5f, 1.5f);
return goodLoc;
}
messageHandler creatureDied()
{
if(params == null || params.isEmpty())
{
LOG ("sissynoid", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_medium script had Invalid Params from the deadGuy.");
return SCRIPT_CONTINUE;
}
obj_id deadNpc = params.getObjId ("deadGuy");
spawning.planetSpawnersCreatureDied(self, deadNpc);
spawnCreatures(self);
return SCRIPT_CONTINUE;
}