Biolinking and buff item procs added

Rare buff items now have a working proc
This commit is contained in:
CharonInferar
2014-06-01 20:29:36 +02:00
parent 7859d24583
commit b768272ef2
23 changed files with 611 additions and 14 deletions
@@ -2,3 +2,22 @@
def itemTemplate():
return ['object/tangible/component/weapon/lightsaber/shared_lightsaber_module_force_crystal.iff']
def customItemName():
return "Cunning Of Tyranus"
def customColor1():
return 0
def lootDescriptor():
return 'rarecolorcrystal'
def itemStats():
stats = ['elemtype','heat','heat']
stats +=['elemdamage','6','6']
return stats
@@ -1,4 +1,4 @@
def itemTemplate():
return ['object/tangible/wearables/base/shared_base_cloak_hooded.iff'] # needs correct iff still
return ['object/tangible/wearables/robe/shared_robe_s05_h1.iff'] # needs correct iff still
@@ -2,3 +2,25 @@
def itemTemplate():
return ['object/tangible/component/weapon/lightsaber/shared_lightsaber_module_force_crystal.iff']
def customItemName():
return "Shard Of Ferocity"
def biolink():
return 1
def lootDescriptor():
return 'rarebuffitem'
def itemStats():
stats = ['buffeffect','Action','+500']
stats +=['effectname','Ferocity','Ferocity']
stats +=['duration','180','180']
stats +=['cooldown','3600','3600']
return stats
@@ -2,3 +2,24 @@
def itemTemplate():
return ['object/tangible/component/weapon/lightsaber/shared_lightsaber_module_force_crystal.iff'] # correct iff not found
def customItemName():
return "Shard Of Retaliation"
def biolink():
return 1
def lootDescriptor():
return 'rarebuffitem'
def itemStats():
stats = ['buffeffect','Action','+500']
stats +=['effectname','towCrystalUberDs','towCrystalUberDs']
stats +=['duration','180','180']
stats +=['cooldown','3600','3600']
return stats
@@ -6,3 +6,20 @@ def itemTemplate():
def customItemName():
return 'Sith Holocron'
def biolink():
return 1
def lootDescriptor():
return 'rarebuffitem'
def itemStats():
stats = ['buffeffect','Action','+500']
stats +=['effectname','Forbidden Knowledge I','Forbidden Knowledge I']
stats +=['duration','180','180']
stats +=['cooldown','3600','3600']
return stats
@@ -2,3 +2,28 @@
def itemTemplate():
return ['object/tangible/item/quest/force_sensitive/shared_fs_crystal_health.iff'] # needs correct iff still
def customItemName():
return "Biological Focus Crystal"
def requiredLevelForEffect():
return 80
def biolink():
return 1
def lootDescriptor():
return 'rarebuffitem'
def itemStats():
stats = ['buffeffect','Constitution','+250']
stats +=['effectname','Extended Constitution','Extended Constitution']
stats +=['duration','10800','10800']
stats +=['cooldown','86400','86400']
return stats
@@ -2,3 +2,22 @@
def itemTemplate():
return ['object/tangible/component/weapon/lightsaber/shared_lightsaber_module_force_crystal.iff']
def customItemName():
return "Sunrider's Destiny"
def customColor1():
return 29
def lootDescriptor():
return 'rarecolorcrystal'
def itemStats():
stats = ['elemtype','heat','heat']
stats +=['elemdamage','6','6']
return stats
@@ -1,4 +1,29 @@
def itemTemplate():
return ['object/tangible/item/quest/force_sensitive/shared_fs_crystal_health.iff']
return ['object/tangible/item/quest/force_sensitive/shared_fs_crystal_force.iff'] # needs correct iff still
def customItemName():
return "Synapse Focus Crystal"
def requiredLevelForEffect():
return 80
def biolink():
return 1
def lootDescriptor():
return 'rarebuffitem'
def itemStats():
stats = ['buffeffect','Action','+500']
stats +=['effectname','Extended Action','Extended Action']
stats +=['duration','10800','10800']
stats +=['cooldown','86400','86400']
return stats
@@ -2,3 +2,22 @@
def itemTemplate():
return ['object/tangible/component/weapon/lightsaber/shared_lightsaber_module_force_crystal.iff']
def customItemName():
return "Bane's Heart"
def customColor1():
return 16
def lootDescriptor():
return 'rarecolorcrystal'
def itemStats():
stats = ['elemtype','electricity','electricity']
stats +=['elemdamage','5','5']
return stats
@@ -2,3 +2,28 @@
def itemTemplate():
return ['object/tangible/component/weapon/lightsaber/shared_lightsaber_module_force_crystal.iff']
def customItemName():
return "Shard Of The Serpent"
def biolink():
return 1
def customColor1():
return 3
def lootDescriptor():
return 'rarebuffitem'
def itemStats():
stats = ['buffeffect','Action','+500']
stats +=['effectname','Harmonious Counteraction','Harmonious Counteraction']
stats +=['duration','180','180']
stats +=['cooldown','3600','3600']
return stats
@@ -1,4 +1,10 @@
import sys
def setup(core, object):
return
object.setStfFilename('static_item_n')
object.setStfName('item_force_crystal_04_02')
object.setDetailFilename('static_item_d')
object.setDetailName('item_force_crystal_04_02')
object.setAttachment('Post_BL_radial_filename', 'item/synapse_focus_crystal')
object.setAttachment('radial_filename', 'item/biolink')
return
@@ -1,4 +1,10 @@
import sys
def setup(core, object):
return
object.setStfFilename('static_item_n')
object.setStfName('item_force_crystal_04_01')
object.setDetailFilename('static_item_d')
object.setDetailName('item_force_crystal_04_01')
object.setAttachment('Post_BL_radial_filename', 'item/biological_focus_crystal')
object.setAttachment('radial_filename', 'item/biolink')
return
@@ -1,4 +1,22 @@
import sys
def setup(core, object):
object.setStfFilename('static_item_n')
object.setStfName('item_jedi_robe_06_01')
object.setDetailFilename('static_item_d')
object.setDetailName('item_jedi_robe_06_01')
object.setStringAttribute('protection_level', 'Luminous')
object.setStringAttribute('class_required', 'Jedi')
object.setIntAttribute('required_combat_level', 80)
object.setIntAttribute('cat_stat_mod_bonus.@stat_n:constitution_modified', 100)
object.setIntAttribute('cat_stat_mod_bonus.@stat_n:strength_modified', 100)
object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 100)
object.setIntAttribute('cat_stat_mod_bonus.@stat_n:luck_modified', 100)
object.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_jedi_robe_1')
object.setAttachment('type', 'jedi_robe')
object.setAttachment('setBonus', 'set_bonus_jedi_robe')
return
+58
View File
@@ -0,0 +1,58 @@
from resources.common import RadialOptions
from services.sui import SUIWindow
from services.sui.SUIWindow import Trigger
from java.util import Vector
from java.lang import Long
from main import NGECore
import sys
def createRadial(core, owner, target, radials):
radials.add(RadialOptions(0, 21, 1, ''))
radials.add(RadialOptions(0, 7, 1, ''))
radials.add(RadialOptions(0, 15, 1, ''))
return
def handleSelection(core, owner, target, option):
if option == 21 and target:
bioLinkPrompt(core, owner, target, option)
if option == 15 and target:
core.objectService.destroyObject(target)
return
def bioLinkPrompt(core, owner, target, option):
if not 'shared_character_inventory' in target.getContainer().getTemplate():
owner.sendSystemMessage('@base_player:must_biolink_to_use_from_inventory', 1)
return
bl = target.getStringAttribute('bio_link')
#if not '<pending>' in bl:
# owner.sendSystemMessage('@base_player:not_linked_to_holder', 1) # This should never occur, because a bio-linked item should have another radial
# return
owner.setAttachment('BioLinkItemCandidate', Long(target.getObjectID()))
window = core.suiService.createSUIWindow('Script.messageBox', owner, owner, 0)
window.setProperty('bg.caption.lblTitle:Text', '@sui:bio_link_item_title')
window.setProperty('Prompt.lblPrompt:Text', '@sui:bio_link_item_prompt')
window.setProperty('btnCancel:visible', 'True')
window.setProperty('btnOk:visible', 'True')
window.setProperty('btnUpdate:visible', 'False')
window.setProperty('btnCancel:Text', '@cancel')
window.setProperty('btnOk:Text', '@ui_radial:bio_link')
returnList = Vector()
window.addHandler(0, '', Trigger.TRIGGER_OK, returnList, bioLinkProcess)
window.addHandler(1, '', Trigger.TRIGGER_CANCEL, returnList, bioLinkCancel)
core.suiService.openSUIWindow(window);
return
def bioLinkProcess(owner, window, eventType, returnList):
objectID = owner.getAttachment('BioLinkItemCandidate')
linkedobject = NGECore.getInstance().objectService.getObject(objectID)
owner.sendSystemMessage('@base_player:item_bio_linked', 1)
newRadial = linkedobject.getAttachment('Post_BL_radial_filename')
linkedobject.setAttachment('radial_filename', newRadial)
linkedobject.setStringAttribute('bio_link', owner.getCustomName())
return
def bioLinkCancel(owner, window, eventType, returnList):
return
@@ -0,0 +1,19 @@
import resources.objects.creature.CreatureObject;
from resources.common import RadialOptions
import sys
def createRadial(core, owner, target, radials):
radials.add(RadialOptions(0, 21, 1, ''))
radials.add(RadialOptions(0, 7, 1, ''))
radials.add(RadialOptions(0, 15, 1, ''))
return
def handleSelection(core, owner, object, option):
if option == 21:
bl = object.getStringAttribute('bio_link')
if not bl == owner.getCustomName():
owner.sendSystemMessage('@base_player:not_linked_to_holder', 1)
return
core.buffService.addBuffToCreature(owner, 'forceCrystalHealth', owner)
return
+19
View File
@@ -0,0 +1,19 @@
import resources.objects.creature.CreatureObject;
from resources.common import RadialOptions
import sys
def createRadial(core, owner, target, radials):
radials.add(RadialOptions(0, 21, 1, ''))
radials.add(RadialOptions(0, 7, 1, ''))
radials.add(RadialOptions(0, 15, 1, ''))
return
def handleSelection(core, owner, object, option):
if option == 21:
bl = object.getStringAttribute('bio_link')
if not bl == owner.getCustomName():
owner.sendSystemMessage('@base_player:not_linked_to_holder', 1)
return
core.buffService.addBuffToCreature(owner, 'towCrystalUberCombat', owner)
return
@@ -0,0 +1,19 @@
import resources.objects.creature.CreatureObject;
from resources.common import RadialOptions
import sys
def createRadial(core, owner, target, radials):
radials.add(RadialOptions(0, 21, 1, ''))
radials.add(RadialOptions(0, 7, 1, ''))
radials.add(RadialOptions(0, 15, 1, ''))
return
def handleSelection(core, owner, object, option):
if option == 21:
bl = object.getStringAttribute('bio_link')
if not bl == owner.getCustomName():
owner.sendSystemMessage('@base_player:not_linked_to_holder', 1)
return
core.buffService.addBuffToCreature(owner, 'towCrystalUberDs', owner)
return
@@ -0,0 +1,19 @@
import resources.objects.creature.CreatureObject;
from resources.common import RadialOptions
import sys
def createRadial(core, owner, target, radials):
radials.add(RadialOptions(0, 21, 1, ''))
radials.add(RadialOptions(0, 7, 1, ''))
radials.add(RadialOptions(0, 15, 1, ''))
return
def handleSelection(core, owner, object, option):
if option == 21:
bl = object.getStringAttribute('bio_link')
if not bl == owner.getCustomName():
owner.sendSystemMessage('@base_player:not_linked_to_holder', 1)
return
core.buffService.addBuffToCreature(owner, 'towCrystalUberCombat', owner) # correct buff needs to be replaced
return
+19
View File
@@ -0,0 +1,19 @@
import resources.objects.creature.CreatureObject;
from resources.common import RadialOptions
import sys
def createRadial(core, owner, target, radials):
radials.add(RadialOptions(0, 21, 1, ''))
radials.add(RadialOptions(0, 7, 1, ''))
radials.add(RadialOptions(0, 15, 1, ''))
return
def handleSelection(core, owner, object, option):
if option == 21:
bl = object.getStringAttribute('bio_link')
if not bl == owner.getCustomName():
owner.sendSystemMessage('@base_player:not_linked_to_holder', 1)
return
core.buffService.addBuffToCreature(owner, 'towCrystalABImmune', owner)
return
@@ -0,0 +1,19 @@
import resources.objects.creature.CreatureObject;
from resources.common import RadialOptions
import sys
def createRadial(core, owner, target, radials):
radials.add(RadialOptions(0, 21, 1, ''))
radials.add(RadialOptions(0, 7, 1, ''))
radials.add(RadialOptions(0, 15, 1, ''))
return
def handleSelection(core, owner, object, option):
if option == 21:
bl = object.getStringAttribute('bio_link')
if not bl == owner.getCustomName():
owner.sendSystemMessage('@base_player:not_linked_to_holder', 1)
return
core.buffService.addBuffToCreature(owner, 'forceCrystalForce', owner)
return
@@ -62,8 +62,9 @@ public final class LightsaberColors {
map.put("Kenobi's Legacy", 28);
map.put("Sunrider's Destiny", 29);
map.put("Kit's Ferocity", 30);
map.put("Cunning of Tyranus", 31);
// Special crystals that have seperate shaders - the 256 is for a hacky way to set blade type and color without more code
// Special crystals that have seperate shaders - the 256 is for a hacky way to set blade type and color without more code
map.put("Lava", 256 + 1);
map.put("Permafrost", 256 + 2);
map.put("Blackwing Bezoar", 256 + 3);
+12 -1
View File
@@ -91,11 +91,14 @@ public class BuffService implements INetworkDispatch {
if(buff == null) return false;
// Here the necessary checks must be placed to prevent buffs from the same buff group (e.g. Buff D) being stacked!
if(buff.isGroupBuff()) {
addGroupBuff(buffer, buffName, buffer);
return true;
} else {
doAddBuff(target, buffName, buffer);
if (! hasBuff(target,buffName)) // QA, prevent infinite "refreshing" of buff by repeated use
doAddBuff(target, buffName, buffer);
return true;
}
}
@@ -290,6 +293,14 @@ public class BuffService implements INetworkDispatch {
}
public boolean hasBuff(final CreatureObject creature, String buffName) {
for(final Buff buff : creature.getBuffList().get().toArray(new Buff[] { })) {
if (buff.getBuffName().contains(buffName)) { return true; }
}
return false;
}
public void addGroupBuff(CreatureObject buffer, String buffName) {
try {
throw new Exception();
+199 -8
View File
@@ -438,6 +438,10 @@ public class LootService implements INetworkDispatch {
droppedItem.setJunkType(junkType);
}
if (biolink>0){
droppedItem.setStringAttribute("bio_link", "bio_link_pending");
}
if (itemStats!=null){
if (itemStats.size()%3!=0){
String errorMessage = "Loot item '" + itemName + "' has a wrong number of itemstats. Please contact Charon about this issue.";
@@ -477,7 +481,6 @@ public class LootService implements INetworkDispatch {
lootRollSession.addDroppedItem(droppedItem);
System.out.println("END REACHED");
}
private void handleCustomDropName(TangibleObject droppedItem,String customName) {
@@ -513,6 +516,7 @@ public class LootService implements INetworkDispatch {
chancemodifier += 15;
//legendaryRoll=500; // For TEST
//legendaryRoll=1; // For TEST
//exceptionalRoll = 5;
if (legendaryRoll<2+chancemodifier){
@@ -555,6 +559,10 @@ public class LootService implements INetworkDispatch {
}
public void fillrarelootchest(CreatureObject owner, TangibleObject chest){
SWGObject inventory = owner.getSlottedObject("inventory");
inventory.remove(chest);
if (chest.getTemplate().contains("object/tangible/item/shared_rare_loot_chest_1.iff")){
fillRareChest(owner, chest);
}
@@ -563,10 +571,8 @@ public class LootService implements INetworkDispatch {
}
if (chest.getTemplate().contains("object/tangible/item/shared_rare_loot_chest_3.iff")){
fillLegendaryChest(owner, chest);
}
SWGObject inventory = owner.getSlottedObject("inventory");
inventory.remove(chest);
core.objectService.destroyObject(chest.getObjectID());
}
core.objectService.destroyObject(chest.getObjectID());
}
private void fillLegendaryChest(CreatureObject owner, TangibleObject chest){
@@ -701,7 +707,7 @@ public class LootService implements INetworkDispatch {
else
remainder += span;
if (randomItemFromPool<=remainder){
fillChest4(itemNames.get(i), owner, chest);
fillChest4(itemNames.get(i), owner, chest);
//break;
return;
}
@@ -711,6 +717,7 @@ public class LootService implements INetworkDispatch {
private void fillChest4(String itemName, CreatureObject owner, TangibleObject chest){
final Vector<String> foundPath = new Vector<String>();
Path p = Paths.get("scripts/loot/lootItems/");
FileVisitor<Path> fv = new SimpleFileVisitor<Path>() {
@@ -746,6 +753,7 @@ public class LootService implements INetworkDispatch {
int stackCount = 1;
int biolink = 0;
int requiredCL = 1;
int requiredLevelForEffect = 1;
int stackable = -1;
int junkDealerPrice = 0;
byte junkType = -1;
@@ -753,6 +761,8 @@ public class LootService implements INetworkDispatch {
String requiredFaction = "";
Vector<String> customizationAttributes = null;
Vector<Integer> customizationValues = null;
int customColor1 = 0;
String lootDescriptor = "";
Vector<String> itemStats = null;
Vector<String> itemSkillMods = null;
@@ -781,6 +791,12 @@ public class LootService implements INetworkDispatch {
if(core.scriptService.getMethod(itemPath,"","customizationValues")!=null)
customizationValues = (Vector<Integer>)core.scriptService.fetchIntegerVector(itemPath,"customizationValues");
if(core.scriptService.getMethod(itemPath,"","customColor1")!=null)
customColor1 = (Integer)core.scriptService.fetchInteger(itemPath,"customColor1");
if(core.scriptService.getMethod(itemPath,"","lootDescriptor")!=null)
lootDescriptor = (String)core.scriptService.fetchString(itemPath,"lootDescriptor");
if(core.scriptService.getMethod(itemPath,"","itemStats")!=null)
itemStats = (Vector<String>)core.scriptService.fetchStringVector(itemPath,"itemStats");
@@ -792,7 +808,10 @@ public class LootService implements INetworkDispatch {
if(core.scriptService.getMethod(itemPath,"","requiredCL")!=null)
requiredCL = (Integer)core.scriptService.fetchInteger(itemPath,"requiredCL");
if(core.scriptService.getMethod(itemPath,"","requiredLevelForEffect")!=null)
requiredLevelForEffect = (Integer)core.scriptService.fetchInteger(itemPath,"requiredLevelForEffect");
if(core.scriptService.getMethod(itemPath,"","requiredProfession")!=null)
requiredProfession = (String)core.scriptService.fetchString(itemPath,"requiredProfession");
@@ -819,6 +838,10 @@ public class LootService implements INetworkDispatch {
droppedItem.setLootItem(true);
droppedItem.setAttachment("LootItemName", itemName);
droppedItem.setAttachment("customColor1", customColor1);
droppedItem.setAttachment("lootDescriptor", lootDescriptor);
droppedItem.setAttachment("customName", customName);
if (!customName.isEmpty())
@@ -859,6 +882,10 @@ public class LootService implements INetworkDispatch {
droppedItem.setIntAttribute("required_combat_level", requiredCL);
}
if (requiredLevelForEffect>1) {
droppedItem.getAttributes().put("@proc/proc:effect_level", ""+requiredLevelForEffect);
}
if (requiredProfession.length()>0){
droppedItem.setStringAttribute("class_required", requiredProfession);
}
@@ -867,6 +894,10 @@ public class LootService implements INetworkDispatch {
droppedItem.setStringAttribute("required_faction", requiredFaction);
}
if (biolink>0){
droppedItem.setStringAttribute("bio_link", "@obj_attr_n:bio_link_pending");
}
if(core.scriptService.getMethod(itemPath,"","customSetup") != null)
core.scriptService.callScript(itemPath, "", "customSetup", droppedItem);
@@ -915,6 +946,23 @@ public class LootService implements INetworkDispatch {
droppedItem.setCustomizationVariable("/private/index_color_1", (byte) 0x21); // 0x1F
}
String lootDescriptor = (String)droppedItem.getAttachment("lootDescriptor");
if (lootDescriptor==null)
lootDescriptor="";
if (lootDescriptor.contains("rarecolorcrystal")) {
System.out.println("rarecolorcrystal");
int saberColor = (Integer)droppedItem.getAttachment("customColor1");
if (saberColor==31) // Cunning of Tyranus, which is not in @jedi_spam
saberColor=0;
droppedItem.setCustomizationVariable("/private/index_color_1", (byte) saberColor);
droppedItem.getAttributes().put("@obj_attr_n:condition", "100/100");
droppedItem.getAttributes().put("@obj_attr_n:crystal_owner", "\\#D1F56F UNTUNED \\#FFFFFF ");
droppedItem.getAttributes().put("@obj_attr_n:color", resources.datatables.LightsaberColors.get((Integer)droppedItem.getAttachment("customColor1")));
droppedItem.setAttachment("radial_filename", "item/tunable");
}
// More general
// String path = "scripts/loot/lootItems/"+droppedItem.getCustomName().toLowerCase();
// Vector<String> customizationPaths = (Vector<String>)core.scriptService.fetchStringVector(path,"itemCustomizationPaths");
@@ -937,7 +985,7 @@ public class LootService implements INetworkDispatch {
private void handleStats(TangibleObject droppedItem, Vector<String> itemStats) {
if (droppedItem.getTemplate().contains("/weapon")){
if (droppedItem.getTemplate().contains("object/weapon")){
WeaponObject weaponObject = (WeaponObject) droppedItem;
for (int i=0;i<itemStats.size()/3;i++){
String statName = itemStats.get(3*i);
@@ -955,6 +1003,28 @@ public class LootService implements INetworkDispatch {
setArmorStat(droppedItem, statName, minValue, maxValue);
}
}
String lootDescriptor = (String)droppedItem.getAttachment("lootDescriptor");
if (lootDescriptor==null)
lootDescriptor="";
if (lootDescriptor.contains("rarecolorcrystal")) {
for (int i=0;i<itemStats.size()/3;i++){
String statName = itemStats.get(3*i);
String minValue = itemStats.get(3*i+1);
String maxValue = itemStats.get(3*i+2);
setCrystalStat(droppedItem, statName, minValue, maxValue);
}
}
if (lootDescriptor.contains("rarebuffitem")) {
for (int i=0;i<itemStats.size()/3;i++){
String statName = itemStats.get(3*i);
String minValue = itemStats.get(3*i+1);
String maxValue = itemStats.get(3*i+2);
setBuffItemStat(droppedItem, statName, minValue, maxValue);
}
}
}
private void handleSkillMods(TangibleObject droppedItem, Vector<String> skillMods) {
@@ -1321,6 +1391,127 @@ public class LootService implements INetworkDispatch {
}
private void setCrystalStat(TangibleObject crystal, String statName, String minValue, String maxValue){
if (statName.equals("elemtype")){
String result = "";
if (minValue.length()==0)
if (maxValue.length()==0)
result = "Error";
if (minValue.length()>0)
result = minValue;
if (maxValue.length()>0)
result = maxValue;
crystal.setAttachment("ElementalType", result);
}
if (statName.equals("elemdamage")){
int minimalValue = (int) Integer.parseInt(minValue);
int value = minimalValue;
crystal.setAttachment("ElementalDamage", value);
}
}
private void setBuffItemStat(TangibleObject buffItem, String statName, String minValue, String maxValue){
if (statName.equals("buffeffect")){
String result = "";
if (minValue.length()==0)
if (maxValue.length()==0)
result = "Error";
if (minValue.length()>0)
result = minValue;
if (maxValue.length()>0)
result = maxValue;
buffItem.setAttachment("BuffEffect", minValue);
buffItem.setAttachment("BuffEffectMagnitude", maxValue);
}
if (statName.equals("effectname")){
String result = minValue;
if (minValue.length()==0)
if (maxValue.length()==0)
result = "Error";
buffItem.setAttachment("BuffEffectName", result);
buffItem.getAttributes().put("@obj_attr_n:proc_name", result);
}
if (statName.equals("duration")){
int minimalValue = (int) Integer.parseInt(minValue);
buffItem.setAttachment("BuffEffectDuration", minimalValue);
}
if (statName.equals("cooldown")){
/*
String displayString = "";
String[] cooldownArr = minValue.split(":"); // 24:00:00 -> HH:MM:SS
if (cooldownArr.length==3){
String hours = cooldownArr[0];
String minutes = cooldownArr[1];
String seconds = cooldownArr[2];
if (hours.equals("00") || hours.equals("0")){
displayString=minutes + " minutes";
} else
{
displayString=hours + " hours, " + minutes + " minutes";
}
} else
{
displayString= "Format Error!";
}
*/
String displayString = minValue + " sec";
int minimalValue = (int) Integer.parseInt(minValue);
buffItem.setAttachment("BuffEffectCoolDown", minimalValue);
buffItem.getAttributes().put("@obj_attr_n:reuse_time", displayString);
buffItem.getAttributes().put("@ui_attrib_mod:timeleft", "0");
}
// Deal with buff items that have colorcrystal templates or not unique templates , because no py script can be used for them to set the radials
// Shard of the Serpent
if (buffItem.getCustomName().contains("Serpent")){
buffItem.setAttachment("Post_BL_radial_filename", "item/shard_of_the_serpent");
buffItem.setAttachment("radial_filename", "item/biolink");
buffItem.setStfFilename("static_item_n");
buffItem.setStfName("item_tow_buff_crystal_02_03");
buffItem.setDetailFilename("static_item_d");
buffItem.setDetailName("item_tow_buff_crystal_02_03");
buffItem.setCustomizationVariable("/private/index_color_1", (byte) 3);
}
// Shard of Ferocity
if (buffItem.getCustomName().contains("Ferocity")){
buffItem.setAttachment("Post_BL_radial_filename", "item/shard_of_ferocity");
buffItem.setAttachment("radial_filename", "item/biolink");
buffItem.setStfFilename("static_item_n");
buffItem.setStfName("item_tow_crystal_uber_01_05");
buffItem.setDetailFilename("static_item_d");
buffItem.setDetailName("item_tow_crystal_uber_01_05");
buffItem.setCustomizationVariable("/private/index_color_1", (byte) 9);
}
// Shard of Retaliation
if (buffItem.getCustomName().contains("Retaliation")){
buffItem.setAttachment("Post_BL_radial_filename", "item/shard_of_retaliation");
buffItem.setAttachment("radial_filename", "item/biolink");
buffItem.setStfFilename("static_item_n");
buffItem.setStfName("item_tow_crystal_uber_02_05");
buffItem.setDetailFilename("static_item_d");
buffItem.setDetailName("item_tow_crystal_uber_02_05");
}
// Sith Buff Holocron
if (buffItem.getCustomName().contains("Sith")){
buffItem.setAttachment("Post_BL_radial_filename", "item/sith_buff_holocron");
buffItem.setAttachment("radial_filename", "item/biolink");
buffItem.setStfFilename("static_item_n");
buffItem.setStfName("item_tow_holocron_ab_immune_01_02");
buffItem.setDetailFilename("static_item_d");
buffItem.setDetailName("item_tow_holocron_ab_immune_01_02");
}
}
private void setArmorStat(SWGObject armor, String statName, String minValue, String maxValue){
// Armor is not represented with its own class,
// so we gotta create the attributes here