Corrected multi-colored junk items handling

This commit is contained in:
CharonInferar
2014-06-25 02:39:57 +02:00
parent b72f51c717
commit b57e9209da
4 changed files with 80 additions and 5 deletions
@@ -13,11 +13,11 @@ def lootDescriptor():
def customizationAttributes():
return ['/private/index_color_1']
return ['/private/index_color_1','/private/index_color_2']
def customizationValues():
return [13] #not correct
return [6,12]
def reverse_engineering_name():
+59
View File
@@ -2805,8 +2805,67 @@ public class LootService implements INetworkDispatch {
item24b.setUses(399);
core.objectService.addStackableItem(item24b,playerInventory);
TangibleObject item25a = (TangibleObject)core.objectService.createObject("object/tangible/loot/npc_loot/shared_wiring_generic.iff", player.getPlanet());
item25a.setCustomName("Wiring");
item25a.setAttachment("reverse_engineering_name", "Red/Yellow");
item25a.setStackable(true);
item25a.setUses(299);
Vector<String> customizationAttributes = new Vector<String>();
customizationAttributes.add("/private/index_color_1");
customizationAttributes.add("/private/index_color_2");
Vector<Integer> customizationValues = new Vector<Integer>();
customizationValues.add(6);
customizationValues.add(12);
item25a.setAttachment("lootDescriptor", "customattributes");
setCustomization(item25a,"Wiring", customizationAttributes, customizationValues);
core.objectService.addStackableItem(item25a,playerInventory);
TangibleObject item25b = (TangibleObject)core.objectService.createObject("object/tangible/loot/npc_loot/shared_launcher_tube_generic.iff", player.getPlanet());
item25b.setCustomName("Launcher Tube");
item25b.setStackable(true);
item25b.setUses(399);
core.objectService.addStackableItem(item25b,playerInventory);
TangibleObject item27b = (TangibleObject)core.objectService.createObject("object/tangible/loot/npc_loot/shared_small_motor_generic.iff", player.getPlanet());
item27b.setCustomName("Locomotor");
item27b.setStackable(true);
item27b.setUses(399);
core.objectService.addStackableItem(item27b,playerInventory);
TangibleObject item26a = (TangibleObject)core.objectService.createObject("object/tangible/loot/npc_loot/shared_copper_battery_generic.iff", player.getPlanet());
item26a.setCustomName("Droid Battery");
item26a.setAttachment("reverse_engineering_name", "Black/Green");
item26a.setStackable(true);
item26a.setUses(299);
customizationAttributes = new Vector<String>();
customizationAttributes.add("/private/index_color_1");
customizationAttributes.add("/private/index_color_2");
customizationValues = new Vector<Integer>();
customizationValues.add(0);
customizationValues.add(15);
item26a.setAttachment("lootDescriptor", "customattributes");
setCustomization(item26a,"Droid Battery", customizationAttributes, customizationValues);
core.objectService.addStackableItem(item26a,playerInventory);
TangibleObject item26b = (TangibleObject)core.objectService.createObject("object/tangible/loot/npc_loot/shared_copper_battery_generic.iff", player.getPlanet());
item26b.setCustomName("Droid Battery");
item26b.setAttachment("reverse_engineering_name", "Purple/Green");
item26b.setStackable(true);
item26b.setUses(299);
customizationAttributes = new Vector<String>();
customizationAttributes.add("/private/index_color_1");
customizationAttributes.add("/private/index_color_2");
customizationValues = new Vector<Integer>();
customizationValues.add(33);
customizationValues.add(15);
item26b.setAttachment("lootDescriptor", "customattributes");
setCustomization(item26b,"Droid Battery", customizationAttributes, customizationValues);
core.objectService.addStackableItem(item26b,playerInventory);
String modifierBitTemplate = "object/tangible/component/reverse_engineering/shared_modifier_bit.iff";
TangibleObject modifierBit = (TangibleObject) core.objectService.createObject(modifierBitTemplate, player.getPlanet());
modifierBit.setCustomName("Droid Experimentation");
+2 -1
View File
@@ -113,7 +113,8 @@ public class HousingService implements INetworkDispatch {
HouseTemplate houseTemplate = housingTemplates.get(deed.getTemplate());
int structureLotCost = houseTemplate.getLotCost();
String structureTemplate = houseTemplate.getBuildingTemplate();
PlayerCity city = core.playerCityService.getCityPositionIsIn(new Point3D(positionX, 0, positionZ));
//PlayerCity city = core.playerCityService.getCityPositionIsIn(new Point3D(positionX, 0, positionZ));
PlayerCity city = null;
if (!houseTemplate.canBePlacedOn(actor.getPlanet().getName())) {
actor.sendSystemMessage("You may not place this structure on this planet.", (byte) 0); // should probably load this from an stf
+17 -2
View File
@@ -1439,8 +1439,23 @@ public class ObjectService implements INetworkDispatch {
@Override
public void process(SWGObject obj) {
if (obj.getTemplate().equals(item.getTemplate())){
alikeItemsInContainer.add(obj);
System.out.println(obj.getTemplate());
// Check if items are Droid Motors or Wirings
if (obj.getTemplate().equals("object/tangible/loot/npc_loot/shared_wiring_generic.iff")){
if (obj.getAttachment("reverse_engineering_name")!=null){
if (obj.getAttachment("reverse_engineering_name").equals(item.getAttachment("reverse_engineering_name"))){
alikeItemsInContainer.add(obj);
}
}
} else if (obj.getTemplate().equals("object/tangible/loot/npc_loot/shared_copper_battery_generic.iff")){
if (obj.getAttachment("reverse_engineering_name")!=null){
if (obj.getAttachment("reverse_engineering_name").equals(item.getAttachment("reverse_engineering_name"))){
alikeItemsInContainer.add(obj);
}
}
} else {
alikeItemsInContainer.add(obj);
}
}
}
});