mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-09-12 23:45:12 -04:00
Added god mode checks to all QA and testing scripts.
This commit is contained in:
@@ -148,12 +148,7 @@ public class cmd extends script.base_script
|
||||
}
|
||||
public int cmdMoney(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException
|
||||
{
|
||||
if (getGodLevel(self) < 10)
|
||||
{
|
||||
sendSystemMessage(self, "You do not have the appropriate access level to use this command.", null);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!isGod(self)) return SCRIPT_CONTINUE;
|
||||
dictionary d = gm.parseTarget(params, target, "CREDITS");
|
||||
if (d == null)
|
||||
{
|
||||
@@ -222,7 +217,6 @@ public class cmd extends script.base_script
|
||||
}
|
||||
}
|
||||
showMoneySyntax(self);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void showMoneySyntax(obj_id self) throws InterruptedException
|
||||
@@ -232,24 +226,13 @@ public class cmd extends script.base_script
|
||||
}
|
||||
public int cmdBroadcast(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException
|
||||
{
|
||||
if (getGodLevel(self) < 40)
|
||||
{
|
||||
sendSystemMessage(self, "You do not have the appropriate access level to use this command.", null);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!isGod(self)) return SCRIPT_CONTINUE;
|
||||
queueCommand(self, (-351572629), target, params, COMMAND_PRIORITY_DEFAULT);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int cmdBroadcastPlanet(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException
|
||||
{
|
||||
if (getGodLevel(self) < 40)
|
||||
{
|
||||
sendSystemMessage(self, "You do not have the appropriate access level to use this command.", null);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!isGod(self)) return SCRIPT_CONTINUE;
|
||||
if (params != null && !params.equalsIgnoreCase(""))
|
||||
{
|
||||
sendSystemMessagePlanetTestingOnly(params);
|
||||
@@ -259,17 +242,11 @@ public class cmd extends script.base_script
|
||||
sendSystemMessageTestingOnly(self, "[Syntax] /broadcastPlanet <message>");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int cmdBroadcastGalaxy(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException
|
||||
{
|
||||
if (getGodLevel(self) < 40)
|
||||
{
|
||||
sendSystemMessage(self, "You do not have the appropriate access level to use this command.", null);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!isGod(self)) return SCRIPT_CONTINUE;
|
||||
if (params != null && !params.equalsIgnoreCase(""))
|
||||
{
|
||||
sendSystemMessageGalaxyTestingOnly(params);
|
||||
@@ -279,7 +256,6 @@ public class cmd extends script.base_script
|
||||
sendSystemMessageTestingOnly(self, "[Syntax] /broadcastGalaxy <message>");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int cmdBroadcastArea(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException
|
||||
|
||||
Regular → Executable
+3
@@ -134,6 +134,9 @@ public class ai_test extends script.base_script
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if(!isGod(self) || getGodLevel(self) < 10 || !isPlayer(self)){
|
||||
detachScript(self, "test.ai_test");
|
||||
}
|
||||
setObjVar(self, "blahblah", 1);
|
||||
start(self);
|
||||
return SCRIPT_CONTINUE;
|
||||
|
||||
Regular → Executable
+6
@@ -13,6 +13,12 @@ public class buy_box extends script.base_script
|
||||
public buy_box()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException {
|
||||
if (!isGod(self) || getGodLevel(self) < 10 || !isPlayer(self)) {
|
||||
detachScript(self, "test.buy_box");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException
|
||||
{
|
||||
LOG("tony_test", "player " + player + " item " + item);
|
||||
|
||||
Regular → Executable
+6
@@ -13,6 +13,12 @@ public class cannot_die_healing_test extends script.base_script
|
||||
public cannot_die_healing_test()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException {
|
||||
if (!isGod(self) || getGodLevel(self) < 10 || !isPlayer(self)) {
|
||||
detachScript(self, "test.buy_box");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnCreatureDamaged(obj_id self, obj_id attacker, obj_id weapon, int[] damage) throws InterruptedException
|
||||
{
|
||||
setAttrib(self, HEALTH, 100);
|
||||
|
||||
Regular → Executable
+3
@@ -59,6 +59,9 @@ public class char_transfer extends script.base.remote_object_requester
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 10 || !isPlayer(self)) {
|
||||
detachScript(self, "test.char_transfer");
|
||||
}
|
||||
debugConsoleMsg(self, "char_transfer attached!");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
Regular → Executable
+7
@@ -17,6 +17,13 @@ public class create_weapon extends script.base_script
|
||||
public create_weapon()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 10 || !isPlayer(self)) {
|
||||
detachScript(self, "test.create_weapon");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void makeResource(obj_id self, String rclass) throws InterruptedException
|
||||
{
|
||||
obj_id[] rtypes = getResourceTypes(rclass);
|
||||
|
||||
Regular → Executable
+7
@@ -27,6 +27,13 @@ public class dmellencamp_test extends script.base_script
|
||||
public dmellencamp_test()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.dmellencamp_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void colorize(obj_id player, obj_id target, String customizationVar) throws InterruptedException
|
||||
{
|
||||
int pId = createSUIPage("Script.ColorPicker", player, player, "ColorizeCallback");
|
||||
|
||||
Regular → Executable
+3
@@ -28,6 +28,9 @@ public class dwhite_test extends script.base_script
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.dwhite_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
|
||||
Regular → Executable
+3
@@ -444,6 +444,9 @@ public class esebesta_test extends script.base_script
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.esebesta_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnFormCreateObject(obj_id self, String templateName, float xLoc, float yLoc, float zLoc, obj_id cell, String[] keys, String[] values) throws InterruptedException
|
||||
|
||||
Regular → Executable
+3
@@ -99,6 +99,9 @@ public class juriarte_test extends script.base.remote_object_requester
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.juriarte_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int startPerform(obj_id self, dictionary params) throws InterruptedException
|
||||
|
||||
Regular → Executable
+7
@@ -28,6 +28,13 @@ public class jwatson_test extends script.base_script
|
||||
public jwatson_test()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.jwatson_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void colorize(obj_id player, obj_id target, String customizationVar) throws InterruptedException
|
||||
{
|
||||
int pId = createSUIPage("Script.ColorPicker", player, player, "ColorizeCallback");
|
||||
|
||||
Regular → Executable
+7
@@ -34,6 +34,13 @@ public class mbogue_test extends script.base_script
|
||||
public static final String s_usageSpaceUnitSetTargetOrders = "Usage: spaceUnitSetTargetOrders <unitObjId> <int>";
|
||||
public static final String s_usageSpaceUnitSetSquad = "Usage: spaceUnitSetSquad <unitObjId> <int>";
|
||||
public static final String s_usageSpaceSquadAddPatrolPath = "Usage: spaceSquadAddPatrolPath <int>";
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.mbogue_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (isGod(self))
|
||||
|
||||
Regular → Executable
+3
@@ -911,6 +911,9 @@ public class mboudreaux_test extends script.base.remote_object_requester
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.mboudreaux_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int startPerform(obj_id self, dictionary params) throws InterruptedException
|
||||
|
||||
Regular → Executable
+4
-1
@@ -39,7 +39,10 @@ public class mfarone_test extends script.base_script
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (hasObjVar(self, "idiot_testing"))
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.mfarone_test");
|
||||
}
|
||||
else if (hasObjVar(self, "idiot_testing"))
|
||||
{
|
||||
sendSystemMessage(self, "mfarone_test script attached.", "");
|
||||
}
|
||||
|
||||
Regular → Executable
+7
@@ -16,6 +16,13 @@ public class mhalash_test extends script.base_script
|
||||
public mhalash_test()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.mhalash_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (isGod(self))
|
||||
|
||||
Regular → Executable
+7
@@ -19,6 +19,13 @@ public class millbarge_test extends script.base_script
|
||||
public millbarge_test()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.millbarge_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (isGod(self))
|
||||
|
||||
Regular → Executable
+7
@@ -51,6 +51,13 @@ public class mitigation extends script.base_script
|
||||
"DAMAGE_ENVIRONMENTAL_ACID",
|
||||
"DAMAGE_ENVIRONMENTAL_ELECTRICAL"
|
||||
};
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 10) {
|
||||
detachScript(self, "test.mitigation");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (isGod(self))
|
||||
|
||||
Regular → Executable
+7
@@ -39,6 +39,13 @@ public class mjensen_test extends script.base_script
|
||||
public mjensen_test()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.mjensen_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
java.util.StringTokenizer tok = new java.util.StringTokenizer(text);
|
||||
|
||||
Regular → Executable
+7
@@ -19,6 +19,13 @@ public class msivertson_test extends script.base_script
|
||||
public msivertson_test()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.msivertson_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void maxStats(obj_id objPlayer) throws InterruptedException
|
||||
{
|
||||
addAttribModifier(objPlayer, HEALTH, 2000, 0, 0, MOD_POOL);
|
||||
|
||||
Regular → Executable
+7
@@ -88,6 +88,13 @@ public class qa_character extends script.base_script
|
||||
"camouflage",
|
||||
"combat_block_value"
|
||||
};
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 10) {
|
||||
detachScript(self, "test.qa_character");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
debugConsoleMsg(self, text);
|
||||
|
||||
Regular → Executable
+6
-1
@@ -72,7 +72,12 @@ public class qaspace extends script.base_script
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "QaSpace script attached.");
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.qaspace");
|
||||
}
|
||||
else {
|
||||
sendSystemMessageTestingOnly(self, "QaSpace script attached.");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnDetach(obj_id self) throws InterruptedException
|
||||
|
||||
Regular → Executable
+7
@@ -52,6 +52,13 @@ public class qaxp extends script.base_script
|
||||
"entertainer",
|
||||
"trader"
|
||||
};
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.qaxp");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (isGod(self))
|
||||
|
||||
Regular → Executable
+7
@@ -24,6 +24,13 @@ public class rhanz_test extends script.base.remote_object_requester
|
||||
{
|
||||
}
|
||||
public static final String STARTING_EQUIPMENT_FILE = "datatables/equipment/newbie_equipment.iff";
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.rhanz_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (isGod(self))
|
||||
|
||||
Regular → Executable
+6
-1
@@ -306,7 +306,12 @@ public class swyckoff_test extends script.base.remote_object_requester
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugConsoleMsg(self, "attached swyckoff_test");
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.swyckoff_test");
|
||||
}
|
||||
else {
|
||||
debugConsoleMsg(self, "attached swyckoff_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int startPerform(obj_id self, dictionary params) throws InterruptedException
|
||||
|
||||
Regular → Executable
+7
@@ -35,6 +35,13 @@ public class teidson_test extends script.base_script
|
||||
public teidson_test()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.teidson_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String strText) throws InterruptedException
|
||||
{
|
||||
String[] strCommands = split(strText, ' ');
|
||||
|
||||
Regular → Executable
+7
-2
@@ -18,8 +18,13 @@ public class test_sui extends script.base_script
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "test_sui: attached!");
|
||||
debugServerConsoleMsg(self, "test_sui: attached!");
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.test_sui");
|
||||
}
|
||||
else{
|
||||
debugSpeakMsg(self, "test_sui: attached!");
|
||||
debugServerConsoleMsg(self, "test_sui: attached!");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnDetach(obj_id self) throws InterruptedException
|
||||
|
||||
Regular → Executable
+6
-1
@@ -110,7 +110,12 @@ public class tford_test extends script.base_script
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "tford_test.script attached");
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.tford_test");
|
||||
}
|
||||
else{
|
||||
debugSpeakMsg(self, "tford_test.script attached");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnLocomotionChanged(obj_id self, int newLocomotion, int oldLocomotion) throws InterruptedException
|
||||
|
||||
Regular → Executable
+7
@@ -58,6 +58,13 @@ public class thicks_test extends script.base_script
|
||||
public static final int clearAllObjVars = 5;
|
||||
public static final int doClientEffect = 6;
|
||||
public static final int spawnCreature = 7;
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.thicks_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnMoveMoving(obj_id self) throws InterruptedException
|
||||
{
|
||||
setState(self, STATE_STUNNED, false);
|
||||
|
||||
Regular → Executable
+3
@@ -650,6 +650,9 @@ public class ttyson_test extends script.base.remote_object_requester
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
||||
detachScript(self, "test.ttyson_test");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int handleFailedStructurePackup(obj_id self, dictionary params) throws InterruptedException
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1,797 +0,0 @@
|
||||
package script.working.ahunter;
|
||||
|
||||
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.colors;
|
||||
import script.library.hue;
|
||||
import script.library.prose;
|
||||
import script.library.pclib;
|
||||
import script.library.player_structure;
|
||||
import script.library.skill;
|
||||
import script.library.utils;
|
||||
import script.library.fs_quests_sad;
|
||||
import script.library.chat;
|
||||
import script.library.respec;
|
||||
|
||||
public class my_script extends script.base_script
|
||||
{
|
||||
public my_script()
|
||||
{
|
||||
}
|
||||
public int[] anArrayFunc() throws InterruptedException
|
||||
{
|
||||
return new int[5];
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
boolean result;
|
||||
int intArrayIndex;
|
||||
obj_id other = null;
|
||||
if (other == self)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
other = self;
|
||||
}
|
||||
debugServerConsoleMsg(self, "about to crash in C!");
|
||||
debugServerConsoleMsg(null, "crashing in C!");
|
||||
debugServerConsoleMsg(self, "after crash in C!");
|
||||
messageTo(self, "myMessageHandler", null, 0, true);
|
||||
|
||||
debugServerConsoleMsg(null, "in debug mode");
|
||||
|
||||
debugConsoleMsg(self, "myscript reload attached!");
|
||||
debugConsoleMsg(self, "current objvars:");
|
||||
listObjvars(self, self);
|
||||
debugConsoleMsg(self, "adding objvars");
|
||||
debugConsoleMsg(self, "integer");
|
||||
result = setObjVar(self, "idata", 111);
|
||||
if (result)
|
||||
{
|
||||
debugConsoleMsg(self, "ok");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugConsoleMsg(self, "fail");
|
||||
}
|
||||
debugConsoleMsg(self, "float");
|
||||
result = setObjVar(self, "fdata", 666.999f);
|
||||
if (result)
|
||||
{
|
||||
debugConsoleMsg(self, "ok");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugConsoleMsg(self, "fail");
|
||||
}
|
||||
debugConsoleMsg(self, "string");
|
||||
result = setObjVar(self, "sdata", "winona");
|
||||
if (result)
|
||||
{
|
||||
debugConsoleMsg(self, "ok");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugConsoleMsg(self, "fail");
|
||||
}
|
||||
debugConsoleMsg(self, "obj_id");
|
||||
result = setObjVar(self, "oid_data", self);
|
||||
if (result)
|
||||
{
|
||||
debugConsoleMsg(self, "ok");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugConsoleMsg(self, "fail");
|
||||
}
|
||||
debugConsoleMsg(self, "obj_id array");
|
||||
obj_id[] oidaData = new obj_id[3];
|
||||
oidaData[0] = self;
|
||||
oidaData[1] = self;
|
||||
oidaData[2] = self;
|
||||
result = setObjVar(self, "oidArray_data", oidaData);
|
||||
if (result)
|
||||
{
|
||||
debugConsoleMsg(self, "ok");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugConsoleMsg(self, "fail");
|
||||
}
|
||||
debugConsoleMsg(self, "sublist");
|
||||
result = setObjVar(self, "item1", 123);
|
||||
result = setObjVar(self, "item2", 123.456f);
|
||||
result = setObjVar(self, "sublist.sub item", "yadayada");
|
||||
if (result)
|
||||
{
|
||||
debugConsoleMsg(self, "result:");
|
||||
listObjvars(self, self);
|
||||
}
|
||||
else
|
||||
{
|
||||
debugConsoleMsg(self, "setObjVar failed!");
|
||||
}
|
||||
debugConsoleMsg(self, "leaving OnAttach");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnDetach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "Bye bye!");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnInitialize(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugServerConsoleMsg(self, "I'm initialized!");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnAddedToWorld(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "I'm in the world!");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void whackamoleRandomize(obj_id self, int pid) throws InterruptedException
|
||||
{
|
||||
int button = rand(0, 2);
|
||||
utils.setScriptVar(self, "whackamolebutton", button);
|
||||
setSUIProperty(pid, "%button0%", "BackgroundTint", "#FF0000");
|
||||
setSUIProperty(pid, "%button1%", "BackgroundTint", "#FF0000");
|
||||
setSUIProperty(pid, "%button2%", "BackgroundTint", "#FF0000");
|
||||
setSUIProperty(pid, "%button" + button + "%", "BackgroundTint", "#00FF00");
|
||||
flushSUIPage(pid);
|
||||
utils.setScriptVar(self, "whackamolebutton", button);
|
||||
}
|
||||
public int whackamoleTimerCallback(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
int pid = utils.getIntScriptVar(self, "whackamolepid");
|
||||
if (pid > 0)
|
||||
{
|
||||
whackamoleRandomize(self, pid);
|
||||
messageTo(self, "whackamoleTimerCallback", null, 1, false);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int whackamoleCallback(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "whackamoleCallback");
|
||||
String widgetName = params.getString("eventWidgetName");
|
||||
debugSpeakMsg(self, "eventWidgetName = " + widgetName);
|
||||
int buttonPressed = -1;
|
||||
if (widgetName.equalsIgnoreCase("%button0%"))
|
||||
{
|
||||
buttonPressed = 0;
|
||||
}
|
||||
else if (widgetName.equalsIgnoreCase("%button1%"))
|
||||
{
|
||||
buttonPressed = 1;
|
||||
}
|
||||
else if (widgetName.equalsIgnoreCase("%button2%"))
|
||||
{
|
||||
buttonPressed = 2;
|
||||
}
|
||||
int targetButton = utils.getIntScriptVar(self, "whackamolebutton");
|
||||
int currentScore = utils.getIntScriptVar(self, "whackamolescore");
|
||||
int pid = utils.getIntScriptVar(self, "whackamolepid");
|
||||
if (targetButton == buttonPressed)
|
||||
{
|
||||
currentScore += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentScore = 0;
|
||||
}
|
||||
setSUIProperty(pid, "score.numberBox", "Text", "" + currentScore);
|
||||
utils.setScriptVar(self, "whackamolescore", currentScore);
|
||||
whackamoleRandomize(self, pid);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnTheaterCreated(obj_id self, obj_id[] objects, obj_id player, obj_id creator) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(player, "my id is " + self);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
debugServerConsoleMsg(self, "From myscript.script OnSpeaking: " + text);
|
||||
java.util.StringTokenizer st = new java.util.StringTokenizer(text);
|
||||
String arg = st.nextToken();
|
||||
String arg2 = st.nextToken();
|
||||
if (arg.equals("gotoDungeon") && st.countTokens() == 1)
|
||||
{
|
||||
obj_id dungeon = utils.stringToObjId(st.nextToken());
|
||||
obj_id cell = getCellId(dungeon, "cave_entrance");
|
||||
location dest = new location(2.4f, 10.5f, 9.3f, getCurrentSceneName(), cell);
|
||||
setLocation(self, dest);
|
||||
}
|
||||
else if (arg.equals("gotoStation") && st.countTokens() == 1)
|
||||
{
|
||||
obj_id station = utils.stringToObjId(st.nextToken());
|
||||
obj_id cell = getCellId(station, "hangarbay2");
|
||||
location dest = new location(62.7f, 0.9f, -33.5f, getCurrentSceneName(), cell);
|
||||
setLocation(self, dest);
|
||||
}
|
||||
if (text.equals("newdewd"))
|
||||
{
|
||||
location mylocation = getLocation(self);
|
||||
createObject("creature/fodder", mylocation);
|
||||
}
|
||||
else if (arg.equals("turnon"))
|
||||
{
|
||||
debugSpeakMsg(self, ("turning on"));
|
||||
setCondition(obj_id.getObjId(Integer.parseInt(arg2)), CONDITION_ON);
|
||||
}
|
||||
else if (arg.equals("turnoff"))
|
||||
{
|
||||
debugSpeakMsg(self, ("turning off"));
|
||||
clearCondition(obj_id.getObjId(Integer.parseInt(arg2)), CONDITION_ON);
|
||||
}
|
||||
else if (arg.equals("oc"))
|
||||
{
|
||||
debugSpeakMsg(self, "opening customization window with " + Integer.parseInt(arg2));
|
||||
obj_id oid = obj_id.getObjId(Integer.parseInt(arg2));
|
||||
custom_var[] allVars = getAllCustomVars(oid);
|
||||
if (allVars.length == 1)
|
||||
{
|
||||
openCustomizationWindow(self, oid, allVars[0].getVarName(), -1, -1, "", -1, -1, "", -1, -1, "", -1, -1);
|
||||
}
|
||||
else if (allVars.length == 2)
|
||||
{
|
||||
openCustomizationWindow(self, oid, allVars[0].getVarName(), 0, 10, allVars[1].getVarName(), -1, -1, "", -1, -1, "", -1, -1);
|
||||
}
|
||||
else if (allVars.length == 3)
|
||||
{
|
||||
openCustomizationWindow(self, oid, allVars[0].getVarName(), -1, -1, allVars[1].getVarName(), -1, -1, allVars[2].getVarName(), -1, -1, "", -1, -1);
|
||||
}
|
||||
}
|
||||
else if (text.equals("sendcombat1"))
|
||||
{
|
||||
string_id critSpam = new string_id("combat_effects", "action_too_tired");
|
||||
prose_package ppc = new prose_package();
|
||||
ppc = prose.setStringId(ppc, critSpam);
|
||||
showFlyTextPrivateProseWithFlags(self, self, ppc, 1.5f, colors.DARKORANGE, FLY_TEXT_FLAG_IS_BLEED);
|
||||
}
|
||||
else if (text.equals("sendcombat2"))
|
||||
{
|
||||
string_id critSpam = new string_id("combat_effects", "action_too_tired");
|
||||
prose_package ppc = new prose_package();
|
||||
ppc = prose.setStringId(ppc, critSpam);
|
||||
showFlyTextPrivateProseWithFlags(self, self, ppc, 1.5f, colors.DARKORANGE, FLY_TEXT_FLAG_IS_HEAL);
|
||||
}
|
||||
else if (text.equals("rae"))
|
||||
{
|
||||
resetExpertises(self);
|
||||
}
|
||||
else if (text.equals("rcs"))
|
||||
{
|
||||
recomputeCommandSeries(self);
|
||||
}
|
||||
else if (text.equals("scs"))
|
||||
{
|
||||
debugSpeakMsg(self, "sending fake combat spam");
|
||||
hit_result hit = new hit_result();
|
||||
hit.damage = 1000;
|
||||
hit.hitLocation = 0;
|
||||
string_id sid = new string_id("combat_effects", "action_too_tired");
|
||||
sendCombatSpam(self, self, getCurrentWeapon(self), hit, sid, true, true, true, COMBAT_RESULT_HIT);
|
||||
}
|
||||
else if (text.equals("sit"))
|
||||
{
|
||||
}
|
||||
else if (text.equals("git"))
|
||||
{
|
||||
debugSpeakMsg(self, "getting intended target: " + getIntendedTarget(self));
|
||||
}
|
||||
else if (text.equals("cit"))
|
||||
{
|
||||
}
|
||||
else if (text.equals("gt"))
|
||||
{
|
||||
debugSpeakMsg(self, "getting template: '" + getSkillTemplate(self) + "'");
|
||||
}
|
||||
else if (text.equals("ct"))
|
||||
{
|
||||
debugSpeakMsg(self, "setting template to nothing");
|
||||
setSkillTemplate(self, "");
|
||||
}
|
||||
else if (text.equals("sti"))
|
||||
{
|
||||
debugSpeakMsg(self, "setting template to something invalid");
|
||||
setSkillTemplate(self, "foo");
|
||||
}
|
||||
else if (text.equals("st"))
|
||||
{
|
||||
debugSpeakMsg(self, "setting template to teras kasi smuggler");
|
||||
setSkillTemplate(self, "smuggler_2a");
|
||||
}
|
||||
else if (text.equals("st2"))
|
||||
{
|
||||
debugSpeakMsg(self, "setting template to pistoleer smuggler");
|
||||
setSkillTemplate(self, "smuggler_2b");
|
||||
}
|
||||
else if (text.equals("st3"))
|
||||
{
|
||||
debugSpeakMsg(self, "setting template to commando b");
|
||||
setSkillTemplate(self, "commando_2b");
|
||||
}
|
||||
else if (text.equals("st4"))
|
||||
{
|
||||
debugSpeakMsg(self, "setting template to commando a");
|
||||
setSkillTemplate(self, "commando_2a");
|
||||
}
|
||||
else if (text.equals("sws"))
|
||||
{
|
||||
debugSpeakMsg(self, "setting working skill to combat_marksman_pistol_01");
|
||||
setWorkingSkill(self, "combat_marksman_pistol_01");
|
||||
}
|
||||
else if (text.equals("advance"))
|
||||
{
|
||||
debugSpeakMsg(self, "advancing along template");
|
||||
grantSkill(self, "combat_marksman_pistol_01");
|
||||
grantSkill(self, "combat_brawler_unarmed_01");
|
||||
grantSkill(self, "combat_marksman_pistol_02");
|
||||
grantSkill(self, "combat_brawler_unarmed_02");
|
||||
grantSkill(self, "combat_marksman_pistol_03");
|
||||
grantSkill(self, "combat_brawler_unarmed_03");
|
||||
grantSkill(self, "combat_marksman_pistol_04");
|
||||
grantSkill(self, "combat_brawler_unarmed_04");
|
||||
grantSkill(self, "combat_smuggler_novice");
|
||||
grantSkill(self, "science_medic_novice");
|
||||
grantSkill(self, "outdoors_scout_novice");
|
||||
setWorkingSkill(self, "combat_brawler_2handmelee_01");
|
||||
}
|
||||
else if (text.equals("demo"))
|
||||
{
|
||||
debugSpeakMsg(self, "setting up template demo");
|
||||
setSkillTemplate(self, "smuggler_2a");
|
||||
grantSkill(self, "combat_marksman_novice");
|
||||
grantSkill(self, "combat_brawler_novice");
|
||||
setWorkingSkill(self, "combat_marksman_pistol_01");
|
||||
}
|
||||
else if (text.equals("gt"))
|
||||
{
|
||||
debugSpeakMsg(self, "getting template: " + getSkillTemplate(self));
|
||||
}
|
||||
else if (text.equals("gws"))
|
||||
{
|
||||
debugSpeakMsg(self, "getting working skill: " + getWorkingSkill(self));
|
||||
}
|
||||
else if (text.equals("ht"))
|
||||
{
|
||||
debugSpeakMsg(self, "highlighting toolbar widget");
|
||||
newbieTutorialHighlightUIElement(self, "/GroundHUD.Toolbar.volume.1", 5.0f);
|
||||
}
|
||||
else if (text.equals("hm"))
|
||||
{
|
||||
debugSpeakMsg(self, "highlighting toolbar widget");
|
||||
newbieTutorialHighlightUIElement(self, "/GroundHUD.ButtonBar.buttonsComposite.buttonInventoryComposite.inventory", 5.0f);
|
||||
}
|
||||
else if (text.equals("hm2"))
|
||||
{
|
||||
debugSpeakMsg(self, "highlighting toolbar widget");
|
||||
newbieTutorialHighlightUIElement(self, "/GroundHUD.ButtonBar.bigMenuPage.bigMenu", 5.0f);
|
||||
}
|
||||
else if (text.equals("hy"))
|
||||
{
|
||||
debugSpeakMsg(self, "highlighting widget");
|
||||
newbieTutorialHighlightUIElement(self, "/GroundHUD.radar", true);
|
||||
}
|
||||
else if (text.equals("hn"))
|
||||
{
|
||||
debugSpeakMsg(self, "turning off highlighting widget");
|
||||
newbieTutorialHighlightUIElement(self, "/GroundHUD.radar", false);
|
||||
}
|
||||
else if (text.equals("hw"))
|
||||
{
|
||||
debugSpeakMsg(self, "highlighting widget");
|
||||
newbieTutorialHighlightUIElement(self, "/GroundHUD.radar", 6.0f);
|
||||
}
|
||||
else if (text.equals("sb"))
|
||||
{
|
||||
debugSpeakMsg(self, "setting bar");
|
||||
newbieTutorialSetToolbarElement(self, 8, "/meleeHit");
|
||||
}
|
||||
else if (text.equals("sp"))
|
||||
{
|
||||
debugSpeakMsg(self, "setting pants in bar");
|
||||
newbieTutorialSetToolbarElement(self, 8, obj_id.getObjId(new Long(10000720)));
|
||||
}
|
||||
else if (text.equals("cb"))
|
||||
{
|
||||
debugSpeakMsg(self, "setting bar");
|
||||
newbieTutorialSetToolbarElement(self, 8, "");
|
||||
}
|
||||
else if (text.equals("no"))
|
||||
{
|
||||
debugSpeakMsg(self, "sending notification");
|
||||
addNotification(self, "foo", false, 0, 0.0f, 0, "sound/tut_15_opencontainer.snd");
|
||||
}
|
||||
else if (text.equals("no2"))
|
||||
{
|
||||
debugSpeakMsg(self, "sending notification");
|
||||
int handle = addNotification(self, "foo2", false, NOTE_ICON_STYLE_EXCLAMATION, 0.0f, 0, "");
|
||||
utils.setScriptVar(self, "notifyhandle", handle);
|
||||
debugSpeakMsg(self, "handle " + handle);
|
||||
}
|
||||
else if (text.equals("no3"))
|
||||
{
|
||||
debugSpeakMsg(self, "sending notification");
|
||||
addNotification(self, "foo3", true, NOTE_ICON_STYLE_QUESTION, 0.0f, 0, "");
|
||||
}
|
||||
else if (text.equals("no4"))
|
||||
{
|
||||
debugSpeakMsg(self, "sending notification");
|
||||
addNotification(self, "foo4", true, 0, 6.0f, 0, "");
|
||||
}
|
||||
else if (text.equals("cl2"))
|
||||
{
|
||||
int handle = utils.getIntScriptVar(self, "notifyhandle");
|
||||
debugSpeakMsg(self, "sending cancel " + handle);
|
||||
cancelNotification(self, handle);
|
||||
}
|
||||
else if (text.equals("tt"))
|
||||
{
|
||||
String duration = getConfigSetting("GameServer", "respecDurationAllowedInSeconds");
|
||||
debugSpeakMsg(self, "current config time = " + duration);
|
||||
int now = getGameTime();
|
||||
debugSpeakMsg(self, "now = " + now);
|
||||
int timestamp = getIntObjVar(self, respec.OBJVAR_TIMESTAMP);
|
||||
debugSpeakMsg(self, "timestamp = " + timestamp);
|
||||
String duration2 = getConfigSetting("GameServer", "minRespecIntervalInSeconds");
|
||||
debugSpeakMsg(self, "duration2 = " + duration2);
|
||||
int lastTimestamp = getIntObjVar(self, respec.OBJVAR_LAST_TIMESTAMP);
|
||||
debugSpeakMsg(self, "lastTimestamp = " + lastTimestamp);
|
||||
}
|
||||
else if (text.equals("ab"))
|
||||
{
|
||||
String s = new String("testMedBuff");
|
||||
_addBuff(self, getStringCrc(s));
|
||||
}
|
||||
else if (text.equals("nt1"))
|
||||
{
|
||||
debugSpeakMsg(self, "creating theater");
|
||||
location theaterLoc = getLocation(self);
|
||||
theaterLoc.z -= 10.0;
|
||||
boolean created = assignTheaterToPlayer(self, "datatables/theater/fs_quest_sad/theater1.iff", theaterLoc, "ahunter.my_script");
|
||||
debugSpeakMsg(self, "result = " + created);
|
||||
}
|
||||
else if (text.equals("nt2"))
|
||||
{
|
||||
debugSpeakMsg(self, "creating theater");
|
||||
location theaterLoc = getLocation(self);
|
||||
theaterLoc.z -= 10.0;
|
||||
boolean created = assignTheaterToPlayer(self, "datatables/theater/fs_quest_sad/theater2.iff", theaterLoc, "ahunter.my_script");
|
||||
debugSpeakMsg(self, "result = " + created);
|
||||
}
|
||||
else if (text.equals("nt3"))
|
||||
{
|
||||
debugSpeakMsg(self, "creating theater");
|
||||
location theaterLoc = getLocation(self);
|
||||
theaterLoc.z -= 10.0;
|
||||
boolean created = assignTheaterToPlayer(self, "datatables/theater/fs_quest_sad/theater3.iff", theaterLoc, "ahunter.my_script");
|
||||
debugSpeakMsg(self, "result = " + created);
|
||||
}
|
||||
else if (text.equals("foo"))
|
||||
{
|
||||
chat.chat(self, "bar");
|
||||
}
|
||||
else if (text.equals("nqc"))
|
||||
{
|
||||
debugSpeakMsg(self, "num quests completed = " + fs_quests_sad.getNumberTasksCompleted(self));
|
||||
}
|
||||
else if (text.equals("tu"))
|
||||
{
|
||||
debugSpeakMsg(self, "unassigning theater");
|
||||
unassignTheaterFromPlayer(self);
|
||||
}
|
||||
else if (text.equals("launchcalibpuzzle2"))
|
||||
{
|
||||
detachScript(self, "systems.fs_quest.calibrationpuzzle.puzzle2");
|
||||
attachScript(self, "systems.fs_quest.calibrationpuzzle.puzzle2");
|
||||
}
|
||||
else if (text.equals("whackamole"))
|
||||
{
|
||||
debugSpeakMsg(self, "whackamole processing");
|
||||
int pid = createSUIPage("/Script.whackamole", self, self, "whackamoleCallback");
|
||||
utils.setScriptVar(self, "whackamolepid", pid);
|
||||
debugSpeakMsg(self, "whackamole pid = " + pid);
|
||||
if (pid < 0)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "%button0%", "whackamoleCallback");
|
||||
subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "%button0%", "score", "Text");
|
||||
subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "%button1%", "whackamoleCallback");
|
||||
subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "%button1%", "score", "Text");
|
||||
subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "%button2%", "whackamoleCallback");
|
||||
subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "%button2%", "score", "Text");
|
||||
setSUIProperty(pid, "bg.caption.lbltitle", "Text", "WHACK-A-MOLE");
|
||||
utils.setScriptVar(self, "whackamolescore", 0);
|
||||
setSUIProperty(pid, "score.numberBox", "Text", "0");
|
||||
setSUIAssociatedObject(pid, self);
|
||||
showSUIPage(pid);
|
||||
whackamoleRandomize(self, pid);
|
||||
messageTo(self, "whackamoleTimerCallback", null, 1, false);
|
||||
}
|
||||
else if (text.equals("testlib"))
|
||||
{
|
||||
}
|
||||
else if (text.equals("testweapon"))
|
||||
{
|
||||
obj_id weapon = getCurrentWeapon(self);
|
||||
debugSpeakMsg(self, "My weapon damage = " + getAverageDamage(weapon));
|
||||
}
|
||||
else if (text.equals("testattach"))
|
||||
{
|
||||
attachScript(self, "steve.dummy");
|
||||
}
|
||||
else if (text.equals("testdetach"))
|
||||
{
|
||||
detachScript(self, "steve.myscript");
|
||||
setObjVar(self, "item1", 0);
|
||||
removeObjVar(self, "item2");
|
||||
}
|
||||
else if (text.equals("quest"))
|
||||
{
|
||||
messageTo(self, "spawnBoxDestroyed", null, 0, true);
|
||||
}
|
||||
else if (text.equals("broadcast"))
|
||||
{
|
||||
debugServerConsoleMsg(self, "broadcasting message");
|
||||
dictionary params = new dictionary();
|
||||
}
|
||||
else if (text.equals("messageTo"))
|
||||
{
|
||||
debugServerConsoleMsg(self, "testing messageTo");
|
||||
dictionary params = new dictionary();
|
||||
params.put("slef", self);
|
||||
messageTo(self, "myMessageHandler", params, 0.5f, false);
|
||||
}
|
||||
else if (text.equals("damagehouse"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (isIdValid(target))
|
||||
{
|
||||
deltadictionary scriptvars = target.getScriptVars();
|
||||
obj_id house = scriptvars.getObjId("player_structure.parent");
|
||||
if (isIdValid(house))
|
||||
{
|
||||
int maxhp = getMaxHitpoints(house);
|
||||
int current = getHitpoints(house);
|
||||
int hp = current - (int)(maxhp * .1f);
|
||||
if (hp < 0)
|
||||
{
|
||||
hp = 0;
|
||||
}
|
||||
debugSpeakMsg(self, "setting house hp from " + current + " to " + hp);
|
||||
player_structure.damageStructure(house, current - hp);
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "Can't find scriptvar player_structure.parent");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "No lookat target");
|
||||
}
|
||||
}
|
||||
else if (text.equals("makemejedi"))
|
||||
{
|
||||
String[] skills = getStringArrayObjVar(self, pclib.OBJVAR_JEDI_SKILL_REQUIREMENTS);
|
||||
if (skills != null)
|
||||
{
|
||||
for (int i = 0; i < skills.length; ++i)
|
||||
{
|
||||
skill.grantSkillToPlayer(self, skills[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (text.equals("isjedi"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (!isIdValid(target))
|
||||
{
|
||||
target = self;
|
||||
}
|
||||
if (isJedi(target))
|
||||
{
|
||||
debugSpeakMsg(self, "jedi");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "not jedi");
|
||||
}
|
||||
}
|
||||
else if (text.equals("getjedistate"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (!isIdValid(target))
|
||||
{
|
||||
target = self;
|
||||
}
|
||||
debugSpeakMsg(self, "jedi state = " + getJediState(target));
|
||||
}
|
||||
else if (text.equals("setjediforcesensitive"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (!isIdValid(target))
|
||||
{
|
||||
target = self;
|
||||
}
|
||||
setJediState(target, JEDI_STATE_FORCE_SENSITIVE);
|
||||
debugSpeakMsg(self, "setting jedi state to JEDI_STATE_FORCE_SENSITIVE");
|
||||
}
|
||||
else if (text.equals("setjedijedi"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (!isIdValid(target))
|
||||
{
|
||||
target = self;
|
||||
}
|
||||
setJediState(target, JEDI_STATE_JEDI);
|
||||
debugSpeakMsg(self, "setting jedi state to JEDI_STATE_JEDI");
|
||||
}
|
||||
else if (text.equals("setjediforcerankedlight"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (!isIdValid(target))
|
||||
{
|
||||
target = self;
|
||||
}
|
||||
setJediState(target, JEDI_STATE_FORCE_RANKED_LIGHT);
|
||||
debugSpeakMsg(self, "setting jedi state to JEDI_STATE_FORCE_RANKED_LIGHT");
|
||||
}
|
||||
else if (text.equals("setjediforcerankeddark"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (!isIdValid(target))
|
||||
{
|
||||
target = self;
|
||||
}
|
||||
setJediState(target, JEDI_STATE_FORCE_RANKED_DARK);
|
||||
debugSpeakMsg(self, "setting jedi state to JEDI_STATE_FORCE_RANKED_DARK");
|
||||
}
|
||||
else if (text.equals("setjedinone"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (!isIdValid(target))
|
||||
{
|
||||
target = self;
|
||||
}
|
||||
setJediState(target, JEDI_STATE_NONE);
|
||||
debugSpeakMsg(self, "setting jedi state to JEDI_STATE_NONE");
|
||||
}
|
||||
else if (text.equals("getjedi"))
|
||||
{
|
||||
dictionary result = requestJedi(IGNORE_JEDI_STAT, IGNORE_JEDI_STAT, 1, 1000, IGNORE_JEDI_STAT, IGNORE_JEDI_STAT, IGNORE_JEDI_STAT);
|
||||
if (result != null)
|
||||
{
|
||||
obj_id[] id = result.getObjIdArray("id");
|
||||
String[] name = result.getStringArray("name");
|
||||
location[] loc = result.getLocationArray("location");
|
||||
String[] scene = result.getStringArray("scene");
|
||||
int[] visibility = result.getIntArray("visibility");
|
||||
int[] bountyValue = result.getIntArray("bountyValue");
|
||||
int[] level = result.getIntArray("level");
|
||||
int[] hoursAlive = result.getIntArray("hoursAlive");
|
||||
int[] state = result.getIntArray("state");
|
||||
obj_id[][] bounties = (obj_id[][])(result.get("bounties"));
|
||||
boolean[] online = result.getBooleanArray("online");
|
||||
if (id != null && id.length > 0)
|
||||
{
|
||||
for (int i = 0; i < id.length; ++i)
|
||||
{
|
||||
debugConsoleMsg(self, "Player " + name[i]);
|
||||
debugConsoleMsg(self, "\tid = " + id[i]);
|
||||
debugConsoleMsg(self, "\tloc = " + loc[i]);
|
||||
debugConsoleMsg(self, "\tscene = " + scene[i]);
|
||||
debugConsoleMsg(self, "\tvisibility = " + visibility[i]);
|
||||
debugConsoleMsg(self, "\tbounty value = " + bountyValue[i]);
|
||||
debugConsoleMsg(self, "\tlevel = " + level[i]);
|
||||
debugConsoleMsg(self, "\thours alive = " + hoursAlive[i]);
|
||||
debugConsoleMsg(self, "\tstate = " + state[i]);
|
||||
debugConsoleMsg(self, "\tonline = " + online[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
debugConsoleMsg(self, "No jedi");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
debugConsoleMsg(self, "Error getting jedi");
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void listObjvars(obj_id self, obj_id object) throws InterruptedException
|
||||
{
|
||||
obj_var_list list = getObjVarList(object, null);
|
||||
if (list != null)
|
||||
{
|
||||
debugConsoleMsg(self, list.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
debugConsoleMsg(self, "no objvars on me");
|
||||
}
|
||||
}
|
||||
public String myFunc() throws InterruptedException
|
||||
{
|
||||
return new String("");
|
||||
}
|
||||
public dictionary myOtherFunc() throws InterruptedException
|
||||
{
|
||||
return null;
|
||||
}
|
||||
public int myMessageHandler(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "in my message handler");
|
||||
if (params != null)
|
||||
{
|
||||
debugServerConsoleMsg(self, "params = " + params);
|
||||
Object slef = params.get("slef");
|
||||
if (slef != null)
|
||||
{
|
||||
debugServerConsoleMsg(self, "slef class is " + slef.getClass());
|
||||
obj_id o_slef = (obj_id)slef;
|
||||
if (o_slef != null)
|
||||
{
|
||||
debugServerConsoleMsg(self, "slef converted to obj_id");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugServerConsoleMsg(self, "cannot convert slef");
|
||||
}
|
||||
obj_id d_slef = params.getObjId("slef");
|
||||
if (d_slef != null)
|
||||
{
|
||||
debugServerConsoleMsg(self, "dictionary converted to obj_id");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugServerConsoleMsg(self, "dictionary cannot convert to obj_id");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
debugServerConsoleMsg(self, "can't find slef");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
debugServerConsoleMsg(self, "null params");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnCustomizeFinished(obj_id self, obj_id object, String params) throws InterruptedException
|
||||
{
|
||||
java.util.StringTokenizer st = new java.util.StringTokenizer(params);
|
||||
String var = st.nextToken();
|
||||
int i = Integer.parseInt(st.nextToken());
|
||||
debugSpeakMsg(self, "OnCustomizeFinished: " + object + " , '" + var + "' " + i);
|
||||
hue.setColor(object, var, i);
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
var = st.nextToken();
|
||||
i = Integer.parseInt(st.nextToken());
|
||||
debugSpeakMsg(self, "OnCustomizeFinished: " + object + " , '" + var + "' " + i);
|
||||
hue.setColor(object, var, i);
|
||||
}
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
var = st.nextToken();
|
||||
i = Integer.parseInt(st.nextToken());
|
||||
debugSpeakMsg(self, "OnCustomizeFinished: " + object + " , '" + var + "' " + i);
|
||||
hue.setColor(object, var, i);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,221 +0,0 @@
|
||||
package script.working;
|
||||
|
||||
import script.*;
|
||||
import script.base_class.*;
|
||||
import script.combat_engine.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import script.base_script;
|
||||
|
||||
import script.library.ai_lib;
|
||||
import script.library.sui;
|
||||
import script.library.utils;
|
||||
import script.library.anims;
|
||||
import script.library.chat;
|
||||
|
||||
public class animtest extends script.base_script
|
||||
{
|
||||
public animtest()
|
||||
{
|
||||
}
|
||||
public static final String[] ANIMATIONS_ALL =
|
||||
{
|
||||
anims.PLAYER_ACCEPT_AFFECTION,
|
||||
anims.PLAYER_BECKON,
|
||||
anims.PLAYER_BEG,
|
||||
anims.PLAYER_BELLY_LAUGH,
|
||||
anims.PLAYER_BOW2,
|
||||
anims.PLAYER_BOW3,
|
||||
anims.PLAYER_BOW4,
|
||||
anims.PLAYER_BOW5,
|
||||
anims.PLAYER_CELEBRATE,
|
||||
anims.PLAYER_CELEBRATE1,
|
||||
anims.PLAYER_CHECK_WRIST_DEVICE,
|
||||
anims.PLAYER_CLAP_ROUSING,
|
||||
anims.PLAYER_COUGH_POLITE,
|
||||
anims.PLAYER_COVER_EARS_MOCKING,
|
||||
anims.PLAYER_COVER_MOUTH,
|
||||
anims.PLAYER_CURTSEY,
|
||||
anims.PLAYER_CURTSEY1,
|
||||
anims.PLAYER_DOOR_KNOCK,
|
||||
anims.PLAYER_DOOR_POUND,
|
||||
anims.PLAYER_EMBARRASSED,
|
||||
anims.PLAYER_FLEX_BICEPS,
|
||||
anims.PLAYER_FORCE_ABSORB,
|
||||
anims.PLAYER_FORCE_BLAST,
|
||||
anims.PLAYER_FORCE_CHANNEL,
|
||||
anims.PLAYER_FORCE_CHOKE,
|
||||
anims.PLAYER_FORCE_DAMPEN,
|
||||
anims.PLAYER_FORCE_DESTRUCTION,
|
||||
anims.PLAYER_FORCE_ILLUSION,
|
||||
anims.PLAYER_FORCE_LIGHTNING,
|
||||
anims.PLAYER_FORCE_PERSUASION,
|
||||
anims.PLAYER_FORCE_PROTECTION,
|
||||
anims.PLAYER_FORCE_PULL,
|
||||
anims.PLAYER_FORCE_PUSH,
|
||||
anims.PLAYER_FORCE_STRENGTH,
|
||||
anims.PLAYER_FORCE_THROW,
|
||||
anims.PLAYER_GESTICULATE_WILDLY,
|
||||
anims.PLAYER_HAIR_FLIP,
|
||||
anims.PLAYER_HANDS_ABOVE_HEAD,
|
||||
anims.PLAYER_HANDS_BEHIND_HEAD,
|
||||
anims.PLAYER_HEAVY_COUGH_VOMIT,
|
||||
anims.PLAYER_HOLD_NOSE,
|
||||
anims.PLAYER_HUG_SELF,
|
||||
anims.PLAYER_IMPLORE,
|
||||
anims.PLAYER_KISS_BLOW_KISS,
|
||||
anims.PLAYER_LAUGH_CACKLE,
|
||||
anims.PLAYER_LAUGH_POINTING,
|
||||
anims.PLAYER_LAUGH_TITTER,
|
||||
anims.PLAYER_LISTEN,
|
||||
anims.PLAYER_NOD_HEAD_MULTIPLE,
|
||||
anims.PLAYER_NOD_HEAD_ONCE,
|
||||
anims.PLAYER_OFFER_AFFECTION,
|
||||
anims.PLAYER_PAT_ABDOMEN,
|
||||
anims.PLAYER_POINT_ACCUSINGLY,
|
||||
anims.PLAYER_POINT_AWAY,
|
||||
anims.PLAYER_POINT_DOWN,
|
||||
anims.PLAYER_POINT_FORWARD,
|
||||
anims.PLAYER_POINT_LEFT,
|
||||
anims.PLAYER_POINT_RIGHT,
|
||||
anims.PLAYER_POINT_TO_SELF,
|
||||
anims.PLAYER_POINT_UP,
|
||||
anims.PLAYER_POSE_PROUDLY,
|
||||
anims.PLAYER_POUND_FIST_CHEST,
|
||||
anims.PLAYER_POUND_FIST_PALM,
|
||||
anims.PLAYER_REFUSE_OFFER_AFFECTION,
|
||||
anims.PLAYER_REFUSE_OFFER_FORMAL,
|
||||
anims.PLAYER_RUB_BELLY,
|
||||
anims.PLAYER_RUB_CHIN_THOUGHTFUL,
|
||||
anims.PLAYER_SALUTE1,
|
||||
anims.PLAYER_SALUTE2,
|
||||
anims.PLAYER_SCRATCH_HEAD,
|
||||
anims.PLAYER_SEARCH,
|
||||
anims.PLAYER_SHAKE_HEAD_DISGUST,
|
||||
anims.PLAYER_SHAKE_HEAD_NO,
|
||||
anims.PLAYER_SHIVER,
|
||||
anims.PLAYER_SHRUG_HANDS,
|
||||
anims.PLAYER_SHRUG_SHOULDERS,
|
||||
anims.PLAYER_SHUSH,
|
||||
anims.PLAYER_SIGH_DEEPLY,
|
||||
anims.PLAYER_SLIT_THROAT,
|
||||
anims.PLAYER_SLOW_DOWN,
|
||||
anims.PLAYER_SLUMP_HEAD,
|
||||
anims.PLAYER_SMACK_SELF,
|
||||
anims.PLAYER_SMELL_AIR,
|
||||
anims.PLAYER_SMELL_ARMPIT,
|
||||
anims.PLAYER_SNAP_FINGER1,
|
||||
anims.PLAYER_SNAP_FINGER2,
|
||||
anims.PLAYER_SNEEZE,
|
||||
anims.PLAYER_STAMP_FEET,
|
||||
anims.PLAYER_STANDING_PLACATE,
|
||||
anims.PLAYER_STANDING_RAISE_FIST,
|
||||
anims.PLAYER_STOP,
|
||||
anims.PLAYER_TAP_HEAD,
|
||||
anims.PLAYER_TAUNT1,
|
||||
anims.PLAYER_TAUNT2,
|
||||
anims.PLAYER_TAUNT3,
|
||||
anims.PLAYER_WAVE_FINGER_WARNING,
|
||||
anims.PLAYER_WAVE_HAIL,
|
||||
anims.PLAYER_WAVE_ON_DIRECTING,
|
||||
anims.PLAYER_WAVE_ON_DISMISSING,
|
||||
anims.PLAYER_WAVE1,
|
||||
anims.PLAYER_WAVE2,
|
||||
anims.PLAYER_WEEPING,
|
||||
anims.PLAYER_WHISPER,
|
||||
anims.PLAYER_YAWN
|
||||
};
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (isPlayer(self))
|
||||
{
|
||||
debugSpeakMsg(self, "ERROR: This script must be attached to a humanoid NPC");
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
else
|
||||
{
|
||||
String skeleton = dataTableGetString("datatables/ai/species.iff", ai_lib.aiGetSpecies(self), "Skeleton");
|
||||
if (!skeleton.equals("human"))
|
||||
{
|
||||
debugSpeakMsg(self, "ERROR: This script must be attached to a humanoid NPC");
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
}
|
||||
setName(self, "Animation Tester");
|
||||
ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL);
|
||||
setInvulnerable(self, true);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException
|
||||
{
|
||||
if (isPlayer(self))
|
||||
{
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
else
|
||||
{
|
||||
String skeleton = dataTableGetString("datatables/ai/species.iff", ai_lib.aiGetSpecies(self), "Skeleton");
|
||||
if (!skeleton.equals("human"))
|
||||
{
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
}
|
||||
if (isIdValid(player))
|
||||
{
|
||||
if (utils.hasScriptVar(player, "anim_test.testing"))
|
||||
{
|
||||
int old_pid = utils.getIntScriptVar(player, "anim_test.testing");
|
||||
forceCloseSUIPage(old_pid);
|
||||
utils.removeScriptVar(player, "anim_test.testing");
|
||||
}
|
||||
}
|
||||
String title = "Animation Testing Menu";
|
||||
String prompt = "The following is a list of standing idle animations that can be performed by humanoid NPCs in a script.\n\n";
|
||||
prompt += "To have an NPC perform an animation, use this function:\n";
|
||||
prompt += "doAnimationAction(obj_id npc, string animation);\n\n";
|
||||
prompt += "Please choose an animation to test:";
|
||||
int pid = sui.listbox(self, player, prompt, sui.OK_CANCEL, title, ANIMATIONS_ALL, "animationAll", true, false);
|
||||
debugSpeakMsg(self, "PID is " + pid);
|
||||
if (pid > -1)
|
||||
{
|
||||
utils.setScriptVar(player, "anim_test.testing", pid);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int animationAll(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
if (params == null || params.isEmpty())
|
||||
{
|
||||
debugSpeakMsg(self, "<DEBUG> Message passed with no parameters");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
int idx = sui.getListboxSelectedRow(params);
|
||||
int btn = sui.getIntButtonPressed(params);
|
||||
obj_id player = sui.getPlayerId(params);
|
||||
if ((btn == sui.BP_CANCEL) || (btn == sui.BP_OK && idx < 0))
|
||||
{
|
||||
if (isIdValid(player))
|
||||
{
|
||||
if (utils.hasScriptVar(player, "anim_test.testing"))
|
||||
{
|
||||
utils.removeScriptVar(player, "anim_test.testing");
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
String title = "Animation Testing Menu";
|
||||
String prompt = "Now playing: " + ANIMATIONS_ALL[idx] + "\n\n";
|
||||
prompt += "To have an NPC perform this animation, use the function:\n";
|
||||
prompt += "doAnimationAction(npc, \"" + ANIMATIONS_ALL[idx] + "\");\n\n";
|
||||
prompt += "Please choose an animation to test:";
|
||||
int pid = sui.listbox(self, player, prompt, sui.OK_CANCEL, title, ANIMATIONS_ALL, "animationAll", true, false);
|
||||
debugSpeakMsg(self, "PID is " + pid);
|
||||
if (pid > -1)
|
||||
{
|
||||
utils.setScriptVar(player, "anim_test.testing", pid);
|
||||
}
|
||||
doAnimationAction(self, ANIMATIONS_ALL[idx]);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,454 +0,0 @@
|
||||
package script.working.asommers;
|
||||
|
||||
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.sui;
|
||||
import script.library.create;
|
||||
import script.library.ship_ai;
|
||||
import script.library.utils;
|
||||
|
||||
public class debug extends script.base_script
|
||||
{
|
||||
public debug()
|
||||
{
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
location playerLocation = getLocation(self);
|
||||
if (text.equals("newbieZoomCamera"))
|
||||
{
|
||||
boolean result = newbieTutorialRequest(self, "zoomCamera");
|
||||
if (result)
|
||||
{
|
||||
debugSpeakMsg(self, "success");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "fail");
|
||||
}
|
||||
}
|
||||
if (text.equals("newbieOpenInventory"))
|
||||
{
|
||||
boolean result = newbieTutorialRequest(self, "openInventory");
|
||||
if (result)
|
||||
{
|
||||
debugSpeakMsg(self, "success");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "fail");
|
||||
}
|
||||
}
|
||||
if (text.equals("newbieCloseInventory"))
|
||||
{
|
||||
boolean result = newbieTutorialRequest(self, "closeInventory");
|
||||
if (result)
|
||||
{
|
||||
debugSpeakMsg(self, "success");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "fail");
|
||||
}
|
||||
}
|
||||
if (text.equals("newbieOpenCharacterSheet"))
|
||||
{
|
||||
boolean result = newbieTutorialRequest(self, "openCharacterSheet");
|
||||
if (result)
|
||||
{
|
||||
debugSpeakMsg(self, "success");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "fail");
|
||||
}
|
||||
}
|
||||
if (text.equals("newbieCloseCharacterSheet"))
|
||||
{
|
||||
boolean result = newbieTutorialRequest(self, "closeCharacterSheet");
|
||||
if (result)
|
||||
{
|
||||
debugSpeakMsg(self, "success");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "fail");
|
||||
}
|
||||
}
|
||||
if (text.equals("newbieChangeMouseMode"))
|
||||
{
|
||||
boolean result = newbieTutorialRequest(self, "changeMouseMode");
|
||||
if (result)
|
||||
{
|
||||
debugSpeakMsg(self, "success");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "fail");
|
||||
}
|
||||
}
|
||||
if (text.equals("newbieEquipToolbar"))
|
||||
{
|
||||
boolean result = newbieTutorialRequest(self, "equipToolbar");
|
||||
if (result)
|
||||
{
|
||||
debugSpeakMsg(self, "success");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "fail");
|
||||
}
|
||||
}
|
||||
if (text.equals("newbieEnableRadar"))
|
||||
{
|
||||
boolean result = newbieTutorialEnableHudElement(self, "radar", true, 5);
|
||||
if (result)
|
||||
{
|
||||
debugSpeakMsg(self, "success");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "fail");
|
||||
}
|
||||
}
|
||||
if (text.equals("newbieDisableRadar"))
|
||||
{
|
||||
boolean result = newbieTutorialEnableHudElement(self, "radar", false, 0);
|
||||
if (result)
|
||||
{
|
||||
debugSpeakMsg(self, "success");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "fail");
|
||||
}
|
||||
}
|
||||
if (text.equals("suitest"))
|
||||
{
|
||||
int temp = sui.msgbox(self, text);
|
||||
}
|
||||
if (text.equals("warptest"))
|
||||
{
|
||||
warpPlayer(self, playerLocation.area, playerLocation.x, playerLocation.y, playerLocation.z + 100, null, 0, 0, 0);
|
||||
}
|
||||
if (text.equals("weather0"))
|
||||
{
|
||||
boolean set = setWeatherData(0, 1.0f, 0.0f);
|
||||
if (set)
|
||||
{
|
||||
debugSpeakMsg(self, text + "set");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, text + "not set");
|
||||
}
|
||||
}
|
||||
if (text.equals("weather1"))
|
||||
{
|
||||
boolean set = setWeatherData(1, 0.0f, 1.0f);
|
||||
if (set)
|
||||
{
|
||||
debugSpeakMsg(self, text + "set");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, text + "not set");
|
||||
}
|
||||
}
|
||||
if (text.equals("weather2"))
|
||||
{
|
||||
boolean set = setWeatherData(2, -1.0f, 0.0f);
|
||||
if (set)
|
||||
{
|
||||
debugSpeakMsg(self, text + "set");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, text + "not set");
|
||||
}
|
||||
}
|
||||
if (text.equals("weather3"))
|
||||
{
|
||||
boolean set = setWeatherData(3, 0.0f, -1.0f);
|
||||
if (set)
|
||||
{
|
||||
debugSpeakMsg(self, text + "set");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, text + "not set");
|
||||
}
|
||||
}
|
||||
if (text.equals("addTravelPoints"))
|
||||
{
|
||||
String planet = getCurrentSceneName();
|
||||
location location = getLocation(self);
|
||||
location.x -= 50;
|
||||
obj_id object1 = createObject("object/installation/mining_ore/mining_ore_harvester_style_2.iff", location);
|
||||
boolean result = addPlanetTravelPoint(planet, "point 1", location, 100, true, TPT_PC_Shuttleport);
|
||||
if (result)
|
||||
{
|
||||
debugSpeakMsg(self, "addPlanetTravelPoint point1 succeeded");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "addPlanetTravelPoint point1 failed");
|
||||
}
|
||||
location.x += 100;
|
||||
obj_id object2 = createObject("object/installation/mining_ore/mining_ore_harvester_style_2.iff", location);
|
||||
result = addPlanetTravelPoint(planet, "point2", location, 50, true, TPT_PC_Shuttleport);
|
||||
if (result)
|
||||
{
|
||||
debugSpeakMsg(self, "addPlanetTravelPoint point2 succeeded");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "addPlanetTravelPoint point2 failed");
|
||||
}
|
||||
}
|
||||
if (text.equals("purchaseTicket1"))
|
||||
{
|
||||
String planet = getCurrentSceneName();
|
||||
boolean result = enterClientTicketPurchaseMode(self, planet, "point 1", false);
|
||||
if (result)
|
||||
{
|
||||
debugSpeakMsg(self, "enterClientTicketPurchaseMode succeeded");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "enterClientTicketPurchaseMode failed");
|
||||
}
|
||||
}
|
||||
if (text.equals("purchaseTicket2"))
|
||||
{
|
||||
String planet = getCurrentSceneName();
|
||||
boolean result = enterClientTicketPurchaseMode(self, planet, "point2", false);
|
||||
if (result)
|
||||
{
|
||||
debugSpeakMsg(self, "enterClientTicketPurchaseMode succeeded");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "enterClientTicketPurchaseMode failed");
|
||||
}
|
||||
}
|
||||
if (text.equals("place"))
|
||||
{
|
||||
boolean placed = enterClientStructurePlacementMode(self, self, "object/installation/mining_ore/mining_ore_harvester_style_2.iff");
|
||||
if (!placed)
|
||||
{
|
||||
debugSpeakMsg(self, "OnSpeaking: enterClientStructurePlacementMode failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "OnSpeaking: enterClientStructurePlacementMode succeeded");
|
||||
}
|
||||
}
|
||||
if (text.equals("poiTest"))
|
||||
{
|
||||
debugSpeakMsg(self, "Making lair at your location");
|
||||
location locHome = getLocation(self);
|
||||
String strLairDifficulty = create.getLairDifficulty(4, 40, 20);
|
||||
obj_id objLair = createObject("object/tangible/lair/npc_lair.iff", locHome);
|
||||
setObjVar(objLair, "spawning.intDifficultyLevel", 20);
|
||||
setObjVar(objLair, "spawning.lairDifficulty", strLairDifficulty);
|
||||
setObjVar(objLair, "spawning.lairType", "evil_tatooine_village");
|
||||
messageTo(objLair, "handle_Spawn_Setup_Complete", null, 0, false);
|
||||
}
|
||||
if (text.equals("heightTest"))
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
location position = utils.getRandomLocationInRing(playerLocation, 1, 20);
|
||||
float height = getHeightAtLocation(position.x, position.z);
|
||||
debugSpeakMsg(self, "height = " + height);
|
||||
}
|
||||
}
|
||||
if (text.equals("zeroLots"))
|
||||
{
|
||||
adjustLotCount(self, -getAccountNumLots(self));
|
||||
}
|
||||
if (text.equals("requestLocation"))
|
||||
{
|
||||
if (requestLocation(self, "locationId", playerLocation, 200, 32, true, true))
|
||||
{
|
||||
debugSpeakMsg(self, "requestLocation succeeded");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "requestLocation failed");
|
||||
}
|
||||
}
|
||||
if (text.equals("enemy_xwing"))
|
||||
{
|
||||
obj_id ship = createObject("object/ship/xwing.iff", playerLocation);
|
||||
ship_ai.unitAddDamageTaken(ship, self, 10000.0f);
|
||||
}
|
||||
if (text.equals("enemy_tiefighter"))
|
||||
{
|
||||
obj_id ship = createObject("object/ship/tiefighter.iff", playerLocation);
|
||||
ship_ai.unitAddDamageTaken(ship, self, 10000.0f);
|
||||
}
|
||||
if (text.equals("deleteObject"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null && target != obj_id.NULL_ID)
|
||||
{
|
||||
destroyObject(target);
|
||||
debugSpeakMsg(self, "destroyObject " + target + " succeeded");
|
||||
}
|
||||
}
|
||||
if (text.equals("createTestObjects"))
|
||||
{
|
||||
for (int i = -3; i < 3; ++i)
|
||||
{
|
||||
for (int j = -3; j < 3; ++j)
|
||||
{
|
||||
location location = getLocation(self);
|
||||
location.x -= 5 * i;
|
||||
location.z -= 5 * j;
|
||||
obj_id object = createObject("object/tangible/furniture/space/frn_chair_falcon_passenger_s01.iff", location);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (text.equals("addMissionCriticalObject"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null && target != obj_id.NULL_ID)
|
||||
{
|
||||
if (addMissionCriticalObject(self, target))
|
||||
{
|
||||
debugSpeakMsg(self, "addMissionCriticalObject" + target + " succeeded");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "no target");
|
||||
}
|
||||
}
|
||||
if (text.equals("removeMissionCriticalObject"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null && target != obj_id.NULL_ID)
|
||||
{
|
||||
if (removeMissionCriticalObject(self, target))
|
||||
{
|
||||
debugSpeakMsg(self, "removeMissionCriticalObject" + target + " succeeded");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "no target");
|
||||
}
|
||||
}
|
||||
if (text.equals("isMissionCriticalObject"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null && target != obj_id.NULL_ID)
|
||||
{
|
||||
if (isMissionCriticalObject(self, target))
|
||||
{
|
||||
debugSpeakMsg(self, "isMissionCriticalObject" + target + " yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "isMissionCriticalObject" + target + " no");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (text.equals("clearMissionCriticalObjects"))
|
||||
{
|
||||
if (clearMissionCriticalObjects(self))
|
||||
{
|
||||
debugSpeakMsg(self, "clearMissionCriticalObjects succeeded");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "clearMissionCriticalObjects failed");
|
||||
}
|
||||
}
|
||||
if (text.equals("conditionTest1"))
|
||||
{
|
||||
obj_id object = createObject("object/tangible/ship/interior_components/alarm_interior.iff", playerLocation);
|
||||
}
|
||||
if (text.equals("conditionTest2"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null && target != obj_id.NULL_ID)
|
||||
{
|
||||
setCondition(target, CONDITION_ON);
|
||||
}
|
||||
}
|
||||
if (text.equals("getConditionOnOff"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null && target != obj_id.NULL_ID)
|
||||
{
|
||||
if (hasCondition(target, CONDITION_ON))
|
||||
{
|
||||
debugSpeakMsg(target, "on");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(target, "off");
|
||||
}
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnPlaceStructure(obj_id self, obj_id player, obj_id deed, location position, int rotation) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "OnPlaceStructure: entered");
|
||||
obj_id structure = createObject("object/installation/mining_ore/mining_ore_harvester_style_2.iff", position);
|
||||
if (structure == null || structure == obj_id.NULL_ID)
|
||||
{
|
||||
debugSpeakMsg(self, "OnPlaceStructure: createObject failed");
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
setYaw(structure, (float)(90 * rotation));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnPurchaseTicket(obj_id self, obj_id player, String departPlanetName, String departTravelPointName, String arrivePlanetName, String arriveTravelPointName, boolean roundTrip) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "OnPurchaseTicket: entered");
|
||||
debugSpeakMsg(self, departPlanetName);
|
||||
debugSpeakMsg(self, departTravelPointName);
|
||||
debugSpeakMsg(self, arrivePlanetName);
|
||||
debugSpeakMsg(self, arriveTravelPointName);
|
||||
debugSpeakMsg(self, roundTrip ? "roundtrip" : "not roundtrip");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnNewbieTutorialResponse(obj_id self, String response) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "Newbie tutorial: " + response);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnLocationReceived(obj_id self, String locationId, obj_id locationObject, location locationLocation, float locationRadius) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "OnLocationReceived: " + locationId);
|
||||
if (locationObject == null || locationObject == obj_id.NULL_ID)
|
||||
{
|
||||
debugSpeakMsg(self, "OnLocationReceived: could not find a valid location");
|
||||
}
|
||||
else
|
||||
{
|
||||
obj_id object = createObject("object/installation/mining_ore/mining_ore_harvester_style_2.iff", locationLocation);
|
||||
if (object == null || object == obj_id.NULL_ID)
|
||||
{
|
||||
debugSpeakMsg(self, "OnLocationReceived: createObject failed");
|
||||
}
|
||||
if (!destroyObject(locationObject))
|
||||
{
|
||||
debugSpeakMsg(self, "OnLocationReceived: failed to destroy locationObject");
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package script.working.asommers;
|
||||
|
||||
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 transport extends script.base_script
|
||||
{
|
||||
public transport()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
detachScript(self, "ai.ai");
|
||||
detachScript(self, "ai.creature_combat");
|
||||
detachScript(self, "skeleton.humanoid");
|
||||
detachScript(self, "systems.combat.combat_actions");
|
||||
detachScript(self, "systems.combat.credit_for_kills");
|
||||
stop(self);
|
||||
setName(self, "Hutt Cargo Transport");
|
||||
setPosture(self, POSTURE_UPRIGHT);
|
||||
queueCommand(self, (-1465754503), self, "", COMMAND_PRIORITY_FRONT);
|
||||
messageTo(self, "changePosture", null, 60, true);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int changePosture(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
setPosture(self, POSTURE_PRONE);
|
||||
queueCommand(self, (-1114832209), self, "", COMMAND_PRIORITY_FRONT);
|
||||
messageTo(self, "changePostureAgain", null, 30, true);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int changePostureAgain(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
setPosture(self, POSTURE_UPRIGHT);
|
||||
queueCommand(self, (-1465754503), self, "", COMMAND_PRIORITY_FRONT);
|
||||
messageTo(self, "changePosture", null, 60, true);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,291 +0,0 @@
|
||||
package script.working;
|
||||
|
||||
import script.*;
|
||||
import script.base_class.*;
|
||||
import script.combat_engine.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import script.base_script;
|
||||
|
||||
import script.library.ai_lib;
|
||||
import script.library.battlefield;
|
||||
import script.library.bio_engineer;
|
||||
import script.library.buff;
|
||||
import script.library.create;
|
||||
import script.library.dot;
|
||||
import script.library.features;
|
||||
import script.library.hq;
|
||||
import script.library.locations;
|
||||
import script.library.mustafar;
|
||||
import script.library.pclib;
|
||||
import script.library.pet_lib;
|
||||
import script.library.prose;
|
||||
import script.library.player_structure;
|
||||
import script.library.regions;
|
||||
import script.library.skill;
|
||||
import script.library.utils;
|
||||
import script.library.space_crafting;
|
||||
import script.library.space_transition;
|
||||
import script.library.weapons;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class balancetest extends script.base_script
|
||||
{
|
||||
public balancetest()
|
||||
{
|
||||
}
|
||||
public static final String CREATURE_TABLE = "datatables/mob/creatures.iff";
|
||||
public static final String STAT_BALANCE_TABLE = "datatables/mob/stat_balance.iff";
|
||||
public static final boolean CONST_FLAG_DO_LOGGING = true;
|
||||
public int checkDifficulty(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
int intRawDifficulty = getLevel(self);
|
||||
sendSystemMessageTestingOnly(self, "getLevel returned " + intRawDifficulty);
|
||||
if (intRawDifficulty == 0)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "you lost your difficulty!");
|
||||
deltadictionary dctScriptVars = self.getScriptVars();
|
||||
sendSystemMessageTestingOnly(self, "Scriptvars are " + dctScriptVars.toString());
|
||||
}
|
||||
messageTo(self, "checkDifficulty", null, 3, false);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void debugLogging(String section, String message) throws InterruptedException
|
||||
{
|
||||
if (CONST_FLAG_DO_LOGGING)
|
||||
{
|
||||
LOG("working/balancetest/" + section, message);
|
||||
}
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException
|
||||
{
|
||||
debugLogging("//// OnHearSpeech: ", "////>>>> Enter");
|
||||
if (objSpeaker != self)
|
||||
{
|
||||
debugLogging("//// OnHearSpeech: ", "////>>>> 1");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (strText.indexOf("b ") < 0)
|
||||
{
|
||||
debugLogging("//// OnHearSpeech: ", "////>>>> 2 - index is: " + strText.indexOf("b "));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
StringTokenizer st = new StringTokenizer(strText);
|
||||
int numArgs = st.countTokens();
|
||||
String actionUnlock = st.nextToken();
|
||||
String actionName = st.nextToken();
|
||||
if (actionName.equals("help"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "REMINDER: key phrases for balancetest are: or 'b wipe' or 'b spawn <creatureName>' or 'b newlevel <level>'");
|
||||
sendSystemMessageTestingOnly(self, " 'b clev <creature level>' or 'b wdam <mindamage> <maxdamage>' (can enter just one damage value to set both same)' ");
|
||||
sendSystemMessageTestingOnly(self, " 'b newlevel <newlevel> will mod all current and following creatures. A <newlevel> value of 0 will remove a stored level delta variable ");
|
||||
}
|
||||
else if (actionName.equals("clev"))
|
||||
{
|
||||
debugLogging("//// OnHearSpeech: ", "////>>>> 3");
|
||||
if (numArgs < 3)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "You've got to have at least TWO arguments to spawn a creature 'b clev <creature level> ");
|
||||
debugLogging("//// OnHearSpeech: ", "////>>>> 4");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
String levelStr = st.nextToken();
|
||||
int level = utils.stringToInt(levelStr);
|
||||
sendSystemMessageTestingOnly(self, "creature level selected: " + level);
|
||||
dictionary creatureDict = null;
|
||||
Vector validCreatureNames = new Vector();
|
||||
validCreatureNames.setSize(0);
|
||||
int[] creatureTabLevels = dataTableGetIntColumn(CREATURE_TABLE, "BaseLevel");
|
||||
for (int i = 0; i < creatureTabLevels.length; i++)
|
||||
{
|
||||
if (creatureTabLevels[i] == level)
|
||||
{
|
||||
creatureDict = dataTableGetRow(CREATURE_TABLE, i);
|
||||
float aggressiveness = creatureDict.getFloat("aggressive");
|
||||
String creatureName = creatureDict.getString("creatureName");
|
||||
debugLogging("//// OnHearSpeech: ", "////>>>> Checking a creature: " + creatureName + " its aggressiveness is: " + aggressiveness);
|
||||
if (aggressiveness > 0.0)
|
||||
{
|
||||
utils.addElement(validCreatureNames, creatureName);
|
||||
}
|
||||
}
|
||||
}
|
||||
debugLogging("//// OnHearSpeech: ", "////>>>> TOTAL MATCHES FOUND IS: " + validCreatureNames.size());
|
||||
if (validCreatureNames.size() > 0)
|
||||
{
|
||||
debugLogging("//// OnHearSpeech: ", "////>>>> 7");
|
||||
int matchNumber = 1;
|
||||
if (validCreatureNames.size() > 1)
|
||||
{
|
||||
matchNumber = rand(1, validCreatureNames.size());
|
||||
}
|
||||
creatureDict = dataTableGetRow(CREATURE_TABLE, ((String)validCreatureNames.get(matchNumber - 1)));
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "no matches in creatures.tab found for level: " + level);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (creatureDict == null)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "no creatures found at level: " + level);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "creature selected for spawn is: " + creatureDict.getString("creatureName"));
|
||||
}
|
||||
String creatureName = creatureDict.getString("creatureName");
|
||||
utils.setScriptVar(self, "clev_creature", creatureName);
|
||||
utils.setScriptVar(self, "clev_creature_level", level);
|
||||
}
|
||||
else if (actionName.equals("spawn"))
|
||||
{
|
||||
debugLogging("//// OnHearSpeech: ", "////>>>> 8");
|
||||
if (!utils.hasScriptVar(self, "clev_creature"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "no you haven't selected a creature to spawn");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
int creaturelevel = utils.getIntScriptVar(self, "clev_creature_level");
|
||||
String creatureName = utils.getStringScriptVar(self, "clev_creature");
|
||||
sendSystemMessageTestingOnly(self, "we're going to try to spawn the level " + creaturelevel + " creature, the " + creatureName);
|
||||
int newCreatureLevel = 0;
|
||||
if (utils.hasScriptVar(self, "newCreatureLevel"))
|
||||
{
|
||||
newCreatureLevel = utils.getIntScriptVar(self, "newCreatureLevel");
|
||||
sendSystemMessageTestingOnly(self, " and going to re-level the creature to be " + newCreatureLevel);
|
||||
}
|
||||
int numCreatures = 1;
|
||||
if (numArgs == 3)
|
||||
{
|
||||
String numberOfCreaturesStr = st.nextToken();
|
||||
int numberOfCreatures = utils.stringToInt(numberOfCreaturesStr);
|
||||
if (numberOfCreatures == 9)
|
||||
{
|
||||
numCreatures = rand(1, 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
numCreatures = numberOfCreatures;
|
||||
}
|
||||
}
|
||||
obj_id[] spawnedCreatures = new obj_id[numCreatures];
|
||||
location here = getLocation(self);
|
||||
for (int i = 0; i < numCreatures; i++)
|
||||
{
|
||||
location spawnLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 4f, 4f);
|
||||
if (spawnLoc == null)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, " spawnLoc was NULL ");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id mob = create.createCreature(creatureName, spawnLoc, creaturelevel, true, false);
|
||||
if (!isIdValid(mob))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "invalid objid on the creature we just tried to spawn. OH NO!");
|
||||
}
|
||||
else
|
||||
{
|
||||
spawnedCreatures[i] = mob;
|
||||
if (newCreatureLevel > 0)
|
||||
{
|
||||
reLevelMob(mob, newCreatureLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (spawnedCreatures != null)
|
||||
{
|
||||
utils.setScriptVar(self, "spawnedCreatures", spawnedCreatures);
|
||||
}
|
||||
}
|
||||
else if (actionName.equals("wdam"))
|
||||
{
|
||||
debugLogging("//// OnHearSpeech: ", "////>>>> 9");
|
||||
String damageStr = st.nextToken();
|
||||
int damageValue = utils.stringToInt(damageStr);
|
||||
obj_id weapon = getCurrentWeapon(self);
|
||||
if (!isIdValid(weapon))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "bad weapon - objId was: " + weapon);
|
||||
}
|
||||
if (getWeaponType(weapon) != WEAPON_TYPE_UNARMED)
|
||||
{
|
||||
setWeaponMinDamage(weapon, damageValue);
|
||||
setWeaponMaxDamage(weapon, damageValue);
|
||||
weapons.setWeaponData(weapon);
|
||||
}
|
||||
}
|
||||
else if (actionName.equals("newlevel"))
|
||||
{
|
||||
debugLogging("//// OnHearSpeech: ", "////>>>> 10");
|
||||
String reLevelStr = st.nextToken();
|
||||
int newLevel = utils.stringToInt(reLevelStr);
|
||||
if (newLevel == 0)
|
||||
{
|
||||
if (utils.hasScriptVar(self, "newCreatureLevel"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Removed existing creature level delta value");
|
||||
utils.removeScriptVar(self, "newCreatureLevel");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (utils.setScriptVar(self, "newCreatureLevel", newLevel))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "All creatures spawned will now be set to level " + newLevel);
|
||||
}
|
||||
}
|
||||
if (utils.hasScriptVar(self, "spawnedCreatures"))
|
||||
{
|
||||
obj_id[] mobsToRelevel = utils.getObjIdArrayScriptVar(self, "spawnedCreatures");
|
||||
int reLeveledMobCounter = 0;
|
||||
for (int i = 0; i < mobsToRelevel.length; i++)
|
||||
{
|
||||
if (isIdValid(mobsToRelevel[i]) && !ai_lib.aiIsDead(mobsToRelevel[i]))
|
||||
{
|
||||
reLevelMob(mobsToRelevel[i], newLevel);
|
||||
reLeveledMobCounter++;
|
||||
}
|
||||
}
|
||||
if (reLeveledMobCounter > 0)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "A total of " + reLeveledMobCounter + " creatures were re-set to be level " + newLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (actionName.equals("wipe"))
|
||||
{
|
||||
debugLogging("//// OnHearSpeech: ", "////>>>> 11");
|
||||
if (!utils.hasScriptVar(self, "spawnedCreatures"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "No apparent creature to destroy. Couldn't find obj_id scripvar. OH NO!");
|
||||
}
|
||||
else
|
||||
{
|
||||
obj_id[] mobsToDestroy = utils.getObjIdArrayScriptVar(self, "spawnedCreatures");
|
||||
for (int i = 0; i < mobsToDestroy.length; i++)
|
||||
{
|
||||
if (isIdValid(mobsToDestroy[i]))
|
||||
{
|
||||
destroyObject(mobsToDestroy[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "valid trigger phrases for balancetest script are: 'wdam #' for weapon damage value and 'clev #' for creature level.");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void reLevelMob(obj_id mob, int level) throws InterruptedException
|
||||
{
|
||||
obj_id self = getSelf();
|
||||
String creatureName = utils.getStringScriptVar(self, "clev_creature");
|
||||
dictionary creatureDict = utils.dataTableGetRow(CREATURE_TABLE, creatureName);
|
||||
create.initializeCreature(mob, creatureName, creatureDict, level);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package script.working.breinhart;
|
||||
|
||||
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.space_quest;
|
||||
|
||||
public class missiontest extends script.base_script
|
||||
{
|
||||
public missiontest()
|
||||
{
|
||||
}
|
||||
public static final String mission_type = "patrol";
|
||||
public static final String mission_name = "npe_easy_main_1";
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
location playerLocation = getLocation(self);
|
||||
if (text.equals("assignquest"))
|
||||
{
|
||||
boolean grant = space_quest.grantQuest(self, mission_type, mission_name);
|
||||
}
|
||||
else if (text.equals("winquest"))
|
||||
{
|
||||
obj_id mobj = space_quest._getQuest(self, mission_type, mission_name);
|
||||
space_quest.setQuestWon(self, mobj);
|
||||
}
|
||||
else if (text.equals("failquest"))
|
||||
{
|
||||
obj_id mobj = space_quest._getQuest(self, mission_type, mission_name);
|
||||
space_quest.setQuestFailed(self, mobj);
|
||||
}
|
||||
else if (text.equals("abortquest"))
|
||||
{
|
||||
obj_id mobj = space_quest._getQuest(self, mission_type, mission_name);
|
||||
space_quest.setQuestAborted(self, mobj);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
package script.working.breinhart;
|
||||
|
||||
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.utils;
|
||||
import script.library.ai_lib;
|
||||
import script.library.xp;
|
||||
import script.library.factions;
|
||||
import script.library.dot;
|
||||
import script.library.city;
|
||||
import script.library.loot;
|
||||
import script.library.player_structure;
|
||||
import script.library.player_stomach;
|
||||
import script.library.space_quest;
|
||||
import script.library.space_create;
|
||||
import script.library.movement;
|
||||
|
||||
public class speaktest extends script.base_script
|
||||
{
|
||||
public speaktest()
|
||||
{
|
||||
}
|
||||
public double randBell(double avg, double var) throws InterruptedException
|
||||
{
|
||||
var = var / 2;
|
||||
double r, v1, v2;
|
||||
do
|
||||
{
|
||||
v1 = 2.0 * rand() - 1.0;
|
||||
v2 = 2.0 * rand() - 1.0;
|
||||
r = v1 * v1 + v2 * v2;
|
||||
} while (r >= 1.0 || r == 0.0);
|
||||
double fac = Math.sqrt(-2.0 * Math.log(r) / r);
|
||||
double value = (avg + (v1 * fac) * (avg * var));
|
||||
if (value < 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
location playerLocation = getLocation(self);
|
||||
if (text.equals("meganuke"))
|
||||
{
|
||||
obj_id[] objects = getObjectsInRange(playerLocation, 250.0f);
|
||||
for (int i = 0; i < objects.length; i++)
|
||||
{
|
||||
if (!isPlayer(objects[i]))
|
||||
{
|
||||
LOG("LOG_CHANNEL", "object deleted ->" + objects[i]);
|
||||
destroyObject(objects[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (text.equals("test"))
|
||||
{
|
||||
obj_id t = getLookAtTarget(self);
|
||||
setCraftedId(t, self);
|
||||
}
|
||||
else if (text.equals("blindme"))
|
||||
{
|
||||
setState(self, STATE_BLINDED, true);
|
||||
setObjVar(self, "combat.intEffects.13", 1);
|
||||
}
|
||||
else if (text.equals("poisonme"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "poisoning");
|
||||
dot.applyDotEffect(self, self, "poison", "poison1", HEALTH, -1, 5, 60, true, null);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package script.working;
|
||||
|
||||
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 cannot_die extends script.base_script
|
||||
{
|
||||
public cannot_die()
|
||||
{
|
||||
}
|
||||
public int OnCreatureDamaged(obj_id self, obj_id attacker, obj_id weapon, int[] damage) throws InterruptedException
|
||||
{
|
||||
setAttrib(self, HEALTH, 100);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnObjectDamaged(obj_id self, obj_id attacker, obj_id weapon, int damage) throws InterruptedException
|
||||
{
|
||||
setHitpoints(self, 100);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException
|
||||
{
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package script.working;
|
||||
|
||||
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 cincotest extends script.base_script
|
||||
{
|
||||
public cincotest()
|
||||
{
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException
|
||||
{
|
||||
if (objSpeaker != self)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (strText.equals("setupTerminal"))
|
||||
{
|
||||
obj_id objTarget = getLookAtTarget(self);
|
||||
if (isIdValid(objTarget))
|
||||
{
|
||||
location locTest = new location();
|
||||
locTest.area = "space_tatooine";
|
||||
setObjVar(objTarget, "space.destination", locTest);
|
||||
sendSystemMessageTestingOnly(self, "Set the coordinates to your thang!");
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package script.working.cmayer;
|
||||
|
||||
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 bottom extends script.base_script
|
||||
{
|
||||
public bottom()
|
||||
{
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("test"))
|
||||
{
|
||||
obj_id building = getTopMostContainer(self);
|
||||
moveHouseItemToPlayer(building, self, 0);
|
||||
}
|
||||
else if (text.equals("test2"))
|
||||
{
|
||||
obj_id building = getTopMostContainer(self);
|
||||
deleteAllHouseItems(building, self);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnReceivedItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException
|
||||
{
|
||||
if (isPlayer(item))
|
||||
{
|
||||
debugServerConsoleMsg(self, "Got player");
|
||||
sendSystemMessageTestingOnly(item, "Building got player");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package script.working.cmayer;
|
||||
|
||||
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.ai.ai_combat;
|
||||
import script.library.create;
|
||||
|
||||
public class buildingtest extends script.base_script
|
||||
{
|
||||
public buildingtest()
|
||||
{
|
||||
}
|
||||
public int OnInitialize(obj_id self) throws InterruptedException
|
||||
{
|
||||
createTriggerVolume("guards", 20f, true);
|
||||
obj_id room = getCellId(self, "mainhall");
|
||||
location termLoc = new location(0.1f, .13f, -5.46f, "tatooine", room);
|
||||
obj_id destructor = createObject("object/tangible/furniture/imperial/data_terminal_s1.iff", termLoc);
|
||||
setObjVar(self, "DESTRUCTOR", destructor);
|
||||
setObjVar(destructor, "bldg", self);
|
||||
attachScript(destructor, "theme_park.bldg_destroy");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
createTriggerVolume("guards", 20f, true);
|
||||
obj_id room = getCellId(self, "mainhall");
|
||||
location termLoc = new location(0.1f, .13f, -5.46f, "tatooine", room);
|
||||
obj_id destructor = createObject("object/tangible/furniture/imperial/data_terminal_s1.iff", termLoc);
|
||||
setObjVar(self, "DESTRUCTOR", destructor);
|
||||
setObjVar(destructor, "bldg", self);
|
||||
attachScript(destructor, "theme_park.bldg_destroy");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id breacher) throws InterruptedException
|
||||
{
|
||||
if (!isPlayer(breacher))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (volumeName.equals("guards"))
|
||||
{
|
||||
obj_id g1 = getObjIdObjVar(self, "guard1");
|
||||
obj_id g2 = getObjIdObjVar(self, "guard2");
|
||||
obj_id g3 = getObjIdObjVar(self, "guard3");
|
||||
obj_id g4 = getObjIdObjVar(self, "guard4");
|
||||
startCombat(g1, breacher);
|
||||
startCombat(g2, breacher);
|
||||
startCombat(g3, breacher);
|
||||
startCombat(g4, breacher);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int spawnTerminal(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
obj_id room = getCellId(self, "mainhall");
|
||||
location termLoc = new location(0.1f, .13f, -5.46f, "tatooine", room);
|
||||
obj_id destructor = createObject("object/tangible/furniture/imperial/data_terminal_s1.iff", termLoc);
|
||||
setObjVar(self, "DESTRUCTOR", destructor);
|
||||
setObjVar(destructor, "bldg", self);
|
||||
attachScript(destructor, "theme_park.bldg_destroy");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package script.working.cmayer;
|
||||
|
||||
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 containertest extends script.base_script
|
||||
{
|
||||
public containertest()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("test"))
|
||||
{
|
||||
obj_id groupObject = getGroupObject(self);
|
||||
if (isIdValid(groupObject))
|
||||
{
|
||||
int groupSize = getGroupSize(groupObject);
|
||||
int pcSize = getPCGroupSize(groupObject);
|
||||
LOG("GroupTest", "Size: " + groupSize + " PCSIze: " + pcSize);
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("list"))
|
||||
{
|
||||
obj_id[] contents = getContents(self);
|
||||
for (int i = 0; i < contents.length; ++i)
|
||||
{
|
||||
debugConsoleMsg(speaker, "I have " + contents[i]);
|
||||
}
|
||||
}
|
||||
else if (text.equals("yaw"))
|
||||
{
|
||||
float f = rand(0.0f, 270.0f);
|
||||
debugConsoleMsg(speaker, "Rotating object " + f);
|
||||
setYaw(self, f);
|
||||
}
|
||||
else if (text.equals("createyaw"))
|
||||
{
|
||||
float f = rand(0.0f, 270.0f);
|
||||
debugConsoleMsg(speaker, "Rotating object " + f);
|
||||
obj_id obj = createObject("object/building/player/player_house_tatooine_small_style_01.iff", getLocation(speaker));
|
||||
persistObject(obj);
|
||||
setYaw(obj, f);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package script.working.cmayer;
|
||||
|
||||
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 inittest extends script.base_script
|
||||
{
|
||||
public inittest()
|
||||
{
|
||||
}
|
||||
public int OnInitialize(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugServerConsoleMsg(self, ("I am initialized"));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
package script.working.cmayer;
|
||||
|
||||
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.utils;
|
||||
|
||||
public class inttest extends script.base_script
|
||||
{
|
||||
public inttest()
|
||||
{
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("test"))
|
||||
{
|
||||
debugConsoleMsg(speaker, "Yaw is " + getYaw(self));
|
||||
setYaw(self, 180);
|
||||
debugConsoleMsg(speaker, "Yaw is " + getYaw(self));
|
||||
}
|
||||
else if (text.equals("test2"))
|
||||
{
|
||||
int x = dataTableSearchColumnForInt(2, 7, "datatables/combat/combat_data.iff");
|
||||
debugConsoleMsg(speaker, "Row is " + x);
|
||||
x = dataTableSearchColumnForInt(2, 8, "datatables/combat/combat_data.iff");
|
||||
debugConsoleMsg(speaker, "Invalid Column Row is " + x);
|
||||
x = dataTableSearchColumnForInt(2, 7, "datatables/combat/combats_data.iff");
|
||||
debugConsoleMsg(speaker, "Invalid Datatable Row is " + x);
|
||||
}
|
||||
else if (text.equals("test3"))
|
||||
{
|
||||
location loc = getLocation(self);
|
||||
setObjVar(self, "test1", loc);
|
||||
setObjVar(self, "test2", loc);
|
||||
setObjVar(self, "test3", loc);
|
||||
setObjVar(self, "test4", loc);
|
||||
setObjVar(self, "test5", loc);
|
||||
setObjVar(self, "test6", loc);
|
||||
setObjVar(self, "test7", loc);
|
||||
setObjVar(self, "test8", loc);
|
||||
setObjVar(self, "test9", loc);
|
||||
setObjVar(self, "test10", loc);
|
||||
}
|
||||
else if (text.equals("test4"))
|
||||
{
|
||||
removeObjVar(self, "test1");
|
||||
removeObjVar(self, "test2");
|
||||
removeObjVar(self, "test3");
|
||||
removeObjVar(self, "test4");
|
||||
removeObjVar(self, "test5");
|
||||
removeObjVar(self, "test6");
|
||||
removeObjVar(self, "test7");
|
||||
removeObjVar(self, "test8");
|
||||
removeObjVar(self, "test9");
|
||||
removeObjVar(self, "test10");
|
||||
}
|
||||
else if (text.equals("test5"))
|
||||
{
|
||||
Vector ids = new Vector();
|
||||
ids.setSize(0);
|
||||
ids.clear();
|
||||
utils.addElement(ids, self);
|
||||
setObjVar(self, "testids", ids);
|
||||
}
|
||||
else if (text.equals("test6"))
|
||||
{
|
||||
Vector ids = getResizeableObjIdArrayObjVar(self, "testids");
|
||||
int idx = utils.getElementPositionInArray(ids, self);
|
||||
if (idx > -1)
|
||||
{
|
||||
ids = utils.removeElementAt(ids, idx);
|
||||
setObjVar(self, "testids", ids);
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("shirt"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
boolean retval = equipOverride(target, self);
|
||||
debugServerConsoleMsg(self, "Retval is " + retval);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,194 +0,0 @@
|
||||
package script.working.cmayer;
|
||||
|
||||
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.utils;
|
||||
import script.library.pclib;
|
||||
import script.library.sui;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class jedi_reset extends script.base_script
|
||||
{
|
||||
public jedi_reset()
|
||||
{
|
||||
}
|
||||
public static final String SCRIPT_NAME = "cmayer.jedi_reset";
|
||||
public static final String COMMAND = "reset_jedi";
|
||||
public static final String JEDI_TABLE = "datatables/jedi/jedi_skill_requirements.iff";
|
||||
public void resetJedi(obj_id self, obj_id target, int numSkills) throws InterruptedException
|
||||
{
|
||||
boolean result = true;
|
||||
if (result)
|
||||
{
|
||||
removeOldJediData(target);
|
||||
setNewSkillReq(target, numSkills);
|
||||
sendSystemMessageTestingOnly(self, "Jedi requirements have successfully been reset");
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Jedi requirements were not reset");
|
||||
}
|
||||
return;
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || (getGodLevel(self) < 50))
|
||||
{
|
||||
int numSkills = 8;
|
||||
if (hasObjVar(self, "numJediSkillsToReset"))
|
||||
{
|
||||
numSkills = getIntObjVar(self, "numJediSkillsToReset");
|
||||
}
|
||||
resetJedi(self, self, numSkills);
|
||||
detachScript(self, SCRIPT_NAME);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnInitialize(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self) || (getGodLevel(self) < 50))
|
||||
{
|
||||
int numSkills = 8;
|
||||
if (hasObjVar(self, "numJediSkillsToReset"))
|
||||
{
|
||||
numSkills = getIntObjVar(self, "numJediSkillsToReset");
|
||||
}
|
||||
resetJedi(self, self, numSkills);
|
||||
detachScript(self, SCRIPT_NAME);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if ((toLower(text)).startsWith(COMMAND))
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(text);
|
||||
if (st.countTokens() != 2)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Error: Syntax is \"" + COMMAND + " <number of skills>\"");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
String command = st.nextToken();
|
||||
int numSkills = utils.stringToInt(st.nextToken());
|
||||
if ((numSkills < 1) || (numSkills > 8))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Error: Number of skills must be 1-8");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target == null || !isIdValid(target) || !isPlayer(target))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Error: You must target a valid player");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (!hasObjVar(target, "jedi.enabled"))
|
||||
{
|
||||
String error = "WARNING: It appears that " + getName(target) + " ";
|
||||
error += "has not yet met the requirements to activate a force sensitive ";
|
||||
error += "slot.\n\nDo you still wish to continue resetting this player's ";
|
||||
error += "Jedi requirements?";
|
||||
showWarningSui(self, target, numSkills, error);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
resetJedi(self, target, numSkills);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void showWarningSui(obj_id self, obj_id target, int numSkills, String msg) throws InterruptedException
|
||||
{
|
||||
int pid = sui.msgbox(self, self, msg, sui.YES_NO, "RESET JEDI", "handleWarningSui");
|
||||
if (pid > -1)
|
||||
{
|
||||
utils.setScriptVar(self, "resetJedi_target", target);
|
||||
utils.setScriptVar(self, "resetJedi_numSkills", numSkills);
|
||||
}
|
||||
return;
|
||||
}
|
||||
public int handleWarningSui(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
int bp = sui.getIntButtonPressed(params);
|
||||
if (bp == sui.BP_CANCEL)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id target = utils.getObjIdScriptVar(self, "resetJedi_target");
|
||||
int numSkills = utils.getIntScriptVar(self, "resetJedi_numSkills");
|
||||
if (target == null || !isIdValid(target))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Error: Jedi requirements did not reset");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (numSkills < 1 || numSkills > 8)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Error: Jedi requirements did not reset");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
resetJedi(self, target, numSkills);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void removeOldJediData(obj_id target) throws InterruptedException
|
||||
{
|
||||
if (hasObjVar(target, pclib.OBJVAR_JEDI_SKILL_REQUIREMENTS))
|
||||
{
|
||||
removeObjVar(target, pclib.OBJVAR_JEDI_SKILL_REQUIREMENTS);
|
||||
}
|
||||
if (hasObjVar(target, "jedi.timeStamp"))
|
||||
{
|
||||
removeObjVar(target, "jedi.timeStamp");
|
||||
}
|
||||
if (hasObjVar(target, "jedi.enabled"))
|
||||
{
|
||||
removeObjVar(target, "jedi.enabled");
|
||||
}
|
||||
if (hasObjVar(target, "jediAddedAcknowlege"))
|
||||
{
|
||||
removeObjVar(target, "jediAddedAcknowlege");
|
||||
}
|
||||
return;
|
||||
}
|
||||
public void setNewSkillReq(obj_id target, int numSkills) throws InterruptedException
|
||||
{
|
||||
int rows = dataTableGetNumRows(JEDI_TABLE);
|
||||
if (numSkills < 1)
|
||||
{
|
||||
numSkills = 1;
|
||||
}
|
||||
if (numSkills > 8)
|
||||
{
|
||||
numSkills = 8;
|
||||
}
|
||||
String[] skills = new String[numSkills];
|
||||
int n = 0;
|
||||
while (n < numSkills)
|
||||
{
|
||||
String skill = dataTableGetString(JEDI_TABLE, rand(0, (rows - 1)), 0);
|
||||
if (skill != null && !skill.equals(""))
|
||||
{
|
||||
boolean skillNotUsed = true;
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
if (skills[i] != null && !skills[i].equals(""))
|
||||
{
|
||||
if (skills[i].equals(skill))
|
||||
{
|
||||
skillNotUsed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (skillNotUsed)
|
||||
{
|
||||
skills[n] = skill;
|
||||
n++;
|
||||
}
|
||||
}
|
||||
}
|
||||
setObjVar(target, pclib.OBJVAR_JEDI_SKILL_REQUIREMENTS, skills);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package script.working.cmayer;
|
||||
|
||||
import script.*;
|
||||
import script.base_class.*;
|
||||
import script.combat_engine.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import script.base_script;
|
||||
|
||||
import script.library.create;
|
||||
import script.library.utils;
|
||||
|
||||
public class lairtest extends script.base_script
|
||||
{
|
||||
public lairtest()
|
||||
{
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException
|
||||
{
|
||||
if (strText.equals("makePOI"))
|
||||
{
|
||||
debugSpeakMsg(self, "Making lair at your location");
|
||||
location locHome = getLocation(self);
|
||||
String strLairDifficulty = create.getLairDifficulty(4, 40, 20);
|
||||
obj_id objLair = createObject("object/tangible/lair/npc_lair.iff", locHome);
|
||||
setObjVar(objLair, "spawning.intDifficultyLevel", 20);
|
||||
setObjVar(objLair, "spawning.lairDifficulty", strLairDifficulty);
|
||||
setObjVar(objLair, "spawning.lairType", "evil_tatooine_village");
|
||||
messageTo(objLair, "handle_Spawn_Setup_Complete", null, 0, false);
|
||||
}
|
||||
if (strText.equals("lairTest"))
|
||||
{
|
||||
debugSpeakMsg(self, "making womprat lair");
|
||||
location locHome = getLocation(self);
|
||||
String strLairDifficulty = create.getLairDifficulty(1, 15, 8);
|
||||
obj_id objLair = createObject("object/tangible/lair/npc_lair.iff", locHome);
|
||||
setObjVar(objLair, "spawning.intDifficultyLevel", 8);
|
||||
setObjVar(objLair, "spawning.lairDifficulty", strLairDifficulty);
|
||||
setObjVar(objLair, "spawning.lairType", "lesser_desert_womprat");
|
||||
setObjVar(objLair, "spawning.target", "object/tangible/lair/base/trash_dark.iff");
|
||||
messageTo(objLair, "handle_Spawn_Setup_Complete", null, 0, false);
|
||||
}
|
||||
if (strText.equals("theaterTest1"))
|
||||
{
|
||||
debugSpeakMsg(self, "Making lair at your location");
|
||||
location locHome = getLocation(self);
|
||||
String strLairDifficulty = create.getLairDifficulty(4, 40, 20);
|
||||
obj_id objLair = createObject("object/tangible/lair/npc_lair.iff", locHome);
|
||||
setObjVar(objLair, "spawning.intDifficultyLevel", 20);
|
||||
setObjVar(objLair, "spawning.lairDifficulty", strLairDifficulty);
|
||||
setObjVar(objLair, "spawning.lairType", "patrol_test");
|
||||
setObjVar(objLair, "spawning.target", "object/installation/battlefield/destructible/shared_bfield_target_power_generator.iff");
|
||||
messageTo(objLair, "handle_Spawn_Setup_Complete", null, 0, false);
|
||||
}
|
||||
if (strText.equals("theaterTest2"))
|
||||
{
|
||||
debugSpeakMsg(self, "Making lair at your location");
|
||||
location locHome = getLocation(self);
|
||||
String strLairDifficulty = create.getLairDifficulty(4, 40, 20);
|
||||
obj_id objLair = createObject("object/tangible/lair/npc_lair.iff", locHome);
|
||||
setObjVar(objLair, "spawning.intDifficultyLevel", 20);
|
||||
setObjVar(objLair, "spawning.lairDifficulty", strLairDifficulty);
|
||||
setObjVar(objLair, "spawning.lairType", "patrol_test");
|
||||
setObjVar(objLair, "spawning.target", "object/installation/battlefield/destructible/shared_bfield_target_power_transformer_2.iff");
|
||||
messageTo(objLair, "handle_Spawn_Setup_Complete", null, 0, false);
|
||||
}
|
||||
if (strText.equals("sampleHeight"))
|
||||
{
|
||||
int intI = 0;
|
||||
while (intI < 9)
|
||||
{
|
||||
location locHome = getLocation(self);
|
||||
location locTest = utils.getRandomLocationInRing(locHome, 1, 20);
|
||||
float fltHeight = getHeightAtLocation(locTest.x, locTest.z);
|
||||
debugSpeakMsg(self, "location tested was " + locTest);
|
||||
debugSpeakMsg(self, "height at location was " + fltHeight);
|
||||
intI = intI + 1;
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package script.working.cmayer;
|
||||
|
||||
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 lostest extends script.base_script
|
||||
{
|
||||
public lostest()
|
||||
{
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("test"))
|
||||
{
|
||||
int times = 50;
|
||||
if (hasObjVar(self, "lostest"))
|
||||
{
|
||||
times = getIntObjVar(self, "lostest");
|
||||
}
|
||||
obj_id target = getLookAtTarget(self);
|
||||
boolean test = canSee(self, target);
|
||||
if (test)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Can See!");
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "NOOOO Can See!");
|
||||
}
|
||||
for (int i = 0; i < times; ++i)
|
||||
{
|
||||
test = canSee(self, target);
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package script.working.cmayer;
|
||||
|
||||
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.utils;
|
||||
|
||||
public class memtest extends script.base_script
|
||||
{
|
||||
public memtest()
|
||||
{
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("test"))
|
||||
{
|
||||
dictionary dict = new dictionary();
|
||||
if (!hasObjVar(self, "myTest"))
|
||||
{
|
||||
messageTo(self, "TestCallback", dict, 1, true);
|
||||
setObjVar(self, "myTest", 1);
|
||||
}
|
||||
}
|
||||
if (text.equals("end"))
|
||||
{
|
||||
removeObjVar(self, "myTest");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int TestCallback(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
if (hasObjVar(self, "myTest"))
|
||||
{
|
||||
debugSpeakMsg(self, "bleh");
|
||||
Vector test = new Vector();
|
||||
test.setSize(0);
|
||||
for (int j = 0; j < 2000; ++j)
|
||||
{
|
||||
test = utils.addElement(test, j);
|
||||
}
|
||||
messageTo(self, "TestCallback", params, 1, true);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package script.working.cmayer;
|
||||
|
||||
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 top extends script.base_script
|
||||
{
|
||||
public top()
|
||||
{
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("test"))
|
||||
{
|
||||
debugSpeakMsg(self, "TopScript");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package script.working.cmayer;
|
||||
|
||||
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 trigtest extends script.base_script
|
||||
{
|
||||
public trigtest()
|
||||
{
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("test"))
|
||||
{
|
||||
createTriggerVolume("trigTest", 3, true);
|
||||
}
|
||||
if (text.equals("end"))
|
||||
{
|
||||
removeTriggerVolume("trigTest");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnTriggerVolumeEntered(obj_id self, String triggerVolumeName, obj_id breacher) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "Entered!");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnTriggerVolumeExited(obj_id self, String triggerVolumeName, obj_id breacher) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "Exitted!");
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
public int OnSkillAboutToBeGranted(obj_id self, String name) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "Entered about to be granted!");
|
||||
if (hasObjVar(self, "override_test"))
|
||||
{
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSkillAboutToBeRevoked(obj_id self, String name) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "Entered about to be revoked!");
|
||||
if (hasObjVar(self, "override_test"))
|
||||
{
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSkillGranted(obj_id self, String name) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "Entered granted!");
|
||||
if (hasObjVar(self, "override_test"))
|
||||
{
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSkillRevoked(obj_id self, String name) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "Entered revoked!");
|
||||
if (hasObjVar(self, "override_test"))
|
||||
{
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
package script.working.cmayer;
|
||||
|
||||
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 troopertest extends script.base_script
|
||||
{
|
||||
public troopertest()
|
||||
{
|
||||
}
|
||||
public obj_id makeStormtrooper(obj_id player, location here) throws InterruptedException
|
||||
{
|
||||
String gender = "male";
|
||||
String species = "object/creature/player/human_";
|
||||
String name = "stormtrooper";
|
||||
species = species + gender + ".iff";
|
||||
obj_id npc = createObject(species, here);
|
||||
obj_id clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_boots.iff", npc, "");
|
||||
if (clothes1 == null)
|
||||
{
|
||||
debugConsoleMsg(player, "I wasn't able to make boots ");
|
||||
}
|
||||
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_bicep_l.iff", npc, "");
|
||||
if (clothes1 == null)
|
||||
{
|
||||
debugConsoleMsg(player, "I wasn't able to make 1 ");
|
||||
}
|
||||
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_bicep_r.iff", npc, "");
|
||||
if (clothes1 == null)
|
||||
{
|
||||
debugConsoleMsg(player, "I wasn't able to make 2 ");
|
||||
}
|
||||
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_bracer_l.iff", npc, "");
|
||||
if (clothes1 == null)
|
||||
{
|
||||
debugConsoleMsg(player, "I wasn't able to make 3 ");
|
||||
}
|
||||
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_bracer_r.iff", npc, "");
|
||||
if (clothes1 == null)
|
||||
{
|
||||
debugConsoleMsg(player, "I wasn't able to make 4 ");
|
||||
}
|
||||
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_chest_plate.iff", npc, "");
|
||||
if (clothes1 == null)
|
||||
{
|
||||
debugConsoleMsg(player, "I wasn't able to make 5 ");
|
||||
}
|
||||
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_gloves.iff", npc, "");
|
||||
if (clothes1 == null)
|
||||
{
|
||||
debugConsoleMsg(player, "I wasn't able to make 6 ");
|
||||
}
|
||||
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_helmet.iff", npc, "");
|
||||
if (clothes1 == null)
|
||||
{
|
||||
debugConsoleMsg(player, "I wasn't able to make 7 ");
|
||||
}
|
||||
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_leggings.iff", npc, "");
|
||||
if (clothes1 == null)
|
||||
{
|
||||
debugConsoleMsg(player, "I wasn't able to make 8 ");
|
||||
}
|
||||
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_utility_belt.iff", npc, "");
|
||||
if (clothes1 == null)
|
||||
{
|
||||
debugConsoleMsg(player, "I wasn't able to make 9 ");
|
||||
}
|
||||
if (false)
|
||||
{
|
||||
String clothes_table = "datatables/npc_customization/stormtrooper_clothes.iff";
|
||||
int columns = dataTableGetNumColumns(clothes_table);
|
||||
int intX = 1;
|
||||
while (intX <= columns)
|
||||
{
|
||||
debugConsoleMsg(player, "This is some clothes");
|
||||
int clothesRows = dataTableGetNumRows(clothes_table);
|
||||
int randrow = rand(1, clothesRows);
|
||||
String clothes = dataTableGetString(clothes_table, randrow, intX - 1);
|
||||
debugConsoleMsg(player, "Creating " + clothes);
|
||||
obj_id newClothes = createObject(clothes, npc, "");
|
||||
if (newClothes == null)
|
||||
{
|
||||
debugConsoleMsg(player, "I wasn't able to make " + clothes);
|
||||
}
|
||||
intX = intX + 1;
|
||||
}
|
||||
}
|
||||
return npc;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("test"))
|
||||
{
|
||||
location l = getLocation(self);
|
||||
obj_id test = makeStormtrooper(self, l);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
package script.working;
|
||||
|
||||
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.hue;
|
||||
import script.library.sui;
|
||||
import script.library.utils;
|
||||
|
||||
public class color_index_testing extends script.base_script
|
||||
{
|
||||
public color_index_testing()
|
||||
{
|
||||
}
|
||||
public static final string_id PCOLOR = new string_id("sui", "set_primary_color");
|
||||
public static final string_id SCOLOR = new string_id("sui", "set_secondary_color");
|
||||
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException
|
||||
{
|
||||
if (!isGod(player))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id hueObject = self;
|
||||
if (!utils.isNestedWithin(hueObject, player))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
int mnuPrimaryColor = mi.addRootMenu(menu_info_types.SERVER_MENU9, PCOLOR);
|
||||
int mnuSecondaryColor = mi.addRootMenu(menu_info_types.SERVER_MENU10, SCOLOR);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException
|
||||
{
|
||||
if (!isGod(player))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id hueObject = self;
|
||||
if (!utils.isNestedWithin(hueObject, player))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (item == menu_info_types.SERVER_MENU9)
|
||||
{
|
||||
sui.colorize(hueObject, player, hueObject, hue.INDEX_1, "handlePrimaryColorize");
|
||||
}
|
||||
if (item == menu_info_types.SERVER_MENU10)
|
||||
{
|
||||
sui.colorize(hueObject, player, hueObject, hue.INDEX_2, "handleSecondaryColorize");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int handlePrimaryColorize(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
obj_id hueObject = self;
|
||||
int idx = sui.getColorPickerIndex(params);
|
||||
int bp = sui.getIntButtonPressed(params);
|
||||
obj_id player = sui.getPlayerId(params);
|
||||
if (bp == sui.BP_CANCEL)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (idx > -1)
|
||||
{
|
||||
custom_var myVar = getCustomVarByName(hueObject, hue.INDEX_1);
|
||||
if (myVar != null && myVar.isPalColor())
|
||||
{
|
||||
palcolor_custom_var pcVar = (palcolor_custom_var)myVar;
|
||||
pcVar.setValue(idx);
|
||||
debugConsoleMsg(player, "index_color_1: " + idx);
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int handleSecondaryColorize(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
obj_id hueObject = self;
|
||||
int idx = sui.getColorPickerIndex(params);
|
||||
int bp = sui.getIntButtonPressed(params);
|
||||
obj_id player = sui.getPlayerId(params);
|
||||
if (bp == sui.BP_CANCEL)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (idx > -1)
|
||||
{
|
||||
custom_var myVar = getCustomVarByName(hueObject, hue.INDEX_2);
|
||||
if (myVar != null && myVar.isPalColor())
|
||||
{
|
||||
palcolor_custom_var pcVar = (palcolor_custom_var)myVar;
|
||||
pcVar.setValue(idx);
|
||||
debugConsoleMsg(player, "index_color_2: " + idx);
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,180 +0,0 @@
|
||||
package script.working.cthurow;
|
||||
|
||||
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 moneytest extends script.base_script
|
||||
{
|
||||
public moneytest()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "money test script attached.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
dictionary d = new dictionary();
|
||||
if (text.equals("from_named"))
|
||||
{
|
||||
boolean boolReturn = transferBankCreditsFromNamedAccount("slush_fund", self, 1000, null, null, null);
|
||||
if (boolReturn)
|
||||
{
|
||||
debugSpeakMsg(self, "returned true.");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "returned false.");
|
||||
}
|
||||
}
|
||||
if (text.equals("to_named"))
|
||||
{
|
||||
boolean boolReturn = transferBankCreditsToNamedAccount(self, "slush_fund", 1000, null, null, null);
|
||||
if (boolReturn)
|
||||
{
|
||||
debugSpeakMsg(self, "returned true.");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "returned false.");
|
||||
}
|
||||
}
|
||||
if (text.equals("cash_to_object"))
|
||||
{
|
||||
boolean boolReturn = transferCashTo(self, obj_id.getObjId(200025), 1000, null, null, null);
|
||||
if (boolReturn)
|
||||
{
|
||||
debugSpeakMsg(self, "returned true.");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "returned false.");
|
||||
}
|
||||
}
|
||||
if (text.equals("bank_to_object"))
|
||||
{
|
||||
boolean boolReturn = transferBankCreditsTo(self, obj_id.getObjId(200025), 1000, null, null, null);
|
||||
if (boolReturn)
|
||||
{
|
||||
debugSpeakMsg(self, "returned true.");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "returned false.");
|
||||
}
|
||||
}
|
||||
if (text.equals("withdraw"))
|
||||
{
|
||||
boolean boolReturn = withdrawCashFromBank(self, 1000, null, null, null);
|
||||
if (boolReturn)
|
||||
{
|
||||
debugSpeakMsg(self, "returned true.");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "returned false.");
|
||||
}
|
||||
}
|
||||
if (text.equals("deposit"))
|
||||
{
|
||||
boolean boolReturn = depositCashToBank(self, 1000, null, null, null);
|
||||
if (boolReturn)
|
||||
{
|
||||
debugSpeakMsg(self, "returned true.");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "returned false.");
|
||||
}
|
||||
}
|
||||
if (text.equals("from_named_callback"))
|
||||
{
|
||||
boolean boolReturn = transferBankCreditsFromNamedAccount("slush_fund", self, 1000, "success", "fail", d);
|
||||
if (boolReturn)
|
||||
{
|
||||
debugSpeakMsg(self, "returned true.");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "returned false.");
|
||||
}
|
||||
}
|
||||
if (text.equals("to_named_callback"))
|
||||
{
|
||||
boolean boolReturn = transferBankCreditsToNamedAccount(self, "slush_fund", 1000, "success", "fail", d);
|
||||
if (boolReturn)
|
||||
{
|
||||
debugSpeakMsg(self, "returned true.");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "returned false.");
|
||||
}
|
||||
}
|
||||
if (text.equals("cash_to_object_callback"))
|
||||
{
|
||||
boolean boolReturn = transferCashTo(self, obj_id.getObjId(200025), 1000, "success", "fail", d);
|
||||
if (boolReturn)
|
||||
{
|
||||
debugSpeakMsg(self, "returned true.");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "returned false.");
|
||||
}
|
||||
}
|
||||
if (text.equals("bank_to_object_callback"))
|
||||
{
|
||||
boolean boolReturn = transferBankCreditsTo(self, obj_id.getObjId(200025), 1000, "success", "fail", d);
|
||||
if (boolReturn)
|
||||
{
|
||||
debugSpeakMsg(self, "returned true.");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "returned false.");
|
||||
}
|
||||
}
|
||||
if (text.equals("withdraw_callback"))
|
||||
{
|
||||
boolean boolReturn = withdrawCashFromBank(self, 1000, "success", "fail", d);
|
||||
if (boolReturn)
|
||||
{
|
||||
debugSpeakMsg(self, "returned true.");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "returned false.");
|
||||
}
|
||||
}
|
||||
if (text.equals("deposit_callback"))
|
||||
{
|
||||
boolean boolReturn = depositCashToBank(self, 1000, "success", "fail", d);
|
||||
if (boolReturn)
|
||||
{
|
||||
debugSpeakMsg(self, "returned true.");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "returned false.");
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int success(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "Got success message.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int fail(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "Got fail message.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package script.working.cthurow;
|
||||
|
||||
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.utils;
|
||||
|
||||
public class test extends script.base_script
|
||||
{
|
||||
public test()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Name test script attached. Use \"setname <oid>\" to set an object's name to a max-length name.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
if (speaker != self)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
String[] argv = split(text, ' ');
|
||||
if (argv[0].equals("setname"))
|
||||
{
|
||||
Long id = new Long(argv[1]);
|
||||
obj_id target = obj_id.getObjId(id);
|
||||
setName(target, "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij");
|
||||
debugSpeakMsg(self, "named.");
|
||||
}
|
||||
if (argv[0].equals("test"))
|
||||
{
|
||||
messageTo(self, "TestMessage", null, 0, false);
|
||||
}
|
||||
if (argv[0].equals("bigspawn"))
|
||||
{
|
||||
location whereAt = getLocation(self);
|
||||
for (int i = 0; i < 100; ++i)
|
||||
{
|
||||
obj_id newObject = createObject("object/tangible/container/general/satchel.iff", whereAt);
|
||||
}
|
||||
}
|
||||
if (argv[0].equals("bigspawn"))
|
||||
{
|
||||
location whereAt = getLocation(self);
|
||||
for (int i = 0; i < 100; ++i)
|
||||
{
|
||||
obj_id newObject = createObject("object/tangible/container/general/satchel.iff", whereAt);
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int TestMessage(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Test message received.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int RecurringTestMessage(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Recurring test message received.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int MessageLost(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Test message not delivered.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package script.working.cthurow;
|
||||
|
||||
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.utils;
|
||||
|
||||
public class uber extends script.base_script
|
||||
{
|
||||
public uber()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Uberscript attached. Say \"uber\" for options.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
if (speaker != self)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
String[] argv = split(text, ' ');
|
||||
if (argv[0].equals("uber"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "List of commands:vendor_skills house generator factory bank_terminal");
|
||||
}
|
||||
if (argv[0].equals("house"))
|
||||
{
|
||||
obj_id inventory = utils.getInventoryContainer(self);
|
||||
createObject("object/tangible/deed/player_house_deed/tatooine_house_small_deed.iff", inventory, "");
|
||||
sendSystemMessageTestingOnly(self, "Housified.");
|
||||
}
|
||||
if (argv[0].equals("generator"))
|
||||
{
|
||||
obj_id inventory = utils.getInventoryContainer(self);
|
||||
createObject("object/tangible/deed/generator_deed/power_generator_fusion_deed.iff", inventory, "");
|
||||
sendSystemMessageTestingOnly(self, "Generated.");
|
||||
}
|
||||
if (argv[0].equals("factory"))
|
||||
{
|
||||
obj_id inventory = utils.getInventoryContainer(self);
|
||||
createObject("object/tangible/deed/factory_deed/item_factory_deed.iff", inventory, "");
|
||||
sendSystemMessageTestingOnly(self, "Factored.");
|
||||
}
|
||||
if (argv[0].equals("bank_terminal"))
|
||||
{
|
||||
obj_id inventory = utils.getInventoryContainer(self);
|
||||
createObject("object/tangible/terminal/terminal_bank.iff", getLocation(self));
|
||||
sendSystemMessageTestingOnly(self, "terminated.");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,141 +0,0 @@
|
||||
package script.working.cthurow;
|
||||
|
||||
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.features;
|
||||
import script.library.sui;
|
||||
import script.library.utils;
|
||||
|
||||
public class veterantest extends script.base_script
|
||||
{
|
||||
public veterantest()
|
||||
{
|
||||
}
|
||||
public static final String ANNOUNCEMENT_BOX_TITLE = "Announcement Box Title";
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "veteran test script attached. Say \"lewt\" to get stuff.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("lewt"))
|
||||
{
|
||||
checkForVeteranRewards(self);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void checkForVeteranRewards(obj_id self) throws InterruptedException
|
||||
{
|
||||
}
|
||||
public int handleRewardAnnouncement(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
String event = utils.getStringScriptVar(self, "veteran_rewards.event");
|
||||
int rowSelected = sui.getListboxSelectedRow(params);
|
||||
debugSpeakMsg(self, "In handleRewardAnnouncement. Row selected is " + rowSelected);
|
||||
if (rowSelected == 0)
|
||||
{
|
||||
chooseRewardForEvent(self, event);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rowSelected == 1)
|
||||
{
|
||||
launchClientWebBrowser(self, veteranGetEventUrl(event));
|
||||
checkForVeteranRewards(self);
|
||||
}
|
||||
if (rowSelected == 2)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
int waitForNextPrompt = 0;
|
||||
if (rowSelected == 3)
|
||||
{
|
||||
waitForNextPrompt = 24 * 60 * 60;
|
||||
}
|
||||
if (rowSelected == 4)
|
||||
{
|
||||
waitForNextPrompt = 7 * 24 * 60 * 60;
|
||||
}
|
||||
int gameTime = getGameTime();
|
||||
int nextPromptTime = gameTime + waitForNextPrompt;
|
||||
setObjVar(self, "veteran_rewards.nextPromptTime", nextPromptTime);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void chooseRewardForEvent(obj_id self, String event) throws InterruptedException
|
||||
{
|
||||
String[] rewardChoices = veteranGetRewardChoicesDescriptions(self, event);
|
||||
String[] rewardChoicesTags = veteranGetRewardChoicesTags(self, event);
|
||||
utils.setScriptVar(self, "veteran_rewards.event", event);
|
||||
utils.setScriptVar(self, "veteran_rewards.rewardTags", rewardChoicesTags);
|
||||
if (rewardChoices.length == 0)
|
||||
{
|
||||
}
|
||||
else if (rewardChoices.length == 1)
|
||||
{
|
||||
veteranClaimReward(self, event, rewardChoicesTags[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
String[] choicesWithLaunchWeb = new String[rewardChoices.length + 1];
|
||||
choicesWithLaunchWeb[0] = "@veteran:launch_web_browser_for_event";
|
||||
for (int i = 0; i < rewardChoices.length; ++i)
|
||||
{
|
||||
choicesWithLaunchWeb[i + 1] = rewardChoices[i];
|
||||
}
|
||||
int pid = sui.listbox(self, self, veteranGetEventDescription(event), sui.OK_CANCEL, sui.DEFAULT_TITLE, choicesWithLaunchWeb, "rewardSelectHandler", true, true);
|
||||
if (pid < 0)
|
||||
{
|
||||
debugSpeakMsg(self, "Could not create sui reward list for player, error = " + pid);
|
||||
}
|
||||
}
|
||||
}
|
||||
public int rewardSelectHandler(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "In rewardSelectHandler message handler");
|
||||
if ((params == null) || (params.isEmpty()))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
int bp = sui.getIntButtonPressed(params);
|
||||
int rowSelected = sui.getListboxSelectedRow(params);
|
||||
if (bp == sui.BP_CANCEL || rowSelected < 0)
|
||||
{
|
||||
debugSpeakMsg(self, "Cancel was pressed or no row was picked.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
String event = utils.getStringScriptVar(self, "veteran_rewards.event");
|
||||
if (rowSelected == 0)
|
||||
{
|
||||
launchClientWebBrowser(self, veteranGetEventUrl(event));
|
||||
checkForVeteranRewards(self);
|
||||
}
|
||||
else
|
||||
{
|
||||
String[] rewardChoicesTags = utils.getStringArrayScriptVar(self, "veteran_rewards.rewardTags");
|
||||
debugSpeakMsg(self, "Choice is " + event + ":" + rewardChoicesTags[rowSelected - 1]);
|
||||
veteranClaimReward(self, event, rewardChoicesTags[rowSelected - 1]);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int veteranItemGrantSucceeded(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "In veteranItemGrantSucceeded message handler");
|
||||
sendSystemMessage(self, new string_id("veteran", "item_grant_succeeded"));
|
||||
checkForVeteranRewards(self);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int veteranItemGrantFailed(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "In veteranItemGrantFailed message handler");
|
||||
sendSystemMessage(self, new string_id("veteran", "item_grant_failed"));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,51 +0,0 @@
|
||||
package script.working;
|
||||
|
||||
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.skill;
|
||||
|
||||
public class difficultytest extends script.base_script
|
||||
{
|
||||
public difficultytest()
|
||||
{
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException
|
||||
{
|
||||
if (objSpeaker != self)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (strText.equals("getDifficulty"))
|
||||
{
|
||||
int intLevel = getLevel(self);
|
||||
sendSystemMessageTestingOnly(self, "My level is " + intLevel);
|
||||
debugServerConsoleMsg(self, "my level is " + intLevel);
|
||||
}
|
||||
if (strText.equals("reloadDifficulty"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Reloaded skill level");
|
||||
recalculateLevel(self);
|
||||
}
|
||||
if (strText.equals("getGroupDifficulty"))
|
||||
{
|
||||
int intLevel = skill.getGroupLevel(self);
|
||||
sendSystemMessageTestingOnly(self, "My Group level is " + intLevel);
|
||||
}
|
||||
if (strText.equals("scriptVars"))
|
||||
{
|
||||
deltadictionary dctScriptVars = self.getScriptVars();
|
||||
if (dctScriptVars == null)
|
||||
{
|
||||
debugSpeakMsg(self, "null scriptvar");
|
||||
}
|
||||
debugSpeakMsg(self, "scriptvars are " + dctScriptVars.toString());
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package script.working.dosgood;
|
||||
|
||||
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.utils;
|
||||
import script.library.space_dungeon;
|
||||
import script.library.npe;
|
||||
|
||||
public class test extends script.base_script
|
||||
{
|
||||
public test()
|
||||
{
|
||||
}
|
||||
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
java.util.StringTokenizer st = new java.util.StringTokenizer(text);
|
||||
String arg = st.nextToken();
|
||||
if (arg.equals("testing"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "1... 2... 3...");
|
||||
}
|
||||
if (arg.equals("path"))
|
||||
{
|
||||
float x = Float.parseFloat(st.nextToken());
|
||||
float y = Float.parseFloat(st.nextToken());
|
||||
float z = Float.parseFloat(st.nextToken());
|
||||
location destination = new location(x, y, z);
|
||||
createClientPathAdvanced(self, getLocation(self), destination, "default");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package script.working;
|
||||
|
||||
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.regions;
|
||||
|
||||
public class dynamicregiontest extends script.base_script
|
||||
{
|
||||
public dynamicregiontest()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
createCircleRegion(getLocation(self), 2000, self.toString(), regions.PVP_REGION_TYPE_NORMAL, regions.BUILD_TRUE, regions.MUNI_FALSE, 600, 0, 50, regions.SPAWN_FALSE, regions.MISSION_NONE, false, false);
|
||||
debugSpeakMsg(self, "made region called " + self.toString());
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnDestroy(obj_id self) throws InterruptedException
|
||||
{
|
||||
location locTest = getLocation(self);
|
||||
String strPlanet = locTest.area;
|
||||
region rgnRegion = getRegion(strPlanet, self.toString());
|
||||
if (rgnRegion == null)
|
||||
{
|
||||
debugSpeakMsg(self, "Null region.. no good");
|
||||
}
|
||||
else
|
||||
{
|
||||
deleteRegion(rgnRegion);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,818 +0,0 @@
|
||||
package script.working;
|
||||
|
||||
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 java.util.StringTokenizer;
|
||||
import java.lang.Math;
|
||||
import script.library.ai_lib;
|
||||
import script.library.buff;
|
||||
import script.library.beast_lib;
|
||||
import script.library.create;
|
||||
import script.library.expertise;
|
||||
import script.library.groundquests;
|
||||
import script.library.guild;
|
||||
import script.library.incubator;
|
||||
import script.library.instance;
|
||||
import script.library.npe;
|
||||
import script.library.player_structure;
|
||||
import script.library.pet_lib;
|
||||
import script.library.respec;
|
||||
import script.library.skill;
|
||||
import script.library.skill_template;
|
||||
import script.library.space_combat;
|
||||
import script.library.space_flags;
|
||||
import script.library.space_quest;
|
||||
import script.library.static_item;
|
||||
import script.library.sui;
|
||||
import script.library.transition;
|
||||
import script.library.trial;
|
||||
import script.library.utils;
|
||||
|
||||
public class jbenjtest extends script.base_script
|
||||
{
|
||||
public jbenjtest()
|
||||
{
|
||||
}
|
||||
public static final String PID_NAME = "hateList";
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
obj_id player = self;
|
||||
obj_id pInv = utils.getInventoryContainer(player);
|
||||
obj_id target = getIntendedTarget(self);
|
||||
obj_id tInv = utils.getInventoryContainer(target);
|
||||
if (isGod(player))
|
||||
{
|
||||
StringTokenizer st = new java.util.StringTokenizer(text);
|
||||
int tokens = st.countTokens();
|
||||
String command = null;
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
command = st.nextToken();
|
||||
}
|
||||
if (command.equals("setSpaceFlag"))
|
||||
{
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
command = st.nextToken();
|
||||
space_flags.setSpaceFlag(self, command, 1);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("tweakRespecValues"))
|
||||
{
|
||||
int combatLevel = -1;
|
||||
int entLevel = -1;
|
||||
int traderLevel = -1;
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
command = st.nextToken();
|
||||
combatLevel = utils.stringToInt(command);
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
command = st.nextToken();
|
||||
entLevel = utils.stringToInt(command);
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
command = st.nextToken();
|
||||
traderLevel = utils.stringToInt(command);
|
||||
}
|
||||
}
|
||||
}
|
||||
int[] recpecLevelsNewValue =
|
||||
{
|
||||
combatLevel,
|
||||
entLevel,
|
||||
traderLevel
|
||||
};
|
||||
setObjVar(player, respec.PROF_LEVEL_ARRAY, recpecLevelsNewValue);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("respecFix"))
|
||||
{
|
||||
if (hasObjVar(player, respec.PROF_LEVEL_ARRAY))
|
||||
{
|
||||
String skillTemplate = getSkillTemplate(player);
|
||||
int[] recpecLevelsValue = getIntArrayObjVar(player, respec.PROF_LEVEL_ARRAY);
|
||||
int currentLevel = getLevel(player);
|
||||
if (!skillTemplate.startsWith("entertainer") && !skillTemplate.startsWith("trader"))
|
||||
{
|
||||
int combatLevel = recpecLevelsValue[respec.PROF_LEVEL_COMBAT];
|
||||
if (currentLevel < combatLevel)
|
||||
{
|
||||
respec.autoLevelPlayer(player, combatLevel, true);
|
||||
}
|
||||
}
|
||||
else if (skillTemplate.startsWith("entertainer"))
|
||||
{
|
||||
debugSpeakMsg(self, "you should be a entertainer dude");
|
||||
int entLevel = recpecLevelsValue[respec.PROF_LEVEL_ENT];
|
||||
debugSpeakMsg(self, "entLevel " + entLevel);
|
||||
if (currentLevel < entLevel)
|
||||
{
|
||||
respec.autoLevelPlayer(player, entLevel, true);
|
||||
}
|
||||
}
|
||||
else if (skillTemplate.startsWith("trader"))
|
||||
{
|
||||
debugSpeakMsg(self, "you should be a trader dude");
|
||||
int traderLevel = recpecLevelsValue[respec.PROF_LEVEL_TRADER];
|
||||
debugSpeakMsg(self, "traderLevel " + traderLevel);
|
||||
if (currentLevel < traderLevel)
|
||||
{
|
||||
respec.autoLevelPlayer(player, traderLevel, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (command.equals("sendTestMail"))
|
||||
{
|
||||
utils.sendMail(new string_id("spam", "test_mail_title"), new string_id("spam", "test_mail_title"), self, "Galactic Vacant Building Demolishing Movement");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("hasScriptVar"))
|
||||
{
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
command = st.nextToken();
|
||||
debugSpeakMsg(self, "" + utils.hasObjIdBatchScriptVar(target, command));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
if (command.equals("getAttackerList"))
|
||||
{
|
||||
obj_id[] attackerList = utils.getObjIdBatchScriptVar(target, "creditForKills.attackerList.attackers");
|
||||
String list = utils.getStringScriptVar(target, "creditForKills.attackerList");
|
||||
if (attackerList == null)
|
||||
{
|
||||
debugSpeakMsg(self, "attackerList was null");
|
||||
debugSpeakMsg(self, "list was " + list);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
for (int i = 0; i < attackerList.length; ++i)
|
||||
{
|
||||
debugSpeakMsg(self, "attackerList[" + i + "] " + attackerList[i]);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("testMonthly"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "" + getCalendarTimeStringGMT(getIntObjVar(self, respec.OBJVAR_RESPEC_DECAY_TIME)));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("clearInstanceQueue"))
|
||||
{
|
||||
instance.setRequestResolved(self);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("setRespecDecay"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "setting respec decay to end in 10 seconds. You need to log out fully to test this, or say 'testRespecDecay'.");
|
||||
int now = getCalendarTime();
|
||||
int then = now + 10;
|
||||
setObjVar(player, respec.OBJVAR_RESPEC_DECAY_TIME, then);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("testRespecDecay"))
|
||||
{
|
||||
respec.checkRespecDecay(self);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("get_tat"))
|
||||
{
|
||||
obj_id planetId = getPlanetByName("tatooine");
|
||||
sendSystemMessageTestingOnly(self, "" + planetId);
|
||||
}
|
||||
if (command.equals("sendTestHeroicComplete"))
|
||||
{
|
||||
dictionary dict = new dictionary();
|
||||
dict.put("tokenIndex", 5);
|
||||
dict.put("tokenCount", 9);
|
||||
messageTo(self, "handleAwardtoken", dict, 1, false);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("getHealthRate"))
|
||||
{
|
||||
float fltHealthRegen = getHealthRegenRate(target);
|
||||
debugSpeakMsg(self, "" + fltHealthRegen);
|
||||
}
|
||||
if (command.equals("testSuiCountDown"))
|
||||
{
|
||||
int flags = 0;
|
||||
flags |= sui.CD_EVENT_INCAPACITATE;
|
||||
flags |= sui.CD_EVENT_DAMAGED;
|
||||
int startTime = 0;
|
||||
int endTime = 6;
|
||||
String displayGroup = "bm_creature_knowledge";
|
||||
string_id prompt = new string_id("beast", "ability_activate_creature_knowledge");
|
||||
String handler = "testSuiCountDown";
|
||||
float maxRange = 32;
|
||||
int pid = sui.smartCountdownTimerSUI(self, self, displayGroup, prompt, startTime, endTime, handler, maxRange, flags);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("getFirstName"))
|
||||
{
|
||||
debugSpeakMsg(self, "" + getFirstName(self));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("setStatic"))
|
||||
{
|
||||
setCreatureStatic(target, true);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("clearInspiration"))
|
||||
{
|
||||
utils.removeScriptVarTree(self, "performance");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("removeScriptVar"))
|
||||
{
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
command = st.nextToken();
|
||||
utils.removeScriptVarTree(self, command);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
if (command.equals("displayScriptVarDictionary"))
|
||||
{
|
||||
dictionary dict = new dictionary();
|
||||
dict.put("myInt", 1);
|
||||
dict.put("myString", "Mikkel");
|
||||
debugSpeakMsg(self, "dictionary is " + dict.toString());
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("createCameraPcd"))
|
||||
{
|
||||
obj_id datapad = utils.getPlayerDatapad(self);
|
||||
obj_id petControlDevice = createObject(pet_lib.PET_CTRL_DEVICE_TEMPLATE, datapad, "");
|
||||
attachScript(petControlDevice, "ai.pcd_ping_response");
|
||||
attachScript(petControlDevice, "ai.pet_control_device");
|
||||
setObjVar(petControlDevice, "ai.pet.command.0", "f");
|
||||
setObjVar(petControlDevice, "ai.pet.command.1", "st");
|
||||
setObjVar(petControlDevice, "ai.pet.command.10", "tran");
|
||||
setObjVar(petControlDevice, "ai.pet.command.11", "s");
|
||||
setObjVar(petControlDevice, "ai.pet.command.12", "t1");
|
||||
setObjVar(petControlDevice, "ai.pet.command.13", "t2");
|
||||
setObjVar(petControlDevice, "ai.pet.command.1563288080", "fa");
|
||||
setObjVar(petControlDevice, "ai.pet.command.16", "g");
|
||||
setObjVar(petControlDevice, "ai.pet.command.17", "ft");
|
||||
setObjVar(petControlDevice, "ai.pet.command.2", "gu");
|
||||
setObjVar(petControlDevice, "ai.pet.command.20", "r");
|
||||
setObjVar(petControlDevice, "ai.pet.command.3", "bef");
|
||||
setObjVar(petControlDevice, "ai.pet.command.4", "a");
|
||||
setObjVar(petControlDevice, "ai.pet.command.5", "p");
|
||||
setObjVar(petControlDevice, "ai.pet.command.6", "gp");
|
||||
setObjVar(petControlDevice, "ai.pet.command.7", "cp");
|
||||
setObjVar(petControlDevice, "ai.pet.command.8", "w");
|
||||
setObjVar(petControlDevice, "ai.pet.command.9", "c");
|
||||
setObjVar(petControlDevice, "ai.pet.currentStats", "0:0:0:0:0:0:");
|
||||
setObjVar(petControlDevice, "ai.pet.palvar.vars./private/index_color_1", 19);
|
||||
setObjVar(petControlDevice, "ai.pet.type", 1);
|
||||
setObjVar(petControlDevice, "ai.petAbility.abilityList", "1319491216:1563288080:");
|
||||
setObjVar(petControlDevice, "ai.petAbility.available", 2);
|
||||
setObjVar(petControlDevice, "ai.petAbility.toBeEarned", 1);
|
||||
setObjVar(petControlDevice, "ai.petAbility.trainingPts", 24);
|
||||
setObjVar(petControlDevice, "ai.petAdvance.cannotBeMount", 1);
|
||||
setObjVar(petControlDevice, "ai.petAdvance.growthStage", 5);
|
||||
setObjVar(petControlDevice, "ai.petAdvance.xpEarned", 6223);
|
||||
setObjVar(petControlDevice, "pet.creatureName", "noxious_vrelt_scavenger");
|
||||
setObjVar(petControlDevice, "pet.timeStored", 65802667);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("getExpertiseAllocation"))
|
||||
{
|
||||
String[] skills = expertise.getExpertiseAllocation(self);
|
||||
if (skills == null || skills.length <= 0)
|
||||
{
|
||||
debugSpeakMsg(self, "No Expertise Skills");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
for (int i = 0; i < skills.length; ++i)
|
||||
{
|
||||
debugSpeakMsg(self, "" + skills[i]);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("getStandingON"))
|
||||
{
|
||||
debugSpeakMsg(self, "Standing On " + getStandingOn(self));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("getTargetYaw"))
|
||||
{
|
||||
debugSpeakMsg(self, "yaw is " + getYaw(target));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("clearHouseId"))
|
||||
{
|
||||
setHouseId(self, obj_id.NULL_ID);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("destroyTarget"))
|
||||
{
|
||||
destroyObject(target);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("getTargetHateList"))
|
||||
{
|
||||
if (!isIdValid(target) || !exists(target))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
String enemyNames = generateStringHateList(target);
|
||||
if (enemyNames != null && !enemyNames.equals(""))
|
||||
{
|
||||
int pid = sui.msgbox(self, self, enemyNames, sui.OK_ONLY, "Hate List", "onHateListSuiUpdate");
|
||||
messageTo(self, "refreshSuiHateList", null, 1, false);
|
||||
sui.setPid(self, pid, PID_NAME);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("freezeAi"))
|
||||
{
|
||||
stop(target);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("testAddHate"))
|
||||
{
|
||||
debugSpeakMsg(self, "beginingHate is " + getHate(target, self));
|
||||
addHateDot(target, self, 50, 25);
|
||||
debugSpeakMsg(self, "hateDot is " + getHate(target, self));
|
||||
float currentHate = getHate(target, self);
|
||||
addHate(target, self, currentHate + 500);
|
||||
debugSpeakMsg(self, "SecondHate is " + getHate(target, self));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("incrementSlot"))
|
||||
{
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
command = st.nextToken();
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
int number = utils.stringToInt(st.nextToken());
|
||||
modifyCollectionSlotValue(player, command, number);
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("showDroids"))
|
||||
{
|
||||
obj_id[] droidIds = pet_lib.getPcdsForType(player, pet_lib.PET_TYPE_DROID);
|
||||
Vector resizAbleDroidIds = new Vector(Arrays.asList(droidIds));
|
||||
Vector droidNames = new Vector();
|
||||
droidNames.setSize(0);
|
||||
for (int i = 0; i < droidIds.length; ++i)
|
||||
{
|
||||
if (hasObjVar(droidIds[i], "module_data.dancing_droid"))
|
||||
{
|
||||
utils.removeElement(resizAbleDroidIds, droidIds[i]);
|
||||
continue;
|
||||
}
|
||||
String droidName = getName(droidIds[i]);
|
||||
String[] splitName = split(droidName, '/');
|
||||
if (splitName.length > 1)
|
||||
{
|
||||
utils.addElement(droidNames, "@" + droidName);
|
||||
}
|
||||
else
|
||||
{
|
||||
utils.addElement(droidNames, droidName);
|
||||
}
|
||||
}
|
||||
utils.setScriptVar(player, "dancing_droid.ids", droidIds);
|
||||
int pid = sui.listbox(self, self, "prompt", sui.OK_CANCEL, "title", droidNames, "onDanceDroidLoaded", true, true);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("getMemberIds"))
|
||||
{
|
||||
int guildId = getGuildId(self);
|
||||
obj_id[] members = guildGetMemberIds(guildId);
|
||||
debugSpeakMsg(self, "members.length = " + members.length);
|
||||
debugSpeakMsg(self, "guildId = " + guildId);
|
||||
for (int i = 0; i < members.length; ++i)
|
||||
{
|
||||
if (!isIdValid(members[i]))
|
||||
{
|
||||
debugSpeakMsg(self, "members[" + i + "] was Invalid");
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("gc"))
|
||||
{
|
||||
debugSpeakMsg(self, "telling Java to do garbage collection");
|
||||
System.gc();
|
||||
}
|
||||
if (command.equals("getGameTime"))
|
||||
{
|
||||
debugSpeakMsg(self, "" + getGameTime());
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("clearGuildPid"))
|
||||
{
|
||||
guild.removeWindowPid(self);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("giveNewbShip"))
|
||||
{
|
||||
space_quest.grantNewbieShip(self, "neutral");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("getGuildId"))
|
||||
{
|
||||
int guildId = getGuildId(target);
|
||||
debugSpeakMsg(self, "guildId " + guildId);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("maxDailyPackup"))
|
||||
{
|
||||
setObjVar(self, "dailyHousePackup", player_structure.MAX_PACKUP_PER_DAY);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("getMasterGuildObj"))
|
||||
{
|
||||
obj_id masterGuildObj = getMasterGuildObject();
|
||||
debugSpeakMsg(self, "masterGuildObj " + masterGuildObj);
|
||||
}
|
||||
if (command.equals("getGameTime"))
|
||||
{
|
||||
debugSpeakMsg(self, "Game Time is " + getGameTime());
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("mountable"))
|
||||
{
|
||||
debugSpeakMsg(self, "couldPetBeMadeMountable " + couldPetBeMadeMountable(target));
|
||||
}
|
||||
if (command.equals("getMyCityId"))
|
||||
{
|
||||
debugSpeakMsg(self, "My city is " + getCitizenOfCityId(self));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("updateScriptvar"))
|
||||
{
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
String scriptVarName = st.nextToken();
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
String scriptVarValue = st.nextToken();
|
||||
utils.setScriptVar(target, scriptVarName, utils.stringToInt(scriptVarValue));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "parameters are updateScriptvar <scriptVarName> <scriptVarValue>");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "parameters are updateScriptvar <scriptVarName> <scriptVarValue>");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("getAppearance"))
|
||||
{
|
||||
String targetAppearance = getAppearance(target);
|
||||
String[] splitAppearance = split(targetAppearance, '/');
|
||||
String[] finalAppearance = split(splitAppearance[1], '.');
|
||||
int row = dataTableSearchColumnForString(finalAppearance[0], "start_template", "datatables/beast/incubator_templates.iff");
|
||||
debugSpeakMsg(self, "finalAppearance = " + finalAppearance[0]);
|
||||
debugSpeakMsg(self, "row = " + row);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("getRawAppearance"))
|
||||
{
|
||||
String targetAppearance = getAppearance(target);
|
||||
debugSpeakMsg(self, "targetAppearance = " + targetAppearance);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("getDna"))
|
||||
{
|
||||
obj_id dnaContainer = incubator.extractDna(self, target);
|
||||
debugSpeakMsg(self, "dnaContainer = " + dnaContainer);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("validateExpertise"))
|
||||
{
|
||||
skill.validateExpertise(self);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("newbArmor"))
|
||||
{
|
||||
npe.grantNewbArmor(self);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("getTemplate"))
|
||||
{
|
||||
String skillTemplate = getSkillTemplate(self);
|
||||
debugSpeakMsg(self, "Skill Template is " + skillTemplate);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("setBlankTemplate"))
|
||||
{
|
||||
setSkillTemplate(self, "a");
|
||||
String skillTemplate = getSkillTemplate(self);
|
||||
debugSpeakMsg(self, "Skill Template is " + skillTemplate);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("startMarket"))
|
||||
{
|
||||
debugSpeakMsg(self, "target is " + target);
|
||||
messageTo(target, "spawnMarketplaceNpcs", null, 1, false);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("nukeWorld"))
|
||||
{
|
||||
obj_id[] objObjects = getObjectsInRange(self, 32000);
|
||||
sendSystemMessageTestingOnly(self, "Destroying world");
|
||||
for (int intI = 0; intI < objObjects.length; intI++)
|
||||
{
|
||||
if (!isPlayer(objObjects[intI]))
|
||||
{
|
||||
setObjVar(objObjects[intI], "intCleaningUp", 1);
|
||||
destroyObject(objObjects[intI]);
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("topMostContainer"))
|
||||
{
|
||||
debugSpeakMsg(self, "topmost is" + getTopMostContainer(self));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("getScene"))
|
||||
{
|
||||
String planet = getCurrentSceneName();
|
||||
debugSpeakMsg(self, "planet is " + planet);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("faceMe"))
|
||||
{
|
||||
faceTo(target, self);
|
||||
}
|
||||
if (command.equals("addNightSisterVendor"))
|
||||
{
|
||||
applySkillStatisticModifier(self, "vendor_nightsister", 1);
|
||||
}
|
||||
if (command.equals("addSkillMod"))
|
||||
{
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
String modName = st.nextToken();
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
int amount = utils.stringToInt(st.nextToken());
|
||||
applySkillStatisticModifier(self, modName, amount);
|
||||
messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods"), 0, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (command.equals("callTravelUI"))
|
||||
{
|
||||
String planet = getCurrentSceneName();
|
||||
boolean uiCalled = enterClientTicketPurchaseMode(self, planet, "Dathomir Outpost", true);
|
||||
debugSpeakMsg(self, "enterClientTicketPurchaseMode " + uiCalled);
|
||||
}
|
||||
if (command.equals("zoneAurillia"))
|
||||
{
|
||||
transition.zonePlayerNoGate("aurillia_township", self, true);
|
||||
}
|
||||
if (command.equals("removeNightSisterVendor"))
|
||||
{
|
||||
applySkillStatisticModifier(self, "vendor_nightsister", -1);
|
||||
}
|
||||
if (command.equals("getResistance"))
|
||||
{
|
||||
int resistance_mod = getEnhancedSkillStatisticModifier(self, "resistance_poison");
|
||||
float resist_scale = (0.4f / ((100f + resistance_mod) / 200f));
|
||||
float to_hit_chance = 100 * resist_scale;
|
||||
debugSpeakMsg(self, "My resistance mod is " + resistance_mod);
|
||||
debugSpeakMsg(self, "My resist_scale is " + resist_scale);
|
||||
debugSpeakMsg(self, "To hit Chance for spy fang is " + to_hit_chance);
|
||||
to_hit_chance = 360 * resist_scale;
|
||||
debugSpeakMsg(self, "To hit Chance for artery strike is " + to_hit_chance);
|
||||
to_hit_chance = 120 * resist_scale;
|
||||
debugSpeakMsg(self, "To hit Chance for malady is " + to_hit_chance);
|
||||
}
|
||||
if (command.equals("spawnCommoner"))
|
||||
{
|
||||
location myLoc = getLocation(self);
|
||||
create.object("commoner", myLoc, false);
|
||||
}
|
||||
if (command.equals("incrementHappiness"))
|
||||
{
|
||||
obj_id beast = beast_lib.getBeastOnPlayer(self);
|
||||
obj_id bcd = beast_lib.getBeastBCD(beast);
|
||||
int currentHappiness = utils.getIntScriptVar(bcd, beast_lib.PET_HAPPINESS_SCRIPTVAR);
|
||||
int updatedHappiness = currentHappiness + 5;
|
||||
utils.setScriptVar(bcd, beast_lib.PET_HAPPINESS_SCRIPTVAR, updatedHappiness);
|
||||
beast_lib.updateBeastStats(bcd, beast);
|
||||
}
|
||||
if (command.equals("decrementHappiness"))
|
||||
{
|
||||
obj_id beast = beast_lib.getBeastOnPlayer(self);
|
||||
obj_id bcd = beast_lib.getBeastBCD(beast);
|
||||
int currentHappiness = utils.getIntScriptVar(bcd, beast_lib.PET_HAPPINESS_SCRIPTVAR);
|
||||
int updatedHappiness = currentHappiness - 5;
|
||||
utils.setScriptVar(bcd, beast_lib.PET_HAPPINESS_SCRIPTVAR, updatedHappiness);
|
||||
beast_lib.updateBeastStats(bcd, beast);
|
||||
}
|
||||
if (command.equals("testCrystal"))
|
||||
{
|
||||
obj_id createdObject = createObjectInInventoryAllowOverload("object/tangible/item/quest/force_sensitive/fs_buff_item.iff", self);
|
||||
if (!isIdNull(createdObject))
|
||||
{
|
||||
setObjVar(createdObject, "createdFor", self);
|
||||
setObjVar(createdObject, "item.time.reuse_time", 345600);
|
||||
setObjVar(createdObject, "item.buff.type", 6);
|
||||
setObjVar(createdObject, "item.buff.value", 900);
|
||||
setObjVar(createdObject, "item.buff.duration", 5400);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("giveTargetBuff"))
|
||||
{
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
String buffName = st.nextToken();
|
||||
buff.applyBuff(target, buffName);
|
||||
}
|
||||
}
|
||||
if (command.equals("giveMidlithe"))
|
||||
{
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
String count = st.nextToken();
|
||||
obj_id lootItem = static_item.createNewItemFunction(space_combat.NOVA_ORION_RESOURCE, utils.getInventoryContainer(self));
|
||||
setCount(lootItem, utils.stringToInt(count));
|
||||
}
|
||||
}
|
||||
if (command.equals("nukeTarget"))
|
||||
{
|
||||
destroyObject(target);
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
if (command.equals("getPosture"))
|
||||
{
|
||||
int myPosture = getPosture(target);
|
||||
switch (myPosture)
|
||||
{
|
||||
case POSTURE_NONE:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_NONE");
|
||||
break;
|
||||
case POSTURE_UPRIGHT:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_UPRIGHT");
|
||||
break;
|
||||
case POSTURE_CROUCHED:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_CROUCHED");
|
||||
break;
|
||||
case POSTURE_PRONE:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_PRONE");
|
||||
break;
|
||||
case POSTURE_SNEAKING:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_SNEAKING");
|
||||
break;
|
||||
case POSTURE_BLOCKING:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_BLOCKING");
|
||||
break;
|
||||
case POSTURE_CLIMBING:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_CLIMBING");
|
||||
break;
|
||||
case POSTURE_FLYING:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_FLYING");
|
||||
break;
|
||||
case POSTURE_LYING_DOWN:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_LYING_DOWN");
|
||||
break;
|
||||
case POSTURE_SITTING:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_SITTING");
|
||||
break;
|
||||
case POSTURE_SKILL_ANIMATING:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_SKILL_ANIMATING");
|
||||
break;
|
||||
case POSTURE_DRIVING_VEHICLE:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_DRIVING_VEHICLE");
|
||||
break;
|
||||
case POSTURE_RIDING_CREATURE:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_RIDING_CREATURE");
|
||||
break;
|
||||
case POSTURE_KNOCKED_DOWN:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_KNOCKED_DOWN");
|
||||
break;
|
||||
case POSTURE_INCAPACITATED:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_INCAPACITATED");
|
||||
break;
|
||||
case POSTURE_DEAD:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_DEAD");
|
||||
break;
|
||||
case POSTURE_COUNT:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is POSTURE_COUNT");
|
||||
break;
|
||||
default:
|
||||
sendSystemMessageTestingOnly(self, "my Posuture is default");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int testSuiCountDown(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "params is " + params);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int onHateListSuiUpdate(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
if (params == null || params.isEmpty())
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
int bp = sui.getIntButtonPressed(params);
|
||||
if (bp == sui.BP_CANCEL || bp == sui.BP_OK)
|
||||
{
|
||||
sui.removePid(self, PID_NAME);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (!sui.hasPid(self, PID_NAME))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int refreshSuiHateList(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
if (sui.hasPid(self, PID_NAME))
|
||||
{
|
||||
int pid = sui.getPid(self, PID_NAME);
|
||||
obj_id target = getIntendedTarget(self);
|
||||
if (!isIdValid(target) || !exists(target))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
String enemyNames = generateStringHateList(target);
|
||||
if (enemyNames != null && !enemyNames.equals(""))
|
||||
{
|
||||
setSUIProperty(pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, enemyNames);
|
||||
flushSUIPage(pid);
|
||||
messageTo(self, "refreshSuiHateList", null, 1, false);
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int getStructureGuildId(obj_id self) throws InterruptedException
|
||||
{
|
||||
int guildId = 0;
|
||||
obj_id structure = player_structure.getStructure(self);
|
||||
if (isIdValid(structure) && hasObjVar(structure, "player_structure.owner") && hasObjVar(structure, "guildId"))
|
||||
{
|
||||
guildId = getIntObjVar(structure, "guildId");
|
||||
if (guildId != 0 && !guildExists(guildId))
|
||||
{
|
||||
removeObjVar(structure, "guildId");
|
||||
guildId = 0;
|
||||
}
|
||||
}
|
||||
if (guildId == 0 && hasObjVar(self, "guildId"))
|
||||
{
|
||||
guildId = getIntObjVar(self, "guildId");
|
||||
if (guildId != 0 && !guildExists(guildId))
|
||||
{
|
||||
removeObjVar(self, "guildId");
|
||||
guildId = 0;
|
||||
}
|
||||
}
|
||||
return guildId;
|
||||
}
|
||||
public String generateStringHateList(obj_id target) throws InterruptedException
|
||||
{
|
||||
obj_id[] enemies = getHateList(target);
|
||||
if (enemies == null || enemies.length == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
String enemyNames = "\n";
|
||||
for (int i = 0; i < enemies.length; ++i)
|
||||
{
|
||||
String enemyStringName = "";
|
||||
if (!isPlayer(enemies[i]))
|
||||
{
|
||||
enemyStringName = "NotAPlayer ObjID(" + enemies[i] + ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
enemyStringName = getPlayerName(enemies[i]);
|
||||
}
|
||||
enemyNames += enemyStringName + "\t\t" + (int)getHate(target, enemies[i]) + "\n";
|
||||
}
|
||||
return enemyNames;
|
||||
}
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
package script.working.jcarpenter;
|
||||
|
||||
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.datatable;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class spawn_recorder extends script.base_script
|
||||
{
|
||||
public spawn_recorder()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!hasObjVar(self, "record_table"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Attach the objvar 'record_table' to yourself with the name of the table to which you want to record");
|
||||
}
|
||||
else
|
||||
{
|
||||
String table = getStringObjVar(self, "record_table");
|
||||
sendSystemMessageTestingOnly(self, "Recording to table: " + table);
|
||||
sendSystemMessageTestingOnly(self, "If this is not correct, change the value of the objvar 'record_table'");
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, "Say 'mark <creature name>' to place a creature or npc at your current location and heading");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (!(toLower(text)).startsWith("mark"))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (!hasObjVar(self, "record_table"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "[ERROR] No datatable specified for recording");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
String table = getStringObjVar(self, "record_table");
|
||||
if (!(toLower(table)).startsWith("datatables") || !(toLower(table)).endsWith(".tab"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "[ERROR] Invalid datatable specified for recording");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
StringTokenizer st = new StringTokenizer(text);
|
||||
String command = st.nextToken();
|
||||
String creature = "";
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
creature = st.nextToken();
|
||||
}
|
||||
obj_id obj = self;
|
||||
if (command.equalsIgnoreCase("markthis"))
|
||||
{
|
||||
obj = getLookAtTarget(self);
|
||||
creature = getTemplateName(obj);
|
||||
}
|
||||
location here = getLocation(obj);
|
||||
float yaw = getYaw(obj);
|
||||
obj_id room = here.cell;
|
||||
obj_id top = getTopMostContainer(obj);
|
||||
String roomName = getRoomName(top, room);
|
||||
sendSystemMessageTestingOnly(self, "Spawning: " + creature + " Location: " + here + " Heading: " + yaw);
|
||||
dictionary dctRow = new dictionary();
|
||||
dctRow.put("spawns", creature);
|
||||
dctRow.put("loc_x", here.x);
|
||||
dctRow.put("loc_y", here.y);
|
||||
dctRow.put("loc_z", here.z);
|
||||
dctRow.put("room", roomName);
|
||||
dctRow.put("yaw", yaw);
|
||||
datatable.serverDataTableAddRow(table, dctRow);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public String getRoomName(obj_id building, obj_id cell) throws InterruptedException
|
||||
{
|
||||
String[] allCells = getCellNames(building);
|
||||
int numberOfCells = allCells.length;
|
||||
for (int i = 0; i < numberOfCells; i++)
|
||||
{
|
||||
String cellName = allCells[i];
|
||||
obj_id thisCell = getCellId(building, cellName);
|
||||
if (thisCell == cell)
|
||||
{
|
||||
return cellName;
|
||||
}
|
||||
}
|
||||
return "no_match";
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,51 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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 broadtest extends script.base_script
|
||||
{
|
||||
public broadtest()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "attached");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("go"))
|
||||
{
|
||||
obj_id lookAt = getLookAtTarget(self);
|
||||
if (lookAt == null)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
listenToMessage(lookAt, "handleBroadcast");
|
||||
debugSpeakMsg(self, "subscribed");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
dictionary stuff = new dictionary();
|
||||
stuff.put("objid", self);
|
||||
if (text.equals("send"))
|
||||
{
|
||||
broadcastMessage("handleBroadcast", stuff);
|
||||
debugSpeakMsg(self, "broadcast");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int handleBroadcast(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "received from " + params.getObjId("objid"));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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 combattest extends script.systems.combat.combat_base
|
||||
{
|
||||
public combattest()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "attached. Detaching AI scripts in 5");
|
||||
messageTo(self, "detachAI", null, 5, false);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int detachAI(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
detachScript(self, "ai.ai");
|
||||
detachScript(self, "ai.creature_combat");
|
||||
stop(self);
|
||||
debugSpeakMsg(self, "ai detached!");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException
|
||||
{
|
||||
if (strText.equals("setTarget"))
|
||||
{
|
||||
debugSpeakMsg(self, "target is set to " + objSpeaker);
|
||||
setTarget(self, objSpeaker);
|
||||
}
|
||||
if (strText.equals("getTarget"))
|
||||
{
|
||||
obj_id objTarget = getTarget(self);
|
||||
debugSpeakMsg(self, "target is " + objTarget);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnDefenderCombatAction(obj_id self, obj_id attacker, obj_id weapon, int combatResult) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "defender_action, locomotion is " + getLocomotion(self) + " and posture is " + getPosture(self));
|
||||
if (hasCombatAction(self))
|
||||
{
|
||||
debugSpeakMsg(self, "I've got combat actions already, returning");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id objTarget = getTarget(self);
|
||||
if ((objTarget == null) || (objTarget == obj_id.NULL_ID))
|
||||
{
|
||||
debugSpeakMsg(self, "setting target to " + attacker);
|
||||
setTarget(self, attacker);
|
||||
}
|
||||
debugSpeakMsg(self, "queueing attack against " + attacker);
|
||||
queueCommand(self, (966697619), attacker, "Test params", COMMAND_PRIORITY_DEFAULT);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public boolean hasCombatAction(obj_id npc) throws InterruptedException
|
||||
{
|
||||
return checkForCombatActions(npc);
|
||||
}
|
||||
public int OnIncapacitated(obj_id self, obj_id attacker) throws InterruptedException
|
||||
{
|
||||
kill(self);
|
||||
debugSpeakMsg(self, "I am dead");
|
||||
detachScript(self, "jfreeman.combattest");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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.utils;
|
||||
import script.library.create;
|
||||
|
||||
public class creaturetest extends script.base_script
|
||||
{
|
||||
public creaturetest()
|
||||
{
|
||||
}
|
||||
public static final String CREATURE_TABLE = "datatables/mob/creatures.iff";
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "attached");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("creaturetest"))
|
||||
{
|
||||
if (utils.hasScriptVar(self, "creatureTest"))
|
||||
{
|
||||
debugSpeakMsg(self, "creaturetest is already running");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
int startTime = getGameTime();
|
||||
debugSpeakMsg(self, "beginning creatureTest " + startTime);
|
||||
utils.setScriptVar(self, "startTime", startTime);
|
||||
utils.setScriptVar(self, "creatureTest", 0);
|
||||
LOG("creaturetest", "BEGIN " + startTime);
|
||||
messageTo(self, "spawnNextCreature", null, 1, false);
|
||||
}
|
||||
else if (text.equals("creaturetest stop"))
|
||||
{
|
||||
utils.removeScriptVar(self, "creatureTest");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int spawnNextCreature(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
if (!utils.hasScriptVar(self, "creatureTest"))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
int creatureNum = utils.getIntScriptVar(self, "creatureTest");
|
||||
int numRows = dataTableGetNumRows(CREATURE_TABLE);
|
||||
if (creatureNum >= numRows)
|
||||
{
|
||||
int startTime = utils.getIntScriptVar(self, "startTime");
|
||||
debugSpeakMsg(self, "creaturetest " + startTime + " is DONE");
|
||||
utils.removeScriptVar(self, "creatureTest");
|
||||
utils.removeScriptVar(self, "startTime");
|
||||
LOG("creaturetest", "END " + startTime);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
String creatureName = dataTableGetString(CREATURE_TABLE, creatureNum, "creatureName");
|
||||
if (creatureName.equals("") || creatureName == null)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
debugServerConsoleMsg(self, "CREATURE NAME IS " + creatureName + " - NUMBER: " + creatureNum);
|
||||
utils.setScriptVar(self, "lastCreature", creatureName);
|
||||
location spawnLoc = getLocation(self);
|
||||
spawnLoc.x += 2;
|
||||
spawnLoc.z += 2;
|
||||
obj_id creature = create.object(creatureName, spawnLoc, false);
|
||||
if (!isIdValid(creature))
|
||||
{
|
||||
String templateName = dataTableGetString(CREATURE_TABLE, creatureName, "template");
|
||||
LOG("creaturetest", "UNABLE TO CREATE " + creatureName + " WITH TEMPLATE " + templateName + "DOES THIS TEMPLATE EXIST?");
|
||||
LOG("creaturetest", creatureName + ":" + templateName);
|
||||
}
|
||||
else
|
||||
{
|
||||
destroyObject(creature);
|
||||
}
|
||||
creatureNum++;
|
||||
utils.setScriptVar(self, "creatureTest", creatureNum);
|
||||
messageTo(self, "spawnNextCreature", null, 1, false);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnImmediateLogout(obj_id self) throws InterruptedException
|
||||
{
|
||||
String creatureName = utils.getStringScriptVar(self, "lastCreature");
|
||||
if (creatureName != null)
|
||||
{
|
||||
LOG("creaturetest", "CLIENT FATAL " + creatureName);
|
||||
debugServerConsoleMsg(self, "CLIENT FATAL " + creatureName);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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 dressnpc extends script.base_script
|
||||
{
|
||||
public dressnpc()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "attached!");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("done"))
|
||||
{
|
||||
debugSpeakMsg(self, "detaching jfreeman.dressnpc");
|
||||
detachScript(self, "jfreeman.dressnpc");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
else if (text.equals("dress"))
|
||||
{
|
||||
obj_id thingToWear = getLookAtTarget(speaker);
|
||||
if (thingToWear == null)
|
||||
{
|
||||
debugSpeakMsg(self, "you aren't looking at anything.");
|
||||
}
|
||||
else
|
||||
{
|
||||
equip(thingToWear, self);
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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.utils;
|
||||
|
||||
public class elev extends script.base_script
|
||||
{
|
||||
public elev()
|
||||
{
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("up"))
|
||||
{
|
||||
playClientEffectObj(self, "clienteffect/elevator_rise.cef", self, null);
|
||||
if (elevatorMove(self, 1) == 0)
|
||||
{
|
||||
sendSystemMessage(self, "You are already on the highest floor", null);
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
else if (text.equals("down"))
|
||||
{
|
||||
playClientEffectObj(self, "clienteffect/elevator_descend.cef", self, null);
|
||||
if (elevatorMove(self, -1) == 0)
|
||||
{
|
||||
sendSystemMessage(self, "You are already on the lowest floor", null);
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
else if (text.equals("out"))
|
||||
{
|
||||
obj_id building = getTopMostContainer(self);
|
||||
if (isIdValid(building) && building != self)
|
||||
{
|
||||
location outLoc = getBuildingEjectLocation(building);
|
||||
utils.warpPlayer(self, outLoc);
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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 followtest extends script.base_script
|
||||
{
|
||||
public followtest()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "attached");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
if (isPlayer(speaker) && text.equals("follow me"))
|
||||
{
|
||||
debugSpeakMsg(self, "following " + getName(speaker));
|
||||
follow(self, speaker, 1f, 5f);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnFollowTargetLost(obj_id self, obj_id target) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "follow target lost");
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
public int OnFollowWaiting(obj_id self, obj_id target) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "follow waiting");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnFollowMoving(obj_id self, obj_id target) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "follow moving");
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
public int OnFollowPathNotFound(obj_id self, obj_id target) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "follow path not found");
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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.utils;
|
||||
|
||||
public class invtest extends script.base_script
|
||||
{
|
||||
public invtest()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "attached!");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnLogin(obj_id self) throws InterruptedException
|
||||
{
|
||||
obj_id bank = utils.getPlayerBank(self);
|
||||
if (!isIdValid(bank))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "bank is invalid");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id inv = utils.getInventoryContainer(self);
|
||||
if (!isIdValid(inv))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "inventory is invalid");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id[] bankContents = getContents(bank);
|
||||
if (bankContents == null)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "bank contents is null");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, "bank has " + bankContents.length + " items");
|
||||
obj_id[] invContents = getContents(inv);
|
||||
if (invContents == null)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "inv contents is null");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, "inv has " + invContents.length + " items");
|
||||
if (invContents.length > bankContents.length)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "moving inv contents to bank");
|
||||
int numMoved = moveObjects(invContents, bank);
|
||||
sendSystemMessageTestingOnly(self, "moved " + numMoved + " objects");
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "moving bank contents to inv");
|
||||
int numMoved = moveObjects(bankContents, inv);
|
||||
sendSystemMessageTestingOnly(self, "moved " + numMoved + " objects");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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.space_transition;
|
||||
|
||||
public class isapvpgod extends script.base_script
|
||||
{
|
||||
public isapvpgod()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Greeting, Human! To begin applying the smackdown, say PVP ON");
|
||||
sendSystemMessageTestingOnly(self, "To discontinue the laying down of the smack, say PVP OFF");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equalsIgnoreCase("pvp on"))
|
||||
{
|
||||
if (isSpaceScene())
|
||||
{
|
||||
space_transition.setPlayerOvert(self, (-615855020));
|
||||
sendSystemMessageTestingOnly(self, "Just start killing Bothans. I'll tell you when to stop.");
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "With what? Your HANDS?! You have to be in space, yo.");
|
||||
}
|
||||
}
|
||||
else if (text.equalsIgnoreCase("pvp off"))
|
||||
{
|
||||
if (isSpaceScene())
|
||||
{
|
||||
obj_id ship = space_transition.getContainingShip(self);
|
||||
space_transition.clearOvertStatus(ship);
|
||||
sendSystemMessageTestingOnly(self, "Ah! Safe, but never innocent. No wonder she still weeps for you.");
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "It is very dark. You are likely to be eaten by a Grue.");
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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 loitertest extends script.base_script
|
||||
{
|
||||
public loitertest()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "attached. Loitering: ");
|
||||
final location anchorLocation = getLocation(self);
|
||||
final float minDistance = 10.0f;
|
||||
final float maxDistance = 30.0f;
|
||||
final float minDelay = 3.0f;
|
||||
final float maxDelay = 8.0f;
|
||||
loiterLocation(self, anchorLocation, minDistance, maxDistance, minDelay, maxDelay);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnLoiterMoving(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "loiter moving");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnLoiterWaypoint(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "loiter waypoint");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnLoiterWaiting(obj_id self, modifiable_float time) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "loiter waiting");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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.utils;
|
||||
|
||||
public class makemites extends script.base_script
|
||||
{
|
||||
public makemites()
|
||||
{
|
||||
}
|
||||
public int OnDetach(obj_id self) throws InterruptedException
|
||||
{
|
||||
removeObjVar(self, "rockMiteMaking");
|
||||
if (hasObjVar(self, "miteReg"))
|
||||
{
|
||||
killAllMites(self);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnRemovingFromWorld(obj_id self) throws InterruptedException
|
||||
{
|
||||
removeObjVar(self, "rockMiteMaking");
|
||||
if (hasObjVar(self, "miteReg"))
|
||||
{
|
||||
killAllMites(self);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
location myLoc = getLocation(self);
|
||||
if (text.equals("go"))
|
||||
{
|
||||
if (hasObjVar(self, "rockMiteMaking"))
|
||||
{
|
||||
debugSpeakMsg(self, "I'm still making rock mites!");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
setObjVar(self, "rockMiteMaking", 0);
|
||||
messageTo(self, "spawnMite", null, 0, false);
|
||||
}
|
||||
else if ((text.equals("stop") || text.equals("die")) && hasObjVar(self, "rockMiteMaking"))
|
||||
{
|
||||
removeObjVar(self, "rockMiteMaking");
|
||||
}
|
||||
if (text.equals("die") && hasObjVar(self, "miteReg"))
|
||||
{
|
||||
killAllMites(self);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int spawnMite(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
if (!hasObjVar(self, "rockMiteMaking"))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
int numSpawned = getIntObjVar(self, "rockMiteMaking");
|
||||
location spawnLoc = new location(getLocation(self));
|
||||
spawnLoc.x += rand(-15, 15);
|
||||
spawnLoc.z += rand(-15, 15);
|
||||
String templateName = "object/creature/monster/rock_mite/rock_mite_desert_";
|
||||
switch (rand(0, 3))
|
||||
{
|
||||
case 0:
|
||||
templateName = templateName + "giant.iff";
|
||||
break;
|
||||
case 1:
|
||||
templateName = templateName + "large.iff";
|
||||
break;
|
||||
case 2:
|
||||
templateName = templateName + "medium.iff";
|
||||
break;
|
||||
case 3:
|
||||
templateName = templateName + "small.iff";
|
||||
break;
|
||||
}
|
||||
obj_id mite = createObject(templateName, spawnLoc);
|
||||
registerMite(self, mite);
|
||||
numSpawned++;
|
||||
if (numSpawned > 19)
|
||||
{
|
||||
debugSpeakMsg(self, "I made 20 rock mites!");
|
||||
removeObjVar(self, "rockMiteMaking");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
setObjVar(self, "rockMiteMaking", numSpawned);
|
||||
messageTo(self, "spawnMite", null, 1, false);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void registerMite(obj_id player, obj_id mite) throws InterruptedException
|
||||
{
|
||||
if (!hasObjVar(player, "miteReg"))
|
||||
{
|
||||
obj_id[] mites = new obj_id[1];
|
||||
mites[0] = mite;
|
||||
setObjVar(player, "miteReg", mites);
|
||||
return;
|
||||
}
|
||||
Vector mites = getResizeableObjIdArrayObjVar(player, "miteReg");
|
||||
mites = utils.addElement(mites, mite);
|
||||
if (mites != null && mites.size() > 0)
|
||||
{
|
||||
setObjVar(player, "miteReg", mites);
|
||||
}
|
||||
}
|
||||
public void killAllMites(obj_id player) throws InterruptedException
|
||||
{
|
||||
obj_id[] mites = getObjIdArrayObjVar(player, "miteReg");
|
||||
for (int i = 0; i < mites.length; i++)
|
||||
{
|
||||
destroyObject(mites[i]);
|
||||
}
|
||||
removeObjVar(player, "miteReg");
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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.pet_lib;
|
||||
import script.library.ai_lib;
|
||||
|
||||
public class makepet extends script.base_script
|
||||
{
|
||||
public makepet()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "attached.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
if (pet_lib.hasMaster(self))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (ai_lib.isAiDead(self))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (text.equals("pet"))
|
||||
{
|
||||
dictionary params = new dictionary();
|
||||
params.put("pet", self);
|
||||
params.put("master", speaker);
|
||||
messageTo(self, "handleAddMaster", params, 1, true);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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 movetest extends script.base_script
|
||||
{
|
||||
public movetest()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "attached");
|
||||
location destLoc = new location(getLocation(self));
|
||||
destLoc.x = 0;
|
||||
destLoc.z = 0;
|
||||
pathTo(self, destLoc);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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 msgtest extends script.base_script
|
||||
{
|
||||
public msgtest()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
messageTo(self, "handleTest", null, 0, false);
|
||||
messageTo(self, "handleOtherTest", null, 20, true);
|
||||
messageTo(self, "handleLastTest", null, 21, false);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int handleTest(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "received non-persisted zero-length message");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int handleOtherTest(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "received persisted 20-second delay message");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int handleLastTest(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "received non-persisted 21-second delay message");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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 msgtestbase extends script.base_script
|
||||
{
|
||||
public msgtestbase()
|
||||
{
|
||||
}
|
||||
public int handleTest(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "msg test base received message");
|
||||
debugSpeakMsg(self, "this should not have happened, if this script was attached first.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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 runfast extends script.base_script
|
||||
{
|
||||
public runfast()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "attached: say 'runfast' to increase your speed");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("runfast"))
|
||||
{
|
||||
float movePercent = getMovementPercent(self);
|
||||
debugSpeakMsg(self, "old speed: " + movePercent);
|
||||
movePercent = movePercent * 2f;
|
||||
setMovementPercent(self, movePercent);
|
||||
debugSpeakMsg(self, "new speed: " + movePercent);
|
||||
}
|
||||
else if (text.equals("runslow"))
|
||||
{
|
||||
float movePercent = getMovementPercent(self);
|
||||
debugSpeakMsg(self, "old speed: " + movePercent);
|
||||
movePercent = movePercent / 2f;
|
||||
setMovementPercent(self, movePercent);
|
||||
debugSpeakMsg(self, "new speed: " + movePercent);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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 scriptvartest extends script.base_script
|
||||
{
|
||||
public scriptvartest()
|
||||
{
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
if (!text.equals("scriptvartest"))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id target = getLookAtTarget(speaker);
|
||||
if (target == null)
|
||||
{
|
||||
debugSpeakMsg(self, "Look-at something and then say scriptvartest");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
else if (target == self)
|
||||
{
|
||||
debugSpeakMsg(self, "I know I can set scriptvars on myself. Look at something else");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
deltadictionary targetScriptVars = target.getScriptVars();
|
||||
int testScriptVar = targetScriptVars.getInt("scriptvartest");
|
||||
debugSpeakMsg(self, "spriptvar test value on " + target + " is " + testScriptVar);
|
||||
testScriptVar++;
|
||||
targetScriptVars.put("scriptvartest", testScriptVar);
|
||||
deltadictionary newTargetScriptVars = target.getScriptVars();
|
||||
int newTestScriptVar = newTargetScriptVars.getInt("scriptvartest");
|
||||
debugSpeakMsg(self, "Immediately: spriptvar test value on " + target + " is " + newTestScriptVar);
|
||||
dictionary parms = new dictionary();
|
||||
parms.put("target", target);
|
||||
messageTo(self, "handleRecheck", parms, 2, false);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int handleRecheck(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
obj_id target = params.getObjId("target");
|
||||
if (target == null || target == obj_id.NULL_ID)
|
||||
{
|
||||
debugSpeakMsg(self, "target is fuxed");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
deltadictionary targetScriptVars = target.getScriptVars();
|
||||
int testScriptVar = targetScriptVars.getInt("scriptvartest");
|
||||
debugSpeakMsg(self, "After Call Back: spriptvar test value on " + target + " is " + testScriptVar);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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 skilltest extends script.base_script
|
||||
{
|
||||
public skilltest()
|
||||
{
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equalsIgnoreCase("choose"))
|
||||
{
|
||||
playUiEffect(self, "showMediator=ws_professiontemplateselect");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (text.equalsIgnoreCase("reset"))
|
||||
{
|
||||
debugSpeakMsg(self, "resetting");
|
||||
setSkillTemplate(self, "");
|
||||
setWorkingSkill(self, "");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnCreatureDamaged(obj_id self, obj_id attacker, obj_id weapon, int[] damage) throws InterruptedException
|
||||
{
|
||||
setHealth(self, getMaxHealth(self));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
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 tutorial_request_test extends script.base_script
|
||||
{
|
||||
public tutorial_request_test()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
newbieTutorialRequest(self, "openInventory");
|
||||
newbieTutorialRequest(self, "closeInventory");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnNewbieTutorialResponse(obj_id self, String action) throws InterruptedException
|
||||
{
|
||||
if (action.equals("openInventory"))
|
||||
{
|
||||
debugSpeakMsg(self, "opened inventory!");
|
||||
newbieTutorialRequest(self, "openInventory");
|
||||
}
|
||||
else if (action.equals("closeInventory"))
|
||||
{
|
||||
debugSpeakMsg(self, "closed inventory!");
|
||||
newbieTutorialRequest(self, "closeInventory");
|
||||
}
|
||||
debugSpeakMsg(self, "woah : " + action);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
package script.working.jfreeman;
|
||||
|
||||
import script.*;
|
||||
import script.base_class.*;
|
||||
import script.combat_engine.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import script.base_script;
|
||||
|
||||
import script.library.create;
|
||||
import script.library.factions;
|
||||
import script.library.utils;
|
||||
import script.ai.ai_combat;
|
||||
|
||||
public class wartest extends script.base_script
|
||||
{
|
||||
public wartest()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
utils.removeScriptVar(self, "myWarriors");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String txt) throws InterruptedException
|
||||
{
|
||||
if (txt.equals("go"))
|
||||
{
|
||||
if (!utils.hasScriptVar(self, "myWarriors"))
|
||||
{
|
||||
spawnGroup(self, "group1", 20);
|
||||
spawnGroup(self, "group2", -20);
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSpeakMsg(self, "already going");
|
||||
}
|
||||
}
|
||||
else if (txt.equals("fight"))
|
||||
{
|
||||
startFight(self);
|
||||
}
|
||||
else if (txt.equals("stop"))
|
||||
{
|
||||
killWarriors(self);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void spawnGroup(obj_id chris, String group, int offset) throws InterruptedException
|
||||
{
|
||||
Vector warriors = new Vector();
|
||||
warriors.setSize(0);
|
||||
if (utils.hasScriptVar(chris, "myWarriors"))
|
||||
{
|
||||
warriors = utils.getResizeableObjIdArrayScriptVar(chris, "myWarriors");
|
||||
}
|
||||
location groupLoc = new location(getLocation(chris));
|
||||
groupLoc.x += offset;
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
obj_id npc = create.object("pirate", groupLoc);
|
||||
warriors = utils.addElement(warriors, npc);
|
||||
factions.setFaction(npc, group);
|
||||
}
|
||||
utils.setScriptVar(chris, "myWarriors", warriors);
|
||||
}
|
||||
public void killWarriors(obj_id chris) throws InterruptedException
|
||||
{
|
||||
if (!utils.hasScriptVar(chris, "myWarriors"))
|
||||
{
|
||||
debugSpeakMsg(chris, "none spawned");
|
||||
return;
|
||||
}
|
||||
obj_id[] warriors = utils.getObjIdArrayScriptVar(chris, "myWarriors");
|
||||
if (warriors.length < 100)
|
||||
{
|
||||
debugSpeakMsg(chris, "not done spawning yet " + warriors.length);
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < warriors.length; i++)
|
||||
{
|
||||
if (exists(warriors[i]))
|
||||
{
|
||||
destroyObject(warriors[i]);
|
||||
}
|
||||
}
|
||||
utils.removeScriptVar(chris, "myWarriors");
|
||||
}
|
||||
public void startFight(obj_id chris) throws InterruptedException
|
||||
{
|
||||
if (!utils.hasScriptVar(chris, "myWarriors"))
|
||||
{
|
||||
debugSpeakMsg(chris, "no warriors");
|
||||
return;
|
||||
}
|
||||
obj_id[] warriors = utils.getObjIdArrayScriptVar(chris, "myWarriors");
|
||||
if (warriors.length < 100)
|
||||
{
|
||||
debugSpeakMsg(chris, "not done spawning yet");
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
if (exists(warriors[i]) && exists(warriors[i + 50]))
|
||||
{
|
||||
startCombat(warriors[i], warriors[i + 50]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,146 +0,0 @@
|
||||
package script.working;
|
||||
|
||||
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 java.util.StringTokenizer;
|
||||
import java.lang.Math;
|
||||
import script.library.ai_lib;
|
||||
import script.library.buff;
|
||||
import script.library.beast_lib;
|
||||
import script.library.create;
|
||||
import script.library.expertise;
|
||||
import script.library.groundquests;
|
||||
import script.library.guild;
|
||||
import script.library.incubator;
|
||||
import script.library.instance;
|
||||
import script.library.npe;
|
||||
import script.library.player_structure;
|
||||
import script.library.pet_lib;
|
||||
import script.library.skill;
|
||||
import script.library.skill_template;
|
||||
import script.library.space_combat;
|
||||
import script.library.space_flags;
|
||||
import script.library.space_quest;
|
||||
import script.library.static_item;
|
||||
import script.library.sui;
|
||||
import script.library.transition;
|
||||
import script.library.trial;
|
||||
import script.library.utils;
|
||||
|
||||
public class jmichener_test extends script.base_script
|
||||
{
|
||||
public jmichener_test()
|
||||
{
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
obj_id player = self;
|
||||
if (isGod(player))
|
||||
{
|
||||
StringTokenizer st = new java.util.StringTokenizer(text);
|
||||
int tokens = st.countTokens();
|
||||
String command = null;
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
command = st.nextToken();
|
||||
}
|
||||
if (command.equals("list_player_buffs"))
|
||||
{
|
||||
int[] playerBuffs = buff.getAllBuffs(player);
|
||||
String[] strPlayerBuffs = new String[playerBuffs.length];
|
||||
for (int i = 0; i < playerBuffs.length; i++)
|
||||
{
|
||||
strPlayerBuffs[i] = buff.getBuffNameFromCrc(playerBuffs[i]);
|
||||
sendSystemMessageTestingOnly(player, strPlayerBuffs[i]);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("remove_player_buffs"))
|
||||
{
|
||||
buff.removeAllBuffs(player);
|
||||
sendSystemMessageTestingOnly(player, "All buffs have been removed from player");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("remove_entertainer_invis_buff"))
|
||||
{
|
||||
buff.removeBuff(player, "col_ent_invis_buff_tracker");
|
||||
sendSystemMessageTestingOnly(player, "Entertainer Timer Buff Removed(Build-A-Buff collection)");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("check_has_entertainer_invis_buff"))
|
||||
{
|
||||
if (buff.hasBuff(player, "col_ent_invis_buff_tracker"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(player, "player has buff: 'col_ent_invis_buff_tracker'.");
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(player, "player does NOT have buff: 'col_ent_invis_buff_tracker'.");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("remove_heroic_sd_invis_buff"))
|
||||
{
|
||||
buff.removeBuff(player, "col_sd_invis_buff_tracker");
|
||||
sendSystemMessageTestingOnly(player, "Heroic SD Taxi Buff Removed");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("check_has_heroic_sd_invis_buff"))
|
||||
{
|
||||
if (buff.hasBuff(player, "col_sd_invis_buff_tracker"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(player, "player has buff: 'col_sd_invis_buff_tracker'.");
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(player, "player does NOT have buff: 'col_sd_invis_buff_tracker'.");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (command.equals("bypass_harvest_roll"))
|
||||
{
|
||||
utils.setScriptVar(player, "qa.resource_roll_bypass", "testing");
|
||||
sendSystemMessageTestingOnly(player, "resource roll has been bypassed - drop rate for exceptionals is 100%");
|
||||
}
|
||||
if (command.equals("remove_bypass_harvest_roll"))
|
||||
{
|
||||
utils.removeScriptVar(player, "qa.resource_roll_bypass");
|
||||
sendSystemMessageTestingOnly(player, "resource roll has been negated - drop rate for exceptionals is no longer bypassed");
|
||||
}
|
||||
if (command.equals("durni"))
|
||||
{
|
||||
location myLoc = getLocation(self);
|
||||
create.object("durni", myLoc, true);
|
||||
sendSystemMessageTestingOnly(player, "you created a durni");
|
||||
}
|
||||
if (command.equals("stop_regen"))
|
||||
{
|
||||
float QARegenRate = getActionRegenRate(player);
|
||||
setObjVar(player, "QARegenRate", QARegenRate);
|
||||
getActionRegenRate(player, 0);
|
||||
sendSystemMessageTestingOnly(player, "Your Regen Rate has been set to Zero!");
|
||||
}
|
||||
if (command.equals("restore_regen"))
|
||||
{
|
||||
float myStoredRegen = getFloatObjVar(player, "QARegenRate");
|
||||
getActionRegenRate(player, myStoredRegen);
|
||||
removeObjVar(self, "QARegenRate");
|
||||
if (!hasObjVar(player, "QARegenRate"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(player, "Your Action Regen Rate has been restored");
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(player, "Problem - Regen Rate was not restored!");
|
||||
}
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package script.working.justin;
|
||||
|
||||
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 test_scriptvar extends script.base_script
|
||||
{
|
||||
public test_scriptvar()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
deltadictionary vars = self.getScriptVars();
|
||||
vars.put("test", "value");
|
||||
debugServerConsoleMsg(self, "On attach, added test/value to script vars");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnDetach(obj_id self) throws InterruptedException
|
||||
{
|
||||
deltadictionary vars = self.getScriptVars();
|
||||
String s = vars.getString("test");
|
||||
debugServerConsoleMsg(self, "OnDetach, getting test " + s);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public String test_console(String params) throws InterruptedException
|
||||
{
|
||||
debugServerConsoleMsg(obj_id.NULL_ID, "test_console");
|
||||
int weather = 0;
|
||||
try
|
||||
{
|
||||
Integer i = new Integer(params);
|
||||
weather = i.intValue();
|
||||
}
|
||||
catch(NumberFormatException err)
|
||||
{
|
||||
weather = 0;
|
||||
}
|
||||
setWeatherData(weather, 20, 20);
|
||||
return "Weather set to " + params;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equals("makeWaypoint"))
|
||||
{
|
||||
obj_id waypoint = createWaypointInDatapad(self, getLocation(self));
|
||||
setWaypointName(waypoint, "test waypoint");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,205 +0,0 @@
|
||||
package script.working.justin;
|
||||
|
||||
import script.*;
|
||||
import script.base_class.*;
|
||||
import script.combat_engine.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import script.base_script;
|
||||
|
||||
import script.library.create;
|
||||
import script.library.quests;
|
||||
import script.library.chat;
|
||||
import script.library.factions;
|
||||
import script.library.utils;
|
||||
import script.library.fs_quests;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.InputStream;
|
||||
import java.lang.Math;
|
||||
import java.lang.Runtime;
|
||||
|
||||
public class utilities extends script.base_script
|
||||
{
|
||||
public utilities()
|
||||
{
|
||||
}
|
||||
public void usage(obj_id self) throws InterruptedException
|
||||
{
|
||||
chat.chat(self, "Usagement!: utility <cmd> [<args ...>]");
|
||||
chat.chat(self, "commands: ");
|
||||
chat.chat(self, "grantSkills - grant all skills to yourself");
|
||||
chat.chat(self, "quest - execute a quest command dammit!!?");
|
||||
chat.chat(self, " activate <name> - activate a quest named <name> from player.quests datatable");
|
||||
chat.chat(self, " clear - clear all quest bits");
|
||||
chat.chat(self, "spawn <name> - spawn a creature from creatures.tab");
|
||||
chat.chat(self, "faction <faction name> <pounts - set your faction standing");
|
||||
chat.chat(self, "makeFsVillageEligible");
|
||||
chat.chat(self, "makeFsVillageIneligible");
|
||||
chat.chat(self, "unlock <branch> - unlock fs branch using the fs_quests library. E.g. force_sensitive_combat_prowess_ranged_speed");
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.startsWith("utility"))
|
||||
{
|
||||
java.util.StringTokenizer st = new java.util.StringTokenizer(text);
|
||||
st.nextToken();
|
||||
String cmd = st.nextToken();
|
||||
if (cmd.equals("grantSkills"))
|
||||
{
|
||||
grantSkill(self, "combat_unarmed_master");
|
||||
obj_id pInv = utils.getInventoryContainer(self);
|
||||
if (isIdValid(pInv))
|
||||
{
|
||||
createObject("object/tangible/terminal/terminal_character_builder.iff", pInv, "");
|
||||
}
|
||||
}
|
||||
else if (cmd.equals("completed"))
|
||||
{
|
||||
String arg1 = st.nextToken();
|
||||
if (arg1 != null)
|
||||
{
|
||||
Object[] params = new Object[3];
|
||||
params[0] = self;
|
||||
params[1] = arg1;
|
||||
params[2] = new Boolean(true);
|
||||
script_entry.runScripts("OnForceSensitiveQuestCompleted", params);
|
||||
}
|
||||
}
|
||||
else if (cmd.equals("showOff"))
|
||||
{
|
||||
chat.chat(self, "Hi there BANDIT!!!");
|
||||
}
|
||||
else if (cmd.equals("quest"))
|
||||
{
|
||||
String arg1 = st.nextToken();
|
||||
if (arg1 != null)
|
||||
{
|
||||
if (arg1.equals("activate"))
|
||||
{
|
||||
String arg2 = st.nextToken();
|
||||
if (arg2 != null)
|
||||
{
|
||||
int questId = questGetQuestId(arg2);
|
||||
questActivateQuest(questId, self, null);
|
||||
}
|
||||
}
|
||||
else if (arg1.equals("clear"))
|
||||
{
|
||||
String arg2 = st.nextToken();
|
||||
if (arg2 != null)
|
||||
{
|
||||
int questId = questGetQuestId(arg2);
|
||||
questClearQuest(questId, self);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (cmd.equals("faction"))
|
||||
{
|
||||
String arg1 = st.nextToken();
|
||||
if (arg1 != null)
|
||||
{
|
||||
String arg2 = st.nextToken();
|
||||
if (arg2 != null)
|
||||
{
|
||||
int points = utils.stringToInt(arg2);
|
||||
factions.setFactionStanding(self, arg1, points);
|
||||
chat.chat(self, "set faction standing for " + arg1 + " to " + points);
|
||||
}
|
||||
else
|
||||
{
|
||||
usage(self);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
usage(self);
|
||||
}
|
||||
}
|
||||
else if (cmd.equals("requestLocation"))
|
||||
{
|
||||
requestLocation(self, "testrequest", getLocation(self), 512.0f, 128.0f, true, true);
|
||||
}
|
||||
else if (cmd.equals("spawn"))
|
||||
{
|
||||
String arg1 = st.nextToken();
|
||||
if (arg1 != null)
|
||||
{
|
||||
location l = getLocation(self);
|
||||
l.x += 2;
|
||||
obj_id creature = create.createCreature(arg1, l, true);
|
||||
}
|
||||
}
|
||||
else if (cmd.equals("makeFsVillageEligible"))
|
||||
{
|
||||
fs_quests.makeVillageEligible(self);
|
||||
}
|
||||
else if (cmd.equals("makeFsVillageIneligible"))
|
||||
{
|
||||
removeObjVar(self, fs_quests.VAR_VILLAGE_ELIGIBLE);
|
||||
}
|
||||
else if (cmd.equals("unlock"))
|
||||
{
|
||||
String arg1 = st.nextToken();
|
||||
if (arg1 != null)
|
||||
{
|
||||
boolean success = fs_quests.unlockBranch(self, arg1);
|
||||
if (!success)
|
||||
{
|
||||
chat.chat(self, "could not unlock " + arg1);
|
||||
}
|
||||
else
|
||||
{
|
||||
chat.chat(self, arg1 + " has been unlocked");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (cmd.equals("rad2deg"))
|
||||
{
|
||||
String arg1 = st.nextToken();
|
||||
if (arg1 != null)
|
||||
{
|
||||
float rads = utils.stringToFloat(arg1);
|
||||
float degs = (float)Math.toDegrees(rads);
|
||||
chat.chat(self, "" + degs);
|
||||
}
|
||||
}
|
||||
else if (cmd.equals("cover"))
|
||||
{
|
||||
chat.chat(self, "calling setCreatureCoverVisibility(" + self + ", true)");
|
||||
setCreatureCoverVisibility(self, false);
|
||||
}
|
||||
else if (cmd.equals("uncover"))
|
||||
{
|
||||
setCreatureCoverVisibility(self, true);
|
||||
}
|
||||
else if (cmd.equals("getcover"))
|
||||
{
|
||||
if (getCreatureCoverVisibility(self))
|
||||
{
|
||||
chat.chat(self, "I am visible");
|
||||
}
|
||||
else
|
||||
{
|
||||
chat.chat(self, "I am not visible");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
usage(self);
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnLocationReceived(obj_id self, String locationId, obj_id locationObject, location locationLocation, float locationRadius) throws InterruptedException
|
||||
{
|
||||
LOG("testlocation", "locationId=" + locationId);
|
||||
chat.chat(self, "locationId=" + locationId);
|
||||
chat.chat(self, "locationObject = " + locationObject);
|
||||
destroyObject(locationObject);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,436 +0,0 @@
|
||||
package script.working.kai;
|
||||
|
||||
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.weapons;
|
||||
import script.library.player_structure;
|
||||
import script.library.utils;
|
||||
import java.util.StringTokenizer;
|
||||
import script.library.loot;
|
||||
import script.library.ai_lib;
|
||||
import script.library.stealth;
|
||||
import script.library.buff;
|
||||
import script.library.dot;
|
||||
|
||||
public class magic extends script.base_script
|
||||
{
|
||||
public magic()
|
||||
{
|
||||
}
|
||||
public void printTokens(StringTokenizer st) throws InterruptedException
|
||||
{
|
||||
LOG("LOG_CHANNEL", "tokens -> " + st.countTokens() + " nextToken ->" + st.nextToken());
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
if (speaker != self)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (!hasObjVar(speaker, "kai"))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (text.startsWith("where"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (!isIdValid(target))
|
||||
{
|
||||
target = self;
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, getName(target) + " is at " + (getLocation(target)).toString());
|
||||
}
|
||||
if (text.startsWith("enemycheck"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (!isIdValid(target))
|
||||
{
|
||||
target = self;
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, getName(target) + " isEnemy=" + pvpIsEnemy(self, target) + ", canAttack=" + pvpCanAttack(self, target));
|
||||
}
|
||||
if (text.startsWith("testclass"))
|
||||
{
|
||||
boolean rslt = utils.testItemClassRequirements(self, getLookAtTarget(self), false, "trap.");
|
||||
sendSystemMessageTestingOnly(self, "Pass Class requirements: " + rslt);
|
||||
}
|
||||
if (text.startsWith("getowner"))
|
||||
{
|
||||
obj_id owner = getOwner(getLookAtTarget(self));
|
||||
sendSystemMessageTestingOnly(self, "Owner for " + getName(getLookAtTarget(self)) + " is " + getName(owner));
|
||||
}
|
||||
if (text.startsWith("getpl"))
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(text);
|
||||
printTokens(st);
|
||||
String lvl = "";
|
||||
int level = 1;
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
level = utils.stringToInt(st.nextToken());
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, "Level " + level + " gives power of " + stealth.getPowerLevel(level, false));
|
||||
}
|
||||
obj_id inv = utils.getInventoryContainer(self);
|
||||
if (text.startsWith("getsv"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (!isIdValid(target))
|
||||
{
|
||||
target = self;
|
||||
}
|
||||
deltadictionary dd = target.getScriptVars();
|
||||
sendSystemMessageTestingOnly(self, dd.toString());
|
||||
}
|
||||
if (text.startsWith("hurt"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (!isIdValid(target))
|
||||
{
|
||||
target = self;
|
||||
}
|
||||
hit_result hit = new hit_result();
|
||||
hit.damage = 1000;
|
||||
hit.hitLocation = 0;
|
||||
doDamage(target, self, hit);
|
||||
}
|
||||
if (text.startsWith("dodot"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (!isIdValid(target))
|
||||
{
|
||||
target = self;
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, "APPLY DOT=" + dot.applyBleedingEffect(self, target, "bleed777", 0, 5000, 15));
|
||||
}
|
||||
if (text.startsWith("mycontainer"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "MyContainer=" + getTopMostContainer(self));
|
||||
}
|
||||
if (text.startsWith("spy1"))
|
||||
{
|
||||
buff.applyBuff(self, "invis_sp_buff_invis_1");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (text.startsWith("smug"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Applied=" + buff.applyBuff(self, "invis_sm_buff_invis_1"));
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (text.startsWith("act"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "action Up!");
|
||||
setMaxAttrib(self, ACTION, 10000);
|
||||
setAttrib(self, ACTION, 10000);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (text.startsWith("steal"))
|
||||
{
|
||||
if (stealth.canSteal(self, getLookAtTarget(self)))
|
||||
{
|
||||
stealth.steal(self, getLookAtTarget(self));
|
||||
}
|
||||
}
|
||||
if (text.startsWith("gettab"))
|
||||
{
|
||||
String bleh = stealth.getStealableTemplateFromTable(self);
|
||||
sendSystemMessageTestingOnly(self, bleh);
|
||||
}
|
||||
if (text.startsWith("dtype"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (!isIdValid(target))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "No target.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
weapons.setWeaponData(target);
|
||||
}
|
||||
if (text.startsWith("cleaninvis"))
|
||||
{
|
||||
utils.removeScriptVar(self, stealth.INVIS_UPKEEP_MSG_DISPATCHED);
|
||||
}
|
||||
if (text.startsWith("loc"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Location is" + (getLocation(getLookAtTarget(self))).toString());
|
||||
}
|
||||
if (text.startsWith("regen"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Regen multiplier is 0");
|
||||
}
|
||||
if (text.startsWith("getname"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Name is: '" + getName(getLookAtTarget(self)) + "'");
|
||||
}
|
||||
if (text.startsWith("getcount"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Count is: '" + getCount(getLookAtTarget(self)) + "'");
|
||||
}
|
||||
if (text.startsWith("getcommands"))
|
||||
{
|
||||
String[] commands = getCommandListingForPlayer(getLookAtTarget(self));
|
||||
sendSystemMessageTestingOnly(self, "Commands:");
|
||||
for (int i = 0; i < commands.length; i++)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "'" + commands[i] + "'");
|
||||
}
|
||||
}
|
||||
if ((toLower(text)).startsWith("incapcount"))
|
||||
{
|
||||
int num = 0;
|
||||
if (hasObjVar(getLookAtTarget(self), "combat.intIncapacitationCount"))
|
||||
{
|
||||
num = getIntObjVar(self, "combat.intIncapacitationCount");
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, "# of timers incap'd = " + num);
|
||||
}
|
||||
if ((toLower(text)).startsWith("damage"))
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(text);
|
||||
if (st.countTokens() != 3)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (!isIdValid(target))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
String command = st.nextToken();
|
||||
String attribStr = st.nextToken();
|
||||
String amountStr = st.nextToken();
|
||||
attribute[] attrib = getAttribs(target);
|
||||
int amount = utils.stringToInt(amountStr);
|
||||
if (attribStr.equals("health"))
|
||||
{
|
||||
attrib[HEALTH] = new attribute(attrib[HEALTH].getType(), (attrib[HEALTH].getValue() - amount));
|
||||
}
|
||||
else if (attribStr.equals("action"))
|
||||
{
|
||||
attrib[ACTION] = new attribute(attrib[ACTION].getType(), (attrib[ACTION].getValue() - amount));
|
||||
}
|
||||
else if (attribStr.equals("mind"))
|
||||
{
|
||||
attrib[MIND] = new attribute(attrib[MIND].getType(), (attrib[MIND].getValue() - amount));
|
||||
}
|
||||
else if (attribStr.equals("all"))
|
||||
{
|
||||
for (int i = 0; i < attrib.length; i += NUM_ATTRIBUTES_PER_GROUP)
|
||||
{
|
||||
attrib[i] = new attribute(attrib[i].getType(), (attrib[i].getValue() - amount));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
for (int j = 0; j < attrib.length; j += NUM_ATTRIBUTES_PER_GROUP)
|
||||
{
|
||||
if (attrib[j].getValue() < 1)
|
||||
{
|
||||
attrib[j] = new attribute(attrib[j].getType(), 1);
|
||||
}
|
||||
}
|
||||
if (setAttribs(target, attrib))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "...target successully damaged...");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (text.startsWith("getniche"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Niche for " + getLookAtTarget(self) + " = " + ai_lib.aiGetNiche(getLookAtTarget(self)));
|
||||
}
|
||||
if (text.startsWith("whichgroup"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Group Object for " + getLookAtTarget(self) + " = " + getGroupObject(getLookAtTarget(self)));
|
||||
}
|
||||
if (text.startsWith("mobtest"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "isMob(" + getLookAtTarget(self) + ") = " + isMob(getLookAtTarget(self)));
|
||||
}
|
||||
if (text.startsWith("listdp"))
|
||||
{
|
||||
obj_id dp = utils.getPlayerDatapad(self);
|
||||
obj_id[] things = getContents(dp);
|
||||
for (int i = 0; i < things.length; i++)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Item[" + i + "] = " + things[i] + ", " + getTemplateName(things[i]) + ")");
|
||||
obj_id[] thingcontents = getContents(things[i]);
|
||||
for (int x = 0; x < thingcontents.length; x++)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "--Item[" + x + "] = " + thingcontents[x] + ", " + getTemplateName(thingcontents[x]) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (text.equals("packHouse"))
|
||||
{
|
||||
player_structure.packBuilding(self, getLookAtTarget(self));
|
||||
sendSystemMessageTestingOnly(self, "Did i crash");
|
||||
}
|
||||
if (text.startsWith("cleandp"))
|
||||
{
|
||||
obj_id dp = utils.getPlayerDatapad(self);
|
||||
obj_id[] things = getContents(dp);
|
||||
for (int i = 0; i < things.length; i++)
|
||||
{
|
||||
destroyObject(things[i]);
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, "DP cleaned.");
|
||||
}
|
||||
if (text.startsWith("sockets"))
|
||||
{
|
||||
setSkillModSockets(utils.stringToObjId("10590100"), 4);
|
||||
}
|
||||
if (text.startsWith("wcreate"))
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(text);
|
||||
printTokens(st);
|
||||
String name = "";
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
name = st.nextToken();
|
||||
}
|
||||
float num = 1.0f;
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
num = utils.stringToFloat(st.nextToken());
|
||||
}
|
||||
LOG("weapons", "Creating weapon " + name + " at " + num + " capacity.");
|
||||
weapons.createWeapon(name, speaker, weapons.VIA_SCHEMATIC, num);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if ((toLower(text)).equals("grant all weapon schematics"))
|
||||
{
|
||||
LOG("weapons", "Granting schematics");
|
||||
weapons.grantOrDenyAllWeaponSchematics("all", getLookAtTarget(self), weapons.VIA_SCHEMATIC, true);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if ((toLower(text)).equals("revoke all weapon schematics"))
|
||||
{
|
||||
LOG("weapons", "Revoking schematics");
|
||||
weapons.grantOrDenyAllWeaponSchematics("all", getLookAtTarget(self), weapons.VIA_SCHEMATIC, false);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if ((toLower(text)).equals("lootdata"))
|
||||
{
|
||||
LOG("loot", "Fetching loot data for object ");
|
||||
obj_id item = getLookAtTarget(self);
|
||||
if (!isIdValid(item))
|
||||
{
|
||||
LOG("loot", "No valid lookat target to get loot data for..." + item);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
dictionary weaponCraftingData = loot.getComponentData(item);
|
||||
if (weaponCraftingData == null)
|
||||
{
|
||||
LOG("loot", "Couldn't find data for ..." + item);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
LOG("loot", "Object loot data for " + item + " as follows:");
|
||||
LOG("loot", "---------------------------------------------");
|
||||
LOG("loot", weaponCraftingData.toString());
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if ((toLower(text)).startsWith("makelootweapon"))
|
||||
{
|
||||
LOG("loot", "Creating loot weapon for object ");
|
||||
obj_id item = getLookAtTarget(self);
|
||||
if (!isIdValid(item))
|
||||
{
|
||||
LOG("loot", "No valid lookat target to transform into a loot item..." + item);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
StringTokenizer st = new StringTokenizer(text);
|
||||
printTokens(st);
|
||||
String level = "1";
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
level = st.nextToken();
|
||||
}
|
||||
int lev = utils.stringToInt(level);
|
||||
if (lev < 1 || lev > 350)
|
||||
{
|
||||
LOG("loot", "Invalid level. Use 1 - 350");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (loot.randomizeWeapon(item, lev))
|
||||
{
|
||||
LOG("loot", "Weapon " + item + " has been re-rolled as a level " + lev + " loot item.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("loot", "Weapon could not be initialized as a loot drop.");
|
||||
}
|
||||
}
|
||||
if ((toLower(text)).startsWith("makelootarmor"))
|
||||
{
|
||||
LOG("loot", "Creating loot armor for object ");
|
||||
obj_id item = getLookAtTarget(self);
|
||||
if (!isIdValid(item))
|
||||
{
|
||||
LOG("loot", "No valid lookat target to transform into a loot item..." + item);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
StringTokenizer st = new StringTokenizer(text);
|
||||
printTokens(st);
|
||||
String level = "1";
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
level = st.nextToken();
|
||||
}
|
||||
int lev = utils.stringToInt(level);
|
||||
if (lev < 1 || lev > 350)
|
||||
{
|
||||
LOG("loot", "Invalid level. Use 1 - 350");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (loot.randomizeArmor(item, lev))
|
||||
{
|
||||
LOG("loot", "Armor " + item + " has been re-rolled as a level " + lev + " loot item.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("loot", "Armor could not be initialized as a loot drop.");
|
||||
}
|
||||
}
|
||||
if ((toLower(text)).startsWith("makelootcomponent"))
|
||||
{
|
||||
LOG("loot", "Creating loot component for object ");
|
||||
obj_id item = getLookAtTarget(self);
|
||||
if (!isIdValid(item))
|
||||
{
|
||||
LOG("loot", "No valid lookat target to transform into a loot item..." + item);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
StringTokenizer st = new StringTokenizer(text);
|
||||
printTokens(st);
|
||||
String level = "1";
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
level = st.nextToken();
|
||||
}
|
||||
int lev = utils.stringToInt(level);
|
||||
if (lev < 1 || lev > 350)
|
||||
{
|
||||
LOG("loot", "Invalid level. Use 1 - 350");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (loot.randomizeComponent(item, lev, utils.getInventoryContainer(self)))
|
||||
{
|
||||
LOG("loot", "Component " + item + " has been re-rolled as a level " + lev + " loot item.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("loot", "Component could not be initialized as a loot drop.");
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,119 +0,0 @@
|
||||
package script.working.rdelashmit;
|
||||
|
||||
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 city_test extends script.base_script
|
||||
{
|
||||
public city_test()
|
||||
{
|
||||
}
|
||||
public obj_id getPlayerByName(obj_id actor, String name) throws InterruptedException
|
||||
{
|
||||
java.util.StringTokenizer st = new java.util.StringTokenizer(name);
|
||||
String compareName = toLower(st.nextToken());
|
||||
obj_id[] players = getPlayerCreaturesInRange(actor, 128.0f);
|
||||
if (players != null)
|
||||
{
|
||||
for (int i = 0; i < players.length; ++i)
|
||||
{
|
||||
java.util.StringTokenizer st2 = new java.util.StringTokenizer(getName(players[i]));
|
||||
String playerName = toLower(st2.nextToken());
|
||||
if (compareName.equals(playerName))
|
||||
{
|
||||
return players[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return obj_id.NULL_ID;
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "city test script attached.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnCityChanged(obj_id self, int oldCityId, int newCityId) throws InterruptedException
|
||||
{
|
||||
if (oldCityId != 0)
|
||||
{
|
||||
debugSpeakMsg(self, "Leaving city " + cityGetName(oldCityId));
|
||||
}
|
||||
if (newCityId != 0)
|
||||
{
|
||||
debugSpeakMsg(self, "Entering city " + cityGetName(newCityId));
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void registerCloningFacilities() throws InterruptedException
|
||||
{
|
||||
int[] cityIds = getAllCityIds();
|
||||
for (int i = 0; i < cityIds.length; ++i)
|
||||
{
|
||||
int cityId = cityIds[i];
|
||||
location cityLoc = cityGetLocation(cityId);
|
||||
location cloneLoc = cityGetCloneLoc(cityId);
|
||||
location cloneRespawn = cityGetCloneRespawn(cityId);
|
||||
obj_id cloneId = cityGetCloneId(cityId);
|
||||
if (isIdValid(cloneId))
|
||||
{
|
||||
obj_id planet = getPlanetByName(cityLoc.area);
|
||||
if (isIdValid(planet))
|
||||
{
|
||||
dictionary params = new dictionary();
|
||||
params.put("id", cloneId);
|
||||
params.put("loc", cloneLoc);
|
||||
params.put("respawn", cloneRespawn);
|
||||
messageTo(planet, "registerCloningFacility", params, 1.0f, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void dumpInfo(obj_id self, int cityId) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "City name=" + cityGetName(cityId) + " hall=" + cityGetCityHall(cityId) + " loc=" + cityGetLocation(cityId) + " radius=" + cityGetRadius(cityId) + " leader=" + cityGetLeader(cityId) + " incomeTax=" + cityGetIncomeTax(cityId) + " propertyTax=" + cityGetPropertyTax(cityId) + " salesTax=" + cityGetSalesTax(cityId) + " cloneLoc=" + cityGetCloneLoc(cityId) + " cloneRespawn=" + cityGetCloneRespawn(cityId) + " cloneId=" + cityGetCloneId(cityId));
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
if (speaker != self)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (text.startsWith("city "))
|
||||
{
|
||||
java.util.StringTokenizer st = new java.util.StringTokenizer(text);
|
||||
st.nextToken();
|
||||
int cityId = getCityAtLocation(getLocation(speaker), 0);
|
||||
String tok = st.nextToken();
|
||||
if (tok.equals("create"))
|
||||
{
|
||||
createCity(st.nextToken(), speaker, getLocation(speaker), 128, speaker, 1, 2, 3, new location(), 0, false, new location(), new location(), obj_id.NULL_ID);
|
||||
}
|
||||
else if (tok.equals("destroy"))
|
||||
{
|
||||
removeCity(cityId);
|
||||
}
|
||||
else if (tok.equals("info"))
|
||||
{
|
||||
dumpInfo(speaker, getCityAtLocation(getLocation(speaker), 0));
|
||||
}
|
||||
else if (tok.equals("militia"))
|
||||
{
|
||||
citySetCitizenInfo(cityId, speaker, getName(speaker), speaker, 1);
|
||||
}
|
||||
else if (tok.equals("citizen"))
|
||||
{
|
||||
citySetCitizenInfo(cityId, speaker, getName(speaker), speaker, 0);
|
||||
}
|
||||
else if (tok.equals("register"))
|
||||
{
|
||||
registerCloningFacilities();
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
package script.working.rdelashmit;
|
||||
|
||||
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.guild;
|
||||
|
||||
public class guild_test extends script.base_script
|
||||
{
|
||||
public guild_test()
|
||||
{
|
||||
}
|
||||
public obj_id getPlayerByName(obj_id actor, String name) throws InterruptedException
|
||||
{
|
||||
java.util.StringTokenizer st = new java.util.StringTokenizer(name);
|
||||
String compareName = toLower(st.nextToken());
|
||||
obj_id[] players = getPlayerCreaturesInRange(actor, 128.0f);
|
||||
if (players != null)
|
||||
{
|
||||
for (int i = 0; i < players.length; ++i)
|
||||
{
|
||||
java.util.StringTokenizer st2 = new java.util.StringTokenizer(getName(players[i]));
|
||||
String playerName = toLower(st2.nextToken());
|
||||
if (compareName.equals(playerName))
|
||||
{
|
||||
return players[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return obj_id.NULL_ID;
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
debugSpeakMsg(self, "guild test script attached.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
|
||||
{
|
||||
if (speaker != self)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (text.startsWith("guild "))
|
||||
{
|
||||
java.util.StringTokenizer st = new java.util.StringTokenizer(text);
|
||||
st.nextToken();
|
||||
int guildId = getGuildId(speaker);
|
||||
String tok = st.nextToken();
|
||||
if (tok.equals("create"))
|
||||
{
|
||||
guild.create(speaker, st.nextToken(), st.nextToken());
|
||||
}
|
||||
else if (tok.equals("disband"))
|
||||
{
|
||||
guild.disband(guildId, speaker);
|
||||
}
|
||||
else if (tok.equals("info"))
|
||||
{
|
||||
guild.dumpInfo(guildId, speaker);
|
||||
}
|
||||
else if (tok.equals("accept"))
|
||||
{
|
||||
guild.accept(guildId, speaker, st.nextToken());
|
||||
}
|
||||
else if (tok.equals("kick"))
|
||||
{
|
||||
guild.kick(guildId, speaker, st.nextToken());
|
||||
}
|
||||
else if (tok.equals("title"))
|
||||
{
|
||||
guild.title(guildId, speaker, st.nextToken(), st.nextToken());
|
||||
}
|
||||
else if (tok.equals("namechange"))
|
||||
{
|
||||
guild.nameChange(guildId, speaker, st.nextToken(), st.nextToken());
|
||||
}
|
||||
else if (tok.equals("allegiance"))
|
||||
{
|
||||
guild.allegiance(speaker, st.nextToken());
|
||||
}
|
||||
else if (tok.equals("war"))
|
||||
{
|
||||
guild.war(guildId, speaker, st.nextToken());
|
||||
}
|
||||
else if (tok.equals("peace"))
|
||||
{
|
||||
guild.peace(guildId, speaker, st.nextToken());
|
||||
}
|
||||
else if (tok.equals("maintain_update"))
|
||||
{
|
||||
messageTo(getMasterGuildObject(), "forceUpdateGuilds", null, 0, false);
|
||||
}
|
||||
else if (tok.equals("maintain_namechange"))
|
||||
{
|
||||
messageTo(getMasterGuildObject(), "forceUpdateGuildNameChanges", null, 0, false);
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,193 +0,0 @@
|
||||
package script.working.rdelashmit;
|
||||
|
||||
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.utils;
|
||||
import script.library.space_utils;
|
||||
import script.library.space_transition;
|
||||
|
||||
public class new_ship_launch extends script.base_script
|
||||
{
|
||||
public new_ship_launch()
|
||||
{
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equalsIgnoreCase("beginLaunch"))
|
||||
{
|
||||
obj_id scd = space_utils.hasUsableShip(self);
|
||||
if (isIdValid(scd))
|
||||
{
|
||||
obj_id ship = space_transition.getShipFromShipControlDevice(scd);
|
||||
if (isIdValid(ship))
|
||||
{
|
||||
beginLaunch(self, ship, new location(100.f, 0.f, 100.f, "space_tatooine"));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (text.equalsIgnoreCase("confirmLaunch"))
|
||||
{
|
||||
confirmLaunch(self);
|
||||
}
|
||||
else if (text.equalsIgnoreCase("finishLaunch"))
|
||||
{
|
||||
finishLaunch(self);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void beginLaunch(obj_id player, obj_id ship, location destination) throws InterruptedException
|
||||
{
|
||||
Vector potentialPassengers = null;
|
||||
Vector shipStartLocations = space_transition.getShipStartLocations(ship);
|
||||
if (shipStartLocations != null && shipStartLocations.size() > 0)
|
||||
{
|
||||
obj_id playerBuilding = getTopMostContainer(player);
|
||||
obj_id group = getGroupObject(player);
|
||||
if (isIdValid(group))
|
||||
{
|
||||
obj_id[] groupMembers = getGroupMemberIds(group);
|
||||
for (int i = 0; i < groupMembers.length; ++i)
|
||||
{
|
||||
obj_id groupMember = groupMembers[i];
|
||||
if (groupMember != player && exists(groupMember) && getTopMostContainer(groupMember) == playerBuilding)
|
||||
{
|
||||
potentialPassengers = utils.addElement(potentialPassengers, groupMember);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vector launchees = null;
|
||||
launchees = utils.addElement(launchees, player);
|
||||
utils.setScriptVar(player, "launch.launchees", launchees);
|
||||
utils.setScriptVar(player, "launch.ship", ship);
|
||||
utils.setScriptVar(player, "launch.destination", destination);
|
||||
if (potentialPassengers != null)
|
||||
{
|
||||
for (int i = 0; i < potentialPassengers.size(); ++i)
|
||||
{
|
||||
dictionary params = new dictionary();
|
||||
params.put("launcher", player);
|
||||
messageTo(((obj_id)potentialPassengers.get(i)), "inviteForPobShipLaunch", params, 0, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
finishLaunch(player);
|
||||
}
|
||||
}
|
||||
public int inviteForPobShipLaunch(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
obj_id launcher = params.getObjId("launcher");
|
||||
prose_package pp = new prose_package();
|
||||
pp.actor.set(getName(launcher));
|
||||
pp.stringId = new string_id("space/space_interaction", "invite_for_launch");
|
||||
sendSystemMessageProse(self, pp);
|
||||
utils.setScriptVar(self, "launch.launcher", launcher);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void confirmLaunch(obj_id player) throws InterruptedException
|
||||
{
|
||||
obj_id launcher = utils.getObjIdScriptVar(player, "launch.launcher");
|
||||
if (isIdValid(launcher))
|
||||
{
|
||||
dictionary params = new dictionary();
|
||||
params.put("launchee", player);
|
||||
messageTo(launcher, "confirmForPobShipLaunch", params, 0, false);
|
||||
}
|
||||
utils.removeScriptVar(player, "launch.launcher");
|
||||
}
|
||||
public int confirmForPobShipLaunch(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
obj_id launchee = params.getObjId("launchee");
|
||||
Vector launchees = utils.getResizeableObjIdArrayScriptVar(self, "launch.launchees");
|
||||
if (launchees != null)
|
||||
{
|
||||
launchees = utils.addElement(launchees, launchee);
|
||||
utils.setScriptVar(self, "launch.launchees", launchees);
|
||||
prose_package pp = new prose_package();
|
||||
pp.actor.set(getName(launchee));
|
||||
pp.stringId = new string_id("space/space_interaction", "confirm_for_launch");
|
||||
sendSystemMessageProse(self, pp);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void finishLaunch(obj_id player) throws InterruptedException
|
||||
{
|
||||
Vector launchees = utils.getResizeableObjIdArrayScriptVar(player, "launch.launchees");
|
||||
obj_id ship = utils.getObjIdScriptVar(player, "launch.ship");
|
||||
location destination = utils.getLocationScriptVar(player, "launch.destination");
|
||||
location groundLoc = getLocation(getTopMostContainer(player));
|
||||
Vector groupMembersToWarp = utils.addElement(null, player);
|
||||
Vector groupMemberStartIndex = utils.addElement(null, 0);
|
||||
Vector shipStartLocations = space_transition.getShipStartLocations(ship);
|
||||
if (shipStartLocations != null && shipStartLocations.size() > 0)
|
||||
{
|
||||
int startIndex = 0;
|
||||
obj_id playerBuilding = getTopMostContainer(player);
|
||||
obj_id group = getGroupObject(player);
|
||||
if (isIdValid(group))
|
||||
{
|
||||
obj_id[] groupMembers = getGroupMemberIds(group);
|
||||
for (int i = 1; i < launchees.size(); ++i)
|
||||
{
|
||||
obj_id launchee = ((obj_id)launchees.get(i));
|
||||
boolean ok = false;
|
||||
for (int j = 0; j < groupMembers.length; ++j)
|
||||
{
|
||||
if (groupMembers[j] == launchee && exists(launchee) && getTopMostContainer(launchee) == playerBuilding)
|
||||
{
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
if (ok)
|
||||
{
|
||||
startIndex = getNextStartIndex(shipStartLocations, startIndex);
|
||||
if (startIndex <= shipStartLocations.size())
|
||||
{
|
||||
groupMembersToWarp = utils.addElement(groupMembersToWarp, ((obj_id)launchees.get(i)));
|
||||
groupMemberStartIndex = utils.addElement(groupMemberStartIndex, startIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
launch(groupMembersToWarp, groupMemberStartIndex, ship, destination, groundLoc);
|
||||
}
|
||||
public void launch(Vector players, Vector playerStartIndex, obj_id ship, location destination, location groundLoc) throws InterruptedException
|
||||
{
|
||||
for (int i = 0; i < players.size(); ++i)
|
||||
{
|
||||
launch(((obj_id)players.get(i)), ((Integer)playerStartIndex.get(i)).intValue(), ship, destination, groundLoc);
|
||||
}
|
||||
}
|
||||
public void launch(obj_id player, int playerStartIndex, obj_id ship, location destination, location groundLoc) throws InterruptedException
|
||||
{
|
||||
utils.removeScriptVar(player, "launch.ship");
|
||||
utils.removeScriptVar(player, "launch.destination");
|
||||
utils.removeScriptVar(player, "launch.launcher");
|
||||
utils.removeScriptVar(player, "launch.launchees");
|
||||
space_transition.setLaunchInfo(player, ship, playerStartIndex, groundLoc);
|
||||
warpPlayer(player, destination.area, destination.x, destination.y, destination.z, null, destination.x, destination.y, destination.z);
|
||||
}
|
||||
public int getNextStartIndex(Vector shipStartLocations, int lastStartIndex) throws InterruptedException
|
||||
{
|
||||
int startIndex = lastStartIndex + 1;
|
||||
if (startIndex > shipStartLocations.size())
|
||||
{
|
||||
for (startIndex = 1; startIndex <= shipStartLocations.size(); ++startIndex)
|
||||
{
|
||||
if (((location)shipStartLocations.get(startIndex - 1)).cell != null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return startIndex;
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
package script.working.rdelashmit;
|
||||
|
||||
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.space_transition;
|
||||
|
||||
public class ship_faction_debug extends script.base_script
|
||||
{
|
||||
public ship_faction_debug()
|
||||
{
|
||||
}
|
||||
public static final String[] factionStrings =
|
||||
{
|
||||
"aynat",
|
||||
"beta_neutral",
|
||||
"blacksun",
|
||||
"borvo",
|
||||
"civilian",
|
||||
"corsec",
|
||||
"hutt",
|
||||
"imperial",
|
||||
"jabba",
|
||||
"merchant",
|
||||
"nym",
|
||||
"pirate",
|
||||
"rebel",
|
||||
"rebel_suspect",
|
||||
"rsf",
|
||||
"smuggler",
|
||||
"spynet",
|
||||
"station",
|
||||
"true_neutral",
|
||||
"unattackable",
|
||||
"valarian"
|
||||
};
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (text.equalsIgnoreCase("targetfactioninfo"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (!isIdValid(target))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Target something, then say targetfactioninfo again.");
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Target Faction Info for " + target);
|
||||
int faction = shipGetSpaceFaction(target);
|
||||
int[] allies = shipGetSpaceFactionAllies(target);
|
||||
int[] enemies = shipGetSpaceFactionEnemies(target);
|
||||
boolean isAggro = shipGetSpaceFactionIsAggro(target);
|
||||
boolean isEnemy = pvpIsEnemy(target, space_transition.getContainingShip(self));
|
||||
sendSystemMessageTestingOnly(self, "Faction: " + faction + " (" + getFactionString(faction) + ")");
|
||||
if (allies != null)
|
||||
{
|
||||
for (int i = 0; i < allies.length; ++i)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "AlliedFaction: " + allies[i] + " (" + getFactionString(allies[i]) + ")");
|
||||
}
|
||||
}
|
||||
if (enemies != null)
|
||||
{
|
||||
for (int i = 0; i < enemies.length; ++i)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "EnemyFaction: " + enemies[i] + " (" + getFactionString(enemies[i]) + ")");
|
||||
}
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, "IsAggro: " + isAggro + " isEnemy: " + isEnemy);
|
||||
}
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public String getFactionString(int faction) throws InterruptedException
|
||||
{
|
||||
for (int i = 0; i < factionStrings.length; ++i)
|
||||
{
|
||||
if (getStringCrc(factionStrings[i]) == faction)
|
||||
{
|
||||
return factionStrings[i];
|
||||
}
|
||||
}
|
||||
return "<< unknown >>";
|
||||
}
|
||||
}
|
||||
@@ -1,971 +0,0 @@
|
||||
package script.working;
|
||||
|
||||
import script.*;
|
||||
import script.base_class.*;
|
||||
import script.combat_engine.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import script.base_script;
|
||||
|
||||
import script.library.ai_lib;
|
||||
import script.library.battlefield;
|
||||
import script.library.bio_engineer;
|
||||
import script.library.buff;
|
||||
import script.library.create;
|
||||
import script.library.dot;
|
||||
import script.library.features;
|
||||
import script.library.hq;
|
||||
import script.library.locations;
|
||||
import script.library.mustafar;
|
||||
import script.library.pclib;
|
||||
import script.library.pet_lib;
|
||||
import script.library.prose;
|
||||
import script.library.player_structure;
|
||||
import script.library.regions;
|
||||
import script.library.skill;
|
||||
import script.library.utils;
|
||||
import script.library.space_crafting;
|
||||
import script.library.space_transition;
|
||||
|
||||
public class reecetest extends script.base_script
|
||||
{
|
||||
public reecetest()
|
||||
{
|
||||
}
|
||||
public static final int SPAWN_TEMPLATE_CHECK_DISTANCE = 128;
|
||||
public static final int SPAWN_CHECK_TEMPLATE_LIMIT = 140;
|
||||
public static final int SPAWN_THEATER_CHECK_DISTANCE = 200;
|
||||
public static final int SPAWN_CHECK_DISTANCE = 64;
|
||||
public static final int SPAWN_CHECK_LIMIT = 15;
|
||||
public static final int SPAWN_CHECK_THEATER_LIMIT = 1;
|
||||
public int checkDifficulty(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
int intRawDifficulty = getLevel(self);
|
||||
sendSystemMessageTestingOnly(self, "getLevel returned " + intRawDifficulty);
|
||||
if (intRawDifficulty == 0)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "you lost your difficulty!");
|
||||
deltadictionary dctScriptVars = self.getScriptVars();
|
||||
sendSystemMessageTestingOnly(self, "Scriptvars are " + dctScriptVars.toString());
|
||||
}
|
||||
messageTo(self, "checkDifficulty", null, 3, false);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void setupJediTrainer(obj_id self) throws InterruptedException
|
||||
{
|
||||
final String[] TRAINER_TYPES =
|
||||
{
|
||||
"trainer_brawler"
|
||||
};
|
||||
String strPrimaryCategory = "trainer";
|
||||
String strSecondaryCategory = TRAINER_TYPES[rand(0, TRAINER_TYPES.length - 1)];
|
||||
map_location[] mapLocations = getPlanetaryMapLocations(strPrimaryCategory, strSecondaryCategory);
|
||||
if ((mapLocations == null) || (mapLocations.length == 0))
|
||||
{
|
||||
location locTest = getLocation(self);
|
||||
LOG("DESIGNER_FATAL", "JEDI : For planet " + locTest.area + ", primary category : " + strPrimaryCategory + " and secondary category " + strSecondaryCategory + " No planetary map location was found");
|
||||
return;
|
||||
}
|
||||
int intRoll = rand(0, mapLocations.length - 1);
|
||||
location locHome = getLocation(self);
|
||||
location locTest = new location();
|
||||
locTest.x = mapLocations[intRoll].getX();
|
||||
locTest.z = mapLocations[intRoll].getY();
|
||||
locTest.area = locHome.area;
|
||||
setObjVar(self, "jedi.locTrainerLocation", locTest);
|
||||
return;
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException
|
||||
{
|
||||
if (objSpeaker != self)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (strText.equals("name"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null)
|
||||
{
|
||||
String creatureName = getCreatureName(target);
|
||||
sendSystemMessageTestingOnly(self, "creatureName = " + creatureName);
|
||||
}
|
||||
}
|
||||
if (strText.equals("level"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null)
|
||||
{
|
||||
ai_lib.creatureLevelUp(target, self);
|
||||
}
|
||||
}
|
||||
if (strText.equals("stats"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Action = " + getMaxAttrib(self, ACTION) + " Mind = " + getMaxAttrib(self, MIND));
|
||||
sendSystemMessageTestingOnly(self, "Stamina = " + getMaxAttrib(self, STAMINA) + " Constitution = " + getMaxAttrib(self, CONSTITUTION));
|
||||
}
|
||||
if (strText.equals("cef1"))
|
||||
{
|
||||
playClientEffectObj(self, "clienteffect/mustafar/som_force_crystal_drain.cef", self, "");
|
||||
sendSystemMessageTestingOnly(self, "CEF 1 !!!!!!!!!");
|
||||
}
|
||||
if (strText.equals("cef2"))
|
||||
{
|
||||
playClientEffectObj(self, "clienteffect/mustafar/som_force_crystal_buff.cef", self, "");
|
||||
sendSystemMessageTestingOnly(self, "CEF 2 !!!!!!!!!");
|
||||
}
|
||||
if (strText.equals("cef3"))
|
||||
{
|
||||
playClientEffectObj(self, "clienteffect/mustafar/som_force_crystal_destruction.cef", self, "");
|
||||
sendSystemMessageTestingOnly(self, "CEF 3 !!!!!!!!!");
|
||||
}
|
||||
if (strText.equals("cef4"))
|
||||
{
|
||||
playClientEffectObj(self, "clienteffect/mustafar/som_dark_jedi_laugh.cef", self, "");
|
||||
sendSystemMessageTestingOnly(self, "CEF 4 !!!!!!!!!");
|
||||
}
|
||||
if (strText.equals("test"))
|
||||
{
|
||||
obj_id dungeon = getTopMostContainer(self);
|
||||
obj_id crystal = utils.getObjIdScriptVar(dungeon, "crystal");
|
||||
messageTo(crystal, "crystalTest1", null, 1, false);
|
||||
sendSystemMessageTestingOnly(self, "TEST !!!!!!!!!");
|
||||
}
|
||||
if (strText.equals("test2"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null)
|
||||
{
|
||||
messageTo(target, "crystalTest2", null, 1, false);
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, "TEST2 !!!!!!!!!");
|
||||
}
|
||||
if (strText.equals("attach"))
|
||||
{
|
||||
attachScript(self, "theme_park.dungeon.mustafar_trials.obiwan_finale.obiwan_quest_monitor");
|
||||
if (hasScript(self, "theme_park.dungeon.mustafar_trials.obiwan_finale.obiwan_quest_monitor"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "script attached");
|
||||
}
|
||||
}
|
||||
if (strText.equals("detach"))
|
||||
{
|
||||
if (detachScript(self, "theme_park.dungeon.mustafar_trials.obiwan_finale.obiwan_quest_monitor"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "script detatched");
|
||||
}
|
||||
}
|
||||
if (strText.equals("fireone"))
|
||||
{
|
||||
attachScript(self, "theme_park.dungeon.mustafar_trials.obiwan_finale.obiwan_quest_monitor");
|
||||
sendSystemMessageTestingOnly(self, "fireone");
|
||||
if (mustafar.canCallObiwan(self))
|
||||
{
|
||||
mustafar.callObiwan(self, true);
|
||||
sendSystemMessageTestingOnly(self, "callingObiwan");
|
||||
}
|
||||
else
|
||||
{
|
||||
setObjVar(self, "waitingOnObiwan", 1);
|
||||
messageTo(self, "recallObiwanDelay", null, 180, false);
|
||||
sendSystemMessageTestingOnly(self, "recallObiwanDelay");
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, "firetwo");
|
||||
}
|
||||
if (strText.equals("firetwo"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "firetwo");
|
||||
utils.setScriptVar(self, "sawObiwanAtLauncher", 1);
|
||||
}
|
||||
if (strText.equals("hittem"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "hittem");
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null)
|
||||
{
|
||||
obj_id weapon = getCurrentWeapon(self);
|
||||
hit_result cbtHitData = new hit_result();
|
||||
cbtHitData.success = true;
|
||||
cbtHitData.baseRoll = 50;
|
||||
cbtHitData.finalRoll = 100;
|
||||
cbtHitData.hitLocation = rand(0, 5);
|
||||
cbtHitData.canSee = true;
|
||||
cbtHitData.damage = 5000;
|
||||
cbtHitData.bleedingChance = 0;
|
||||
doDamage(self, target, weapon, cbtHitData);
|
||||
}
|
||||
}
|
||||
if (strText.equals("cbuff"))
|
||||
{
|
||||
buff.applyBuff(self, "crystal_buff");
|
||||
sendSystemMessageTestingOnly(self, "I C'BUFFED YA!");
|
||||
}
|
||||
if (strText.equals("dbuff"))
|
||||
{
|
||||
buff.removeAllBuffs(self);
|
||||
sendSystemMessageTestingOnly(self, "I D'BUFFED YA!");
|
||||
}
|
||||
if (strText.equals("reforce"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "reforce start");
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null)
|
||||
{
|
||||
messageTo(target, "specialForcePowerAttackWindup", null, rand(10, 20), false);
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, "reforce done");
|
||||
}
|
||||
if (strText.equals("bossman"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null)
|
||||
{
|
||||
if (utils.hasScriptVar(target, "dungeon"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "got dungeon objid. going to spawn BOSS.");
|
||||
obj_id dungeon = utils.getObjIdScriptVar(target, "dungeon");
|
||||
spawnContents(dungeon, "boss", 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (strText.equals("currentScene"))
|
||||
{
|
||||
String scene = getCurrentSceneName();
|
||||
sendSystemMessageTestingOnly(self, "current scene name is: " + scene);
|
||||
}
|
||||
if (strText.equals("locations"))
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
location here = getLocation(self);
|
||||
location spawnLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 4f, 4f);
|
||||
if (spawnLoc == null)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, " spawnLoc was NULL ");
|
||||
spawnLoc = here;
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, "found location #" + i + " and it was at: " + spawnLoc);
|
||||
}
|
||||
}
|
||||
if (strText.equals("expansion"))
|
||||
{
|
||||
if (features.hasTrialsOfObiwanExpansion(self))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, " YEE HAW! GOT MUSTAFAR");
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "No mustafar expansion detected");
|
||||
}
|
||||
if (features.hasEpisode3PreOrderDigitalDownload(self))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, " YEE HAW! EP3 Preorder");
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "No EP3 pre-order expansion detected");
|
||||
}
|
||||
}
|
||||
if (strText.equals("petcount"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null)
|
||||
{
|
||||
int petcount = pet_lib.getMaxStoredPets(target);
|
||||
sendSystemMessageTestingOnly(self, " Got pet count. It was: " + petcount);
|
||||
}
|
||||
}
|
||||
if (strText.equals("patroller"))
|
||||
{
|
||||
location here = getLocation(self);
|
||||
obj_id spawn = create.object("fbase_stormtrooper", here);
|
||||
obj_id base = player_structure.getStructure(self);
|
||||
String[] base_cells = getCellNames(base);
|
||||
location[] locs = new location[base_cells.length];
|
||||
for (int i = 0; i < base_cells.length; i++)
|
||||
{
|
||||
locs[i] = getGoodLocation(base, base_cells[i]);
|
||||
}
|
||||
ai_lib.setPatrolPath(spawn, locs);
|
||||
}
|
||||
if (strText.equals("conditionon"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null)
|
||||
{
|
||||
hq.activateHackAlarms(target, true);
|
||||
hq.activateDestructAlarms(target, true);
|
||||
sendSystemMessageTestingOnly(self, "alarm!");
|
||||
}
|
||||
}
|
||||
if (strText.equals("conditionoff"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null)
|
||||
{
|
||||
hq.activateHackAlarms(target, false);
|
||||
hq.activateDestructAlarms(target, false);
|
||||
sendSystemMessageTestingOnly(self, "alarm! off");
|
||||
}
|
||||
}
|
||||
if (strText.equals("respawnalarms"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null)
|
||||
{
|
||||
hq.cleanupBaseAlarmUnits(target);
|
||||
hq.spawnAlarmUnits(target);
|
||||
sendSystemMessageTestingOnly(self, "alarm! RESPAWN!");
|
||||
}
|
||||
}
|
||||
if (strText.equals("disableobj"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
sendSystemMessageTestingOnly(self, "disabled objective! target is: " + target);
|
||||
if (target != null)
|
||||
{
|
||||
hq.disableObjective(target);
|
||||
sendSystemMessageTestingOnly(self, "disabled objective!");
|
||||
}
|
||||
}
|
||||
if (strText.equals("startcountdown"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
sendSystemMessageTestingOnly(self, "startcountdown detected! target is: " + target);
|
||||
if (target != null)
|
||||
{
|
||||
float delay = 300f + 300f * 1;
|
||||
int minutes = Math.round(delay / 60f);
|
||||
obj_id[] players = player_structure.getPlayersInBuilding(getTopMostContainer(target));
|
||||
if (players != null && players.length > 0)
|
||||
{
|
||||
for (int i = 0; i < players.length; i++)
|
||||
{
|
||||
sendSystemMessageProse(players[i], prose.getPackage(new string_id("faction/faction_hq/faction_hq_response", "terminal_response40"), minutes));
|
||||
}
|
||||
}
|
||||
int stamp = getGameTime() + Math.round(delay);
|
||||
utils.setScriptVar(target, "countdownInProgress", stamp);
|
||||
dictionary d = new dictionary();
|
||||
d.put("player", self);
|
||||
d.put("cnt", minutes);
|
||||
messageTo(target, "handleCountdown", d, 10f, false);
|
||||
}
|
||||
}
|
||||
if (strText.equals("accountCheck"))
|
||||
{
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null)
|
||||
{
|
||||
int pBits = getSubscriptionFeatureBits(target);
|
||||
sendSystemMessageTestingOnly(self, "CHECKING ACCOUNT TYPE Got account bits. They came back as: " + pBits);
|
||||
if ((utils.isFreeTrial(target)))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "It would appear that this IS a free trial account, per results from utils.isFreeTrial");
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "It would appear that this IS NOT a free trial account, per results from utils.isFreeTrial");
|
||||
}
|
||||
obj_id playerObject = getPlayerObject(target);
|
||||
if (playerObject != null)
|
||||
{
|
||||
pBits = getSubscriptionFeatureBits(playerObject);
|
||||
sendSystemMessageTestingOnly(self, "Running same checks on PLAYER ACCOUNT OBJECT. Got account bits came back as: " + pBits);
|
||||
if ((utils.isFreeTrial(playerObject)))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "testing PLAYER ACCOUNT OBJ, this IS a free trial account, per results from utils.isFreeTrial");
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "testing PLAYER ACCOUNT OBJ, this IS NOT a free trial account, per results from utils.isFreeTrial");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (strText.equals("reloadtest"))
|
||||
{
|
||||
obj_id ship = space_transition.getContainingShip(self);
|
||||
if (!isIdValid(ship))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
int[] slots = space_crafting.getShipInstalledSlots(ship);
|
||||
for (int i = 0; i < slots.length; i++)
|
||||
{
|
||||
if (space_crafting.isMissileSlot(ship, slots[i]))
|
||||
{
|
||||
setShipWeaponAmmoCurrent(ship, slots[i], 1);
|
||||
}
|
||||
else if (space_crafting.isCounterMeasureSlot(ship, slots[i]))
|
||||
{
|
||||
setShipWeaponAmmoCurrent(ship, slots[i], 1);
|
||||
}
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, "unloaded!");
|
||||
}
|
||||
if (strText.equals("zaprear"))
|
||||
{
|
||||
obj_id ship = space_transition.getContainingShip(self);
|
||||
if (!isIdValid(ship))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
setShipShieldHitpointsBackCurrent(ship, 5.0f);
|
||||
sendSystemMessageTestingOnly(self, "BANG! Rear Shields ZAPPED! Should be at 5.0f units");
|
||||
}
|
||||
if (strText.equals("gettime"))
|
||||
{
|
||||
long now = System.currentTimeMillis();
|
||||
long curTime = ((now / 1000) - 1072224000);
|
||||
int currentTime = (int)curTime + 3600;
|
||||
sendSystemMessageTestingOnly(self, "Set timestamp to: " + currentTime);
|
||||
}
|
||||
if (strText.equals("getlots"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Got getlots command");
|
||||
obj_id playerObject = getPlayerObject(self);
|
||||
int lots = getAccountNumLots(playerObject);
|
||||
sendSystemMessageTestingOnly(self, "Current Lots Count is " + lots);
|
||||
}
|
||||
if (strText.equals("getcell"))
|
||||
{
|
||||
String currentCell = getCellName(self);
|
||||
sendSystemMessageTestingOnly(self, "DEBUG - currentCell is: " + currentCell);
|
||||
location locTest = getLocation(self);
|
||||
if (isIdValid(locTest.cell))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "DEBUG - current cell information via locTest IS: " + locTest.cell);
|
||||
currentCell = getCellName(locTest.cell);
|
||||
sendSystemMessageTestingOnly(self, "DEBUG - currentCell via second method IS: " + currentCell);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "DEBUG - current cell information via locTest IS NOT VALID ");
|
||||
}
|
||||
}
|
||||
if (strText.equals("goSlow"))
|
||||
{
|
||||
obj_id objMount = getMountId(self);
|
||||
setBaseRunSpeed(objMount, 6.0f);
|
||||
sendSystemMessageTestingOnly(self, "Jogging");
|
||||
}
|
||||
if (strText.equals("slowMe"))
|
||||
{
|
||||
setBaseRunSpeed(self, 1.0f);
|
||||
}
|
||||
if (strText.equals("fastMe"))
|
||||
{
|
||||
setBaseRunSpeed(self, 6.0f);
|
||||
}
|
||||
if (strText.equals("getScriptVars"))
|
||||
{
|
||||
deltadictionary dctScriptVars = self.getScriptVars();
|
||||
sendSystemMessageTestingOnly(self, "Scriptvars are " + dctScriptVars.toString());
|
||||
}
|
||||
if (strText.equals("basereset"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Received baseReset command.");
|
||||
obj_id target = getLookAtTarget(self);
|
||||
if (target != null)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Sending message to target. Obj_id target is: " + target);
|
||||
messageTo(target, "handleManualSpawnResetTest", null, 3, false);
|
||||
}
|
||||
}
|
||||
else if (strText.equals("getStats"))
|
||||
{
|
||||
obj_id objTarget = getLookAtTarget(self);
|
||||
if (objTarget != null)
|
||||
{
|
||||
int intConstitution = getConst(objTarget);
|
||||
int intHealth = getHealth(objTarget);
|
||||
sendSystemMessageTestingOnly(self, "Const=" + intConstitution + " Health=" + intHealth);
|
||||
int intStamina = getStam(objTarget);
|
||||
int intAction = getAction(objTarget);
|
||||
sendSystemMessageTestingOnly(self, "Stamina=" + intStamina + " Action=" + intAction);
|
||||
int intWillPower = getWill(objTarget);
|
||||
int intMind = getMind(objTarget);
|
||||
sendSystemMessageTestingOnly(self, "WillPower=" + intWillPower + " Mind=" + intMind);
|
||||
}
|
||||
}
|
||||
if (strText.equals("damage"))
|
||||
{
|
||||
obj_id objTarget = getLookAtTarget(self);
|
||||
if (objTarget != null)
|
||||
{
|
||||
obj_id objWeapon = getCurrentWeapon(self);
|
||||
hit_result cbtHitData = new hit_result();
|
||||
cbtHitData.success = true;
|
||||
cbtHitData.baseRoll = 50;
|
||||
cbtHitData.finalRoll = 100;
|
||||
cbtHitData.hitLocation = rand(0, 5);
|
||||
cbtHitData.canSee = true;
|
||||
cbtHitData.damage = 200;
|
||||
cbtHitData.bleedingChance = 1;
|
||||
doDamage(self, objTarget, objWeapon, cbtHitData);
|
||||
sendSystemMessageTestingOnly(self, "200 damage done to target");
|
||||
debugSpeakMsg(objTarget, "ow!");
|
||||
}
|
||||
}
|
||||
if (strText.equals("music"))
|
||||
{
|
||||
playMusic(self, "sound/music_int_complete_rebel.snd");
|
||||
}
|
||||
if (strText.equals("badWeapon"))
|
||||
{
|
||||
obj_id objWeapon = createObject("object/weapon/ranged/rifle/rifle_dlt20a.iff", getLocation(self));
|
||||
setWeaponAttackSpeed(objWeapon, 1.5f);
|
||||
}
|
||||
if (strText.equals("checkFlags"))
|
||||
{
|
||||
obj_id objTarget = getLookAtTarget(self);
|
||||
if (isIdValid(objTarget))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "NPC is: " + objTarget);
|
||||
sendSystemMessageTestingOnly(self, "InvulnerableFlag is: " + isInvulnerable(objTarget));
|
||||
sendSystemMessageTestingOnly(self, "pvpCanAttack is: " + pvpCanAttack(self, objTarget));
|
||||
}
|
||||
}
|
||||
if (strText.equals("combatr2"))
|
||||
{
|
||||
debugServerConsoleMsg(self, "entered combatr2 module");
|
||||
obj_id inventoryContainer = getObjectInSlot(self, "inventory");
|
||||
if (!isIdValid(inventoryContainer))
|
||||
{
|
||||
debugServerConsoleMsg(self, "looks like the objid of the player inventory is invalid");
|
||||
}
|
||||
obj_id deed = createObject("object/tangible/deed/pet_deed/deed_r2_basic.iff", inventoryContainer, "SLOT_INVENTORY");
|
||||
if (!isIdValid(deed))
|
||||
{
|
||||
debugServerConsoleMsg(self, "failed to create the deed object");
|
||||
}
|
||||
int powerLevel = 50;
|
||||
final String CREATURE_NAME = "r2_crafted";
|
||||
dictionary creatureDict = dataTableGetRow(create.CREATURE_TABLE, "r2_crafted");
|
||||
setObjVar(deed, "creature_attribs.type", "r2_crafted");
|
||||
setObjVar(deed, "creature_attribs.level", 30);
|
||||
setObjVar(deed, "creature_attribs.maxHealth", 4000);
|
||||
setObjVar(deed, "creature_attribs.maxConstitution", 0);
|
||||
setObjVar(deed, "creature_attribs.general_protection", 2000);
|
||||
setObjVar(deed, "creature_attribs.toHitChance", 81);
|
||||
setObjVar(deed, "creature_attribs.defenseValue", 81);
|
||||
setObjVar(deed, "creature_attribs.minDamage", 61);
|
||||
setObjVar(deed, "creature_attribs.maxDamage", 284);
|
||||
setObjVar(deed, "creature_attribs.aggroBonus", 0.0f);
|
||||
setObjVar(deed, "creature_attribs.critChance", 0.0f);
|
||||
setObjVar(deed, "creature_attribs.critSave", 0.0f);
|
||||
setObjVar(deed, "creature_attribs.scale", 1.0f);
|
||||
setObjVar(deed, "creature_attribs.stateResist", 0.0f);
|
||||
setObjVar(deed, "crafting_components.cmbt_module", 600.0f);
|
||||
setObjVar(deed, "dataModuleRating", 12);
|
||||
setObjVar(deed, "ai.pet.hasContainer", 12);
|
||||
setObjVar(deed, "ai.pet.isRepairDroid", true);
|
||||
setObjVar(deed, "craftingStationSpace", true);
|
||||
setObjVar(deed, "craftingStationWeapon", true);
|
||||
setObjVar(deed, "craftingStationFood", true);
|
||||
}
|
||||
if (strText.equals("combatprobot"))
|
||||
{
|
||||
debugServerConsoleMsg(self, "entered probot module");
|
||||
obj_id inventoryContainer = getObjectInSlot(self, "inventory");
|
||||
if (!isIdValid(inventoryContainer))
|
||||
{
|
||||
debugServerConsoleMsg(self, "looks like the objid of the player inventory is invalid");
|
||||
}
|
||||
obj_id object = createObject("object/tangible/deed/pet_deed/deed_probot_basic.iff", inventoryContainer, "SLOT_INVENTORY");
|
||||
if (!isIdValid(object))
|
||||
{
|
||||
debugServerConsoleMsg(self, "failed to create the deed object");
|
||||
}
|
||||
int powerLevel = 50;
|
||||
final String CREATURE_NAME = "probot";
|
||||
dictionary creatureDict = dataTableGetRow(create.CREATURE_TABLE, "r2_crafted");
|
||||
setObjVar(object, "creature_attribs.type", "probot");
|
||||
for (int attribNum = HEALTH; attribNum <= WILLPOWER; attribNum++)
|
||||
{
|
||||
int minAttrib = creatureDict.getInt(create.MINATTRIBNAMES[attribNum]);
|
||||
int maxAttrib = creatureDict.getInt(create.MAXATTRIBNAMES[attribNum]);
|
||||
int attribRange = maxAttrib - minAttrib;
|
||||
int newAttribValue = (int)((attribRange * powerLevel) / 1000) + minAttrib;
|
||||
setObjVar(object, "creature_attribs." + create.MAXATTRIBNAMES[attribNum], newAttribValue);
|
||||
}
|
||||
int toHitChance = creatureDict.getInt("toHitChance");
|
||||
float minToHit = toHitChance + (toHitChance * bio_engineer.CREATURE_MIN_TO_HIT_MOD);
|
||||
float maxToHit = toHitChance + (toHitChance * bio_engineer.CREATURE_MAX_TO_HIT_MOD);
|
||||
setObjVar(object, "creature_attribs.toHitChance", toHitChance);
|
||||
obj_id creatureWeapon = getCurrentWeapon(object);
|
||||
if (!isIdValid(creatureWeapon))
|
||||
{
|
||||
debugServerConsoleMsg(self, "failed to get the obj_id of the creature's current weapon. Uh oh!");
|
||||
}
|
||||
float wpnSpeed = (float)creatureDict.getInt("attackSpeed");
|
||||
float minWpnSpeed = wpnSpeed + (wpnSpeed * bio_engineer.CREATURE_MIN_WEAPON_SPEED_MOD);
|
||||
float maxWpnSpeed = wpnSpeed + (wpnSpeed * bio_engineer.CREATURE_MAX_WEAPON_SPEED_MOD);
|
||||
setObjVar(object, "creature_attribs.attackSpeed", wpnSpeed);
|
||||
int minDamage = creatureDict.getInt("minDamage");
|
||||
int maxDamage = creatureDict.getInt("maxDamage");
|
||||
float minMinDamage = minDamage + (minDamage * bio_engineer.CREATURE_MIN_DAMAGE_MOD);
|
||||
float maxMinDamage = minDamage + (minDamage * bio_engineer.CREATURE_MAX_DAMAGE_MOD);
|
||||
float minMaxDamage = maxDamage + (maxDamage * bio_engineer.CREATURE_MIN_DAMAGE_MOD);
|
||||
float maxMaxDamage = maxDamage + (maxDamage * bio_engineer.CREATURE_MAX_DAMAGE_MOD);
|
||||
minDamage = (int)(minMinDamage + (((maxMinDamage - minMinDamage) * powerLevel) / 1000));
|
||||
maxDamage = (int)(minMaxDamage + (((maxMaxDamage - minMaxDamage) * powerLevel) / 1000));
|
||||
setObjVar(object, "creature_attribs.minDamage", minDamage);
|
||||
setObjVar(object, "creature_attribs.maxDamage", maxDamage);
|
||||
setObjVar(object, "crafting_components.cmbt_module", 600.0f);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public location getGoodMissionLocation(location locSpawnLocation, obj_id objPlayer) throws InterruptedException
|
||||
{
|
||||
int intSize = 72;
|
||||
location locGoodLocation = locations.getGoodLocationAroundLocation(locSpawnLocation, intSize, intSize, 300, 300, false, true);
|
||||
if (locGoodLocation == null)
|
||||
{
|
||||
locGoodLocation = locations.getGoodLocationAroundLocation(getLocation(objPlayer), intSize, intSize, 400, 400, false, true);
|
||||
if (locGoodLocation == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (locations.isInMissionCity(locGoodLocation))
|
||||
{
|
||||
locGoodLocation = locations.getGoodLocationAroundLocation(getLocation(objPlayer), intSize, intSize, 400, 400, false, true);
|
||||
if (locGoodLocation == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (locations.isInMissionCity(locGoodLocation))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
region rgnBattlefield = battlefield.getBattlefield(locGoodLocation);
|
||||
if (rgnBattlefield != null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (locations.isInMissionCity(locGoodLocation))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return locGoodLocation;
|
||||
}
|
||||
public boolean checkTemplatesInRange(obj_id objPlayer, location locHome, boolean boolCheckForTheaters, String strObjectType) throws InterruptedException
|
||||
{
|
||||
boolean boolLogFailures = true;
|
||||
boolean boolVerboseMode = true;
|
||||
float fltDistance = rand(120, 200);
|
||||
obj_id[] objTemplates = getObjectsInRange(locHome, fltDistance);
|
||||
if (objTemplates == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (boolCheckForTheaters)
|
||||
{
|
||||
obj_id[] objLairs = getAllObjectsWithTemplate(locHome, fltDistance, "object/tangible/lair/npc_lair.iff");
|
||||
if (objLairs != null)
|
||||
{
|
||||
sendSystemMessageTestingOnly(objPlayer, "Non null objLairs.. length is " + objLairs.length);
|
||||
if (objLairs.length > 0)
|
||||
{
|
||||
String strSpam = objPlayer + " Too many lairs in the area, kicking out, area was " + locHome + " number of lairs is " + objLairs.length;
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (strObjectType != null)
|
||||
{
|
||||
int intIndex = strObjectType.indexOf("theater");
|
||||
if (intIndex > -1)
|
||||
{
|
||||
objLairs = getAllObjectsWithTemplate(locHome, 200, "object/creature/planet/bothan_male.iff");
|
||||
int intCount = utils.countSubStringObjVars(objLairs, "spawing.lairType", "theater");
|
||||
if (intCount > 0)
|
||||
{
|
||||
String strSpam = objPlayer + " theaters in range is " + intCount + " too many at location " + locHome;
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
obj_id[] objTheaters = getAllObjectsWithObjVar(locHome, 200, "isScenario");
|
||||
if (objTheaters != null)
|
||||
{
|
||||
if (objTheaters.length > 0)
|
||||
{
|
||||
String strSpam = objPlayer + " too many scenarios neat " + locHome + " count was " + objTheaters.length;
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (objTemplates.length > SPAWN_CHECK_TEMPLATE_LIMIT)
|
||||
{
|
||||
if (boolLogFailures)
|
||||
{
|
||||
String strSpam = objPlayer + " found too many normal templates in range of " + locHome + " count was " + objTemplates.length;
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public boolean canSpawn(obj_id objPlayer, location locSpawnLocation, boolean boolCheckForTheaters, String strObjectType) throws InterruptedException
|
||||
{
|
||||
boolean boolLogFailures = true;
|
||||
boolean boolVerboseMode = true;
|
||||
if (!isSpawningAllowed(locSpawnLocation))
|
||||
{
|
||||
String strSpam = objPlayer + " spawning not allowed on " + locSpawnLocation.area;
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
return false;
|
||||
}
|
||||
int intServerSpawnLimit = getServerSpawnLimit();
|
||||
String strSpam = "";
|
||||
location locCurrentLocation = getLocation(objPlayer);
|
||||
if (locCurrentLocation.area == "tutorial")
|
||||
{
|
||||
strSpam = objPlayer + " canSpawn failed: spawning disabled in tutorial";
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
return false;
|
||||
}
|
||||
region[] rgnCities = getRegionsWithMunicipalAtPoint(locCurrentLocation, regions.MUNI_TRUE);
|
||||
if (rgnCities != null)
|
||||
{
|
||||
strSpam = objPlayer + " canSpawn failed: spawning not allowed in cities";
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
return false;
|
||||
}
|
||||
region rgnBattlefield = battlefield.getBattlefield(locCurrentLocation);
|
||||
if (rgnBattlefield != null)
|
||||
{
|
||||
strSpam = objPlayer + " canSpawn failed: spawning disabled in battlefields";
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
return false;
|
||||
}
|
||||
rgnCities = getRegionsWithGeographicalAtPoint(locCurrentLocation, regions.GEO_CITY);
|
||||
if (rgnCities != null)
|
||||
{
|
||||
strSpam = objPlayer + " canSpawn failed: spawning not allowed in cities";
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
return false;
|
||||
}
|
||||
obj_id objMasterSpawner = getPlanetByName(locCurrentLocation.area);
|
||||
if (hasObjVar(objMasterSpawner, "boolSpawnerIsOn"))
|
||||
{
|
||||
boolean boolSpawnerIsOn;
|
||||
boolSpawnerIsOn = getBooleanObjVar(objMasterSpawner, "boolSpawnerIsOn");
|
||||
if (boolSpawnerIsOn == false)
|
||||
{
|
||||
strSpam = objPlayer + " canSpawn failed: spawning is disabled";
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
return boolSpawnerIsOn;
|
||||
}
|
||||
}
|
||||
if (locCurrentLocation.cell != obj_id.NULL_ID)
|
||||
{
|
||||
strSpam = objPlayer + " canSpawn failed: spawnig is disabled in cells";
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
return false;
|
||||
}
|
||||
if (hasObjVar(objPlayer, "spawning.locSpawnLocation"))
|
||||
{
|
||||
int intSpawnedTemplates = 0;
|
||||
if (hasObjVar(objPlayer, "spawning.intSpawnedTemplates"))
|
||||
{
|
||||
intSpawnedTemplates = getIntObjVar(objPlayer, "spawning.intSpawnedTemplates");
|
||||
}
|
||||
if (intSpawnedTemplates >= SPAWN_CHECK_LIMIT)
|
||||
{
|
||||
location locLastSpawnLocation = getLocationObjVar(objPlayer, "spawning.locSpawnLocation");
|
||||
float fltDistance = utils.getDistance(locLastSpawnLocation, locCurrentLocation);
|
||||
if (fltDistance < SPAWN_CHECK_DISTANCE)
|
||||
{
|
||||
strSpam = objPlayer + " You need to move before we spawn more stuff";
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
strSpam = objPlayer + " The minimum check distance is: " + SPAWN_CHECK_DISTANCE;
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
strSpam = objPlayer + " Your distance is: " + fltDistance;
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (locSpawnLocation != null)
|
||||
{
|
||||
rgnCities = getRegionsWithMunicipalAtPoint(locSpawnLocation, regions.MUNI_TRUE);
|
||||
if (rgnCities != null)
|
||||
{
|
||||
strSpam = " spawn location is in a city, returning false from canspawn";
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
return false;
|
||||
}
|
||||
rgnCities = getRegionsWithGeographicalAtPoint(locSpawnLocation, regions.GEO_CITY);
|
||||
if (rgnCities != null)
|
||||
{
|
||||
strSpam = "location is in a city2, returning false from canspawn";
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
return false;
|
||||
}
|
||||
rgnBattlefield = battlefield.getBattlefield(locSpawnLocation);
|
||||
if (rgnBattlefield != null)
|
||||
{
|
||||
strSpam = "location is in a battlefield, returning false from canspawn";
|
||||
sendSpawnSpam(objPlayer, boolLogFailures, boolVerboseMode, strSpam);
|
||||
return false;
|
||||
}
|
||||
if (!checkTemplatesInRange(objPlayer, locSpawnLocation, boolCheckForTheaters, strObjectType))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public void sendSpawnSpam(obj_id self, boolean boolLogFailures, boolean boolVerboseMode, String strSpam) throws InterruptedException
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, strSpam);
|
||||
return;
|
||||
}
|
||||
public boolean isSpawningAllowed(location locTest) throws InterruptedException
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public int gmCreateSpecificResource(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException
|
||||
{
|
||||
String strClass = params;
|
||||
if ((strClass == null) || (strClass.equals("")))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Bad class passed in, syntax is /gmCreateClassResource class");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id rtype = pickRandomNonDepeletedResource(strClass);
|
||||
if (!isIdValid(rtype))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "No id found");
|
||||
sendSystemMessageTestingOnly(self, "Type was " + strClass);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
String crateTemplate = getResourceContainerForType(rtype);
|
||||
if (!crateTemplate.equals(""))
|
||||
{
|
||||
obj_id pInv = utils.getInventoryContainer(self);
|
||||
if (pInv != null)
|
||||
{
|
||||
obj_id crate = createObject(crateTemplate, pInv, "");
|
||||
if (addResourceToContainer(crate, rtype, 100000, self))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Resource of class " + params + " added");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int gmCreateClassResource(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException
|
||||
{
|
||||
String strClass = params;
|
||||
if ((strClass == null) || (strClass.equals("")))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Bad class passed in, syntax is /gmCreateClassResource class");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id rtype = pickRandomNonDepeletedResource(strClass);
|
||||
if (!isIdValid(rtype))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Bad class passed in, syntax is /gmCreateClassResource class");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
String crateTemplate = getResourceContainerForType(rtype);
|
||||
if (!crateTemplate.equals(""))
|
||||
{
|
||||
obj_id pInv = utils.getInventoryContainer(self);
|
||||
if (pInv != null)
|
||||
{
|
||||
obj_id crate = createObject(crateTemplate, pInv, "");
|
||||
if (addResourceToContainer(crate, rtype, 100000, self))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "Resource of class " + params + " added");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void spawnContents(obj_id dungeon, String spawnType, int numberOfCopies) throws InterruptedException
|
||||
{
|
||||
obj_id self = getSelf();
|
||||
sendSystemMessageTestingOnly(self, "//***// spawnContents: ////>>>> entered. SpawnType requested was: " + spawnType);
|
||||
String[] spawnTypeColumnData = dataTableGetStringColumnNoDefaults(mustafar.CONST_TBL_EVENT_DATA, "dataType");
|
||||
if (spawnTypeColumnData.length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < spawnTypeColumnData.length; i++)
|
||||
{
|
||||
if (spawnTypeColumnData[i].equals(spawnType))
|
||||
{
|
||||
dictionary dict = dataTableGetRow(mustafar.CONST_TBL_EVENT_DATA, i);
|
||||
sendSystemMessageTestingOnly(self, "spawnContents:Retrieving info for row(" + i + ")");
|
||||
int locx = dict.getInt("locx");
|
||||
int locy = dict.getInt("locy");
|
||||
int locz = dict.getInt("locz");
|
||||
location myself = getLocation(dungeon);
|
||||
String scene = myself.area;
|
||||
obj_id cell = getCellId(dungeon, "mainroom");
|
||||
float yaw = dict.getFloat("yaw");
|
||||
String script = dict.getString("script");
|
||||
location spawnLoc = new location(locx, locy, locz, scene, cell);
|
||||
String object = dict.getString("object");
|
||||
if ((dict.getString("dataType")).equals("setpiece"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "//***// spawnContents: ////>>>> Going to try to spawn a 'setpiece'");
|
||||
obj_id item = createObjectInCell(object, dungeon, "mainroom", spawnLoc);
|
||||
if (!isIdValid(item))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "spawnContents: Tried to create invalid item(" + object + ")");
|
||||
return;
|
||||
}
|
||||
setYaw(item, yaw);
|
||||
if (!script.equals("none"))
|
||||
{
|
||||
attachScript(item, script);
|
||||
}
|
||||
utils.setScriptVar(item, "dungeon", dungeon);
|
||||
sendSystemMessageTestingOnly(self, "spawnContents: Created object(" + object + "/" + item + ") with script(" + script);
|
||||
}
|
||||
else if (!(dict.getString("dataType")).equals("location") && !(dict.getString("dataType")).equals("forcePowerAttack"))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "//***// spawnContents: ////>>>> Going to try to spawn a creature of some kind");
|
||||
sendSystemMessageTestingOnly(self, "//***// spawnContents: ////>>>> Going to try to spawn a creature. SERIOUSLY!");
|
||||
if (numberOfCopies < 1)
|
||||
{
|
||||
numberOfCopies = 1;
|
||||
}
|
||||
sendSystemMessageTestingOnly(self, "//***// spawnContents: ////>>>> numberOfCopies is: " + numberOfCopies);
|
||||
for (int j = 0; j < numberOfCopies; j++)
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "//***// spawnContents: ////>>>> spawn loop 1");
|
||||
obj_id creature = create.object(object, spawnLoc);
|
||||
sendSystemMessageTestingOnly(self, "//***// spawnContents: ////>>>> creature spawned objId is: " + creature);
|
||||
if (!isIdValid(creature))
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "spawnContents: Tried to create invalid creature(" + object + ")");
|
||||
return;
|
||||
}
|
||||
if (!script.equals("none"))
|
||||
{
|
||||
attachScript(creature, script);
|
||||
}
|
||||
utils.setScriptVar(creature, "dungeon", dungeon);
|
||||
sendSystemMessageTestingOnly(self, "spawnContents: Created object(" + object + "/" + creature + ") with script(" + script);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,264 +0,0 @@
|
||||
package script.working;
|
||||
|
||||
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.utils;
|
||||
|
||||
public class requestloctest extends script.base_script
|
||||
{
|
||||
public requestloctest()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self))
|
||||
{
|
||||
sendSystemMessage(self, "You are not authorized to use this script.", "");
|
||||
detachScript(self, "working.requestloctest");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
||||
{
|
||||
if (!isGod(self))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
int stringCheck = text.indexOf("get_location_32");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
boolean checkSlope = true;
|
||||
boolean checkWater = true;
|
||||
stringCheck = text.indexOf("allow_slope");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
checkSlope = false;
|
||||
}
|
||||
stringCheck = text.indexOf("allow_water");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
checkWater = false;
|
||||
}
|
||||
location here = getLocation(self);
|
||||
requestLocation(self, "get_location_32", here, 500.0f, 32.0f, checkWater, checkSlope);
|
||||
sendSystemMessage(self, "requestingLocation: get_location_32 - water: " + checkWater + ", slope: " + checkSlope, "");
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
stringCheck = text.indexOf("get_location_48");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
boolean checkSlope = true;
|
||||
boolean checkWater = true;
|
||||
stringCheck = text.indexOf("allow_slope");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
checkSlope = false;
|
||||
}
|
||||
stringCheck = text.indexOf("allow_water");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
checkWater = false;
|
||||
}
|
||||
location here = getLocation(self);
|
||||
requestLocation(self, "get_location_48", here, 500.0f, 48.0f, checkWater, checkSlope);
|
||||
sendSystemMessage(self, "requestingLocation: get_location_48 - water: " + checkWater + ", slope: " + checkSlope, "");
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
stringCheck = text.indexOf("get_location_64");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
boolean checkSlope = true;
|
||||
boolean checkWater = true;
|
||||
stringCheck = text.indexOf("allow_slope");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
checkSlope = false;
|
||||
}
|
||||
stringCheck = text.indexOf("allow_water");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
checkWater = false;
|
||||
}
|
||||
location here = getLocation(self);
|
||||
requestLocation(self, "get_location_64", here, 500.0f, 64.0f, checkWater, checkSlope);
|
||||
sendSystemMessage(self, "requestingLocation: get_location_64 - water: " + checkWater + ", slope: " + checkSlope, "");
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
stringCheck = text.indexOf("get_location_80");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
boolean checkSlope = true;
|
||||
boolean checkWater = true;
|
||||
stringCheck = text.indexOf("allow_slope");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
checkSlope = false;
|
||||
}
|
||||
stringCheck = text.indexOf("allow_water");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
checkWater = false;
|
||||
}
|
||||
location here = getLocation(self);
|
||||
requestLocation(self, "get_location_80", here, 500.0f, 80.0f, checkWater, checkSlope);
|
||||
sendSystemMessage(self, "requestingLocation: get_location_80 - water: " + checkWater + ", slope: " + checkSlope, "");
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
stringCheck = text.indexOf("get_location_96");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
boolean checkSlope = true;
|
||||
boolean checkWater = true;
|
||||
stringCheck = text.indexOf("allow_slope");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
checkSlope = false;
|
||||
}
|
||||
stringCheck = text.indexOf("allow_water");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
checkWater = false;
|
||||
}
|
||||
location here = getLocation(self);
|
||||
requestLocation(self, "get_location_96", here, 500.0f, 96.0f, checkWater, checkSlope);
|
||||
sendSystemMessage(self, "requestingLocation: get_location_96 - water: " + checkWater + ", slope: " + checkSlope, "");
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
stringCheck = text.indexOf("clear_last_location");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
if (hasObjVar(self, "locTest.objects"))
|
||||
{
|
||||
Vector locObjects = getResizeableObjIdArrayObjVar(self, "locTest.objects");
|
||||
if (locObjects != null && locObjects.size() > 0)
|
||||
{
|
||||
int lastObjectIndx = locObjects.size() - 1;
|
||||
obj_id locObject = ((obj_id)locObjects.get(lastObjectIndx));
|
||||
utils.removeElementAt(locObjects, lastObjectIndx);
|
||||
setObjVar(self, "locTest.objects", locObjects);
|
||||
if (isIdValid(locObject))
|
||||
{
|
||||
locations.destroyLocationObject(locObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasObjVar(self, "locTest.waypoints"))
|
||||
{
|
||||
Vector locWaypoints = getResizeableObjIdArrayObjVar(self, "locTest.waypoints");
|
||||
if (locWaypoints != null && locWaypoints.size() > 0)
|
||||
{
|
||||
int lastWaypointIndx = locWaypoints.size() - 1;
|
||||
obj_id locWaypoint = ((obj_id)locWaypoints.get(lastWaypointIndx));
|
||||
utils.removeElementAt(locWaypoints, lastWaypointIndx);
|
||||
setObjVar(self, "locTest.waypoints", locWaypoints);
|
||||
if (isIdValid(locWaypoint))
|
||||
{
|
||||
destroyWaypointInDatapad(locWaypoint, self);
|
||||
}
|
||||
}
|
||||
}
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
stringCheck = text.indexOf("clear_all_locations");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
getRidOfLocObjects(self);
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
stringCheck = text.indexOf("detach_script");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
getRidOfLocObjects(self);
|
||||
detachScript(self, "working.requestloctest");
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
stringCheck = text.indexOf("help");
|
||||
if (stringCheck > -1)
|
||||
{
|
||||
String msg1 = "Type get_location_32, get_location_48, get_location_64, get_location_80, or get_location_96 to request a location.";
|
||||
String msg1b = " Include allow_slope or allow_water to not block for slope or for water.";
|
||||
String msg2 = " Type clear_last_location or clear_all_locations to clear reserved location objects.";
|
||||
String msg3 = " Type detach_script to clear current reserved location objects and detach this script.";
|
||||
sendSystemMessage(self, msg1 + msg1b + msg2 + msg3, "");
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnLocationReceived(obj_id self, String locationId, obj_id locationObject, location locationLocation, float locationRadius) throws InterruptedException
|
||||
{
|
||||
if (!isIdValid(locationObject))
|
||||
{
|
||||
sendSystemMessage(self, "locationObject was invalid for search location: " + locationLocation + " locationId: " + locationId, "");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (locationLocation == null)
|
||||
{
|
||||
sendSystemMessage(self, "locationLocation was null (??!!?) for search location: " + locationLocation + " locationId: " + locationId, "");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
Vector locObjects = new Vector();
|
||||
locObjects.setSize(0);
|
||||
if (hasObjVar(self, "locTest.objects"))
|
||||
{
|
||||
locObjects = getResizeableObjIdArrayObjVar(self, "locTest.objects");
|
||||
}
|
||||
utils.addElement(locObjects, locationObject);
|
||||
setObjVar(self, "locTest.objects", locObjects);
|
||||
obj_id waypoint = createWaypointInDatapad(self, locationLocation);
|
||||
setWaypointName(waypoint, locationId);
|
||||
setWaypointActive(waypoint, true);
|
||||
Vector locWaypoints = new Vector();
|
||||
locWaypoints.setSize(0);
|
||||
if (hasObjVar(self, "locTest.waypoints"))
|
||||
{
|
||||
locWaypoints = getResizeableObjIdArrayObjVar(self, "locTest.waypoints");
|
||||
}
|
||||
utils.addElement(locWaypoints, waypoint);
|
||||
setObjVar(self, "locTest.waypoints", locWaypoints);
|
||||
sendSystemMessage(self, "OnLocationReceived parameters - Id: " + locationId + ", location: " + locationLocation + ", object: " + locationObject + ", radius:" + locationRadius, "");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void getRidOfLocObjects(obj_id self) throws InterruptedException
|
||||
{
|
||||
if (hasObjVar(self, "locTest.objects"))
|
||||
{
|
||||
Vector locObjects = getResizeableObjIdArrayObjVar(self, "locTest.objects");
|
||||
removeObjVar(self, "locTest.objects");
|
||||
if (locObjects != null && locObjects.size() > 0)
|
||||
{
|
||||
for (int i = 0; i < locObjects.size(); i++)
|
||||
{
|
||||
obj_id locObject = ((obj_id)locObjects.get(i));
|
||||
if (isIdValid(locObject))
|
||||
{
|
||||
locations.destroyLocationObject(locObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasObjVar(self, "locTest.waypoints"))
|
||||
{
|
||||
Vector locWaypoints = getResizeableObjIdArrayObjVar(self, "locTest.waypoints");
|
||||
removeObjVar(self, "locTest.waypoints");
|
||||
if (locWaypoints != null && locWaypoints.size() > 0)
|
||||
{
|
||||
for (int i = 0; i < locWaypoints.size(); i++)
|
||||
{
|
||||
obj_id locWaypoint = ((obj_id)locWaypoints.get(i));
|
||||
if (isIdValid(locWaypoint))
|
||||
{
|
||||
destroyWaypointInDatapad(locWaypoint, self);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package script.working;
|
||||
|
||||
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.pclib;
|
||||
import script.library.factions;
|
||||
import script.library.player_structure;
|
||||
import script.library.skill;
|
||||
|
||||
public class royscript extends script.base_script
|
||||
{
|
||||
public royscript()
|
||||
{
|
||||
}
|
||||
public int OnSpeaking(obj_id self, String strText) throws InterruptedException
|
||||
{
|
||||
String[] strCommands = split(strText, ' ');
|
||||
if (strCommands[0].equals("setupImperialFaction"))
|
||||
{
|
||||
factions.addFactionStanding(self, factions.FACTION_IMPERIAL, 3000);
|
||||
sendSystemMessageTestingOnly(self, "Done");
|
||||
}
|
||||
if (strCommands[0].equals("makeInteresting"))
|
||||
{
|
||||
setCondition(getLookAtTarget(self), CONDITION_INTERESTING);
|
||||
sendSystemMessageTestingOnly(self, "Set condition");
|
||||
}
|
||||
if (strCommands[0].equals("setYaw"))
|
||||
{
|
||||
setYaw(self, 90);
|
||||
sendSystemMessageTestingOnly(self, "Set condition");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package script.working;
|
||||
|
||||
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 scriptvars extends script.base_script
|
||||
{
|
||||
public scriptvars()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
deltadictionary dctScriptVars = self.getScriptVars();
|
||||
debugSpeakMsg(self, "ScriptVars are " + dctScriptVars.toString());
|
||||
detachScript(self, "working.scriptvars");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,55 +0,0 @@
|
||||
package script.working.steve;
|
||||
|
||||
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 theater_test extends script.base_script
|
||||
{
|
||||
public theater_test()
|
||||
{
|
||||
}
|
||||
public int OnTheaterCreated(obj_id self, obj_id[] objects, obj_id player, obj_id creator) throws InterruptedException
|
||||
{
|
||||
debugServerConsoleMsg(self, "OnTheaterCreated enter");
|
||||
if (isIdValid(creator))
|
||||
{
|
||||
dictionary params = new dictionary();
|
||||
params.put("theater", self);
|
||||
messageTo(creator, "handleTheaterCreated", params, 0.1f, false);
|
||||
}
|
||||
else if (isIdValid(player))
|
||||
{
|
||||
persistObject(self);
|
||||
setObjVar(player, "player_theater", self);
|
||||
debugSpeakMsg(player, "Theater " + self + " active");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugServerConsoleMsg(self, "Theater missing creator");
|
||||
}
|
||||
if (objects != null)
|
||||
{
|
||||
if (objects.length == 0)
|
||||
{
|
||||
debugServerConsoleMsg(self, "OnTheaterCreated no objects");
|
||||
}
|
||||
for (int i = 0; i < objects.length; ++i)
|
||||
{
|
||||
if (isIdValid(objects[i]))
|
||||
{
|
||||
messageTo(objects[i], "startHandler", null, 1, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
debugServerConsoleMsg(self, "OnTheaterCreated null objects");
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package script.working.steve;
|
||||
|
||||
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 theater_test2 extends script.base_script
|
||||
{
|
||||
public theater_test2()
|
||||
{
|
||||
}
|
||||
public int startHandler(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package script.working.steve;
|
||||
|
||||
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.veteran_deprecated;
|
||||
|
||||
public class veteran_npc extends script.base_script
|
||||
{
|
||||
public veteran_npc()
|
||||
{
|
||||
}
|
||||
public int OnInitialize(obj_id self) throws InterruptedException
|
||||
{
|
||||
setCondition(self, CONDITION_CONVERSABLE);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnStartNpcConversation(obj_id self, obj_id conversant) throws InterruptedException
|
||||
{
|
||||
string_id greeting = null;
|
||||
string_id[] responses = null;
|
||||
if (veteran_deprecated.canGetReward(conversant))
|
||||
{
|
||||
greeting = new string_id(veteran_deprecated.VETERAN_STRING_TABLE, "greeting");
|
||||
responses = new string_id[2];
|
||||
responses[0] = new string_id(veteran_deprecated.VETERAN_STRING_TABLE, "get_award");
|
||||
responses[1] = new string_id(veteran_deprecated.VETERAN_STRING_TABLE, "not_now");
|
||||
}
|
||||
else
|
||||
{
|
||||
greeting = new string_id(veteran_deprecated.VETERAN_STRING_TABLE, "go_away");
|
||||
responses = new string_id[1];
|
||||
responses[0] = new string_id(veteran_deprecated.VETERAN_STRING_TABLE, "damn");
|
||||
}
|
||||
npcStartConversation(conversant, self, "veteran", greeting, responses);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnNpcConversationResponse(obj_id self, String conversation, obj_id conversant, string_id response) throws InterruptedException
|
||||
{
|
||||
debugServerConsoleMsg(null, "OnNpcConversationResponse response = " + response);
|
||||
if (response.equals(new string_id(veteran_deprecated.VETERAN_STRING_TABLE, "get_award")))
|
||||
{
|
||||
veteran_deprecated.requestVeteranRewards(conversant);
|
||||
}
|
||||
npcEndConversation(conversant);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user