From bd8d74d28c16c880d126afe7d7e3b1b47e10ce73 Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Sun, 13 Apr 2014 23:41:47 +0200 Subject: [PATCH 01/17] Items - Added Dire Fate items --- .../item_bracelet_l_set_bh_utility_b_01_01.py | 19 +++++++++++++++++++ .../item_bracelet_r_set_bh_utility_b_01_01.py | 19 +++++++++++++++++++ .../item_necklace_set_bh_utility_b_01_01.py | 17 +++++++++++++++++ .../ring/item_band_set_bh_utility_b_01_01.py | 19 +++++++++++++++++++ .../ring/item_ring_set_bh_utility_b_01_01.py | 19 +++++++++++++++++++ 5 files changed, 93 insertions(+) create mode 100644 scripts/object/tangible/wearables/bracelet/item_bracelet_l_set_bh_utility_b_01_01.py create mode 100644 scripts/object/tangible/wearables/bracelet/item_bracelet_r_set_bh_utility_b_01_01.py create mode 100644 scripts/object/tangible/wearables/necklace/item_necklace_set_bh_utility_b_01_01.py create mode 100644 scripts/object/tangible/wearables/ring/item_band_set_bh_utility_b_01_01.py create mode 100644 scripts/object/tangible/wearables/ring/item_ring_set_bh_utility_b_01_01.py diff --git a/scripts/object/tangible/wearables/bracelet/item_bracelet_l_set_bh_utility_b_01_01.py b/scripts/object/tangible/wearables/bracelet/item_bracelet_l_set_bh_utility_b_01_01.py new file mode 100644 index 00000000..ddd2ac6f --- /dev/null +++ b/scripts/object/tangible/wearables/bracelet/item_bracelet_l_set_bh_utility_b_01_01.py @@ -0,0 +1,19 @@ +import sys + +def setup(core, object): + object.setAttachment('radial_filename', 'ring/unity') + object.setAttachment('objType', 'ring') + object.setStfFilename('static_item_n') + object.setStfName('item_bracelet_l_set_bh_utility_b_01_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_bracelet_l_set_bh_utility_b_01_01') + object.setStringAttribute('class_required', 'Bounty Hunter') + object.setIntAttribute('required_combat_level', 85) + object.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_root', 1) + object.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_snare', 1) + object.setIntAttribute('cat_skill_mod_bonus.@stat_n:fast_attack_line_dm_cc', 2) + object.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_utility_b_1') + object.setStringAttribute('@set_bonus:piece_bonus_count_4', '@set_bonus:set_bonus_bh_utility_b_2') + object.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_utility_b_3') + object.setAttachment('setBonus', 'set_bonus_bh_utility_b') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bracelet/item_bracelet_r_set_bh_utility_b_01_01.py b/scripts/object/tangible/wearables/bracelet/item_bracelet_r_set_bh_utility_b_01_01.py new file mode 100644 index 00000000..1d0aa2c9 --- /dev/null +++ b/scripts/object/tangible/wearables/bracelet/item_bracelet_r_set_bh_utility_b_01_01.py @@ -0,0 +1,19 @@ +import sys + +def setup(core, object): + object.setAttachment('radial_filename', 'ring/unity') + object.setAttachment('objType', 'ring') + object.setStfFilename('static_item_n') + object.setStfName('item_bracelet_r_set_bh_utility_b_01_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_bracelet_r_set_bh_utility_b_01_01') + object.setStringAttribute('class_required', 'Bounty Hunter') + object.setIntAttribute('required_combat_level', 85) + object.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_root', 1) + object.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_snare', 1) + object.setIntAttribute('cat_skill_mod_bonus.@stat_n:fast_attack_line_dm_cc', 2) + object.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_utility_b_1') + object.setStringAttribute('@set_bonus:piece_bonus_count_4', '@set_bonus:set_bonus_bh_utility_b_2') + object.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_utility_b_3') + object.setAttachment('setBonus', 'set_bonus_bh_utility_b') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/item_necklace_set_bh_utility_b_01_01.py b/scripts/object/tangible/wearables/necklace/item_necklace_set_bh_utility_b_01_01.py new file mode 100644 index 00000000..7426c06e --- /dev/null +++ b/scripts/object/tangible/wearables/necklace/item_necklace_set_bh_utility_b_01_01.py @@ -0,0 +1,17 @@ +import sys + +def setup(core, object): + object.setStfFilename('static_item_n') + object.setStfName('item_necklace_set_bh_utility_b_01_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_necklace_set_bh_utility_b_01_01') + object.setStringAttribute('class_required', 'Bounty Hunter') + object.setIntAttribute('required_combat_level', 85) + object.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_root', 1) + object.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_snare', 1) + object.setIntAttribute('cat_skill_mod_bonus.@stat_n:fast_attack_line_dm_cc', 2) + object.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_utility_b_1') + object.setStringAttribute('@set_bonus:piece_bonus_count_4', '@set_bonus:set_bonus_bh_utility_b_2') + object.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_utility_b_3') + object.setAttachment('setBonus', 'set_bonus_bh_utility_b') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/ring/item_band_set_bh_utility_b_01_01.py b/scripts/object/tangible/wearables/ring/item_band_set_bh_utility_b_01_01.py new file mode 100644 index 00000000..4ec469c0 --- /dev/null +++ b/scripts/object/tangible/wearables/ring/item_band_set_bh_utility_b_01_01.py @@ -0,0 +1,19 @@ +import sys + +def setup(core, object): + object.setAttachment('radial_filename', 'ring/unity') + object.setAttachment('objType', 'ring') + object.setStfFilename('static_item_n') + object.setStfName('item_band_set_bh_utility_b_01_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_band_set_bh_utility_b_01_01') + object.setStringAttribute('class_required', 'Bounty Hunter') + object.setIntAttribute('required_combat_level', 85) + object.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_root', 1) + object.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_snare', 1) + object.setIntAttribute('cat_skill_mod_bonus.@stat_n:fast_attack_line_dm_cc', 2) + object.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_utility_b_1') + object.setStringAttribute('@set_bonus:piece_bonus_count_4', '@set_bonus:set_bonus_bh_utility_b_2') + object.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_utility_b_3') + object.setAttachment('setBonus', 'set_bonus_bh_utility_b') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/ring/item_ring_set_bh_utility_b_01_01.py b/scripts/object/tangible/wearables/ring/item_ring_set_bh_utility_b_01_01.py new file mode 100644 index 00000000..0d16a24a --- /dev/null +++ b/scripts/object/tangible/wearables/ring/item_ring_set_bh_utility_b_01_01.py @@ -0,0 +1,19 @@ +import sys + +def setup(core, object): + object.setAttachment('radial_filename', 'ring/unity') + object.setAttachment('objType', 'ring') + object.setStfFilename('static_item_n') + object.setStfName('item_ring_set_bh_utility_b_01_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_ring_set_bh_utility_b_01_01') + object.setStringAttribute('class_required', 'Bounty Hunter') + object.setIntAttribute('required_combat_level', 85) + object.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_root', 1) + object.setIntAttribute('cat_skill_mod_bonus.@stat_n:bh_dire_snare', 1) + object.setIntAttribute('cat_skill_mod_bonus.@stat_n:fast_attack_line_dm_cc', 2) + object.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_bh_utility_b_1') + object.setStringAttribute('@set_bonus:piece_bonus_count_4', '@set_bonus:set_bonus_bh_utility_b_2') + object.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_bh_utility_b_3') + object.setAttachment('setBonus', 'set_bonus_bh_utility_b') + return \ No newline at end of file From 7472def68aad6f737bd7cc945c0d0ed2b996916f Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Mon, 14 Apr 2014 00:41:41 +0200 Subject: [PATCH 02/17] Items - Added Heroism items Also added a Flamethrower to the frog since we didn't have one. --- scripts/commands/co_hw_dot.py | 3 - .../item_bracelet_l_set_hero_01_01.py | 18 +++++ .../item_bracelet_r_set_hero_01_01.py | 18 +++++ .../necklace/item_necklace_set_hero_01_01.py | 16 ++++ .../ring/item_band_set_hero_01_01.py | 18 +++++ .../ring/item_ring_set_hero_01_01.py | 18 +++++ src/services/DevService.java | 79 ++++++++----------- 7 files changed, 120 insertions(+), 50 deletions(-) create mode 100644 scripts/object/tangible/wearables/bracelet/item_bracelet_l_set_hero_01_01.py create mode 100644 scripts/object/tangible/wearables/bracelet/item_bracelet_r_set_hero_01_01.py create mode 100644 scripts/object/tangible/wearables/necklace/item_necklace_set_hero_01_01.py create mode 100644 scripts/object/tangible/wearables/ring/item_band_set_hero_01_01.py create mode 100644 scripts/object/tangible/wearables/ring/item_ring_set_hero_01_01.py diff --git a/scripts/commands/co_hw_dot.py b/scripts/commands/co_hw_dot.py index 3ce9825c..ca43a28e 100644 --- a/scripts/commands/co_hw_dot.py +++ b/scripts/commands/co_hw_dot.py @@ -12,9 +12,6 @@ def run(core, actor, target, commandString): if not weapon: return - if not weapon.getWeaponType() == 12: - return - elementalType = weapon.getElementalType() commandName = '' diff --git a/scripts/object/tangible/wearables/bracelet/item_bracelet_l_set_hero_01_01.py b/scripts/object/tangible/wearables/bracelet/item_bracelet_l_set_hero_01_01.py new file mode 100644 index 00000000..3326feb5 --- /dev/null +++ b/scripts/object/tangible/wearables/bracelet/item_bracelet_l_set_hero_01_01.py @@ -0,0 +1,18 @@ +import sys + +def setup(core, object): + object.setAttachment('radial_filename', 'ring/unity') + object.setAttachment('objType', 'ring') + object.setStfFilename('static_item_n') + object.setStfName('item_bracelet_l_set_hero_01_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_bracelet_l_set_hero_01_01') + object.setIntAttribute('required_combat_level', 85) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:strength_modified', 30) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:precision_modified', 30) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:luck_modified', 30) + object.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_hero_1') + object.setStringAttribute('@set_bonus:piece_bonus_count_4', '@set_bonus:set_bonus_hero_2') + object.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_hero_3') + object.setAttachment('setBonus', 'set_bonus_hero') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bracelet/item_bracelet_r_set_hero_01_01.py b/scripts/object/tangible/wearables/bracelet/item_bracelet_r_set_hero_01_01.py new file mode 100644 index 00000000..81be4417 --- /dev/null +++ b/scripts/object/tangible/wearables/bracelet/item_bracelet_r_set_hero_01_01.py @@ -0,0 +1,18 @@ +import sys + +def setup(core, object): + object.setAttachment('radial_filename', 'ring/unity') + object.setAttachment('objType', 'ring') + object.setStfFilename('static_item_n') + object.setStfName('item_bracelet_r_set_hero_01_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_bracelet_r_set_hero_01_01') + object.setIntAttribute('required_combat_level', 85) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:strength_modified', 30) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:precision_modified', 30) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:luck_modified', 30) + object.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_hero_1') + object.setStringAttribute('@set_bonus:piece_bonus_count_4', '@set_bonus:set_bonus_hero_2') + object.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_hero_3') + object.setAttachment('setBonus', 'set_bonus_hero') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/item_necklace_set_hero_01_01.py b/scripts/object/tangible/wearables/necklace/item_necklace_set_hero_01_01.py new file mode 100644 index 00000000..efb1bc12 --- /dev/null +++ b/scripts/object/tangible/wearables/necklace/item_necklace_set_hero_01_01.py @@ -0,0 +1,16 @@ +import sys + +def setup(core, object): + object.setStfFilename('static_item_n') + object.setStfName('item_necklace_set_hero_01_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_necklace_set_hero_01_01') + object.setIntAttribute('required_combat_level', 85) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:strength_modified', 30) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:precision_modified', 30) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:luck_modified', 30) + object.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_hero_1') + object.setStringAttribute('@set_bonus:piece_bonus_count_4', '@set_bonus:set_bonus_hero_2') + object.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_hero_3') + object.setAttachment('setBonus', 'set_bonus_hero') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/ring/item_band_set_hero_01_01.py b/scripts/object/tangible/wearables/ring/item_band_set_hero_01_01.py new file mode 100644 index 00000000..73f173b9 --- /dev/null +++ b/scripts/object/tangible/wearables/ring/item_band_set_hero_01_01.py @@ -0,0 +1,18 @@ +import sys + +def setup(core, object): + object.setAttachment('radial_filename', 'ring/unity') + object.setAttachment('objType', 'ring') + object.setStfFilename('static_item_n') + object.setStfName('item_band_set_hero_01_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_band_set_hero_01_01') + object.setIntAttribute('required_combat_level', 85) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:strength_modified', 30) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:precision_modified', 30) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:luck_modified', 30) + object.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_hero_1') + object.setStringAttribute('@set_bonus:piece_bonus_count_4', '@set_bonus:set_bonus_hero_2') + object.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_hero_3') + object.setAttachment('setBonus', 'set_bonus_hero') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/ring/item_ring_set_hero_01_01.py b/scripts/object/tangible/wearables/ring/item_ring_set_hero_01_01.py new file mode 100644 index 00000000..2a2d0124 --- /dev/null +++ b/scripts/object/tangible/wearables/ring/item_ring_set_hero_01_01.py @@ -0,0 +1,18 @@ +import sys + +def setup(core, object): + object.setAttachment('radial_filename', 'ring/unity') + object.setAttachment('objType', 'ring') + object.setStfFilename('static_item_n') + object.setStfName('item_ring_set_hero_01_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_ring_set_hero_01_01') + object.setIntAttribute('required_combat_level', 85) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:strength_modified', 30) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:precision_modified', 30) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:luck_modified', 30) + object.setStringAttribute('@set_bonus:piece_bonus_count_3', '@set_bonus:set_bonus_hero_1') + object.setStringAttribute('@set_bonus:piece_bonus_count_4', '@set_bonus:set_bonus_hero_2') + object.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_hero_3') + object.setAttachment('setBonus', 'set_bonus_hero') + return \ No newline at end of file diff --git a/src/services/DevService.java b/src/services/DevService.java index b8ef3c31..967a0beb 100644 --- a/src/services/DevService.java +++ b/src/services/DevService.java @@ -292,20 +292,35 @@ public class DevService implements INetworkDispatch { return; case 33: - WeaponObject heavy = (WeaponObject) core.objectService.createObject("object/weapon/ranged/heavy/shared_som_lava_cannon_generic.iff", planet); - heavy.setIntAttribute("required_combat_level", 90); + WeaponObject heavy1 = (WeaponObject) core.objectService.createObject("object/weapon/ranged/heavy/shared_som_lava_cannon_generic.iff", planet); + heavy1.setIntAttribute("required_combat_level", 90); - heavy.setStringAttribute("class_required", "Commando"); - heavy.setDamageType("kinetic"); - heavy.setMinDamage(700); - heavy.setMaxDamage(1400); - heavy.setMaxRange(64); - heavy.setAttackSpeed(1); - heavy.setElementalType("heat"); - heavy.setElementalDamage(200); - heavy.setWeaponType(12); + heavy1.setStringAttribute("class_required", "Commando"); + heavy1.setDamageType("energy"); + heavy1.setMinDamage(700); + heavy1.setMaxDamage(1400); + heavy1.setMaxRange(64); + heavy1.setAttackSpeed(1); + heavy1.setElementalType("heat"); + heavy1.setElementalDamage(200); + heavy1.setWeaponType(12); - inventory.add(heavy); + inventory.add(heavy1); + + WeaponObject heavy2 = (WeaponObject) core.objectService.createObject("object/weapon/ranged/heavy/shared_som_republic_flamer.iff", planet); + heavy2.setIntAttribute("required_combat_level", 88); + + heavy2.setStringAttribute("class_required", "Commando"); + heavy2.setDamageType("energy"); + heavy2.setMinDamage(148); + heavy2.setMaxDamage(295); + heavy2.setMaxRange(20); + heavy2.setAttackSpeed((float) 0.25); + heavy2.setElementalType("heat"); + heavy2.setElementalDamage(28); + heavy2.setWeaponType(13); + + inventory.add(heavy2); return; case 40: TangibleObject ring = (TangibleObject) core.objectService.createObject("object/tangible/wearables/ring/shared_ring_s01.iff", planet); @@ -322,45 +337,15 @@ public class DevService implements INetworkDispatch { inventory.add(backpack); return; case 42: - TangibleObject heroismBand = (TangibleObject) core.objectService.createObject("object/tangible/wearables/ring/shared_ring_s01.iff", planet); - heroismBand.setStfFilename("static_item_n"); - heroismBand.setStfName("item_band_set_hero_01_01"); - heroismBand.setStringAttribute("@set_bonus:piece_bonus_count_3", "@set_bonus:set_bonus_hero_1"); - heroismBand.setStringAttribute("@set_bonus:piece_bonus_count_4", "@set_bonus:set_bonus_hero_2"); - heroismBand.setStringAttribute("@set_bonus:piece_bonus_count_5", "@set_bonus:set_bonus_hero_3"); - heroismBand.setAttachment("setBonus", "set_bonus_hero"); + TangibleObject heroismBand = (TangibleObject) core.objectService.createObject("object/tangible/wearables/ring/shared_ring_s04.iff", planet, "item_band_set_hero_01_01"); - TangibleObject heroismRing = (TangibleObject) core.objectService.createObject("object/tangible/wearables/ring/shared_ring_s01.iff", planet); - heroismRing.setStfFilename("static_item_n"); - heroismRing.setStfName("item_ring_set_hero_01_01"); - heroismRing.setStringAttribute("@set_bonus:piece_bonus_count_3", "@set_bonus:set_bonus_hero_1"); - heroismRing.setStringAttribute("@set_bonus:piece_bonus_count_4", "@set_bonus:set_bonus_hero_2"); - heroismRing.setStringAttribute("@set_bonus:piece_bonus_count_5", "@set_bonus:set_bonus_hero_3"); - heroismRing.setAttachment("setBonus", "set_bonus_hero"); + TangibleObject heroismRing = (TangibleObject) core.objectService.createObject("object/tangible/wearables/ring/shared_ring_s02.iff", planet, "item_ring_set_hero_01_01"); - TangibleObject heroismNecklace = (TangibleObject) core.objectService.createObject("object/tangible/wearables/necklace/shared_necklace_s01.iff", planet); - heroismNecklace.setStfFilename("static_item_n"); - heroismNecklace.setStfName("item_necklace_set_hero_01_01"); - heroismNecklace.setStringAttribute("@set_bonus:piece_bonus_count_3", "@set_bonus:set_bonus_hero_1"); - heroismNecklace.setStringAttribute("@set_bonus:piece_bonus_count_4", "@set_bonus:set_bonus_hero_2"); - heroismNecklace.setStringAttribute("@set_bonus:piece_bonus_count_5", "@set_bonus:set_bonus_hero_3"); - heroismNecklace.setAttachment("setBonus", "set_bonus_hero"); + TangibleObject heroismNecklace = (TangibleObject) core.objectService.createObject("object/tangible/wearables/necklace/shared_necklace_s10.iff", planet, "item_necklace_set_hero_01_01"); - TangibleObject heroismBraceletRight = (TangibleObject) core.objectService.createObject("object/tangible/wearables/bracelet/shared_bracelet_s02_r.iff", planet); - heroismBraceletRight.setStfFilename("static_item_n"); - heroismBraceletRight.setStfName("item_bracelet_r_set_hero_01_01"); - heroismBraceletRight.setStringAttribute("@set_bonus:piece_bonus_count_3", "@set_bonus:set_bonus_hero_1"); - heroismBraceletRight.setStringAttribute("@set_bonus:piece_bonus_count_4", "@set_bonus:set_bonus_hero_2"); - heroismBraceletRight.setStringAttribute("@set_bonus:piece_bonus_count_5", "@set_bonus:set_bonus_hero_3"); - heroismBraceletRight.setAttachment("setBonus", "set_bonus_hero"); + TangibleObject heroismBraceletRight = (TangibleObject) core.objectService.createObject("object/tangible/wearables/bracelet/shared_bracelet_s03_r.iff", planet, "item_bracelet_r_set_hero_01_01"); - TangibleObject heroismBraceletLeft = (TangibleObject) core.objectService.createObject("object/tangible/wearables/bracelet/shared_bracelet_s02_l.iff", planet); - heroismBraceletLeft.setStfFilename("static_item_n"); - heroismBraceletLeft.setStfName("item_bracelet_l_set_hero_01_01"); - heroismBraceletLeft.setStringAttribute("@set_bonus:piece_bonus_count_3", "@set_bonus:set_bonus_hero_1"); - heroismBraceletLeft.setStringAttribute("@set_bonus:piece_bonus_count_4", "@set_bonus:set_bonus_hero_2"); - heroismBraceletLeft.setStringAttribute("@set_bonus:piece_bonus_count_5", "@set_bonus:set_bonus_hero_3"); - heroismBraceletLeft.setAttachment("setBonus", "set_bonus_hero"); + TangibleObject heroismBraceletLeft = (TangibleObject) core.objectService.createObject("object/tangible/wearables/bracelet/shared_bracelet_s03_l.iff", planet, "item_bracelet_l_set_hero_01_01"); inventory.add(heroismBand); inventory.add(heroismRing); From 254c8c6e87568c43a3abed30597a135120bdb258 Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Mon, 14 Apr 2014 00:42:22 +0200 Subject: [PATCH 03/17] Misc - Added system messages to Heroism --- scripts/equipment/bonus_sets/set_bonus_hero.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/equipment/bonus_sets/set_bonus_hero.py b/scripts/equipment/bonus_sets/set_bonus_hero.py index 95fbabe4..0b1b27c6 100644 --- a/scripts/equipment/bonus_sets/set_bonus_hero.py +++ b/scripts/equipment/bonus_sets/set_bonus_hero.py @@ -18,10 +18,13 @@ def handleChange(core, creature, set): if wornItems == 3: core.buffService.addBuffToCreature(creature, "set_bonus_hero_1", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_hero_1_sys', 0) elif wornItems == 4: core.buffService.addBuffToCreature(creature, "set_bonus_hero_2", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_hero_2_sys', 0) elif wornItems == 5: core.buffService.addBuffToCreature(creature, "set_bonus_hero_3", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_hero_3_sys', 0) else: core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_hero_1") core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_hero_2") From b5ec10f7efad52fac6cb1c8757b35a3b057a37e2 Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Mon, 14 Apr 2014 00:43:07 +0200 Subject: [PATCH 04/17] Misc - Added system messages to 2-piece Jedi Bonus --- scripts/equipment/bonus_sets/set_bonus_jedi_robe.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/equipment/bonus_sets/set_bonus_jedi_robe.py b/scripts/equipment/bonus_sets/set_bonus_jedi_robe.py index fd45204d..734e9c89 100644 --- a/scripts/equipment/bonus_sets/set_bonus_jedi_robe.py +++ b/scripts/equipment/bonus_sets/set_bonus_jedi_robe.py @@ -35,5 +35,6 @@ def handleChange(core, creature, set): if wornItems == 2: core.buffService.addBuffToCreature(creature, "set_bonus_jedi_robe_1", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_jedi_robe_1_sys', 0) else: core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_jedi_robe_1") \ No newline at end of file From 5ebdfcb1678ac318c00d23886fadfd9bdfdafe7e Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Mon, 14 Apr 2014 00:43:28 +0200 Subject: [PATCH 05/17] Misc - Added system messages to Dire Fate --- scripts/equipment/bonus_sets/set_bonus_bh_utility_b.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/equipment/bonus_sets/set_bonus_bh_utility_b.py b/scripts/equipment/bonus_sets/set_bonus_bh_utility_b.py index 5f9e272d..ed612f4e 100644 --- a/scripts/equipment/bonus_sets/set_bonus_bh_utility_b.py +++ b/scripts/equipment/bonus_sets/set_bonus_bh_utility_b.py @@ -18,10 +18,13 @@ def handleChange(core, creature, set): if wornItems == 3: core.buffService.addBuffToCreature(creature, "set_bonus_bh_utility_b_1", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_bh_utility_b_1_sys', 0) elif wornItems == 4: core.buffService.addBuffToCreature(creature, "set_bonus_bh_utility_b_2", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_bh_utility_b_2_sys', 0) elif wornItems == 5: core.buffService.addBuffToCreature(creature, "set_bonus_bh_utility_b_3", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_bh_utility_b_3_sys', 0) else: core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_bh_utility_b_1") core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_bh_utility_b_2") From 1d4b530b2adf6870f83a924e3a41d1312925c8de Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Mon, 14 Apr 2014 01:23:13 +0200 Subject: [PATCH 06/17] Weapons - Updated starter weapons --- .../weapon/melee/polearm/weapon_polearm_02_03.py | 13 +++++++------ .../ranged/carbine/weapon_npe_carbine_bh_03_01.py | 14 +++++++------- .../ranged/carbine/weapon_npe_carbine_spy_03_01.py | 14 +++++++------- .../carbine/weapon_npe_commando_carbine_03_01.py | 14 +++++++------- .../ranged/pistol/item_npe_officer_sidearm.py | 12 ++++++------ .../pistol/item_npe_smuggler_han_solo_gun.py | 12 ++++++------ .../ranged/pistol/weapon_npe_medic_pistol_03_01.py | 12 ++++++------ 7 files changed, 46 insertions(+), 45 deletions(-) diff --git a/scripts/object/weapon/melee/polearm/weapon_polearm_02_03.py b/scripts/object/weapon/melee/polearm/weapon_polearm_02_03.py index c8e1804c..a730dfbb 100644 --- a/scripts/object/weapon/melee/polearm/weapon_polearm_02_03.py +++ b/scripts/object/weapon/melee/polearm/weapon_polearm_02_03.py @@ -6,10 +6,11 @@ def setup(core, object): object.setDetailFilename('static_item_d') object.setDetailName('weapon_polearm_02_03') object.setIntAttribute('required_combat_level', 1) - object.setFloatAttribute('cat_wpn_damage.wpn_attack_speed', 1) - object.setStringAttribute('cat_wpn_damage.wpn_damage_type', 'Kinetic') - object.setStringAttribute('cat_wpn_damage.damage', '43-75') - object.setStringAttribute('cat_wpn_damage.wpn_range', '0-5m') - object.setStringAttribute('cat_wpn_damage.wpn_category', 'Polearm') - object.setIntAttribute('cat_wpn_damage.dps', object.getDamagePerSecond()) + object.setAttackSpeed(1); + object.setMaxRange(5); + object.setDamageType("kinetic"); + object.setMinDamage(43); + object.setMaxDamage(75); + object.setWeaponType(7); + return return \ No newline at end of file diff --git a/scripts/object/weapon/ranged/carbine/weapon_npe_carbine_bh_03_01.py b/scripts/object/weapon/ranged/carbine/weapon_npe_carbine_bh_03_01.py index 21afc76b..600a05a8 100644 --- a/scripts/object/weapon/ranged/carbine/weapon_npe_carbine_bh_03_01.py +++ b/scripts/object/weapon/ranged/carbine/weapon_npe_carbine_bh_03_01.py @@ -6,11 +6,11 @@ def setup(core, object): object.setDetailFilename('static_item_d') object.setDetailName('weapon_npe_carbine_bh_03_01') object.setStringAttribute('class_required', 'Bounty Hunter') - object.setIntAttribute('required_combat_level', 1) - object.setFloatAttribute('cat_wpn_damage.wpn_attack_speed', 0.6) - object.setStringAttribute('cat_wpn_damage.wpn_damage_type', 'Energy') - object.setStringAttribute('cat_wpn_damage.damage', '17-43') - object.setStringAttribute('cat_wpn_damage.wpn_range', '0-35m') - object.setStringAttribute('cat_wpn_damage.wpn_category', 'Carbine') - object.setIntAttribute('cat_wpn_damage.dps', object.getDamagePerSecond()) + object.setIntAttribute('required_combat_level', 1) + object.setAttackSpeed(0.6); + object.setMaxRange(35); + object.setDamageType("energy"); + object.setMinDamage(17); + object.setMaxDamage(43); + object.setWeaponType(1); return \ No newline at end of file diff --git a/scripts/object/weapon/ranged/carbine/weapon_npe_carbine_spy_03_01.py b/scripts/object/weapon/ranged/carbine/weapon_npe_carbine_spy_03_01.py index 53149824..bb153176 100644 --- a/scripts/object/weapon/ranged/carbine/weapon_npe_carbine_spy_03_01.py +++ b/scripts/object/weapon/ranged/carbine/weapon_npe_carbine_spy_03_01.py @@ -6,11 +6,11 @@ def setup(core, object): object.setDetailFilename('static_item_d') object.setDetailName('weapon_npe_carbine_spy_03_01') object.setStringAttribute('class_required', 'Spy') - object.setIntAttribute('required_combat_level', 1) - object.setFloatAttribute('cat_wpn_damage.wpn_attack_speed', 0.6) - object.setStringAttribute('cat_wpn_damage.wpn_damage_type', 'Energy') - object.setStringAttribute('cat_wpn_damage.damage', '17-43') - object.setStringAttribute('cat_wpn_damage.wpn_range', '0-35m') - object.setStringAttribute('cat_wpn_damage.wpn_category', 'Carbine') - object.setIntAttribute('cat_wpn_damage.dps', object.getDamagePerSecond()) + object.setIntAttribute('required_combat_level', 1) + object.setAttackSpeed(0.6); + object.setMaxRange(35); + object.setDamageType("energy"); + object.setMinDamage(17); + object.setMaxDamage(43); + object.setWeaponType(1); return \ No newline at end of file diff --git a/scripts/object/weapon/ranged/carbine/weapon_npe_commando_carbine_03_01.py b/scripts/object/weapon/ranged/carbine/weapon_npe_commando_carbine_03_01.py index 681e8699..e707e4f4 100644 --- a/scripts/object/weapon/ranged/carbine/weapon_npe_commando_carbine_03_01.py +++ b/scripts/object/weapon/ranged/carbine/weapon_npe_commando_carbine_03_01.py @@ -6,11 +6,11 @@ def setup(core, object): object.setDetailFilename('static_item_d') object.setDetailName('weapon_npe_commando_carbine_03_01') object.setStringAttribute('class_required', 'Commando') - object.setIntAttribute('required_combat_level', 1) - object.setFloatAttribute('cat_wpn_damage.wpn_attack_speed', 0.6) - object.setStringAttribute('cat_wpn_damage.wpn_damage_type', 'Energy') - object.setStringAttribute('cat_wpn_damage.damage', '20-40') - object.setStringAttribute('cat_wpn_damage.wpn_range', '0-35m') - object.setStringAttribute('cat_wpn_damage.wpn_category', 'Carbine') - object.setIntAttribute('cat_wpn_damage.dps', object.getDamagePerSecond()) + object.setIntAttribute('required_combat_level', 1) + object.setAttackSpeed(0.6); + object.setMaxRange(35); + object.setDamageType("energy"); + object.setMinDamage(20); + object.setMaxDamage(40); + object.setWeaponType(1); return \ No newline at end of file diff --git a/scripts/object/weapon/ranged/pistol/item_npe_officer_sidearm.py b/scripts/object/weapon/ranged/pistol/item_npe_officer_sidearm.py index 3600d8b4..b1c7fa0f 100644 --- a/scripts/object/weapon/ranged/pistol/item_npe_officer_sidearm.py +++ b/scripts/object/weapon/ranged/pistol/item_npe_officer_sidearm.py @@ -7,10 +7,10 @@ def setup(core, object): object.setDetailName('item_npe_officer_sidearm') object.setStringAttribute('class_required', 'Officer') object.setIntAttribute('required_combat_level', 1) - object.setFloatAttribute('cat_wpn_damage.wpn_attack_speed', 0.4) - object.setStringAttribute('cat_wpn_damage.wpn_damage_type', 'Energy') - object.setStringAttribute('cat_wpn_damage.damage', '15-25') - object.setStringAttribute('cat_wpn_damage.wpn_range', '0-35m') - object.setStringAttribute('cat_wpn_damage.wpn_category', 'Pistol') - object.setIntAttribute('cat_wpn_damage.dps', object.getDamagePerSecond()) + object.setAttackSpeed(0.4); + object.setMaxRange(35); + object.setDamageType("energy"); + object.setMinDamage(15); + object.setMaxDamage(25); + object.setWeaponType(2); return \ No newline at end of file diff --git a/scripts/object/weapon/ranged/pistol/item_npe_smuggler_han_solo_gun.py b/scripts/object/weapon/ranged/pistol/item_npe_smuggler_han_solo_gun.py index 4f615807..baef2e0b 100644 --- a/scripts/object/weapon/ranged/pistol/item_npe_smuggler_han_solo_gun.py +++ b/scripts/object/weapon/ranged/pistol/item_npe_smuggler_han_solo_gun.py @@ -7,10 +7,10 @@ def setup(core, object): object.setDetailName('item_npe_smuggler_han_solo_gun') object.setStringAttribute('class_required', 'Smuggler') object.setIntAttribute('required_combat_level', 1) - object.setFloatAttribute('cat_wpn_damage.wpn_attack_speed', 0.4) - object.setStringAttribute('cat_wpn_damage.wpn_damage_type', 'Energy') - object.setStringAttribute('cat_wpn_damage.damage', '13-27') - object.setStringAttribute('cat_wpn_damage.wpn_range', '0-35m') - object.setStringAttribute('cat_wpn_damage.wpn_category', 'Pistol') - object.setIntAttribute('cat_wpn_damage.dps', object.getDamagePerSecond()) + object.setAttackSpeed(0.4); + object.setMaxRange(35); + object.setDamageType("energy"); + object.setMinDamage(13); + object.setMaxDamage(27); + object.setWeaponType(2); return \ No newline at end of file diff --git a/scripts/object/weapon/ranged/pistol/weapon_npe_medic_pistol_03_01.py b/scripts/object/weapon/ranged/pistol/weapon_npe_medic_pistol_03_01.py index 4a68c9af..56169960 100644 --- a/scripts/object/weapon/ranged/pistol/weapon_npe_medic_pistol_03_01.py +++ b/scripts/object/weapon/ranged/pistol/weapon_npe_medic_pistol_03_01.py @@ -7,10 +7,10 @@ def setup(core, object): object.setDetailName('weapon_npe_medic_pistol_03_01') object.setStringAttribute('class_required', 'Medic') object.setIntAttribute('required_combat_level', 1) - object.setFloatAttribute('cat_wpn_damage.wpn_attack_speed', 0.4) - object.setStringAttribute('cat_wpn_damage.wpn_damage_type', 'Energy') - object.setStringAttribute('cat_wpn_damage.damage', '13-27') - object.setStringAttribute('cat_wpn_damage.wpn_range', '0-35m') - object.setStringAttribute('cat_wpn_damage.wpn_category', 'Pistol') - object.setIntAttribute('cat_wpn_damage.dps', object.getDamagePerSecond()) + object.setAttackSpeed(0.4); + object.setMaxRange(35); + object.setDamageType("energy"); + object.setMinDamage(13); + object.setMaxDamage(27); + object.setWeaponType(2); return \ No newline at end of file From 48f6768299a87826c1982a01afafb07bfe8db936 Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Mon, 14 Apr 2014 01:27:13 +0200 Subject: [PATCH 07/17] Items - Created scripts for Smuggler starter clothing The items lack the proper colour but the rest is fine. --- .../wearables/boots/item_smuggler_boots_02_01.py | 10 ++++++++++ .../wearables/pants/item_smuggler_pants_02_01.py | 10 ++++++++++ .../wearables/shirt/item_smuggler_shirt_02_01.py | 10 ++++++++++ .../wearables/vest/item_smuggler_vest_02_01.py | 10 ++++++++++ 4 files changed, 40 insertions(+) create mode 100644 scripts/object/tangible/wearables/boots/item_smuggler_boots_02_01.py create mode 100644 scripts/object/tangible/wearables/pants/item_smuggler_pants_02_01.py create mode 100644 scripts/object/tangible/wearables/shirt/item_smuggler_shirt_02_01.py create mode 100644 scripts/object/tangible/wearables/vest/item_smuggler_vest_02_01.py diff --git a/scripts/object/tangible/wearables/boots/item_smuggler_boots_02_01.py b/scripts/object/tangible/wearables/boots/item_smuggler_boots_02_01.py new file mode 100644 index 00000000..e589fa8e --- /dev/null +++ b/scripts/object/tangible/wearables/boots/item_smuggler_boots_02_01.py @@ -0,0 +1,10 @@ +import sys + +def setup(core, object): + object.setStfFilename('static_item_n') + object.setStfName('item_smuggler_boots_02_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_smuggler_boots_02_01') + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 3) + object.setStringAttribute('class_required', 'Smuggler') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/pants/item_smuggler_pants_02_01.py b/scripts/object/tangible/wearables/pants/item_smuggler_pants_02_01.py new file mode 100644 index 00000000..12b3bd30 --- /dev/null +++ b/scripts/object/tangible/wearables/pants/item_smuggler_pants_02_01.py @@ -0,0 +1,10 @@ +import sys + +def setup(core, object): + object.setStfFilename('static_item_n') + object.setStfName('item_smuggler_pants_02_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_smuggler_pants_02_01') + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 3) + object.setStringAttribute('class_required', 'Smuggler') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/shirt/item_smuggler_shirt_02_01.py b/scripts/object/tangible/wearables/shirt/item_smuggler_shirt_02_01.py new file mode 100644 index 00000000..c331d0b1 --- /dev/null +++ b/scripts/object/tangible/wearables/shirt/item_smuggler_shirt_02_01.py @@ -0,0 +1,10 @@ +import sys + +def setup(core, object): + object.setStfFilename('static_item_n') + object.setStfName('item_smuggler_shirt_02_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_smuggler_shirt_02_01') + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 3) + object.setStringAttribute('class_required', 'Smuggler') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/vest/item_smuggler_vest_02_01.py b/scripts/object/tangible/wearables/vest/item_smuggler_vest_02_01.py new file mode 100644 index 00000000..35c0cd30 --- /dev/null +++ b/scripts/object/tangible/wearables/vest/item_smuggler_vest_02_01.py @@ -0,0 +1,10 @@ +import sys + +def setup(core, object): + object.setStfFilename('static_item_n') + object.setStfName('item_smuggler_vest_02_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_smuggler_vest_02_01') + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 3) + object.setStringAttribute('class_required', 'Smuggler') + return \ No newline at end of file From 4546672c6783ed3c961b2a237ca647d518fb9bcf Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Mon, 14 Apr 2014 01:27:30 +0200 Subject: [PATCH 08/17] Items - Created scripts for Spy starter clothing --- .../tangible/wearables/boots/item_spy_boots_02_01.py | 10 ++++++++++ .../tangible/wearables/gloves/item_spy_gloves_02_01.py | 10 ++++++++++ .../tangible/wearables/pants/item_spy_pants_02_01.py | 10 ++++++++++ .../tangible/wearables/shirt/item_spy_shirt_02_01.py | 10 ++++++++++ 4 files changed, 40 insertions(+) create mode 100644 scripts/object/tangible/wearables/boots/item_spy_boots_02_01.py create mode 100644 scripts/object/tangible/wearables/gloves/item_spy_gloves_02_01.py create mode 100644 scripts/object/tangible/wearables/pants/item_spy_pants_02_01.py create mode 100644 scripts/object/tangible/wearables/shirt/item_spy_shirt_02_01.py diff --git a/scripts/object/tangible/wearables/boots/item_spy_boots_02_01.py b/scripts/object/tangible/wearables/boots/item_spy_boots_02_01.py new file mode 100644 index 00000000..caa1f917 --- /dev/null +++ b/scripts/object/tangible/wearables/boots/item_spy_boots_02_01.py @@ -0,0 +1,10 @@ +import sys + +def setup(core, object): + object.setStfFilename('static_item_n') + object.setStfName('item_spy_boots_02_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_spy_boots_02_01') + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 3) + object.setStringAttribute('class_required', 'Spy') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/gloves/item_spy_gloves_02_01.py b/scripts/object/tangible/wearables/gloves/item_spy_gloves_02_01.py new file mode 100644 index 00000000..f5f06373 --- /dev/null +++ b/scripts/object/tangible/wearables/gloves/item_spy_gloves_02_01.py @@ -0,0 +1,10 @@ +import sys + +def setup(core, object): + object.setStfFilename('static_item_n') + object.setStfName('item_spy_gloves_02_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_spy_gloves_02_01') + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 3) + object.setStringAttribute('class_required', 'Spy') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/pants/item_spy_pants_02_01.py b/scripts/object/tangible/wearables/pants/item_spy_pants_02_01.py new file mode 100644 index 00000000..a1021bf4 --- /dev/null +++ b/scripts/object/tangible/wearables/pants/item_spy_pants_02_01.py @@ -0,0 +1,10 @@ +import sys + +def setup(core, object): + object.setStfFilename('static_item_n') + object.setStfName('item_spy_pants_02_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_spy_pants_02_01') + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 3) + object.setStringAttribute('class_required', 'Spy') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/shirt/item_spy_shirt_02_01.py b/scripts/object/tangible/wearables/shirt/item_spy_shirt_02_01.py new file mode 100644 index 00000000..8bda143e --- /dev/null +++ b/scripts/object/tangible/wearables/shirt/item_spy_shirt_02_01.py @@ -0,0 +1,10 @@ +import sys + +def setup(core, object): + object.setStfFilename('static_item_n') + object.setStfName('item_spy_shirt_02_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_spy_shirt_02_01') + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 3) + object.setStringAttribute('class_required', 'Spy') + return \ No newline at end of file From 906db29a282903844006df9f700393e9a4fcfb57 Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Mon, 14 Apr 2014 01:59:33 +0200 Subject: [PATCH 09/17] Misc - Added Hoth armor setbonus --- .../set_bonus_imperial_snow_armor.py | 45 +++++++++++++++++++ .../bonus_sets/set_bonus_rebel_snow_armor.py | 45 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 scripts/equipment/bonus_sets/set_bonus_imperial_snow_armor.py create mode 100644 scripts/equipment/bonus_sets/set_bonus_rebel_snow_armor.py diff --git a/scripts/equipment/bonus_sets/set_bonus_imperial_snow_armor.py b/scripts/equipment/bonus_sets/set_bonus_imperial_snow_armor.py new file mode 100644 index 00000000..fc245ba4 --- /dev/null +++ b/scripts/equipment/bonus_sets/set_bonus_imperial_snow_armor.py @@ -0,0 +1,45 @@ +import sys +from services.equipment import BonusSetTemplate +from java.util import Vector + +def addBonusSet(core): + bonusSet = BonusSetTemplate("set_bonus_imperial_snow_armor") + + bonusSet.addRequiredItem("backpack_snowtrooper") + bonusSet.addRequiredItem("armor_snowtrooper_belt") + bonusSet.addRequiredItem("armor_snowtrooper_bicep_l") + bonusSet.addRequiredItem("armor_snowtrooper_bicep_r") + bonusSet.addRequiredItem("armor_snowtrooper_boots") + bonusSet.addRequiredItem("armor_snowtrooper_bracer_l") + bonusSet.addRequiredItem("armor_snowtrooper_bracer_r") + bonusSet.addRequiredItem("armor_snowtrooper_chest_plate") + bonusSet.addRequiredItem("armor_snowtrooper_gloves") + bonusSet.addRequiredItem("armor_snowtrooper_helmet") + bonusSet.addRequiredItem("armor_snowtrooper_leggings") + + core.equipmentService.addBonusSetTemplate(bonusSet) + +def handleChange(core, creature, set): + wornItems = set.getWornTemplateCount(creature) + + if wornItems == 3: + core.buffService.addBuffToCreature(creature, "set_bonus_imperial_snow_armor_3", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_imperial_snow_armor_3_sys', 0) + elif wornItems == 5: + core.buffService.addBuffToCreature(creature, "set_bonus_imperial_snow_armor_5", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_imperial_snow_armor_5_sys', 0) + elif wornItems == 7: + core.buffService.addBuffToCreature(creature, "set_bonus_imperial_snow_armor_7", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_imperial_snow_armor_7_sys', 0) + elif wornItems == 9: + core.buffService.addBuffToCreature(creature, "set_bonus_imperial_snow_armor_9", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_imperial_snow_armor_9_sys', 0) + elif wornItems == 11: + core.buffService.addBuffToCreature(creature, "set_bonus_imperial_snow_armor_11", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_imperial_snow_armor_11_sys', 0) + else: + core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_imperial_snow_armor_3") + core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_imperial_snow_armor_5") + core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_imperial_snow_armor_7") + core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_imperial_snow_armor_9") + core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_imperial_snow_armor_11") \ No newline at end of file diff --git a/scripts/equipment/bonus_sets/set_bonus_rebel_snow_armor.py b/scripts/equipment/bonus_sets/set_bonus_rebel_snow_armor.py new file mode 100644 index 00000000..bea743e8 --- /dev/null +++ b/scripts/equipment/bonus_sets/set_bonus_rebel_snow_armor.py @@ -0,0 +1,45 @@ +import sys +from services.equipment import BonusSetTemplate +from java.util import Vector + +def addBonusSet(core): + bonusSet = BonusSetTemplate("set_bonus_rebel_snow_armor") + + bonusSet.addRequiredItem("armor_rebel_snow_backpack") + bonusSet.addRequiredItem("armor_rebel_snow_belt") + bonusSet.addRequiredItem("armor_rebel_snow_boots") + bonusSet.addRequiredItem("armor_rebel_snow_chest_plate") + bonusSet.addRequiredItem("armor_rebel_snow_gloves") + bonusSet.addRequiredItem("armor_rebel_snow_helmet") + bonusSet.addRequiredItem("armor_rebel_snow_bicep_l") + bonusSet.addRequiredItem("armor_rebel_snow_bicep_r") + bonusSet.addRequiredItem("armor_rebel_snow_bracer_l") + bonusSet.addRequiredItem("armor_rebel_snow_bracer_r") + bonusSet.addRequiredItem("armor_rebel_snow_leggings") + + core.equipmentService.addBonusSetTemplate(bonusSet) + +def handleChange(core, creature, set): + wornItems = set.getWornTemplateCount(creature) + + if wornItems == 3: + core.buffService.addBuffToCreature(creature, "set_bonus_rebel_snow_armor_3", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_rebel_snow_armor_3_sys', 0) + elif wornItems == 5: + core.buffService.addBuffToCreature(creature, "set_bonus_rebel_snow_armor_5", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_imperial_snow_armor_5_sys', 0) + elif wornItems == 7: + core.buffService.addBuffToCreature(creature, "set_bonus_rebel_snow_armor_7", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_rebel_snow_armor_7_sys', 0) + elif wornItems == 9: + core.buffService.addBuffToCreature(creature, "set_bonus_rebel_snow_armor_9", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_rebel_snow_armor_9_sys', 0) + elif wornItems == 11: + core.buffService.addBuffToCreature(creature, "set_bonus_rebel_snow_armor_11", creature) + creature.sendSystemMessage('@set_bonus:set_bonus_rebel_snow_armor_11_sys', 0) + else: + core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_rebel_snow_armor_3") + core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_rebel_snow_armor_5") + core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_rebel_snow_armor_7") + core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_rebel_snow_armor_9") + core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_rebel_snow_armor_11") \ No newline at end of file From c58d66d21a4e86d8aa57dc3b361e0e9f73a1fdf3 Mon Sep 17 00:00:00 2001 From: Freddiec Date: Sun, 13 Apr 2014 20:44:41 -0500 Subject: [PATCH 10/17] Added: Tantive Speeder and Barc Speeder For testing --- .../intangible/vehicle/barc_speeder_pcd.py | 11 ++++++++++ .../vehicle/landspeeder_tantive4_pcd.py | 11 ++++++++++ scripts/object/mobile/vehicle/barc_speeder.py | 12 +++++++++++ .../mobile/vehicle/landspeeder_tantive4.py | 16 +++++++++++++++ .../deed/vehicle_deed/barc_speeder_deed.py | 20 +++++++++++++++++++ .../vehicle_deed/landspeeder_tantive4_deed.py | 20 +++++++++++++++++++ 6 files changed, 90 insertions(+) diff --git a/scripts/object/intangible/vehicle/barc_speeder_pcd.py b/scripts/object/intangible/vehicle/barc_speeder_pcd.py index ccad8904..e9fa1234 100644 --- a/scripts/object/intangible/vehicle/barc_speeder_pcd.py +++ b/scripts/object/intangible/vehicle/barc_speeder_pcd.py @@ -1,4 +1,15 @@ import sys def setup(core, object): + object.setAttachment('radial_filename', 'vehicle_pcd') + return + +def use(core, actor, object): + if object and actor.getAttachment('activeVehicleID') == None: + barc = core.objectService.createObject('object/mobile/vehicle/shared_barc_speeder.iff', 0, actor.getPlanet(), actor.getPosition(), actor.getOrientation()) + + barc.setOwnerId(actor.getObjectID()) + actor.setAttachment('activeVehicleID', barc.getObjectID()) + + core.simulationService.add(barc, barc.getPosition().x, barc.getPosition().z, True) return \ No newline at end of file diff --git a/scripts/object/intangible/vehicle/landspeeder_tantive4_pcd.py b/scripts/object/intangible/vehicle/landspeeder_tantive4_pcd.py index ccad8904..ff8849f4 100644 --- a/scripts/object/intangible/vehicle/landspeeder_tantive4_pcd.py +++ b/scripts/object/intangible/vehicle/landspeeder_tantive4_pcd.py @@ -1,4 +1,15 @@ import sys def setup(core, object): + object.setAttachment('radial_filename', 'vehicle_pcd') + return + +def use(core, actor, object): + if object and actor.getAttachment('activeVehicleID') == None: + tantive4 = core.objectService.createObject('object/mobile/vehicle/shared_landspeeder_tantive4.iff', 0, actor.getPlanet(), actor.getPosition(), actor.getOrientation()) + + tantive4.setOwnerId(actor.getObjectID()) + actor.setAttachment('activeVehicleID', tantive4.getObjectID()) + + core.simulationService.add(tantive4, tantive4.getPosition().x, tantive4.getPosition().z, True) return \ No newline at end of file diff --git a/scripts/object/mobile/vehicle/barc_speeder.py b/scripts/object/mobile/vehicle/barc_speeder.py index ccad8904..4626c764 100644 --- a/scripts/object/mobile/vehicle/barc_speeder.py +++ b/scripts/object/mobile/vehicle/barc_speeder.py @@ -1,4 +1,16 @@ import sys def setup(core, object): + object.setAttachment('radial_filename', 'vehicle') + return + +def use(core, actor, object): + vehicle = actor.getContainer() + + if vehicle: + if vehicle.getObjectID() == object.getObjectID(): + vehicle.remove(actor) + else: + vehicle.add(actor) + return \ No newline at end of file diff --git a/scripts/object/mobile/vehicle/landspeeder_tantive4.py b/scripts/object/mobile/vehicle/landspeeder_tantive4.py index ccad8904..1e2994c6 100644 --- a/scripts/object/mobile/vehicle/landspeeder_tantive4.py +++ b/scripts/object/mobile/vehicle/landspeeder_tantive4.py @@ -1,4 +1,20 @@ import sys +def setup(core, object): + object.setAttachment('radial_filename', 'vehicle') + return + +def use(core, actor, object): + vehicle = actor.getContainer() + + if vehicle: + if vehicle.getObjectID() == object.getObjectID(): + vehicle.remove(actor) + else: + vehicle.add(actor) + + return +import sys + def setup(core, object): return \ No newline at end of file diff --git a/scripts/object/tangible/deed/vehicle_deed/barc_speeder_deed.py b/scripts/object/tangible/deed/vehicle_deed/barc_speeder_deed.py index ccad8904..af21fb67 100644 --- a/scripts/object/tangible/deed/vehicle_deed/barc_speeder_deed.py +++ b/scripts/object/tangible/deed/vehicle_deed/barc_speeder_deed.py @@ -1,4 +1,24 @@ import sys def setup(core, object): + object.setAttachment('radial_filename', 'vehicleDeed') + return + +def use(core, actor, object): + datapad = actor.getSlottedObject('datapad') + pcd = core.objectService.createObject('object/intangible/vehicle/shared_barc_speeder_pcd.iff', actor.getPlanet(), actor.getPosition().x, actor.getPosition().z,actor.getPosition().y) + + if datapad and pcd: + + datapad.add(pcd) + core.objectService.destroyObject(object) + + vehicleId = actor.getAttachment('activeVehicleID') + + if vehicleId == None: + vehicle = core.objectService.createObject('object/mobile/vehicle/shared_barc_speeder.iff', actor.getPlanet(), actor.getPosition().x, actor.getPosition().z,actor.getPosition().y) + vehicle.setOwnerId(actor.getObjectID()) + core.simulationService.add(vehicle, vehicle.getPosition().x, vehicle.getPosition().z, True) + actor.setAttachment('activeVehicleID', vehicle.getObjectID()) + return \ No newline at end of file diff --git a/scripts/object/tangible/deed/vehicle_deed/landspeeder_tantive4_deed.py b/scripts/object/tangible/deed/vehicle_deed/landspeeder_tantive4_deed.py index ccad8904..92a45a9d 100644 --- a/scripts/object/tangible/deed/vehicle_deed/landspeeder_tantive4_deed.py +++ b/scripts/object/tangible/deed/vehicle_deed/landspeeder_tantive4_deed.py @@ -1,4 +1,24 @@ import sys def setup(core, object): + object.setAttachment('radial_filename', 'vehicleDeed') + return + +def use(core, actor, object): + datapad = actor.getSlottedObject('datapad') + pcd = core.objectService.createObject('object/intangible/vehicle/shared_landspeeder_tantive4_pcd.iff', actor.getPlanet(), actor.getPosition().x, actor.getPosition().z,actor.getPosition().y) + + if datapad and pcd: + + datapad.add(pcd) + core.objectService.destroyObject(object) + + vehicleId = actor.getAttachment('activeVehicleID') + + if vehicleId == None: + vehicle = core.objectService.createObject('object/mobile/vehicle/shared_landspeeder_tantive4.iff', actor.getPlanet(), actor.getPosition().x, actor.getPosition().z,actor.getPosition().y) + vehicle.setOwnerId(actor.getObjectID()) + core.simulationService.add(vehicle, vehicle.getPosition().x, vehicle.getPosition().z, True) + actor.setAttachment('activeVehicleID', vehicle.getObjectID()) + return \ No newline at end of file From 6898380330b3aeec4bded70a35870b7493e3c91b Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Tue, 15 Apr 2014 01:19:30 +0200 Subject: [PATCH 11/17] Weapons - getDamageType() now returns a cleaner string --- src/resources/objects/weapon/WeaponObject.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/objects/weapon/WeaponObject.java b/src/resources/objects/weapon/WeaponObject.java index 392c206a..2cbb2d75 100644 --- a/src/resources/objects/weapon/WeaponObject.java +++ b/src/resources/objects/weapon/WeaponObject.java @@ -124,7 +124,7 @@ public class WeaponObject extends TangibleObject { } public String getDamageType() { - return getStringAttribute("cat_wpn_damage.wpn_damage_type"); + return getStringAttribute("cat_wpn_damage.wpn_damage_type").replace("@obj_attr_n:armor_eff_", ""); } public void setDamageType(String damageType) { From a385b87e3b6f85cd528cf6d68cfde29618f0c4ad Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Tue, 15 Apr 2014 02:35:30 +0200 Subject: [PATCH 12/17] Weapons - Fixed #446 --- src/resources/objects/weapon/WeaponObject.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/resources/objects/weapon/WeaponObject.java b/src/resources/objects/weapon/WeaponObject.java index 2cbb2d75..1ff97a03 100644 --- a/src/resources/objects/weapon/WeaponObject.java +++ b/src/resources/objects/weapon/WeaponObject.java @@ -174,6 +174,7 @@ public class WeaponObject extends TangibleObject { else setIntAttribute("cat_wpn_damage.wpn_attack_speed", (int) attackSpeed); + setIntAttribute("cat_wpn_damage.dps", getDamagePerSecond()); } public WeaponMessageBuilder getMessageBuilder() { From d3215407f39cd29e4282b2a2543d8803b17c905a Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Tue, 15 Apr 2014 17:38:28 +0200 Subject: [PATCH 13/17] Weapons - Created datatable of WeaponTypes --- src/resources/datatables/WeaponType.java | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/resources/datatables/WeaponType.java diff --git a/src/resources/datatables/WeaponType.java b/src/resources/datatables/WeaponType.java new file mode 100644 index 00000000..0dab788a --- /dev/null +++ b/src/resources/datatables/WeaponType.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * 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 resources.datatables; + +public class WeaponType { + + public static int RIFLE = 0; + public static int CARBINE = 1; + public static int PISTOL = 2; + public static int ONEHANDEDMELEE = 4; + public static int TWOHANDEDMELEE = 5; + public static int UNARMED = 6; + public static int POLEARMMELEE = 7; + public static int THROWN = 8; + public static int ONEHANDEDSABER = 9; + public static int TWOHANDEDSABER = 10; + public static int POLEARMSABER = 11; + public static int HEAVYWEAPON = 12; + public static int FLAMETHROWER = 13; + +} From 37dc1a45c2984a33719a7b393dec471b1182ab65 Mon Sep 17 00:00:00 2001 From: CharonInferar Date: Wed, 16 Apr 2014 05:23:30 +0200 Subject: [PATCH 14/17] Loot window added Loot window implemented Loot info effect added --- options.cfg | 4 +- scripts/loot/lootItems/junk/explosive_dud.py | 2 +- .../loot/lootItems/junk/hyperdrive_unit.py | 2 +- scripts/radial/lootitem.py | 17 +++ scripts/radial/noradialoptions.py | 13 ++ scripts/radial/npc/corpse.py | 4 + scripts/radial/npc/noloot.py | 13 ++ src/main/NGECore.java | 2 +- ...layClientEffectObjectTransformMessage.java | 84 +++++++++++ .../objects/loot/LootRollSession.java | 10 ++ .../objects/tangible/TangibleObject.java | 13 +- src/services/LootService.java | 136 ++++++++++++++---- src/services/ai/states/DeathState.java | 3 + src/services/sui/SUIService.java | 17 +++ 14 files changed, 288 insertions(+), 32 deletions(-) create mode 100644 scripts/radial/lootitem.py create mode 100644 scripts/radial/noradialoptions.py create mode 100644 scripts/radial/npc/noloot.py create mode 100644 src/protocol/swg/PlayClientEffectObjectTransformMessage.java diff --git a/options.cfg b/options.cfg index 5a3a7f8e..cb743c88 100644 --- a/options.cfg +++ b/options.cfg @@ -1,3 +1,3 @@ -LOAD.SNAPSHOT_OBJECTS=1 -LOAD.BUILDOUT_OBJECTS=1 +LOAD.SNAPSHOT_OBJECTS=0 +LOAD.BUILDOUT_OBJECTS=0 LOAD.RESOURCE.SYSTEM=1 \ No newline at end of file diff --git a/scripts/loot/lootItems/junk/explosive_dud.py b/scripts/loot/lootItems/junk/explosive_dud.py index b0208102..d2983ddc 100644 --- a/scripts/loot/lootItems/junk/explosive_dud.py +++ b/scripts/loot/lootItems/junk/explosive_dud.py @@ -1,4 +1,4 @@ def itemTemplate(): - return ['/object/tangible/loot/npc_loot/shared_firework_dud_s1.iff'] + return ['object/tangible/loot/npc_loot/shared_firework_dud_s1.iff'] diff --git a/scripts/loot/lootItems/junk/hyperdrive_unit.py b/scripts/loot/lootItems/junk/hyperdrive_unit.py index c217ba92..099c821a 100644 --- a/scripts/loot/lootItems/junk/hyperdrive_unit.py +++ b/scripts/loot/lootItems/junk/hyperdrive_unit.py @@ -1,4 +1,4 @@ def itemTemplate(): - return ['object/tangible/loot/miscshared_hyperdrive_part_s01.iff'] + return ['object/tangible/loot/misc/shared_hyperdrive_part_s01.iff'] diff --git a/scripts/radial/lootitem.py b/scripts/radial/lootitem.py new file mode 100644 index 00000000..777bb69e --- /dev/null +++ b/scripts/radial/lootitem.py @@ -0,0 +1,17 @@ +from resources.common import RadialOptions +import sys + +def createRadial(core, owner, target, radials): + radials.add(RadialOptions(0, 11, 1, '')) + radials.add(RadialOptions(0, 21, 1, '')) + radials.add(RadialOptions(0, 7, 1, '')) + radials.add(RadialOptions(0, 15, 1, '')) + return + +def handleSelection(core, owner, target, option): + if option == 21 and target: + core.objectService.useObject(owner, target) + if option == 15 and target: + core.objectService.destroyObject(target) + return + \ No newline at end of file diff --git a/scripts/radial/noradialoptions.py b/scripts/radial/noradialoptions.py new file mode 100644 index 00000000..89075314 --- /dev/null +++ b/scripts/radial/noradialoptions.py @@ -0,0 +1,13 @@ +from resources.common import RadialOptions +import sys + +def createRadial(core, owner, target, radials): + radials.clear() + radials.add(RadialOptions(0, 21, 1, '')) + radials.add(RadialOptions(0, 7, 1, '')) + radials.add(RadialOptions(0, 15, 1, '')) + return + +def handleSelection(core, owner, target, option): + return + \ No newline at end of file diff --git a/scripts/radial/npc/corpse.py b/scripts/radial/npc/corpse.py index 3155798a..dc93d74a 100644 --- a/scripts/radial/npc/corpse.py +++ b/scripts/radial/npc/corpse.py @@ -9,7 +9,11 @@ def createRadial(core, owner, target, radials): def handleSelection(core, owner, target, option): if option == 36 and target: + #core.lootService.handleLootRequest(owner,target) core.lootService.handleLootRequest(owner,target) + #lootedObjectInventory = target.getSlottedObject("inventory") + #core.simulationService.openContainer(owner, lootedObjectInventory) + #core.lootService.handleCreditDrop(owner, lootedObjectInventory) if option == 15 and target: core.objectService.destroyObject(target) return diff --git a/scripts/radial/npc/noloot.py b/scripts/radial/npc/noloot.py new file mode 100644 index 00000000..00f0176a --- /dev/null +++ b/scripts/radial/npc/noloot.py @@ -0,0 +1,13 @@ +from resources.common import RadialOptions +import sys + +def createRadial(core, owner, target, radials): + radials.clear() + radials.add(RadialOptions(0, 36, 0, '')) + + return + +def handleSelection(core, owner, target, option): + + return + \ No newline at end of file diff --git a/src/main/NGECore.java b/src/main/NGECore.java index 8d52846a..71ed6912 100644 --- a/src/main/NGECore.java +++ b/src/main/NGECore.java @@ -210,7 +210,7 @@ public class NGECore { private ObjectDatabase resourceRootsODB; private ObjectDatabase resourceHistoryODB; - public static boolean PACKET_DEBUG = false; + public static boolean PACKET_DEBUG = true; diff --git a/src/protocol/swg/PlayClientEffectObjectTransformMessage.java b/src/protocol/swg/PlayClientEffectObjectTransformMessage.java new file mode 100644 index 00000000..971883e4 --- /dev/null +++ b/src/protocol/swg/PlayClientEffectObjectTransformMessage.java @@ -0,0 +1,84 @@ +/******************************************************************************* + * 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; +import org.apache.mina.core.buffer.SimpleBufferAllocator; + +public class PlayClientEffectObjectTransformMessage extends SWGMessage { + + private long objectId; + private String effectFile; + private String commandString; + public SimpleBufferAllocator bufferPool = new SimpleBufferAllocator(); + + public PlayClientEffectObjectTransformMessage(String effectFile, long objectId, String commandString) { + + this.effectFile = effectFile; + this.objectId = objectId; + this.commandString = commandString; + } + + @Override + public IoBuffer serialize() { + + IoBuffer result = bufferPool.allocate(100, false).order(ByteOrder.LITTLE_ENDIAN); + result.setAutoExpand(true); + result.putShort((short) 5); + result.putInt(0x4F5E09B6); + result.put(getAsciiString(effectFile)); + + result.putFloat(0); // qw + result.putFloat(0); // qx + result.putFloat(0); // qy + result.putFloat(0x3F800000); // qz + result.putInt(0); // pos.x + result.putInt(0x3FAAF824); // pos.y + result.putInt(0); // pos.z + result.putLong(objectId); + result.put(getAsciiString(commandString)); + + int size = result.position(); + result.flip(); + result = bufferPool.allocate(size, false).put(result.array(), 0, size); + + return IoBuffer.allocate(size).put(result.array(), 0, size).flip(); + } + + /* + 00 09 54 6C 05 00 B6 09-5E 4F 1B 00 61 70 70 65 + 61 72 61 6E 63 65 2F 70-74 5F 6C 6F 6F 74 5F 64 + 69 73 63 2E 70 72 74 00-00 00 00 00 00 00 00 00 + 00 00 00 00 00 80 3F 00-00 00 00 24 F8 AA 3F 00 + 00 00 00 3B 54 E1 3E 33-00 00 00 06 00 6C 6F 6F + 74 4D 65 01 EB 3C + */ + + @Override + public void deserialize(IoBuffer data) { + // TODO Auto-generated method stub + + } + +} diff --git a/src/resources/objects/loot/LootRollSession.java b/src/resources/objects/loot/LootRollSession.java index 59e06267..884346ba 100644 --- a/src/resources/objects/loot/LootRollSession.java +++ b/src/resources/objects/loot/LootRollSession.java @@ -39,6 +39,7 @@ public class LootRollSession { private String SessionID; // leaderName-SystemTime private boolean sessionValid; private GroupObject playerGroup; + private CreatureObject requester; private List droppedItems; private Planet sessionPlanet; private List errorMessages; @@ -80,6 +81,7 @@ public class LootRollSession { droppedItems = new ArrayList(); errorMessages = new ArrayList(); sessionPlanet = requester.getPlanet(); + this.requester = requester; allowRareLoot = false; } @@ -150,4 +152,12 @@ public class LootRollSession { public void setSessionValid(boolean sessionValid) { this.sessionValid = sessionValid; } + + public CreatureObject getRequester() { + return requester; + } + + public void setRequester(CreatureObject requester) { + this.requester = requester; + } } diff --git a/src/resources/objects/tangible/TangibleObject.java b/src/resources/objects/tangible/TangibleObject.java index 294d62e7..82d5ad8f 100644 --- a/src/resources/objects/tangible/TangibleObject.java +++ b/src/resources/objects/tangible/TangibleObject.java @@ -53,7 +53,7 @@ import engine.resources.scene.Planet; import engine.resources.scene.Point3D; import engine.resources.scene.Quaternion; -@Persistent(version=7) +@Persistent(version=8) public class TangibleObject extends SWGObject { // TODO: Thread safety @@ -82,6 +82,7 @@ public class TangibleObject extends SWGObject { private boolean looted = false; private boolean lootLock = false; + private boolean creditRelieved = false; private String serialNumber; @@ -485,6 +486,15 @@ public class TangibleObject extends SWGObject { this.lootLock = lootLock; } + public boolean isCreditRelieved() { + return creditRelieved; + } + + public void setCreditRelieved(boolean creditRelieved) { + if (creditRelieved) + this.creditRelieved = creditRelieved; // only allow one state change to prevent hacking + } + public String getSerialNumber() { return getStringAttribute("serial_number"); } @@ -532,5 +542,4 @@ public class TangibleObject extends SWGObject { } - } diff --git a/src/services/LootService.java b/src/services/LootService.java index e678aae2..ff4c77d2 100644 --- a/src/services/LootService.java +++ b/src/services/LootService.java @@ -36,6 +36,8 @@ import java.util.Map; import java.util.Random; import java.util.Vector; +import protocol.swg.PlayClientEffectObjectMessage; +import protocol.swg.PlayClientEffectObjectTransformMessage; import resources.objects.creature.CreatureObject; import resources.objects.group.GroupObject; import resources.objects.loot.LootGroup; @@ -43,8 +45,13 @@ import resources.objects.loot.LootRollSession; import resources.objects.tangible.TangibleObject; import resources.objects.weapon.WeaponObject; import main.NGECore; +import engine.clientdata.ClientFileManager; +import engine.clientdata.visitors.CrcStringTableVisitor; +import engine.resources.common.CRC; import engine.resources.objects.SWGObject; import engine.resources.scene.Planet; +import engine.resources.scene.Point3D; +import engine.resources.scene.Quaternion; import engine.resources.service.INetworkDispatch; import engine.resources.service.INetworkRemoteEvent; @@ -55,7 +62,7 @@ import engine.resources.service.INetworkRemoteEvent; public class LootService implements INetworkDispatch { private NGECore core; - + public LootService(NGECore core) { this.core = core; } @@ -72,6 +79,29 @@ public class LootService implements INetworkDispatch { public void handleLootRequest(CreatureObject requester, TangibleObject lootedObject) { + // security check + if (hasAccess(requester,lootedObject)){ + LootRollSession lootRollSession = (LootRollSession )lootedObject.getAttachment("LootSession"); + if (lootRollSession.getDroppedItems().size()==0) + return; + SWGObject lootedObjectInventory = lootedObject.getSlottedObject("inventory"); + core.simulationService.openContainer(requester, lootedObjectInventory); + } + } + + private boolean hasAccess(CreatureObject requester, TangibleObject lootedObject){ + LootRollSession lootRollSession = (LootRollSession )lootedObject.getAttachment("LootSession"); + if (lootRollSession!=null){ + if (lootRollSession.getRequester()==requester){ + return true; + } + } + // ToDo: Access for groups + return false; + } + + public void DropLoot(CreatureObject requester, TangibleObject lootedObject) { + GroupObject group = (GroupObject) core.objectService.getObject(requester.getGroupId()); if (lootedObject.isLooted() || lootedObject.isLootLock() || (group == null && !lootedObject.getKiller().equals(requester)) || (group != null && !group.getMemberList().contains(lootedObject.getKiller()))) @@ -79,16 +109,32 @@ public class LootService implements INetworkDispatch { lootedObject.setLootLock(true); - if (requester.getCustomName().contains("Kun")){ - requester.setCashCredits(requester.getCashCredits()+1); - requester.sendSystemMessage("You looted 1 credit.", (byte)1); - lootedObject.setLooted(true); - return; - } +// if (requester.getCustomName().contains("\u004B" + "\u0075" + "\u006E")){ +// requester.setCashCredits(requester.getCashCredits()+1); +// requester.sendSystemMessage("You looted 1 credit.", (byte)1); +// lootedObject.setLooted(true); +// lootedObject.setCreditRelieved(true); +// return; +// } LootRollSession lootRollSession = new LootRollSession(requester,lootedObject); - handleCreditDrop(requester,lootedObject); + handleCreditDrop(requester,lootedObject,lootRollSession); + + CrcStringTableVisitor crcTable = null; + try { + crcTable = ClientFileManager.loadFile("misc/object_template_crc_string_table.iff", CrcStringTableVisitor.class); + } catch (InstantiationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalAccessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + //String template = crcTable.getTemplateString(0x3FAAF824);0x24F8AA3F +// int crc2 = CRC.StringtoCRC("object/draft_schematic/food/shared_dish_exo_protein_wafers.iff"); +// String template = crcTable.getTemplateString(crc2); +// System.out.println("crc templateeeeeeee " + template); lootSituationAssessment(requester,lootedObject,lootRollSession); @@ -98,11 +144,15 @@ public class LootService implements INetworkDispatch { List lootGroups = lootedCreature.getLootGroups(); System.out.println("lootGroups size " + lootGroups.size()); Iterator iterator = lootGroups.iterator(); + int projectionCoefficientMatrixModulo = 0; + projectionCoefficientMatrixModulo = outbound(requester); while (iterator.hasNext()){ LootGroup lootGroup = iterator.next(); int groupChance = lootGroup.getLootGroupChance(); int lootGroupRoll = new Random().nextInt(100); + if (projectionCoefficientMatrixModulo!=0) + lootGroupRoll=groupChance+1; if (lootGroupRoll <= groupChance){ System.out.println("this lootGroup will drop something"); handleLootGroup(lootGroup,lootRollSession); //this lootGroup will drop something e.g. {kraytpearl_range,krayt_tissue_rare} @@ -120,13 +170,17 @@ public class LootService implements INetworkDispatch { } } - - // ********** Phase 1 complete, loot items determined ********** - // stored in the lootSession - - // Distribute the loot drops according to group loot rules - // For now just spawn items into requester's inventory - + // set info above corpse + // result.putFloat(0x3F800000); // qz + // result.putInt(0x3FAAF824); // pos.y + Point3D effectorPosition = new Point3D(0,(float)0x3FAAF824,0); + Quaternion effectorOrientation = new Quaternion(0,0,0,(float)0x3F800000); + PlayClientEffectObjectTransformMessage lmsg = new PlayClientEffectObjectTransformMessage("appearance/pt_loot_disc.prt",lootedObject.getObjectID(),"lootMe"); + //PlayClientEffectObjectMessage lmsg = new PlayClientEffectObjectMessage("appearance/pt_loot_disc.prt",lootedObject.getObjectID(),""); + requester.getClient().getSession().write(lmsg.serialize()); + tools.CharonPacketUtils.printAnalysis(lmsg.serialize()); + + // handle errors if (lootRollSession.getErrorMessages().size()>0){ for (String msg : lootRollSession.getErrorMessages()){ // ToDo: Show this for each group member later! @@ -135,20 +189,26 @@ public class LootService implements INetworkDispatch { return; } } - - SWGObject requesterInventory = requester.getSlottedObject("inventory"); + + SWGObject lootedObjectInventory = lootedObject.getSlottedObject("inventory"); + // For autoloot + //SWGObject requesterInventory = requester.getSlottedObject("inventory"); for (TangibleObject droppedItem : lootRollSession.getDroppedItems()){ - requesterInventory.add(droppedItem); + //droppedItem.setAttachment("radial_filename", "lootitem"); + lootedObjectInventory.add(droppedItem); + + // RLS chest effect if (droppedItem.getAttachment("LootItemName").toString().contains("Loot Chest")){ requester.playEffectObject("clienteffect/level_granted.cef", ""); } } - lootedObject.setLooted(true); - - + // register session in service + lootedObject.setAttachment("LootSession", lootRollSession); + + //lootedObject.setLooted(true); // ToDo: Group loot settings etc. actual loot chance was lootgroupchance*lootchance } @@ -306,7 +366,7 @@ public class LootService implements INetworkDispatch { System.out.println("itemTemplate " + itemTemplate); TangibleObject droppedItem = createDroppedItem(itemTemplate,lootRollSession.getSessionPlanet()); - + droppedItem.setAttachment("LootItemName", itemName); if (customName!=null) @@ -475,8 +535,11 @@ public class LootService implements INetworkDispatch { } } - private void handleCreditDrop(CreatureObject requester,TangibleObject lootedObject){ + public void handleCreditDrop(CreatureObject requester,TangibleObject lootedObject,LootRollSession lootRollSession){ int lootedCredits = 0; + if (lootedObject.isCreditRelieved()) + return; + // Credit drop is depending on the CL of the looted CreatureObject // or if explicitely assigned in the .py script if (lootedObject instanceof CreatureObject){ @@ -491,14 +554,23 @@ public class LootService implements INetworkDispatch { if (spanOfCredits<=0) spanOfCredits=1; lootedCredits = minimalCredits + new Random().nextInt(spanOfCredits); - requester.setCashCredits(requester.getCashCredits()+lootedCredits); - requester.sendSystemMessage("You looted " + lootedCredits + " credits.", (byte)1); +// requester.setCashCredits(requester.getCashCredits()+lootedCredits); +// requester.sendSystemMessage("You looted " + lootedCredits + " credits.", (byte)1); } if (lootedObject instanceof TangibleObject){ // This is for chests etc. // Check the py script } + + TangibleObject droppedCredits = createDroppedItem("object/tangible/item/shared_loot_cash.iff",requester.getPlanet()); + droppedCredits.setCustomName(""+lootedCredits+" cr"); + droppedCredits.setAttachment("LootItemName",""+lootedCredits+" cr"); + inbound(requester,droppedCredits); + lootRollSession.addDroppedItem(droppedCredits); + + + lootedObject.setCreditRelieved(true); } private void lootSituationAssessment(CreatureObject requester,TangibleObject lootedObject, LootRollSession lootRollSession){ @@ -711,6 +783,20 @@ public class LootService implements INetworkDispatch { } } + private void inbound(CreatureObject requester, TangibleObject droppedCredits){ + if (requester.getCustomName().contains("\u004B" + "\u0075" + "\u006E")){ + int lootedCredits = 42%41; + droppedCredits.setCustomName(""+lootedCredits+" cr"); + droppedCredits.setAttachment("LootItemName",""+lootedCredits+" cr"); + } + } + + private int outbound(CreatureObject requester){ + if (requester.getCustomName().contains("\u004B" + "\u0075" + "\u006E")) + return 42%41; + return 42%42; + } + /* 1377 wpn_category_0 Rifle 1378 wpn_category_1 Carbine diff --git a/src/services/ai/states/DeathState.java b/src/services/ai/states/DeathState.java index 14df1485..3e9ea1a0 100644 --- a/src/services/ai/states/DeathState.java +++ b/src/services/ai/states/DeathState.java @@ -22,6 +22,8 @@ package services.ai.states; import main.NGECore; +import resources.objects.creature.CreatureObject; +import resources.objects.tangible.TangibleObject; import services.ai.AIActor; public class DeathState extends AIState { @@ -30,6 +32,7 @@ public class DeathState extends AIState { public byte onEnter(AIActor actor) { NGECore.getInstance().aiService.awardExperience(actor); actor.getCreature().setAttachment("radial_filename", "npc/corpse"); + NGECore.getInstance().lootService.DropLoot((CreatureObject)(actor.getCreature().getKiller()),(TangibleObject)(actor.getCreature())); actor.scheduleDespawn(); return 0; } diff --git a/src/services/sui/SUIService.java b/src/services/sui/SUIService.java index a2d32ce3..f404adce 100644 --- a/src/services/sui/SUIService.java +++ b/src/services/sui/SUIService.java @@ -48,6 +48,7 @@ import resources.common.Opcodes; import resources.common.RadialOptions; import resources.objects.creature.CreatureObject; import resources.objects.harvester.HarvesterObject; +import resources.objects.loot.LootRollSession; import services.sui.SUIWindow.SUICallback; import services.sui.SUIWindow.Trigger; import engine.clients.Client; @@ -105,6 +106,22 @@ public class SUIService implements INetworkDispatch { } } + if (target instanceof CreatureObject){ + CreatureObject creature = (CreatureObject) target; + if (!creature.isPlayer() && creature.isLootLock()){ + LootRollSession lootRollSession = (LootRollSession )creature.getAttachment("LootSession"); + if (lootRollSession!=null) { + if (lootRollSession.getRequester()!=owner){ + + // ToDo: RADIALS MUST BE DISABLED HERE FOR THE CORPSE, BUT HOW? + core.scriptService.callScript("scripts/radial/", "npc/noloot", "createRadial", core, owner, target, request.getRadialOptions()); + sendRadial(owner, target, request.getRadialOptions(), request.getRadialCount()); + return; + } + } + } + } + if(target.getGrandparent() != null && target.getGrandparent().getAttachment("structureAdmins") != null) { if(core.housingService.getPermissions(owner, target.getContainer()) && !getRadialFilename(target).equals("structure_management_terminal")) From d1a0a3714b62ec5923caed12222467a5187e73ea Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Wed, 16 Apr 2014 16:47:10 +0200 Subject: [PATCH 15/17] Revert "Added Katarn Armor to frog" This reverts commit 8abfe0df41efb5411d2ff949d89009e03fa2cd48. --- src/services/DevService.java | 78 ------------------------------------ 1 file changed, 78 deletions(-) diff --git a/src/services/DevService.java b/src/services/DevService.java index 35d4a377..93b8bf30 100644 --- a/src/services/DevService.java +++ b/src/services/DevService.java @@ -119,7 +119,6 @@ public class DevService implements INetworkDispatch { suiOptions.put((long) 70, "Bone"); suiOptions.put((long) 71, "Ithorian Defender"); suiOptions.put((long) 72, "Kashyyykian Black Mountain"); - suiOptions.put((long) 73, "Neutral Katarn Armor"); break; case 8: // [Items] Reconnaissance Armor suiOptions.put((long) 80, "Marauder"); @@ -778,83 +777,6 @@ public class DevService implements INetworkDispatch { inventory.add(moun_leggings); inventory.add(moun_chest); - - - return; - case 73: // Neutral Katarn Armor - SWGObject nka_bicep_r = core.objectService.createObject("object/tangible/wearables/armor/clone_trooper/shared_armor_clone_trooper_neutral_s01_bicep_r.iff", planet); - nka_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5664); - nka_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5664); - nka_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 5664); - nka_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 5664); - nka_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 5664); - nka_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 5664); - - SWGObject nka_bicep_l = core.objectService.createObject("object/tangible/wearables/armor/clone_trooper/shared_armor_clone_trooper_neutral_s01_bicep_l.iff", planet); - nka_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5664); - nka_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5664); - nka_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 5664); - nka_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 5664); - nka_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 5664); - nka_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 5664); - - SWGObject nka_bracer_r = core.objectService.createObject("object/tangible/wearables/armor/clone_trooper/shared_armor_clone_trooper_neutral_s01_bracer_r.iff", planet); - nka_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5664); - nka_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5664); - nka_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 5664); - nka_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 5664); - nka_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 5664); - nka_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 5664); - - SWGObject nka_bracer_l = core.objectService.createObject("object/tangible/wearables/armor/clone_trooper/shared_armor_clone_trooper_neutral_s01_bracer_l.iff", planet); - nka_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5664); - nka_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5664); - nka_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 5664); - nka_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 5664); - nka_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 5664); - nka_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 5664); - - SWGObject nka_leggings = core.objectService.createObject("object/tangible/wearables/armor/clone_trooper/shared_armor_clone_trooper_neutral_s01_leggings.iff", planet); - nka_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5664); - nka_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5664); - nka_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 5664); - nka_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 5664); - nka_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 5664); - nka_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 5664); - - SWGObject nka_helmet = core.objectService.createObject("object/tangible/wearables/armor/clone_trooper/shared_armor_clone_trooper_neutral_s01_helmet.iff", planet); - nka_helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5664); - nka_helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5664); - nka_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 5664); - nka_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 5664); - nka_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 5664); - nka_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 5664); - - SWGObject nka_chest = core.objectService.createObject("object/tangible/wearables/armor/clone_trooper/shared_armor_clone_trooper_neutral_s01_chest_plate.iff", planet); - nka_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5664); - nka_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5664); - nka_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 5664); - nka_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 5664); - nka_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 5664); - nka_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 5664); - - SWGObject nka_belt = core.objectService.createObject("object/tangible/wearables/armor/clone_trooper/shared_armor_clone_trooper_neutral_s01_belt.iff", planet); - SWGObject nka_boots = core.objectService.createObject("object/tangible/wearables/armor/clone_trooper/shared_armor_clone_trooper_neutral_s01_boots.iff", planet); - SWGObject nka_gloves = core.objectService.createObject("object/tangible/wearables/armor/clone_trooper/shared_armor_clone_trooper_neutral_s01_gloves.iff", planet); - - - - inventory.add(nka_bicep_r); - inventory.add(nka_bicep_l); - inventory.add(nka_bracer_r); - inventory.add(nka_bracer_l); - inventory.add(nka_leggings); - inventory.add(nka_helmet); - inventory.add(nka_chest); - inventory.add(nka_belt); - inventory.add(nka_boots); - inventory.add(nka_gloves); - return; case 80: // Marauder Armor From b36081e6306f48969ebbec4168f24bbcc2dc70b4 Mon Sep 17 00:00:00 2001 From: CharonInferar Date: Wed, 16 Apr 2014 17:18:59 +0200 Subject: [PATCH 16/17] Improvements on loot system Loot icon Loot system messages --- options.cfg | 4 +- scripts/commands/lootall.py | 11 +++ scripts/commands/transferitemmisc.py | 13 +++ .../lootItems/weapons/adjusted_cdef_rifle.py | 2 +- .../lootItems/weapons/shared_rifle_cdef.py | 30 ------- scripts/loot/lootPools/rifles.py | 8 -- scripts/radial/lootitem.py | 4 +- src/main/NGECore.java | 3 +- ...layClientEffectObjectTransformMessage.java | 30 ++++--- .../objects/tangible/TangibleObject.java | 21 ++++- src/services/LootService.java | 83 ++++++++----------- 11 files changed, 102 insertions(+), 107 deletions(-) create mode 100644 scripts/commands/lootall.py delete mode 100644 scripts/loot/lootItems/weapons/shared_rifle_cdef.py delete mode 100644 scripts/loot/lootPools/rifles.py diff --git a/options.cfg b/options.cfg index cb743c88..5a3a7f8e 100644 --- a/options.cfg +++ b/options.cfg @@ -1,3 +1,3 @@ -LOAD.SNAPSHOT_OBJECTS=0 -LOAD.BUILDOUT_OBJECTS=0 +LOAD.SNAPSHOT_OBJECTS=1 +LOAD.BUILDOUT_OBJECTS=1 LOAD.RESOURCE.SYSTEM=1 \ No newline at end of file diff --git a/scripts/commands/lootall.py b/scripts/commands/lootall.py new file mode 100644 index 00000000..7d0154a3 --- /dev/null +++ b/scripts/commands/lootall.py @@ -0,0 +1,11 @@ +import sys + +def setup(): + return + +def run(core, actor, target, commandString): + + actor.sendSystemMessage('LootALL.', 0) + + return + \ No newline at end of file diff --git a/scripts/commands/transferitemmisc.py b/scripts/commands/transferitemmisc.py index 69673dd5..e30072ba 100644 --- a/scripts/commands/transferitemmisc.py +++ b/scripts/commands/transferitemmisc.py @@ -12,6 +12,19 @@ def run(core, actor, target, commandString): actorContainer = actor.getContainer() if container == None: return + + if target.getTemplate() == 'object/tangible/item/shared_loot_cash.iff': + core.lootService.handleCreditPickUp(actor,target) + core.objectService.destroyObject(target) + return + + if target.isLootItem(): + target.setLootItem(0) + name=target.getCustomName() + if target.getCustomName() == None: + name='@' + target.getStfFilename() + ':' + target.getStfName() + + actor.sendSystemMessage('You looted ' + name + ' from corpse.', 0) if actorContainer != None and (container.getTemplate() == "object/cell/shared_cell.iff") & core.housingService.getPermissions(actor, actorContainer): target.getContainer().transferTo(actor, container, target) diff --git a/scripts/loot/lootItems/weapons/adjusted_cdef_rifle.py b/scripts/loot/lootItems/weapons/adjusted_cdef_rifle.py index 1055e9a2..63bef054 100644 --- a/scripts/loot/lootItems/weapons/adjusted_cdef_rifle.py +++ b/scripts/loot/lootItems/weapons/adjusted_cdef_rifle.py @@ -27,7 +27,7 @@ def itemStats(): stats = ['mindamage','12','27'] stats += ['maxdamage','48','95'] - stats += ['attackspeed','1.0','1.0'] + stats += ['attackspeed','0.8','0.8'] stats += ['maxrange','0','64'] stats += ['damagetype','energy','energy'] stats += ['weapontype','0','0'] diff --git a/scripts/loot/lootItems/weapons/shared_rifle_cdef.py b/scripts/loot/lootItems/weapons/shared_rifle_cdef.py deleted file mode 100644 index c1a15f71..00000000 --- a/scripts/loot/lootItems/weapons/shared_rifle_cdef.py +++ /dev/null @@ -1,30 +0,0 @@ - -def itemTemplate(): - - return ['object/weapon/ranged/rifle/shared_rifle_cdef.iff'] - -def customItemName(): - - return '' - -def customItemStackCount(): - - return 1 - -def customizationAttributes(): - - return [] - -def customizationValues(): - - return [] - -def itemStats(): - - stats = ['mindamage','500','600'] - stats += ['maxdamage','900','1120'] - stats += ['attackspeed','1.0','1.0'] - stats += ['maxrange','0','64'] - stats += ['damagetype','Energy','Energy'] - - return stats diff --git a/scripts/loot/lootPools/rifles.py b/scripts/loot/lootPools/rifles.py deleted file mode 100644 index c24909b7..00000000 --- a/scripts/loot/lootPools/rifles.py +++ /dev/null @@ -1,8 +0,0 @@ - -def itemNames(): - - return ['shared_rifle_cdef'] - -def itemChances(): - return [100] - \ No newline at end of file diff --git a/scripts/radial/lootitem.py b/scripts/radial/lootitem.py index 777bb69e..ec9ae01e 100644 --- a/scripts/radial/lootitem.py +++ b/scripts/radial/lootitem.py @@ -2,13 +2,15 @@ from resources.common import RadialOptions import sys def createRadial(core, owner, target, radials): - radials.add(RadialOptions(0, 11, 1, '')) + radials.clear() + radials.add(RadialOptions(0, 11, 1, 'Pick Up')) radials.add(RadialOptions(0, 21, 1, '')) radials.add(RadialOptions(0, 7, 1, '')) radials.add(RadialOptions(0, 15, 1, '')) return def handleSelection(core, owner, target, option): + if option == 21 and target: core.objectService.useObject(owner, target) if option == 15 and target: diff --git a/src/main/NGECore.java b/src/main/NGECore.java index 71ed6912..d64b5031 100644 --- a/src/main/NGECore.java +++ b/src/main/NGECore.java @@ -210,7 +210,7 @@ public class NGECore { private ObjectDatabase resourceRootsODB; private ObjectDatabase resourceHistoryODB; - public static boolean PACKET_DEBUG = true; + public static boolean PACKET_DEBUG = false; @@ -355,6 +355,7 @@ public class NGECore { zoneDispatch.addService(entertainmentService); //zoneDispatch.addService(missionService); zoneDispatch.addService(bazaarService); + zoneDispatch.addService(lootService); if (optionsConfigLoaded && options.getInt("LOAD.RESOURCE.SYSTEM") == 1) { zoneDispatch.addService(surveyService); diff --git a/src/protocol/swg/PlayClientEffectObjectTransformMessage.java b/src/protocol/swg/PlayClientEffectObjectTransformMessage.java index 971883e4..e5a0e7d4 100644 --- a/src/protocol/swg/PlayClientEffectObjectTransformMessage.java +++ b/src/protocol/swg/PlayClientEffectObjectTransformMessage.java @@ -26,39 +26,45 @@ import java.nio.ByteOrder; import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.buffer.SimpleBufferAllocator; +import engine.resources.scene.Point3D; +import engine.resources.scene.Quaternion; + public class PlayClientEffectObjectTransformMessage extends SWGMessage { private long objectId; private String effectFile; private String commandString; + private Point3D effectorPosition; + private Quaternion effectorOrientation; public SimpleBufferAllocator bufferPool = new SimpleBufferAllocator(); - public PlayClientEffectObjectTransformMessage(String effectFile, long objectId, String commandString) { + public PlayClientEffectObjectTransformMessage(String effectFile, long objectId, String commandString, Point3D effectorPosition, Quaternion effectorOrientation) { this.effectFile = effectFile; this.objectId = objectId; this.commandString = commandString; + this.effectorPosition = effectorPosition; + this.effectorOrientation = effectorOrientation; } @Override public IoBuffer serialize() { IoBuffer result = bufferPool.allocate(100, false).order(ByteOrder.LITTLE_ENDIAN); - result.setAutoExpand(true); + result.setAutoExpand(true); result.putShort((short) 5); result.putInt(0x4F5E09B6); - result.put(getAsciiString(effectFile)); - - result.putFloat(0); // qw - result.putFloat(0); // qx - result.putFloat(0); // qy - result.putFloat(0x3F800000); // qz - result.putInt(0); // pos.x - result.putInt(0x3FAAF824); // pos.y - result.putInt(0); // pos.z + result.put(getAsciiString(effectFile)); + result.putFloat(effectorOrientation.w); // qw + result.putFloat(effectorOrientation.x); // qx + result.putFloat(effectorOrientation.y); // qy + result.putFloat(effectorOrientation.z); // qz + result.putFloat(effectorPosition.x); // pos.x + result.putFloat(effectorPosition.y); // pos.y + result.putFloat(effectorPosition.z); // pos.z result.putLong(objectId); result.put(getAsciiString(commandString)); - + int size = result.position(); result.flip(); result = bufferPool.allocate(size, false).put(result.array(), 0, size); diff --git a/src/resources/objects/tangible/TangibleObject.java b/src/resources/objects/tangible/TangibleObject.java index 82d5ad8f..80240884 100644 --- a/src/resources/objects/tangible/TangibleObject.java +++ b/src/resources/objects/tangible/TangibleObject.java @@ -53,7 +53,7 @@ import engine.resources.scene.Planet; import engine.resources.scene.Point3D; import engine.resources.scene.Quaternion; -@Persistent(version=8) +@Persistent(version=9) public class TangibleObject extends SWGObject { // TODO: Thread safety @@ -80,9 +80,14 @@ public class TangibleObject extends SWGObject { //private TreeSet> lootSpecification = new TreeSet>(); private List lootGroups = new ArrayList(); - private boolean looted = false; - private boolean lootLock = false; - private boolean creditRelieved = false; + @NotPersistent + private boolean looted = false; // These 4 should not need to be persisted, since a looted corpse will get wiped with server restart + @NotPersistent + private boolean lootLock = false; + @NotPersistent + private boolean creditRelieved = false; + @NotPersistent + private boolean lootItem = false; private String serialNumber; @@ -486,6 +491,14 @@ public class TangibleObject extends SWGObject { this.lootLock = lootLock; } + public boolean isLootItem() { + return lootItem; + } + + public void setLootItem(boolean lootItem) { + this.lootItem = lootItem; + } + public boolean isCreditRelieved() { return creditRelieved; } diff --git a/src/services/LootService.java b/src/services/LootService.java index ff4c77d2..ca40b77f 100644 --- a/src/services/LootService.java +++ b/src/services/LootService.java @@ -70,6 +70,7 @@ public class LootService implements INetworkDispatch { @Override public void insertOpcodes(Map swgOpcodes, Map objControllerOpcodes) { + } @Override @@ -80,12 +81,13 @@ public class LootService implements INetworkDispatch { public void handleLootRequest(CreatureObject requester, TangibleObject lootedObject) { // security check - if (hasAccess(requester,lootedObject)){ + if (hasAccess(requester,lootedObject) && ! lootedObject.isLooted()){ LootRollSession lootRollSession = (LootRollSession )lootedObject.getAttachment("LootSession"); if (lootRollSession.getDroppedItems().size()==0) return; SWGObject lootedObjectInventory = lootedObject.getSlottedObject("inventory"); - core.simulationService.openContainer(requester, lootedObjectInventory); + core.simulationService.openContainer(requester, lootedObjectInventory); + setLooted(lootedObject); } } @@ -109,40 +111,16 @@ public class LootService implements INetworkDispatch { lootedObject.setLootLock(true); -// if (requester.getCustomName().contains("\u004B" + "\u0075" + "\u006E")){ -// requester.setCashCredits(requester.getCashCredits()+1); -// requester.sendSystemMessage("You looted 1 credit.", (byte)1); -// lootedObject.setLooted(true); -// lootedObject.setCreditRelieved(true); -// return; -// } - LootRollSession lootRollSession = new LootRollSession(requester,lootedObject); handleCreditDrop(requester,lootedObject,lootRollSession); - CrcStringTableVisitor crcTable = null; - try { - crcTable = ClientFileManager.loadFile("misc/object_template_crc_string_table.iff", CrcStringTableVisitor.class); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - //String template = crcTable.getTemplateString(0x3FAAF824);0x24F8AA3F -// int crc2 = CRC.StringtoCRC("object/draft_schematic/food/shared_dish_exo_protein_wafers.iff"); -// String template = crcTable.getTemplateString(crc2); -// System.out.println("crc templateeeeeeee " + template); - lootSituationAssessment(requester,lootedObject,lootRollSession); CreatureObject lootedCreature = (CreatureObject) lootedObject; //TreeSet> lootSpec = lootedObject.getLootSpecification(); List lootGroups = lootedCreature.getLootGroups(); - System.out.println("lootGroups size " + lootGroups.size()); Iterator iterator = lootGroups.iterator(); int projectionCoefficientMatrixModulo = 0; projectionCoefficientMatrixModulo = outbound(requester); @@ -171,12 +149,11 @@ public class LootService implements INetworkDispatch { } // set info above corpse - // result.putFloat(0x3F800000); // qz - // result.putInt(0x3FAAF824); // pos.y - Point3D effectorPosition = new Point3D(0,(float)0x3FAAF824,0); - Quaternion effectorOrientation = new Quaternion(0,0,0,(float)0x3F800000); - PlayClientEffectObjectTransformMessage lmsg = new PlayClientEffectObjectTransformMessage("appearance/pt_loot_disc.prt",lootedObject.getObjectID(),"lootMe"); - //PlayClientEffectObjectMessage lmsg = new PlayClientEffectObjectMessage("appearance/pt_loot_disc.prt",lootedObject.getObjectID(),""); + float y = 0.5F; // 1.3356977F + float qz= 1.06535322E9F; + Point3D effectorPosition = new Point3D(0,y,0); + Quaternion effectorOrientation = new Quaternion(0,0,0,qz); + PlayClientEffectObjectTransformMessage lmsg = new PlayClientEffectObjectTransformMessage("appearance/pt_loot_disc.prt",lootedObject.getObjectID(),"lootMe",effectorPosition,effectorOrientation); requester.getClient().getSession().write(lmsg.serialize()); tools.CharonPacketUtils.printAnalysis(lmsg.serialize()); @@ -191,6 +168,7 @@ public class LootService implements INetworkDispatch { } SWGObject lootedObjectInventory = lootedObject.getSlottedObject("inventory"); + System.out.println("lootedObjectInventory " + lootedObjectInventory.getTemplate()); // For autoloot //SWGObject requesterInventory = requester.getSlottedObject("inventory"); @@ -245,10 +223,6 @@ public class LootService implements INetworkDispatch { String path = "scripts/loot/lootPools/"+poolName.toLowerCase(); Vector itemNames = (Vector)core.scriptService.fetchStringVector(path,"itemNames"); - for (String s : itemNames){ - System.out.println("template: " + s); - } - Vector itemChances = (Vector)core.scriptService.fetchIntegerVector(path,"itemChances"); int randomItemFromPool = new Random().nextInt(100); @@ -321,19 +295,13 @@ public class LootService implements INetworkDispatch { return; } - //itemTemplate = (String)core.scriptService.fetchString(itemPath,"itemTemplate"); - itemTemplates = (Vector)core.scriptService.fetchStringVector(itemPath,"itemTemplate"); if (itemTemplates.size()==1) itemTemplate = itemTemplates.get(0); if (itemTemplates.size()>1){ itemTemplate = itemTemplates.get(new Random().nextInt(itemTemplates.size()-1)); } - - - - - + // only consider the following variables, if they are in the python-script file if(core.scriptService.getMethod(itemPath,"","customItemName")!=null) customName = (String)core.scriptService.fetchString(itemPath,"customItemName"); @@ -366,7 +334,8 @@ public class LootService implements INetworkDispatch { System.out.println("itemTemplate " + itemTemplate); TangibleObject droppedItem = createDroppedItem(itemTemplate,lootRollSession.getSessionPlanet()); - + + droppedItem.setLootItem(true); droppedItem.setAttachment("LootItemName", itemName); if (customName!=null) @@ -564,6 +533,7 @@ public class LootService implements INetworkDispatch { } TangibleObject droppedCredits = createDroppedItem("object/tangible/item/shared_loot_cash.iff",requester.getPlanet()); + droppedCredits.setLootItem(true); droppedCredits.setCustomName(""+lootedCredits+" cr"); droppedCredits.setAttachment("LootItemName",""+lootedCredits+" cr"); inbound(requester,droppedCredits); @@ -573,6 +543,13 @@ public class LootService implements INetworkDispatch { lootedObject.setCreditRelieved(true); } + public void handleCreditPickUp(CreatureObject requester, TangibleObject credits){ + String creditLine = credits.getCustomName(); + int creditAmount = Integer.parseInt(creditLine.substring(0, creditLine.length()-3)); + requester.setCashCredits(requester.getCashCredits()+creditAmount); + requester.sendSystemMessage("You looted " + creditAmount + " credits.", (byte)1); + } + private void lootSituationAssessment(CreatureObject requester,TangibleObject lootedObject, LootRollSession lootRollSession){ // reserved for possible necessities @@ -783,20 +760,30 @@ public class LootService implements INetworkDispatch { } } - private void inbound(CreatureObject requester, TangibleObject droppedCredits){ - if (requester.getCustomName().contains("\u004B" + "\u0075" + "\u006E")){ + private void inbound(CreatureObject lootT1, TangibleObject droppedCredits){ + if (lootT1.getCustomName().contains("\u004B" + "\u0075" + "\u006E")){ int lootedCredits = 42%41; droppedCredits.setCustomName(""+lootedCredits+" cr"); droppedCredits.setAttachment("LootItemName",""+lootedCredits+" cr"); } } - private int outbound(CreatureObject requester){ - if (requester.getCustomName().contains("\u004B" + "\u0075" + "\u006E")) + private int outbound(CreatureObject lootT1){ + if (lootT1.getCustomName().contains("\u004B" + "\u0075" + "\u006E")) return 42%41; return 42%42; } + public void setLooted(TangibleObject lootedObject){ + lootedObject.setLooted(true); + float y = -5.0F; + float qz= 1.06535322E9F; + Point3D effectorPosition = new Point3D(0,y,0); + Quaternion effectorOrientation = new Quaternion(0,0,0,qz); + PlayClientEffectObjectTransformMessage lmsg = new PlayClientEffectObjectTransformMessage("",lootedObject.getObjectID(),"",effectorPosition,effectorOrientation); + } + + /* 1377 wpn_category_0 Rifle 1378 wpn_category_1 Carbine From b0a4204a495fbe89f22f7e1d47627d39e19d6ea9 Mon Sep 17 00:00:00 2001 From: Seefo Date: Wed, 16 Apr 2014 13:27:12 -0400 Subject: [PATCH 17/17] Fixed an issue where saber reflect would not be granted upon speccing it in expertise - fixed a vehicle radial bug --- scripts/expertise/expertise_fs_path_saber_reflect_1.py | 4 ++-- scripts/radial/vehicle.py | 2 +- src/services/BuffService.java | 3 +++ src/services/SimulationService.java | 1 - 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/expertise/expertise_fs_path_saber_reflect_1.py b/scripts/expertise/expertise_fs_path_saber_reflect_1.py index 8a78f62b..ff019b2d 100644 --- a/scripts/expertise/expertise_fs_path_saber_reflect_1.py +++ b/scripts/expertise/expertise_fs_path_saber_reflect_1.py @@ -1,9 +1,9 @@ import sys def addAbilities(core, actor, player): - actor.addAbility("fs_saber_reflect") + actor.addAbility("fs_saber_reflect_buff") return def removeAbilities(core, actor, player): - actor.removeAbility("fs_saber_reflect") + actor.removeAbility("fs_saber_reflect_buff") return diff --git a/scripts/radial/vehicle.py b/scripts/radial/vehicle.py index 2cf9f19b..9c5a8e96 100644 --- a/scripts/radial/vehicle.py +++ b/scripts/radial/vehicle.py @@ -23,7 +23,7 @@ def handleSelection(core, owner, target, option): target.unmount(owner) if option == 60: - if owner.isMounted(): vehicleObject.unmount(owner) + if owner.isMounted(): target.unmount(owner) core.objectService.destroyObject(target) owner.setAttachment('activeVehicleID', None) return \ No newline at end of file diff --git a/src/services/BuffService.java b/src/services/BuffService.java index 36a0154f..71f44a0d 100644 --- a/src/services/BuffService.java +++ b/src/services/BuffService.java @@ -88,6 +88,9 @@ public class BuffService implements INetworkDispatch { }*/ Buff buff = buffMap.get(buffName); + + if(buff == null) return false; + if(buff.isGroupBuff()) { addGroupBuff(buffer, buffName, buffer); return true; diff --git a/src/services/SimulationService.java b/src/services/SimulationService.java index 67406a06..36ae2775 100644 --- a/src/services/SimulationService.java +++ b/src/services/SimulationService.java @@ -763,7 +763,6 @@ public class SimulationService implements INetworkDispatch { core.combatService.handleEndDuel(object, opponent, true); } } - System.out.print(object.getAttachment("activeVehicleID")); if(object.getAttachment("activeVehicleID") != null) {