mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
Overhauled the creature and NPC spawners that actually may no longer be used in the game... but.. at least they're better than before
This commit is contained in:
Regular → Executable
+29
-24
@@ -1,66 +1,72 @@
|
||||
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.dictionary;
|
||||
import script.library.ai_lib;
|
||||
import script.library.create;
|
||||
import script.library.locations;
|
||||
import script.library.utils;
|
||||
import script.location;
|
||||
import script.obj_id;
|
||||
|
||||
public class base_newbie_creature_spawner extends script.base_script
|
||||
{
|
||||
public static final boolean SPAWNER_DISABLED = true;
|
||||
public int maxPop = 1;
|
||||
public boolean newbie = false;
|
||||
|
||||
public base_newbie_creature_spawner()
|
||||
{
|
||||
}
|
||||
public int OnInitialize(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!SPAWNER_DISABLED)
|
||||
{
|
||||
spawnCreatures(self);
|
||||
if(newbie) LOG("NewbieSpawn", "Spawning Init: " + self);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
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.");
|
||||
}
|
||||
location goodLoc;
|
||||
obj_id spawned;
|
||||
for (; count < maxPop; ++count)
|
||||
{
|
||||
location goodLoc = pickLocation();
|
||||
if(newbie) LOG("NewbieSpawn", "spawning #" + count);
|
||||
goodLoc = pickLocation();
|
||||
if (goodLoc == null)
|
||||
{
|
||||
goodLoc = getLocation(self);
|
||||
}
|
||||
whatToSpawn = pickCreature();
|
||||
count++;
|
||||
utils.setScriptVar(self, "count", count);
|
||||
obj_id spawned = create.object(whatToSpawn, goodLoc);
|
||||
spawned = create.object(pickCreature(), 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;
|
||||
return locations.getGoodLocationAroundLocation(here, 10f, 10f, 10f, 10f);
|
||||
}
|
||||
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
doDeathRespawn(self);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void doDeathRespawn(obj_id self) throws InterruptedException
|
||||
{
|
||||
@@ -73,6 +79,5 @@ public class base_newbie_creature_spawner extends script.base_script
|
||||
}
|
||||
utils.setScriptVar(self, "count", count);
|
||||
spawnCreatures(self);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+10
-42
@@ -1,59 +1,27 @@
|
||||
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 class corellia_easy extends 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 int maxPop = 6;
|
||||
public boolean newbie = true;
|
||||
|
||||
public String pickCreature() throws InterruptedException
|
||||
{
|
||||
String creature = "corellian_butterfly_drone";
|
||||
int choice = rand(1, 4);
|
||||
switch (choice)
|
||||
switch (rand(1, 4))
|
||||
{
|
||||
case 1:
|
||||
creature = "corellian_butterfly_drone";
|
||||
break;
|
||||
return "corellian_butterfly_drone";
|
||||
case 2:
|
||||
creature = "corellian_butterfly";
|
||||
break;
|
||||
return "corellian_butterfly";
|
||||
case 3:
|
||||
creature = "durni";
|
||||
break;
|
||||
return "durni";
|
||||
case 4:
|
||||
creature = "gubbur";
|
||||
break;
|
||||
default:
|
||||
creature = "gubbur";
|
||||
break;
|
||||
return "gubbur";
|
||||
}
|
||||
return creature;
|
||||
}
|
||||
public int getMaxPop() throws InterruptedException
|
||||
{
|
||||
int maxPop = 6;
|
||||
return maxPop;
|
||||
return "gubbur";
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+7
-39
@@ -1,56 +1,24 @@
|
||||
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 int maxPop = 3;
|
||||
|
||||
public String pickCreature() throws InterruptedException
|
||||
{
|
||||
String creature = "crazed_durni";
|
||||
int choice = rand(1, 3);
|
||||
switch (choice)
|
||||
switch (rand(1, 3))
|
||||
{
|
||||
case 1:
|
||||
creature = "crazed_durni";
|
||||
break;
|
||||
return "crazed_durni";
|
||||
case 2:
|
||||
creature = "gurrcat";
|
||||
break;
|
||||
return "gurrcat";
|
||||
case 3:
|
||||
creature = "sand_panther_cub";
|
||||
break;
|
||||
default:
|
||||
creature = "sand_panther_cub";
|
||||
break;
|
||||
return "sand_panther_cub";
|
||||
}
|
||||
return creature;
|
||||
}
|
||||
public int getMaxPop() throws InterruptedException
|
||||
{
|
||||
int maxPop = 3;
|
||||
return maxPop;
|
||||
return "sand_panther_cub";
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+8
-41
@@ -1,59 +1,26 @@
|
||||
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 int maxPop = 4;
|
||||
|
||||
public String pickCreature() throws InterruptedException
|
||||
{
|
||||
String creature = "corellian_butterfly";
|
||||
int choice = rand(1, 4);
|
||||
switch (choice)
|
||||
switch (rand(1,4))
|
||||
{
|
||||
case 1:
|
||||
creature = "corellian_butterfly";
|
||||
break;
|
||||
return "corellian_butterfly";
|
||||
case 2:
|
||||
creature = "corellian_butterfly_worker";
|
||||
break;
|
||||
return "corellian_butterfly_worker";
|
||||
case 3:
|
||||
creature = "vynock";
|
||||
break;
|
||||
return "vynock";
|
||||
case 4:
|
||||
creature = "scavenger_rat";
|
||||
break;
|
||||
default:
|
||||
creature = "vynock";
|
||||
break;
|
||||
return "scavenger_rat";
|
||||
}
|
||||
return creature;
|
||||
}
|
||||
public int getMaxPop() throws InterruptedException
|
||||
{
|
||||
int maxPop = 4;
|
||||
return maxPop;
|
||||
return "vynock";
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+16
-132
@@ -1,157 +1,41 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
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 class corellia_npc_easy extends base_newbie_npc_spawner
|
||||
{
|
||||
public int maxSpawn = 4;
|
||||
public boolean newbie = true;
|
||||
|
||||
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)
|
||||
switch (rand(1, 5))
|
||||
{
|
||||
case 1:
|
||||
creature = "swooper_gangmember";
|
||||
break;
|
||||
return "swooper_gangmember";
|
||||
case 2:
|
||||
return "ragtag_kook";
|
||||
case 3:
|
||||
return "ragtag_loon";
|
||||
case 4:
|
||||
return "meatlump_fool";
|
||||
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 "meatlump_buffoon";
|
||||
}
|
||||
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;
|
||||
return "meatlump_buffoon";
|
||||
}
|
||||
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.");
|
||||
LOG("sissynoid", "Spawner " + self + " on Corellia. Corellia_npc_easy script had Invalid Params from the deadGuy.");
|
||||
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Corellia. Corellia_npc_easy 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;
|
||||
return super.creatureDied(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+16
-114
@@ -1,139 +1,41 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
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 class corellia_npc_hard extends base_newbie_npc_spawner
|
||||
{
|
||||
public int maxSpawn = 3;
|
||||
public boolean newbie = true;
|
||||
|
||||
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)
|
||||
switch (rand(1, 5))
|
||||
{
|
||||
case 1:
|
||||
creature = "meatlump_oaf";
|
||||
break;
|
||||
return "meatlump_oaf";
|
||||
case 2:
|
||||
creature = "meatlump_cretin";
|
||||
break;
|
||||
return "meatlump_cretin";
|
||||
case 3:
|
||||
creature = "flail_enforcer";
|
||||
break;
|
||||
return "flail_enforcer";
|
||||
case 4:
|
||||
creature = "flail_cutthroat";
|
||||
break;
|
||||
return "flail_cutthroat";
|
||||
case 5:
|
||||
creature = "ragtag_maniac";
|
||||
break;
|
||||
default:
|
||||
creature = "flail_cutthroat";
|
||||
break;
|
||||
return "ragtag_maniac";
|
||||
}
|
||||
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;
|
||||
return "flail_cutthroat";
|
||||
}
|
||||
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.");
|
||||
LOG("sissynoid", "Spawner " + self + " on Corellia. Corellia_npc_hard script had Invalid Params from the deadGuy.");
|
||||
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Corellia. Corellia_npc_hard 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;
|
||||
return super.creatureDied(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+16
-114
@@ -1,139 +1,41 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
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 class corellia_npc_medium extends base_newbie_npc_spawner
|
||||
{
|
||||
public int maxSpawn = 3;
|
||||
public boolean newbie = true;
|
||||
|
||||
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)
|
||||
switch (rand(1, 5))
|
||||
{
|
||||
case 1:
|
||||
creature = "ragtag_lunatic";
|
||||
break;
|
||||
return "ragtag_lunatic";
|
||||
case 2:
|
||||
creature = "meatlump_stooge";
|
||||
break;
|
||||
return "meatlump_stooge";
|
||||
case 3:
|
||||
creature = "meatlump_clod";
|
||||
break;
|
||||
return "meatlump_clod";
|
||||
case 4:
|
||||
creature = "corsec_rogue";
|
||||
break;
|
||||
return "corsec_rogue";
|
||||
case 5:
|
||||
creature = "swooper_leader";
|
||||
break;
|
||||
default:
|
||||
creature = "swooper_leader";
|
||||
break;
|
||||
return "swooper_leader";
|
||||
}
|
||||
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;
|
||||
return "swooper_leader";
|
||||
}
|
||||
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.");
|
||||
LOG("sissynoid", "Spawner " + self + " on Corellia. Corellia_npc_medium script had Invalid Params from the deadGuy.");
|
||||
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Corellia. Corellia_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;
|
||||
return super.creatureDied(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+4
-11
@@ -1,12 +1,7 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
public class death_msg extends script.base_script
|
||||
{
|
||||
@@ -15,13 +10,11 @@ public class death_msg extends script.base_script
|
||||
}
|
||||
public int OnDestroy(obj_id self) throws InterruptedException
|
||||
{
|
||||
String creatureTemplate = getTemplateName(self);
|
||||
LOG("Newbie_Spawn", "Message in onDestroy: Creature died of type - " + creatureTemplate);
|
||||
LOG("Newbie_Spawn", "Message in onDestroy: Creature died of type - " + getTemplateName(self));
|
||||
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);
|
||||
messageTo(mom, "creatureDied", webster, rand(180, 360), false);
|
||||
LOG("Newbie_Spawn", "Message in onDestroy: Sending message to mom - " + mom + " from self - " + self);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
Regular → Executable
+3
-13
@@ -1,16 +1,8 @@
|
||||
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.dictionary;
|
||||
import script.library.create;
|
||||
import script.library.ai_lib;
|
||||
import script.obj_id;
|
||||
|
||||
public class droid_vendor_spawner extends script.base_script
|
||||
{
|
||||
@@ -28,9 +20,7 @@ public class droid_vendor_spawner extends script.base_script
|
||||
}
|
||||
public void spawnVendor(obj_id self) throws InterruptedException
|
||||
{
|
||||
String creatureToSpawn = "farmer";
|
||||
location goodLoc = getLocation(self);
|
||||
obj_id spawned = create.object(creatureToSpawn, goodLoc);
|
||||
obj_id spawned = create.object("farmer", getLocation(self));
|
||||
create.addDestroyMessage(spawned, "creatureDied", 10.0f, self);
|
||||
attachScript(spawned, "beta.droid_vendor");
|
||||
setObjVar(self, "myVendor", spawned);
|
||||
|
||||
Regular → Executable
+8
-21
@@ -1,17 +1,9 @@
|
||||
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.dictionary;
|
||||
import script.library.ai_lib;
|
||||
import script.library.utils;
|
||||
import script.library.create;
|
||||
import script.obj_id;
|
||||
|
||||
public class jedi_sentinel_dark_spawner extends script.base_script
|
||||
{
|
||||
@@ -25,19 +17,14 @@ public class jedi_sentinel_dark_spawner extends script.base_script
|
||||
}
|
||||
public void spawnCreatures(obj_id self) throws InterruptedException
|
||||
{
|
||||
String whatToSpawn = "dark_jedi_sentinel";
|
||||
location here = getLocation(self);
|
||||
obj_id spawned = create.object(whatToSpawn, here);
|
||||
obj_id spawned = create.object("dark_jedi_sentinel", getLocation(self));
|
||||
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;
|
||||
setYaw(spawned, getYaw(self));
|
||||
|
||||
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_SENTINEL);
|
||||
}
|
||||
public int npcDied(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
|
||||
Regular → Executable
+8
-21
@@ -1,17 +1,9 @@
|
||||
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.dictionary;
|
||||
import script.library.ai_lib;
|
||||
import script.library.utils;
|
||||
import script.library.create;
|
||||
import script.obj_id;
|
||||
|
||||
public class jedi_sentinel_light_spawner extends script.base_script
|
||||
{
|
||||
@@ -25,19 +17,14 @@ public class jedi_sentinel_light_spawner extends script.base_script
|
||||
}
|
||||
public void spawnCreatures(obj_id self) throws InterruptedException
|
||||
{
|
||||
String whatToSpawn = "light_jedi_sentinel";
|
||||
location here = getLocation(self);
|
||||
obj_id spawned = create.object(whatToSpawn, here);
|
||||
obj_id spawned = create.object("light_jedi_sentinel", getLocation(self));
|
||||
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;
|
||||
setYaw(spawned, getYaw(self));
|
||||
|
||||
ai_lib.setDefaultCalmBehavior(spawned, ai_lib.BEHAVIOR_SENTINEL);
|
||||
}
|
||||
public int npcDied(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
|
||||
Regular → Executable
+5
-18
@@ -1,15 +1,9 @@
|
||||
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.dictionary;
|
||||
import script.library.create;
|
||||
import script.library.locations;
|
||||
import script.obj_id;
|
||||
|
||||
public class krayt_graveyard extends script.base_script
|
||||
{
|
||||
@@ -24,19 +18,12 @@ public class krayt_graveyard extends script.base_script
|
||||
public void doKraytSpawn() throws InterruptedException
|
||||
{
|
||||
obj_id self = getSelf();
|
||||
if (hasObjVar(self, "Krayt"))
|
||||
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);
|
||||
obj_id kd = create.object("canyon_krayt_dragon", locations.getGoodLocationAroundLocation(getLocation(self), 100f, 100f, 100f, 100f));
|
||||
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
|
||||
|
||||
Regular → Executable
+9
-36
@@ -1,52 +1,25 @@
|
||||
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 static final boolean SPAWNER_DISABLED = false;
|
||||
public int maxPop = 6;
|
||||
public boolean newbie = true;
|
||||
|
||||
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)
|
||||
switch (rand(1, 3))
|
||||
{
|
||||
case 1:
|
||||
creature = "flesh_eating_chuba";
|
||||
break;
|
||||
return "flesh_eating_chuba";
|
||||
case 2:
|
||||
creature = "capper_spineflap";
|
||||
break;
|
||||
return "capper_spineflap";
|
||||
case 3:
|
||||
creature = "diseased_nuna";
|
||||
break;
|
||||
default:
|
||||
creature = "diseased_nuna";
|
||||
break;
|
||||
return "diseased_nuna";
|
||||
}
|
||||
return creature;
|
||||
}
|
||||
public int getMaxPop() throws InterruptedException
|
||||
{
|
||||
int maxPop = 6;
|
||||
return maxPop;
|
||||
return "diseased_nuna";
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+8
-36
@@ -1,52 +1,24 @@
|
||||
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 static final boolean SPAWNER_DISABLED = false;
|
||||
public int maxPop = 3;
|
||||
|
||||
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)
|
||||
switch (rand(1, 3))
|
||||
{
|
||||
case 1:
|
||||
creature = "nuna";
|
||||
break;
|
||||
return "nuna";
|
||||
case 2:
|
||||
creature = "rabid_shaupaut";
|
||||
break;
|
||||
return "rabid_shaupaut";
|
||||
case 3:
|
||||
creature = "narglatch_cub";
|
||||
break;
|
||||
default:
|
||||
creature = "narglatch_cub";
|
||||
break;
|
||||
return "narglatch_cub";
|
||||
}
|
||||
return creature;
|
||||
}
|
||||
public int getMaxPop() throws InterruptedException
|
||||
{
|
||||
int maxPop = 3;
|
||||
return maxPop;
|
||||
return "narglatch_cub";
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+9
-30
@@ -1,15 +1,12 @@
|
||||
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.obj_id;
|
||||
|
||||
public class naboo_medium extends script.creature_spawner.base_newbie_creature_spawner
|
||||
{
|
||||
public static final boolean SPAWNER_DISABLED = false;
|
||||
public int maxPop = 4;
|
||||
|
||||
public naboo_medium()
|
||||
{
|
||||
}
|
||||
@@ -18,35 +15,17 @@ public class naboo_medium extends script.creature_spawner.base_newbie_creature_s
|
||||
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)
|
||||
switch (rand(1, 3))
|
||||
{
|
||||
case 1:
|
||||
creature = "fanned_rawl";
|
||||
break;
|
||||
return "fanned_rawl";
|
||||
case 2:
|
||||
creature = "nightspider";
|
||||
break;
|
||||
return "nightspider";
|
||||
case 3:
|
||||
creature = "flewt";
|
||||
break;
|
||||
default:
|
||||
creature = "flewt";
|
||||
break;
|
||||
return "flewt";
|
||||
}
|
||||
return creature;
|
||||
}
|
||||
public int getMaxPop() throws InterruptedException
|
||||
{
|
||||
int maxPop = 4;
|
||||
return maxPop;
|
||||
return "flewt";
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+15
-109
@@ -1,133 +1,39 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
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 class naboo_npc_easy extends base_newbie_npc_spawner
|
||||
{
|
||||
public int maxPop = 4;
|
||||
public boolean newbie = true;
|
||||
|
||||
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)
|
||||
switch (rand(1, 4))
|
||||
{
|
||||
case 1:
|
||||
creature = "skaak_tipper_prowler";
|
||||
break;
|
||||
return "skaak_tipper_prowler";
|
||||
case 2:
|
||||
creature = "skaak_tipper_mugger";
|
||||
break;
|
||||
return "skaak_tipper_mugger";
|
||||
case 3:
|
||||
creature = "mummer_thug";
|
||||
break;
|
||||
return "mummer_thug";
|
||||
case 4:
|
||||
creature = "mummer_bully";
|
||||
break;
|
||||
default:
|
||||
creature = "mummer_bully";
|
||||
break;
|
||||
return "mummer_bully";
|
||||
}
|
||||
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;
|
||||
return "mummer_bully";
|
||||
}
|
||||
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.");
|
||||
LOG("sissynoid", "Spawner " + self + " on Naboo. Naboo_npc_easy script had Invalid Params from the deadGuy.");
|
||||
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Naboo. Naboo_npc_easy 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;
|
||||
return super.creatureDied(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+14
-106
@@ -1,130 +1,38 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
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 class naboo_npc_hard extends base_newbie_npc_spawner
|
||||
{
|
||||
public int maxPop = 3;
|
||||
|
||||
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)
|
||||
switch (rand(1, 4))
|
||||
{
|
||||
case 1:
|
||||
creature = "mauler_acolyte";
|
||||
break;
|
||||
return "mauler_acolyte";
|
||||
case 2:
|
||||
creature = "plasma_thief_leader";
|
||||
break;
|
||||
return "plasma_thief_leader";
|
||||
case 3:
|
||||
creature = "skaak_tipper_swindler";
|
||||
break;
|
||||
return "skaak_tipper_swindler";
|
||||
case 4:
|
||||
creature = "skaak_tipper_crook";
|
||||
break;
|
||||
default:
|
||||
creature = "skaak_tipper_crook";
|
||||
break;
|
||||
return "skaak_tipper_crook";
|
||||
}
|
||||
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;
|
||||
return "skaak_tipper_crook";
|
||||
}
|
||||
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.");
|
||||
LOG("sissynoid", "Spawner " + self + " on Naboo. Naboo_npc_hard script had Invalid Params from the deadGuy.");
|
||||
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Naboo. Naboo_npc_hard 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;
|
||||
return super.creatureDied(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+13
-106
@@ -1,121 +1,31 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
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 class naboo_npc_medium extends base_newbie_npc_spawner
|
||||
{
|
||||
public int maxPop = 3;
|
||||
|
||||
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)
|
||||
switch (rand(1, 5))
|
||||
{
|
||||
case 1:
|
||||
creature = "plasma_bandit";
|
||||
break;
|
||||
return "plasma_bandit";
|
||||
case 2:
|
||||
creature = "skaak_tipper_bandit";
|
||||
break;
|
||||
return "skaak_tipper_bandit";
|
||||
case 3:
|
||||
creature = "mummer_punk";
|
||||
break;
|
||||
return "mummer_punk";
|
||||
case 4:
|
||||
creature = "mummer_ruffian";
|
||||
break;
|
||||
return "mummer_ruffian";
|
||||
case 5:
|
||||
creature = "plasma_thief";
|
||||
break;
|
||||
default:
|
||||
creature = "mummer_ruffian";
|
||||
break;
|
||||
return "plasma_thief";
|
||||
}
|
||||
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;
|
||||
return "mummer_ruffian";
|
||||
}
|
||||
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
@@ -125,9 +35,6 @@ public class naboo_npc_medium extends script.base_script
|
||||
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;
|
||||
return super.creatureDied(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+9
-38
@@ -1,55 +1,26 @@
|
||||
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 static final boolean SPAWNER_DISABLED = false;
|
||||
public int maxPop = 6;
|
||||
|
||||
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)
|
||||
switch (rand(1, 4))
|
||||
{
|
||||
case 1:
|
||||
creature = "flesh_eating_chuba";
|
||||
break;
|
||||
return "flesh_eating_chuba";
|
||||
case 2:
|
||||
creature = "nightspider";
|
||||
break;
|
||||
return "nightspider";
|
||||
case 3:
|
||||
creature = "frail_squall";
|
||||
break;
|
||||
return "frail_squall";
|
||||
case 4:
|
||||
creature = "frail_squall";
|
||||
break;
|
||||
default:
|
||||
creature = "flesh_eating_chuba";
|
||||
break;
|
||||
return "frail_squall";
|
||||
}
|
||||
return creature;
|
||||
}
|
||||
public int getMaxPop() throws InterruptedException
|
||||
{
|
||||
int maxPop = 6;
|
||||
return maxPop;
|
||||
return "flesh_eating_chuba";
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+10
-40
@@ -1,58 +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 rori_hard extends script.creature_spawner.base_newbie_creature_spawner
|
||||
{
|
||||
public static final boolean SPAWNER_DISABLED = false;
|
||||
public int maxPop = 6;
|
||||
|
||||
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)
|
||||
switch (rand(1, 5))
|
||||
{
|
||||
case 1:
|
||||
creature = "wormed_vrobal";
|
||||
break;
|
||||
return "wormed_vrobal";
|
||||
case 2:
|
||||
creature = "bark_mite";
|
||||
break;
|
||||
return "bark_mite";
|
||||
case 3:
|
||||
creature = "vir_vur";
|
||||
break;
|
||||
return "vir_vur";
|
||||
case 4:
|
||||
creature = "squall_female";
|
||||
break;
|
||||
return "squall_female";
|
||||
case 5:
|
||||
creature = "squall_male";
|
||||
break;
|
||||
default:
|
||||
creature = "bark_mite";
|
||||
break;
|
||||
return "squall_male";
|
||||
}
|
||||
return creature;
|
||||
}
|
||||
public int getMaxPop() throws InterruptedException
|
||||
{
|
||||
int maxPop = 3;
|
||||
return maxPop;
|
||||
return "bark_mite";
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+8
-42
@@ -1,58 +1,24 @@
|
||||
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 static final boolean SPAWNER_DISABLED = false;
|
||||
public int maxPop = 4;
|
||||
|
||||
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)
|
||||
switch (rand(1, 3))
|
||||
{
|
||||
case 1:
|
||||
creature = "vrobalet";
|
||||
break;
|
||||
return "vrobalet";
|
||||
case 2:
|
||||
creature = "timid_vir_vur";
|
||||
break;
|
||||
return "timid_vir_vur";
|
||||
case 3:
|
||||
creature = "flewt";
|
||||
break;
|
||||
case 4:
|
||||
creature = "vrobalet";
|
||||
break;
|
||||
case 5:
|
||||
creature = "timid_vir_vur";
|
||||
break;
|
||||
default:
|
||||
creature = "timid_vir_vur";
|
||||
break;
|
||||
return "flewt";
|
||||
}
|
||||
return creature;
|
||||
}
|
||||
public int getMaxPop() throws InterruptedException
|
||||
{
|
||||
int maxPop = 4;
|
||||
return maxPop;
|
||||
return "timid_vir_vur";
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+15
-109
@@ -1,133 +1,39 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
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 class rori_npc_easy extends base_newbie_npc_spawner
|
||||
{
|
||||
public int maxPop = 4;
|
||||
public boolean newbie = true;
|
||||
|
||||
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)
|
||||
switch (rand(1, 4))
|
||||
{
|
||||
case 1:
|
||||
creature = "garyn_prowler";
|
||||
break;
|
||||
return "garyn_prowler";
|
||||
case 2:
|
||||
creature = "gundark_crook";
|
||||
break;
|
||||
return "gundark_crook";
|
||||
case 3:
|
||||
creature = "cobral_mugger";
|
||||
break;
|
||||
return "cobral_mugger";
|
||||
case 4:
|
||||
creature = "gundark_hooligan";
|
||||
break;
|
||||
default:
|
||||
creature = "cobral_mugger";
|
||||
break;
|
||||
return "gundark_hooligan";
|
||||
}
|
||||
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;
|
||||
return "cobral_mugger";
|
||||
}
|
||||
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.");
|
||||
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_easy script had Invalid Params from the deadGuy.");
|
||||
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_easy 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;
|
||||
return super.creatureDied(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+16
-108
@@ -1,133 +1,41 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
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 class rori_npc_hard extends base_newbie_npc_spawner
|
||||
{
|
||||
public int maxPop = 3;
|
||||
public boolean newbie = false;
|
||||
|
||||
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)
|
||||
switch (rand(1, 5))
|
||||
{
|
||||
case 1:
|
||||
creature = "gundark_raider";
|
||||
break;
|
||||
return "gundark_raider";
|
||||
case 2:
|
||||
creature = "gundark_ruffian";
|
||||
break;
|
||||
return "gundark_ruffian";
|
||||
case 3:
|
||||
creature = "garyn_mugger";
|
||||
break;
|
||||
return "garyn_mugger";
|
||||
case 4:
|
||||
creature = "cobral_thug";
|
||||
break;
|
||||
return "cobral_thug";
|
||||
case 5:
|
||||
creature = "garyn_pirate";
|
||||
break;
|
||||
default:
|
||||
creature = "garyn_pirate";
|
||||
break;
|
||||
return "garyn_pirate";
|
||||
}
|
||||
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;
|
||||
return "garyn_pirate";
|
||||
}
|
||||
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.");
|
||||
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_hard script had Invalid Params from the deadGuy.");
|
||||
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_hard 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;
|
||||
return super.creatureDied(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+13
-110
@@ -1,123 +1,30 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
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 class rori_npc_medium extends base_newbie_npc_spawner
|
||||
{
|
||||
public int maxPop = 3;
|
||||
public boolean newbie = true;
|
||||
|
||||
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)
|
||||
switch (rand(1,4))
|
||||
{
|
||||
case 1:
|
||||
creature = "gundark_rogue";
|
||||
break;
|
||||
return "gundark_rogue";
|
||||
case 2:
|
||||
creature = "cobral_hooligan";
|
||||
break;
|
||||
return "cobral_hooligan";
|
||||
case 3:
|
||||
creature = "garyn_thief";
|
||||
break;
|
||||
return "garyn_thief";
|
||||
case 4:
|
||||
creature = "gundark_desperado";
|
||||
break;
|
||||
default:
|
||||
creature = "gundark_rogue";
|
||||
break;
|
||||
return "gundark_desperado";
|
||||
}
|
||||
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;
|
||||
return "gundark_rogue";
|
||||
}
|
||||
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
@@ -127,10 +34,6 @@ public class rori_npc_medium extends script.base_script
|
||||
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;
|
||||
return super.creatureDied(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+15
-109
@@ -1,133 +1,39 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
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 class talus_npc_easy extends base_newbie_npc_spawner
|
||||
{
|
||||
public int maxPop = 4;
|
||||
public boolean newbie = false;
|
||||
|
||||
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)
|
||||
switch (rand(1,4))
|
||||
{
|
||||
case 1:
|
||||
creature = "chunker_nitwit";
|
||||
break;
|
||||
return "chunker_nitwit";
|
||||
case 2:
|
||||
creature = "chunker_punk";
|
||||
break;
|
||||
return "chunker_punk";
|
||||
case 3:
|
||||
creature = "sleemo_hoodlum";
|
||||
break;
|
||||
return "sleemo_hoodlum";
|
||||
case 4:
|
||||
creature = "sleemo_punk";
|
||||
break;
|
||||
default:
|
||||
creature = "sleemo_hoodlum";
|
||||
break;
|
||||
return "sleemo_punk";
|
||||
}
|
||||
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;
|
||||
return "sleemo_hoodlum";
|
||||
}
|
||||
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.");
|
||||
LOG("sissynoid", "Spawner " + self + " on Talus. Talus_npc_easy script had Invalid Params from the deadGuy.");
|
||||
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Talus. Talus_npc_easy 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;
|
||||
return super.creatureDied(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+15
-106
@@ -1,130 +1,39 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
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 class talus_npc_hard extends base_newbie_npc_spawner
|
||||
{
|
||||
public int maxPop = 3;
|
||||
public boolean newbie = false;
|
||||
|
||||
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)
|
||||
switch (rand(1,4))
|
||||
{
|
||||
case 1:
|
||||
creature = "sleemo_vandal";
|
||||
break;
|
||||
return "sleemo_vandal";
|
||||
case 2:
|
||||
creature = "chunker_bully";
|
||||
break;
|
||||
return "chunker_bully";
|
||||
case 3:
|
||||
creature = "aakuan_follower";
|
||||
break;
|
||||
return "aakuan_follower";
|
||||
case 4:
|
||||
creature = "binayre_hooligan";
|
||||
break;
|
||||
default:
|
||||
creature = "aakuan_follower";
|
||||
break;
|
||||
return "binayre_hooligan";
|
||||
}
|
||||
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;
|
||||
return "aakuan_follower";
|
||||
}
|
||||
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.");
|
||||
LOG("sissynoid", "Spawner " + self + " on Rori. Rori_npc_hard script had Invalid Params from the deadGuy.");
|
||||
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Rori. Rori_npc_hard 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;
|
||||
return super.creatureDied(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+13
-104
@@ -1,118 +1,30 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
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 class talus_npc_medium extends base_newbie_npc_spawner
|
||||
{
|
||||
public int maxPop = 3;
|
||||
public boolean newbie = false;
|
||||
|
||||
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)
|
||||
switch (rand(1, 4))
|
||||
{
|
||||
case 1:
|
||||
creature = "chunker_mooch";
|
||||
break;
|
||||
return "chunker_mooch";
|
||||
case 2:
|
||||
creature = "chunker_swindler";
|
||||
break;
|
||||
return "chunker_swindler";
|
||||
case 3:
|
||||
creature = "sleemo_delinquent";
|
||||
break;
|
||||
return "sleemo_delinquent";
|
||||
case 4:
|
||||
creature = "sleemo_scamp";
|
||||
break;
|
||||
default:
|
||||
creature = "sleemo_scamp";
|
||||
break;
|
||||
return "sleemo_scamp";
|
||||
}
|
||||
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;
|
||||
return "sleemo_scamp";
|
||||
}
|
||||
public int creatureDied(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
@@ -122,9 +34,6 @@ public class talus_npc_medium extends script.base_script
|
||||
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;
|
||||
return super.creatureDied(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+14
-52
@@ -1,73 +1,35 @@
|
||||
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 static final boolean SPAWNER_DISABLED = false;
|
||||
public int maxPop = 8;
|
||||
public boolean newbie = true;
|
||||
|
||||
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)
|
||||
switch (rand(1, 8))
|
||||
{
|
||||
case 1:
|
||||
return "minor_worrt";
|
||||
case 2:
|
||||
return "kreetle";
|
||||
case 3:
|
||||
creature = "minor_worrt";
|
||||
break;
|
||||
return "rill";
|
||||
case 4:
|
||||
return "lesser_desert_womprat";
|
||||
case 5:
|
||||
return "worrt";
|
||||
case 6:
|
||||
creature = "kreetle";
|
||||
break;
|
||||
return "rockmite";
|
||||
case 7:
|
||||
return "mound_mite";
|
||||
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 "womprat";
|
||||
}
|
||||
return creature;
|
||||
}
|
||||
public int getMaxPop() throws InterruptedException
|
||||
{
|
||||
int maxPop = 8;
|
||||
return maxPop;
|
||||
return "minor_worrt";
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+9
-36
@@ -1,52 +1,25 @@
|
||||
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 static final boolean SPAWNER_DISABLED = false;
|
||||
public int maxPop = 3;
|
||||
public boolean newbie = true;
|
||||
|
||||
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)
|
||||
switch (rand(1,3))
|
||||
{
|
||||
case 1:
|
||||
creature = "mound_mite";
|
||||
break;
|
||||
return "mound_mite";
|
||||
case 2:
|
||||
creature = "desert_squill";
|
||||
break;
|
||||
return "desert_squill";
|
||||
case 3:
|
||||
creature = "womprat";
|
||||
break;
|
||||
default:
|
||||
creature = "womprat";
|
||||
break;
|
||||
return "womprat";
|
||||
}
|
||||
return creature;
|
||||
}
|
||||
public int getMaxPop() throws InterruptedException
|
||||
{
|
||||
int maxPop = 3;
|
||||
return maxPop;
|
||||
return "womprat";
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+9
-36
@@ -1,52 +1,25 @@
|
||||
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 static final boolean SPAWNER_DISABLED = false;
|
||||
public int maxPop = 4;
|
||||
public boolean newbie = true;
|
||||
|
||||
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)
|
||||
switch (rand(1,3))
|
||||
{
|
||||
case 1:
|
||||
creature = "rockmite";
|
||||
break;
|
||||
return "rockmite";
|
||||
case 2:
|
||||
creature = "mound_mite";
|
||||
break;
|
||||
return "mound_mite";
|
||||
case 3:
|
||||
creature = "worrt";
|
||||
break;
|
||||
default:
|
||||
creature = "worrt";
|
||||
break;
|
||||
return "worrt";
|
||||
}
|
||||
return creature;
|
||||
}
|
||||
public int getMaxPop() throws InterruptedException
|
||||
{
|
||||
int maxPop = 4;
|
||||
return maxPop;
|
||||
return "worrt";
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+15
-118
@@ -1,142 +1,39 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
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 class tatooine_npc_easy extends base_newbie_npc_spawner
|
||||
{
|
||||
public int maxPop = 4;
|
||||
public boolean newbie = true;
|
||||
|
||||
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)
|
||||
switch (rand(1,4))
|
||||
{
|
||||
case 1:
|
||||
creature = "desert_swooper";
|
||||
break;
|
||||
return "desert_swooper";
|
||||
case 2:
|
||||
creature = "desert_swooper";
|
||||
break;
|
||||
return "desert_swooper_leader";
|
||||
case 3:
|
||||
creature = "desert_swooper_leader";
|
||||
break;
|
||||
return "jabbas_swooper";
|
||||
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 "jabba_scout";
|
||||
}
|
||||
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;
|
||||
return "desert_swooper";
|
||||
}
|
||||
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.");
|
||||
LOG("sissynoid", "Spawner " + self + " on Tatooine. Tatooine_npc_easy script had Invalid Params from the deadGuy.");
|
||||
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Tatooine. Tatooine_npc_easy 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;
|
||||
return super.creatureDied(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+23
-120
@@ -1,151 +1,54 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
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 class tatooine_npc_hard extends base_newbie_npc_spawner
|
||||
{
|
||||
public static final boolean SPAWNER_DISABLED = false;
|
||||
public int maxPop = 3;
|
||||
public boolean newbie = true;
|
||||
|
||||
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)
|
||||
switch (rand(1,11))
|
||||
{
|
||||
case 1:
|
||||
creature = "jabba_thief";
|
||||
break;
|
||||
return "jabba_thief";
|
||||
case 2:
|
||||
creature = "trandoshan_slaver";
|
||||
break;
|
||||
return "trandoshan_slaver";
|
||||
case 3:
|
||||
creature = "tusken_commoner";
|
||||
break;
|
||||
return "tusken_commoner";
|
||||
case 4:
|
||||
creature = "valarian_thief";
|
||||
break;
|
||||
return "valarian_thief";
|
||||
case 5:
|
||||
creature = "valarian_henchman";
|
||||
break;
|
||||
return "valarian_henchman";
|
||||
case 6:
|
||||
creature = "jabba_enforcer";
|
||||
break;
|
||||
return "jabba_enforcer";
|
||||
case 7:
|
||||
creature = "desert_demon_brawler";
|
||||
break;
|
||||
return "desert_demon_brawler";
|
||||
case 8:
|
||||
creature = "desert_demon_marksman";
|
||||
break;
|
||||
return "desert_demon_marksman";
|
||||
case 9:
|
||||
creature = "gunrunner";
|
||||
break;
|
||||
return "gunrunner";
|
||||
case 10:
|
||||
creature = "dune_stalker_marksman";
|
||||
break;
|
||||
return "dune_stalker_marksman";
|
||||
case 11:
|
||||
creature = "dune_stalker_brawler ";
|
||||
break;
|
||||
default:
|
||||
creature = "tusken_commoner";
|
||||
break;
|
||||
return "dune_stalker_brawler ";
|
||||
}
|
||||
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;
|
||||
return "tusken_commoner";
|
||||
}
|
||||
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.");
|
||||
LOG("sissynoid", "Spawner " + self + " on Tatooine. Tatooine_npc_hard script had Invalid Params from the deadGuy.");
|
||||
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Tatooine. Tatooine_npc_hard 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;
|
||||
return super.creatureDied(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+21
-116
@@ -1,145 +1,50 @@
|
||||
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.dictionary;
|
||||
import script.obj_id;
|
||||
|
||||
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 class tatooine_npc_medium extends base_newbie_npc_spawner
|
||||
{
|
||||
public static final boolean SPAWNER_DISABLED = false;
|
||||
public int maxPop = 3;
|
||||
public boolean newbie = true;
|
||||
|
||||
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)
|
||||
switch (rand(1,9))
|
||||
{
|
||||
case 1:
|
||||
creature = "cannibal";
|
||||
break;
|
||||
return "cannibal";
|
||||
case 2:
|
||||
creature = "desert_demon";
|
||||
break;
|
||||
return "desert_demon";
|
||||
case 3:
|
||||
creature = "spice_fiend";
|
||||
break;
|
||||
return "spice_fiend";
|
||||
case 4:
|
||||
creature = "valarian_thug";
|
||||
break;
|
||||
return "valarian_thug";
|
||||
case 5:
|
||||
creature = "valarian_swooper_leader";
|
||||
break;
|
||||
return "valarian_swooper_leader";
|
||||
case 6:
|
||||
creature = "jabba_thief";
|
||||
break;
|
||||
return "jabba_thief";
|
||||
case 7:
|
||||
creature = "evil_nomad";
|
||||
break;
|
||||
return "evil_nomad";
|
||||
case 8:
|
||||
creature = "jabba_thug";
|
||||
break;
|
||||
return "jabba_thug";
|
||||
case 9:
|
||||
creature = "jabbas_swooper_leader";
|
||||
break;
|
||||
default:
|
||||
creature = "valarian_swooper_leader";
|
||||
break;
|
||||
return "jabbas_swooper_leader";
|
||||
}
|
||||
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;
|
||||
return "valarian_swooper_leader";
|
||||
}
|
||||
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.");
|
||||
LOG("sissynoid", "Spawner " + self + " on Tatooine. Tatooine_npc_medium script had Invalid Params from the deadGuy.");
|
||||
CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner " + self + " on Tatooine. Tatooine_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;
|
||||
return super.creatureDied(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user