mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-27 16:56:48 -04:00
Fixed crafting for Java 8.
This commit is contained in:
Regular → Executable
+2
-10
@@ -1,13 +1,5 @@
|
||||
package script;
|
||||
|
||||
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.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
@@ -123,13 +115,13 @@ public class base_script extends script.base_class
|
||||
String oldname = "\"" + k.toString();
|
||||
String name = oldname.replace('.', '+');
|
||||
debugServerConsoleMsg(self, "scriptvar name: " + name);
|
||||
sortedValues.put(name, scriptvars.getObject(k));
|
||||
sortedValues.put(name, scriptvars.getObject(k).toString());
|
||||
}
|
||||
Iterator keysSet = (sortedValues.keySet()).iterator();
|
||||
while (keysSet.hasNext() && i < names.length)
|
||||
{
|
||||
names[i] = (String)keysSet.next();
|
||||
attribs[i] = (String)sortedValues.get((String)names[i]);
|
||||
attribs[i] = (String)sortedValues.get(names[i]);
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+2
@@ -27,6 +27,8 @@ public class draft_schematic
|
||||
public obj_id source; // who supplied the ingredient
|
||||
public int xpType; // type of xp to grant the source
|
||||
public int xpAmount; // amount of xp to grant
|
||||
|
||||
public simple_ingredient() {}
|
||||
} // simple_ingredient
|
||||
|
||||
public static class slot
|
||||
|
||||
@@ -1,22 +1,8 @@
|
||||
package script.library;
|
||||
|
||||
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.Arrays;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashSet;
|
||||
import script.library.city;
|
||||
import script.library.luck;
|
||||
import script.library.performance;
|
||||
import script.library.reverse_engineering;
|
||||
import script.library.skill;
|
||||
import script.library.utils;
|
||||
import java.util.Vector;
|
||||
|
||||
public class craftinglib extends script.base_script
|
||||
{
|
||||
@@ -1756,33 +1742,29 @@ public class craftinglib extends script.base_script
|
||||
return false;
|
||||
}
|
||||
draft_schematic.slot[] slots = schematic.getSlots();
|
||||
draft_schematic.attribute[] objectAttribs = schematic.getAttribs();
|
||||
draft_schematic.attribute[] experimentalAttribs = schematic.getExperimentalAttribs();
|
||||
int ratio = 0;
|
||||
int powerMod = 0;
|
||||
obj_id powerBitId = obj_id.NULL_ID;
|
||||
for (int i = 0; i < slots.length; ++i)
|
||||
{
|
||||
if (!isIdValid(slots[i].ingredients[0].ingredient) || !exists(slots[i].ingredients[0].ingredient))
|
||||
{
|
||||
String reStatMod;
|
||||
obj_id ingredient;
|
||||
for (draft_schematic.slot slot : slots) {
|
||||
ingredient = slot.ingredients[0].ingredient;
|
||||
if (!isIdValid(ingredient) || !exists(ingredient)) {
|
||||
continue;
|
||||
}
|
||||
if (hasObjVar(slots[i].ingredients[0].ingredient, "reverse_engineering.reverse_engineering_modifier"))
|
||||
{
|
||||
CustomerServiceLog("new_weapon_crafting", "ingredient " + slots[i].ingredients[0].ingredient + " has the objvar reverse_engineering.reverse_engineering_modifier");
|
||||
String reStatMod = getStringObjVar(slots[i].ingredients[0].ingredient, "reverse_engineering.reverse_engineering_modifier");
|
||||
ratio = getIntObjVar(slots[i].ingredients[0].ingredient, "reverse_engineering.reverse_engineering_ratio");
|
||||
if (!reverse_engineering.canMakePowerUp(reStatMod))
|
||||
{
|
||||
if (hasObjVar(ingredient, "reverse_engineering.reverse_engineering_modifier")) {
|
||||
CustomerServiceLog("new_weapon_crafting", "ingredient " + ingredient + " has the objvar reverse_engineering.reverse_engineering_modifier");
|
||||
reStatMod = getStringObjVar(ingredient, "reverse_engineering.reverse_engineering_modifier");
|
||||
ratio = getIntObjVar(ingredient, "reverse_engineering.reverse_engineering_ratio");
|
||||
if (!reverse_engineering.canMakePowerUp(reStatMod)) {
|
||||
CustomerServiceLog("new_weapon_crafting", "Player " + getFirstName(player) + "(" + player + ") has tried to use an invalid RE modifier. We are killing the crafting process.");
|
||||
sui.msgbox(player, new string_id("spam", "bad_re_modifier"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasObjVar(slots[i].ingredients[0].ingredient, "reverse_engineering.reverse_engineering_power"))
|
||||
{
|
||||
powerBitId = slots[i].ingredients[0].ingredient;
|
||||
powerMod = getIntObjVar(slots[i].ingredients[0].ingredient, "reverse_engineering.reverse_engineering_power");
|
||||
if (hasObjVar(ingredient, "reverse_engineering.reverse_engineering_power")) {
|
||||
powerBitId = ingredient;
|
||||
powerMod = getIntObjVar(ingredient, "reverse_engineering.reverse_engineering_power");
|
||||
}
|
||||
}
|
||||
float modifiedPower = 0.0f;
|
||||
|
||||
Regular → Executable
+2
@@ -348,8 +348,10 @@ public class script_class_loader extends ClassLoader
|
||||
defaultLoad.add("script.deltadictionary");
|
||||
defaultLoad.add("script.dictionary");
|
||||
defaultLoad.add("script.draft_schematic");
|
||||
defaultLoad.add("script.draft_schematic$simple_ingredient");
|
||||
defaultLoad.add("script.draft_schematic$slot");
|
||||
defaultLoad.add("script.draft_schematic$attribute");
|
||||
defaultLoad.add("script.draft_schematic$custom");
|
||||
defaultLoad.add("script.location");
|
||||
defaultLoad.add("script.map_location");
|
||||
defaultLoad.add("script.menu_info");
|
||||
|
||||
Reference in New Issue
Block a user