From 73b20381fefb3d62e9fcc7e89f9f795ffcc2645e Mon Sep 17 00:00:00 2001 From: Seefo Date: Mon, 31 Mar 2014 14:14:51 -0400 Subject: [PATCH 1/6] AI changes, added Stormtrooper and fixed creature names for Krettle, Chuba, and Womprat --- scripts/mobiles/canon/jedi_master.py | 19 ++++++++++++----- scripts/mobiles/canon/stormtrooper.py | 27 +++++++++++++++++++++++++ scripts/mobiles/naboo/chuba.py | 1 + scripts/mobiles/tatooine/kreetle.py | 1 + scripts/mobiles/tatooine/womprat.py | 1 + src/services/ai/states/AttackState.java | 15 ++++++++++++++ src/services/spawn/MobileTemplate.java | 14 ++++++------- src/services/spawn/SpawnService.java | 2 +- 8 files changed, 66 insertions(+), 14 deletions(-) create mode 100644 scripts/mobiles/canon/stormtrooper.py diff --git a/scripts/mobiles/canon/jedi_master.py b/scripts/mobiles/canon/jedi_master.py index 9770c507..d2b65aaf 100644 --- a/scripts/mobiles/canon/jedi_master.py +++ b/scripts/mobiles/canon/jedi_master.py @@ -4,6 +4,12 @@ from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() + + mobileTemplate.setCreatureName('eow_dark_jedi_sentinel_uber') + mobileTemplate.setLevel(90) + mobileTemplate.setDifficulty(2) + mobileTemplate.setAttackRange(6) + templates = Vector() templates.add('object/mobile/shared_dressed_dark_jedi_master_female_twk_01.iff') templates.add('object/mobile/shared_dressed_dark_jedi_master_female_twk_02.iff') @@ -14,13 +20,16 @@ def addTemplate(core): templates.add('object/mobile/shared_dressed_dark_jedi_master_male_human_05.iff') templates.add('object/mobile/shared_dressed_dark_jedi_master_male_human_06.iff') mobileTemplate.setTemplates(templates) - mobileTemplate.setLevel(90) - mobileTemplate.setDifficulty(2) - mobileTemplate.setCustomWeaponTemplate('object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gen5.iff') + + weaponTemplates = Vector() + weaponTemplates.add('object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_gen5.iff') + weaponTemplates.add('object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gen5.iff') + weaponTemplates.add('object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_gen5.iff') + mobileTemplate.setWeaponTemplates(weaponTemplates) + attacks = Vector() mobileTemplate.setDefaultAttack('saberHit') mobileTemplate.setAttacks(attacks) - mobileTemplate.setCreatureName('eow_dark_jedi_sentinel_uber') - mobileTemplate.setAttackRange(6) + core.spawnService.addMobileTemplate('jedi_master', mobileTemplate) \ No newline at end of file diff --git a/scripts/mobiles/canon/stormtrooper.py b/scripts/mobiles/canon/stormtrooper.py new file mode 100644 index 00000000..90da938f --- /dev/null +++ b/scripts/mobiles/canon/stormtrooper.py @@ -0,0 +1,27 @@ +import sys +from services.spawn import MobileTemplate +from java.util import Vector + +def addTemplate(core): + mobileTemplate = MobileTemplate() + + mobileTemplate.setCreatureName('stormtrooper') + mobileTemplate.setLevel(90) + mobileTemplate.setDifficulty(0) + mobileTemplate.setAttackRange(24) + + templates = Vector() + templates.add('object/mobile/shared_dressed_stormtrooper_m.iff') + mobileTemplate.setTemplates(templates) + + weaponTemplates = Vector() + weaponTemplates.add('object/weapon/ranged/rifle/shared_rifle_e11.iff') + weaponTemplates.add('object/weapon/ranged/rifle/shared_rifle_t21.iff') + mobileTemplate.setWeaponTemplates(weaponTemplates) + + attacks = Vector() + mobileTemplate.setDefaultAttack('rangedShot') + mobileTemplate.setAttacks(attacks) + + core.spawnService.addMobileTemplate('stormtrooper', mobileTemplate) + \ No newline at end of file diff --git a/scripts/mobiles/naboo/chuba.py b/scripts/mobiles/naboo/chuba.py index c40d2421..085d9e77 100644 --- a/scripts/mobiles/naboo/chuba.py +++ b/scripts/mobiles/naboo/chuba.py @@ -6,6 +6,7 @@ def addTemplate(core): mobileTemplate = MobileTemplate() templates = Vector() templates.add('object/mobile/shared_chuba_hue.iff') + mobileTemplate.setCreatureName('chuba') mobileTemplate.setTemplates(templates) mobileTemplate.setLevel(5) attacks = Vector() diff --git a/scripts/mobiles/tatooine/kreetle.py b/scripts/mobiles/tatooine/kreetle.py index 6d96166b..ec037bd4 100644 --- a/scripts/mobiles/tatooine/kreetle.py +++ b/scripts/mobiles/tatooine/kreetle.py @@ -6,6 +6,7 @@ def addTemplate(core): mobileTemplate = MobileTemplate() templates = Vector() templates.add('object/mobile/shared_kreetle.iff') + mobileTemplate.setCreatureName('kreetle') mobileTemplate.setTemplates(templates) mobileTemplate.setLevel(5) attacks = Vector() diff --git a/scripts/mobiles/tatooine/womprat.py b/scripts/mobiles/tatooine/womprat.py index f1531b4c..836d9922 100644 --- a/scripts/mobiles/tatooine/womprat.py +++ b/scripts/mobiles/tatooine/womprat.py @@ -6,6 +6,7 @@ def addTemplate(core): mobileTemplate = MobileTemplate() templates = Vector() templates.add('object/mobile/shared_womp_rat.iff') + mobileTemplate.setCreatureName('womprat') mobileTemplate.setTemplates(templates) mobileTemplate.setLevel(5) attacks = Vector() diff --git a/src/services/ai/states/AttackState.java b/src/services/ai/states/AttackState.java index 2d49791c..dee11544 100644 --- a/src/services/ai/states/AttackState.java +++ b/src/services/ai/states/AttackState.java @@ -47,6 +47,9 @@ public class AttackState extends AIState { @Override public byte onExit(AIActor actor) { // TODO Auto-generated method stub + actor.getCreature().setLookAtTarget(0); + actor.getCreature().setIntendedTarget(0); + return StateResult.FINISHED; } @@ -100,7 +103,12 @@ public class AttackState extends AIState { if(creature.getPosture() == 14) return StateResult.DEAD; if(creature.getCombatFlag() == 0 || creature.getDefendersList().size() == 0 || actor.getFollowObject() == null) + { + creature.setLookAtTarget(0); + creature.setIntendedTarget(0); + actor.setFollowObject(null); return StateResult.FINISHED; + } CreatureObject target = actor.getFollowObject(); if(target != actor.getHighestDamageDealer() && actor.getHighestDamageDealer() != null) { actor.setFollowObject(actor.getHighestDamageDealer()); @@ -116,7 +124,11 @@ public class AttackState extends AIState { actor.setFollowObject(actor.getHighestDamageDealer()); target = actor.getFollowObject(); if(target == null) + { + creature.setLookAtTarget(0); + creature.setIntendedTarget(0); return StateResult.FINISHED; + } } if(target.getWorldPosition().getDistance(creature.getWorldPosition()) > 128 || target.getPosture() == 13 || target.getPosture() == 14) { actor.removeDefender(target); @@ -141,6 +153,9 @@ public class AttackState extends AIState { Vector attacks = actor.getMobileTemplate().getAttacks(); + creature.setLookAtTarget(target.getObjectId()); + creature.setIntendedTarget(target.getObjectId()); + if(attacks.size() == 0) { core.commandService.callCommand(creature, actor.getMobileTemplate().getDefaultAttack(), target, ""); } else { diff --git a/src/services/spawn/MobileTemplate.java b/src/services/spawn/MobileTemplate.java index 9b1cb401..3e673af0 100644 --- a/src/services/spawn/MobileTemplate.java +++ b/src/services/spawn/MobileTemplate.java @@ -44,7 +44,7 @@ public class MobileTemplate { private float scale = 1; // this is a custom attack Range setting to use for large mobs like krayts private int attackRange; - private String customWeaponTemplate; + private Vector weaponTemplates; public Vector getTemplates() { return templates; @@ -158,13 +158,11 @@ public class MobileTemplate { this.attackRange = attackRange; } - public void setCustomWeaponTemplate(String template) - { - this.customWeaponTemplate = template; + public Vector getWeaponTemplates() { + return weaponTemplates; } - - public String getCustomWeaponTemplate() - { - return customWeaponTemplate; + + public void setWeaponTemplates(Vector weaponTemplates) { + this.weaponTemplates = weaponTemplates; } } diff --git a/src/services/spawn/SpawnService.java b/src/services/spawn/SpawnService.java index c26defae..bc3fbef1 100644 --- a/src/services/spawn/SpawnService.java +++ b/src/services/spawn/SpawnService.java @@ -112,7 +112,7 @@ public class SpawnService { creature.setLevel(level); else creature.setLevel(mobileTemplate.getLevel()); - WeaponObject defaultWeapon = (mobileTemplate.getCustomWeaponTemplate() != null) ? (WeaponObject) core.objectService.createObject(mobileTemplate.getCustomWeaponTemplate(), creature.getPlanet()) : (WeaponObject) core.objectService.createObject("object/weapon/creature/shared_creature_default_weapon.iff", creature.getPlanet()); + WeaponObject defaultWeapon = (mobileTemplate.getWeaponTemplates().size() > 0) ? (WeaponObject) core.objectService.createObject(mobileTemplate.getWeaponTemplates().get(new Random().nextInt(mobileTemplate.getWeaponTemplates().size())), creature.getPlanet()) : (WeaponObject) core.objectService.createObject("object/weapon/creature/shared_creature_default_weapon.iff", creature.getPlanet()); defaultWeapon.setAttackSpeed(2); defaultWeapon.setDamageType("@obj_attr_n:armor_eff_kinetic"); defaultWeapon.setStringAttribute("cat_wpn_damage.damage", "0-0"); From 515cb92ce777a9ecdd8fa5dd11ba6dfe0ce12029 Mon Sep 17 00:00:00 2001 From: Seefo Date: Mon, 31 Mar 2014 21:06:43 -0400 Subject: [PATCH 2/6] Added option for buffs on items and wearables --- scripts/commands/of_medical_sup_1.py | 2 + .../generic_usable/stim_syringe_generic.py | 1 + .../wearables/robe/robe_jedi_light_s03.py | 4 +- .../wearables/robe/robe_jedi_light_s04.py | 40 +++++++------------ src/services/BuffService.java | 5 +++ src/services/EquipmentService.java | 6 ++- src/services/object/ObjectService.java | 12 ++++++ 7 files changed, 41 insertions(+), 29 deletions(-) diff --git a/scripts/commands/of_medical_sup_1.py b/scripts/commands/of_medical_sup_1.py index b7186ab6..52ae6c13 100644 --- a/scripts/commands/of_medical_sup_1.py +++ b/scripts/commands/of_medical_sup_1.py @@ -39,6 +39,8 @@ def spawnCrate(core, actor, shuttle): for i in range(0, 8): tactical = core.objectService.createObject('object/tangible/loot/generic_usable/shared_stim_syringe_generic.iff', actor.getPlanet()) #FIXME: Use the correct template tactical.setCustomName('Tactical Serum A') + tactical.setStringAttribute('proc_name', '@ui_buff:of_tactical_drop_6') + tactical.setAttachment("tempUseCount", 1) crate.add(tactical) for i in range(0, 8): diff --git a/scripts/object/tangible/loot/generic_usable/stim_syringe_generic.py b/scripts/object/tangible/loot/generic_usable/stim_syringe_generic.py index ccad8904..15085ba3 100644 --- a/scripts/object/tangible/loot/generic_usable/stim_syringe_generic.py +++ b/scripts/object/tangible/loot/generic_usable/stim_syringe_generic.py @@ -1,4 +1,5 @@ import sys def setup(core, object): + object.setAttachment('radial_filename', 'usable') return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/robe/robe_jedi_light_s03.py b/scripts/object/tangible/wearables/robe/robe_jedi_light_s03.py index a40fe4b9..ba7c4c85 100644 --- a/scripts/object/tangible/wearables/robe/robe_jedi_light_s03.py +++ b/scripts/object/tangible/wearables/robe/robe_jedi_light_s03.py @@ -2,9 +2,9 @@ import sys def setup(core, object): object.setStfFilename('static_item_n') - object.setStfName('item_jedi_robe_light_03_03') + object.setStfName('item_jedi_robe_light_04_04') object.setDetailFilename('static_item_d') - object.setDetailName('item_jedi_robe_light_03_03') + object.setDetailName('item_jedi_robe_light_04_04') object.setIntAttribute('cat_stat_mod_bonus.@stat_n:constitution_modified', 185) object.setIntAttribute('cat_stat_mod_bonus.@stat_n:strength_modified', 185) object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 185) diff --git a/scripts/object/tangible/wearables/robe/robe_jedi_light_s04.py b/scripts/object/tangible/wearables/robe/robe_jedi_light_s04.py index be022790..07760bd3 100644 --- a/scripts/object/tangible/wearables/robe/robe_jedi_light_s04.py +++ b/scripts/object/tangible/wearables/robe/robe_jedi_light_s04.py @@ -1,31 +1,19 @@ import sys def setup(core, object): + object.setStfFilename('static_item_n') + object.setStfName('item_jedi_robe_light_04_04') + object.setDetailFilename('static_item_d') + object.setDetailName('item_jedi_robe_light_04_04') + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:constitution_modified', 250) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:strength_modified', 250) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 250) + object.setStringAttribute('protection_level', 'Radiant') + object.setStringAttribute('class_required', 'Jedi') + object.setIntAttribute('required_combat_level', 90) + object.setAttachment('type', 'jedi_robe') + object.setStringAttribute('proc_name', '@ui_buff:proc_old_light_jedi_gift') + object.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_jedi_robe_1') return - -def equip(core, actor, target): - core.skillModService.addSkillMod(actor, 'agility_modified', 250) - core.skillModService.addSkillMod(actor, 'constitution_modified', 250) - core.skillModService.addSkillMod(actor, 'strength_modified', 250) - - Buff = actor.getBuffByName('proc_old_light_jedi_gift') - if actor.getBuffList().contains(Buff): - core.buffService.removeBuffFromCreature(actor, Buff) - return - - if actor: - core.buffService.addBuffToCreature(actor, 'proc_old_light_jedi_gift') - return - return - -def unequip(core, actor, target): - core.skillModService.deductSkillMod(actor, 'agility_modified', 250) - core.skillModService.deductSkillMod(actor, 'constitution_modified', 250) - core.skillModService.deductSkillMod(actor, 'strength_modified', 250) - - Buff = actor.getBuffByName('proc_old_light_jedi_gift') - if actor.getBuffList().contains(Buff): - core.buffService.removeBuffFromCreature(actor, Buff) - return - return + \ No newline at end of file diff --git a/src/services/BuffService.java b/src/services/BuffService.java index 57bd4bd9..917f07e6 100644 --- a/src/services/BuffService.java +++ b/src/services/BuffService.java @@ -245,6 +245,11 @@ public class BuffService implements INetworkDispatch { } } + public void removeBuffFromCreatureByName(CreatureObject creature, String buffName) + { + removeBuffFromCreature(creature, creature.getBuffByName(buffName)); + } + public void clearBuffs(final CreatureObject creature) { // copy to array for thread safety diff --git a/src/services/EquipmentService.java b/src/services/EquipmentService.java index afe5b694..9995f4a7 100644 --- a/src/services/EquipmentService.java +++ b/src/services/EquipmentService.java @@ -215,10 +215,12 @@ public class EquipmentService implements INetworkDispatch { } } + + if(item.getStringAttribute("proc_name") != null) core.buffService.addBuffToCreature(actor, item.getStringAttribute("proc_name").replace("@ui_buff:", ""), actor); + if(!actor.getEquipmentList().contains(item)) actor.addObjectToEquipList(item); - } @@ -268,6 +270,8 @@ public class EquipmentService implements INetworkDispatch { return; } + if(item.getStringAttribute("proc_name") != null) core.buffService.removeBuffFromCreatureByName(actor, item.getStringAttribute("proc_name").replace("@ui_buff:", "")); + if(actor.getEquipmentList().contains(item)) actor.removeObjectFromEquipList(item); diff --git a/src/services/object/ObjectService.java b/src/services/object/ObjectService.java index 451ab5b5..e117483c 100644 --- a/src/services/object/ObjectService.java +++ b/src/services/object/ObjectService.java @@ -530,6 +530,18 @@ public class ObjectService implements INetworkDispatch { return; } + if(object.getStringAttribute("proc_name") != null) + { + if(object.getAttachment("tempUseCount") != null) + { + int useCount = (int)object.getAttachment("tempUseCount"); // Placeholder until delta for stack count/use count + + if(useCount - 1 == 0) destroyObject(object); + else object.setAttachment("tempUseCount", useCount--); + } + core.buffService.addBuffToCreature(creature, object.getStringAttribute("proc_name").replace("@ui_buff:", ""), creature); + } + String filePath = "scripts/" + object.getTemplate().split("shared_" , 2)[0].replace("shared_", "") + object.getTemplate().split("shared_" , 2)[1].replace(".iff", "") + ".py"; if (FileUtilities.doesFileExist(filePath)) { From f93a7b68db97a3fe41eda6c1eddefba1fa104907 Mon Sep 17 00:00:00 2001 From: Seefo Date: Mon, 31 Mar 2014 22:03:39 -0400 Subject: [PATCH 3/6] Added action skill mod --- scripts/skillMods/action.py | 12 ++++++++++++ src/services/BuffService.java | 2 ++ src/services/object/ObjectService.java | 6 ++++-- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 scripts/skillMods/action.py diff --git a/scripts/skillMods/action.py b/scripts/skillMods/action.py new file mode 100644 index 00000000..5d92ea61 --- /dev/null +++ b/scripts/skillMods/action.py @@ -0,0 +1,12 @@ +import sys + +def add(core, actor, name, base): + actor.addSkillMod(name, base) + actor.setMaxAction(actor.getMaxAction() + base) + return + +def deduct(core, actor, name, base): + actor.deductSkillMod(name, base) + actor.setMaxAction(actor.getMaxAction() - base) + return + \ No newline at end of file diff --git a/src/services/BuffService.java b/src/services/BuffService.java index 917f07e6..4a41803d 100644 --- a/src/services/BuffService.java +++ b/src/services/BuffService.java @@ -100,6 +100,8 @@ public class BuffService implements INetworkDispatch { return null; } + if(target.hasBuff(buffName)) return null; + final Buff buff = new Buff(buffName, target.getObjectID()); if(target.getSlottedObject("ghost") != null) buff.setTotalPlayTime(((PlayerObject) target.getSlottedObject("ghost")).getTotalPlayTime()); diff --git a/src/services/object/ObjectService.java b/src/services/object/ObjectService.java index e117483c..76a680a1 100644 --- a/src/services/object/ObjectService.java +++ b/src/services/object/ObjectService.java @@ -534,11 +534,13 @@ public class ObjectService implements INetworkDispatch { { if(object.getAttachment("tempUseCount") != null) { - int useCount = (int)object.getAttachment("tempUseCount"); // Placeholder until delta for stack count/use count + int useCount = (int)object.getAttachment("tempUseCount"); // Seefo: Placeholder until delta for stack count/use count - if(useCount - 1 == 0) destroyObject(object); + if((useCount - 1) == 0) destroyObject(object); else object.setAttachment("tempUseCount", useCount--); } + + // Seefo: We need to add cool downs for buff items core.buffService.addBuffToCreature(creature, object.getStringAttribute("proc_name").replace("@ui_buff:", ""), creature); } From 31d57bb790640df1df6b2556954e7dcd7b4936a7 Mon Sep 17 00:00:00 2001 From: Levarrishawk Date: Mon, 31 Mar 2014 22:10:29 -0400 Subject: [PATCH 4/6] Removed Jedi and Spy Professions :3 --- src/services/StaticService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/services/StaticService.java b/src/services/StaticService.java index f6c8bf68..626fb261 100644 --- a/src/services/StaticService.java +++ b/src/services/StaticService.java @@ -56,6 +56,7 @@ public class StaticService implements INetworkDispatch { spawnPlanetStaticObjs("naboo"); spawnPlanetStaticObjs("tatooine"); spawnPlanetStaticObjs("lok"); + // //spawnPlanetStaticObjs("kaas"); // Keep commented out unless you possess the latest build of Kaas! } From e926507ea41fb48fdba49f5d63a1e6b7b622f627 Mon Sep 17 00:00:00 2001 From: Treeku Date: Tue, 1 Apr 2014 03:18:58 +0100 Subject: [PATCH 5/6] Removed structure trader, start work on guildbanks --- scripts/demo.py | 348 ++++++++++++++++++++++++------------------------ 1 file changed, 174 insertions(+), 174 deletions(-) diff --git a/scripts/demo.py b/scripts/demo.py index 92b340a8..1b5dbf3d 100644 --- a/scripts/demo.py +++ b/scripts/demo.py @@ -2,23 +2,23 @@ import sys def CreateStartingCharacter(core, object): -# testObject = core.objectService.createObject('object/weapon/ranged/rifle/shared_rifle_t21.iff', object.getPlanet()) -# testObject.setCustomName('This is a Jython Rifle') -# testObject.setStringAttribute('crafter', 'Light') -# testObject.setDamageType('@obj_attr_n:armor_eff_energy') -# testObject.setElementalType('@obj_attr_n:elemental_cold') -# testObject.setStringAttribute('cat_wpn_damage.damage', '0-0') -# testObject.setMinDamage(425) -# testObject.setMaxDamage(1150) -# testObject.setElementalDamage(50) -# testObject.setIntAttribute('cat_wpn_damage.weapon_dps', testObject.getDamagePerSecond()) -# testObject.setIntAttribute('cat_skill_mod_bonus.@stat_n:precision_modified', 35) -# object.addSkillMod('kinetic' , 0) -# object.addSkillMod('energy' , 0) -# object.addSkillMod('heat' , 0) -# object.addSkillMod('cold' , 0) -# object.addSkillMod('acid' , 0) -# object.addSkillMod('electricity' , 0) + #testObject = core.objectService.createObject('object/weapon/ranged/rifle/shared_rifle_t21.iff', object.getPlanet()) + #testObject.setCustomName('This is a Jython Rifle') + #testObject.setStringAttribute('crafter', 'Light') + #testObject.setDamageType('@obj_attr_n:armor_eff_energy') + #testObject.setElementalType('@obj_attr_n:elemental_cold') + #testObject.setStringAttribute('cat_wpn_damage.damage', '0-0') + #testObject.setMinDamage(425) + #testObject.setMaxDamage(1150) + #testObject.setElementalDamage(50) + #testObject.setIntAttribute('cat_wpn_damage.weapon_dps', testObject.getDamagePerSecond()) + #testObject.setIntAttribute('cat_skill_mod_bonus.@stat_n:precision_modified', 35) + #object.addSkillMod('kinetic' , 0) + #object.addSkillMod('energy' , 0) + #object.addSkillMod('heat' , 0) + #object.addSkillMod('cold' , 0) + #object.addSkillMod('acid' , 0) + #object.addSkillMod('electricity' , 0) #object.addSkillMod('combat_strikethrough_value' , 50) #object.addSkillMod('display_only_dodge' , 2000) #object.addSkillMod('display_only_parry' , 1000) @@ -29,40 +29,40 @@ def CreateStartingCharacter(core, object): #object.addSkillMod('display_only_block' , 2000) #object.addSkillMod('combat_block_value' , 0) -# inventory = object.getSlottedObject('inventory') -# if not inventory: -# return -# inventory.add(testObject) +# #inventory = object.getSlottedObject('inventory') +# #if not inventory: +# # return +# #inventory.add(testObject) -# testClothing = core.objectService.createObject('object/tangible/wearables/cape/shared_cape_rebel_01.iff', object.getPlanet()) -# testClothing.setCustomName('Test Cape') -# testCloak = core.objectService.createObject('object/tangible/wearables/robe/shared_robe_jedi_dark_s05.iff', object.getPlanet()) -# testCloak.setCustomName('Test Cloak') - -# inventory.add(testClothing) -# inventory.add(testCloak) -# profession = object.getSlottedObject('ghost').getProfession() -# if profession == 'commando_1a': -# object.addSkillMod('expertise_devastation_bonus' , 20) -# testObject2 = core.objectService.createObject('object/weapon/ranged/heavy/shared_heavy_rocket_launcher.iff', object.getPlanet()) -# testObject2.setCustomName('Test Heavy Weapon') -# testObject2.setStringAttribute('crafter', 'Light') -# testObject2.setDamageType('@obj_attr_n:armor_eff_kinetic') -# testObject2.setElementalType('@obj_attr_n:elemental_heat') -# testObject2.setStringAttribute('cat_wpn_damage.damage', '0-0') -# testObject2.setMinDamage(550) -# testObject2.setMaxDamage(1315) -# testObject2.setElementalDamage(216) -# testObject2.setIntAttribute('cat_wpn_damage.weapon_dps', testObject2.getDamagePerSecond()) -# inventory.add(testObject2) +# #testClothing = core.objectService.createObject('object/tangible/wearables/cape/shared_cape_rebel_01.iff', object.getPlanet()) +# #testClothing.setCustomName('Test Cape') +# #testCloak = core.objectService.createObject('object/tangible/wearables/robe/shared_robe_jedi_dark_s05.iff', object.getPlanet()) +# #testCloak.setCustomName('Test Cloak') +# #inventory.add(testClothing) +# #inventory.add(testCloak) +# #profession = object.getSlottedObject('ghost').getProfession() +# #if profession == 'commando_1a': +# # object.addSkillMod('expertise_devastation_bonus' , 20) +# # testObject2 = core.objectService.createObject('object/weapon/ranged/heavy/shared_heavy_rocket_launcher.iff', object.getPlanet()) +# # testObject2.setCustomName('Test Heavy Weapon') +# # testObject2.setStringAttribute('crafter', 'Light') +# # testObject2.setDamageType('@obj_attr_n:armor_eff_kinetic') +# # testObject2.setElementalType('@obj_attr_n:elemental_heat') +# # testObject2.setStringAttribute('cat_wpn_damage.damage', '0-0') +# # testObject2.setMinDamage(550) +# # testObject2.setMaxDamage(1315) +# # testObject2.setElementalDamage(216) +# # testObject2.setIntAttribute('cat_wpn_damage.weapon_dps', testObject2.getDamagePerSecond()) +# # inventory.add(testObject2) +# # addProfessionAbilities(core, object, profession) # heroism1 = core.objectService.createObject('object/tangible/wearables/necklace/shared_necklace_s10.iff', object.getPlanet()) -# heroism1.setStfFilename('static_item_n') -# heroism1.setStfName('item_necklace_set_hero_01_01') -# heroism1.setDetailFilename('static_item_d') -# heroism1.setDetailName('item_necklace_set_hero_01_01') + # heroism1.setStfFilename('static_item_n') + # heroism1.setStfName('item_necklace_set_hero_01_01') + # heroism1.setDetailFilename('static_item_d') + # heroism1.setDetailName('item_necklace_set_hero_01_01') # heroism1.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_hero_1') # heroism1.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_hero_2') # heroism1.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_hero_3') @@ -71,22 +71,22 @@ def CreateStartingCharacter(core, object): # heroism1.setIntAttribute('cat_stat_mod_bonus.food_strength_modified' , 30) -# inventory = object.getSlottedObject('inventory') -# if not inventory: -# return -# inventory.add(heroism1) + # inventory = object.getSlottedObject('inventory') + # if not inventory: + # return + # inventory.add(heroism1) -# heroism2 = core.objectService.createObject('object/tangible/wearables/bracelet/shared_bracelet_s03_r.iff', object.getPlanet()) -# heroism2.setStfFilename('static_item_n') -# heroism2.setStfName('item_bracelet_r_set_hero_01_01') -# heroism2.setDetailFilename('static_item_d') -# heroism2.setDetailName('item_bracelet_r_set_hero_01_01') -# heroism2.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_hero_1') -# heroism2.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_hero_2') -# heroism2.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_hero_3') -# heroism2.setIntAttribute('cat_stat_mod_bonus.food_luck_modified' , 30) -# heroism2.setIntAttribute('cat_stat_mod_bonus.food_precision_modified' , 30) -# heroism2.setIntAttribute('cat_stat_mod_bonus.food_strength_modified' , 30) + # heroism2 = core.objectService.createObject('object/tangible/wearables/bracelet/shared_bracelet_s03_r.iff', object.getPlanet()) + # heroism2.setStfFilename('static_item_n') + # heroism2.setStfName('item_bracelet_r_set_hero_01_01') + # heroism2.setDetailFilename('static_item_d') + # heroism2.setDetailName('item_bracelet_r_set_hero_01_01') + # heroism2.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_hero_1') + # heroism2.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_hero_2') + # heroism2.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_hero_3') + # heroism2.setIntAttribute('cat_stat_mod_bonus.food_luck_modified' , 30) + # heroism2.setIntAttribute('cat_stat_mod_bonus.food_precision_modified' , 30) + # heroism2.setIntAttribute('cat_stat_mod_bonus.food_strength_modified' , 30) # inventory = object.getSlottedObject('inventory') @@ -102,27 +102,27 @@ def CreateStartingCharacter(core, object): # heroism3.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_hero_1') # heroism3.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_hero_2') # heroism3.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_hero_3') -# heroism3.setIntAttribute('cat_stat_mod_bonus.food_luck_modified' , 30) -# heroism3.setIntAttribute('cat_stat_mod_bonus.food_precision_modified' , 30) -# heroism3.setIntAttribute('cat_stat_mod_bonus.food_strength_modified' , 30) + # heroism3.setIntAttribute('cat_stat_mod_bonus.food_luck_modified' , 30) + # heroism3.setIntAttribute('cat_stat_mod_bonus.food_precision_modified' , 30) + # heroism3.setIntAttribute('cat_stat_mod_bonus.food_strength_modified' , 30) -# inventory = object.getSlottedObject('inventory') -# if not inventory: -# return -# inventory.add(heroism3) + # inventory = object.getSlottedObject('inventory') + # if not inventory: + # return + # inventory.add(heroism3) -# heroism4 = core.objectService.createObject('object/tangible/wearables/ring/shared_ring_s04.iff', object.getPlanet()) -# heroism4.setStfFilename('static_item_n') -# heroism4.setStfName('item_ring_set_hero_01_01') -# heroism4.setDetailFilename('static_item_d') -# heroism4.setDetailName('item_ring_set_hero_01_01') -# heroism4.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_hero_1') -# heroism4.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_hero_2') -# heroism4.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_hero_3') -# heroism4.setIntAttribute('cat_stat_mod_bonus.food_luck_modified' , 30) -# heroism4.setIntAttribute('cat_stat_mod_bonus.food_precision_modified' , 30) -# heroism4.setIntAttribute('cat_stat_mod_bonus.food_strength_modified' , 30) + # heroism4 = core.objectService.createObject('object/tangible/wearables/ring/shared_ring_s04.iff', object.getPlanet()) + # heroism4.setStfFilename('static_item_n') + # heroism4.setStfName('item_ring_set_hero_01_01') + # heroism4.setDetailFilename('static_item_d') + # heroism4.setDetailName('item_ring_set_hero_01_01') + # heroism4.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_hero_1') + # heroism4.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_hero_2') + # heroism4.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_hero_3') + # heroism4.setIntAttribute('cat_stat_mod_bonus.food_luck_modified' , 30) + # heroism4.setIntAttribute('cat_stat_mod_bonus.food_precision_modified' , 30) + # heroism4.setIntAttribute('cat_stat_mod_bonus.food_strength_modified' , 30) # inventory = object.getSlottedObject('inventory') @@ -130,39 +130,39 @@ def CreateStartingCharacter(core, object): # return # inventory.add(heroism4) -# heroism5 = core.objectService.createObject('object/tangible/wearables/ring/shared_ring_s02.iff', object.getPlanet()) -# heroism5.setStfFilename('static_item_n') -# heroism5.setStfName('item_ring_a_set_hero') -# heroism5.setDetailFilename('static_item_d') -# heroism5.setDetailName('item_ring_a_set_hero') -# heroism5.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_hero_1') -# heroism5.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_hero_2') -# heroism5.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_hero_3') -# heroism5.setIntAttribute('cat_stat_mod_bonus.food_luck_modified' , 30) -# heroism5.setIntAttribute('cat_stat_mod_bonus.food_precision_modified' , 30) -# heroism5.setIntAttribute('cat_stat_mod_bonus.food_strength_modified' , 30) + # heroism5 = core.objectService.createObject('object/tangible/wearables/ring/shared_ring_s02.iff', object.getPlanet()) + # heroism5.setStfFilename('static_item_n') + # heroism5.setStfName('item_ring_a_set_hero') + # heroism5.setDetailFilename('static_item_d') + # heroism5.setDetailName('item_ring_a_set_hero') + # heroism5.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_hero_1') + # heroism5.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_hero_2') + # heroism5.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_hero_3') + # heroism5.setIntAttribute('cat_stat_mod_bonus.food_luck_modified' , 30) + # heroism5.setIntAttribute('cat_stat_mod_bonus.food_precision_modified' , 30) + # heroism5.setIntAttribute('cat_stat_mod_bonus.food_strength_modified' , 30) -# inventory = object.getSlottedObject('inventory') -# if not inventory: -# return -# inventory.add(heroism5) + # inventory = object.getSlottedObject('inventory') + # if not inventory: + # return + # inventory.add(heroism5) return def addProfessionAbilities(core, object, profession): # if profession == 'force_sensitive_1a': # testObject = core.objectService.createObject('object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gcw_s01_gen5.iff', object.getPlanet()) -# testObject.setCustomName('Lightsaber') +# testObject.setCustomName('Lightsaber') # testObject.setStringAttribute('crafter', 'Light') # testObject.setDamageType('@obj_attr_n:armor_eff_energy') -# testObject.setElementalType('@obj_attr_n:elemental_cold') +# testObject.setElementalType('@obj_attr_n:elemental_cold') # testObject.setStringAttribute('cat_wpn_damage.damage', '0-0') # testObject.setMinDamage(600) # testObject.setMaxDamage(1190) -# testObject.setElementalDamage(72) +# testObject.setElementalDamage(72) # testObject.setIntAttribute('cat_wpn_damage.weapon_dps', testObject.getDamagePerSecond()) -# inventory = object.getSlottedObject('inventory') +# inventory = object.getSlottedObject('inventory') # inventory.add(testObject) ##Case Sensitive @@ -203,16 +203,16 @@ def addProfessionAbilities(core, object, profession): # object.addAbility('co_hw_dot') # object.addAbility('co_ae_hw_dot') #elif profession == 'bounty_hunter_1a': - # object.addAbility('bh_shields_1') - # object.addAbility('bh_dm_8') - # object.addAbility('bh_sh_3') - # object.addAbility('bh_armor_sprint_1') - # object.addAbility('bh_prescience') - # object.addAbility('bh_dm_crit_8') - # object.addAbility('crippleShot') - # object.addAbility('bh_fumble_6') - # object.addAbility('bh_intimidate_6') - # object.addAbility('bh_flawless_strike') + #object.addAbility('bh_shields_1') + #object.addAbility('bh_dm_8') + #object.addAbility('bh_sh_3') + #object.addAbility('bh_armor_sprint_1') + #object.addAbility('bh_prescience') + #object.addAbility('bh_dm_crit_8') + #object.addAbility('crippleShot') + #object.addAbility('bh_fumble_6') + #object.addAbility('bh_intimidate_6') + #object.addAbility('bh_flawless_strike') # direfate1 = core.objectService.createObject('object/tangible/wearables/necklace/shared_necklace_s03.iff', object.getPlanet()) # direfate1.setStfFilename('static_item_n') @@ -404,71 +404,71 @@ def addProfessionAbilities(core, object, profession): # enforcer2.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_dps_1') # enforcer2.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_dps_2') # enforcer2.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_dps_3') - # enforcer2.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm' , 1) - # enforcer2.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm_crit' , 1) - # enforcer2.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_buff_duration_line_bh_return_fire' , 1) - # enforcer2.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_cooldown_line_dm' , 1) - - # inventory = object.getSlottedObject('inventory') - # if not inventory: - # return - # inventory.add(enforcer2) - - # enforcer3 = core.objectService.createObject('object/tangible/wearables/bracelet/shared_bracelet_s02_l.iff', object.getPlanet()) - # enforcer3.setStfFilename('static_item_n') - # enforcer3.setStfName('item_bracelet_l_set_bh_dps_01_01') - # enforcer3.setDetailFilename('static_item_d') - # enforcer3.setDetailName('item_bracelet_l_set_bh_dps_01_01') - # enforcer3.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_dps_1') - # enforcer3.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_dps_2') - # enforcer3.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_dps_3') - # enforcer3.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm' , 1) - # enforcer3.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm_crit' , 1) - # enforcer3.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_buff_duration_line_bh_return_fire' , 1) - # enforcer3.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_cooldown_line_dm' , 1) - - # inventory = object.getSlottedObject('inventory') - # if not inventory: - # return - # inventory.add(enforcer3) - - # enforcer4 = core.objectService.createObject('object/tangible/wearables/ring/shared_ring_s01.iff', object.getPlanet()) - # enforcer4.setStfFilename('static_item_n') - # enforcer4.setStfName('item_ring_set_bh_dps_01_01') - # enforcer4.setDetailFilename('static_item_d') - # enforcer4.setDetailName('item_ring_set_bh_dps_01_01') - # enforcer4.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_dps_1') - # enforcer4.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_dps_2') - # enforcer4.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_dps_3') - # enforcer4.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm' , 1) - # enforcer4.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm_crit' , 1) - # enforcer4.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_buff_duration_line_bh_return_fire' , 1) - # enforcer4.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_cooldown_line_dm' , 1) - - # inventory = object.getSlottedObject('inventory') - # if not inventory: - # return - # inventory.add(enforcer4) - - # enforcer5 = core.objectService.createObject('object/tangible/wearables/ring/shared_ring_s03.iff', object.getPlanet()) - # enforcer5.setStfFilename('static_item_n') - # enforcer5.setStfName('item_ring_a_set_bh_dps') - # enforcer5.setDetailFilename('static_item_d') - # enforcer5.setDetailName('item_ring_a_set_bh_dps') - # enforcer5.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_dps_1') - # enforcer5.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_dps_2') - # enforcer5.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_dps_3') - # enforcer5.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm' , 1) - # enforcer5.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm_crit' , 1) - # enforcer5.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_buff_duration_line_bh_return_fire' , 1) - # enforcer5.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_cooldown_line_dm' , 1) - - # inventory = object.getSlottedObject('inventory') - # if not inventory: - # return - # inventory.add(enforcer5) - # return - #return + # enforcer2.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm' , 1) + # enforcer2.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm_crit' , 1) + # enforcer2.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_buff_duration_line_bh_return_fire' , 1) + # enforcer2.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_cooldown_line_dm' , 1) + + # inventory = object.getSlottedObject('inventory') + # if not inventory: + # return + # inventory.add(enforcer2) + + # enforcer3 = core.objectService.createObject('object/tangible/wearables/bracelet/shared_bracelet_s02_l.iff', object.getPlanet()) + # enforcer3.setStfFilename('static_item_n') + # enforcer3.setStfName('item_bracelet_l_set_bh_dps_01_01') + #enforcer3.setDetailFilename('static_item_d') + # enforcer3.setDetailName('item_bracelet_l_set_bh_dps_01_01') + # enforcer3.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_dps_1') + # enforcer3.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_dps_2') + # enforcer3.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_dps_3') + #enforcer3.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm' , 1) + # enforcer3.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm_crit' , 1) + # enforcer3.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_buff_duration_line_bh_return_fire' , 1) + # enforcer3.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_cooldown_line_dm' , 1) + + #inventory = object.getSlottedObject('inventory') + #if not inventory: + # return + #inventory.add(enforcer3) + + #enforcer4 = core.objectService.createObject('object/tangible/wearables/ring/shared_ring_s01.iff', object.getPlanet()) + #enforcer4.setStfFilename('static_item_n') + #enforcer4.setStfName('item_ring_set_bh_dps_01_01') + #enforcer4.setDetailFilename('static_item_d') + #enforcer4.setDetailName('item_ring_set_bh_dps_01_01') + #enforcer4.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_dps_1') + #enforcer4.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_dps_2') + #enforcer4.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_dps_3') + #enforcer4.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm' , 1) + #enforcer4.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm_crit' , 1) + #enforcer4.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_buff_duration_line_bh_return_fire' , 1) + #enforcer4.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_cooldown_line_dm' , 1) + + #inventory = object.getSlottedObject('inventory') + #if not inventory: + # return + #inventory.add(enforcer4) + + #enforcer5 = core.objectService.createObject('object/tangible/wearables/ring/shared_ring_s03.iff', object.getPlanet()) + #enforcer5.setStfFilename('static_item_n') + #enforcer5.setStfName('item_ring_a_set_bh_dps') + #enforcer5.setDetailFilename('static_item_d') + #enforcer5.setDetailName('item_ring_a_set_bh_dps') + #enforcer5.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_dps_1') + #enforcer5.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_dps_2') + #enforcer5.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_dps_3') + #enforcer5.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm' , 1) + #enforcer5.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm_crit' , 1) + #enforcer5.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_buff_duration_line_bh_return_fire' , 1) + #enforcer5.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_cooldown_line_dm' , 1) + + #inventory = object.getSlottedObject('inventory') + #if not inventory: + # return + #inventory.add(enforcer5) + #return + #return - return \ No newline at end of file + return From e7761f7e454ab6ab3d51111695a043aa373fd458 Mon Sep 17 00:00:00 2001 From: Seefo Date: Mon, 31 Mar 2014 22:43:18 -0400 Subject: [PATCH 6/6] Added actionPercent and healthPercent skillmods --- scripts/skillMods/actionPercent.py | 12 +++++++++ scripts/skillMods/health.py | 12 +++++++++ scripts/skillMods/healthPercent.py | 12 +++++++++ src/services/BuffService.java | 40 ++++++------------------------ 4 files changed, 44 insertions(+), 32 deletions(-) create mode 100644 scripts/skillMods/actionPercent.py create mode 100644 scripts/skillMods/health.py create mode 100644 scripts/skillMods/healthPercent.py diff --git a/scripts/skillMods/actionPercent.py b/scripts/skillMods/actionPercent.py new file mode 100644 index 00000000..97166ab2 --- /dev/null +++ b/scripts/skillMods/actionPercent.py @@ -0,0 +1,12 @@ +import sys + +def add(core, actor, name, base): + actor.addSkillMod(name, base) + actor.setMaxAction(actor.getMaxAction() + int((float(actor.getMaxAction()) * (float(base) / float(100))))) + return + +def deduct(core, actor, name, base): + actor.deductSkillMod(name, base) + actor.setMaxAction(actor.getMaxAction() - int((float(actor.getMaxAction()) * (float(base) / float(100))))) + return + \ No newline at end of file diff --git a/scripts/skillMods/health.py b/scripts/skillMods/health.py new file mode 100644 index 00000000..b4a86dd4 --- /dev/null +++ b/scripts/skillMods/health.py @@ -0,0 +1,12 @@ +import sys + +def add(core, actor, name, base): + actor.addSkillMod(name, base) + actor.setMaxHealth(actor.getMaxHealth() + base) + return + +def deduct(core, actor, name, base): + actor.deductSkillMod(name, base) + actor.setMaxHealth(actor.getMaxHealth() - base) + return + \ No newline at end of file diff --git a/scripts/skillMods/healthPercent.py b/scripts/skillMods/healthPercent.py new file mode 100644 index 00000000..ed9b3e37 --- /dev/null +++ b/scripts/skillMods/healthPercent.py @@ -0,0 +1,12 @@ +import sys + +def add(core, actor, name, base): + actor.addSkillMod(name, base) + actor.setMaxHealth(actor.getMaxHealth() + int((float(actor.getMaxHealth()) * (float(base) / float(100))))) + return + +def deduct(core, actor, name, base): + actor.deductSkillMod(name, base) + actor.setMaxHealth(actor.getMaxHealth() - int((actor.getMaxHealth() * (float(base) / float(100))))) + return + \ No newline at end of file diff --git a/src/services/BuffService.java b/src/services/BuffService.java index 4a41803d..ca7812c7 100644 --- a/src/services/BuffService.java +++ b/src/services/BuffService.java @@ -252,38 +252,14 @@ public class BuffService implements INetworkDispatch { removeBuffFromCreature(creature, creature.getBuffByName(buffName)); } - public void clearBuffs(final CreatureObject creature) { - - // copy to array for thread safety - - for(final Buff buff : creature.getBuffList().get().toArray(new Buff[] { })) { - - if (buff.getGroup1().startsWith("setBonus")) { continue; } - - if(buff.isGroupBuff() && buff.getGroupBufferId() != creature.getObjectID()) { - removeBuffFromCreature(creature, buff); - continue; - } - - if(buff.getRemainingDuration() > 0 && buff.getDuration() > 0) { - ScheduledFuture task = scheduler.schedule(new Runnable() { - - @Override - public void run() { - - removeBuffFromCreature(creature, buff); - - } - - }, (long) buff.getRemainingDuration(), TimeUnit.SECONDS); - buff.setRemovalTask(task); - continue; - } else { - removeBuffFromCreature(creature, buff); - } - - } - + public void clearBuffs(final CreatureObject creature) + { + // This method sucks ass, someone please fix me + for(Buff buff : creature.getBuffList().get()) + { + if(buff.getRemainingDuration() > 0 && buff.getDuration() > 0) buff.setRemovalTask(null); + removeBuffFromCreature(creature, buff); + } } public void addGroupBuff(CreatureObject buffer, String buffName) {