mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-09-30 16:12:59 -04:00
Merge branch 'master' of stellabellum.net:staff/dsrc
This commit is contained in:
@@ -1,35 +1,76 @@
|
||||
package script.space.quest_logic;
|
||||
|
||||
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 delivery_no_pickup extends script.space.quest_logic.delivery
|
||||
{
|
||||
public delivery_no_pickup()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
setObjVar(self, "delivering", 1);
|
||||
setObjVar(self, "delivery_nopickup", 1);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int deliveryNoPickupAttack(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
if (params == null)
|
||||
{
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
int attackPeriod = getIntObjVar(self, "attackPeriod");
|
||||
if (attackPeriod > 0)
|
||||
{
|
||||
messageTo(self, "launchAttack", null, attackPeriod, false);
|
||||
}
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
}
|
||||
package script.space.quest_logic;
|
||||
|
||||
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 delivery_no_pickup extends script.space.quest_logic.delivery
|
||||
{
|
||||
public delivery_no_pickup()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
setObjVar(self, "delivering", 1);
|
||||
setObjVar(self, "delivery_nopickup", 1);
|
||||
String questName = getStringObjVar(self, space_quest.QUEST_NAME);
|
||||
String questType = getStringObjVar(self, space_quest.QUEST_TYPE);
|
||||
obj_id player = getObjIdObjVar(self, space_quest.QUEST_OWNER);
|
||||
if ((questName == null) || (questType == null))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
String qTable = "datatables/spacequest/" + questType + "/" + questName + ".iff";
|
||||
sendSystemMessageTestingOnly(player, "table is " + qTable);
|
||||
dictionary questInfo = dataTableGetRow(qTable, 0);
|
||||
if (questInfo == null)
|
||||
{
|
||||
sendSystemMessageTestingOnly(player, "Debug: Failed to open quest table " + qTable);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
setObjVar(self, "pickupShip", questInfo.getString("pickupShip"));
|
||||
setObjVar(self, "deliveryShip", questInfo.getString("deliveryShip"));
|
||||
setObjVar(self, "pickupPoint", questInfo.getString("pickupPoint"));
|
||||
setObjVar(self, "deliveryPoint", questInfo.getString("deliveryPoint"));
|
||||
int numAttackShipLists = questInfo.getInt("numAttackShipLists");
|
||||
setObjVar(self, "numAttackShipLists", numAttackShipLists);
|
||||
for (int i = 0; i < numAttackShipLists; i++)
|
||||
{
|
||||
String[] attackShips = dataTableGetStringColumn(qTable, "attackShips" + (i + 1));
|
||||
space_quest.cleanArray(self, "attackShips" + (i + 1), attackShips);
|
||||
}
|
||||
setObjVar(self, "attackPeriod", questInfo.getInt("attackPeriod"));
|
||||
setObjVar(self, "attackListType", questInfo.getInt("attackListType"));
|
||||
String questZone = getStringObjVar(self, space_quest.QUEST_ZONE);
|
||||
if ((getCurrentSceneName()).startsWith(questZone))
|
||||
{
|
||||
dictionary outparams = new dictionary();
|
||||
outparams.put("player", player);
|
||||
messageTo(self, "initializedQuestPlayer", outparams, 1.f, false);
|
||||
}
|
||||
int questid = questGetQuestId("spacequest/" + questType + "/" + questName);
|
||||
if (questid != 0)
|
||||
{
|
||||
questActivateTask(questid, 0, player);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int deliveryNoPickupAttack(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
if (params == null)
|
||||
{
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
int attackPeriod = getIntObjVar(self, "attackPeriod");
|
||||
if (attackPeriod > 0)
|
||||
{
|
||||
messageTo(self, "launchAttack", null, attackPeriod, false);
|
||||
}
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1971,18 +1971,6 @@ public class qatool extends script.base_script
|
||||
sui.msgbox(self, self, allHelpData, sui.OK_ONLY, QATOOL_TITLE, "noHandler");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
else if((toLower(command)).equals("persistplanet"))
|
||||
{
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
String buildoutPlanet = st.nextToken();
|
||||
|
||||
int persistedObjs = pPlanet(buildoutPlanet);
|
||||
sendSystemMessageTestingOnly(self, "Successfully persisted " + persistedObjs + " objects for " + buildoutPlanet);
|
||||
|
||||
}
|
||||
else sendSystemMessageTestingOnly(self, "Syntax: /qatool persistplanet <planet scene id>; ex: /qatool persistplanet tatooine");
|
||||
}
|
||||
else
|
||||
{
|
||||
sendSystemMessageTestingOnly(self, "No such QA Tool Command. Please check your spelling");
|
||||
@@ -2555,45 +2543,6 @@ public class qatool extends script.base_script
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
public int pPlanet(String buildoutPlanet)
|
||||
{
|
||||
int persistedObjects = 0;
|
||||
|
||||
if (buildoutPlanet != "")
|
||||
{
|
||||
String buildoutPath = "datatables/buildout/" + buildoutPlanet + "/" + buildoutPlanet + "_";
|
||||
|
||||
for(int x = 1; x < 9; x++) // we assume that a planet is comprised of 8x8 regions
|
||||
{
|
||||
for(int y = 1; y < 9; y++)
|
||||
{
|
||||
String buildoutRegionPath = buildoutPath + x + "_" + y + "_ws.iff";
|
||||
int[] buildoutRows = dataTableGetIntColumn(buildoutRegionPath, "objid");
|
||||
int[] cellIndexRows = dataTableGetIntColumn(buildoutRegionPath, "cell_index");
|
||||
|
||||
if(buildoutRows != null)
|
||||
{
|
||||
for(int i = 0; i < buildoutRows.length; i++)
|
||||
{
|
||||
if(buildoutRows[i] > 0)
|
||||
{
|
||||
obj_id buildoutObject = obj_id.getObjId(buildoutRows[i]);
|
||||
|
||||
if (cellIndexRows[i] == 0) {
|
||||
if (persistObject(buildoutObject)) {
|
||||
persistedObjects++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return persistedObjects;
|
||||
}
|
||||
|
||||
public void cleanAllScriptVars(obj_id player) throws InterruptedException
|
||||
{
|
||||
utils.removeScriptVarTree(player, "qascript");
|
||||
|
||||
Reference in New Issue
Block a user