mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-09-11 22:45:06 -04:00
kill ship refire fix
This commit is contained in:
@@ -297,34 +297,7 @@ public class space_crafting extends script.base_script
|
||||
}
|
||||
public static void recalculateFireRateFromSlot(obj_id player, obj_id self, int slot) throws InterruptedException
|
||||
{
|
||||
int intCrc = getShipComponentCrc(self, slot);
|
||||
if (intCrc == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
String descName = getShipComponentDescriptorCrcName(intCrc);
|
||||
if (descName.equals("") || descName.length() <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
String template = dataTableGetString(SHIP_COMPONENT_TABLE, descName, "object_template");
|
||||
if (template.equals("") || template.length() <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int charges = getIntObjVar(self, "ship_refire_fix");
|
||||
float weaponFireRate = getShipWeaponRefireRate(self, slot);
|
||||
int reverseEngineeringLevel = dataTableGetInt(SHIP_WEAPON_TABLE, template, "reverseEngineeringLevel");
|
||||
float newWeaponFireRate = filterFireRateForShip(weaponFireRate, reverseEngineeringLevel);
|
||||
float lootDropFireRateAverage = dataTableGetFloat(SHIP_WEAPON_TABLE, template, "fltRefireRate");
|
||||
if (charges > 0 && newWeaponFireRate != weaponFireRate)
|
||||
{
|
||||
CustomerServiceLog("space_loot", "Weapon fire rate fix in ship. |player: " + player + "|ship: " + self + "|weapon name: " + descName + "|weaponFireRate: " + weaponFireRate + "|newWeaponFireRate: " + newWeaponFireRate + "|reverseEngineeringLevel: " + reverseEngineeringLevel);
|
||||
setShipWeaponRefireRate(self, slot, newWeaponFireRate);
|
||||
charges--;
|
||||
setObjVar(self, "ship_refire_fix", charges);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
public static obj_id initializeSpaceShipComponent(obj_id objComponent) throws InterruptedException
|
||||
{
|
||||
|
||||
@@ -325,22 +325,6 @@ public class combat_ship extends script.base_script
|
||||
public int OnInitialize(obj_id self) throws InterruptedException
|
||||
{
|
||||
obj_id player = utils.getContainingPlayer(self);
|
||||
if (!hasObjVar(self, "ship_refire_fix"))
|
||||
{
|
||||
String ship_refire_table = "datatables/space_loot/ship_refire_fix/" + getClusterName() + "_ships.iff";
|
||||
String id = "" + self;
|
||||
LOG("shipcontents", "ship: " + id + " versioning weapons with " + ship_refire_table);
|
||||
dictionary refireDict = utils.dataTableGetRow(ship_refire_table, id);
|
||||
if (refireDict == null)
|
||||
{
|
||||
LOG("shipcontents", "Ship for refire fix not found for " + self + ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
setObjVar(self, "ship_refire_fix", refireDict.getInt("count"));
|
||||
LOG("shipcontents", "Ship for refire fix found for " + self + " with " + refireDict.getInt("count") + " charges.");
|
||||
}
|
||||
}
|
||||
setCondition(self, CONDITION_ON);
|
||||
String strChassisType = getShipChassisType(self);
|
||||
int[] intSlots = space_crafting.getShipInstalledSlots(self);
|
||||
|
||||
@@ -26,16 +26,6 @@ public class component_loot extends script.base_script
|
||||
int flags = getIntObjVar(self, "ship_comp.flags");
|
||||
boolean isBitSet = (flags & ship_component_flags.SCF_reverse_engineered) != 0;
|
||||
obj_id player = utils.getContainingPlayer(self);
|
||||
if (isBitSet)
|
||||
{
|
||||
String ship_refire_table = "datatables/space_loot/ship_refire_fix/" + getClusterName() + "_ships.iff";
|
||||
String id = "" + self;
|
||||
dictionary refireDict = utils.dataTableGetRow(ship_refire_table, id);
|
||||
if (refireDict != null)
|
||||
{
|
||||
space_crafting.recalculateFireRateFromObject(player, self);
|
||||
}
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException
|
||||
|
||||
@@ -578,19 +578,6 @@ public class teidson_test extends script.base_script
|
||||
utils.warpPlayer(self, loc);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (strCommands[0].equals("teidsonfix"))
|
||||
{
|
||||
int num_rows = dataTableGetNumRows("datatables/space_loot/ship_refire_fix/" + getClusterName() + "_ships.iff");
|
||||
LOG("shipcontents", "Rows: " + num_rows);
|
||||
for (int i = 0; i < num_rows; i++)
|
||||
{
|
||||
dictionary row = dataTableGetRow("datatables/space_loot/ship_refire_fix/" + getClusterName() + "_ships.iff", i);
|
||||
if (row != null)
|
||||
{
|
||||
LOG("shipcontents", "Data: " + row.getString("id") + " / " + row.getInt("count"));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (strCommands[0].equals("shipinfo"))
|
||||
{
|
||||
obj_id[] scds = callable.getDatapadCallablesByType(self, callable.CALLABLE_TYPE_SHIP);
|
||||
|
||||
Reference in New Issue
Block a user