diff --git a/ngengine_public.jar b/ngengine_public.jar index 353c787a..0d2614d2 100644 Binary files a/ngengine_public.jar and b/ngengine_public.jar differ diff --git a/scripts/buffs/flawless_bead_1.py b/scripts/buffs/flawless_bead_1.py new file mode 100644 index 00000000..84123a88 --- /dev/null +++ b/scripts/buffs/flawless_bead_1.py @@ -0,0 +1,7 @@ +import sys + +def setup(core, actor, buff): + return + +def removeBuff(core, actor, buff): + return \ No newline at end of file diff --git a/scripts/buffs/flawless_bead_2.py b/scripts/buffs/flawless_bead_2.py new file mode 100644 index 00000000..84123a88 --- /dev/null +++ b/scripts/buffs/flawless_bead_2.py @@ -0,0 +1,7 @@ +import sys + +def setup(core, actor, buff): + return + +def removeBuff(core, actor, buff): + return \ No newline at end of file diff --git a/scripts/buffs/flawless_bead_3.py b/scripts/buffs/flawless_bead_3.py new file mode 100644 index 00000000..84123a88 --- /dev/null +++ b/scripts/buffs/flawless_bead_3.py @@ -0,0 +1,7 @@ +import sys + +def setup(core, actor, buff): + return + +def removeBuff(core, actor, buff): + return \ No newline at end of file diff --git a/scripts/buffs/me_stasis_1.py b/scripts/buffs/me_stasis_1.py new file mode 100644 index 00000000..1539e280 --- /dev/null +++ b/scripts/buffs/me_stasis_1.py @@ -0,0 +1,11 @@ +import sys + +def setup(core, actor, buff): + actor.playEffectObject('clienteffect/medic_stasis.cef', 'me_stasis_1') + actor.setSpeedMultiplierBase(0.2) + return + +def removeBuff(core, actor, buff): + actor.setSpeedMultiplierBase(1) + return + \ No newline at end of file diff --git a/scripts/buffs/me_stasis_self_1.py b/scripts/buffs/me_stasis_self_1.py new file mode 100644 index 00000000..6341cb4c --- /dev/null +++ b/scripts/buffs/me_stasis_self_1.py @@ -0,0 +1,11 @@ +import sys + +def setup(core, actor, buff): + actor.playEffectObject('clienteffect/medic_stasis.cef', 'me_stasis_self_1') + actor.setSpeedMultiplierBase(0.2) + return + +def removeBuff(core, actor, buff): + actor.setSpeedMultiplierBase(1) + return + \ No newline at end of file diff --git a/scripts/buffs/set_bonus_bh_dps_1.py b/scripts/buffs/set_bonus_bh_dps_1.py new file mode 100644 index 00000000..58d3ed08 --- /dev/null +++ b/scripts/buffs/set_bonus_bh_dps_1.py @@ -0,0 +1,9 @@ +import sys + +def setup(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_action_line_dm', 5) + return + +def removeBuff(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_action_line_dm', 5) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_bh_dps_2.py b/scripts/buffs/set_bonus_bh_dps_2.py new file mode 100644 index 00000000..cf463a7a --- /dev/null +++ b/scripts/buffs/set_bonus_bh_dps_2.py @@ -0,0 +1,11 @@ +import sys + +def setup(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_action_line_dm', 5) + core.skillModService.addSkillMod(actor, 'expertise_buff_duration_line_bh_return_fire' , 5) + return + +def removeBuff(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_action_line_dm', 5) + core.skillModService.deductSkillMod(actor, 'expertise_buff_duration_line_bh_return_fire' , 5) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_bh_dps_3.py b/scripts/buffs/set_bonus_bh_dps_3.py new file mode 100644 index 00000000..06bcee28 --- /dev/null +++ b/scripts/buffs/set_bonus_bh_dps_3.py @@ -0,0 +1,17 @@ +import sys + +def setup(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_action_line_dm', 10) + core.skillModService.addSkillMod(actor, 'expertise_action_line_dm_crit', 10) + core.skillModService.addSkillMod(actor, 'expertise_buff_duration_line_bh_return_fire' , 10) + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_dm' , 10) + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_bh_return_fire' , 750) + return + +def removeBuff(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_action_line_dm', 10) + core.skillModService.deductSkillMod(actor, 'expertise_action_line_dm_crit', 10) + core.skillModService.deductSkillMod(actor, 'expertise_buff_duration_line_bh_return_fire' , 10) + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_dm' , 10) + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_bh_return_fire' , 750) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_bh_utility_a_1.py b/scripts/buffs/set_bonus_bh_utility_a_1.py new file mode 100644 index 00000000..4f9e42e4 --- /dev/null +++ b/scripts/buffs/set_bonus_bh_utility_a_1.py @@ -0,0 +1,9 @@ +import sys + +def setup(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_bh_flawless_strike', 15) + return + +def removeBuff(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_bh_flawless_strike', 15) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_bh_utility_a_2.py b/scripts/buffs/set_bonus_bh_utility_a_2.py new file mode 100644 index 00000000..4f9e42e4 --- /dev/null +++ b/scripts/buffs/set_bonus_bh_utility_a_2.py @@ -0,0 +1,9 @@ +import sys + +def setup(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_bh_flawless_strike', 15) + return + +def removeBuff(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_bh_flawless_strike', 15) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_bh_utility_a_3.py b/scripts/buffs/set_bonus_bh_utility_a_3.py new file mode 100644 index 00000000..e98992f3 --- /dev/null +++ b/scripts/buffs/set_bonus_bh_utility_a_3.py @@ -0,0 +1,10 @@ +import sys + +def setup(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_bh_flawless_strike', 30) + return + +def removeBuff(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_bh_flawless_strike', 30) + return + \ No newline at end of file diff --git a/scripts/buffs/set_bonus_bh_utility_b_1.py b/scripts/buffs/set_bonus_bh_utility_b_1.py new file mode 100644 index 00000000..0f4597fe --- /dev/null +++ b/scripts/buffs/set_bonus_bh_utility_b_1.py @@ -0,0 +1,9 @@ +import sys + +def setup(core, actor, buff): + core.skillModService.addSkillMod(actor, 'fast_attack_line_dm_cc', 5) + return + +def removeBuff(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'fast_attack_line_dm_cc', 5) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_bh_utility_b_2.py b/scripts/buffs/set_bonus_bh_utility_b_2.py new file mode 100644 index 00000000..945c2883 --- /dev/null +++ b/scripts/buffs/set_bonus_bh_utility_b_2.py @@ -0,0 +1,13 @@ +import sys + +def setup(core, actor, buff): + core.skillModService.addSkillMod(actor, 'fast_attack_line_dm_cc', 10) + core.skillModService.addSkillMod(actor, 'bh_dire_root', 20) + core.skillModService.addSkillMod(actor, 'bh_dire_snare', 20) + return + +def removeBuff(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'fast_attack_line_dm_cc', 10) + core.skillModService.deductSkillMod(actor, 'bh_dire_root', 20) + core.skillModService.deductSkillMod(actor, 'bh_dire_snare', 20) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_bh_utility_b_3.py b/scripts/buffs/set_bonus_bh_utility_b_3.py new file mode 100644 index 00000000..d136c4ec --- /dev/null +++ b/scripts/buffs/set_bonus_bh_utility_b_3.py @@ -0,0 +1,13 @@ +import sys + +def setup(core, actor, buff): + core.skillModService.addSkillMod(actor, 'fast_attack_line_dm_cc', 35) + core.skillModService.addSkillMod(actor, 'bh_dire_root', 45) + core.skillModService.addSkillMod(actor, 'bh_dire_snare', 45) + return + +def removeBuff(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'fast_attack_line_dm_cc', 35) + core.skillModService.deductSkillMod(actor, 'bh_dire_root', 45) + core.skillModService.deductSkillMod(actor, 'bh_dire_snare', 45) + return \ No newline at end of file diff --git a/scripts/commands/combat/me_stasis_1.py b/scripts/commands/combat/me_stasis_1.py new file mode 100644 index 00000000..35ffc3d7 --- /dev/null +++ b/scripts/commands/combat/me_stasis_1.py @@ -0,0 +1,11 @@ +import sys + +def setup(core, actor, target, command): + command.setBuffNameTarget('me_stasis_1') + return + +def preRun(core, actor, target, command): + return + +def run(core, actor, target, commandString): + return diff --git a/scripts/commands/me_drag_1.py b/scripts/commands/me_drag_1.py new file mode 100644 index 00000000..d7a0a46a --- /dev/null +++ b/scripts/commands/me_drag_1.py @@ -0,0 +1,18 @@ +import sys + +def setup(): + return + +def run(core, actor, target, commandString): + + if actor.getGroupId() == 0: + return + + group = core.objectService.getObject(actor.getGroupId()) + + for creature in group.getMemberList(): + if creature.getPosture() == 14: + core.simulationService.teleport(creature, actor.getPosition(), actor.getOrientation(), actor.getParentId()) + + return + \ No newline at end of file diff --git a/scripts/commands/me_reckless_stimulation_1.py b/scripts/commands/me_reckless_stimulation_1.py new file mode 100644 index 00000000..9949b2e5 --- /dev/null +++ b/scripts/commands/me_reckless_stimulation_1.py @@ -0,0 +1,25 @@ +import sys +from services.command import CombatCommand + +def setup(core, actor, buff): + return + +def run(core, actor, target, commandString): + + combatSvc = core.combatService + + weapon = core.objectService.getObject(actor.getWeaponId()) + + if not weapon: + weapon = actor.getSlottedObject('default_weapon') + + command = core.commandService.getCommandByName('me_reckless_stimulation_1') + + if not combatSvc.applySpecialCost(actor, weapon, CombatCommand('me_reckless_stimulation_1')): + return + + actor.playEffectObject('clienteffect/medic_reckless_stimulation.cef', 'root') + actor.setAction(actor.getAction() + 1000) + + return + \ No newline at end of file diff --git a/scripts/commands/me_reckless_stimulation_2.py b/scripts/commands/me_reckless_stimulation_2.py new file mode 100644 index 00000000..d5ddeef2 --- /dev/null +++ b/scripts/commands/me_reckless_stimulation_2.py @@ -0,0 +1,25 @@ +import sys +from services.command import CombatCommand + +def setup(core, actor, buff): + return + +def run(core, actor, target, commandString): + + combatSvc = core.combatService + + weapon = core.objectService.getObject(actor.getWeaponId()) + + if not weapon: + weapon = actor.getSlottedObject('default_weapon') + + command = core.commandService.getCommandByName('me_reckless_stimulation_2') + + if not combatSvc.applySpecialCost(actor, weapon, CombatCommand('me_reckless_stimulation_2')): + return + + actor.playEffectObject('clienteffect/medic_reckless_stimulation.cef', 'root') + actor.setAction(actor.getAction() + 1500) + + return + \ No newline at end of file diff --git a/scripts/commands/me_reckless_stimulation_3.py b/scripts/commands/me_reckless_stimulation_3.py new file mode 100644 index 00000000..9d3820f4 --- /dev/null +++ b/scripts/commands/me_reckless_stimulation_3.py @@ -0,0 +1,25 @@ +import sys +from services.command import CombatCommand + +def setup(core, actor, buff): + return + +def run(core, actor, target, commandString): + + combatSvc = core.combatService + + weapon = core.objectService.getObject(actor.getWeaponId()) + + if not weapon: + weapon = actor.getSlottedObject('default_weapon') + + command = core.commandService.getCommandByName('me_reckless_stimulation_3') + + if not combatSvc.applySpecialCost(actor, weapon, CombatCommand('me_reckless_stimulation_3')): + return + + actor.playEffectObject('clienteffect/medic_reckless_stimulation.cef', 'root') + actor.setAction(actor.getAction() + 2000) + + return + \ No newline at end of file diff --git a/scripts/commands/me_reckless_stimulation_4.py b/scripts/commands/me_reckless_stimulation_4.py new file mode 100644 index 00000000..1121b29e --- /dev/null +++ b/scripts/commands/me_reckless_stimulation_4.py @@ -0,0 +1,25 @@ +import sys +from services.command import CombatCommand + +def setup(core, actor, buff): + return + +def run(core, actor, target, commandString): + + combatSvc = core.combatService + + weapon = core.objectService.getObject(actor.getWeaponId()) + + if not weapon: + weapon = actor.getSlottedObject('default_weapon') + + command = core.commandService.getCommandByName('me_reckless_stimulation_4') + + if not combatSvc.applySpecialCost(actor, weapon, CombatCommand('me_reckless_stimulation_4')): + return + + actor.playEffectObject('clienteffect/medic_reckless_stimulation.cef', 'root') + actor.setAction(actor.getAction() + 2500) + + return + \ No newline at end of file diff --git a/scripts/commands/me_reckless_stimulation_5.py b/scripts/commands/me_reckless_stimulation_5.py new file mode 100644 index 00000000..6978b27e --- /dev/null +++ b/scripts/commands/me_reckless_stimulation_5.py @@ -0,0 +1,25 @@ +import sys +from services.command import CombatCommand + +def setup(core, actor, buff): + return + +def run(core, actor, target, commandString): + + combatSvc = core.combatService + + weapon = core.objectService.getObject(actor.getWeaponId()) + + if not weapon: + weapon = actor.getSlottedObject('default_weapon') + + command = core.commandService.getCommandByName('me_reckless_stimulation_5') + + if not combatSvc.applySpecialCost(actor, weapon, CombatCommand('me_reckless_stimulation_5')): + return + + actor.playEffectObject('clienteffect/medic_reckless_stimulation.cef', 'root') + actor.setAction(actor.getAction() + 3000) + + return + \ No newline at end of file diff --git a/scripts/commands/me_reckless_stimulation_6.py b/scripts/commands/me_reckless_stimulation_6.py new file mode 100644 index 00000000..fc220b9f --- /dev/null +++ b/scripts/commands/me_reckless_stimulation_6.py @@ -0,0 +1,25 @@ +import sys +from services.command import CombatCommand + +def setup(core, actor, buff): + return + +def run(core, actor, target, commandString): + + combatSvc = core.combatService + + weapon = core.objectService.getObject(actor.getWeaponId()) + + if not weapon: + weapon = actor.getSlottedObject('default_weapon') + + command = core.commandService.getCommandByName('me_reckless_stimulation_6') + + if not combatSvc.applySpecialCost(actor, weapon, CombatCommand('me_reckless_stimulation_6')): + return + + actor.playEffectObject('clienteffect/medic_reckless_stimulation.cef', 'root') + actor.setAction(actor.getAction() + 3500) + + return + \ No newline at end of file diff --git a/scripts/commands/me_stasis_self_1.py b/scripts/commands/me_stasis_self_1.py new file mode 100644 index 00000000..fc808c70 --- /dev/null +++ b/scripts/commands/me_stasis_self_1.py @@ -0,0 +1,24 @@ +import sys +from services.command import CombatCommand + +def setup(core, actor, buff): + return + +def run(core, actor, target, commandString): + + combatSvc = core.combatService + + weapon = core.objectService.getObject(actor.getWeaponId()) + + if not weapon: + weapon = actor.getSlottedObject('default_weapon') + + command = core.commandService.getCommandByName('me_stasis_self_1') + + if not combatSvc.applySpecialCost(actor, weapon, CombatCommand('me_stasis_self_1')): + return + + core.buffService.addBuffToCreature(actor, 'me_stasis_self_1') + + return + \ No newline at end of file diff --git a/scripts/demo.py b/scripts/demo.py index 2cda8a16..f030192a 100644 --- a/scripts/demo.py +++ b/scripts/demo.py @@ -177,6 +177,10 @@ def addProfessionAbilities(core, object, profession): object.addAbility('me_thyroid_rupture_1') object.addAbility('me_traumatize_5') object.addAbility('me_induce_insanity_1') + elif profession == 'commando_1a': + object.addAbility('co_del_ae_cc_2_2') + object.addAbility('co_del_ae_dm_3') + object.addAbility('co_del_ae_cc_1_3') elif profession == 'bounty_hunter_1a': object.addAbility('bh_shields_1') object.addAbility('bh_dm_8') @@ -189,4 +193,262 @@ def addProfessionAbilities(core, object, profession): 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') + direfate1.setStfName('item_necklace_set_bh_utility_b_01_01') + direfate1.setDetailFilename('static_item_d') + direfate1.setDetailName('item_necklace_set_bh_utility_b_01_01') + direfate1.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_utility_b_1') + direfate1.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_utility_b_2') + direfate1.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_utility_b_3') + direfate1.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_root' , 1) + direfate1.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_snare' , 1) + direfate1.setIntAttribute('cat_skill_mod_bonus.@stat_n:fast_attack_line_dm_cc' , 2) + + inventory = object.getSlottedObject('inventory') + if not inventory: + return + inventory.add(direfate1) + + direfate2 = core.objectService.createObject('object/tangible/wearables/bracelet/shared_bracelet_s04_r.iff', object.getPlanet()) + direfate2.setStfFilename('static_item_n') + direfate2.setStfName('item_bracelet_r_set_bh_utility_b_01_01') + direfate2.setDetailFilename('static_item_d') + direfate2.setDetailName('item_bracelet_r_set_bh_utility_b_01_01') + direfate2.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_utility_b_1') + direfate2.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_utility_b_2') + direfate2.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_utility_b_3') + direfate2.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_root' , 1) + direfate2.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_snare' , 1) + direfate2.setIntAttribute('cat_skill_mod_bonus.@stat_n:fast_attack_line_dm_cc' , 2) + + inventory = object.getSlottedObject('inventory') + if not inventory: + return + inventory.add(direfate2) + + direfate3 = core.objectService.createObject('object/tangible/wearables/bracelet/shared_bracelet_s04_l.iff', object.getPlanet()) + direfate3.setStfFilename('static_item_n') + direfate3.setStfName('item_bracelet_l_set_bh_utility_b_01_01') + direfate3.setDetailFilename('static_item_d') + direfate3.setDetailName('item_bracelet_l_set_bh_utility_b_01_01') + direfate3.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_utility_b_1') + direfate3.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_utility_b_2') + direfate3.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_utility_b_3') + direfate3.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_root' , 1) + direfate3.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_snare' , 1) + direfate3.setIntAttribute('cat_skill_mod_bonus.@stat_n:fast_attack_line_dm_cc' , 2) + + inventory = object.getSlottedObject('inventory') + if not inventory: + return + inventory.add(direfate3) + + direfate4 = core.objectService.createObject('object/tangible/wearables/ring/shared_ring_s01.iff', object.getPlanet()) + direfate4.setStfFilename('static_item_n') + direfate4.setStfName('item_ring_set_bh_utility_b_01_01') + direfate4.setDetailFilename('static_item_d') + direfate4.setDetailName('item_ring_set_bh_utility_b_01_01') + direfate4.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_utility_b_1') + direfate4.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_utility_b_2') + direfate4.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_utility_b_3') + direfate4.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_root' , 1) + direfate4.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_snare' , 1) + direfate4.setIntAttribute('cat_skill_mod_bonus.@stat_n:fast_attack_line_dm_cc' , 2) + + inventory = object.getSlottedObject('inventory') + if not inventory: + return + inventory.add(direfate4) + + direfate5 = core.objectService.createObject('object/tangible/wearables/ring/shared_ring_s03.iff', object.getPlanet()) + direfate5.setStfFilename('static_item_n') + direfate5.setStfName('item_ring_a_set_bh_utility_b') + direfate5.setDetailFilename('static_item_d') + direfate5.setDetailName('item_ring_a_set_bh_utility_b') + direfate5.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_utility_b_1') + direfate5.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_utility_b_2') + direfate5.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_utility_b_3') + direfate5.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_root' , 1) + direfate5.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_snare' , 1) + direfate5.setIntAttribute('cat_skill_mod_bonus.@stat_n:fast_attack_line_dm_cc' , 2) + + inventory = object.getSlottedObject('inventory') + if not inventory: + return + inventory.add(direfate5) + + flawless1 = core.objectService.createObject('object/tangible/wearables/necklace/shared_necklace_s02.iff', object.getPlanet()) + flawless1.setStfFilename('static_item_n') + flawless1.setStfName('item_necklace_set_bh_utility_a_01_01') + flawless1.setDetailFilename('static_item_d') + flawless1.setDetailName('item_necklace_set_bh_utility_a_01_01') + flawless1.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_utility_a_1') + flawless1.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_utility_a_2') + flawless1.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_utility_a_3') + flawless1.setIntAttribute('cat_stat_mod_bonus.food_luck_modified' , 30) + flawless1.setIntAttribute('cat_stat_mod_bonus.food_precision_modified' , 50) + + inventory = object.getSlottedObject('inventory') + if not inventory: + return + inventory.add(flawless1) + + flawless2 = core.objectService.createObject('object/tangible/wearables/bracelet/shared_bracelet_s03_r.iff', object.getPlanet()) + flawless2.setStfFilename('static_item_n') + flawless2.setStfName('item_bracelet_r_set_bh_utility_a_01_01') + flawless2.setDetailFilename('static_item_d') + flawless2.setDetailName('item_bracelet_r_set_bh_utility_a_01_01') + flawless2.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_utility_b_1') + flawless2.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_utility_b_2') + flawless2.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_utility_b_3') + flawless2.setIntAttribute('cat_stat_mod_bonus.food_luck_modified' , 30) + flawless2.setIntAttribute('cat_stat_mod_bonus.food_precision_modified' , 50) + + inventory = object.getSlottedObject('inventory') + if not inventory: + return + inventory.add(flawless2) + + flawless3 = core.objectService.createObject('object/tangible/wearables/bracelet/shared_bracelet_s03_l.iff', object.getPlanet()) + flawless3.setStfFilename('static_item_n') + flawless3.setStfName('item_bracelet_l_set_bh_utility_a_01_01') + flawless3.setDetailFilename('static_item_d') + flawless3.setDetailName('item_bracelet_l_set_bh_utility_a_01_01') + flawless3.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_utility_b_1') + flawless3.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_utility_b_2') + flawless3.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_utility_b_3') + flawless3.setIntAttribute('cat_stat_mod_bonus.food_luck_modified' , 30) + flawless3.setIntAttribute('cat_stat_mod_bonus.food_precision_modified' , 50) + + inventory = object.getSlottedObject('inventory') + if not inventory: + return + inventory.add(flawless3) + + flawless4 = core.objectService.createObject('object/tangible/wearables/ring/shared_ring_s02.iff', object.getPlanet()) + flawless4.setStfFilename('static_item_n') + flawless4.setStfName('item_ring_set_bh_utility_a_01_01') + flawless4.setDetailFilename('static_item_d') + flawless4.setDetailName('item_ring_set_bh_utility_a_01_01') + flawless4.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_utility_b_1') + flawless4.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_utility_b_2') + flawless4.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_utility_b_3') + flawless4.setIntAttribute('cat_stat_mod_bonus.food_luck_modified' , 30) + flawless4.setIntAttribute('cat_stat_mod_bonus.food_precision_modified' , 50) + + inventory = object.getSlottedObject('inventory') + if not inventory: + return + inventory.add(flawless4) + + flawless5 = core.objectService.createObject('object/tangible/wearables/ring/shared_ring_s04.iff', object.getPlanet()) + flawless5.setStfFilename('static_item_n') + flawless5.setStfName('item_ring_a_set_bh_utility_a') + flawless5.setDetailFilename('static_item_d') + flawless5.setDetailName('item_ring_a_set_bh_utility_a') + flawless5.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_utility_b_1') + flawless5.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_utility_b_2') + flawless5.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_utility_b_3') + flawless5.setIntAttribute('cat_stat_mod_bonus.food_luck_modified' , 30) + flawless5.setIntAttribute('cat_stat_mod_bonus.food_precision_modified' , 50) + + inventory = object.getSlottedObject('inventory') + if not inventory: + return + inventory.add(flawless5) + + enforcer1 = core.objectService.createObject('object/tangible/wearables/necklace/shared_necklace_s01.iff', object.getPlanet()) + enforcer1.setStfFilename('static_item_n') + enforcer1.setStfName('item_necklace_set_bh_dps_01_01') + enforcer1.setDetailFilename('static_item_d') + enforcer1.setDetailName('item_necklace_set_bh_dps_01_01') + enforcer1.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_bh_dps_1') + enforcer1.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_dps_2') + enforcer1.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_dps_3') + enforcer1.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm' , 1) + enforcer1.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_action_line_dm_crit' , 1) + enforcer1.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_buff_duration_line_bh_return_fire' , 1) + enforcer1.setIntAttribute('cat_skill_mod_bonus.@stat_n:expertise_cooldown_line_dm' , 1) + + inventory = object.getSlottedObject('inventory') + if not inventory: + return + inventory.add(enforcer1) + + enforcer2 = core.objectService.createObject('object/tangible/wearables/bracelet/shared_bracelet_s02_r.iff', object.getPlanet()) + enforcer2.setStfFilename('static_item_n') + enforcer2.setStfName('item_bracelet_r_set_bh_dps_01_01') + enforcer2.setDetailFilename('static_item_d') + enforcer2.setDetailName('item_bracelet_r_set_dps_01_01') + 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 + + return diff --git a/scripts/object/tangible/terminal/terminal_cloning.py b/scripts/object/tangible/terminal/terminal_cloning.py index ccad8904..91f80095 100644 --- a/scripts/object/tangible/terminal/terminal_cloning.py +++ b/scripts/object/tangible/terminal/terminal_cloning.py @@ -1,4 +1,6 @@ import sys def setup(core, object): - return \ No newline at end of file + object.setAttachment('radial_filename', 'cloning_terminal') + return + \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bracelet/bracelet_s02_l.py b/scripts/object/tangible/wearables/bracelet/bracelet_s02_l.py index ccad8904..f4f028dd 100644 --- a/scripts/object/tangible/wearables/bracelet/bracelet_s02_l.py +++ b/scripts/object/tangible/wearables/bracelet/bracelet_s02_l.py @@ -1,4 +1,27 @@ import sys def setup(core, object): - return \ No newline at end of file + return + +def equip(core, actor, object): + + ##Enforcer + if object.getStfName() == ('item_bracelet_l_set_bh_dps_01_01'): + core.skillModService.addSkillMod(actor, 'expertise_action_line_dm', 1) + core.skillModService.addSkillMod(actor, 'expertise_action_line_dm_crit', 1) + core.skillModService.addSkillMod(actor, 'expertise_buff_duration_line_bh_return_fire' , 1) + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_dm' , 1) + return + return + +def unequip(core, actor, object): + + ##Enforcer + if object.getStfName() == ('item_bracelet_l_set_bh_dps_01_01'): + core.skillModService.deductSkillMod(actor, 'expertise_action_line_dm', 1) + core.skillModService.deductSkillMod(actor, 'expertise_action_line_dm_crit', 1) + core.skillModService.deductSkillMod(actor, 'expertise_buff_duration_line_bh_return_fire' , 1) + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_dm' , 1) + return + return + diff --git a/scripts/object/tangible/wearables/bracelet/bracelet_s02_r.py b/scripts/object/tangible/wearables/bracelet/bracelet_s02_r.py index ccad8904..99b3e2a7 100644 --- a/scripts/object/tangible/wearables/bracelet/bracelet_s02_r.py +++ b/scripts/object/tangible/wearables/bracelet/bracelet_s02_r.py @@ -1,4 +1,27 @@ import sys def setup(core, object): - return \ No newline at end of file + return + +def equip(core, actor, object): + + ##Enforcer + if object.getStfName() == ('item_bracelet_r_set_bh_dps_01_01'): + core.skillModService.addSkillMod(actor, 'expertise_action_line_dm', 1) + core.skillModService.addSkillMod(actor, 'expertise_action_line_dm_crit', 1) + core.skillModService.addSkillMod(actor, 'expertise_buff_duration_line_bh_return_fire' , 1) + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_dm' , 1) + return + return + +def unequip(core, actor, object): + + ##Enforcer + if object.getStfName() == ('item_bracelet_r_set_bh_dps_01_01'): + core.skillModService.deductSkillMod(actor, 'expertise_action_line_dm', 1) + core.skillModService.deductSkillMod(actor, 'expertise_action_line_dm_crit', 1) + core.skillModService.deductSkillMod(actor, 'expertise_buff_duration_line_bh_return_fire' , 1) + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_dm' , 1) + return + return + diff --git a/scripts/object/tangible/wearables/bracelet/bracelet_s03_l.py b/scripts/object/tangible/wearables/bracelet/bracelet_s03_l.py index 37f98a3a..7910082d 100644 --- a/scripts/object/tangible/wearables/bracelet/bracelet_s03_l.py +++ b/scripts/object/tangible/wearables/bracelet/bracelet_s03_l.py @@ -12,6 +12,12 @@ def equip(core, actor, object): core.skillModService.addSkillMod(actor, 'precision_modified', 30) core.skillModService.addSkillMod(actor, 'luck_modified', 30) return + + ##Flawless + elif object.getStfName() == ('item_bracelet_l_set_bh_utility_a_01_01'): + core.skillModService.addSkillMod(actor, 'precision_modified', 50) + core.skillModService.addSkillMod(actor, 'luck_modified', 30) + return return def unequip(core, actor, object): @@ -22,5 +28,11 @@ def unequip(core, actor, object): core.skillModService.deductSkillMod(actor, 'precision_modified', 30) core.skillModService.deductSkillMod(actor, 'luck_modified', 30) return + + ##Flawless + elif object.getStfName() == ('item_bracelet_l_set_bh_utility_a_01_01'): + core.skillModService.deductSkillMod(actor, 'precision_modified', 50) + core.skillModService.deductSkillMod(actor, 'luck_modified', 30) + return return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bracelet/bracelet_s03_r.py b/scripts/object/tangible/wearables/bracelet/bracelet_s03_r.py index bc8f4ae5..6aef422c 100644 --- a/scripts/object/tangible/wearables/bracelet/bracelet_s03_r.py +++ b/scripts/object/tangible/wearables/bracelet/bracelet_s03_r.py @@ -12,6 +12,12 @@ def equip(core, actor, object): core.skillModService.addSkillMod(actor, 'precision_modified', 30) core.skillModService.addSkillMod(actor, 'luck_modified', 30) return + + ##Flawless + elif object.getStfName() == ('item_bracelet_r_set_bh_utility_a_01_01'): + core.skillModService.addSkillMod(actor, 'precision_modified', 50) + core.skillModService.addSkillMod(actor, 'luck_modified', 30) + return return def unequip(core, actor, object): @@ -22,4 +28,10 @@ def unequip(core, actor, object): core.skillModService.deductSkillMod(actor, 'precision_modified', 30) core.skillModService.deductSkillMod(actor, 'luck_modified', 30) return + + ##Flawless + elif object.getStfName() == ('item_bracelet_r_set_bh_utility_a_01_01'): + core.skillModService.deductSkillMod(actor, 'precision_modified', 50) + core.skillModService.deductSkillMod(actor, 'luck_modified', 30) + return return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bracelet/bracelet_s04_l.py b/scripts/object/tangible/wearables/bracelet/bracelet_s04_l.py index ccad8904..69ebd639 100644 --- a/scripts/object/tangible/wearables/bracelet/bracelet_s04_l.py +++ b/scripts/object/tangible/wearables/bracelet/bracelet_s04_l.py @@ -1,4 +1,25 @@ import sys def setup(core, object): - return \ No newline at end of file + return + +def equip(core, actor, object): + + ##Direfate + if object.getStfName() == ('item_bracelet_l_set_bh_utility_b_01_01'): + core.skillModService.addSkillMod(actor, 'bh_dire_root', 1) + core.skillModService.addSkillMod(actor, 'bh_dire_snare', 1) + core.skillModService.addSkillMod(actor, 'fast_attack_line_dm_cc', 2) + return + return + +def unequip(core, actor, object): + + ##Direfate + if object.getStfName() == ('item_bracelet_l_set_bh_utility_b_01_01'): + core.skillModService.deductSkillMod(actor, 'bh_dire_root', 1) + core.skillModService.deductSkillMod(actor, 'bh_dire_snare', 1) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_dm_cc', 2) + return + return + diff --git a/scripts/object/tangible/wearables/bracelet/bracelet_s04_r.py b/scripts/object/tangible/wearables/bracelet/bracelet_s04_r.py index ccad8904..a82456f4 100644 --- a/scripts/object/tangible/wearables/bracelet/bracelet_s04_r.py +++ b/scripts/object/tangible/wearables/bracelet/bracelet_s04_r.py @@ -1,4 +1,26 @@ import sys def setup(core, object): - return \ No newline at end of file + return + +def equip(core, actor, object): + + ##Direfate + if object.getStfName() == ('item_bracelet_r_set_bh_utility_b_01_01'): + core.skillModService.addSkillMod(actor, 'bh_dire_root', 1) + core.skillModService.addSkillMod(actor, 'bh_dire_snare', 1) + core.skillModService.addSkillMod(actor, 'fast_attack_line_dm_cc', 2) + return + return + +def unequip(core, actor, object): + + ##Direfate + if object.getStfName() == ('item_bracelet_r_set_bh_utility_b_01_01'): + core.skillModService.deductSkillMod(actor, 'bh_dire_root', 1) + core.skillModService.deductSkillMod(actor, 'bh_dire_snare', 1) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_dm_cc', 2) + return + return + + \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_s01.py b/scripts/object/tangible/wearables/necklace/necklace_s01.py index 767c6be7..0890489c 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_s01.py +++ b/scripts/object/tangible/wearables/necklace/necklace_s01.py @@ -3,9 +3,40 @@ import sys def setup(core, object): return -def equip(core, actor, target): +def equip(core, actor, object): + + ##Enforcer + if object.getStfName() == ('item_necklace_set_bh_dps_01_01'): + core.skillModService.addSkillMod(actor, 'expertise_action_line_dm', 1) + core.skillModService.addSkillMod(actor, 'expertise_action_line_dm_crit', 1) + core.skillModService.addSkillMod(actor, 'expertise_buff_duration_line_bh_return_fire' , 1) + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_dm' , 1) + + Buff = actor.getBuffByName('set_bonus_bh_dps_3') + if actor.getBuffList().contains(Buff): + core.buffService.removeBuffFromCreature(actor, Buff) + return + + if actor: + core.buffService.addBuffToCreature(actor, 'set_bonus_bh_dps_3') + return + return return -def unequip(core, actor, target): +def unequip(core, actor, object): + ##Enforcer + if object.getStfName() == ('item_necklace_set_bh_dps_01_01'): + core.skillModService.deductSkillMod(actor, 'expertise_action_line_dm', 1) + core.skillModService.deductSkillMod(actor, 'expertise_action_line_dm_crit', 1) + core.skillModService.deductSkillMod(actor, 'expertise_buff_duration_line_bh_return_fire' , 1) + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_dm' , 1) + + Buff = actor.getBuffByName('set_bonus_bh_dps_3') + if actor.getBuffList().contains(Buff): + core.buffService.removeBuffFromCreature(actor, Buff) + return + return return + + diff --git a/scripts/object/tangible/wearables/necklace/necklace_s02.py b/scripts/object/tangible/wearables/necklace/necklace_s02.py index ccad8904..9f15ed48 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_s02.py +++ b/scripts/object/tangible/wearables/necklace/necklace_s02.py @@ -1,4 +1,36 @@ import sys def setup(core, object): - return \ No newline at end of file + return + +def equip(core, actor, object): + + ##Flawless + if object.getStfName() == ('item_necklace_set_bh_utility_a_01_01'): + core.skillModService.addSkillMod(actor, 'precision_modified', 50) + core.skillModService.addSkillMod(actor, 'luck_modified', 30) + + Buff = actor.getBuffByName('set_bonus_bh_utility_a_3') + if actor.getBuffList().contains(Buff): + core.buffService.removeBuffFromCreature(actor, Buff) + return + + if actor: + core.buffService.addBuffToCreature(actor, 'set_bonus_bh_utility_a_3') + return + return + return + +def unequip(core, actor, object): + + ##Flawless + if object.getStfName() == ('item_necklace_set_bh_utility_a_01_01'): + core.skillModService.deductSkillMod(actor, 'precision_modified', 50) + core.skillModService.deductSkillMod(actor, 'luck_modified', 30) + + Buff = actor.getBuffByName('set_bonus_bh_utility_a_3') + if actor.getBuffList().contains(Buff): + core.buffService.removeBuffFromCreature(actor, Buff) + return + return + return diff --git a/scripts/object/tangible/wearables/necklace/necklace_s03.py b/scripts/object/tangible/wearables/necklace/necklace_s03.py index ccad8904..76b8141c 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_s03.py +++ b/scripts/object/tangible/wearables/necklace/necklace_s03.py @@ -1,4 +1,40 @@ import sys def setup(core, object): - return \ No newline at end of file + return + +def equip(core, actor, object): + + ##Direfate + if object.getStfName() == ('item_necklace_set_bh_utility_b_01_01'): + core.skillModService.addSkillMod(actor, 'bh_dire_root', 1) + core.skillModService.addSkillMod(actor, 'bh_dire_snare', 1) + core.skillModService.addSkillMod(actor, 'fast_attack_line_dm_cc', 2) + + Buff = actor.getBuffByName('set_bonus_bh_utility_b_3') + if actor.getBuffList().contains(Buff): + core.buffService.removeBuffFromCreature(actor, Buff) + return + + if actor: + core.buffService.addBuffToCreature(actor, 'set_bonus_bh_utility_b_3') + return + return + return + +def unequip(core, actor, object): + + ##Direfate + if object.getStfName() == ('item_necklace_set_bh_utility_b_01_01'): + core.skillModService.deductSkillMod(actor, 'bh_dire_root', 1) + core.skillModService.deductSkillMod(actor, 'bh_dire_snare', 1) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_dm_cc', 2) + + Buff = actor.getBuffByName('set_bonus_bh_utility_b_3') + if actor.getBuffList().contains(Buff): + core.buffService.removeBuffFromCreature(actor, Buff) + return + return + return + + \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_s10.py b/scripts/object/tangible/wearables/necklace/necklace_s10.py index c55ced68..91ab9c88 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_s10.py +++ b/scripts/object/tangible/wearables/necklace/necklace_s10.py @@ -5,12 +5,20 @@ def setup(core, object): def equip(core, actor, object): - ##Heroism if object.getStfName() == ('item_necklace_set_hero_01_01'): core.skillModService.addSkillMod(actor, 'strength_modified', 30) core.skillModService.addSkillMod(actor, 'precision_modified', 30) core.skillModService.addSkillMod(actor, 'luck_modified', 30) + + Buff = actor.getBuffByName('set_bonus_hero_3') + if actor.getBuffList().contains(Buff): + core.buffService.removeBuffFromCreature(actor, Buff) + return + + if actor: + core.buffService.addBuffToCreature(actor, 'set_bonus_hero_3') + return return return @@ -21,5 +29,10 @@ def unequip(core, actor, object): core.skillModService.deductSkillMod(actor, 'strength_modified', 30) core.skillModService.deductSkillMod(actor, 'precision_modified', 30) core.skillModService.deductSkillMod(actor, 'luck_modified', 30) + + Buff = actor.getBuffByName('set_bonus_hero_3') + if actor.getBuffList().contains(Buff): + core.buffService.removeBuffFromCreature(actor, Buff) + return return return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/ring/ring_s01.py b/scripts/object/tangible/wearables/ring/ring_s01.py index ccad8904..dc6ea0b1 100644 --- a/scripts/object/tangible/wearables/ring/ring_s01.py +++ b/scripts/object/tangible/wearables/ring/ring_s01.py @@ -1,4 +1,42 @@ import sys def setup(core, object): - return \ No newline at end of file + return + +def equip(core, actor, object): + + ##Direfate + if object.getStfName() == ('item_ring_set_bh_utility_b_01_01'): + core.skillModService.addSkillMod(actor, 'bh_dire_root', 1) + core.skillModService.addSkillMod(actor, 'bh_dire_snare', 1) + core.skillModService.addSkillMod(actor, 'fast_attack_line_dm_cc', 2) + return + + ##Enforcer + elif object.getStfName() == ('item_ring_set_bh_dps_01_01'): + core.skillModService.addSkillMod(actor, 'expertise_action_line_dm', 1) + core.skillModService.addSkillMod(actor, 'expertise_action_line_dm_crit', 1) + core.skillModService.addSkillMod(actor, 'expertise_buff_duration_line_bh_return_fire' , 1) + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_dm' , 1) + return + return + +def unequip(core, actor, object): + + ##Direfate + if object.getStfName() == ('item_ring_set_bh_utility_b_01_01'): + core.skillModService.deductSkillMod(actor, 'bh_dire_root', 1) + core.skillModService.deductSkillMod(actor, 'bh_dire_snare', 1) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_dm_cc', 2) + return + + ##Enforcer + elif object.getStfName() == ('item_ring_set_bh_dps_01_01'): + core.skillModService.deductSkillMod(actor, 'expertise_action_line_dm', 1) + core.skillModService.deductSkillMod(actor, 'expertise_action_line_dm_crit', 1) + core.skillModService.deductSkillMod(actor, 'expertise_buff_duration_line_bh_return_fire' , 1) + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_dm' , 1) + return + return + + \ No newline at end of file diff --git a/scripts/object/tangible/wearables/ring/ring_s02.py b/scripts/object/tangible/wearables/ring/ring_s02.py index 6d8de3a6..2ca3d3ca 100644 --- a/scripts/object/tangible/wearables/ring/ring_s02.py +++ b/scripts/object/tangible/wearables/ring/ring_s02.py @@ -5,13 +5,18 @@ def setup(core, object): def equip(core, actor, object): - ##Heroism if object.getStfName() == ('item_ring_a_set_hero'): core.skillModService.addSkillMod(actor, 'strength_modified', 30) core.skillModService.addSkillMod(actor, 'precision_modified', 30) core.skillModService.addSkillMod(actor, 'luck_modified', 30) return + + ##Flawless + elif object.getStfName() == ('item_ring_set_bh_utility_a_01_01'): + core.skillModService.addSkillMod(actor, 'precision_modified', 50) + core.skillModService.addSkillMod(actor, 'luck_modified', 30) + return return def unequip(core, actor, object): @@ -22,5 +27,11 @@ def unequip(core, actor, object): core.skillModService.deductSkillMod(actor, 'precision_modified', 30) core.skillModService.deductSkillMod(actor, 'luck_modified', 30) return + + ##Flawless + elif object.getStfName() == ('item_ring_set_bh_utility_a_01_01'): + core.skillModService.deductSkillMod(actor, 'precision_modified', 50) + core.skillModService.deductSkillMod(actor, 'luck_modified', 30) + return return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/ring/ring_s03.py b/scripts/object/tangible/wearables/ring/ring_s03.py index ccad8904..418b5aa4 100644 --- a/scripts/object/tangible/wearables/ring/ring_s03.py +++ b/scripts/object/tangible/wearables/ring/ring_s03.py @@ -1,4 +1,42 @@ import sys def setup(core, object): - return \ No newline at end of file + return + +def equip(core, actor, object): + + ##Direfate + if object.getStfName() == ('item_ring_a_set_bh_utility_b'): + core.skillModService.addSkillMod(actor, 'bh_dire_root', 1) + core.skillModService.addSkillMod(actor, 'bh_dire_snare', 1) + core.skillModService.addSkillMod(actor, 'fast_attack_line_dm_cc', 2) + return + + ##Enforcer + elif object.getStfName() == ('item_ring_a_set_bh_dps'): + core.skillModService.addSkillMod(actor, 'expertise_action_line_dm', 1) + core.skillModService.addSkillMod(actor, 'expertise_action_line_dm_crit', 1) + core.skillModService.addSkillMod(actor, 'expertise_buff_duration_line_bh_return_fire' , 1) + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_dm' , 1) + return + return + +def unequip(core, actor, object): + + ##Direfate + if object.getStfName() == ('item_ring_a_set_bh_utility_b'): + core.skillModService.deductSkillMod(actor, 'bh_dire_root', 1) + core.skillModService.deductSkillMod(actor, 'bh_dire_snare', 1) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_dm_cc', 2) + return + + ##Enforcer + elif object.getStfName() == ('item_ring_a_set_bh_dps'): + core.skillModService.deductSkillMod(actor, 'expertise_action_line_dm', 1) + core.skillModService.deductSkillMod(actor, 'expertise_action_line_dm_crit', 1) + core.skillModService.deductSkillMod(actor, 'expertise_buff_duration_line_bh_return_fire' , 1) + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_dm' , 1) + return + return + + \ No newline at end of file diff --git a/scripts/object/tangible/wearables/ring/ring_s04.py b/scripts/object/tangible/wearables/ring/ring_s04.py index 1ffda287..6410d76f 100644 --- a/scripts/object/tangible/wearables/ring/ring_s04.py +++ b/scripts/object/tangible/wearables/ring/ring_s04.py @@ -12,6 +12,12 @@ def equip(core, actor, object): core.skillModService.addSkillMod(actor, 'precision_modified', 30) core.skillModService.addSkillMod(actor, 'luck_modified', 30) return + + ##Flawless + elif object.getStfName() == ('item_ring_a_set_bh_utility_a'): + core.skillModService.addSkillMod(actor, 'precision_modified', 50) + core.skillModService.addSkillMod(actor, 'luck_modified', 30) + return return def unequip(core, actor, object): @@ -22,5 +28,11 @@ def unequip(core, actor, object): core.skillModService.deductSkillMod(actor, 'precision_modified', 30) core.skillModService.deductSkillMod(actor, 'luck_modified', 30) return + + ##Flawless + elif object.getStfName() == ('item_ring_a_set_bh_utility_a'): + core.skillModService.deductSkillMod(actor, 'precision_modified', 50) + core.skillModService.deductSkillMod(actor, 'luck_modified', 30) + return return \ No newline at end of file diff --git a/scripts/radial/bank.py b/scripts/radial/bank.py index db6a08a1..e0faaf87 100644 --- a/scripts/radial/bank.py +++ b/scripts/radial/bank.py @@ -61,7 +61,7 @@ def handleSelection(core, owner, target, option): return -def handleTransfer(core, owner, eventType, returnList): +def handleTransfer(owner, window, eventType, returnList): if eventType == 0 and len(returnList) == 2: cashCredits = int(returnList.get(0)) diff --git a/scripts/radial/cloning_terminal.py b/scripts/radial/cloning_terminal.py new file mode 100644 index 00000000..4809d1d6 --- /dev/null +++ b/scripts/radial/cloning_terminal.py @@ -0,0 +1,43 @@ +from resources.common import RadialOptions +from services.sui.SUIService import MessageBoxType +from services.sui.SUIWindow import Trigger +from java.util import Vector +import sys + +def createRadial(core, owner, target, radials): + return + +def handleSelection(core, owner, target, option): + + if option == 21 and target: + suiSvc = core.suiService + suiWindow = suiSvc.createMessageBox(MessageBoxType.MESSAGE_BOX_OK_CANCEL, '@base_player:clone_confirm_title', '@base_player:clone_confirm_prompt', owner, target, 15) + returnParams = Vector() + returnParams.add('btnOk:Text') + returnParams.add('btnCancel:Text') + suiWindow.addHandler(0, '', Trigger.TRIGGER_OK, returnParams, handleSUI) + suiWindow.addHandler(1, '', Trigger.TRIGGER_CANCEL, returnParams, handleSUI) + suiSvc.openSUIWindow(suiWindow) + + return + +def handleSUI(owner, window, eventType, returnList): + + if eventType == 0: + cash = owner.getCashCredits() + bank = owner.getBankCredits() + if bank < 1000 and cash < 1000: + owner.sendSystemMessage('You lack the credits required to cover the cost of cloning.', 0) + return + elif bank > 1000: + owner.setBankCredits(bank - 1000) + elif cash > 1000 and bank < 1000: + owner.setCashCredits(cash - 1000) + + owner.setAttachment('preDesignatedCloner', window.getRangeObject().getGrandparent().getObjectID()) + owner.sendSystemMessage('@base_player:clone_success', 0) + + + return + + \ No newline at end of file diff --git a/scripts/starter_clothing/crafting_artisan_humanoid_male.py b/scripts/starter_clothing/crafting_artisan_humanoid_male.py index 2f396b69..f140e4c1 100644 --- a/scripts/starter_clothing/crafting_artisan_humanoid_male.py +++ b/scripts/starter_clothing/crafting_artisan_humanoid_male.py @@ -2,9 +2,9 @@ import sys def CraftingArtisanHumanoidMale(core, object): shirt = core.objectService.createObject('object/tangible/wearables/shirt/shared_shirt_s03.iff', object.getPlanet()) - vest = core.objectService.createObject('object/tangible/wearables/vest/shared_vest_s09.if', object.getPlanet()) + vest = core.objectService.createObject('object/tangible/wearables/vest/shared_vest_s09.iff', object.getPlanet()) necklace = core.objectService.createObject('object/tangible/wearables/necklace/shared_necklace_primitive_03.iff', object.getPlanet()) - pants = core.objectService.createObject('object/tangible/wearables/pants/shared_pants_s13.ifff', object.getPlanet()) + pants = core.objectService.createObject('object/tangible/wearables/pants/shared_pants_s13.iff', object.getPlanet()) shoes = core.objectService.createObject('object/tangible/wearables/shoes/shared_shoes_s01.iff', object.getPlanet()) inventory = object.getSlottedObject('inventory') object._add(shirt) diff --git a/src/protocol/swg/PlayClientEffectObjectMessage.java b/src/protocol/swg/PlayClientEffectObjectMessage.java new file mode 100644 index 00000000..5e9dead4 --- /dev/null +++ b/src/protocol/swg/PlayClientEffectObjectMessage.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.swg; + +import java.nio.ByteOrder; + +import org.apache.mina.core.buffer.IoBuffer; + +public class PlayClientEffectObjectMessage extends SWGMessage { + + private long objectId; + private String effectFile; + private String commandString; + + public PlayClientEffectObjectMessage(String effectFile, long objectId, String commandString) { + + this.effectFile = effectFile; + this.objectId = objectId; + this.commandString = commandString; + + } + + @Override + public IoBuffer serialize() { + + IoBuffer result = IoBuffer.allocate(20 + effectFile.length() + commandString.length()).order(ByteOrder.LITTLE_ENDIAN); + + result.putShort((short) 5); + result.putInt(0x8855434A); + result.put(getAsciiString(effectFile)); + result.putShort((short) 0); + result.putLong(objectId); + result.put(getAsciiString(commandString)); + + return result.flip(); + + } + + @Override + public void deserialize(IoBuffer data) { + // TODO Auto-generated method stub + + } + +} diff --git a/src/protocol/swg/objectControllerObjects/StartTask.java b/src/protocol/swg/objectControllerObjects/StartTask.java index da3e74b7..f59ed3d7 100644 --- a/src/protocol/swg/objectControllerObjects/StartTask.java +++ b/src/protocol/swg/objectControllerObjects/StartTask.java @@ -25,6 +25,8 @@ import java.nio.ByteOrder; import org.apache.mina.core.buffer.IoBuffer; +import engine.resources.common.CRC; + import protocol.swg.ObjControllerMessage; public class StartTask extends ObjControllerObject { @@ -32,11 +34,15 @@ public class StartTask extends ObjControllerObject { private int actionCounter; private long objectId; private int commandCRC; + private int cooldownGroupCRC; + private float cooldown; - public StartTask(int actionCounter, long objectId, int commandCRC) { + public StartTask(int actionCounter, long objectId, int commandCRC, int cooldownGroupCRC, float cooldown) { this.actionCounter = actionCounter; this.objectId = objectId; this.commandCRC = commandCRC; + this.cooldownGroupCRC = cooldownGroupCRC; + this.cooldown = cooldown; } @Override @@ -48,10 +54,9 @@ public class StartTask extends ObjControllerObject { @Override public IoBuffer serialize() { - IoBuffer result = IoBuffer.allocate(37).order(ByteOrder.LITTLE_ENDIAN); + IoBuffer result = IoBuffer.allocate(45).order(ByteOrder.LITTLE_ENDIAN); result.putInt(ObjControllerMessage.START_TASK); - result.putLong(objectId); result.putInt(0); result.put((byte) 4); // 0 for no cooldown, 0x26 adds execute time (usually 0.25) @@ -59,9 +64,9 @@ public class StartTask extends ObjControllerObject { result.putInt(0); result.putInt(0); result.putInt(commandCRC); - result.putInt(0); // second unknown crc + result.putInt(cooldownGroupCRC); // second unknown crc result.putInt(0); // unk - result.putFloat(0); // cooldown + result.putFloat(cooldown); // cooldown return result.flip(); diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index 13695e7f..6f89cdfd 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -29,6 +29,7 @@ import org.apache.mina.core.buffer.IoBuffer; import protocol.swg.ChatSystemMessage; import protocol.swg.ObjControllerMessage; +import protocol.swg.PlayClientEffectObjectMessage; import protocol.swg.UpdatePVPStatusMessage; import protocol.swg.UpdatePostureMessage; import protocol.swg.objectControllerObjects.Posture; @@ -927,27 +928,15 @@ public class CreatureObject extends TangibleObject implements IPersistent { } IoBuffer delta; - // IoBuffer delta2; - int counter; synchronized(objectMutex) { if(health > maxHealth) health = maxHealth; - this.health = health; - counter = getHamListCounter() + 1; setHamListCounter(getHamListCounter() + 1); - delta = messageBuilder.buildUpdateHAMListDelta(); - /*if(health == 1) - delta2 = messageBuilder.buildHealthDelta(0); - else - delta2 = delta;*/ + delta = messageBuilder.buildHealthDelta(health); notifyObservers(delta, true); - - /*if(getClient() != null) - getClient().getSession().write(delta2);*/ + this.health = health; } - if(counter != getHamListCounter()) - System.out.println("test"); } @@ -959,18 +948,14 @@ public class CreatureObject extends TangibleObject implements IPersistent { public void setAction(int action) { IoBuffer delta; - int counter; synchronized(objectMutex) { if(action > maxAction) action = maxAction; - this.action = action; - counter = getHamListCounter() + 1; setHamListCounter(getHamListCounter() + 1); - delta = messageBuilder.buildUpdateHAMListDelta(); + delta = messageBuilder.buildActionDelta(action); notifyObservers(delta, true); + this.action = action; } - if(counter != getHamListCounter()) - System.out.println("test"); } public int getHamListCounter() { @@ -1096,6 +1081,10 @@ public class CreatureObject extends TangibleObject implements IPersistent { notifyObservers(messageBuilder.buildResetHAMListDelta(), true); } } + + public void playEffectObject(String effectFile, String commandString) { + notifyObservers(new PlayClientEffectObjectMessage(effectFile, getObjectID(), commandString), true); + } } diff --git a/src/services/BuffService.java b/src/services/BuffService.java index 1a0ab123..9c9beb67 100644 --- a/src/services/BuffService.java +++ b/src/services/BuffService.java @@ -61,7 +61,7 @@ public class BuffService implements INetworkDispatch { public void addBuffToCreature(final CreatureObject creature, String buffName) { if(!FileUtilities.doesFileExist("scripts/buffs/" + buffName + ".py")) { - System.out.println("Buff script doesnt exist for: " + buffName); + //System.out.println("Buff script doesnt exist for: " + buffName); return; } diff --git a/src/services/PlayerService.java b/src/services/PlayerService.java index c3cb95fa..6f2d3beb 100644 --- a/src/services/PlayerService.java +++ b/src/services/PlayerService.java @@ -64,7 +64,7 @@ import engine.resources.service.INetworkRemoteEvent; public class PlayerService implements INetworkDispatch { private NGECore core; - private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(2); + private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); public PlayerService(final NGECore core) { this.core = core; @@ -106,9 +106,10 @@ public class PlayerService implements INetworkDispatch { @Override public void run() { - if(creature.getAction() < creature.getMaxAction() && creature.getPosture() != 14) - creature.setAction(creature.getAction() + 200); - + synchronized(creature.getMutex()) { + if(creature.getAction() < creature.getMaxAction() && creature.getPosture() != 14) + creature.setAction(creature.getAction() + 200); + } } }, 0, 1000, TimeUnit.MILLISECONDS); @@ -118,12 +119,14 @@ public class PlayerService implements INetworkDispatch { @Override public void run() { - if(creature.getHealth() < creature.getMaxHealth() && creature.getCombatFlag() == 0 && creature.getPosture() != 13 && creature.getPosture() != 14) - creature.setHealth(creature.getHealth() + 300); + synchronized(creature.getMutex()) { + if(creature.getHealth() < creature.getMaxHealth() && creature.getCombatFlag() == 0 && creature.getPosture() != 13 && creature.getPosture() != 14) + creature.setHealth(creature.getHealth() + 300); + } } - }, 0, 1100, TimeUnit.MILLISECONDS); + }, 0, 1000, TimeUnit.MILLISECONDS); /*scheduler.scheduleAtFixedRate(new Runnable() { @@ -205,9 +208,18 @@ public class PlayerService implements INetworkDispatch { Map cloneData = new HashMap(); Point3D position = creature.getWorldPosition(); + SWGObject preDesignatedCloner = null; + + if(creature.getAttachment("preDesignatedCloner") != null) { + preDesignatedCloner = core.objectService.getObject((long) creature.getAttachment("preDesignatedCloner")); + if(preDesignatedCloner != null) + cloneData.put(preDesignatedCloner.getObjectID(), core.mapService.getClosestCityName(preDesignatedCloner) /*+ " (" + String.valueOf(position.getDistance2D(cloner.getPosition())) + "m)"*/); + } + for(SWGObject cloner : cloners) { - cloneData.put(cloner.getObjectID(), core.mapService.getClosestCityName(cloner) /*+ " (" + String.valueOf(position.getDistance2D(cloner.getPosition())) + "m)"*/); + if(cloner != preDesignatedCloner) + cloneData.put(cloner.getObjectID(), core.mapService.getClosestCityName(cloner) /*+ " (" + String.valueOf(position.getDistance2D(cloner.getPosition())) + "m)"*/); } @@ -215,6 +227,7 @@ public class PlayerService implements INetworkDispatch { cloneData, creature, null, 0); Vector returnList = new Vector(); returnList.add("List.lstList:SelectedRow"); + window.addHandler(0, "", Trigger.TRIGGER_OK, returnList, new SUICallback() { @SuppressWarnings("unchecked") diff --git a/src/services/SimulationService.java b/src/services/SimulationService.java index 008c140c..83b80a8a 100644 --- a/src/services/SimulationService.java +++ b/src/services/SimulationService.java @@ -616,14 +616,20 @@ public class SimulationService implements INetworkDispatch { } - public void teleport(SWGObject obj, Point3D position, Quaternion orientation) { + public void teleport(SWGObject obj, Point3D position, Quaternion orientation, long cellId) { - if(position.x >= -8192 && position.x <= 8192 && position.z >= -8192 && position.z <= 8192) { - - DataTransform dataTransform = new DataTransform(new Point3D(position.x, position.y, position.z), orientation, 1, obj.getObjectID()); + if(cellId == 0) { + if(position.x >= -8192 && position.x <= 8192 && position.z >= -8192 && position.z <= 8192) { + obj.setMovementCounter(obj.getMovementCounter() + 1); + DataTransform dataTransform = new DataTransform(new Point3D(position.x, position.y, position.z), orientation, obj.getMovementCounter(), obj.getObjectID()); + ObjControllerMessage objController = new ObjControllerMessage(0x1B, dataTransform); + obj.notifyObservers(objController, true); + } + } else { + obj.setMovementCounter(obj.getMovementCounter() + 1); + DataTransformWithParent dataTransform = new DataTransformWithParent(new Point3D(position.x, position.y, position.z), orientation, obj.getMovementCounter(), obj.getObjectID(), cellId); ObjControllerMessage objController = new ObjControllerMessage(0x1B, dataTransform); obj.notifyObservers(objController, true); - } } @@ -686,7 +692,7 @@ public class SimulationService implements INetworkDispatch { for(Mesh3DTriangle tri : tris) { if(ray.intersectsTriangle(tri, distance) != null) { - System.out.println("Collided with " + object.getTemplate() + " X: " + object.getPosition().x + " Y: " + object.getPosition().y + " Z: " + object.getPosition().z); + // System.out.println("Collided with " + object.getTemplate() + " X: " + object.getPosition().x + " Y: " + object.getPosition().y + " Z: " + object.getPosition().z); return false; } @@ -708,7 +714,7 @@ public class SimulationService implements INetworkDispatch { return checkLineOfSightWorldToCell(obj1, obj2, cell); } - List segments = new ArrayList(); + /*List segments = new ArrayList(); Line3D.splitIntoSegments(new Vec3D(position1.x, position1.y + 1, position1.z), new Vec3D(position2.x, position2.y + 1, position2.z), (float) 0.5, segments, true); for(Vec3D segment : segments) { @@ -720,7 +726,7 @@ public class SimulationService implements INetworkDispatch { System.out.println("Collision with terrain"); return false; } - } + }*/ return true; @@ -767,7 +773,7 @@ public class SimulationService implements INetworkDispatch { for(Mesh3DTriangle tri : tris) { if(ray.intersectsTriangle(tri, distance) != null) { - System.out.println("Collision with: " + cell.name); + // System.out.println("Collision with: " + cell.name); return false; } diff --git a/src/services/combat/CombatCommands.java b/src/services/combat/CombatCommands.java index 1a30be6a..d1935736 100644 --- a/src/services/combat/CombatCommands.java +++ b/src/services/combat/CombatCommands.java @@ -417,6 +417,15 @@ public class CombatCommands { core.commandService.registerCombatCommand("me_traumatize_3"); core.commandService.registerCombatCommand("me_traumatize_4"); core.commandService.registerCombatCommand("me_traumatize_5"); + core.commandService.registerCombatCommand("me_stasis_1"); + core.commandService.registerCommand("me_stasis_self_1"); + core.commandService.registerCommand("me_drag_1"); + core.commandService.registerCommand("me_reckless_stimulation_1"); + core.commandService.registerCommand("me_reckless_stimulation_2"); + core.commandService.registerCommand("me_reckless_stimulation_3"); + core.commandService.registerCommand("me_reckless_stimulation_4"); + core.commandService.registerCommand("me_reckless_stimulation_5"); + core.commandService.registerCommand("me_reckless_stimulation_6"); // Officer diff --git a/src/services/combat/CombatService.java b/src/services/combat/CombatService.java index c6075034..8f67abfe 100644 --- a/src/services/combat/CombatService.java +++ b/src/services/combat/CombatService.java @@ -31,6 +31,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import org.apache.mina.core.buffer.IoBuffer; +import org.apache.mina.core.session.IoSession; import protocol.swg.ObjControllerMessage; import protocol.swg.PlayClientEffectLocMessage; @@ -76,12 +77,22 @@ public class CombatService implements INetworkDispatch { public void doCombat(final CreatureObject attacker, final TangibleObject target, final WeaponObject weapon, final CombatCommand command, final int actionCounter) { - - if(!applySpecialCost(attacker, weapon, command)) - return; + boolean success = true; if((command.getAttackType() == 0 || command.getAttackType() == 1 || command.getAttackType() == 3) && !attemptCombat(attacker, target)) + success = false; + + if(!applySpecialCost(attacker, weapon, command)) + success = false; + + if(!success) { + IoSession session = attacker.getClient().getSession(); + CommandEnqueueRemove commandRemove = new CommandEnqueueRemove(attacker.getObjectId(), actionCounter); + session.write(new ObjControllerMessage(0x0B, commandRemove).serialize()); + StartTask startTask = new StartTask(actionCounter, attacker.getObjectID(), command.getCommandCRC(), CRC.StringtoCRC(command.getCooldownGroup()), -1); + session.write(new ObjControllerMessage(0x0B, startTask).serialize()); return; + } /* // use preRun for delayed effects like officer orbital strike, grenades etc. if(FileUtilities.doesFileExist("scripts/commands/combat" + command.getCommandName() + ".py")) @@ -97,15 +108,16 @@ public class CombatService implements INetworkDispatch { target.notifyObservers(new PlayClientEffectLocMessage(command.getDelayAttackParticle(), target.getPlanet().getName(), target.getWorldPosition()), true); try { - Thread.sleep((long) command.getInitialAttackDelay()); + Thread.sleep((long) command.getInitialAttackDelay() * 1000); } catch (InterruptedException e) { e.printStackTrace(); } + } else if(command.getInitialAttackDelay() <= 0 && command.getDelayAttackInterval() > 0 && command.getDelayAttackLoops() <= 1) { try { - Thread.sleep((long) command.getDelayAttackInterval()); + Thread.sleep((long) command.getDelayAttackInterval() * 1000); } catch (InterruptedException e) { e.printStackTrace(); } @@ -160,6 +172,8 @@ public class CombatService implements INetworkDispatch { } + core.buffService.addBuffToCreature(attacker, command.getBuffNameSelf()); + } private void doAreaCombat(CreatureObject attacker, TangibleObject target, WeaponObject weapon, CombatCommand command, int actionCounter) { @@ -292,7 +306,7 @@ public class CombatService implements INetworkDispatch { if(mitigationType == HitType.GLANCE) { damage *= 0.4f; - } else if(mitigationType == HitType.EVASION) { + } else if(mitigationType == HitType.EVASION && attacker.getSkillMod("combat_evasion_value") != null) { float evasionValue = (attacker.getSkillMod("combat_evasion_value").getBase() / 4) / 100; damage *= (1 - evasionValue); @@ -313,6 +327,9 @@ public class CombatService implements INetworkDispatch { applyDamage(attacker, target, (int) damage); sendCombatPackets(attacker, target, weapon, command, actionCounter, damage, armorAbsorbed, hitType); + + if((hitType != HitType.MISS && hitType != HitType.DODGE && hitType != HitType.PARRY) || (command.getAddedDamage() == 0 && command.getPercentFromWeapon() == 0)) + core.buffService.addBuffToCreature(target, command.getBuffNameTarget()); if(FileUtilities.doesFileExist("scripts/commands/combat/" + command.getCommandName() + ".py")) core.scriptService.callScript("scripts/commands/combat/", command.getCommandName(), "run", core, attacker, target, null); @@ -329,7 +346,7 @@ public class CombatService implements INetworkDispatch { ObjControllerMessage objController = new ObjControllerMessage(0x1B, combatAction); attacker.notifyObserversInRange(objController, true, 125); - StartTask startTask = new StartTask(actionCounter, attacker.getObjectID(), command.getCommandCRC()); + StartTask startTask = new StartTask(actionCounter, attacker.getObjectID(), command.getCommandCRC(), CRC.StringtoCRC(command.getCooldownGroup()), command.getCooldown()); ObjControllerMessage objController2 = new ObjControllerMessage(0x0B, startTask); attacker.getClient().getSession().write(objController2.serialize()); @@ -346,6 +363,22 @@ public class CombatService implements INetworkDispatch { target.getClient().getSession().write(spam); + } + + private void sendHealPackets(CreatureObject attacker, CreatureObject target, WeaponObject weapon, CombatCommand command, int actionCounter) { + + CombatAction combatAction = new CombatAction(CRC.StringtoCRC(command.getDefaultAnimations()[0]), attacker.getObjectID(), weapon.getObjectID(), target.getObjectID(), command.getCommandCRC()); + ObjControllerMessage objController = new ObjControllerMessage(0x1B, combatAction); + attacker.notifyObserversInRange(objController, true, 125); + + StartTask startTask = new StartTask(actionCounter, attacker.getObjectID(), command.getCommandCRC(), CRC.StringtoCRC(command.getCooldownGroup()), command.getCooldown()); + ObjControllerMessage objController2 = new ObjControllerMessage(0x0B, startTask); + attacker.getClient().getSession().write(objController2.serialize()); + + CommandEnqueueRemove commandRemove = new CommandEnqueueRemove(attacker.getObjectID(), actionCounter); + ObjControllerMessage objController3 = new ObjControllerMessage(0x0B, commandRemove); + attacker.getClient().getSession().write(objController3.serialize()); + } private float getArmorReduction(CreatureObject attacker, CreatureObject target, WeaponObject weapon, CombatCommand command, byte hitType) { @@ -423,7 +456,7 @@ public class CombatService implements INetworkDispatch { } - private boolean applySpecialCost(CreatureObject attacker, WeaponObject weapon, CombatCommand command) { + public boolean applySpecialCost(CreatureObject attacker, WeaponObject weapon, CombatCommand command) { float actionCost = command.getActionCost(); float healthCost = command.getHealthCost(); @@ -493,7 +526,7 @@ public class CombatService implements INetworkDispatch { } if(target.getSkillMod("damage_decrease_percentage") != null) { - rawDamage *= (target.getSkillMod("damage_decrease_percentage").getBase() / 100); + rawDamage *= (1 - (target.getSkillMod("damage_decrease_percentage").getBase() / 100)); } return rawDamage; @@ -548,7 +581,7 @@ public class CombatService implements INetworkDispatch { public byte getHitType(CreatureObject attacker, CreatureObject target, WeaponObject weapon, CombatCommand command) { float r; - + Random random = new Random(); // negation rolls(parry, miss and dodge) can only roll on single target attacks, strikethrough also only rolls on single target attacks if(command.getAttackType() == 1) { @@ -560,13 +593,13 @@ public class CombatService implements INetworkDispatch { missNegation = 0.04f; missChance -= missNegation; } - r = new Random().nextFloat(); + r = random.nextFloat(); if(r <= missChance) return HitType.MISS; } float dodgeChance = (float) target.getSkillMod("display_only_dodge").getBase() / 10000; - r = new Random().nextFloat(); + r = random.nextFloat(); if(r <= dodgeChance) return HitType.DODGE; @@ -576,7 +609,7 @@ public class CombatService implements INetworkDispatch { float parryChance = (float) target.getSkillMod("display_only_parry").getBase() / 10000; - r = new Random().nextFloat(); + r = random.nextFloat(); if(r <= parryChance) return HitType.PARRY; @@ -584,14 +617,14 @@ public class CombatService implements INetworkDispatch { float stChance = (float) attacker.getSkillMod("display_only_strikethrough").getBase() / 10000; - r = new Random().nextFloat(); + r = random.nextFloat(); if(r <= stChance) return HitType.STRIKETHROUGH; } float critChance = (float) attacker.getSkillMod("display_only_critical").getBase() / 10000; - r = new Random().nextFloat(); + r = random.nextFloat(); if(r <= critChance) return HitType.CRITICAL; @@ -604,10 +637,11 @@ public class CombatService implements INetworkDispatch { public byte doMitigationRolls(CreatureObject attacker, CreatureObject target, WeaponObject weapon, CombatCommand command, byte hitType) { float r; + Random random = new Random(); float blockChance = (float) target.getSkillMod("display_only_block").getBase() / 10000; - r = new Random().nextFloat(); + r = random.nextFloat(); if(r <= blockChance) return HitType.BLOCK; @@ -615,7 +649,7 @@ public class CombatService implements INetworkDispatch { float evasionChance = (float) target.getSkillMod("display_only_evasion").getBase() / 10000; - r = new Random().nextFloat(); + r = random.nextFloat(); if(r <= evasionChance) return HitType.EVASION; @@ -625,12 +659,11 @@ public class CombatService implements INetworkDispatch { float glanceChance = (float) target.getSkillMod("display_only_glancing_blow").getBase() / 10000; - r = new Random().nextFloat(); + r = random.nextFloat(); if(r <= glanceChance) return HitType.GLANCE; } - return -1; @@ -723,35 +756,52 @@ public class CombatService implements INetworkDispatch { public void doHeal(CreatureObject healer, CreatureObject target, WeaponObject weapon, CombatCommand command, int actionCounter) { + boolean success = true; + + if(target.getMaxHealth() == target.getHealth()) + success = command.getAttackType() != 1; + if(!applySpecialCost(healer, weapon, command)) - return; + success = false; if((command.getAttackType() == 0 || command.getAttackType() == 1 || command.getAttackType() == 3) && !attemptHeal(healer, target)) + target = healer; + + if(!success) { + IoSession session = healer.getClient().getSession(); + CommandEnqueueRemove commandRemove = new CommandEnqueueRemove(healer.getObjectId(), actionCounter); + session.write(new ObjControllerMessage(0x0B, commandRemove).serialize()); + StartTask startTask = new StartTask(actionCounter, healer.getObjectID(), command.getCommandCRC(), CRC.StringtoCRC(command.getCooldownGroup()), -1); + session.write(new ObjControllerMessage(0x0B, startTask).serialize()); return; + } if(command.getAttackType() == 1) doSingleTargetHeal(healer, target, weapon, command, actionCounter); else if(command.getAttackType() == 0 || command.getAttackType() == 2 || command.getAttackType() == 3) doAreaHeal(healer, target, weapon, command, actionCounter); + sendHealPackets(healer, target, weapon, command, actionCounter); + } private void doSingleTargetHeal(CreatureObject healer, CreatureObject target, WeaponObject weapon, CombatCommand command, int actionCounter) { int healAmount = command.getAddedDamage(); + int healPotency = 0; - if(healer.getSkillMod("expertise_healing_all") != null) { - int healPotency = healer.getSkillMod("expertise_healing_all").getBase(); - if(healer.getSkillMod("expertise_healing_line_me_heal") != null) - healPotency += healer.getSkillMod("expertise_healing_line_me_heal").getBase(); - if(healer.getSkillMod("expertise_healing_line_of_heal") != null) - healPotency += healer.getSkillMod("expertise_healing_line_of_heal").getBase(); - if(healer.getSkillMod("expertise_healing_line_sm_heal") != null) - healPotency += healer.getSkillMod("expertise_healing_line_sm_heal").getBase(); - if(healer.getSkillMod("expertise_healing_line_sp_heal") != null) - healPotency += healer.getSkillMod("expertise_healing_line_sp_heal").getBase(); + if(healer.getSkillMod("expertise_healing_all") != null) + healPotency += healer.getSkillMod("expertise_healing_all").getBase(); + if(healer.getSkillMod("expertise_healing_line_me_heal") != null) + healPotency += healer.getSkillMod("expertise_healing_line_me_heal").getBase(); + if(healer.getSkillMod("expertise_healing_line_of_heal") != null) + healPotency += healer.getSkillMod("expertise_healing_line_of_heal").getBase(); + if(healer.getSkillMod("expertise_healing_line_sm_heal") != null) + healPotency += healer.getSkillMod("expertise_healing_line_sm_heal").getBase(); + if(healer.getSkillMod("expertise_healing_line_sp_heal") != null) + healPotency += healer.getSkillMod("expertise_healing_line_sp_heal").getBase(); + if(healPotency > 0) healAmount += (healAmount * (healPotency / 100)); - } synchronized(target.getMutex()) { target.setHealth(target.getHealth() + healAmount); diff --git a/src/services/command/CombatCommand.java b/src/services/command/CombatCommand.java index dd838491..444d0895 100644 --- a/src/services/command/CombatCommand.java +++ b/src/services/command/CombatCommand.java @@ -74,7 +74,10 @@ public class CombatCommand extends BaseSWGCommand { private float delayAttackInterval; private int delayAttackLoops; private int delayAttackEggPosition; - + private String cooldownGroup; + private float executeTime; + private float warmupTime; + private float vigorCost; // for commando kill meter and bm specials public CombatCommand(String commandName) { super(commandName); @@ -133,6 +136,7 @@ public class CombatCommand extends BaseSWGCommand { bypassArmor = (Float) visitor.getObject(i, 48); healthCost = (Float) visitor.getObject(i, 54); actionCost = (Float) visitor.getObject(i, 55); + setVigorCost((Float) visitor.getObject(i, 56)); dotType = (String) visitor.getObject(i, 60); dotIntensity = (Integer) visitor.getObject(i, 61); dotDuration = (Integer) visitor.getObject(i, 62); @@ -156,6 +160,21 @@ public class CombatCommand extends BaseSWGCommand { } } + DatatableVisitor visitor2 = ClientFileManager.loadFile("datatables/command/command_table.iff", DatatableVisitor.class); + + for(int i = 0; i < visitor2.getRowCount(); i++) { + if(visitor2.getObject(i, 0) != null) { + if(((String) visitor2.getObject(i, 0)).equalsIgnoreCase(commandName)) { + + cooldownGroup = (String) visitor2.getObject(i, 85); + warmupTime = (Float) visitor2.getObject(i, 86); + executeTime = (Float) visitor2.getObject(i, 87); + cooldown = (Float) visitor2.getObject(i, 88); + + } + } + } + } catch (InstantiationException | IllegalAccessException e) { e.printStackTrace(); } @@ -654,6 +673,38 @@ public class CombatCommand extends BaseSWGCommand { public void setDelayAttackLoops(int delayAttackLoops) { this.delayAttackLoops = delayAttackLoops; } + + public String getCooldownGroup() { + return cooldownGroup; + } + + public void setCooldownGroup(String cooldownGroup) { + this.cooldownGroup = cooldownGroup; + } + + public float getExecuteTime() { + return executeTime; + } + + public void setExecuteTime(float executeTime) { + this.executeTime = executeTime; + } + + public float getWarmupTime() { + return warmupTime; + } + + public void setWarmupTime(float warmupTime) { + this.warmupTime = warmupTime; + } + + public float getVigorCost() { + return vigorCost; + } + + public void setVigorCost(float vigorCost) { + this.vigorCost = vigorCost; + } diff --git a/src/services/command/CommandService.java b/src/services/command/CommandService.java index 3eaebc7c..e6c9293b 100644 --- a/src/services/command/CommandService.java +++ b/src/services/command/CommandService.java @@ -30,6 +30,7 @@ import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.session.IoSession; import engine.clients.Client; +import engine.resources.common.CRC; import engine.resources.objects.SWGObject; import engine.resources.scene.Point3D; import engine.resources.service.INetworkDispatch; @@ -40,6 +41,7 @@ import protocol.swg.ObjControllerMessage; import protocol.swg.objectControllerObjects.CommandEnqueue; import protocol.swg.objectControllerObjects.CommandEnqueueRemove; import protocol.swg.objectControllerObjects.ShowFlyText; +import protocol.swg.objectControllerObjects.StartTask; import resources.objects.creature.CreatureObject; import resources.objects.tangible.TangibleObject; @@ -138,12 +140,24 @@ public class CommandService implements INetworkDispatch { } + public BaseSWGCommand getCommandByName(String name) { + + Vector commands = new Vector(commandLookup); // copy for thread safety + + for(BaseSWGCommand command : commands) { + if(command.getCommandName().equalsIgnoreCase(name)) + return command; + } + return null; + + } + private void processCombatCommand(CreatureObject attacker, SWGObject target, CombatCommand command, int actionCounter, String commandArgs) { boolean success = true; - if((command.getHitType() == 5 || command.getHitType() == 7) && !(target instanceof CreatureObject)) - success = false; + //if((command.getHitType() == 5 || command.getHitType() == 7) && !(target instanceof CreatureObject)) + // success = false; if(!(command.getAttackType() == 2) && !(command.getHitType() == 5)) { if(target == null || !(target instanceof TangibleObject) || target == attacker) @@ -203,9 +217,11 @@ public class CommandService implements INetworkDispatch { } if(!success) { + IoSession session = attacker.getClient().getSession(); CommandEnqueueRemove commandRemove = new CommandEnqueueRemove(attacker.getObjectId(), actionCounter); - ObjControllerMessage objController = new ObjControllerMessage(0x0B, commandRemove); - attacker.getClient().getSession().write(objController.serialize()); + session.write(new ObjControllerMessage(0x0B, commandRemove).serialize()); + StartTask startTask = new StartTask(actionCounter, attacker.getObjectID(), command.getCommandCRC(), CRC.StringtoCRC(command.getCooldownGroup()), -1); + session.write(new ObjControllerMessage(0x0B, startTask).serialize()); } else { if(command.getHitType() == 5) { diff --git a/src/services/sui/SUIService.java b/src/services/sui/SUIService.java index 5d1c494a..9722b691 100644 --- a/src/services/sui/SUIService.java +++ b/src/services/sui/SUIService.java @@ -150,7 +150,7 @@ public class SUIService implements INetworkDispatch { PyObject func = window.getFunctionByEventId(suiEvent.getEventType()); if(func != null) - func.__call__(Py.java2py(core), Py.java2py(owner), Py.java2py(suiEvent.getEventType()), Py.java2py(suiEvent.getReturnList())); + func.__call__(Py.java2py(owner), Py.java2py(window), Py.java2py(suiEvent.getEventType()), Py.java2py(suiEvent.getReturnList())); SUICallback callback = window.getCallbackByEventId(suiEvent.getEventType());