From 16a05bd73cea96bfaa460b0bd2aa88fd5cf0a06d Mon Sep 17 00:00:00 2001 From: Seefo Date: Tue, 6 May 2014 13:30:31 -0400 Subject: [PATCH] Fixed tuning of color crystals --- scripts/radial/item/tunable.py | 23 +++++++++++------------ src/services/DevService.java | 8 ++++---- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/scripts/radial/item/tunable.py b/scripts/radial/item/tunable.py index 85e35bb3..22aa117d 100644 --- a/scripts/radial/item/tunable.py +++ b/scripts/radial/item/tunable.py @@ -21,13 +21,10 @@ def handleSelection(core, owner, target, option): #owner.sendSystemMessage('You are not attuned enough with the force yet.',1) if target.getAttachment("tunerId") == None or target.getAttachment("tunerId") == 0: - - if target.getAttributes().get("@obj_attr_n:color") is None: - owner.setAttachment("TunableObject", target.getObjectID()) - handleSUIWindow(core, owner, target, option) - - - + + owner.setAttachment("TunableObject", target.getObjectID()) + handleSUIWindow(core, owner, target, option) + else: owner.sendSystemMessage("You cannot tune this crystal.",1) return @@ -45,16 +42,18 @@ def handleSUIWindow(core, owner, target, option): def handleSUI(owner, window, eventType, returnList): if eventType == 0: - time.sleep(3) + time.sleep(1) objectID = long(owner.getAttachment("TunableObject")) tunableObject = main.NGECore.getInstance().objectService.getObject(objectID) + if tunableObject: tunableObject.getAttributes().put("@obj_attr_n:crystal_owner", owner.getCustomName()) tunableObject.setAttachment("tunerId", int(owner.getObjectId())) - main.NGECore.getInstance().lootService.tuneProcess(tunableObject) - time.sleep(0.5) + + if tunableObject.getAttributes().get("@obj_attr_n:color") is None: + main.NGECore.getInstance().lootService.tuneProcess(tunableObject) + time.sleep(0.5) + owner.sendSystemMessage('@jedi_spam:crystal_tune_success',1) - - return \ No newline at end of file diff --git a/src/services/DevService.java b/src/services/DevService.java index dc5affa8..7b79dcfe 100644 --- a/src/services/DevService.java +++ b/src/services/DevService.java @@ -1034,16 +1034,16 @@ public class DevService implements INetworkDispatch { TangibleObject colorCrystal = (TangibleObject) core.objectService.createObject("object/tangible/component/weapon/lightsaber/shared_lightsaber_module_force_crystal.iff", planet); colorCrystal.getAttributes().put("@obj_attr_n:condition", "100/100"); - //colorCrystal.getAttributes().put("@obj_attr_n:crystal_owner", "\\#D1F56F UNTUNED \\#FFFFFF "); - //colorCrystal.setAttachment("radial_filename", "item/tunable"); + colorCrystal.getAttributes().put("@obj_attr_n:crystal_owner", "\\#D1F56F UNTUNED \\#FFFFFF "); + colorCrystal.setAttachment("radial_filename", "item/tunable"); core.lootService.setCustomization(colorCrystal, "colorcrystal"); inventory.add(colorCrystal); TangibleObject lavaCrystal = (TangibleObject) core.objectService.createObject("object/tangible/component/weapon/lightsaber/shared_lightsaber_module_lava_crystal.iff", planet); lavaCrystal.getAttributes().put("@obj_attr_n:condition", "100/100"); - //lavaCrystal.getAttributes().put("@obj_attr_n:crystal_owner", "\\#D1F56F UNTUNED \\#FFFFFF "); + lavaCrystal.getAttributes().put("@obj_attr_n:crystal_owner", "\\#D1F56F UNTUNED \\#FFFFFF "); lavaCrystal.getAttributes().put("@obj_attr_n:color", "Lava"); - //lavaCrystal.setAttachment("radial_filename", "item/tunable"); + lavaCrystal.setAttachment("radial_filename", "item/tunable"); inventory.add(lavaCrystal); return;