diff --git a/scripts/loot/lootItems/exceptionallootchest/cunning_of_tyranus.py b/scripts/loot/lootItems/exceptionallootchest/cunning_of_tyranus.py index 1458e1be..fe363b99 100644 --- a/scripts/loot/lootItems/exceptionallootchest/cunning_of_tyranus.py +++ b/scripts/loot/lootItems/exceptionallootchest/cunning_of_tyranus.py @@ -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 diff --git a/scripts/loot/lootItems/exceptionallootchest/jedi_master_cloak.py b/scripts/loot/lootItems/exceptionallootchest/jedi_master_cloak.py index 9422a5e8..f8b19b7f 100644 --- a/scripts/loot/lootItems/exceptionallootchest/jedi_master_cloak.py +++ b/scripts/loot/lootItems/exceptionallootchest/jedi_master_cloak.py @@ -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 diff --git a/scripts/loot/lootItems/exceptionallootchest/shard_of_ferocity.py b/scripts/loot/lootItems/exceptionallootchest/shard_of_ferocity.py index 1458e1be..43565b98 100644 --- a/scripts/loot/lootItems/exceptionallootchest/shard_of_ferocity.py +++ b/scripts/loot/lootItems/exceptionallootchest/shard_of_ferocity.py @@ -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 + diff --git a/scripts/loot/lootItems/exceptionallootchest/shard_of_retaliation.py b/scripts/loot/lootItems/exceptionallootchest/shard_of_retaliation.py index 9a954a13..288360a2 100644 --- a/scripts/loot/lootItems/exceptionallootchest/shard_of_retaliation.py +++ b/scripts/loot/lootItems/exceptionallootchest/shard_of_retaliation.py @@ -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 \ No newline at end of file diff --git a/scripts/loot/lootItems/exceptionallootchest/sith_buff_holocron.py b/scripts/loot/lootItems/exceptionallootchest/sith_buff_holocron.py index 36210f79..2b1177e5 100644 --- a/scripts/loot/lootItems/exceptionallootchest/sith_buff_holocron.py +++ b/scripts/loot/lootItems/exceptionallootchest/sith_buff_holocron.py @@ -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 \ No newline at end of file diff --git a/scripts/loot/lootItems/legendarylootchest/biological_focus_crystal.py b/scripts/loot/lootItems/legendarylootchest/biological_focus_crystal.py index 01c2b7d5..0815e750 100644 --- a/scripts/loot/lootItems/legendarylootchest/biological_focus_crystal.py +++ b/scripts/loot/lootItems/legendarylootchest/biological_focus_crystal.py @@ -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 diff --git a/scripts/loot/lootItems/legendarylootchest/sunriders_destiny.py b/scripts/loot/lootItems/legendarylootchest/sunriders_destiny.py index 1458e1be..b17aca6b 100644 --- a/scripts/loot/lootItems/legendarylootchest/sunriders_destiny.py +++ b/scripts/loot/lootItems/legendarylootchest/sunriders_destiny.py @@ -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 diff --git a/scripts/loot/lootItems/legendarylootchest/synapse_focus_crystal.py b/scripts/loot/lootItems/legendarylootchest/synapse_focus_crystal.py index 8ec038a5..61da7c4a 100644 --- a/scripts/loot/lootItems/legendarylootchest/synapse_focus_crystal.py +++ b/scripts/loot/lootItems/legendarylootchest/synapse_focus_crystal.py @@ -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 diff --git a/scripts/loot/lootItems/rarelootchest/banes_heart.py b/scripts/loot/lootItems/rarelootchest/banes_heart.py index 1458e1be..e7a0db2b 100644 --- a/scripts/loot/lootItems/rarelootchest/banes_heart.py +++ b/scripts/loot/lootItems/rarelootchest/banes_heart.py @@ -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 diff --git a/scripts/loot/lootItems/rarelootchest/shard_of_the_serpent.py b/scripts/loot/lootItems/rarelootchest/shard_of_the_serpent.py index 1458e1be..06a94a75 100644 --- a/scripts/loot/lootItems/rarelootchest/shard_of_the_serpent.py +++ b/scripts/loot/lootItems/rarelootchest/shard_of_the_serpent.py @@ -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 \ No newline at end of file diff --git a/scripts/object/tangible/item/quest/force_sensitive/fs_crystal_force.py b/scripts/object/tangible/item/quest/force_sensitive/fs_crystal_force.py index ccad8904..b50e17cf 100644 --- a/scripts/object/tangible/item/quest/force_sensitive/fs_crystal_force.py +++ b/scripts/object/tangible/item/quest/force_sensitive/fs_crystal_force.py @@ -1,4 +1,10 @@ import sys def setup(core, object): - return \ No newline at end of file + 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 diff --git a/scripts/object/tangible/item/quest/force_sensitive/fs_crystal_health.py b/scripts/object/tangible/item/quest/force_sensitive/fs_crystal_health.py index ccad8904..189829e8 100644 --- a/scripts/object/tangible/item/quest/force_sensitive/fs_crystal_health.py +++ b/scripts/object/tangible/item/quest/force_sensitive/fs_crystal_health.py @@ -1,4 +1,10 @@ import sys def setup(core, object): - return \ No newline at end of file + 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 diff --git a/scripts/object/tangible/wearables/robe/robe_s05_h1.py b/scripts/object/tangible/wearables/robe/robe_s05_h1.py index ccad8904..6df15568 100644 --- a/scripts/object/tangible/wearables/robe/robe_s05_h1.py +++ b/scripts/object/tangible/wearables/robe/robe_s05_h1.py @@ -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 \ No newline at end of file diff --git a/scripts/radial/item/biolink.py b/scripts/radial/item/biolink.py new file mode 100644 index 00000000..099a04b9 --- /dev/null +++ b/scripts/radial/item/biolink.py @@ -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 '' 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 \ No newline at end of file diff --git a/scripts/radial/item/biological_focus_crystal.py b/scripts/radial/item/biological_focus_crystal.py new file mode 100644 index 00000000..7f755500 --- /dev/null +++ b/scripts/radial/item/biological_focus_crystal.py @@ -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 diff --git a/scripts/radial/item/shard_of_ferocity.py b/scripts/radial/item/shard_of_ferocity.py new file mode 100644 index 00000000..759f7175 --- /dev/null +++ b/scripts/radial/item/shard_of_ferocity.py @@ -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 diff --git a/scripts/radial/item/shard_of_retaliation.py b/scripts/radial/item/shard_of_retaliation.py new file mode 100644 index 00000000..9112336e --- /dev/null +++ b/scripts/radial/item/shard_of_retaliation.py @@ -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 diff --git a/scripts/radial/item/shard_of_the_serpent.py b/scripts/radial/item/shard_of_the_serpent.py new file mode 100644 index 00000000..3a73c511 --- /dev/null +++ b/scripts/radial/item/shard_of_the_serpent.py @@ -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 diff --git a/scripts/radial/item/sith_buff_holocron.py b/scripts/radial/item/sith_buff_holocron.py new file mode 100644 index 00000000..3c417e7f --- /dev/null +++ b/scripts/radial/item/sith_buff_holocron.py @@ -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 diff --git a/scripts/radial/item/synapse_focus_crystal.py b/scripts/radial/item/synapse_focus_crystal.py new file mode 100644 index 00000000..7aa755ba --- /dev/null +++ b/scripts/radial/item/synapse_focus_crystal.py @@ -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 diff --git a/src/resources/datatables/LightsaberColors.java b/src/resources/datatables/LightsaberColors.java index cb2028c5..e8adbba9 100644 --- a/src/resources/datatables/LightsaberColors.java +++ b/src/resources/datatables/LightsaberColors.java @@ -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); diff --git a/src/services/BuffService.java b/src/services/BuffService.java index de08efd2..8d2d4038 100644 --- a/src/services/BuffService.java +++ b/src/services/BuffService.java @@ -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(); diff --git a/src/services/LootService.java b/src/services/LootService.java index f8b08f80..31e30306 100644 --- a/src/services/LootService.java +++ b/src/services/LootService.java @@ -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 foundPath = new Vector(); Path p = Paths.get("scripts/loot/lootItems/"); FileVisitor fv = new SimpleFileVisitor() { @@ -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 customizationAttributes = null; Vector customizationValues = null; + int customColor1 = 0; + String lootDescriptor = ""; Vector itemStats = null; Vector itemSkillMods = null; @@ -781,6 +791,12 @@ public class LootService implements INetworkDispatch { if(core.scriptService.getMethod(itemPath,"","customizationValues")!=null) customizationValues = (Vector)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)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 customizationPaths = (Vector)core.scriptService.fetchStringVector(path,"itemCustomizationPaths"); @@ -937,7 +985,7 @@ public class LootService implements INetworkDispatch { private void handleStats(TangibleObject droppedItem, Vector itemStats) { - if (droppedItem.getTemplate().contains("/weapon")){ + if (droppedItem.getTemplate().contains("object/weapon")){ WeaponObject weaponObject = (WeaponObject) droppedItem; for (int i=0;i 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