diff --git a/.classpath b/.classpath index 6d739bfc..6da71800 100644 --- a/.classpath +++ b/.classpath @@ -28,8 +28,8 @@ - - + + diff --git a/lib/mbassador-1.1.7.jar b/lib/mbassador-1.1.7.jar deleted file mode 100644 index c7ae2c11..00000000 Binary files a/lib/mbassador-1.1.7.jar and /dev/null differ diff --git a/lib/mbassador-1.1.9.jar b/lib/mbassador-1.1.9.jar new file mode 100644 index 00000000..ff742d1c Binary files /dev/null and b/lib/mbassador-1.1.9.jar differ diff --git a/ngengine_public.jar b/ngengine_public.jar index 326b2a85..e7007eeb 100644 Binary files a/ngengine_public.jar and b/ngengine_public.jar differ diff --git a/scripts/buffs/armor_break.py b/scripts/buffs/armor_break.py new file mode 100644 index 00000000..288a2db0 --- /dev/null +++ b/scripts/buffs/armor_break.py @@ -0,0 +1,12 @@ +import sys + +def setup(core, actor, buff): + actor.addSkillMod('expertise_innate_reduction_all_player', 6 * buff.getStacks()) + actor.addSkillMod('expertise_innate_reduction_all_mob', 600 * buff.getStacks()) + return + +def removeBuff(core, actor, buff): + actor.deductSkillMod('expertise_innate_reduction_all_mob', 600 * buff.getStacks()) + actor.deductSkillMod('expertise_innate_reduction_all_player', 6 * buff.getStacks()) + return + diff --git a/scripts/buffs/buildabuff_inspiration.py b/scripts/buffs/buildabuff_inspiration.py new file mode 100644 index 00000000..bfcff248 --- /dev/null +++ b/scripts/buffs/buildabuff_inspiration.py @@ -0,0 +1,27 @@ +from resources.common import BuffBuilder +import sys + +def setup(core, actor, buff): + + buffWorkshop = actor.getAttachment('buffWorkshop') + + if buffWorkshop is None: + return + + buff.setDuration(3600) #1 hour + + for BuffBuilder in buffWorkshop: + core.skillModService.addSkillMod(actor, BuffBuilder.getStatAffects(), BuffBuilder.getTotalAffected()) + print (' gave the skill mod ' + BuffBuilder.getStatAffects() + ' with affect of ' + str(BuffBuilder.getTotalAffected())) + return + + return + +def removeBuff(core, actor, buff): + for BuffBuilder in actor.getAttachment('buffWorkshop'): + core.skillModService.deductSkillMod(actor, BuffBuilder.getStatAffects(), BuffBuilder.getTotalAffected()) + print ('removed skill mod!') + return + + actor.setAttachment('buffWorkshop', 'none') + return \ No newline at end of file diff --git a/scripts/buffs/co_base_of_operations.py b/scripts/buffs/co_base_of_operations.py new file mode 100644 index 00000000..894c389c --- /dev/null +++ b/scripts/buffs/co_base_of_operations.py @@ -0,0 +1,12 @@ +import sys + +def setup(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_innate_protection_all', 1000) + core.skillModService.addSkillMod(actor, 'expertise_critical_niche_all', 5) + return + +def removeBuff(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_innate_protection_all', 1000) + core.skillModService.deductSkillMod(actor, 'expertise_critical_niche_all', 5) + return + \ No newline at end of file diff --git a/scripts/buffs/co_position_secured.py b/scripts/buffs/co_position_secured.py new file mode 100644 index 00000000..b0b2781c --- /dev/null +++ b/scripts/buffs/co_position_secured.py @@ -0,0 +1,50 @@ +import sys + +def setup(core, actor, buff): + + actor.setSpeedMultiplierMod(0) + + core.skillModService.addSkillMod(actor, 'precision_modified', 200) + core.skillModService.addSkillMod(actor, 'strength_modified', 200) + + if actor.getSkillMod('expertise_action_line_co_imp_pos_sec'): + core.skillModService.addSkillMod(actor, 'expertise_action_all', actor.getSkillMod('expertise_action_line_co_imp_pos_sec').getBase()) + #if actor.getSkillMod('expertise_co_pos_secured_line_burst_fire_proc'): + if actor.getSkillMod('expertise_co_pos_secured_line_burst_fire_devastation_bonus'): + core.skillModService.addSkillMod(actor, 'expertise_devastation_bonus', actor.getSkillMod('expertise_co_pos_secured_line_burst_fire_devastation_bonus').getBase() * 10) + if actor.getSkillMod('expertise_co_pos_secured_line_critical'): + core.skillModService.addSkillMod(actor, 'display_only_critical', actor.getSkillMod('expertise_co_pos_secured_line_critical').getBase() * 100) + if actor.getSkillMod('expertise_co_pos_secured_line_protection'): + core.skillModService.addSkillMod(actor, 'display_only_expertise_critical_hit_reduction', actor.getSkillMod('expertise_co_pos_secured_line_protection').getBase() * 100) + + if actor.hasSkill('expertise_co_base_of_operations_1'): + core.buffService.addBuffToCreature(actor, 'co_base_of_operations') + + return + +def removeBuff(core, actor, buff): + + actor.setSpeedMultiplierMod(1) + + core.skillModService.deductSkillMod(actor, 'precision_modified', 200) + core.skillModService.deductSkillMod(actor, 'strength_modified', 200) + + if actor.getSkillMod('expertise_action_line_co_imp_pos_sec'): + core.skillModService.deductSkillMod(actor, 'expertise_action_all', actor.getSkillMod('expertise_action_line_co_imp_pos_sec').getBase()) + #if actor.getSkillMod('expertise_co_pos_secured_line_burst_fire_proc'): + if actor.getSkillMod('expertise_co_pos_secured_line_burst_fire_devastation_bonus'): + core.skillModService.deductSkillMod(actor, 'expertise_devastation_bonus', actor.getSkillMod('expertise_co_pos_secured_line_burst_fire_devastation_bonus').getBase() * 10) + if actor.getSkillMod('expertise_co_pos_secured_line_critical'): + core.skillModService.deductSkillMod(actor, 'display_only_critical', actor.getSkillMod('expertise_co_pos_secured_line_critical').getBase() * 100) + if actor.getSkillMod('expertise_co_pos_secured_line_protection'): + core.skillModService.deductSkillMod(actor, 'display_only_expertise_critical_hit_reduction', actor.getSkillMod('expertise_co_pos_secured_line_protection').getBase() * 100) + + if actor.hasSkill('expertise_co_base_of_operations_1'): + if actor.getGroupId() != 0 and core.objectService.getObject(actor.getGroupId()): + group = core.objectService.getObject(actor.getGroupId()) + for member in group.getMemberList(): + core.buffService.removeBuffFromCreature(member, member.getBuffByName('co_base_of_operations')) + else: + core.buffService.removeBuffFromCreature(actor, actor.getBuffByName('co_base_of_operations')) + + return \ No newline at end of file diff --git a/scripts/buffs/co_stand_fast.py b/scripts/buffs/co_stand_fast.py new file mode 100644 index 00000000..17563ff9 --- /dev/null +++ b/scripts/buffs/co_stand_fast.py @@ -0,0 +1,19 @@ +import sys + +def setup(core, actor, buff): + if actor.getSkillMod('expertise_buff_duration_line_co_stand_fast'): + buff.setDuration(buff.getDuration() + actor.getSkillMod('expertise_buff_duration_line_co_stand_fast').getBase()) + + if actor.getSkillMod('expertise_damage_decrease_percentage'): + core.skillModService.addSkillMod(actor, 'damage_decrease_percentage', (60 + actor.getSkillMod('expertise_damage_decrease_percentage').getBase()) / 2) + else: + core.skillModService.addSkillMod(actor, 'damage_decrease_percentage', 60 / 2) + + return + +def removeBuff(core, actor, buff): + if actor.getSkillMod('expertise_damage_decrease_percentage'): + core.skillModService.deductSkillMod(actor, 'damage_decrease_percentage', (60 + actor.getSkillMod('expertise_damage_decrease_percentage').getBase()) / 2) + else: + core.skillModService.deductSkillMod(actor, 'damage_decrease_percentage', 60 / 2) + return \ No newline at end of file diff --git a/scripts/commands/addignore.py b/scripts/commands/addignore.py new file mode 100644 index 00000000..d8da29a8 --- /dev/null +++ b/scripts/commands/addignore.py @@ -0,0 +1,10 @@ +import sys + +def setup(): + return + +def run(core, actor, target, commandString): + actorGhost = actor.getSlottedObject("ghost") + chatSrvc = core.chatService + chatSrvc.addToIgnoreList(actor, commandString) + return \ No newline at end of file diff --git a/scripts/commands/boardshuttle.py b/scripts/commands/boardshuttle.py index f84f7e9b..398a4674 100644 --- a/scripts/commands/boardshuttle.py +++ b/scripts/commands/boardshuttle.py @@ -30,7 +30,7 @@ def run(core, actor, target, commandString): if nearestPoint.isShuttleAvailable() is False and nearestPoint.isShuttleDeparting() is True: actor.sendSystemMessage('@travel:shuttle_not_available', 0) return - elif nearestPoint.getSecondsRemaining() == 0: + elif nearestPoint.getSecondsRemaining() <= 0: actor.sendSystemMessage('The next shuttle is about to begin boarding.', 0) return else: diff --git a/scripts/commands/co_position_secured.py b/scripts/commands/co_position_secured.py new file mode 100644 index 00000000..a2165915 --- /dev/null +++ b/scripts/commands/co_position_secured.py @@ -0,0 +1,14 @@ +import sys + +def setup(): + return + +def run(core, actor, target, commandString): + + if actor.hasBuff('co_position_secured'): + core.buffService.removeBuffFromCreature(actor, actor.getBuffByName('co_position_secured')) + else: + core.buffService.addBuffToCreature(actor, 'co_position_secured') + + return + \ No newline at end of file diff --git a/scripts/commands/combat/co_armor_cracker.py b/scripts/commands/combat/co_armor_cracker.py new file mode 100644 index 00000000..c065b7ca --- /dev/null +++ b/scripts/commands/combat/co_armor_cracker.py @@ -0,0 +1,9 @@ +import sys + +def setup(core, actor, target, command): + if actor.getSkillMod('expertise_cooldown_line_co_riddle_armor'): + command.setCooldown(command.getCooldown() - actor.getSkillMod('expertise_cooldown_line_co_riddle_armor').getBase()) + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/co_del_ae_cc_1_1.py b/scripts/commands/combat/co_del_ae_cc_1_1.py new file mode 100644 index 00000000..ad1f5ab5 --- /dev/null +++ b/scripts/commands/combat/co_del_ae_cc_1_1.py @@ -0,0 +1,15 @@ +import sys + +def setup(core, actor, target, command): + if actor.getSkillMod('expertise_area_size_line_co_grenade'): + command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase()) + if actor.getSkillMod('expertise_damage_line_co_grenade'): + command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_action_line_co_grenade'): + command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'): + command.setDelayAttackInterval(command.getDelayAttackInterval() - 1) + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/co_del_ae_cc_1_2.py b/scripts/commands/combat/co_del_ae_cc_1_2.py new file mode 100644 index 00000000..ad1f5ab5 --- /dev/null +++ b/scripts/commands/combat/co_del_ae_cc_1_2.py @@ -0,0 +1,15 @@ +import sys + +def setup(core, actor, target, command): + if actor.getSkillMod('expertise_area_size_line_co_grenade'): + command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase()) + if actor.getSkillMod('expertise_damage_line_co_grenade'): + command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_action_line_co_grenade'): + command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'): + command.setDelayAttackInterval(command.getDelayAttackInterval() - 1) + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/co_del_ae_cc_1_3.py b/scripts/commands/combat/co_del_ae_cc_1_3.py new file mode 100644 index 00000000..ad1f5ab5 --- /dev/null +++ b/scripts/commands/combat/co_del_ae_cc_1_3.py @@ -0,0 +1,15 @@ +import sys + +def setup(core, actor, target, command): + if actor.getSkillMod('expertise_area_size_line_co_grenade'): + command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase()) + if actor.getSkillMod('expertise_damage_line_co_grenade'): + command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_action_line_co_grenade'): + command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'): + command.setDelayAttackInterval(command.getDelayAttackInterval() - 1) + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/co_del_ae_cc_2_1.py b/scripts/commands/combat/co_del_ae_cc_2_1.py new file mode 100644 index 00000000..ad1f5ab5 --- /dev/null +++ b/scripts/commands/combat/co_del_ae_cc_2_1.py @@ -0,0 +1,15 @@ +import sys + +def setup(core, actor, target, command): + if actor.getSkillMod('expertise_area_size_line_co_grenade'): + command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase()) + if actor.getSkillMod('expertise_damage_line_co_grenade'): + command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_action_line_co_grenade'): + command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'): + command.setDelayAttackInterval(command.getDelayAttackInterval() - 1) + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/co_del_ae_cc_2_2.py b/scripts/commands/combat/co_del_ae_cc_2_2.py new file mode 100644 index 00000000..ad1f5ab5 --- /dev/null +++ b/scripts/commands/combat/co_del_ae_cc_2_2.py @@ -0,0 +1,15 @@ +import sys + +def setup(core, actor, target, command): + if actor.getSkillMod('expertise_area_size_line_co_grenade'): + command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase()) + if actor.getSkillMod('expertise_damage_line_co_grenade'): + command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_action_line_co_grenade'): + command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'): + command.setDelayAttackInterval(command.getDelayAttackInterval() - 1) + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/co_del_ae_dm_1.py b/scripts/commands/combat/co_del_ae_dm_1.py new file mode 100644 index 00000000..ad1f5ab5 --- /dev/null +++ b/scripts/commands/combat/co_del_ae_dm_1.py @@ -0,0 +1,15 @@ +import sys + +def setup(core, actor, target, command): + if actor.getSkillMod('expertise_area_size_line_co_grenade'): + command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase()) + if actor.getSkillMod('expertise_damage_line_co_grenade'): + command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_action_line_co_grenade'): + command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'): + command.setDelayAttackInterval(command.getDelayAttackInterval() - 1) + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/co_del_ae_dm_2.py b/scripts/commands/combat/co_del_ae_dm_2.py new file mode 100644 index 00000000..ad1f5ab5 --- /dev/null +++ b/scripts/commands/combat/co_del_ae_dm_2.py @@ -0,0 +1,15 @@ +import sys + +def setup(core, actor, target, command): + if actor.getSkillMod('expertise_area_size_line_co_grenade'): + command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase()) + if actor.getSkillMod('expertise_damage_line_co_grenade'): + command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_action_line_co_grenade'): + command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'): + command.setDelayAttackInterval(command.getDelayAttackInterval() - 1) + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/co_del_ae_dm_3.py b/scripts/commands/combat/co_del_ae_dm_3.py new file mode 100644 index 00000000..ad1f5ab5 --- /dev/null +++ b/scripts/commands/combat/co_del_ae_dm_3.py @@ -0,0 +1,15 @@ +import sys + +def setup(core, actor, target, command): + if actor.getSkillMod('expertise_area_size_line_co_grenade'): + command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase()) + if actor.getSkillMod('expertise_damage_line_co_grenade'): + command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_action_line_co_grenade'): + command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100))) + if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'): + command.setDelayAttackInterval(command.getDelayAttackInterval() - 1) + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/co_riddle_armor.py b/scripts/commands/combat/co_riddle_armor.py new file mode 100644 index 00000000..c065b7ca --- /dev/null +++ b/scripts/commands/combat/co_riddle_armor.py @@ -0,0 +1,9 @@ +import sys + +def setup(core, actor, target, command): + if actor.getSkillMod('expertise_cooldown_line_co_riddle_armor'): + command.setCooldown(command.getCooldown() - actor.getSkillMod('expertise_cooldown_line_co_riddle_armor').getBase()) + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/co_stand_fast.py b/scripts/commands/combat/co_stand_fast.py new file mode 100644 index 00000000..36b4a557 --- /dev/null +++ b/scripts/commands/combat/co_stand_fast.py @@ -0,0 +1,9 @@ +import sys + +def setup(core, actor, target, command): + if actor.getSkillMod('expertise_cooldown_line_co_stand_fast'): + command.setCooldown(command.getCooldown() - actor.getSkillMod('expertise_cooldown_line_co_stand_fast').getBase()) + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/inspire.py b/scripts/commands/inspire.py index 59aede34..38a789ab 100644 --- a/scripts/commands/inspire.py +++ b/scripts/commands/inspire.py @@ -6,8 +6,16 @@ def setup(): return def run(core, actor, target, commandString): - print ('Buffing Player: ' + str(target.getObjectId())) + + if (actor.getProfession() != "entertainer_1a"): + return + + print ('Buffing Player: ' + str(target.getObjectId()) + ' or: ' + target.getCustomName()) openBuffWindow = BuffBuilderStartMessage(actor.getObjectId(), actor.getObjectId(), target.getObjectId()) objController = ObjControllerMessage(11, openBuffWindow) actor.getClient().getSession().write(objController.serialize()) + + penBuffWindow = BuffBuilderStartMessage(target.getObjectId(), actor.getObjectId(), target.getObjectId()) + objController2 = ObjControllerMessage(11, penBuffWindow) + target.getClient().getSession().write(objController2.serialize()) return \ No newline at end of file diff --git a/scripts/commands/of_charge_1.py b/scripts/commands/of_charge_1.py index 8b1194d2..8a1c683d 100644 --- a/scripts/commands/of_charge_1.py +++ b/scripts/commands/of_charge_1.py @@ -5,8 +5,5 @@ def setup(core, actor, buff): def run(core, actor, target, commandString): core.buffService.addBuffToCreature(actor, 'of_charge_1') - group = core.objectService.getObject(actor.getGroupId()) - for creature in group.getMemberList(): - core.buffService.addBuffToCreature(creature, 'of_charge_1') return \ No newline at end of file diff --git a/scripts/commands/of_drillmaster_1.py b/scripts/commands/of_drillmaster_1.py index 313f855b..0b448c2b 100644 --- a/scripts/commands/of_drillmaster_1.py +++ b/scripts/commands/of_drillmaster_1.py @@ -5,8 +5,5 @@ def setup(core, actor, buff): def run(core, actor, target, commandString): core.buffService.addBuffToCreature(actor, 'of_drillmaster_1') - group = core.objectService.getObject(actor.getGroupId()) - for creature in group.getMemberList(): - core.buffService.addBuffToCreature(creature, 'of_drillmaster_1') return \ No newline at end of file diff --git a/scripts/commands/of_focus_fire_1.py b/scripts/commands/of_focus_fire_1.py index 4857b1ce..d3a2cfb8 100644 --- a/scripts/commands/of_focus_fire_1.py +++ b/scripts/commands/of_focus_fire_1.py @@ -6,7 +6,9 @@ def setup(core, actor, buff): def run(core, actor, target, commandString): core.buffService.addBuffToCreature(actor, 'of_focus_fire_1') group = core.objectService.getObject(actor.getGroupId()) - for creature in group.getMemberList(): - core.buffService.addBuffToCreature(creature, 'of_focus_fire_1') + if group is not None: + for creature in group.getMemberList(): + core.buffService.addBuffToCreature(creature, 'of_focus_fire_1') + return return \ No newline at end of file diff --git a/scripts/commands/of_focus_fire_2.py b/scripts/commands/of_focus_fire_2.py index 2eb8248d..cafae5bd 100644 --- a/scripts/commands/of_focus_fire_2.py +++ b/scripts/commands/of_focus_fire_2.py @@ -4,8 +4,11 @@ def setup(core, actor, buff): return def run(core, actor, target, commandString): - core.buffService.addBuffToCreature(actor, 'of_focus_fire_1') + core.buffService.addBuffToCreature(actor, 'of_focus_fire_2') group = core.objectService.getObject(actor.getGroupId()) - for creature in group.getMemberList(): - core.buffService.addBuffToCreature(creature, 'of_focus_fire_2') - return \ No newline at end of file + if group is not None: + for creature in group.getMemberList(): + core.buffService.addBuffToCreature(creature, 'of_focus_fire_2') + return + return + \ No newline at end of file diff --git a/scripts/commands/of_focus_fire_3.py b/scripts/commands/of_focus_fire_3.py index bac08eb4..75129446 100644 --- a/scripts/commands/of_focus_fire_3.py +++ b/scripts/commands/of_focus_fire_3.py @@ -4,8 +4,11 @@ def setup(core, actor, buff): return def run(core, actor, target, commandString): - core.buffService.addBuffToCreature(actor, 'of_focus_fire_1') + core.buffService.addBuffToCreature(actor, 'of_focus_fire_3') group = core.objectService.getObject(actor.getGroupId()) - for creature in group.getMemberList(): - core.buffService.addBuffToCreature(creature, 'of_focus_fire_3') - return \ No newline at end of file + if group is not None: + for creature in group.getMemberList(): + core.buffService.addBuffToCreature(creature, 'of_focus_fire_3') + return + return + \ No newline at end of file diff --git a/scripts/commands/of_focus_fire_4.py b/scripts/commands/of_focus_fire_4.py index 4091e213..a5fa51f9 100644 --- a/scripts/commands/of_focus_fire_4.py +++ b/scripts/commands/of_focus_fire_4.py @@ -5,7 +5,4 @@ def setup(core, actor, buff): def run(core, actor, target, commandString): core.buffService.addBuffToCreature(actor, 'of_focus_fire_1') - group = core.objectService.getObject(actor.getGroupId()) - for creature in group.getMemberList(): - core.buffService.addBuffToCreature(creature, 'of_focus_fire_4') return \ No newline at end of file diff --git a/scripts/commands/of_focus_fire_5.py b/scripts/commands/of_focus_fire_5.py index 704dc3c4..a5fa51f9 100644 --- a/scripts/commands/of_focus_fire_5.py +++ b/scripts/commands/of_focus_fire_5.py @@ -5,7 +5,4 @@ def setup(core, actor, buff): def run(core, actor, target, commandString): core.buffService.addBuffToCreature(actor, 'of_focus_fire_1') - group = core.objectService.getObject(actor.getGroupId()) - for creature in group.getMemberList(): - core.buffService.addBuffToCreature(creature, 'of_focus_fire_5') return \ No newline at end of file diff --git a/scripts/commands/of_focus_fire_6.py b/scripts/commands/of_focus_fire_6.py index 5027e12c..a5fa51f9 100644 --- a/scripts/commands/of_focus_fire_6.py +++ b/scripts/commands/of_focus_fire_6.py @@ -5,7 +5,4 @@ def setup(core, actor, buff): def run(core, actor, target, commandString): core.buffService.addBuffToCreature(actor, 'of_focus_fire_1') - group = core.objectService.getObject(actor.getGroupId()) - for creature in group.getMemberList(): - core.buffService.addBuffToCreature(creature, 'of_focus_fire_6') return \ No newline at end of file diff --git a/scripts/commands/of_inspiration_1.py b/scripts/commands/of_inspiration_1.py index 95c691d9..001b0e69 100644 --- a/scripts/commands/of_inspiration_1.py +++ b/scripts/commands/of_inspiration_1.py @@ -5,8 +5,5 @@ def setup(core, actor, buff): def run(core, actor, target, commandString): core.buffService.addBuffToCreature(actor, 'of_inspiration_1') - group = core.objectService.getObject(actor.getGroupId()) - for creature in group.getMemberList(): - core.buffService.addBuffToCreature(creature, 'of_inspiration_1') return \ No newline at end of file diff --git a/scripts/commands/of_inspiration_2.py b/scripts/commands/of_inspiration_2.py index f667ecd4..01dbef43 100644 --- a/scripts/commands/of_inspiration_2.py +++ b/scripts/commands/of_inspiration_2.py @@ -5,8 +5,5 @@ def setup(core, actor, buff): def run(core, actor, target, commandString): core.buffService.addBuffToCreature(actor, 'of_inspiration_2') - group = core.objectService.getObject(actor.getGroupId()) - for creature in group.getMemberList(): - core.buffService.addBuffToCreature(creature, 'of_inspiration_2') return \ No newline at end of file diff --git a/scripts/commands/of_inspiration_3.py b/scripts/commands/of_inspiration_3.py index ce4e0b49..a1d2296f 100644 --- a/scripts/commands/of_inspiration_3.py +++ b/scripts/commands/of_inspiration_3.py @@ -5,8 +5,5 @@ def setup(core, actor, buff): def run(core, actor, target, commandString): core.buffService.addBuffToCreature(actor, 'of_inspiration_3') - group = core.objectService.getObject(actor.getGroupId()) - for creature in group.getMemberList(): - core.buffService.addBuffToCreature(creature, 'of_inspiration_3') return \ No newline at end of file diff --git a/scripts/commands/of_inspiration_4.py b/scripts/commands/of_inspiration_4.py index 198e36b5..d1954310 100644 --- a/scripts/commands/of_inspiration_4.py +++ b/scripts/commands/of_inspiration_4.py @@ -5,8 +5,5 @@ def setup(core, actor, buff): def run(core, actor, target, commandString): core.buffService.addBuffToCreature(actor, 'of_inspiration_4') - group = core.objectService.getObject(actor.getGroupId()) - for creature in group.getMemberList(): - core.buffService.addBuffToCreature(creature, 'of_inspiration_4') return \ No newline at end of file diff --git a/scripts/commands/of_inspiration_5.py b/scripts/commands/of_inspiration_5.py index e114bec1..e2d35933 100644 --- a/scripts/commands/of_inspiration_5.py +++ b/scripts/commands/of_inspiration_5.py @@ -5,8 +5,5 @@ def setup(core, actor, buff): def run(core, actor, target, commandString): core.buffService.addBuffToCreature(actor, 'of_inspiration_5') - group = core.objectService.getObject(actor.getGroupId()) - for creature in group.getMemberList(): - core.buffService.addBuffToCreature(creature, 'of_inspiration_5') return \ No newline at end of file diff --git a/scripts/commands/of_inspiration_6.py b/scripts/commands/of_inspiration_6.py index 230aaa5f..c73a2000 100644 --- a/scripts/commands/of_inspiration_6.py +++ b/scripts/commands/of_inspiration_6.py @@ -5,8 +5,5 @@ def setup(core, actor, buff): def run(core, actor, target, commandString): core.buffService.addBuffToCreature(actor, 'of_inspiration_6') - group = core.objectService.getObject(actor.getGroupId()) - for creature in group.getMemberList(): - core.buffService.addBuffToCreature(creature, 'of_inspiration_6') return \ No newline at end of file diff --git a/scripts/commands/of_scatter_1.py b/scripts/commands/of_scatter_1.py index c1ae742a..8ee17071 100644 --- a/scripts/commands/of_scatter_1.py +++ b/scripts/commands/of_scatter_1.py @@ -5,8 +5,5 @@ def setup(core, actor, buff): def run(core, actor, target, commandString): core.buffService.addBuffToCreature(actor, 'of_scatter_1') - group = core.objectService.getObject(actor.getGroupId()) - for creature in group.getMemberList(): - core.buffService.addBuffToCreature(creature, 'of_scatter_1') return \ No newline at end of file diff --git a/scripts/commands/of_tactical_sup_1.py b/scripts/commands/of_tactical_sup_1.py new file mode 100644 index 00000000..7ec7b103 --- /dev/null +++ b/scripts/commands/of_tactical_sup_1.py @@ -0,0 +1,72 @@ +from engine.resources.container import StaticContainerPermissions +import time +import sys + +def setup(core, actor, target, command): + return + +def run(core, actor, target, commandString): + doStimDrop(core, actor) + return + +def doStimDrop(core, actor): + stcSvc = core.staticService + shuttle = stcSvc.spawnObject('object/creature/npc/theme_park/shared_lambda_shuttle.iff', actor.getPlanet().getName(), long(0), actor.getPosition().x, actor.getPosition().y, actor.getPosition().z, actor.getOrientation().y, actor.getOrientation().w) + shuttle.setPosture(0) + time.sleep(10) # Wait time before shuttle arrives after command is called + shuttle.setPosture(2) + time.sleep(20) # wait time for the crate to show (length of landing animation for shuttle) + spawnCrate(core, actor, shuttle) + time.sleep(5) # Wait time for the shuttle to leave after crate is spawned + shuttle.setPosture(0) + time.sleep(20) # How long the take-off sequence is, until the Shuttle is destroyed + core.objectService.destroyObject(shuttle) + return + +def spawnCrate(core, actor, shuttle): + crate = core.staticService.spawnObject('object/tangible/container/loot/shared_npe_loot_crate_low.iff', shuttle.getPlanet().getName(), long(0), shuttle.getPosition().x, shuttle.getPosition().y, shuttle.getPosition().z, shuttle.getOrientation().y, shuttle.getOrientation().w) + crate.setCustomName('Supply Crate') + + permissions = StaticContainerPermissions() + permissions.canRemove(actor, crate) + permissions.canView(actor, crate) + crate.setContainerPermissions(permissions) + + tac1 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac1) + tac2 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac2) + tac3 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac3) + tac4 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac4) + tac5 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac5) + tac6 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac6) + tac7 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac7) + tac8 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac8) + + stim1 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim1) + stim2 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim2) + stim3 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim3) + stim4 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim4) + stim5 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim5) + stim6 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim6) + stim7 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim7) + stim8 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim8) + + time.sleep(60) + core.objectService.destroyObject(crate) + + return \ No newline at end of file diff --git a/scripts/commands/of_tactical_sup_2.py b/scripts/commands/of_tactical_sup_2.py new file mode 100644 index 00000000..76c7b5aa --- /dev/null +++ b/scripts/commands/of_tactical_sup_2.py @@ -0,0 +1,13 @@ +import sys + +def setup(core, actor, buff): + return + +def run(core, actor, target, commandString): + print (' shuttle called!') + lambdaShuttle = stcSvc.spawnObject('object/creature/npc/theme_park/shared_event_lambda_shuttle.iff', actor.getPlanet().getName(), + long(0), actor.getPosition().x, actor.getPosition().y, actor.getPosition().z, actor.getOrientation().y, actor.getOrientation().w) + + lambdaShuttle.setPosture(0) # 0 or 2? + print ('posture set!') + return \ No newline at end of file diff --git a/scripts/commands/of_tactical_sup_3.py b/scripts/commands/of_tactical_sup_3.py new file mode 100644 index 00000000..76c7b5aa --- /dev/null +++ b/scripts/commands/of_tactical_sup_3.py @@ -0,0 +1,13 @@ +import sys + +def setup(core, actor, buff): + return + +def run(core, actor, target, commandString): + print (' shuttle called!') + lambdaShuttle = stcSvc.spawnObject('object/creature/npc/theme_park/shared_event_lambda_shuttle.iff', actor.getPlanet().getName(), + long(0), actor.getPosition().x, actor.getPosition().y, actor.getPosition().z, actor.getOrientation().y, actor.getOrientation().w) + + lambdaShuttle.setPosture(0) # 0 or 2? + print ('posture set!') + return \ No newline at end of file diff --git a/scripts/commands/of_tactical_sup_4.py b/scripts/commands/of_tactical_sup_4.py new file mode 100644 index 00000000..76c7b5aa --- /dev/null +++ b/scripts/commands/of_tactical_sup_4.py @@ -0,0 +1,13 @@ +import sys + +def setup(core, actor, buff): + return + +def run(core, actor, target, commandString): + print (' shuttle called!') + lambdaShuttle = stcSvc.spawnObject('object/creature/npc/theme_park/shared_event_lambda_shuttle.iff', actor.getPlanet().getName(), + long(0), actor.getPosition().x, actor.getPosition().y, actor.getPosition().z, actor.getOrientation().y, actor.getOrientation().w) + + lambdaShuttle.setPosture(0) # 0 or 2? + print ('posture set!') + return \ No newline at end of file diff --git a/scripts/commands/of_tactical_sup_5.py b/scripts/commands/of_tactical_sup_5.py new file mode 100644 index 00000000..76c7b5aa --- /dev/null +++ b/scripts/commands/of_tactical_sup_5.py @@ -0,0 +1,13 @@ +import sys + +def setup(core, actor, buff): + return + +def run(core, actor, target, commandString): + print (' shuttle called!') + lambdaShuttle = stcSvc.spawnObject('object/creature/npc/theme_park/shared_event_lambda_shuttle.iff', actor.getPlanet().getName(), + long(0), actor.getPosition().x, actor.getPosition().y, actor.getPosition().z, actor.getOrientation().y, actor.getOrientation().w) + + lambdaShuttle.setPosture(0) # 0 or 2? + print ('posture set!') + return \ No newline at end of file diff --git a/scripts/commands/of_tactical_sup_6.py b/scripts/commands/of_tactical_sup_6.py new file mode 100644 index 00000000..ec8f96db --- /dev/null +++ b/scripts/commands/of_tactical_sup_6.py @@ -0,0 +1,70 @@ +from engine.resources.container import StaticContainerPermissions +import time +import sys + +def setup(core, actor, buff): + return + +def run(core, actor, target, commandString): + doStimDrop(core, actor) + return + +def doStimDrop(core, actor): + stcSvc = core.staticService + time.sleep(10) # Wait time before shuttle arrives after command is called + shuttle = stcSvc.spawnObject('object/creature/npc/theme_park/shared_lambda_shuttle.iff', actor.getPlanet().getName(), long(0), actor.getPosition().x, actor.getPosition().y, actor.getPosition().z, actor.getOrientation().y, actor.getOrientation().w) + shuttle.setPosture(0) + time.sleep(1) + shuttle.setPosture(2) + time.sleep(20) # wait time for the crate to show (length of landing animation for shuttle) + spawnCrate(core, actor, shuttle) + time.sleep(5) # Wait time for the shuttle to leave after crate is spawned + shuttle.setPosture(0) + time.sleep(20) # How long the take-off sequence is, until the Shuttle is destroyed + core.objectService.destroyObject(shuttle) + return + +def spawnCrate(core, actor, shuttle): + crate = core.staticService.spawnObject('object/tangible/container/loot/shared_npe_loot_crate_low.iff', shuttle.getPlanet().getName(), long(0), shuttle.getPosition().x, shuttle.getPosition().y, shuttle.getPosition().z, shuttle.getOrientation().y, shuttle.getOrientation().w) + crate.setCustomName('Supply Crate') + + permissions = StaticContainerPermissions() + permissions.canRemove(actor, crate) + permissions.canView(actor, crate) + crate.setContainerPermissions(permissions) + + tac1 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac1) + tac2 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac2) + tac3 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac3) + tac4 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac4) + tac5 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac5) + tac6 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac6) + tac7 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac7) + tac8 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) + crate.add(tac8) + + stim1 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim1) + stim2 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim2) + stim3 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim3) + stim4 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim4) + stim5 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim5) + stim6 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim6) + stim7 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim7) + stim8 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) + crate.add(stim8) + + return \ No newline at end of file diff --git a/scripts/commands/removeignore.py b/scripts/commands/removeignore.py new file mode 100644 index 00000000..4561dd79 --- /dev/null +++ b/scripts/commands/removeignore.py @@ -0,0 +1,10 @@ +import sys + +def setup(): + return + +def run(core, actor, target, commandString): + actorGhost = actor.getSlottedObject("ghost") + chatSrvc = core.chatService + chatSrvc.removeFromIgnoreList(actor, commandString) + return \ No newline at end of file diff --git a/scripts/demo.py b/scripts/demo.py index de9a931d..f3ba6ff0 100644 --- a/scripts/demo.py +++ b/scripts/demo.py @@ -13,21 +13,21 @@ def CreateStartingCharacter(core, object): testObject.setElementalDamage(50) testObject.setIntAttribute('cat_wpn_damage.weapon_dps', testObject.getDamagePerSecond()) testObject.setIntAttribute('cat_skill_mod_bonus.@stat_n:precision_modified', 35) - object.addSkillMod('kinetic' , 10000) - object.addSkillMod('energy' , 10000) - object.addSkillMod('heat' , 6000) - object.addSkillMod('cold' , 6000) - object.addSkillMod('acid' , 6000) - object.addSkillMod('electricity' , 6000) - object.addSkillMod('combat_strikethrough_value' , 50) - object.addSkillMod('display_only_dodge' , 2000) - object.addSkillMod('display_only_parry' , 1000) - object.addSkillMod('display_only_strikethrough' , 500) - object.addSkillMod('display_only_critical' , 2500) - object.addSkillMod('display_only_evasion' , 1000) - object.addSkillMod('display_only_glancing_blow' , 750) - object.addSkillMod('display_only_block' , 2000) - object.addSkillMod('combat_block_value' , 0) + object.addSkillMod('kinetic' , 0) + object.addSkillMod('energy' , 0) + object.addSkillMod('heat' , 0) + object.addSkillMod('cold' , 0) + object.addSkillMod('acid' , 0) + object.addSkillMod('electricity' , 0) + #object.addSkillMod('combat_strikethrough_value' , 50) + #object.addSkillMod('display_only_dodge' , 2000) + #object.addSkillMod('display_only_parry' , 1000) + #object.addSkillMod('display_only_strikethrough' , 500) + #object.addSkillMod('display_only_critical' , 2500) + #object.addSkillMod('display_only_evasion' , 1000) + #object.addSkillMod('display_only_glancing_blow' , 750) + #object.addSkillMod('display_only_block' , 2000) + #object.addSkillMod('combat_block_value' , 0) inventory = object.getSlottedObject('inventory') if not inventory: @@ -166,53 +166,53 @@ def addProfessionAbilities(core, object, profession): inventory.add(testObject) ##Case Sensitive - object.addAbility('fs_sweep_7') - object.addAbility('fs_drain_7') - object.addAbility('forceRun') - object.addAbility('fs_dm_cc_crit_5') - object.addAbility('fs_maelstrom_5') - object.addAbility('fs_ae_dm_cc_6') - object.addAbility('fs_sh_3') - object.addAbility('fs_dm_cc_6') - object.addAbility('fs_dm_7') - object.addAbility('fs_buff_def_1_1') - object.addAbility('fs_buff_ca_1') - object.addAbility('saberBlock') - elif profession == 'medic_1a': - object.addAbility('me_bacta_bomb_5') - object.addAbility('me_bacta_grenade_5') - object.addAbility('me_bacta_ampule_6') - object.addAbility('me_ae_heal_6') - object.addAbility('me_dm_8') - object.addAbility('me_dm_dot_6') - object.addAbility('me_drag_1') - object.addAbility('me_rv_pvp_single') - object.addAbility('me_rv_area') - object.addAbility('me_rv_pvp_area') - object.addAbility('me_reckless_stimulation_6') - object.addAbility('me_sh_1') - object.addAbility('me_stasis_1') - object.addAbility('me_stasis_self_1') - object.addAbility('me_thyroid_rupture_1') - object.addAbility('me_traumatize_5') - object.addAbility('me_induce_insanity_1') - elif profession == 'commando_1a': - object.addAbility('co_del_ae_cc_2_2') - object.addAbility('co_del_ae_dm_3') - object.addAbility('co_del_ae_cc_1_3') - object.addAbility('co_hw_dot') - object.addAbility('co_ae_hw_dot') - elif profession == 'bounty_hunter_1a': - object.addAbility('bh_shields_1') - object.addAbility('bh_dm_8') - object.addAbility('bh_sh_3') - object.addAbility('bh_armor_sprint_1') - object.addAbility('bh_prescience') - object.addAbility('bh_dm_crit_8') - object.addAbility('crippleShot') - object.addAbility('bh_fumble_6') - object.addAbility('bh_intimidate_6') - object.addAbility('bh_flawless_strike') + # object.addAbility('fs_sweep_7') + # object.addAbility('fs_drain_7') + # object.addAbility('forceRun') + # object.addAbility('fs_dm_cc_crit_5') + # object.addAbility('fs_maelstrom_5') + # object.addAbility('fs_ae_dm_cc_6') + # object.addAbility('fs_sh_3') + # object.addAbility('fs_dm_cc_6') + # object.addAbility('fs_dm_7') + # object.addAbility('fs_buff_def_1_1') + # object.addAbility('fs_buff_ca_1') + # object.addAbility('saberBlock') + #elif profession == 'medic_1a': + # object.addAbility('me_bacta_bomb_5') + # object.addAbility('me_bacta_grenade_5') + # object.addAbility('me_bacta_ampule_6') + # object.addAbility('me_ae_heal_6') + # object.addAbility('me_dm_8') + # object.addAbility('me_dm_dot_6') + # object.addAbility('me_drag_1') + # object.addAbility('me_rv_pvp_single') + # object.addAbility('me_rv_area') + # object.addAbility('me_rv_pvp_area') + # object.addAbility('me_reckless_stimulation_6') + # object.addAbility('me_sh_1') + # object.addAbility('me_stasis_1') + # object.addAbility('me_stasis_self_1') + # object.addAbility('me_thyroid_rupture_1') + # object.addAbility('me_traumatize_5') + # object.addAbility('me_induce_insanity_1') + #elif profession == 'commando_1a': + # object.addAbility('co_del_ae_cc_2_2') + # object.addAbility('co_del_ae_dm_3') + # object.addAbility('co_del_ae_cc_1_3') + # object.addAbility('co_hw_dot') + # object.addAbility('co_ae_hw_dot') + #elif profession == 'bounty_hunter_1a': + # object.addAbility('bh_shields_1') + # object.addAbility('bh_dm_8') + # object.addAbility('bh_sh_3') + # object.addAbility('bh_armor_sprint_1') + # object.addAbility('bh_prescience') + # object.addAbility('bh_dm_crit_8') + # object.addAbility('crippleShot') + # object.addAbility('bh_fumble_6') + # object.addAbility('bh_intimidate_6') + # object.addAbility('bh_flawless_strike') direfate1 = core.objectService.createObject('object/tangible/wearables/necklace/shared_necklace_s03.iff', object.getPlanet()) direfate1.setStfFilename('static_item_n') diff --git a/scripts/expertise/expertise_of_tactical_sup_1.py b/scripts/expertise/expertise_of_tactical_sup_1.py index ce701bb6..d95ef2a5 100644 --- a/scripts/expertise/expertise_of_tactical_sup_1.py +++ b/scripts/expertise/expertise_of_tactical_sup_1.py @@ -36,11 +36,13 @@ def removeExpertisePoint(core, actor): # this checks what abilities the player gets by level, need to also call this on level-up def addAbilities(core, actor, player): - - + + actor.addAbility('of_tactical_sup_1') + return def removeAbilities(core, actor, player): - - + + actor.removeAbility('of_tactical_sup_1') + return diff --git a/scripts/object/building/corellia/bank_corellia.py b/scripts/object/building/corellia/bank_corellia.py index ccad8904..8a96a6ad 100644 --- a/scripts/object/building/corellia/bank_corellia.py +++ b/scripts/object/building/corellia/bank_corellia.py @@ -1,4 +1,12 @@ import sys def setup(core, object): + + objSvc = core.objectService + + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_bank.iff', 0, 0.5, 4.2, 0, 1) + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_bank.iff', 0, 0.5, -4.2, 1, 0) + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_bank.iff', 4.2, 0.5, 0.707107, 0.707107, 1) + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_bank.iff', -4.2, 0.5, 0, -0.707107, 0.707107) + return \ No newline at end of file diff --git a/scripts/object/building/corellia/shuttleport_corellia.py b/scripts/object/building/corellia/shuttleport_corellia.py index ccad8904..5cdd5f87 100644 --- a/scripts/object/building/corellia/shuttleport_corellia.py +++ b/scripts/object/building/corellia/shuttleport_corellia.py @@ -1,4 +1,10 @@ import sys def setup(core, object): + + objSvc = core.objectService + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', -13, 0.6, -10, -0.707107, 0.707107) + objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_shuttle.iff', 0, 0.6, 0, 1, 0) + objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', -13, 0.6, 10, -0.707107, 0.707107) + return \ No newline at end of file diff --git a/scripts/object/building/corellia/starport_corellia.py b/scripts/object/building/corellia/starport_corellia.py index e71c9121..5b881257 100644 --- a/scripts/object/building/corellia/starport_corellia.py +++ b/scripts/object/building/corellia/starport_corellia.py @@ -3,13 +3,16 @@ import sys def setup(core, object): stcSvc = core.staticService cell = object.getCellByCellNumber(4) + objSvc = core.objectService if cell: stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(11.5), float(0.6), float(51.3), float(0.195405), float(-0.980722)) stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(3.1), float(0.6), float(49), float(0), float(1)) stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-2.7), float(0.6), float(49), float(0), float(1)) stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-13.2), float(0.6), float(51.3), float(-0.195405), float(-0.980722)) - + + objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_transport.iff', 0, 0, 0, 1, 0) + objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 10, 0, -10, 0.707107, 0.707107) core.mapService.addLocation(object.getPlanet(), 'Starport', object.getPosition().x, object.getPosition().z, 15, 0, 0) return \ No newline at end of file diff --git a/scripts/object/building/general/shuttleport_general.py b/scripts/object/building/general/shuttleport_general.py index ccad8904..9d1219e5 100644 --- a/scripts/object/building/general/shuttleport_general.py +++ b/scripts/object/building/general/shuttleport_general.py @@ -1,4 +1,8 @@ import sys def setup(core, object): + objSvc = core.objectService + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', -13, 0.6, -10, -0.707107, 0.707107) + objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_shuttle.iff', 0, 0.6, 0, 1, 0) + objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', -13, 0.6, 10, -0.707107, 0.707107) return \ No newline at end of file diff --git a/scripts/object/building/military/outpost_starport.py b/scripts/object/building/military/outpost_starport.py index ccad8904..b686025c 100644 --- a/scripts/object/building/military/outpost_starport.py +++ b/scripts/object/building/military/outpost_starport.py @@ -1,4 +1,16 @@ import sys def setup(core, object): + + stcSvc = core.staticService + objSvc = core.objectService + objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_transport.iff', 0, 7, 0, 0.707107, 0.707107) + objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 1, 0, -10, 0, 1) + + cell = object.getCellByCellNumber(1) + + if cell: + stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-3.12), float(0.14659503), float(-17.57), float(0.707107), float(-0.707107)) + + return \ No newline at end of file diff --git a/scripts/object/building/naboo/bank_naboo.py b/scripts/object/building/naboo/bank_naboo.py index ccad8904..8a96a6ad 100644 --- a/scripts/object/building/naboo/bank_naboo.py +++ b/scripts/object/building/naboo/bank_naboo.py @@ -1,4 +1,12 @@ import sys def setup(core, object): + + objSvc = core.objectService + + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_bank.iff', 0, 0.5, 4.2, 0, 1) + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_bank.iff', 0, 0.5, -4.2, 1, 0) + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_bank.iff', 4.2, 0.5, 0.707107, 0.707107, 1) + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_bank.iff', -4.2, 0.5, 0, -0.707107, 0.707107) + return \ No newline at end of file diff --git a/scripts/object/building/naboo/hangar_naboo_theed.py b/scripts/object/building/naboo/hangar_naboo_theed.py index ccad8904..f3d215ec 100644 --- a/scripts/object/building/naboo/hangar_naboo_theed.py +++ b/scripts/object/building/naboo/hangar_naboo_theed.py @@ -1,4 +1,19 @@ import sys def setup(core, object): + stcSvc = core.staticService + cell = object.getCellByCellNumber(3) + cell2 = object.getCellByCellNumber(4) + cell3 = object.getCellByCellNumber(5) + + if cell: + stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-26.94), float(0.749), float(-67.14), float(1), float(0)) + stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell2.getObjectID(), float(26.94), float(0.749), float(-67.14), float(1), float(0)) + stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell3.getObjectID(), float(-9.49), float(7.979), float(-45.2359), float(0), float(1)) + stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell3.getObjectID(), float(9.49), float(7.979), float(-45.2359), float(0), float(1)) + stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', object.getPlanet().getName(), cell3.getObjectID(), float(-10), float(7.979), float(10), float(-0.707107), float(0.707107)) + stcSvc.spawnObject('object/creature/npc/theme_park/shared_player_transport_theed_hangar.iff', object.getPlanet().getName(), cell3.getObjectID(), float(0), float(7.979), float(0), float(1), float(1)) + + core.mapService.addLocation(object.getPlanet(), 'Starport', object.getPosition().x, object.getPosition().z, 15, 0, 0) + return \ No newline at end of file diff --git a/scripts/object/building/naboo/rori_restuss_shuttleport.py b/scripts/object/building/naboo/rori_restuss_shuttleport.py index ccad8904..9d1219e5 100644 --- a/scripts/object/building/naboo/rori_restuss_shuttleport.py +++ b/scripts/object/building/naboo/rori_restuss_shuttleport.py @@ -1,4 +1,8 @@ import sys def setup(core, object): + objSvc = core.objectService + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', -13, 0.6, -10, -0.707107, 0.707107) + objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_shuttle.iff', 0, 0.6, 0, 1, 0) + objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', -13, 0.6, 10, -0.707107, 0.707107) return \ No newline at end of file diff --git a/scripts/object/building/naboo/rori_restuss_starport.py b/scripts/object/building/naboo/rori_restuss_starport.py index ccad8904..c48218dd 100644 --- a/scripts/object/building/naboo/rori_restuss_starport.py +++ b/scripts/object/building/naboo/rori_restuss_starport.py @@ -1,4 +1,14 @@ import sys def setup(core, object): + stcSvc = core.staticService + objSvc = core.objectService + objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_transport.iff', 0, 7, 0, 0.707107, 0.707107) + objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 1, 0, -10, 0, 1) + + cell = object.getCellByCellNumber(1) + + if cell: + stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-3.12), float(0.14659503), float(-17.57), float(0.707107), float(-0.707107)) + return \ No newline at end of file diff --git a/scripts/object/building/naboo/shuttleport_naboo.py b/scripts/object/building/naboo/shuttleport_naboo.py index ccad8904..5cdd5f87 100644 --- a/scripts/object/building/naboo/shuttleport_naboo.py +++ b/scripts/object/building/naboo/shuttleport_naboo.py @@ -1,4 +1,10 @@ import sys def setup(core, object): + + objSvc = core.objectService + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', -13, 0.6, -10, -0.707107, 0.707107) + objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_shuttle.iff', 0, 0.6, 0, 1, 0) + objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', -13, 0.6, 10, -0.707107, 0.707107) + return \ No newline at end of file diff --git a/scripts/object/building/naboo/starport_naboo.py b/scripts/object/building/naboo/starport_naboo.py index e71c9121..0060e877 100644 --- a/scripts/object/building/naboo/starport_naboo.py +++ b/scripts/object/building/naboo/starport_naboo.py @@ -3,13 +3,15 @@ import sys def setup(core, object): stcSvc = core.staticService cell = object.getCellByCellNumber(4) + objSvc = core.objectService if cell: stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(11.5), float(0.6), float(51.3), float(0.195405), float(-0.980722)) stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(3.1), float(0.6), float(49), float(0), float(1)) stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-2.7), float(0.6), float(49), float(0), float(1)) stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-13.2), float(0.6), float(51.3), float(-0.195405), float(-0.980722)) - + objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_transport.iff', 0, 0, 0, 1, 0) + objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 10, 0, -10, 0.707107, 0.707107) core.mapService.addLocation(object.getPlanet(), 'Starport', object.getPosition().x, object.getPosition().z, 15, 0, 0) return \ No newline at end of file diff --git a/scripts/object/building/restuss/restuss_shuttleport.py b/scripts/object/building/restuss/restuss_shuttleport.py index ccad8904..a3ddedaa 100644 --- a/scripts/object/building/restuss/restuss_shuttleport.py +++ b/scripts/object/building/restuss/restuss_shuttleport.py @@ -1,4 +1,5 @@ import sys def setup(core, object): + return \ No newline at end of file diff --git a/scripts/object/building/restuss/restuss_starport.py b/scripts/object/building/restuss/restuss_starport.py index ccad8904..b686025c 100644 --- a/scripts/object/building/restuss/restuss_starport.py +++ b/scripts/object/building/restuss/restuss_starport.py @@ -1,4 +1,16 @@ import sys def setup(core, object): + + stcSvc = core.staticService + objSvc = core.objectService + objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_transport.iff', 0, 7, 0, 0.707107, 0.707107) + objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 1, 0, -10, 0, 1) + + cell = object.getCellByCellNumber(1) + + if cell: + stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-3.12), float(0.14659503), float(-17.57), float(0.707107), float(-0.707107)) + + return \ No newline at end of file diff --git a/scripts/object/building/tatooine/bank_tatooine.py b/scripts/object/building/tatooine/bank_tatooine.py index ccad8904..8a96a6ad 100644 --- a/scripts/object/building/tatooine/bank_tatooine.py +++ b/scripts/object/building/tatooine/bank_tatooine.py @@ -1,4 +1,12 @@ import sys def setup(core, object): + + objSvc = core.objectService + + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_bank.iff', 0, 0.5, 4.2, 0, 1) + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_bank.iff', 0, 0.5, -4.2, 1, 0) + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_bank.iff', 4.2, 0.5, 0.707107, 0.707107, 1) + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_bank.iff', -4.2, 0.5, 0, -0.707107, 0.707107) + return \ No newline at end of file diff --git a/scripts/object/building/tatooine/shuttleport_tatooine.py b/scripts/object/building/tatooine/shuttleport_tatooine.py index c5cf71c2..5a651a1c 100644 --- a/scripts/object/building/tatooine/shuttleport_tatooine.py +++ b/scripts/object/building/tatooine/shuttleport_tatooine.py @@ -2,6 +2,11 @@ import sys def setup(core, object): + objSvc = core.objectService + objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', -13, 0.6, -9, -0.707107, 0.707107) + objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_shuttle.iff', 0, 0.6, 0, 1, 0) + objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', -13, 0.6, 10, -0.707107, 0.707107) + core.mapService.addLocation(object.getPlanet(), 'Shuttleport', object.getPosition().x, object.getPosition().z, 14, 0, 0) return \ No newline at end of file diff --git a/scripts/object/building/tatooine/starport_tatooine.py b/scripts/object/building/tatooine/starport_tatooine.py index 34468ac1..0e620101 100644 --- a/scripts/object/building/tatooine/starport_tatooine.py +++ b/scripts/object/building/tatooine/starport_tatooine.py @@ -3,12 +3,14 @@ import sys def setup(core, object): stcSvc = core.staticService cell = object.getCellByCellNumber(4) - + objSvc = core.objectService if cell: stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(11.5), float(0.6), float(51.3), float(0.195405), float(-0.980722)) stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(3.1), float(0.6), float(49), float(0), float(1)) stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-2.7), float(0.6), float(49), float(0), float(1)) stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-13.2), float(0.6), float(51.3), float(-0.195405), float(-0.980722)) + objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_transport.iff', 0, 0, 0, 1, 0) + objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 10, 0, -10, 0.707107, 0.707107) core.mapService.addLocation(object.getPlanet(), 'Starport', object.getPosition().x, object.getPosition().z, 15, 0, 0) return \ No newline at end of file diff --git a/scripts/object/creature/npc/theme_park/lambda_shuttle.py b/scripts/object/creature/npc/theme_park/lambda_shuttle.py index ccad8904..3e8a7cbb 100644 --- a/scripts/object/creature/npc/theme_park/lambda_shuttle.py +++ b/scripts/object/creature/npc/theme_park/lambda_shuttle.py @@ -1,4 +1,5 @@ import sys def setup(core, object): + #object.setPosture(2) return \ No newline at end of file diff --git a/scripts/object/creature/npc/theme_park/player_shuttle.py b/scripts/object/creature/npc/theme_park/player_shuttle.py index ccad8904..57a5dcc3 100644 --- a/scripts/object/creature/npc/theme_park/player_shuttle.py +++ b/scripts/object/creature/npc/theme_park/player_shuttle.py @@ -1,4 +1,11 @@ import sys def setup(core, object): + object.setPosture(0) # land = 0 : away = 2 + object.setOptionsBitmask(256) + tp = core.travelService.getNearestTravelPoint(object) + if tp: + tp.setShuttle(object) + tp.setShuttleAvailable(True) + tp.setShuttleLanding(False) return \ No newline at end of file diff --git a/scripts/object/creature/npc/theme_park/player_transport.py b/scripts/object/creature/npc/theme_park/player_transport.py index 30d15cfb..57a5dcc3 100644 --- a/scripts/object/creature/npc/theme_park/player_transport.py +++ b/scripts/object/creature/npc/theme_park/player_transport.py @@ -2,8 +2,10 @@ import sys def setup(core, object): object.setPosture(0) # land = 0 : away = 2 + object.setOptionsBitmask(256) tp = core.travelService.getNearestTravelPoint(object) - tp.setShuttle(object) - tp.setShuttleAvailable(True) - tp.setShuttleLanding(False) + if tp: + tp.setShuttle(object) + tp.setShuttleAvailable(True) + tp.setShuttleLanding(False) return \ No newline at end of file diff --git a/scripts/object/creature/npc/theme_park/player_transport_theed_hangar.py b/scripts/object/creature/npc/theme_park/player_transport_theed_hangar.py index ccad8904..57a5dcc3 100644 --- a/scripts/object/creature/npc/theme_park/player_transport_theed_hangar.py +++ b/scripts/object/creature/npc/theme_park/player_transport_theed_hangar.py @@ -1,4 +1,11 @@ import sys def setup(core, object): + object.setPosture(0) # land = 0 : away = 2 + object.setOptionsBitmask(256) + tp = core.travelService.getNearestTravelPoint(object) + if tp: + tp.setShuttle(object) + tp.setShuttleAvailable(True) + tp.setShuttleLanding(False) return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/armor/appearance_invisible_bicep_l.py b/scripts/object/tangible/wearables/armor/appearance_invisible_bicep_l.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/armor/appearance_invisible_bicep_l.py +++ b/scripts/object/tangible/wearables/armor/appearance_invisible_bicep_l.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/armor/appearance_invisible_bicep_r.py b/scripts/object/tangible/wearables/armor/appearance_invisible_bicep_r.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/armor/appearance_invisible_bicep_r.py +++ b/scripts/object/tangible/wearables/armor/appearance_invisible_bicep_r.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/armor/appearance_invisible_bracer_l.py b/scripts/object/tangible/wearables/armor/appearance_invisible_bracer_l.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/armor/appearance_invisible_bracer_l.py +++ b/scripts/object/tangible/wearables/armor/appearance_invisible_bracer_l.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/armor/appearance_invisible_bracer_r.py b/scripts/object/tangible/wearables/armor/appearance_invisible_bracer_r.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/armor/appearance_invisible_bracer_r.py +++ b/scripts/object/tangible/wearables/armor/appearance_invisible_bracer_r.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/armor/nightsister/armor_nightsister_bicep_r_s01.py b/scripts/object/tangible/wearables/armor/nightsister/armor_nightsister_bicep_r_s01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/armor/nightsister/armor_nightsister_bicep_r_s01.py +++ b/scripts/object/tangible/wearables/armor/nightsister/armor_nightsister_bicep_r_s01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/backpack/back_gmf_wings.py b/scripts/object/tangible/wearables/backpack/back_gmf_wings.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/backpack/back_gmf_wings.py +++ b/scripts/object/tangible/wearables/backpack/back_gmf_wings.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/backpack/back_love_day_10_blue_wings.py b/scripts/object/tangible/wearables/backpack/back_love_day_10_blue_wings.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/backpack/back_love_day_10_blue_wings.py +++ b/scripts/object/tangible/wearables/backpack/back_love_day_10_blue_wings.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/backpack/back_love_day_10_golden_wings.py b/scripts/object/tangible/wearables/backpack/back_love_day_10_golden_wings.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/backpack/back_love_day_10_golden_wings.py +++ b/scripts/object/tangible/wearables/backpack/back_love_day_10_golden_wings.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/backpack/back_love_day_10_pink_wings.py b/scripts/object/tangible/wearables/backpack/back_love_day_10_pink_wings.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/backpack/back_love_day_10_pink_wings.py +++ b/scripts/object/tangible/wearables/backpack/back_love_day_10_pink_wings.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/backpack/back_love_day_11_hue_wings.py b/scripts/object/tangible/wearables/backpack/back_love_day_11_hue_wings.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/backpack/back_love_day_11_hue_wings.py +++ b/scripts/object/tangible/wearables/backpack/back_love_day_11_hue_wings.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/backpack/back_love_day_wings.py b/scripts/object/tangible/wearables/backpack/back_love_day_wings.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/backpack/back_love_day_wings.py +++ b/scripts/object/tangible/wearables/backpack/back_love_day_wings.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/backpack/backpack_gmf_01.py b/scripts/object/tangible/wearables/backpack/backpack_gmf_01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/backpack/backpack_gmf_01.py +++ b/scripts/object/tangible/wearables/backpack/backpack_gmf_01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/backpack/empireday_rebel_endor_backpack.py b/scripts/object/tangible/wearables/backpack/empireday_rebel_endor_backpack.py index ccad8904..fa0152e7 100644 --- a/scripts/object/tangible/wearables/backpack/empireday_rebel_endor_backpack.py +++ b/scripts/object/tangible/wearables/backpack/empireday_rebel_endor_backpack.py @@ -1,4 +1,9 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + object.setStringAttribute('cost', '[15] Remembrance Day Token') + object.setStringAttribute('faction_restriction', 'Rebel Alliance') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/backpack/empireday_sandtrooper_backpack.py b/scripts/object/tangible/wearables/backpack/empireday_sandtrooper_backpack.py index ccad8904..c86c4ed5 100644 --- a/scripts/object/tangible/wearables/backpack/empireday_sandtrooper_backpack.py +++ b/scripts/object/tangible/wearables/backpack/empireday_sandtrooper_backpack.py @@ -1,4 +1,9 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + object.setStringAttribute('cost', '[15] Empire Day Token') + object.setStringAttribute('faction_restriction', 'Imperial') + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bandolier/bandolier_tusken_raider_s01.py b/scripts/object/tangible/wearables/bandolier/bandolier_tusken_raider_s01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/bandolier/bandolier_tusken_raider_s01.py +++ b/scripts/object/tangible/wearables/bandolier/bandolier_tusken_raider_s01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bandolier/bandolier_tusken_raider_s02.py b/scripts/object/tangible/wearables/bandolier/bandolier_tusken_raider_s02.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/bandolier/bandolier_tusken_raider_s02.py +++ b/scripts/object/tangible/wearables/bandolier/bandolier_tusken_raider_s02.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bandolier/bandolier_tusken_raider_s03.py b/scripts/object/tangible/wearables/bandolier/bandolier_tusken_raider_s03.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/bandolier/bandolier_tusken_raider_s03.py +++ b/scripts/object/tangible/wearables/bandolier/bandolier_tusken_raider_s03.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/belt/appearance_invisible_s01.py b/scripts/object/tangible/wearables/belt/appearance_invisible_s01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/belt/appearance_invisible_s01.py +++ b/scripts/object/tangible/wearables/belt/appearance_invisible_s01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/belt/belt_whip_s01.py b/scripts/object/tangible/wearables/belt/belt_whip_s01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/belt/belt_whip_s01.py +++ b/scripts/object/tangible/wearables/belt/belt_whip_s01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bodysuit/bodysuit_atat.py b/scripts/object/tangible/wearables/bodysuit/bodysuit_atat.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/bodysuit/bodysuit_atat.py +++ b/scripts/object/tangible/wearables/bodysuit/bodysuit_atat.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bodysuit/bodysuit_atat_quest.py b/scripts/object/tangible/wearables/bodysuit/bodysuit_atat_quest.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/bodysuit/bodysuit_atat_quest.py +++ b/scripts/object/tangible/wearables/bodysuit/bodysuit_atat_quest.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bodysuit/bodysuit_bwing.py b/scripts/object/tangible/wearables/bodysuit/bodysuit_bwing.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/bodysuit/bodysuit_bwing.py +++ b/scripts/object/tangible/wearables/bodysuit/bodysuit_bwing.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bodysuit/bodysuit_bwing_quest.py b/scripts/object/tangible/wearables/bodysuit/bodysuit_bwing_quest.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/bodysuit/bodysuit_bwing_quest.py +++ b/scripts/object/tangible/wearables/bodysuit/bodysuit_bwing_quest.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bodysuit/bodysuit_outbreak_prisoner.py b/scripts/object/tangible/wearables/bodysuit/bodysuit_outbreak_prisoner.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/bodysuit/bodysuit_outbreak_prisoner.py +++ b/scripts/object/tangible/wearables/bodysuit/bodysuit_outbreak_prisoner.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bodysuit/bodysuit_tie_fighter.py b/scripts/object/tangible/wearables/bodysuit/bodysuit_tie_fighter.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/bodysuit/bodysuit_tie_fighter.py +++ b/scripts/object/tangible/wearables/bodysuit/bodysuit_tie_fighter.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bodysuit/bodysuit_tie_fighter_quest.py b/scripts/object/tangible/wearables/bodysuit/bodysuit_tie_fighter_quest.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/bodysuit/bodysuit_tie_fighter_quest.py +++ b/scripts/object/tangible/wearables/bodysuit/bodysuit_tie_fighter_quest.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/boots/boots_tusken_raider.py b/scripts/object/tangible/wearables/boots/boots_tusken_raider.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/boots/boots_tusken_raider.py +++ b/scripts/object/tangible/wearables/boots/boots_tusken_raider.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bracelet/appearance_invisible_l_s01.py b/scripts/object/tangible/wearables/bracelet/appearance_invisible_l_s01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/bracelet/appearance_invisible_l_s01.py +++ b/scripts/object/tangible/wearables/bracelet/appearance_invisible_l_s01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/bracelet/appearance_invisible_r_s01.py b/scripts/object/tangible/wearables/bracelet/appearance_invisible_r_s01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/bracelet/appearance_invisible_r_s01.py +++ b/scripts/object/tangible/wearables/bracelet/appearance_invisible_r_s01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/cape/cape_imperial_01.py b/scripts/object/tangible/wearables/cape/cape_imperial_01.py index ccad8904..66ff82f4 100644 --- a/scripts/object/tangible/wearables/cape/cape_imperial_01.py +++ b/scripts/object/tangible/wearables/cape/cape_imperial_01.py @@ -1,4 +1,11 @@ import sys def setup(core, object): + object.setCustomName('Imperial Cape') + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + object.setStringAttribute('cost', '[2500] Imperial Galactic Civil War token') + object.setStringAttribute('faction_restriction', 'Imperial') + + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/cape/cape_rebel_01.py b/scripts/object/tangible/wearables/cape/cape_rebel_01.py index ccad8904..ac9674d5 100644 --- a/scripts/object/tangible/wearables/cape/cape_rebel_01.py +++ b/scripts/object/tangible/wearables/cape/cape_rebel_01.py @@ -1,4 +1,11 @@ import sys def setup(core, object): + object.setCustomName('Rebel Alliance Cape') + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + object.setStringAttribute('cost', '[2500] Rebel Alliance Galactic Civil War token') + object.setStringAttribute('faction_restriction', 'Rebel Alliance') + + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/gloves/appearance_invisible_s01.py b/scripts/object/tangible/wearables/gloves/appearance_invisible_s01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/gloves/appearance_invisible_s01.py +++ b/scripts/object/tangible/wearables/gloves/appearance_invisible_s01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/gloves/gloves_tusken_raider.py b/scripts/object/tangible/wearables/gloves/gloves_tusken_raider.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/gloves/gloves_tusken_raider.py +++ b/scripts/object/tangible/wearables/gloves/gloves_tusken_raider.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/goggles/goggles_anniversary.py b/scripts/object/tangible/wearables/goggles/goggles_anniversary.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/goggles/goggles_anniversary.py +++ b/scripts/object/tangible/wearables/goggles/goggles_anniversary.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/goggles/goggles_s01.py b/scripts/object/tangible/wearables/goggles/goggles_s01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/goggles/goggles_s01.py +++ b/scripts/object/tangible/wearables/goggles/goggles_s01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/goggles/goggles_s02.py b/scripts/object/tangible/wearables/goggles/goggles_s02.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/goggles/goggles_s02.py +++ b/scripts/object/tangible/wearables/goggles/goggles_s02.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/goggles/goggles_s03.py b/scripts/object/tangible/wearables/goggles/goggles_s03.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/goggles/goggles_s03.py +++ b/scripts/object/tangible/wearables/goggles/goggles_s03.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/goggles/goggles_s04.py b/scripts/object/tangible/wearables/goggles/goggles_s04.py index ccad8904..4f631a53 100644 --- a/scripts/object/tangible/wearables/goggles/goggles_s04.py +++ b/scripts/object/tangible/wearables/goggles/goggles_s04.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/goggles/goggles_s05.py b/scripts/object/tangible/wearables/goggles/goggles_s05.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/goggles/goggles_s05.py +++ b/scripts/object/tangible/wearables/goggles/goggles_s05.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/goggles/goggles_s06.py b/scripts/object/tangible/wearables/goggles/goggles_s06.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/goggles/goggles_s06.py +++ b/scripts/object/tangible/wearables/goggles/goggles_s06.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/goggles/rebreather.py b/scripts/object/tangible/wearables/goggles/rebreather.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/goggles/rebreather.py +++ b/scripts/object/tangible/wearables/goggles/rebreather.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/hat/hat_fedora__s01.py b/scripts/object/tangible/wearables/hat/hat_fedora__s01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/hat/hat_fedora__s01.py +++ b/scripts/object/tangible/wearables/hat/hat_fedora__s01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/hat/hat_imp_s01.py b/scripts/object/tangible/wearables/hat/hat_imp_s01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/hat/hat_imp_s01.py +++ b/scripts/object/tangible/wearables/hat/hat_imp_s01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/hat/hat_imp_s02.py b/scripts/object/tangible/wearables/hat/hat_imp_s02.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/hat/hat_imp_s02.py +++ b/scripts/object/tangible/wearables/hat/hat_imp_s02.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/hat/hat_imperial_gunner_01.py b/scripts/object/tangible/wearables/hat/hat_imperial_gunner_01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/hat/hat_imperial_gunner_01.py +++ b/scripts/object/tangible/wearables/hat/hat_imperial_gunner_01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/hat/hat_loveday_halo_01.py b/scripts/object/tangible/wearables/hat/hat_loveday_halo_01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/hat/hat_loveday_halo_01.py +++ b/scripts/object/tangible/wearables/hat/hat_loveday_halo_01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/hat/hat_loveday_halo_02.py b/scripts/object/tangible/wearables/hat/hat_loveday_halo_02.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/hat/hat_loveday_halo_02.py +++ b/scripts/object/tangible/wearables/hat/hat_loveday_halo_02.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/hat/hat_rebel_trooper_01.py b/scripts/object/tangible/wearables/hat/hat_rebel_trooper_01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/hat/hat_rebel_trooper_01.py +++ b/scripts/object/tangible/wearables/hat/hat_rebel_trooper_01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/helmet/helmet_atat.py b/scripts/object/tangible/wearables/helmet/helmet_atat.py index ccad8904..a398dc48 100644 --- a/scripts/object/tangible/wearables/helmet/helmet_atat.py +++ b/scripts/object/tangible/wearables/helmet/helmet_atat.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/helmet/helmet_fighter_blacksun_ace.py b/scripts/object/tangible/wearables/helmet/helmet_fighter_blacksun_ace.py index ccad8904..a398dc48 100644 --- a/scripts/object/tangible/wearables/helmet/helmet_fighter_blacksun_ace.py +++ b/scripts/object/tangible/wearables/helmet/helmet_fighter_blacksun_ace.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/helmet/helmet_fighter_imperial_ace.py b/scripts/object/tangible/wearables/helmet/helmet_fighter_imperial_ace.py index ccad8904..4f631a53 100644 --- a/scripts/object/tangible/wearables/helmet/helmet_fighter_imperial_ace.py +++ b/scripts/object/tangible/wearables/helmet/helmet_fighter_imperial_ace.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/helmet/helmet_fighter_privateer_ace.py b/scripts/object/tangible/wearables/helmet/helmet_fighter_privateer_ace.py index ccad8904..a398dc48 100644 --- a/scripts/object/tangible/wearables/helmet/helmet_fighter_privateer_ace.py +++ b/scripts/object/tangible/wearables/helmet/helmet_fighter_privateer_ace.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/helmet/helmet_fighter_rebel_ace.py b/scripts/object/tangible/wearables/helmet/helmet_fighter_rebel_ace.py index ccad8904..a398dc48 100644 --- a/scripts/object/tangible/wearables/helmet/helmet_fighter_rebel_ace.py +++ b/scripts/object/tangible/wearables/helmet/helmet_fighter_rebel_ace.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/helmet/helmet_tie_fighter.py b/scripts/object/tangible/wearables/helmet/helmet_tie_fighter.py index ccad8904..a398dc48 100644 --- a/scripts/object/tangible/wearables/helmet/helmet_tie_fighter.py +++ b/scripts/object/tangible/wearables/helmet/helmet_tie_fighter.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/helmet/helmet_tusken_raider_s01.py b/scripts/object/tangible/wearables/helmet/helmet_tusken_raider_s01.py index ccad8904..a398dc48 100644 --- a/scripts/object/tangible/wearables/helmet/helmet_tusken_raider_s01.py +++ b/scripts/object/tangible/wearables/helmet/helmet_tusken_raider_s01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/helmet/helmet_tusken_raider_s02.py b/scripts/object/tangible/wearables/helmet/helmet_tusken_raider_s02.py index ccad8904..a398dc48 100644 --- a/scripts/object/tangible/wearables/helmet/helmet_tusken_raider_s02.py +++ b/scripts/object/tangible/wearables/helmet/helmet_tusken_raider_s02.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/jacket/appearance_invisible_s01.py b/scripts/object/tangible/wearables/jacket/appearance_invisible_s01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/jacket/appearance_invisible_s01.py +++ b/scripts/object/tangible/wearables/jacket/appearance_invisible_s01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/jacket/jacket_ace_imperial.py b/scripts/object/tangible/wearables/jacket/jacket_ace_imperial.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/jacket/jacket_ace_imperial.py +++ b/scripts/object/tangible/wearables/jacket/jacket_ace_imperial.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/jacket/jacket_ace_privateer.py b/scripts/object/tangible/wearables/jacket/jacket_ace_privateer.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/jacket/jacket_ace_privateer.py +++ b/scripts/object/tangible/wearables/jacket/jacket_ace_privateer.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/jacket/jacket_ace_rebel.py b/scripts/object/tangible/wearables/jacket/jacket_ace_rebel.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/jacket/jacket_ace_rebel.py +++ b/scripts/object/tangible/wearables/jacket/jacket_ace_rebel.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/jacket/jacket_gcw_imperial_01.py b/scripts/object/tangible/wearables/jacket/jacket_gcw_imperial_01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/jacket/jacket_gcw_imperial_01.py +++ b/scripts/object/tangible/wearables/jacket/jacket_gcw_imperial_01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/jacket/jacket_gcw_rebel_01.py b/scripts/object/tangible/wearables/jacket/jacket_gcw_rebel_01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/jacket/jacket_gcw_rebel_01.py +++ b/scripts/object/tangible/wearables/jacket/jacket_gcw_rebel_01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/jacket/jacket_gmf_01.py b/scripts/object/tangible/wearables/jacket/jacket_gmf_01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/jacket/jacket_gmf_01.py +++ b/scripts/object/tangible/wearables/jacket/jacket_gmf_01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/jacket/jacket_lifeday_09_01.py b/scripts/object/tangible/wearables/jacket/jacket_lifeday_09_01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/jacket/jacket_lifeday_09_01.py +++ b/scripts/object/tangible/wearables/jacket/jacket_lifeday_09_01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/jacket/jacket_lifeday_09_02.py b/scripts/object/tangible/wearables/jacket/jacket_lifeday_09_02.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/jacket/jacket_lifeday_09_02.py +++ b/scripts/object/tangible/wearables/jacket/jacket_lifeday_09_02.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/jacket/jacket_outbreak_prison_guard.py b/scripts/object/tangible/wearables/jacket/jacket_outbreak_prison_guard.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/jacket/jacket_outbreak_prison_guard.py +++ b/scripts/object/tangible/wearables/jacket/jacket_outbreak_prison_guard.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/appearance_invisible_s01.py b/scripts/object/tangible/wearables/necklace/appearance_invisible_s01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/appearance_invisible_s01.py +++ b/scripts/object/tangible/wearables/necklace/appearance_invisible_s01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_empire_f.py b/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_empire_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_empire_f.py +++ b/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_empire_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_empire_m.py b/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_empire_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_empire_m.py +++ b/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_empire_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_neutral_f.py b/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_neutral_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_neutral_f.py +++ b/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_neutral_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_neutral_m.py b/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_neutral_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_neutral_m.py +++ b/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_neutral_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_rebel_f.py b/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_rebel_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_rebel_f.py +++ b/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_rebel_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_rebel_m.py b/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_rebel_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_rebel_m.py +++ b/scripts/object/tangible/wearables/necklace/ith_necklace_ace_pilot_rebel_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/ith_necklace_rodian_safari_f.py b/scripts/object/tangible/wearables/necklace/ith_necklace_rodian_safari_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/ith_necklace_rodian_safari_f.py +++ b/scripts/object/tangible/wearables/necklace/ith_necklace_rodian_safari_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/ith_necklace_rodian_safari_m.py b/scripts/object/tangible/wearables/necklace/ith_necklace_rodian_safari_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/ith_necklace_rodian_safari_m.py +++ b/scripts/object/tangible/wearables/necklace/ith_necklace_rodian_safari_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/ith_necklace_trando_scale_of_honor_f.py b/scripts/object/tangible/wearables/necklace/ith_necklace_trando_scale_of_honor_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/ith_necklace_trando_scale_of_honor_f.py +++ b/scripts/object/tangible/wearables/necklace/ith_necklace_trando_scale_of_honor_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/ith_necklace_trando_scale_of_honor_m.py b/scripts/object/tangible/wearables/necklace/ith_necklace_trando_scale_of_honor_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/ith_necklace_trando_scale_of_honor_m.py +++ b/scripts/object/tangible/wearables/necklace/ith_necklace_trando_scale_of_honor_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire.py b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire.py +++ b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_f.py b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_f.py +++ b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_m.py b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_m.py +++ b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_wke_f.py b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_wke_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_wke_f.py +++ b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_wke_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_wke_m.py b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_wke_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_wke_m.py +++ b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_empire_wke_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral.py b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral.py +++ b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_f.py b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_f.py +++ b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_m.py b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_m.py +++ b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_wke_f.py b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_wke_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_wke_f.py +++ b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_wke_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_wke_m.py b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_wke_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_wke_m.py +++ b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_neutral_wke_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel.py b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel.py +++ b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_f.py b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_f.py +++ b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_m.py b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_m.py +++ b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_wke_f.py b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_wke_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_wke_f.py +++ b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_wke_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_wke_m.py b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_wke_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_wke_m.py +++ b/scripts/object/tangible/wearables/necklace/necklace_ace_pilot_rebel_wke_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_lifeday.py b/scripts/object/tangible/wearables/necklace/necklace_lifeday.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_lifeday.py +++ b/scripts/object/tangible/wearables/necklace/necklace_lifeday.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_medallion_black_sun.py b/scripts/object/tangible/wearables/necklace/necklace_medallion_black_sun.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_medallion_black_sun.py +++ b/scripts/object/tangible/wearables/necklace/necklace_medallion_black_sun.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_primitive_01.py b/scripts/object/tangible/wearables/necklace/necklace_primitive_01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_primitive_01.py +++ b/scripts/object/tangible/wearables/necklace/necklace_primitive_01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_primitive_03.py b/scripts/object/tangible/wearables/necklace/necklace_primitive_03.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_primitive_03.py +++ b/scripts/object/tangible/wearables/necklace/necklace_primitive_03.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_primitive_04.py b/scripts/object/tangible/wearables/necklace/necklace_primitive_04.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_primitive_04.py +++ b/scripts/object/tangible/wearables/necklace/necklace_primitive_04.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_rodian_safari.py b/scripts/object/tangible/wearables/necklace/necklace_rodian_safari.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_rodian_safari.py +++ b/scripts/object/tangible/wearables/necklace/necklace_rodian_safari.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_f.py b/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_f.py +++ b/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_m.py b/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_m.py +++ b/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_wke_f.py b/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_wke_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_wke_f.py +++ b/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_wke_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_wke_m.py b/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_wke_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_wke_m.py +++ b/scripts/object/tangible/wearables/necklace/necklace_rodian_safari_wke_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_f.py b/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_f.py +++ b/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_m.py b/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_m.py +++ b/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_wke_f.py b/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_wke_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_wke_f.py +++ b/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_wke_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_wke_m.py b/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_wke_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_wke_m.py +++ b/scripts/object/tangible/wearables/necklace/necklace_trando_scale_of_honor_wke_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/pants/pants_outbreak_prison_guard.py b/scripts/object/tangible/wearables/pants/pants_outbreak_prison_guard.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/pants/pants_outbreak_prison_guard.py +++ b/scripts/object/tangible/wearables/pants/pants_outbreak_prison_guard.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/robe/robe_tusken_raider_s01.py b/scripts/object/tangible/wearables/robe/robe_tusken_raider_s01.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/robe/robe_tusken_raider_s01.py +++ b/scripts/object/tangible/wearables/robe/robe_tusken_raider_s01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/robe/robe_tusken_raider_s02.py b/scripts/object/tangible/wearables/robe/robe_tusken_raider_s02.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/robe/robe_tusken_raider_s02.py +++ b/scripts/object/tangible/wearables/robe/robe_tusken_raider_s02.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/utility/utility_belt_tusken_raider.py b/scripts/object/tangible/wearables/utility/utility_belt_tusken_raider.py index ccad8904..a398dc48 100644 --- a/scripts/object/tangible/wearables/utility/utility_belt_tusken_raider.py +++ b/scripts/object/tangible/wearables/utility/utility_belt_tusken_raider.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/vest/appearance_invisible_s01.py b/scripts/object/tangible/wearables/vest/appearance_invisible_s01.py index ccad8904..a398dc48 100644 --- a/scripts/object/tangible/wearables/vest/appearance_invisible_s01.py +++ b/scripts/object/tangible/wearables/vest/appearance_invisible_s01.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/wookiee/wke_lifeday_robe.py b/scripts/object/tangible/wearables/wookiee/wke_lifeday_robe.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/wookiee/wke_lifeday_robe.py +++ b/scripts/object/tangible/wearables/wookiee/wke_lifeday_robe.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/wookiee/wke_lifeday_robe_f.py b/scripts/object/tangible/wearables/wookiee/wke_lifeday_robe_f.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/wookiee/wke_lifeday_robe_f.py +++ b/scripts/object/tangible/wearables/wookiee/wke_lifeday_robe_f.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/wookiee/wke_lifeday_robe_m.py b/scripts/object/tangible/wearables/wookiee/wke_lifeday_robe_m.py index ccad8904..b89922ca 100644 --- a/scripts/object/tangible/wearables/wookiee/wke_lifeday_robe_m.py +++ b/scripts/object/tangible/wearables/wookiee/wke_lifeday_robe_m.py @@ -1,4 +1,7 @@ import sys def setup(core, object): + object.setStringAttribute('condition', '100/100') + object.setIntAttribute('volume', 1) + return \ No newline at end of file diff --git a/scripts/roadmap/officer_1a.py b/scripts/roadmap/officer_1a.py new file mode 100644 index 00000000..25e7254f --- /dev/null +++ b/scripts/roadmap/officer_1a.py @@ -0,0 +1,25 @@ +import sys + +def getLuck(): + return 20 + +def getPrecision(): + return 70 + +def getStrength(): + return 50 + +def getConstitution(): + return 80 + +def getStamina(): + return 80 + +def getAgility(): + return 60 + +def getHealth(): + return 100 + +def getAction(): + return 75 diff --git a/scripts/skillMods/expertise_critical_niche_all.py b/scripts/skillMods/expertise_critical_niche_all.py index 4f2871ac..ef07415a 100644 --- a/scripts/skillMods/expertise_critical_niche_all.py +++ b/scripts/skillMods/expertise_critical_niche_all.py @@ -2,11 +2,11 @@ import sys def add(core, actor, name, base): actor.addSkillMod(name, base) - core.skillModService.addSkillMod(actor, 'display_only_critical', 100 * (actor.getSkillModBase('expertise_critical_niche_all'))) + core.skillModService.addSkillMod(actor, 'display_only_critical', 100 * base) return def deduct(core, actor, name, base): actor.deductSkillMod(name, base) - core.skillModService.deductSkillMod(actor, 'display_only_critical', 100 * (actor.getSkillModBase('expertise_critical_niche_all'))) + core.skillModService.deductSkillMod(actor, 'display_only_critical', 100 * base) return \ No newline at end of file diff --git a/scripts/skillMods/expertise_innate_protection_all.py b/scripts/skillMods/expertise_innate_protection_all.py index ee7769e2..cceb61ec 100644 --- a/scripts/skillMods/expertise_innate_protection_all.py +++ b/scripts/skillMods/expertise_innate_protection_all.py @@ -1,10 +1,22 @@ import sys def add(core, actor, name, base): + actor.addSkillMod('energy', base) + actor.addSkillMod('kinetic', base) + actor.addSkillMod('acid', base) + actor.addSkillMod('heat', base) + actor.addSkillMod('cold', base) + actor.addSkillMod('electricity', base) actor.addSkillMod(name, base) return def deduct(core, actor, name, base): + actor.deductSkillMod('energy', base) + actor.deductSkillMod('kinetic', base) + actor.deductSkillMod('acid', base) + actor.deductSkillMod('heat', base) + actor.deductSkillMod('cold', base) + actor.deductSkillMod('electricity', base) actor.deductSkillMod(name, base) return \ No newline at end of file diff --git a/scripts/skillMods/face.py b/scripts/skillMods/face.py new file mode 100644 index 00000000..49050a23 --- /dev/null +++ b/scripts/skillMods/face.py @@ -0,0 +1,10 @@ +import sys + +# Only for entertainers? +def add(core, actor, name, base): + actor.addSkillMod(name, base) + return + +def deduct(core, actor, name, base): + actor.deductSkillMod(name, base) + return \ No newline at end of file diff --git a/scripts/skillMods/hair.py b/scripts/skillMods/hair.py new file mode 100644 index 00000000..49050a23 --- /dev/null +++ b/scripts/skillMods/hair.py @@ -0,0 +1,10 @@ +import sys + +# Only for entertainers? +def add(core, actor, name, base): + actor.addSkillMod(name, base) + return + +def deduct(core, actor, name, base): + actor.deductSkillMod(name, base) + return \ No newline at end of file diff --git a/scripts/skillMods/markings.py b/scripts/skillMods/markings.py new file mode 100644 index 00000000..49050a23 --- /dev/null +++ b/scripts/skillMods/markings.py @@ -0,0 +1,10 @@ +import sys + +# Only for entertainers? +def add(core, actor, name, base): + actor.addSkillMod(name, base) + return + +def deduct(core, actor, name, base): + actor.deductSkillMod(name, base) + return \ No newline at end of file diff --git a/scripts/skillMods/movement.py b/scripts/skillMods/movement.py index 47ce841d..a842f3db 100644 --- a/scripts/skillMods/movement.py +++ b/scripts/skillMods/movement.py @@ -2,13 +2,10 @@ import sys def add(core, actor, name, base): actor.addSkillMod(name, base) - actor.getSkillMod(name).setModifier(10) - modifier = actor.getSkillMod(name).getModifier() - actor.setSpeedMultiplierBase(actor.getSpeedMultiplierBase() + float(float(base) / float(modifier))) + actor.setSpeedMultiplierBase(actor.getSpeedMultiplierBase() + base / 100) return def deduct(core, actor, name, base): - modifier = actor.getSkillMod(name).getModifier() - actor.setSpeedMultiplierBase(actor.getSpeedMultiplierBase() - float(float(base) / float(modifier))) + actor.setSpeedMultiplierBase(actor.getSpeedMultiplierBase() - base / 100) actor.deductSkillMod(name, base) return \ No newline at end of file diff --git a/scripts/starter_clothing/crafting_artisan_trandoshan_male.py b/scripts/starter_clothing/crafting_artisan_trandoshan_male.py index fcabfeda..3862af73 100644 --- a/scripts/starter_clothing/crafting_artisan_trandoshan_male.py +++ b/scripts/starter_clothing/crafting_artisan_trandoshan_male.py @@ -2,10 +2,9 @@ import sys def CraftingArtisanTrandoshanMale(core, object): shirt = core.objectService.createObject('object/tangible/wearables/shirt/shared_shirt_s03.iff', object.getPlanet()) - vest = core.objectService.createObject('object/tangible/wearables/vest/shared_vest_s09.if', object.getPlanet()) + vest = core.objectService.createObject('object/tangible/wearables/vest/shared_vest_s09.iff', object.getPlanet()) necklace = core.objectService.createObject('object/tangible/wearables/necklace/shared_necklace_primitive_03.iff', object.getPlanet()) - pants = core.objectService.createObject('object/tangible/wearables/pants/shared_pants_s13.ifff', object.getPlanet()) - inventory = object.getSlottedObject('inventory') + pants = core.objectService.createObject('object/tangible/wearables/pants/shared_pants_s13.iff', object.getPlanet()) object._add(shirt) object._add(vest) object._add(necklace) diff --git a/scripts/static_map_locations.py b/scripts/static_map_locations.py index 2222447d..62070749 100644 --- a/scripts/static_map_locations.py +++ b/scripts/static_map_locations.py @@ -30,7 +30,13 @@ def addLocations(core, planet): dathomirLocations(core, planet) if planet.getName() == 'lok': - lokLocations(core, planet) + lokLocations(core, planet) + + #if planet.getName() == 'kaas': + #kaasLocations(core, planet) + + #if planet.getName() == 'taanab': + #taanabLocations(core, planet) def tatooineLocations(core, planet): @@ -44,6 +50,7 @@ def tatooineLocations(core, planet): mapService.addLocation(planet, 'Wayfar', -5124, -6530, 17, 0, 0) mapService.addLocation(planet, 'Mos Eisley', 3528, -4804, 17, 0, 0) mapService.addLocation(planet, 'Anchorhead', 40, -5348, 17, 0, 0) + mapService.addLocation(planet, 'Mos Taike', 3813, 2354, 17, 0, 0) def corelliaLocations(core, planet): @@ -52,11 +59,11 @@ def corelliaLocations(core, planet): # Cities mapService.addLocation(planet, 'Coronet', -178, -4504, 17, 0, 0) - mapService.addLocation(planet, 'Tyrena', -5140, 2450, 17, 0, 0) + mapService.addLocation(planet, 'Tyrena', -5140, -2450, 17, 0, 0) mapService.addLocation(planet, 'Bela Vistal', 6766, -5692, 17, 0, 0) mapService.addLocation(planet, 'Kor Vella', -3420, 3146, 17, 0, 0) mapService.addLocation(planet, 'Doaba Guerfel', 3274, 5582, 17, 0, 0) - mapService.addLocation(planet, 'Vreni Island', -5538, 6176, 17, 0, 0) + mapService.addLocation(planet, 'Vreni Island', -5538, -6176, 17, 0, 0) def nabooLocations(core, planet): @@ -78,7 +85,7 @@ def roriLocations(core, planet): mapService.addLocation(planet, 'Narmle', -5140, -2368, 17, 0, 0) mapService.addLocation(planet, 'Restuss', 5318, 5680, 17, 0, 0) - mapService.addLocation(planet, 'Rebel outpost', 3677, -6447, 17, 0, 0) + mapService.addLocation(planet, 'Rebel Outpost', 3677, -6447, 17, 0, 0) def endorLocations(core, planet): @@ -86,7 +93,7 @@ def endorLocations(core, planet): # Cities - mapService.addLocation(planet, 'an outpost', -905, 1584, 17, 0, 0) + mapService.addLocation(planet, 'an Outpost', -905, 1584, 17, 0, 0) def talusLocations(core, planet): @@ -96,7 +103,7 @@ def talusLocations(core, planet): mapService.addLocation(planet, 'Dearic', 422, -3004, 17, 0, 0) mapService.addLocation(planet, 'Nashal', 4163, 5220, 17, 0, 0) - mapService.addLocation(planet, 'Imperial outpost', -2178, 2300, 17, 0, 0) + mapService.addLocation(planet, 'Imperial Outpost', -2178, 2300, 17, 0, 0) def yavin4Locations(core, planet): @@ -113,9 +120,9 @@ def dantooineLocations(core, planet): # Cities - mapService.addLocation(planet, 'Mining outpost', -640, 2486, 17, 0, 0) - mapService.addLocation(planet, 'Pirate outpost', 1588, -6399, 17, 0, 0) - mapService.addLocation(planet, 'Imperial outpost', -4224, -2400, 17, 0, 0) + mapService.addLocation(planet, 'Mining Outpost', -640, 2486, 17, 0, 0) + mapService.addLocation(planet, 'Pirate Outpost', 1588, -6399, 17, 0, 0) + mapService.addLocation(planet, 'Imperial Outpost', -4224, -2400, 17, 0, 0) def dathomirLocations(core, planet): @@ -136,4 +143,19 @@ def lokLocations(core, planet): mapService.addLocation(planet, 'Nym\'s Stronghold', 440, 5029, 17, 0, 0) mapService.addLocation(planet, 'Imperial outpost', -1920, -3084, 17, 0, 0) - \ No newline at end of file +#def kaasLocations(core, planet): + #mapService = core.mapService + + # Cities + + #mapService.addLocation(planet, 'Imperial Outpost', -5118, -2386, 17, 0, 0) + +#def taanabLocations(core, planet): + + #mapService = core.mapService + + # Cities + + #mapService.addLocation(planet, 'Pandath Spaceport', 0, 0, 17, 0, 0) + + diff --git a/scripts/static_spawns/naboo.py b/scripts/static_spawns/naboo.py index ac5d19ca..86f073af 100644 --- a/scripts/static_spawns/naboo.py +++ b/scripts/static_spawns/naboo.py @@ -4,28 +4,4 @@ def addPlanetSpawns(core, planet): stcSvc = core.staticService - # Travel spawns - - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'naboo', long(0), float(-5487.8), float(-149.4), float(-12.5), float(-0.710457), float(0.703739)) # Lake Retreat - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'naboo', long(0), float(4717.7), float(4.2), float(-4650.6), float(1), float(0)) # moenia starport - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'naboo', long(0), float(4968.6), float(4.4), float(-4883.3), float(0.71), float(-0.71)) # moenia shuttleport - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'naboo', long(0), float(5301.1), float(-192), float(6671.5), float(0), float(1)) # kaadara starport - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'naboo', long(0), float(5134.3), float(-191.4), float(6617.2), float(-0.373413), float(0.927665)) # kaadara shuttleport - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'naboo', long(0), float(1347.8), float(13), float(2760.3), float(0.988256), float(0.152808)) # keren starport - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'naboo', long(0), float(1558.3), float(25.6), float(2884.8), float(1), float(0)) # keren shuttleport a - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'naboo', long(0), float(2027.7), float(19.6), float(2535.2), float(-0.710457), float(0.703739)) # keren shuttleport b - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'naboo', long(0), float(5338.6), float(327.6), float(-1567.2), float(-0.710457), float(0.703739)) # deeja peek shuttleport - - - - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'naboo', long(0), float(-5487), float(-149.4), float(-31.8), float(-0.710457), float(0.703739)) # Lake Retreat - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'naboo', long(0), float(5121.5), float(-191.4), float(6603.8), float(-0.373413), float(0.927665)) # kaadara shuttleport - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'naboo', long(0), float(1577.6), float(25.6), float(2845.1), float(1), float(0)) # keren shuttleport a - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'naboo', long(0), float(2028.5), float(19.6), float(2515.6), float(-0.710457), float(0.703739)) # keren shuttleport b - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'naboo', long(0), float(5339.3), float(327.6), float(-1586.7), float(-0.710457), float(0.703739)) # deeja peek shuttleport - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'naboo', long(0), float(4969.4), float(4.4), float(-4902.6), float(-0.710457), float(0.703739)) # moenia shuttleport - - - - return \ No newline at end of file diff --git a/scripts/static_spawns/rori.py b/scripts/static_spawns/rori.py index 0ebd4454..e097f64b 100644 --- a/scripts/static_spawns/rori.py +++ b/scripts/static_spawns/rori.py @@ -2,17 +2,7 @@ import sys def addPlanetSpawns(core, planet): - stcSvc = core.staticService - - # Travel spawns - - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'rori', long(0), float(3672.5), float(96), float(-6411.2), float(0.938551), float(0.345142)) # rebel outpost - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'rori', long(0), float(-5381.5), float(80), float(-2162.8), float(1), float(0)) # narmle starport - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'rori', long(0), float(-5257.2), float(81.3), float(-2150.3), float(-0.924076), float(0.382209)) # narmle shuttleport - - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'rori', long(0), float(-5243), float(81.3), float(-2163.5), float(-0.924076), float(0.382209)) # narmle shuttleport - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'rori', long(4505530), float(-3.5), float(0.1), float(-17.5), float(-0.69182), float(0.72207)) # rebel outpost - + stcSvc = core.staticService # Restuss Spawns @@ -379,15 +369,15 @@ def addPlanetSpawns(core, planet): stcSvc.spawnObject('object/static/worldbuilding/structures/shared_mun_nboo_building_chunk_destoyed_10.iff', 'rori', long(0), float(5165.2), float(80), float(5550.01), float(0.24), float(0.971)) stcSvc.spawnObject('object/static/worldbuilding/decal/shared_mun_decal_blast_lg.iff', 'rori', long(0), float(5139.4), float(160), float(5599.26), float(0.349), float(0.937)) stcSvc.spawnObject('object/static/worldbuilding/structures/shared_mun_nboo_building_chunk_destoyed_13.iff', 'rori', long(0), float(5124.02), float(80), float(5682.59), float(0.057), float(0.998)) - stcSvc.spawnObject('object/building/military/shared_outpost_cloning_facility.iff', 'rori', long(0), float(5232.54), float(79.914), float(6176.29), float(0.703), float(0.711)) - stcSvc.spawnObject('object/building/naboo/shared_rori_restuss_starport.iff', 'rori', long(0), float(5281.13), float(80), float(6171.442), float(1), float(-0.001)) - stcSvc.spawnObject('object/building/military/shared_military_base_shed_imperial_style_cantina_s01.iff', 'rori', long(0), float(5284.15), float(80), float(6236.408), float(1), float(-0.001)) - stcSvc.spawnObject('object/building/military/shared_military_base_shed_imperial_style_hospital_01.iff', 'rori', long(0), float(5327.94), float(80), float(6204.451), float(0.877), float(-0.48)) - stcSvc.spawnObject('object/building/military/shared_military_rebel_tactical_center.iff', 'rori', long(0), float(4719.25), float(80), float(5870.46), float(0.707), float(0.707)) - stcSvc.spawnObject('object/building/restuss/shared_restuss_faction_cantina.iff', 'rori', long(0), float(4827.85), float(80), float(5874.45), float(0.703), float(0.711)) - stcSvc.spawnObject('object/building/military/shared_military_rebel_tactical_center.iff', 'rori', long(0), float(4778.08), float(80), float(5905.97), float(1), float(0)) - stcSvc.spawnObject('object/building/military/shared_military_base_shed_rebel_style_01.iff', 'rori', long(0), float(4831.285), float(80), float(5810.192), float(-0.41), float(0.912)) - stcSvc.spawnObject('object/building/military/shared_military_rebel_detachment_hq.iff', 'rori', long(0), float(4777.64), float(80), float(5776.2), float(0), float(1)) + #stcSvc.spawnObject('object/building/military/shared_outpost_cloning_facility.iff', 'rori', long(0), float(5232.54), float(79.914), float(6176.29), float(0.703), float(0.711)) + #stcSvc.spawnObject('object/building/naboo/shared_rori_restuss_starport.iff', 'rori', long(0), float(5281.13), float(80), float(6171.442), float(1), float(-0.001)) + #stcSvc.spawnObject('object/building/military/shared_military_base_shed_imperial_style_cantina_s01.iff', 'rori', long(0), float(5284.15), float(80), float(6236.408), float(1), float(-0.001)) + #stcSvc.spawnObject('object/building/military/shared_military_base_shed_imperial_style_hospital_01.iff', 'rori', long(0), float(5327.94), float(80), float(6204.451), float(0.877), float(-0.48)) + #stcSvc.spawnObject('object/building/military/shared_military_rebel_tactical_center.iff', 'rori', long(0), float(4719.25), float(80), float(5870.46), float(0.707), float(0.707)) + #stcSvc.spawnObject('object/building/restuss/shared_restuss_faction_cantina.iff', 'rori', long(0), float(4827.85), float(80), float(5874.45), float(0.703), float(0.711)) + #stcSvc.spawnObject('object/building/military/shared_military_rebel_tactical_center.iff', 'rori', long(0), float(4778.08), float(80), float(5905.97), float(1), float(0)) + #stcSvc.spawnObject('object/building/military/shared_military_base_shed_rebel_style_01.iff', 'rori', long(0), float(4831.285), float(80), float(5810.192), float(-0.41), float(0.912)) + #stcSvc.spawnObject('object/building/military/shared_military_rebel_detachment_hq.iff', 'rori', long(0), float(4777.64), float(80), float(5776.2), float(0), float(1)) stcSvc.spawnObject('object/static/worldbuilding/decal/shared_mun_decal_blast_lg.iff', 'rori', long(0), float(5254.85), float(160), float(5553.39), float(-0.551), float(0.834)) stcSvc.spawnObject('object/static/worldbuilding/decal/shared_mun_decal_blast_lg.iff', 'rori', long(0), float(5365.02), float(160), float(5577.16), float(-0.574), float(0.819)) stcSvc.spawnObject('object/static/worldbuilding/decal/shared_mun_decal_blast_lg.iff', 'rori', long(0), float(5143.04), float(160), float(5552.77), float(-0.259), float(0.966)) diff --git a/scripts/static_spawns/tatooine.py b/scripts/static_spawns/tatooine.py index a42c22ca..80b02bde 100644 --- a/scripts/static_spawns/tatooine.py +++ b/scripts/static_spawns/tatooine.py @@ -3,36 +3,7 @@ import sys def addPlanetSpawns(core, planet): stcSvc = core.staticService - - # Travel spawns - - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'tatooine', long(0), float(-1090.8), float(12.6), float(-3554.9), float(-0.67), float(0.74)) # bestine shuttleport - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'tatooine', long(0), float(-1382.15), float(12), float(-3583.25), float(1), float(-0.08)) # bestine starport - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'tatooine', long(0), float(3427.5), float(5.6), float(-4644.1), float(-0.485545), float(0.874212)) # mos eisley shuttleport - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'tatooine', long(0), float(3622), float(5), float(-4788), float(-0.276903063059), float(0.960897982121)) # mos eisley starport - - stcSvc.spawnObject('object/creature/npc/theme_park/shared_player_transport.iff', 'tatooine', long(0), float(3618), float(5), float(-4801), float(0.500574469566), float(0.865693628788)) # mos eisley starport - - - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'tatooine', long(0), float(-2886.3), float(5.6), float(1929.4), float(-0.113814), float(0.993502)) # mos espa shuttleport a - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'tatooine', long(0), float(-3116.3), float(5.6), float(2166.1), float(-0.621933), float(0.783071)) # mos espa shuttleport b - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'tatooine', long(0), float(3623.5), float(5.6), float(2178.4), float(-0.123692), float(0.992321)) # mos espa shuttleport c - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'tatooine', long(0), float(38.15), float(52.6), float(-5532.2), float(1), float(0)) # anchorhead shuttleport - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'tatooine', long(0), float(1241.95), float(7), float(3053.42), float(0.89), float(0.46)) # mos entha starport - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'tatooine', long(0), float(1386.12), float(7.6), float(3473.81), float(1), float(0)) # mos entha shuttleport a - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'tatooine', long(0), float(1721.5), float(7.6), float(3191.3), float(1), float(0)) # mos entha shuttleport b - stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 'tatooine', long(0), float(-2820.5), float(5), float(2083.71), float(0), float(1)) # mos espa starport - - - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'tatooine', long(0), float(-1091.9), float(12.6), float(-3572.7), float(-0.645025), float(0.764162)) # bestine shuttleport - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'tatooine', long(0), float(-2903.5), float(5.6), float(1924), float(-0.113814), float(0.993502)) # mos espa shuttleport a - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'tatooine', long(0), float(-3124.4), float(5.6), float(2138.1), float(0.621933), float(0.783071)) # mos espa shuttleport b - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'tatooine', long(0), float(-2810), float(12.6), float(2173.8), float(-0.123962), float(0.992321)) # mos espa shuttleport c - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'tatooine', long(0), float(55.7), float(52.6), float(-5531.4), float(1), float(0)) # anchorhead shuttleport - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'tatooine', long(0), float(1403.6), float(7.6), float(3474.4), float(1), float(0)) # mos entha shuttleport a - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'tatooine', long(0), float(1739), float(7.6), float(3192.1), float(1), float(0)) # mos entha shuttleport b - stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', 'tatooine', long(0), float(3418.4), float(5.6), float(-4659.3), float(-0.485545), float(0.874212)) # mos eisley shuttleport - + stcSvc.spawnObject('object/mobile/shared_lifeday_saun_dann.iff', 'tatooine', long(0), float(-5037.00), float(75), float(-6561), float(-0.75), float(0)) # Life Day stcSvc.spawnObject('object/tangible/holiday/life_day/shared_main_lifeday_tree.iff', 'tatooine', long(0), float(-5043.00), float(75), float(-6541.00), float(0.999132931232), float(-0.0416347384453)) # Lifeday Tree stcSvc.spawnObject('object/mobile/shared_lifeday_figrin_dan.iff', 'tatooine', long(0), float(-5046.00), float(75), float(-6560), float(-0.75), float(0)) # LD Figrin diff --git a/scripts/static_travel_points.py b/scripts/static_travel_points.py index e6d0987b..54b19a77 100644 --- a/scripts/static_travel_points.py +++ b/scripts/static_travel_points.py @@ -21,11 +21,25 @@ def addPoints(core, planet): if planet.getName() == 'tatooine': tatooinePoints(core, planet) if planet.getName() == 'yavin4': - yavin4Points(core, planet) + yavin4Points(core, planet) + if planet.getName() == 'kashyyyk_main': + kashyyyk_mainPoints(core, planet) + if planet.getName() == 'mustafar': + mustafarPoints(core, planet) return def corelliaPoints(core, planet): trvSvc = core.travelService + + trvSvc.addTravelPoint(planet, "Coronet Shuttle A", -25, 28, -4409) + trvSvc.addTravelPoint(planet, "Coronet Shuttle B", -329, 28, -4641) + trvSvc.addTravelPoint(planet, "Vreni Island Shuttle", -5551, 15, -6059) + trvSvc.addTravelPoint(planet, "Tyrena Shuttle A", -5005, 21, -2386) + trvSvc.addTravelPoint(planet, "Tyrena Shuttle B", -5600, 21, -2790) + trvSvc.addTravelPoint(planet, "Doaba Guerfel Shuttleport", 3085, 280, 4993) + trvSvc.addTravelPoint(planet, "Kor Vella Shuttleport", -3775, 86, 3234) + trvSvc.addTravelPoint(planet, "Bela Vistal Shuttleport A", 6644, 330, -5922) + trvSvc.addTravelPoint(planet, "Bela Vistal Shuttleport B", 6930, 330, -5534) trvSvc.addTravelPoint(planet, "Coronet Starport", -51, 28, -4735) trvSvc.addTravelPoint(planet, "Tyrena Starport", -4975, 21, -2230) @@ -35,25 +49,25 @@ def corelliaPoints(core, planet): def dantooinePoints(core, planet): trvSvc = core.travelService - - trvSvc.addTravelPoint(planet, "Coronet Starport", -51, 28, -4735) - trvSvc.addTravelPoint(planet, "Tyrena Starport", -4975, 21, -2230) - trvSvc.addTravelPoint(planet, "Kor Vella Starport", -3136, 31, 2894) - trvSvc.addTravelPoint(planet, "Doaba Guerful Starport", 3377, 308, 5605) + + trvSvc.addTravelPoint(planet, "Imperial Outpost", -635, 3, 2507) + trvSvc.addTravelPoint(planet, "Mining Outpost", -4208, 3, -2350) + trvSvc.addTravelPoint(planet, "Agro Outpost", 1569, 4, -6415) return def dathomirPoints(core, planet): trvSvc = core.travelService - trvSvc.addTravelPoint(planet, "Science Outpost", -76, 18, -1586) - trvSvc.addTravelPoint(planet, "Trade Outpost", -592, 6, 3087) + trvSvc.addTravelPoint(planet, "Science Outpost", -49, 18, -1584) + trvSvc.addTravelPoint(planet, "Trade Outpost", 618, 6, 3092) + trvSvc.addTravelPoint(planet, "Quarantine Zone", -5691, 511, -6467) return def endorPoints(core, planet): trvSvc = core.travelService - trvSvc.addTravelPoint(planet, "Smuggler Outpost", -978, 73, 1554) - trvSvc.addTravelPoint(planet, "Research Outpost", 3222, 24, -3482) + trvSvc.addTravelPoint(planet, "Smuggler Outpost", -950, 73, 1553) + trvSvc.addTravelPoint(planet, "Research Outpost", 3201, 24, -3499) return def lokPoints(core, planet): @@ -66,23 +80,38 @@ def nabooPoints(core, planet): trvSvc = core.travelService trvSvc.addTravelPoint(planet, "Kaadara Starport", 5295, -192, 6664) + trvSvc.addTravelPoint(planet, "Kaadara Shuttleport", 5123, -192, 6616) + trvSvc.addTravelPoint(planet, "Dee'ja Peak Shuttleport", 5331, 327, -1576) + trvSvc.addTravelPoint(planet, "Moenia Shuttleport", 4961, 3, -4892) + trvSvc.addTravelPoint(planet, "Lake Retreat Shuttleport", -5494, -150, -21) + trvSvc.addTravelPoint(planet, "Keren Shuttleport", 2021, 19, 2525) + trvSvc.addTravelPoint(planet, "Keren Shuttleport South", 1567, 25, 2837) trvSvc.addTravelPoint(planet, "Keren Starport", 1352, 13, 2768) trvSvc.addTravelPoint(planet, "Moenia Starport", 4728, 4, -4650) + trvSvc.addTravelPoint(planet, "Theed Shuttle A", -5856, 19, 4172) + trvSvc.addTravelPoint(planet, "Theed Shuttle B", -5005, 19, 4072) + trvSvc.addTravelPoint(planet, "Theed Shuttle C", -5411, 19, 4332) + trvSvc.addTravelPoint(planet, "Theed Spaceport", -4858, 5, 4164) return def roriPoints(core, planet): trvSvc = core.travelService - trvSvc.addTravelPoint(planet, "Narmle Starport", -5472, 80, 2161) + trvSvc.addTravelPoint(planet, "Narmle Starport", -5374, 80, -2188) + trvSvc.addTravelPoint(planet, "Narmle Shuttleport", -5255, 80, -2161) trvSvc.addTravelPoint(planet, "Rebel Outpost", 3672, 96, -6421) + trvSvc.addTravelPoint(planet, "Restuss Starport", 5281, 80, 6171) + trvSvc.addTravelPoint(planet, "Restuss Shuttleport", 5398, 80, 6195) return def talusPoints(core, planet): trvSvc = core.travelService - trvSvc.addTravelPoint(planet, "Dearic Starport", 245, 6, -2931) - trvSvc.addTravelPoint(planet, "Nashal Starport", 4480, 2, 6365) - trvSvc.addTravelPoint(planet, "Imperial Outpost", -2212, 20, 2302) + trvSvc.addTravelPoint(planet, "Dearic Starport", 263, 6, -2952) + trvSvc.addTravelPoint(planet, "Dearic Shuttleport", 699, 6, -3041) + trvSvc.addTravelPoint(planet, "Nashal Starport", 4453, 2, 5354) + trvSvc.addTravelPoint(planet, "Nashal Shuttleport", 4334, 9, 5431) + trvSvc.addTravelPoint(planet, "Imperial Outpost", -2226, 20, 2319) return def tatooinePoints(core, planet): @@ -92,12 +121,33 @@ def tatooinePoints(core, planet): trvSvc.addTravelPoint(planet, "Mos Eisley Starport", 3619, 5, -4801) trvSvc.addTravelPoint(planet, "Mos Espa Starport", -2829, 5, 2080) trvSvc.addTravelPoint(planet, "Mos Entha Starport", 1238, 7, 3062) + trvSvc.addTravelPoint(planet, "Anchorhead Shuttle", 48, 52, -5319) + trvSvc.addTravelPoint(planet, "Mos Entha Shuttleport A", 1731, 7, 3205) + trvSvc.addTravelPoint(planet, "Mos Entha Shuttleport B", 1396, 7, 3487) + trvSvc.addTravelPoint(planet, "Mos Espa Shuttle West", -3132, 5, 2172) + trvSvc.addTravelPoint(planet, "Mos Espa Shuttle East", -2799, 5, 2163) + trvSvc.addTravelPoint(planet, "Mos Espa Shuttle South", -2892, 5, 1914) + trvSvc.addTravelPoint(planet, "Mos Eisley Shuttleport", 3434, 5, -4659) + trvSvc.addTravelPoint(planet, "Bestine Shuttleport", -1071, 12, -3566) + trvSvc.addTravelPoint(planet, "Wayfar Shuttleport", -5089, 75, -6594) return def yavin4Points(core, planet): trvSvc = core.travelService - trvSvc.addTravelPoint(planet, "Imperial Base", 4033, 37, -6234) - trvSvc.addTravelPoint(planet, "Labor Outpost", -6939, 73, -5706) - trvSvc.addTravelPoint(planet, "Mining Outpost", -277, 35, 4879) - return \ No newline at end of file + trvSvc.addTravelPoint(planet, "Imperial Base", 4054, 37, -6216) + trvSvc.addTravelPoint(planet, "Labor Outpost", -6921, 73, -5726) + trvSvc.addTravelPoint(planet, "Mining Outpost", -267, 35, 4896) + return + +def kashyyyk_mainPoints(core, planet): + trvSvc = core.travelService + + trvSvc.addTravelPoint(planet, "Kachirho Starport", -688, 19, -165) + return + +def mustafarPoints(core, planet): + trvSvc = core.travelService + + trvSvc.addTravelPoint(planet, "Mensix Mining Facility", 405, 230, -1352) + return \ No newline at end of file diff --git a/scripts/weather.py b/scripts/weather.py new file mode 100644 index 00000000..397986ae --- /dev/null +++ b/scripts/weather.py @@ -0,0 +1,16 @@ +import sys + +def init(core): + weatherSvc = core.weatherService + weatherSvc.addPlanetSettings('tatooine', 75, 0) + weatherSvc.addPlanetSettings('naboo', 85, 0) + weatherSvc.addPlanetSettings('corellia', 85, 1) + weatherSvc.addPlanetSettings('dantooine', 80, 1) + weatherSvc.addPlanetSettings('rori', 75, 2) + weatherSvc.addPlanetSettings('talus', 75, 2) + weatherSvc.addPlanetSettings('lok', 75, 2) + weatherSvc.addPlanetSettings('dathomir', 50, 3) + weatherSvc.addPlanetSettings('endor', 80, 0) + weatherSvc.addPlanetSettings('yavin4', 65, 2) + weatherSvc.addPlanetSettings('kashyyyk_main', 80, 0) + diff --git a/src/main/NGECore.java b/src/main/NGECore.java index 2c3606ae..e53b4bfb 100644 --- a/src/main/NGECore.java +++ b/src/main/NGECore.java @@ -36,6 +36,7 @@ import services.AttributeService; import services.BuffService; import services.CharacterService; import services.ConnectionService; +import services.EntertainmentService; import services.EquipmentService; import services.GroupService; import services.LoginService; @@ -46,6 +47,7 @@ import services.SkillModService; import services.SkillService; import services.StaticService; import services.TerrainService; +import services.WeatherService; import services.chat.ChatService; import services.collections.CollectionService; import services.combat.CombatService; @@ -129,6 +131,8 @@ public class NGECore { public EquipmentService equipmentService; public TravelService travelService; public CollectionService collectionService; + public EntertainmentService entertainmentService; + public WeatherService weatherService; // Login Server public NetworkDispatch loginDispatch; @@ -140,6 +144,7 @@ public class NGECore { private ObjectDatabase creatureODB; private ObjectDatabase mailODB; + public NGECore() { @@ -198,6 +203,7 @@ public class NGECore { skillService = new SkillService(this); skillModService = new SkillModService(this); equipmentService = new EquipmentService(this); + entertainmentService = new EntertainmentService(this); // Ping Server @@ -227,6 +233,7 @@ public class NGECore { zoneDispatch.addService(travelService); zoneDispatch.addService(playerService); zoneDispatch.addService(buffService); + zoneDispatch.addService(entertainmentService); zoneServer = new MINAServer(zoneDispatch, config.getInt("ZONE.PORT")); zoneServer.start(); @@ -245,14 +252,17 @@ public class NGECore { terrainService.addPlanet(10, "dathomir", "terrain/dathomir.trn", true); terrainService.addPlanet(11, "mustafar", "terrain/mustafar.trn", true); terrainService.addPlanet(12, "kashyyyk_main", "terrain/kashyyyk_main.trn", true); - terrainService.loadSnapShotObjects(); - - // Zone services that need to be loaded after the above - simulationService = new SimulationService(this); - zoneDispatch.addService(simulationService); // Travel Points travelService.loadTravelPoints(); + simulationService = new SimulationService(this); + + terrainService.loadSnapShotObjects(); + simulationService.insertSnapShotObjects(); + + // Zone services that need to be loaded after the above + zoneDispatch.addService(simulationService); + // Static Spawns staticService.spawnStatics(); @@ -274,11 +284,15 @@ public class NGECore { zoneDispatch.addService(skillService); - travelService.startShuttleSchedule(); + //travelService.startShuttleSchedule(); + + weatherService = new WeatherService(this); + weatherService.loadPlanetSettings(); didServerCrash = false; System.out.println("Started Server."); setGalaxyStatus(2); + } diff --git a/src/protocol/swg/AddIgnoreMessage.java b/src/protocol/swg/AddIgnoreMessage.java new file mode 100644 index 00000000..44455a1c --- /dev/null +++ b/src/protocol/swg/AddIgnoreMessage.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * 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 main.NGECore; + +import org.apache.mina.core.buffer.IoBuffer; + +import engine.resources.config.Config; +import engine.resources.config.DefaultConfig; +import engine.resources.objects.SWGObject; + +public class AddIgnoreMessage extends SWGMessage { + + private SWGObject player; + private boolean type; + private String ignoreName; + + public AddIgnoreMessage(SWGObject obj, String name, boolean type) { + this.player = obj; + this.ignoreName = name; + this.type = type; + } + + @Override + public void deserialize(IoBuffer data) { + + } + + @Override + public IoBuffer serialize() { + Config config = NGECore.getInstance().getConfig(); + String server = config.getProperty("GALAXY_NAME"); + + IoBuffer result = IoBuffer.allocate(34 + server.length() + ignoreName.length()).order(ByteOrder.LITTLE_ENDIAN); + + result.putShort((short) 6); + result.putInt(0x70E9DA0F); + result.putLong(player.getObjectId()); + + result.put(getAsciiString("SWG")); + result.put(getAsciiString(server)); + result.put(getAsciiString(ignoreName)); + + result.putInt(0); + result.put((byte) ((type) ? 1 : 0)); // add = T, remove = F + result.putInt(0); + + return result.flip(); + } + +} diff --git a/src/protocol/swg/ChatOnAddFriend.java b/src/protocol/swg/ChatOnAddFriend.java index be805945..0b84e6ff 100644 --- a/src/protocol/swg/ChatOnAddFriend.java +++ b/src/protocol/swg/ChatOnAddFriend.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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; diff --git a/src/protocol/swg/ChatOnChangeFriendStatus.java b/src/protocol/swg/ChatOnChangeFriendStatus.java index 5eeb3f33..c93e5265 100644 --- a/src/protocol/swg/ChatOnChangeFriendStatus.java +++ b/src/protocol/swg/ChatOnChangeFriendStatus.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * 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; @@ -28,12 +49,9 @@ public class ChatOnChangeFriendStatus extends SWGMessage { @Override public IoBuffer serialize() { - Config config = new Config(); - config.setFilePath("nge.cfg"); - if (!(config.loadConfigFile())) { - config = DefaultConfig.getConfig(); - } + Config config = NGECore.getInstance().getConfig(); String server = config.getString("GALAXY_NAME"); + IoBuffer result = IoBuffer.allocate(100 + this.name.length() + server.length()).order(ByteOrder.LITTLE_ENDIAN); result.putShort((short)0x06); result.putInt(0x54336726); diff --git a/src/protocol/swg/EnterTicketPurchaseModeMessage.java b/src/protocol/swg/EnterTicketPurchaseModeMessage.java index 05d53ad5..04cec6fb 100644 --- a/src/protocol/swg/EnterTicketPurchaseModeMessage.java +++ b/src/protocol/swg/EnterTicketPurchaseModeMessage.java @@ -51,8 +51,7 @@ public class EnterTicketPurchaseModeMessage extends SWGMessage { public IoBuffer serialize() { final NGECore core = NGECore.getInstance(); TravelPoint nearestPoint = core.travelService.getNearestTravelPoint(player); - - IoBuffer result = IoBuffer.allocate(20 + planetName.length() + nearestPoint.getName().length()).order(ByteOrder.LITTLE_ENDIAN); + IoBuffer result = IoBuffer.allocate(11 + planetName.length() + nearestPoint.getName().length()).order(ByteOrder.LITTLE_ENDIAN); result.putShort((short) 3); result.putInt(0x904DAE1A); @@ -60,6 +59,8 @@ public class EnterTicketPurchaseModeMessage extends SWGMessage { result.put(getAsciiString(planetName)); result.put(getAsciiString(nearestPoint.getName())); + result.put((byte) 0); + return result.flip(); } diff --git a/src/protocol/swg/OkMessage.java b/src/protocol/swg/OkMessage.java new file mode 100644 index 00000000..4c31f533 --- /dev/null +++ b/src/protocol/swg/OkMessage.java @@ -0,0 +1,29 @@ +package protocol.swg; + +import java.nio.ByteOrder; + +import org.apache.mina.core.buffer.IoBuffer; + +import resources.common.StringUtilities; + +public class OkMessage extends SWGMessage { + + public OkMessage() { + + } + + @Override + public void deserialize(IoBuffer data) { + + } + + @Override + public IoBuffer serialize() { + IoBuffer buffer = IoBuffer.allocate(6).order(ByteOrder.LITTLE_ENDIAN); + buffer.putShort((short) 1); + buffer.putInt(0xA16CF9AF); + System.out.println(StringUtilities.bytesToHex(buffer.array())); + return buffer.flip(); + } + +} diff --git a/src/protocol/swg/PlanetTravelPointListResponse.java b/src/protocol/swg/PlanetTravelPointListResponse.java index 46d37683..4bd409b9 100644 --- a/src/protocol/swg/PlanetTravelPointListResponse.java +++ b/src/protocol/swg/PlanetTravelPointListResponse.java @@ -35,12 +35,10 @@ public class PlanetTravelPointListResponse extends SWGMessage { private String planetString; private Vector travelPoints; - private List planetList; - public PlanetTravelPointListResponse(String planetString, Vector travelPoints, List planetList) { + public PlanetTravelPointListResponse(String planetString, Vector travelPoints) { this.planetString = planetString; this.travelPoints = travelPoints; - this.planetList = planetList; } @Override @@ -50,7 +48,7 @@ public class PlanetTravelPointListResponse extends SWGMessage { @Override public IoBuffer serialize() { - IoBuffer result = IoBuffer.allocate(travelPoints.size() * 2).order(ByteOrder.LITTLE_ENDIAN); + IoBuffer result = IoBuffer.allocate(100).order(ByteOrder.LITTLE_ENDIAN); result.setAutoExpand(true); result.putShort((short) 6); @@ -81,8 +79,9 @@ public class PlanetTravelPointListResponse extends SWGMessage { for (TravelPoint point : travelPoints) { result.put((byte) 1); // isReachable } - result.flip(); - return result; + int size = result.position(); + result = IoBuffer.allocate(size).put(result.array(), 0, size); + return result.flip(); } } diff --git a/src/protocol/swg/ServerWeatherMessage.java b/src/protocol/swg/ServerWeatherMessage.java index dfe21b2d..e8dc0955 100644 --- a/src/protocol/swg/ServerWeatherMessage.java +++ b/src/protocol/swg/ServerWeatherMessage.java @@ -45,7 +45,7 @@ public class ServerWeatherMessage extends SWGMessage { } public IoBuffer serialize() { - IoBuffer result = IoBuffer.allocate(26).order(ByteOrder.LITTLE_ENDIAN);; + IoBuffer result = IoBuffer.allocate(22).order(ByteOrder.LITTLE_ENDIAN); result.putShort((short)3); result.putInt(0x486356EA); @@ -54,6 +54,6 @@ public class ServerWeatherMessage extends SWGMessage { result.putFloat(cloudY); result.putFloat(cloudZ); - return result; + return result.flip(); } } diff --git a/src/protocol/swg/UpdateCellPermissionMessage.java b/src/protocol/swg/UpdateCellPermissionMessage.java index fe35f240..943eb532 100644 --- a/src/protocol/swg/UpdateCellPermissionMessage.java +++ b/src/protocol/swg/UpdateCellPermissionMessage.java @@ -42,13 +42,13 @@ public class UpdateCellPermissionMessage extends SWGMessage { } public IoBuffer serialize() { - IoBuffer result = IoBuffer.allocate(128).order(ByteOrder.LITTLE_ENDIAN); + IoBuffer result = IoBuffer.allocate(15).order(ByteOrder.LITTLE_ENDIAN); result.putShort((short)3); result.putInt(0xF612499C); result.put(permission); result.putLong(cellId); - return result; + return result.flip(); } } diff --git a/src/protocol/swg/objectControllerObjects/BuffBuilderChange.java b/src/protocol/swg/objectControllerObjects/BuffBuilderChange.java deleted file mode 100644 index dcfb396c..00000000 --- a/src/protocol/swg/objectControllerObjects/BuffBuilderChange.java +++ /dev/null @@ -1,176 +0,0 @@ -package protocol.swg.objectControllerObjects; - -import java.io.UnsupportedEncodingException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.Vector; - -import org.apache.mina.core.buffer.IoBuffer; - -import protocol.swg.ObjControllerMessage; -import resources.common.Console; -import resources.objects.BuffItem; - -public class BuffBuilderChange extends ObjControllerObject { - - private int buffCost; - private int accepted; - private int startTime; - private int tickCount; - - private long objectId; - private long bufferId; - private long recipientId; - - private byte unkByte; - - private Vector buffs = new Vector(); - - public BuffBuilderChange() { - - } - - public BuffBuilderChange(long objectId, long bufferId, long recipientId, int accepted, int cost, byte unkByte) { - this.objectId = objectId; - this.bufferId = bufferId; - this.recipientId = recipientId; - this.accepted = accepted; - this.buffCost = cost; - this.unkByte = unkByte; - } - - @Override - public void deserialize(IoBuffer data) { - objectId = data.getLong(); // acting players id - tickCount = data.getInt(); // tick count - bufferId = data.getLong(); // objId - recipientId = data.getLong(); - startTime = data.getInt(); - buffCost = data.getInt(); - accepted = data.getInt(); - unkByte = data.get(); - - int size = data.getInt(); // list size - for(int i = 0; i < size; i++) { - BuffItem buff = new BuffItem(); - int stringSize; - try { - stringSize = data.getShort(); - String buffName = new String(ByteBuffer.allocate(stringSize).put(data.array(), data.position(), size).array(), "US-ASCII"); - buff.setSkillName(buffName); - Console.println("Buff Name: " + buffName); - data.position(data.position() + size); - buff.setUnknown(data.getInt()); - Console.println("Buff Unknown: " + buff.getUnknown()); - buff.setAmount(data.getInt()); - Console.println("Buff Amount: " + buff.getAmount()); - buffs.add(buff); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - - } - - } - - @Override - public IoBuffer serialize() { - IoBuffer result = IoBuffer.allocate(100).order(ByteOrder.LITTLE_ENDIAN); - - result.putInt(ObjControllerMessage.BUFF_BUILDER_CHANGE); - result.putLong(objectId); - - result.putInt(tickCount); // tickCount - result.putLong(bufferId); - result.putLong(recipientId); - result.putInt(startTime); // starting time - result.putInt(buffCost); - result.putInt(accepted); - result.put(unkByte); // default 0 - - if (buffs == null || buffs.isEmpty()){ - result.putInt(0); - } else { - result.putInt(buffs.size()); - for (BuffItem buff : buffs) { - result.put(getAsciiString(buff.getSkillName())); - result.putInt(buff.getUnknown()); - result.putInt(buff.getAmount()); - } - } - - return result.flip(); - } - - public long getBufferId() { - return bufferId; - } - - public void setBufferId(long bufferId) { - this.bufferId = bufferId; - } - - public int getBuffCost() { - return buffCost; - } - - public void setBuffCost(int buffCost) { - this.buffCost = buffCost; - } - - public int getAccepted() { - return accepted; - } - - public void setAccepted(int accepted) { - this.accepted = accepted; - } - - public long getObjectId() { - return objectId; - } - - public void setObjectId(long objId) { - this.objectId = objId; - } - - public byte getUnkByte() { - return this.unkByte; - } - - public void setUnkByte(byte unkByte) { - this.unkByte = unkByte; - } - - public int getStartTime() { - return startTime; - } - - public void setStartTime(int startTime) { - this.startTime = startTime; - } - - public long getRecipientId() { - return recipientId; - } - - public void setRecipientId(long recipientId) { - this.recipientId = recipientId; - } - - public void setBuffs(Vector buffVector) { - this.buffs = buffVector; - } - - public Vector getBuffVector() { - return this.buffs; - } - - public int getTickCount() { - return tickCount; - } - - public void setTickCount(int tickCount) { - this.tickCount = tickCount; - } -} diff --git a/src/protocol/swg/objectControllerObjects/BuffBuilderChangeMessage.java b/src/protocol/swg/objectControllerObjects/BuffBuilderChangeMessage.java new file mode 100644 index 00000000..a877944a --- /dev/null +++ b/src/protocol/swg/objectControllerObjects/BuffBuilderChangeMessage.java @@ -0,0 +1,170 @@ +package protocol.swg.objectControllerObjects; + +import java.nio.ByteOrder; +import java.util.Vector; + +import org.apache.mina.core.buffer.IoBuffer; + +import protocol.swg.ObjControllerMessage; +import resources.common.ObjControllerOpcodes; +import resources.common.StringUtilities; +import resources.objects.BuffItem; + +public class BuffBuilderChangeMessage extends ObjControllerObject { + + private int buffCost; + private int time; + + private long objectId; + private long bufferId; + private long buffRecipientId; + + private boolean accepted; + private int buffRecipientAccepted; + + private Vector statBuffs = new Vector(); + + public BuffBuilderChangeMessage() { + + } + + public BuffBuilderChangeMessage(long objectId, long bufferId, long buffRecipientId, Vector statBuffs) { + this.objectId = objectId; + this.bufferId = bufferId; + this.buffRecipientId = buffRecipientId; + this.statBuffs = statBuffs; + } + + + @Override + public void deserialize(IoBuffer buffer) { + setObjectId(buffer.getLong()); + buffer.getInt(); + setBufferId(buffer.getLong()); + setBuffRecipientId(buffer.getLong()); + setTime(buffer.getInt()); + setBuffCost(buffer.getInt()); + + byte value = buffer.get(); + if (value == (byte) 0) + setAccepted(false); + else if (value == (byte) 1) + setAccepted(true); + + setBuffRecipientAccepted(buffer.getInt()); + + int statSize = buffer.getInt(); + for (int i = 0; i < statSize; i++) { + BuffItem item = new BuffItem(); + + String statName = getAsciiString(buffer); + item.setSkillName(statName); + + int investedPoints = buffer.getInt(); + item.setInvested(investedPoints); + + int maxAmount = buffer.getInt(); + item.setBonusAmount(maxAmount); + + statBuffs.add(item); + System.out.println("Added buff item with " + investedPoints + " invested points " + " which has a bonus amount of " + maxAmount); + } + } + + @Override + public IoBuffer serialize() { + IoBuffer result = IoBuffer.allocate(65 + statBuffs.size()).order(ByteOrder.LITTLE_ENDIAN); + result.setAutoExpand(true); + + result.putInt(ObjControllerMessage.BUFF_BUILDER_CHANGE); + result.putLong(objectId); + + result.putInt(0); + + result.putLong(bufferId); + result.putLong(buffRecipientId); + + result.putInt(time); + result.putInt(buffCost); + + result.put((byte) ((accepted) ? 1 : 0)); + result.putInt(buffRecipientAccepted); + + result.putInt(statBuffs.size()); + + if (!statBuffs.isEmpty()) { + for (BuffItem item : statBuffs) { + result.put(getAsciiString(item.getSkillName())); + result.putInt(item.getInvested()); + result.putInt(item.getBonusAmount()); + } + } + + return result.flip(); + } + + public int getBuffCost() { + return buffCost; + } + + public void setBuffCost(int buffCost) { + this.buffCost = buffCost; + } + + public int getTime() { + return time; + } + + public void setTime(int time) { + this.time = time; + } + + public long getObjectId() { + return objectId; + } + + public void setObjectId(long objectId) { + this.objectId = objectId; + } + + public long getBufferId() { + return bufferId; + } + + public void setBufferId(long bufferId) { + this.bufferId = bufferId; + } + + public long getBuffRecipientId() { + return buffRecipientId; + } + + public void setBuffRecipientId(long buffRecipientId) { + this.buffRecipientId = buffRecipientId; + } + + public boolean getAccepted() { + return accepted; + } + + public void setAccepted(boolean accepted) { + this.accepted = accepted; + } + + public int getBuffRecipientAccepted() { + return buffRecipientAccepted; + } + + public void setBuffRecipientAccepted(int buffRecipientAccepted) { + this.buffRecipientAccepted = buffRecipientAccepted; + } + + public Vector getStatBuffs() { + return statBuffs; + } + + public void setStatBuffs(Vector statBuffs) { + this.statBuffs = statBuffs; + } + +} diff --git a/src/protocol/swg/objectControllerObjects/ObjectMenuRequest.java b/src/protocol/swg/objectControllerObjects/ObjectMenuRequest.java index 85a2d464..901314b9 100644 --- a/src/protocol/swg/objectControllerObjects/ObjectMenuRequest.java +++ b/src/protocol/swg/objectControllerObjects/ObjectMenuRequest.java @@ -47,11 +47,9 @@ public class ObjectMenuRequest extends ObjControllerObject { int listSize = buffer.getInt(); for(int i = 0; i < listSize; i++) { RadialOptions radial = new RadialOptions(); - if(buffer.get() == 0) // option # - return; + buffer.get(); radial.setParentId(buffer.get()); - radial.setOptionId(buffer.get()); - buffer.get(); + radial.setOptionId(buffer.getShort()); radial.setOptionType(buffer.get()); int size = buffer.getInt(); if(size > 0) { diff --git a/src/protocol/swg/objectControllerObjects/ObjectMenuResponse.java b/src/protocol/swg/objectControllerObjects/ObjectMenuResponse.java index b4450dc9..1d1ae2c5 100644 --- a/src/protocol/swg/objectControllerObjects/ObjectMenuResponse.java +++ b/src/protocol/swg/objectControllerObjects/ObjectMenuResponse.java @@ -73,12 +73,13 @@ public class ObjectMenuResponse extends ObjControllerObject { result.putInt(size); if(size > 0) { - byte counter = 1; + byte counter = 0; for(RadialOptions radialOption : radialOptions) { - result.put(counter++); + result.put(++counter); result.put(radialOption.getParentId()); result.putShort(radialOption.getOptionId()); - result.put(radialOption.getOptionType()); + //result.put(radialOption.getOptionType()); + result.put((byte) 3); if(radialOption.getDescription().length() > 0) result.put(getUnicodeString(radialOption.getDescription())); @@ -87,7 +88,6 @@ public class ObjectMenuResponse extends ObjControllerObject { } } - result.put(radialCount); int packetSize = result.position(); diff --git a/src/resources/common/BuffBuilder.java b/src/resources/common/BuffBuilder.java new file mode 100644 index 00000000..c376ae5a --- /dev/null +++ b/src/resources/common/BuffBuilder.java @@ -0,0 +1,70 @@ +package resources.common; + +public class BuffBuilder { + private String statName; + private String statAffects; + private int maxTimesApplied; + private int affectAmount; + private String requiredExperience; + + private int entBonus; + + public BuffBuilder() { + + } + + public String getStatName() { + return statName; + } + + public void setStatName(String statName) { + this.statName = statName; + } + + public String getStatAffects() { + return statAffects; + } + + public void setStatAffects(String statAffects) { + this.statAffects = statAffects; + } + + public int getMaxTimesApplied() { + return maxTimesApplied; + } + + public void setMaxTimesApplied(int maxTimesApplied) { + this.maxTimesApplied = maxTimesApplied; + } + + public int getAffectAmount() { + return affectAmount; + } + + public void setAffectAmount(int affectAmount) { + this.affectAmount = affectAmount; + } + + public String getRequiredExperience() { + return requiredExperience; + } + + public void setRequiredExperience(String requiredExperience) { + this.requiredExperience = requiredExperience; + } + + public int getTotalAffected() { + // 10 * 10 = 100 + int totalAffected = getMaxTimesApplied() * getAffectAmount(); + Console.println("Total Affected: " + totalAffected + getEntBonus()); + return totalAffected + getEntBonus(); + } + + public int getEntBonus() { + return entBonus; + } + + public void setEntBonus(int entBonus) { + this.entBonus = entBonus; + } +} diff --git a/src/resources/common/MathUtilities.java b/src/resources/common/MathUtilities.java new file mode 100644 index 00000000..8cf73cc0 --- /dev/null +++ b/src/resources/common/MathUtilities.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * 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.common; + +import engine.resources.scene.*; + +public class MathUtilities { + + public static Quaternion rotateQuaternion(Quaternion quaternion, float radians, Point3D axis) { + + float sin = (float) Math.sin(radians / 2); + + Quaternion rotateQ = new Quaternion((float) Math.cos(radians / 2), axis.x * sin, axis.y * sin, axis.z * sin); + + return multiplyQuaternions(rotateQ, quaternion); + + } + + public static Quaternion multiplyQuaternions(Quaternion q1, Quaternion q2) { + + return new Quaternion(q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z, + q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y, + q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z, + q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x); + + } + +} diff --git a/src/resources/common/collidables/AbstractCollidable.java b/src/resources/common/collidables/AbstractCollidable.java new file mode 100644 index 00000000..ae20ceb1 --- /dev/null +++ b/src/resources/common/collidables/AbstractCollidable.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * 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.common.collidables; + +import java.util.Vector; + +import main.NGECore; + +import org.python.core.Py; +import org.python.core.PyObject; + +import engine.resources.objects.SWGObject; +import engine.resources.scene.Planet; + +public abstract class AbstractCollidable { + + private PyObject callback; + public Vector collidedObjects = new Vector(); + private Planet planet; + + public abstract boolean doesCollide(SWGObject obj); + + public PyObject getCallback() { + return callback; + } + + public void setCallback(PyObject callback) { + this.callback = callback; + } + + public void addCollidedObject(SWGObject obj) { + collidedObjects.add(obj); + } + + public void removeCollidedObject(SWGObject obj) { + collidedObjects.remove(obj); + } + + public boolean isInCollisionList(SWGObject obj) { + return collidedObjects.contains(obj); + } + + public void doCollisionCheck(SWGObject obj) { + // check if already collided + if(isInCollisionList(obj) && doesCollide(obj)) { + return; + } else if(isInCollisionList(obj) && !doesCollide(obj)) { + removeCollidedObject(obj); + } else if(doesCollide(obj) && !isInCollisionList(obj)) { + addCollidedObject(obj); + if(getCallback() != null) + getCallback().__call__(Py.java2py(NGECore.getInstance()), Py.java2py(obj), Py.java2py(this)); + } + } + + public Planet getPlanet() { + return planet; + } + + public void setPlanet(Planet planet) { + this.planet = planet; + } + +} diff --git a/src/resources/common/collidables/CollidableBox.java b/src/resources/common/collidables/CollidableBox.java new file mode 100644 index 00000000..4fd64080 --- /dev/null +++ b/src/resources/common/collidables/CollidableBox.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * 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.common.collidables; + +public class CollidableBox { + + + +} diff --git a/src/resources/common/collidables/CollidableCircle.java b/src/resources/common/collidables/CollidableCircle.java new file mode 100644 index 00000000..15cdf75e --- /dev/null +++ b/src/resources/common/collidables/CollidableCircle.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * 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.common.collidables; + +import engine.resources.objects.SWGObject; +import engine.resources.scene.Planet; +import engine.resources.scene.Point3D; + +public class CollidableCircle extends AbstractCollidable { + + private Point3D center; + private float radius; + // for bh traps + private boolean useYAxis = false; + + public CollidableCircle(Point3D center, float radius, Planet planet) { + this.setCenter(center); + this.setRadius(radius); + this.setPlanet(planet); + } + + public Point3D getCenter() { + return center; + } + + public void setCenter(Point3D center) { + this.center = center; + } + + public float getRadius() { + return radius; + } + + public void setRadius(float radius) { + this.radius = radius; + } + + public boolean isUseYAxis() { + return useYAxis; + } + + public void setUseYAxis(boolean useYAxis) { + this.useYAxis = useYAxis; + } + + @Override + public boolean doesCollide(SWGObject obj) { + Point3D objectPos = obj.getWorldPosition(); + if(useYAxis) { + return center.getDistance(objectPos) <= radius && objectPos.y == center.y; + } else { + return center.getDistance(objectPos) <= radius; + } + } +} diff --git a/src/resources/objects/Buff.java b/src/resources/objects/Buff.java index c7ee85de..db19f967 100644 --- a/src/resources/objects/Buff.java +++ b/src/resources/objects/Buff.java @@ -31,6 +31,7 @@ import main.NGECore; import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.buffer.SimpleBufferAllocator; +import resources.common.BuffBuilder; import resources.objects.creature.CreatureObject; import com.sleepycat.persist.model.NotPersistent; @@ -40,7 +41,7 @@ import engine.clientdata.ClientFileManager; import engine.clientdata.visitors.DatatableVisitor; import engine.resources.common.CRC; -@Persistent(version=6) +@Persistent(version=7) public class Buff implements IListObject { @NotPersistent @@ -67,6 +68,7 @@ public class Buff implements IListObject { @NotPersistent private ScheduledFuture removalTask; private int stacks = 1; + private long groupBufferId; public Buff(String buffName, long ownerId) { @@ -416,5 +418,17 @@ public class Buff implements IListObject { public void setStacks(int stacks) { this.stacks = stacks; } + + public boolean isGroupBuff() { + return effect1Name.equals("group"); + } + + public long getGroupBufferId() { + return groupBufferId; + } + + public void setGroupBufferId(long groupBufferId) { + this.groupBufferId = groupBufferId; + } } diff --git a/src/resources/objects/BuffItem.java b/src/resources/objects/BuffItem.java index a7eb3ab0..8d647d4a 100644 --- a/src/resources/objects/BuffItem.java +++ b/src/resources/objects/BuffItem.java @@ -23,17 +23,17 @@ package resources.objects; public class BuffItem { private String skillName; - private int unknown; - private int amount; + private int invested; + private int bonusAmount; // expertise bonus (50%*4 = 200) which would then result in bonusAmount + (maxTimesApplied * affectAmount) = result public BuffItem() { } - public BuffItem(String skillName, int unknown, int amount) { + public BuffItem(String skillName, int invested, int amount) { this.skillName = skillName; - this.unknown = unknown; - this.amount = amount; + this.invested = invested; + this.bonusAmount = amount; } public String getSkillName() { @@ -44,19 +44,19 @@ public class BuffItem { this.skillName = skillName; } - public int getUnknown() { - return unknown; + public int getInvested() { + return invested; } - public void setUnknown(int unknown) { - this.unknown = unknown; + public void setInvested(int invested) { + this.invested = invested; } - public int getAmount() { - return amount; + public int getBonusAmount() { + return bonusAmount; } - public void setAmount(int amount) { - this.amount = amount; + public void setBonusAmount(int amount) { + this.bonusAmount = amount; } } diff --git a/src/resources/objects/building/BuildingMessageBuilder.java b/src/resources/objects/building/BuildingMessageBuilder.java index 224e0a8d..606f5f78 100644 --- a/src/resources/objects/building/BuildingMessageBuilder.java +++ b/src/resources/objects/building/BuildingMessageBuilder.java @@ -21,6 +21,93 @@ ******************************************************************************/ package resources.objects.building; -public class BuildingMessageBuilder { +import java.nio.ByteOrder; +import org.apache.mina.core.buffer.IoBuffer; +import resources.objects.ObjectMessageBuilder; + +public class BuildingMessageBuilder extends ObjectMessageBuilder { + + public BuildingMessageBuilder(BuildingObject buildingObject) { + setObject(buildingObject); + } + + public IoBuffer buildBaseline3() { + + BuildingObject building = (BuildingObject) object; + IoBuffer buffer = bufferPool.allocate(100, false).order(ByteOrder.LITTLE_ENDIAN); + buffer.setAutoExpand(true); + + buffer.putShort((short) 0x0D); + buffer.putFloat(building.getComplexity()); + buffer.put(getAsciiString(building.getStfFilename())); + buffer.putInt(0); + buffer.put(getAsciiString(building.getStfName())); + buffer.putInt(0); + buffer.putInt(255); + buffer.putInt(0); + buffer.putInt(0); + buffer.putInt(0); + buffer.putInt(0); + buffer.putInt(1).order(ByteOrder.BIG_ENDIAN); + buffer.putInt(0); + buffer.putInt(0); + buffer.putShort((short) 0); + buffer.putInt(0x201C); + buffer.put((byte) 1); + + int size = buffer.position(); + buffer = bufferPool.allocate(size, false).put(buffer.array(), 0, size); + + buffer.flip(); + buffer = createBaseline("BUIO", (byte) 3, buffer, size); + + return buffer; + + } + + public IoBuffer buildBaseline6() { + + BuildingObject building = (BuildingObject) object; + IoBuffer buffer = bufferPool.allocate(100, false).order(ByteOrder.LITTLE_ENDIAN); + buffer.setAutoExpand(true); + + buffer.putShort((short) 8); + buffer.putInt(0x43); + + buffer.put(getAsciiString(building.getDetailFilename())); + buffer.putInt(0); + buffer.put(getAsciiString(building.getDetailName())); + buffer.putInt(0); + buffer.put((byte) 0); + buffer.putInt(0); + buffer.putInt(0); + buffer.putInt(0); + buffer.putInt(0); + buffer.putInt(0); + buffer.putInt(0); + buffer.putInt(0); + buffer.putInt(0); + + int size = buffer.position(); + buffer = bufferPool.allocate(size, false).put(buffer.array(), 0, size); + + buffer.flip(); + buffer = createBaseline("BUIO", (byte) 6, buffer, size); + + return buffer; + + } + + + @Override + public void sendListDelta(byte viewType, short updateType, IoBuffer buffer) { + // TODO Auto-generated method stub + + } + + @Override + public void sendBaselines() { + + } } diff --git a/src/resources/objects/building/BuildingObject.java b/src/resources/objects/building/BuildingObject.java index a1267703..482e9cb2 100644 --- a/src/resources/objects/building/BuildingObject.java +++ b/src/resources/objects/building/BuildingObject.java @@ -21,14 +21,10 @@ ******************************************************************************/ package resources.objects.building; - - import java.util.concurrent.atomic.AtomicReference; - import resources.objects.cell.CellObject; - import com.sleepycat.persist.model.Entity; - +import com.sleepycat.persist.model.NotPersistent; import engine.clients.Client; import engine.resources.container.Traverser; import engine.resources.objects.SWGObject; @@ -39,18 +35,17 @@ import engine.resources.scene.Quaternion; @Entity public class BuildingObject extends SWGObject { + @NotPersistent + private BuildingMessageBuilder messageBuilder; + public BuildingObject() { super(); + messageBuilder = new BuildingMessageBuilder(this); } public BuildingObject(long objectID, Planet planet, Point3D position, Quaternion orientation, String Template) { super(objectID, planet, position, orientation, Template); - } - - @Override - public void sendBaselines(Client client) { - // TODO Auto-generated method stub - + messageBuilder = new BuildingMessageBuilder(this); } public CellObject getCellByCellNumber(final int cellNumber) { @@ -73,5 +68,17 @@ public class BuildingObject extends SWGObject { } - + @Override + public void sendBaselines(Client destination) { + + if(destination == null || destination.getSession() == null) { + System.out.println("NULL session"); + return; + } + + destination.getSession().write(messageBuilder.buildBaseline3()); + destination.getSession().write(messageBuilder.buildBaseline6()); + + } + } diff --git a/src/resources/objects/cell/CellMessageBuilder.java b/src/resources/objects/cell/CellMessageBuilder.java index 63f5592b..dd627e06 100644 --- a/src/resources/objects/cell/CellMessageBuilder.java +++ b/src/resources/objects/cell/CellMessageBuilder.java @@ -21,6 +21,78 @@ ******************************************************************************/ package resources.objects.cell; -public class CellMessageBuilder { +import java.nio.ByteOrder; +import org.apache.mina.core.buffer.IoBuffer; + +import resources.objects.ObjectMessageBuilder; +import resources.objects.building.BuildingObject; + +public class CellMessageBuilder extends ObjectMessageBuilder { + + public CellMessageBuilder(CellObject cellObject) { + setObject(cellObject); + } + + public IoBuffer buildBaseline3() { + + CellObject cell = (CellObject) object; + IoBuffer buffer = bufferPool.allocate(27, false).order(ByteOrder.LITTLE_ENDIAN); + + buffer.putShort((short) 6); + buffer.putFloat(0); + buffer.putShort((short) 0); + + buffer.putInt(0); + buffer.putShort((short) 0); + + buffer.putInt(0); + buffer.putInt(0); + buffer.put((byte) 1); + buffer.putInt(cell.getCellNumber()); + + int size = buffer.position(); + + buffer.flip(); + buffer = createBaseline("SCLT", (byte) 3, buffer, size); + + return buffer; + + } + + public IoBuffer buildBaseline6() { + + IoBuffer buffer = bufferPool.allocate(30, false).order(ByteOrder.LITTLE_ENDIAN); + + buffer.putShort((short) 4); + buffer.putInt(0x43); + buffer.putInt(0); + buffer.putInt(0); + buffer.putInt(0); + buffer.putInt(0); + buffer.putInt(0); + buffer.putInt(0); + + int size = buffer.position(); + + buffer.flip(); + buffer = createBaseline("SCLT", (byte) 6, buffer, size); + + return buffer; + + } + + + + @Override + public void sendListDelta(byte viewType, short updateType, IoBuffer buffer) { + // TODO Auto-generated method stub + + } + + @Override + public void sendBaselines() { + // TODO Auto-generated method stub + + } } diff --git a/src/resources/objects/cell/CellObject.java b/src/resources/objects/cell/CellObject.java index a32e33b1..bf8670b8 100644 --- a/src/resources/objects/cell/CellObject.java +++ b/src/resources/objects/cell/CellObject.java @@ -21,10 +21,10 @@ ******************************************************************************/ package resources.objects.cell; +import protocol.swg.UpdateCellPermissionMessage; - +import com.sleepycat.persist.model.NotPersistent; import com.sleepycat.persist.model.Persistent; - import engine.clients.Client; import engine.resources.objects.SWGObject; import engine.resources.scene.Planet; @@ -35,18 +35,23 @@ import engine.resources.scene.Quaternion; public class CellObject extends SWGObject { private int cellNumber = 0; + @NotPersistent + private CellMessageBuilder messageBuilder; public CellObject() { super(); + messageBuilder = new CellMessageBuilder(this); } public CellObject(long objectID, Planet planet, int cellNumber) { - super(objectID, planet, new Point3D(0, 0, 0), new Quaternion(0, 0, 0, 1), "object/cell/shared_cell.iff"); + super(objectID, planet, new Point3D(0, 0, 0), new Quaternion(1, 0, 0, 0), "object/cell/shared_cell.iff"); setCellNumber(cellNumber); + messageBuilder = new CellMessageBuilder(this); } public CellObject(long objectID, Planet planet) { - super(objectID, planet, new Point3D(0, 0, 0), new Quaternion(0, 0, 0, 1), "object/cell/shared_cell.iff"); + super(objectID, planet, new Point3D(0, 0, 0), new Quaternion(1, 0, 0, 0), "object/cell/shared_cell.iff"); + messageBuilder = new CellMessageBuilder(this); } public int getCellNumber() { @@ -62,8 +67,17 @@ public class CellObject extends SWGObject { } @Override - public void sendBaselines(Client client) { - // TODO Auto-generated method stub + public void sendBaselines(Client destination) { + + if(destination == null || destination.getSession() == null) { + System.out.println("NULL session"); + return; + } + + destination.getSession().write(messageBuilder.buildBaseline3()); + destination.getSession().write(messageBuilder.buildBaseline6()); + destination.getSession().write(new UpdateCellPermissionMessage((byte) 1, getObjectID()).serialize()); + } diff --git a/src/resources/objects/creature/CreatureMessageBuilder.java b/src/resources/objects/creature/CreatureMessageBuilder.java index 5ce2cfbf..ac7ceac5 100644 --- a/src/resources/objects/creature/CreatureMessageBuilder.java +++ b/src/resources/objects/creature/CreatureMessageBuilder.java @@ -119,8 +119,8 @@ public class CreatureMessageBuilder extends ObjectMessageBuilder { buffer.putInt(0x3A98); buffer.put((byte) 1); + buffer.put((byte) creature.getPosture()); buffer.put((byte) 0); - buffer.put((byte) 1); buffer.putLong(creature.getOwnerId()); @@ -535,7 +535,7 @@ public class CreatureMessageBuilder extends ObjectMessageBuilder { } - public IoBuffer buildSpeedModDelta(float speed) { + public IoBuffer buildSpeedModBaseDelta(float speed) { IoBuffer buffer = bufferPool.allocate(4, false).order(ByteOrder.LITTLE_ENDIAN); buffer.putFloat(speed); @@ -546,6 +546,19 @@ public class CreatureMessageBuilder extends ObjectMessageBuilder { return buffer; } + + public IoBuffer buildSpeedModDelta(float speedModifier) { + + IoBuffer buffer = bufferPool.allocate(4, false).order(ByteOrder.LITTLE_ENDIAN); + buffer.putFloat(speedModifier); + int size = buffer.position(); + buffer.flip(); + buffer = createDelta("CREO", (byte) 4, (short) 1, (short) 5, buffer, size + 4); + + return buffer; + + } + public IoBuffer buildTurnRadiusDelta(float turnRadius) { diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index 14a389e0..1e964681 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -45,6 +45,7 @@ import engine.clients.Client; import resources.objects.Buff; import resources.objects.DamageOverTime; import resources.objects.SWGList; +import engine.resources.common.CRC; import engine.resources.objects.IPersistent; import engine.resources.objects.MissionCriticalObject; import engine.resources.objects.SWGObject; @@ -501,7 +502,7 @@ public class CreatureObject extends TangibleObject implements IPersistent { synchronized(objectMutex) { this.speedMultiplierBase = speedMultiplierBase; } - IoBuffer speedDelta = messageBuilder.buildSpeedModDelta(speedMultiplierBase); + IoBuffer speedDelta = messageBuilder.buildSpeedModBaseDelta(speedMultiplierBase); notifyObservers(speedDelta, true); @@ -517,6 +518,9 @@ public class CreatureObject extends TangibleObject implements IPersistent { synchronized(objectMutex) { this.speedMultiplierMod = speedMultiplierMod; } + IoBuffer speedDelta = messageBuilder.buildSpeedModDelta(speedMultiplierMod); + + notifyObservers(speedDelta, true); } public long getListenToId() { diff --git a/src/resources/objects/player/PlayerMessageBuilder.java b/src/resources/objects/player/PlayerMessageBuilder.java index ff24f432..452acc19 100644 --- a/src/resources/objects/player/PlayerMessageBuilder.java +++ b/src/resources/objects/player/PlayerMessageBuilder.java @@ -562,6 +562,44 @@ public class PlayerMessageBuilder extends ObjectMessageBuilder { } + public IoBuffer buildIgnoreAddDelta(String ignoreName) { + IoBuffer buffer = bufferPool.allocate(30, false).order(ByteOrder.LITTLE_ENDIAN); + PlayerObject player = (PlayerObject) object; + + buffer.putInt(1); + buffer.putInt(player.getIgnoreListUpdateCounter()); + + buffer.put((byte) 1); // updateType (SubType) + + buffer.putShort((short) player.getIgnoreList().indexOf(ignoreName)); + buffer.put(getAsciiString(ignoreName)); + + int size = buffer.position(); + buffer.flip(); + + buffer = createDelta("PLAY", (byte) 9, (short) 1, (short) 8, buffer, size + 4); + + return buffer; + } + + public IoBuffer buildIgnoreRemoveDelta(String removeName) { + IoBuffer buffer = bufferPool.allocate(30, false).order(ByteOrder.LITTLE_ENDIAN); + PlayerObject player = (PlayerObject) object; + + buffer.putInt(1); + buffer.putInt(player.getIgnoreListUpdateCounter()); + + buffer.put((byte) 0); + buffer.putShort((short) player.getIgnoreList().indexOf(removeName)); + + int size = buffer.position(); + buffer.flip(); + + buffer = createDelta("PLAY", (byte) 9, (short) 1, (short) 8, buffer, size + 4); + + return buffer; + } + public int getProfData(String profession) { switch (profession) { diff --git a/src/resources/objects/player/PlayerObject.java b/src/resources/objects/player/PlayerObject.java index a5f10e4f..3b72b9d2 100644 --- a/src/resources/objects/player/PlayerObject.java +++ b/src/resources/objects/player/PlayerObject.java @@ -438,6 +438,22 @@ public class PlayerObject extends SWGObject { } } + public void ignoreAdd(String ignoreName) { + synchronized(objectMutex) { + setIgnoreListUpdateCounter(getIgnoreListUpdateCounter() + 1); + getContainer().getClient().getSession().write(messageBuilder.buildIgnoreAddDelta(ignoreName)); + ignoreList.add(ignoreName); + } + } + + public void ignoreRemove(String removeName) { + synchronized(objectMutex) { + setIgnoreListUpdateCounter(getIgnoreListUpdateCounter() + 1); + getContainer().getClient().getSession().write(messageBuilder.buildIgnoreRemoveDelta(removeName)); + ignoreList.remove(removeName); + } + } + public void setIgnoreListUpdateCounter(int ignoreListUpdateCounter) { synchronized(objectMutex) { this.ignoreListUpdateCounter = ignoreListUpdateCounter; diff --git a/src/resources/objects/staticobject/StaticMessageBuilder.java b/src/resources/objects/staticobject/StaticMessageBuilder.java index 696954f3..41aaa4ba 100644 --- a/src/resources/objects/staticobject/StaticMessageBuilder.java +++ b/src/resources/objects/staticobject/StaticMessageBuilder.java @@ -41,9 +41,11 @@ public class StaticMessageBuilder extends ObjectMessageBuilder { buffer.putShort((short) 4); buffer.putInt(0); + //buffer.putShort((short) 0); buffer.put(getAsciiString(object.getStfFilename())); buffer.putInt(0); + //buffer.putShort((short) 0); buffer.put(getAsciiString(object.getStfName())); buffer.putInt(0); buffer.putInt(0xFF); @@ -63,9 +65,11 @@ public class StaticMessageBuilder extends ObjectMessageBuilder { buffer.setAutoExpand(true); buffer.putShort((short) 2); buffer.putInt(0x92); + //buffer.putShort((short) 0); buffer.put(getAsciiString(object.getDetailFilename())); buffer.putInt(0); buffer.put(getAsciiString(object.getDetailName())); + // buffer.putShort((short) 0); int size = buffer.position(); buffer = bufferPool.allocate(size, false).put(buffer.array(), 0, size); diff --git a/src/resources/objects/staticobject/StaticObject.java b/src/resources/objects/staticobject/StaticObject.java index 1bb2380c..28b9d797 100644 --- a/src/resources/objects/staticobject/StaticObject.java +++ b/src/resources/objects/staticobject/StaticObject.java @@ -55,8 +55,8 @@ public class StaticObject extends SWGObject { return; } - destination.getSession().write(messageBuilder.buildBaseline3()); - destination.getSession().write(messageBuilder.buildBaseline6()); + //destination.getSession().write(messageBuilder.buildBaseline3()); + //destination.getSession().write(messageBuilder.buildBaseline6()); } diff --git a/src/services/BuffService.java b/src/services/BuffService.java index 3012a962..ef6fda27 100644 --- a/src/services/BuffService.java +++ b/src/services/BuffService.java @@ -28,28 +28,19 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; - - - - - - - - - - import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.session.IoSession; import protocol.swg.ObjControllerMessage; -import protocol.swg.objectControllerObjects.BuffBuilderChange; import protocol.swg.objectControllerObjects.BuffBuilderStartMessage; import resources.common.Console; import resources.common.FileUtilities; import resources.common.ObjControllerOpcodes; import resources.objects.Buff; +import resources.objects.BuffItem; import resources.objects.DamageOverTime; import resources.objects.creature.CreatureObject; +import resources.objects.group.GroupObject; import resources.objects.player.PlayerObject; import main.NGECore; import engine.clients.Client; @@ -60,7 +51,7 @@ import engine.resources.service.INetworkRemoteEvent; public class BuffService implements INetworkDispatch { private NGECore core; - private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); + private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); public BuffService(NGECore core) { this.core = core; @@ -68,83 +59,7 @@ public class BuffService implements INetworkDispatch { @Override public void insertOpcodes(Map swgOpcodes, Map objControllerOpcodes) { - // BUFF_BUILDER_CHANGE sent every time something is clicked on in the Buff Builder. It's also sent when the buff session is started. - objControllerOpcodes.put(ObjControllerOpcodes.BUFF_BUILDER_CHANGE, new INetworkRemoteEvent() { - - @Override - public void handlePacket(IoSession session, IoBuffer data) throws Exception { - Console.println("BUFF_BUILDER_CHANGE RECIEVED"); - data.order(ByteOrder.LITTLE_ENDIAN); - - Client client = core.getClient((Integer) session.getAttribute("connectionId")); - - if(client == null) - return; - - SWGObject sender = client.getParent(); - - if(sender == null) - return; - - BuffBuilderChange changeMessage = new BuffBuilderChange(); - changeMessage.deserialize(data); - - SWGObject recipient = core.objectService.getObject(changeMessage.getRecipientId()); - - if (recipient == null || recipient.getClient() == null) - return; - - if (sender.getClient().getSession().containsAttribute("buffWorkshop")) { - - long attribute = (long) sender.getClient().getSession().getAttribute("buffWorkshop"); - Console.println("Sender Attribute = " + attribute); - Console.println("Recipient ID (Packet) = " + changeMessage.getRecipientId()); - - if (attribute == changeMessage.getObjectId()) { - // TODO: accepted checked? give buff - Console.println("Buffer buffing themselves!"); - return; - } - - else if (attribute == changeMessage.getRecipientId() && attribute != changeMessage.getObjectId()) { - Console.println("Attribute check passed!"); // LAST TRIED BYTE 6 - BuffBuilderChange recievingMsg = new BuffBuilderChange(recipient.getObjectId(), changeMessage.getBufferId(), changeMessage.getRecipientId(), 0, changeMessage.getBuffCost(), (byte) 7); - recievingMsg.setStartTime(changeMessage.getStartTime()); - recievingMsg.setTickCount(changeMessage.getTickCount() + 1); - - ObjControllerMessage objRcController = new ObjControllerMessage(0x23, recievingMsg); - recipient.getClient().getSession().write(objRcController.serialize()); - Console.println("Msg sent to: " + recipient.getCustomName() + " that has an ID of: " + recipient.getObjectId()); - Console.println("ObjectId: " + recievingMsg.getObjectId()); - Console.println("BufferId: " + recievingMsg.getBufferId()); - Console.println("RecipientId: " + recievingMsg.getRecipientId()); - Console.println("Buff Cost: " + recievingMsg.getBuffCost()); - Console.println("MessageRecipientId: " + recievingMsg.getRecipientId()); - - Console.println("BYTE: " + recievingMsg.getUnkByte()); - - } - - } else { - - // Don't need a Buff Recipient Window for buffing themselves.. - if (changeMessage.getObjectId() == changeMessage.getRecipientId()) { - sender.getClient().getSession().setAttribute("buffWorkshop", recipient.getObjectId()); - Console.println("Sender attribute set to: " + sender.getClient().getSession().getAttribute("buffWorkshop").toString()); - return; - } - - BuffBuilderStartMessage startMsg = new BuffBuilderStartMessage(recipient.getObjectId(), sender.getObjectId(), recipient.getObjectId()); - ObjControllerMessage objController = new ObjControllerMessage(11, startMsg); - recipient.getClient().getSession().write(objController.serialize()); - - recipient.getClient().getSession().setAttribute("buffWorkshop", changeMessage.getObjectId()); - Console.println("Recipient attribute set to: " + recipient.getClient().getSession().getAttribute("buffWorkshop").toString()); - sender.getClient().getSession().setAttribute("buffWorkshop", recipient.getObjectId()); - Console.println("Sender attribute set to: " + sender.getClient().getSession().getAttribute("buffWorkshop").toString()); - } - } - }); + } @Override @@ -159,6 +74,16 @@ public class BuffService implements INetworkDispatch { return; }*/ + final Buff buff = new Buff(buffName, creature.getObjectID()); + if(buff.isGroupBuff()) { + addGroupBuff(creature, buffName); + } else { + doAddBuff(creature, buffName); + } + } + + public Buff doAddBuff(final CreatureObject creature, String buffName) { + final Buff buff = new Buff(buffName, creature.getObjectID()); buff.setTotalPlayTime(((PlayerObject) creature.getSlottedObject("ghost")).getTotalPlayTime()); @@ -177,7 +102,7 @@ public class BuffService implements INetworkDispatch { } if (otherBuff.getRemainingDuration() > buff.getDuration() && otherBuff.getStacks() >= otherBuff.getMaxStacks()) { - return; + return null; } } @@ -185,7 +110,7 @@ public class BuffService implements INetworkDispatch { break; } else { System.out.println("buff not added:" + buffName); - return; + return null; } } @@ -212,6 +137,12 @@ public class BuffService implements INetworkDispatch { } + for (String effect : buff.getParticleEffect().split(",")) { + creature.playEffectObject(effect, buff.getBuffName()); + } + + return buff; + } public void removeBuffFromCreature(CreatureObject creature, Buff buff) { @@ -227,6 +158,10 @@ public class BuffService implements INetworkDispatch { core.scriptService.callScript("scripts/buffs/", "removeBuff", buff.getBuffName(), core, creature, buff); creature.removeBuff(buff); + for (String effect : buff.getParticleEffect().split(",")) { + creature.stopEffectObject(buff.getBuffName()); + } + } @@ -237,6 +172,11 @@ public class BuffService implements INetworkDispatch { for(final Buff buff : creature.getBuffList().get().toArray(new Buff[] { })) { if (buff.getGroup1().startsWith("setBonus")) { continue; } + + if(buff.isGroupBuff() && buff.getGroupBufferId() != creature.getObjectID()) { + removeBuffFromCreature(creature, buff); + continue; + } if(buff.getRemainingDuration() > 0 && buff.getDuration() > 0) { ScheduledFuture task = scheduler.schedule(new Runnable() { @@ -259,6 +199,24 @@ public class BuffService implements INetworkDispatch { } - + public void addGroupBuff(final CreatureObject buffer, String buffName) { + + if(buffer.getGroupId() == 0) { + doAddBuff(buffer, buffName); + return; + } + + GroupObject group = (GroupObject) core.objectService.getObject(buffer.getGroupId()); + + if(group == null) { + doAddBuff(buffer, buffName); + return; + } + + for(SWGObject member : group.getMemberList()) { + Buff buff = doAddBuff((CreatureObject) member, buffName); + buff.setGroupBufferId(buffer.getObjectID()); + } + } } diff --git a/src/services/CharacterService.java b/src/services/CharacterService.java index d629d31f..5298d0da 100644 --- a/src/services/CharacterService.java +++ b/src/services/CharacterService.java @@ -218,6 +218,7 @@ public class CharacterService implements INetworkDispatch { object.setPosition(new Point3D(3528, 0, -4804)); object.setCashCredits(100); object.setBankCredits(1000); + object.setOptionsBitmask(0x80); //object.setPosition(new Point3D(0, 0, 0)); object.setOrientation(new Quaternion(1, 0, 0, 0)); object.setLevel((short) 1); diff --git a/src/services/EntertainmentService.java b/src/services/EntertainmentService.java new file mode 100644 index 00000000..896f2525 --- /dev/null +++ b/src/services/EntertainmentService.java @@ -0,0 +1,185 @@ +package services; + +import java.nio.ByteOrder; +import java.util.Map; +import java.util.Vector; +import java.util.concurrent.ConcurrentHashMap; + +import main.NGECore; + +import org.apache.mina.core.buffer.IoBuffer; +import org.apache.mina.core.session.IoSession; + +import protocol.swg.ObjControllerMessage; +import protocol.swg.OkMessage; +import protocol.swg.objectControllerObjects.BuffBuilderChangeMessage; +import protocol.swg.objectControllerObjects.BuffBuilderStartMessage; +import resources.common.BuffBuilder; +import resources.common.Console; +import resources.common.ObjControllerOpcodes; +import resources.objects.Buff; +import resources.objects.BuffItem; +import resources.objects.creature.CreatureObject; +import resources.objects.player.PlayerObject; +import engine.clientdata.ClientFileManager; +import engine.clientdata.visitors.DatatableVisitor; +import engine.clients.Client; +import engine.resources.objects.SWGObject; +import engine.resources.service.INetworkDispatch; +import engine.resources.service.INetworkRemoteEvent; + +public class EntertainmentService implements INetworkDispatch { + + private NGECore core; + + private Vector buffBuilderSkills = new Vector(); + + public EntertainmentService(NGECore core) { + this.core = core; + populateSkillCaps(); + } + + @Override + public void insertOpcodes(Map swgOpcodes, Map objControllerOpcodes) { + objControllerOpcodes.put(ObjControllerOpcodes.BUFF_BUILDER_CHANGE, new INetworkRemoteEvent() { + + @Override + public void handlePacket(IoSession session, IoBuffer data) throws Exception { + Console.println("BUFF_BUILDER_CHANGE RECIEVED"); + data.order(ByteOrder.LITTLE_ENDIAN); + + Client client = core.getClient((Integer) session.getAttribute("connectionId")); + + if(client == null) + return; + + SWGObject sender = client.getParent(); + + if(sender == null) + return; + + BuffBuilderChangeMessage sentPacket = new BuffBuilderChangeMessage(); + sentPacket.deserialize(data); + + Vector statBuffs = sentPacket.getStatBuffs(); + + /*for (BuffItem item : statBuffs) { + System.out.println("Buff Name: " + item.getSkillName()); + System.out.println("Ents bonus to item: " + item.getAmount()); + }*/ + + SWGObject buffer = core.objectService.getObject(sentPacket.getBufferId()); + SWGObject buffRecipient = core.objectService.getObject(sentPacket.getBuffRecipientId()); + + Console.println("Packet Sender ID: " + sender.getObjectId()); + + if (buffer != buffRecipient) { + + BuffBuilderChangeMessage changeMessage = new BuffBuilderChangeMessage(); + changeMessage.setBuffCost(sentPacket.getBuffCost()); + changeMessage.setTime(sentPacket.getTime()); + changeMessage.setBufferId(buffer.getObjectId()); + changeMessage.setBuffRecipientId(buffRecipient.getObjectId()); + + if (!statBuffs.isEmpty()) + changeMessage.setStatBuffs(statBuffs); + + if (sentPacket.getAccepted() == true && sentPacket.getBuffRecipientAccepted() == 1) { + System.out.println("both accepted!"); + + if (sentPacket.getBuffCost() > 0) { + CreatureObject recipientCreature = (CreatureObject) buffRecipient; + if (recipientCreature.getCashCredits() >= sentPacket.getBuffCost()) { + recipientCreature.setCashCredits(recipientCreature.getCashCredits() - sentPacket.getBuffCost()); + } else { + return; + } + } + + OkMessage closeMsg = new OkMessage(); + buffer.getClient().getSession().write(closeMsg.serialize()); + + giveInspirationBuff(buffRecipient, statBuffs); + + } else if (sentPacket.getAccepted() == true && sentPacket.getBuffRecipientAccepted() == 0) { + changeMessage.setAccepted(true); + changeMessage.setObjectId(buffRecipient.getObjectId()); + + ObjControllerMessage objMsg = new ObjControllerMessage(0x0B, changeMessage); + buffRecipient.getClient().getSession().write(objMsg.serialize()); + } else { + changeMessage.setAccepted(false); + changeMessage.setObjectId(sentPacket.getBuffRecipientId()); + + ObjControllerMessage objMsg = new ObjControllerMessage(0x0B, changeMessage); + buffRecipient.getClient().getSession().write(objMsg.serialize()); + } + + } else { + if (sentPacket.getAccepted() == true) { + OkMessage closeMsg = new OkMessage(); + buffer.getClient().getSession().write(closeMsg.serialize()); + + giveInspirationBuff(buffRecipient, statBuffs); + } + } + } + + }); + } + + private void populateSkillCaps() { + try { + DatatableVisitor buffBuilder = ClientFileManager.loadFile("datatables/buff/buff_builder.iff", DatatableVisitor.class); + + for (int r = 0; r < buffBuilder.getRowCount(); r++) { + String skillName = ((String) buffBuilder.getObject(r, 0)); + String statAffects = ((String) buffBuilder.getObject(r, 2)); + int maxTimes = ((int) buffBuilder.getObject(r, 3)); + int affectAmount = ((int) buffBuilder.getObject(r, 5)); + String requiredExperience = ((String) buffBuilder.getObject(r, 6)); + + BuffBuilder item = new BuffBuilder(); + item.setStatName(skillName); + item.setStatAffects(statAffects); + item.setMaxTimesApplied(maxTimes); + item.setAffectAmount(affectAmount); + item.setRequiredExperience(requiredExperience); + + buffBuilderSkills.add(item); + } + } catch (InstantiationException | IllegalAccessException e) { + e.printStackTrace(); + } + } + + public void giveInspirationBuff(SWGObject reciever, Vector buffVector) { + CreatureObject buffCreature = (CreatureObject) reciever; + + Vector availableSkills = buffBuilderSkills; + + Vector buffsToAdd = new Vector(); + + for (BuffItem item : buffVector) { + for (BuffBuilder builder : availableSkills) { + if (builder.getStatName().equals(item.getSkillName())) { + builder.setEntBonus(item.getBonusAmount()); + buffsToAdd.add(builder); + Console.println("Added buff item: " + builder.getStatAffects() + " with total affect of " + builder.getTotalAffected() + " and ent bonus of " + builder.getEntBonus()); + continue; + } + } + } + + reciever.setAttachment("buffWorkshop", buffsToAdd); + + core.buffService.addBuffToCreature(buffCreature, "buildabuff_inspiration"); + + } + + @Override + public void shutdown() { + + } + +} diff --git a/src/services/GroupService.java b/src/services/GroupService.java index b3c1832f..0df7fd2c 100644 --- a/src/services/GroupService.java +++ b/src/services/GroupService.java @@ -25,6 +25,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import resources.objects.Buff; import resources.objects.creature.CreatureObject; import resources.objects.group.GroupObject; @@ -150,6 +151,8 @@ public class GroupService implements INetworkDispatch { leader.setGroupId(group.getObjectID()); invited.makeAware(group); invited.setGroupId(group.getObjectID()); + addGroupBuffsToMember(group, leader); + addGroupBuffsToMember(group, invited); return; } @@ -162,6 +165,7 @@ public class GroupService implements INetworkDispatch { invited.makeAware(group); invited.setGroupId(group.getObjectID()); invited.sendSystemMessage("@group:joined_self", (byte) 0); + addGroupBuffsToMember(group, invited); } else if(group.getMemberList().size() >= 8) { @@ -175,10 +179,33 @@ public class GroupService implements INetworkDispatch { } + } + + public void addGroupBuffsToMember(GroupObject group, CreatureObject member) { + // loop until we find a member other than ourself + for(SWGObject otherMember : group.getMemberList()) { + if(otherMember != member) { + for(Buff buff : ((CreatureObject) otherMember).getBuffList().get()) { + if(buff.isGroupBuff()) { + Buff newBuff = core.buffService.doAddBuff(member, buff.getBuffName()); + newBuff.setGroupBufferId(buff.getGroupBufferId()); + } + } + return; + } + } } + public void removeGroupBuffs(CreatureObject member) { + for(Buff buff : new ArrayList(member.getBuffList().get())) { + if(buff.isGroupBuff() && buff.getGroupBufferId() != member.getObjectID()) { + core.buffService.removeBuffFromCreature(member, buff); + } + } + } + public void handleGroupDisband(CreatureObject creature) { if(creature.getGroupId() == 0) @@ -201,7 +228,7 @@ public class GroupService implements INetworkDispatch { creature.setGroupId(0); creature.makeUnaware(group); creature.sendSystemMessage("You have left the group.", (byte) 0); - + for(SWGObject member : memberList) { CreatureObject creature2 = (CreatureObject) member; @@ -209,6 +236,8 @@ public class GroupService implements INetworkDispatch { } + removeGroupBuffs(creature); + } else { for(SWGObject member : memberList) { @@ -224,7 +253,9 @@ public class GroupService implements INetworkDispatch { creature2.makeUnaware(group); creature2.sendSystemMessage("The group has been disbanded.", (byte) 0); - + + removeGroupBuffs((CreatureObject) member); + } core.objectService.destroyObject(group.getObjectID()); diff --git a/src/services/PlayerService.java b/src/services/PlayerService.java index 6b30c321..453c7945 100644 --- a/src/services/PlayerService.java +++ b/src/services/PlayerService.java @@ -170,7 +170,7 @@ public class PlayerService implements INetworkDispatch { }); - swgOpcodes.put(Opcodes.ExpertiseRequestMessage, new INetworkRemoteEvent() { + /*swgOpcodes.put(Opcodes.ExpertiseRequestMessage, new INetworkRemoteEvent() { @Override public void handlePacket(IoSession session, IoBuffer buffer) throws Exception { @@ -199,7 +199,7 @@ public class PlayerService implements INetworkDispatch { } - }); + });*/ } @@ -321,7 +321,7 @@ public class PlayerService implements INetworkDispatch { DatatableVisitor experienceTable; PlayerObject player = (PlayerObject) creature.getSlottedObject("ghost"); - synchronized(objectMutex) { + //synchronized(objectMutex) { try { experienceTable = ClientFileManager.loadFile("datatables/player/player_level.iff", DatatableVisitor.class); @@ -487,7 +487,7 @@ public class PlayerService implements INetworkDispatch { } catch (InstantiationException | IllegalAccessException e) { e.printStackTrace(); } - } + //} } public void addPlayerTitle(PlayerObject player, String title) { diff --git a/src/services/ScriptService.java b/src/services/ScriptService.java index e7d3b966..791e3cd5 100644 --- a/src/services/ScriptService.java +++ b/src/services/ScriptService.java @@ -45,6 +45,7 @@ public class ScriptService { PyObject func = interpreter.get(method); func.__call__(Py.java2py(core));*/ PythonInterpreter python = new PythonInterpreter(); + python.cleanup(); python.execfile(path + module + ".py"); return python.get(method).__call__(); } @@ -56,6 +57,7 @@ public class ScriptService { PyObject func = interpreter.get(method); func.__call__(Py.java2py(core), Py.java2py(arg1));*/ PythonInterpreter python = new PythonInterpreter(); + python.cleanup(); python.execfile(path + module + ".py"); return python.get(method).__call__(Py.java2py(arg1)); } @@ -67,6 +69,7 @@ public class ScriptService { PyObject func = interpreter.get(method); func.__call__(Py.java2py(arg1), Py.java2py(arg2));*/ PythonInterpreter python = new PythonInterpreter(); + python.cleanup(); python.execfile(path + module + ".py"); return python.get(method).__call__(Py.java2py(arg1), Py.java2py(arg2)); } @@ -78,6 +81,7 @@ public class ScriptService { PyObject func = interpreter.get(method); func.__call__(Py.java2py(arg1), Py.java2py(arg2), Py.java2py(arg3));*/ PythonInterpreter python = new PythonInterpreter(); + python.cleanup(); python.execfile(path + module + ".py"); return python.get(method).__call__(Py.java2py(arg1), Py.java2py(arg2), Py.java2py(arg3)); @@ -90,12 +94,14 @@ public class ScriptService { PyObject func = interpreter.get(method); func.__call__(Py.java2py(arg1), Py.java2py(arg2), Py.java2py(arg3), Py.java2py(arg4));*/ PythonInterpreter python = new PythonInterpreter(); + python.cleanup(); python.execfile(path + module + ".py"); return python.get(method).__call__(Py.java2py(arg1), Py.java2py(arg2), Py.java2py(arg3), Py.java2py(arg4)); } public PyObject getMethod(String path, String module, String method) { PythonInterpreter python = new PythonInterpreter(); + python.cleanup(); python.execfile(path + module + ".py"); PyObject func = python.get(method); return func; diff --git a/src/services/SimulationService.java b/src/services/SimulationService.java index 5f8b3ae7..cfd1671b 100644 --- a/src/services/SimulationService.java +++ b/src/services/SimulationService.java @@ -69,6 +69,7 @@ import resources.objects.cell.CellObject; import resources.objects.creature.CreatureObject; import resources.objects.player.PlayerObject; import resources.common.*; +import resources.common.collidables.AbstractCollidable; import toxi.geom.Line3D; import toxi.geom.Ray3D; import toxi.geom.Vec3D; @@ -91,6 +92,9 @@ import wblut.math.WB_M44; public class SimulationService implements INetworkDispatch { Map> quadTrees; + Map> collidableQuadTrees; + + private NGECore core; private Map cellMeshes = new ConcurrentHashMap(); @@ -98,18 +102,13 @@ public class SimulationService implements INetworkDispatch { this.core = core; TerrainService terrainService = core.terrainService; quadTrees = new ConcurrentHashMap>(); + collidableQuadTrees = new ConcurrentHashMap>(); for (int i = 0; i < core.terrainService.getPlanetList().size(); i++) { quadTrees.put(terrainService.getPlanetList().get(i).getName(), new QuadTree(-8192, -8192, 8192, 8192)); + collidableQuadTrees.put(terrainService.getPlanetList().get(i).getName(), new QuadTree(-8192, -8192, 8192, 8192)); } - List objectList = new ArrayList(core.objectService.getObjectList().values()); - for(SWGObject obj : objectList) { - if(obj.getParentId() == 0 && obj.isInSnapshot()) { - core.objectService.loadServerTemplate(obj); - add(obj, obj.getPosition().x, obj.getPosition().z); - } - } core.commandService.registerCommand("opencontainer"); core.commandService.registerCommand("transferitem"); core.commandService.registerCommand("transferitemarmor"); @@ -145,13 +144,35 @@ public class SimulationService implements INetworkDispatch { } + public void insertSnapShotObjects() { + List objectList = new ArrayList(core.objectService.getObjectList().values()); + for(SWGObject obj : objectList) { + if(obj.getParentId() == 0 && obj.isInSnapshot()) + add(obj, obj.getPosition().x, obj.getPosition().z); + } + } + + public void addCollidable(AbstractCollidable collidable, float x, float y) { + collidableQuadTrees.get(collidable.getPlanet().getName()).put(x, y, collidable); + } + + public void removeCollidable(AbstractCollidable collidable, float x, float y) { + collidableQuadTrees.get(collidable.getPlanet().getName()).remove(x, y, collidable); + } + + public List getCollidables(Planet planet, float x, float y, float range) { + return collidableQuadTrees.get(planet.getName()).get(x, y, range); + } + public void add(SWGObject object, int x, int y) { object.setIsInQuadtree(true); + core.objectService.loadServerTemplate(object); quadTrees.get(object.getPlanet().getName()).put(x, y, object); } public boolean add(SWGObject object, float x, float y) { object.setIsInQuadtree(true); + core.objectService.loadServerTemplate(object); return quadTrees.get(object.getPlanet().getName()).put(x, y, object); } @@ -245,7 +266,7 @@ public class SimulationService implements INetworkDispatch { // + " should be: " + dataTransform.getYPosition()); UpdateTransformMessage utm = new UpdateTransformMessage(object.getObjectID(), dataTransform.getTransformedX(), dataTransform.getTransformedY(), dataTransform.getTransformedZ(), dataTransform.getMovementCounter(), (byte) dataTransform.getMovementAngle(), dataTransform.getSpeed()); - List newAwareObjects = get(object.getPlanet(), newPos.x, newPos.z, 200); + List newAwareObjects = get(object.getPlanet(), newPos.x, newPos.z, 512); ArrayList oldAwareObjects = new ArrayList(object.getAwareObjects()); Collection updateAwareObjects = CollectionUtils.intersection(oldAwareObjects, newAwareObjects); object.notifyObservers(utm, false); @@ -253,6 +274,8 @@ public class SimulationService implements INetworkDispatch { for(int i = 0; i < oldAwareObjects.size(); i++) { SWGObject obj = oldAwareObjects.get(i); if(!updateAwareObjects.contains(obj) && obj != object && obj.getWorldPosition().getDistance2D(newPos) > 200 && obj.isInQuadtree() /*&& obj.getParentId() == 0*/) { + if(obj.getAttachment("bigSpawnRange") != null && obj.getWorldPosition().getDistance2D(newPos) < 512) + continue; object.makeUnaware(obj); if(obj.getClient() != null) obj.makeUnaware(object); @@ -260,14 +283,17 @@ public class SimulationService implements INetworkDispatch { } for(int i = 0; i < newAwareObjects.size(); i++) { SWGObject obj = newAwareObjects.get(i); - if(!updateAwareObjects.contains(obj) && obj != object && !object.getAwareObjects().contains(obj) && obj.getWorldPosition().getDistance2D(newPos) <= 200 && obj.getContainer() != object && obj.isInQuadtree()) { + //System.out.println(obj.getTemplate()); + if(!updateAwareObjects.contains(obj) && obj != object && !object.getAwareObjects().contains(obj) && obj.getContainer() != object && obj.isInQuadtree()) { + if(obj.getAttachment("bigSpawnRange") == null && obj.getWorldPosition().getDistance2D(newPos) > 200) + continue; object.makeAware(obj); if(obj.getClient() != null) obj.makeAware(object); } } - + checkForCollidables(object); } @@ -318,6 +344,8 @@ public class SimulationService implements INetworkDispatch { object.setOrientation(newOrientation); object.setMovementCounter(dataTransform.getMovementCounter()); object.notifyObservers(utm, false); + + checkForCollidables(object); } @@ -458,6 +486,14 @@ public class SimulationService implements INetworkDispatch { if(object.getGroupId() != 0) core.groupService.handleGroupDisband(object); + Point3D objectPos = object.getWorldPosition(); + + List collidables = getCollidables(object.getPlanet(), objectPos.x, objectPos.z, 512); + + for(AbstractCollidable collidable : collidables) { + collidables.remove(object); + } + if (ghost != null) { String objectShortName = object.getCustomName(); @@ -512,9 +548,11 @@ public class SimulationService implements INetworkDispatch { Point3D pos = object.getWorldPosition(); - Collection newAwareObjects = get(object.getPlanet(), pos.x, pos.z, 200); + Collection newAwareObjects = get(object.getPlanet(), pos.x, pos.z, 512); for(Iterator it = newAwareObjects.iterator(); it.hasNext();) { SWGObject obj = it.next(); + if(obj.getAttachment("bigSpawnRange") == null & obj.getWorldPosition().getDistance(pos) > 200) + continue; object.makeAware(obj); if(obj.getClient() != null) obj.makeAware(object); @@ -553,6 +591,8 @@ public class SimulationService implements INetworkDispatch { } } + core.weatherService.sendWeather(object); + if (!object.hasSkill(ghost.getProfessionWheelPosition())) { object.showFlyText("cbt_spam", "skill_up", (float) 2.5, new RGB(154, 205, 50), 0); object.playEffectObject("clienteffect/skill_granted.cef", ""); @@ -862,7 +902,7 @@ public class SimulationService implements INetworkDispatch { public float getHeightOrigin(CreatureObject creature) { - float height = (float) (creature.getHeight() - 0.3); + float height = (float) (creature.getHeight()/* - 0.3*/); if(creature.getPosture() == 2 || creature.getPosture() == 13) height = 0.3f; @@ -872,5 +912,47 @@ public class SimulationService implements INetworkDispatch { return height; } + + public void notifyPlanet(Planet planet, IoBuffer packet) { + + ConcurrentHashMap clients = core.getActiveConnectionsMap(); + + for(Client client : clients.values()) { + + if(client.getParent() == null) + continue; + + if(client.getParent().getPlanet() == null) + continue; + else if(client.getParent().getPlanet() == planet) + client.getSession().write(packet); + + } + + } + + public void notifyAllClients(IoBuffer packet) { + + ConcurrentHashMap clients = core.getActiveConnectionsMap(); + + for(Client client : clients.values()) { + + if(client.getParent() == null) + continue; + + client.getSession().write(packet); + + } + + } + + public void checkForCollidables(SWGObject object) { + Point3D objectPos = object.getWorldPosition(); + List collidables = getCollidables(object.getPlanet(), objectPos.x, objectPos.z, 256); + + for(AbstractCollidable collidable : collidables) { + collidable.doCollisionCheck(object); + } + } } diff --git a/src/services/SkillModService.java b/src/services/SkillModService.java index f7fabe0e..dfc1bb56 100644 --- a/src/services/SkillModService.java +++ b/src/services/SkillModService.java @@ -23,6 +23,7 @@ package services; import java.util.Map; +import resources.common.FileUtilities; import resources.objects.SWGList; import resources.objects.creature.CreatureObject; import main.NGECore; @@ -40,13 +41,19 @@ public class SkillModService implements INetworkDispatch { public void addSkillMod(CreatureObject creature, String skillMod, int value) { - core.scriptService.callScript("scripts/skillMods/", skillMod, "add", core, creature, skillMod, value); - + if(FileUtilities.doesFileExist("scripts/skillMods/" + skillMod + ".py")) + core.scriptService.callScript("scripts/skillMods/", skillMod, "add", core, creature, skillMod, value); + else + creature.addSkillMod(skillMod, value); } public void deductSkillMod(CreatureObject creature, String skillMod, int value) { - core.scriptService.callScript("scripts/skillMods/", skillMod, "deduct", core, creature, skillMod, value); + if(FileUtilities.doesFileExist("scripts/skillMods/" + skillMod + ".py")) + core.scriptService.callScript("scripts/skillMods/", skillMod, "deduct", core, creature, skillMod, value); + else + creature.deductSkillMod(skillMod, value); + } diff --git a/src/services/SkillService.java b/src/services/SkillService.java index 5fa961b5..a6cd92c4 100644 --- a/src/services/SkillService.java +++ b/src/services/SkillService.java @@ -21,14 +21,23 @@ ******************************************************************************/ package services; +import java.nio.ByteOrder; import java.util.Map; +import org.apache.mina.core.buffer.IoBuffer; +import org.apache.mina.core.session.IoSession; + +import protocol.swg.ExpertiseRequestMessage; + import resources.common.Console; +import resources.common.FileUtilities; +import resources.common.Opcodes; import resources.objects.creature.CreatureObject; import resources.objects.player.PlayerObject; import main.NGECore; import engine.clientdata.ClientFileManager; import engine.clientdata.visitors.DatatableVisitor; +import engine.clients.Client; import engine.resources.service.INetworkDispatch; import engine.resources.service.INetworkRemoteEvent; @@ -136,8 +145,10 @@ public class SkillService implements INetworkDispatch { } } - for (String ability : abilities) { - creature.addAbility(ability); + if(!skill.contains("expertise")) { // only mark 1 abilities in datatable need to remove abilities per script + for (String ability : abilities) { + creature.addAbility(ability); + } } for (String skillMod : skillMods) { @@ -201,8 +212,10 @@ public class SkillService implements INetworkDispatch { //creature.addExpertisePoints(pointsRequired); } - for (String ability : abilities) { - creature.removeAbility(ability); + if(!skill.contains("expertise")) { // only mark 1 abilities in datatable need to remove abilities per script + for (String ability : abilities) { + creature.removeAbility(ability); + } } for (String skillMod : skillMods) { @@ -225,7 +238,43 @@ public class SkillService implements INetworkDispatch { } @Override - public void insertOpcodes(Map arg0, Map arg1) { + public void insertOpcodes(Map swgOpcodes, Map objControllerOpcodes) { + + swgOpcodes.put(Opcodes.ExpertiseRequestMessage, new INetworkRemoteEvent() { + + @Override + public void handlePacket(IoSession session, IoBuffer buffer) throws Exception { + + buffer = buffer.order(ByteOrder.LITTLE_ENDIAN); + buffer.position(0); + + ExpertiseRequestMessage expertise = new ExpertiseRequestMessage(); + expertise.deserialize(buffer); + + Client client = core.getClient((Integer) session.getAttribute("connectionId")); + if(client == null) { + System.out.println("NULL Client"); + return; + } + + if(client.getParent() == null) + return; + + CreatureObject creature = (CreatureObject) client.getParent(); + PlayerObject player = (PlayerObject) creature.getSlottedObject("ghost"); + + if(player == null) + return; + + for(String expertiseName : expertise.getExpertiseSkills()) { + addSkill(creature, expertiseName); + if(!FileUtilities.doesFileExist("scripts/expertise/" + expertiseName + ".py")) + continue; + core.scriptService.callScript("scripts/expertise/", "addAbilities", expertiseName, core, creature, player); + } + + } + }); } diff --git a/src/services/StaticService.java b/src/services/StaticService.java index 0dfd37fc..726093e7 100644 --- a/src/services/StaticService.java +++ b/src/services/StaticService.java @@ -110,6 +110,7 @@ public class StaticService implements INetworkDispatch { return object; } parent.add(object); + core.objectService.loadServerTemplate(object); } return object; diff --git a/src/services/TerrainService.java b/src/services/TerrainService.java index d1786eb0..789f54f9 100644 --- a/src/services/TerrainService.java +++ b/src/services/TerrainService.java @@ -90,7 +90,7 @@ public class TerrainService { public Planet getPlanetByName(String name) { for (int i = 0; i < planets.size(); i++) { - if (planets.get(i).getName().equals(name)) { + if (planets.get(i).getName().equalsIgnoreCase(name)) { return planets.get(i); } } @@ -130,7 +130,12 @@ public class TerrainService { config.setFilePath("options.cfg"); if (config.loadConfigFile() && config.getInt("LOAD.SNAPSHOT_OBJECTS") > 0) { - core.objectService.loadSnapshotObjects(planet); + try { + core.objectService.loadSnapshotObjects(planet); + core.objectService.loadBuildoutObjects(planet); + } catch (InstantiationException | IllegalAccessException e) { + e.printStackTrace(); + } } } diff --git a/src/services/WeatherService.java b/src/services/WeatherService.java index 8fb1cd1c..79e22d3d 100644 --- a/src/services/WeatherService.java +++ b/src/services/WeatherService.java @@ -21,6 +21,97 @@ ******************************************************************************/ package services; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import protocol.swg.ServerWeatherMessage; +import resources.objects.creature.CreatureObject; +import engine.resources.scene.Planet; +import main.NGECore; + public class WeatherService { + + private NGECore core; + private Map weatherStability = new ConcurrentHashMap(); + private Map currentWeatherMap = new ConcurrentHashMap(); + private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); + + // TODO: randomise cloud vectors, proper algorithm for weather type rolls + + public WeatherService(NGECore core) { + this.core = core; + } + + public void loadPlanetSettings(){ + core.scriptService.callScript("scripts/", "weather", "init", core); + } + + public void addPlanetSettings(String planetName, int stability, byte defaultWeather) { + + final Planet planet = core.terrainService.getPlanetByName(planetName); + + if(planet == null) + return; + + if(stability > 100) + stability = 100; + if(defaultWeather > 4 || defaultWeather < 0) + defaultWeather = 0; + + weatherStability.put(planet, stability); + currentWeatherMap.put(planet, defaultWeather); + + scheduler.scheduleAtFixedRate(new Runnable() { + + @Override + public void run() { + runWeatherCycle(planet); + } + + + }, 30, 30, TimeUnit.MINUTES); + + } + + public void runWeatherCycle(Planet planet) { + + int stability = weatherStability.get(planet); + + Random rand = new Random(); + int weatherRoll = rand.nextInt(100); + byte weatherType; + + if(weatherRoll < stability) + weatherType = 0; + else { + weatherType = (byte) (rand.nextInt(4) + 1); + } + + currentWeatherMap.put(planet, weatherType); + core.simulationService.notifyPlanet(planet, new ServerWeatherMessage(weatherType, 1, 0, 0).serialize()); + //System.out.println("Weather type changed to: " + weatherType + " on: " + planet.getName()); + + } + + public void sendWeather(CreatureObject player) { + + if(player.getClient() == null || player.getPlanet() == null) + return; + + byte weatherType; + + if(!currentWeatherMap.containsKey(player.getPlanet())) { + weatherType = 0; + } else { + weatherType = currentWeatherMap.get(player.getPlanet()); + } + + ServerWeatherMessage weatherMsg = new ServerWeatherMessage(weatherType, 1, 0, 0); + player.getClient().getSession().write(weatherMsg.serialize()); + + } } diff --git a/src/services/ai/AIActor.java b/src/services/ai/AIActor.java new file mode 100644 index 00000000..edb0a500 --- /dev/null +++ b/src/services/ai/AIActor.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * 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 services.ai; + +import engine.resources.scene.Point3D; +import resources.objects.creature.CreatureObject; + +public class AIActor { + + private CreatureObject creature; + private Point3D spawnPosition; + + public AIActor(CreatureObject creature, Point3D spawnPosition) { + this.creature = creature; + this.spawnPosition = spawnPosition; + } + + public CreatureObject getCreature() { + return creature; + } + + public void setCreature(CreatureObject creature) { + this.creature = creature; + } + + public Point3D getSpawnPosition() { + return spawnPosition; + } + + public void setSpawnPosition(Point3D spawnPosition) { + this.spawnPosition = spawnPosition; + } + + public void doAggro(CreatureObject defender) { + + } + +} diff --git a/src/services/ai/AIService.java b/src/services/ai/AIService.java new file mode 100644 index 00000000..7c130f8b --- /dev/null +++ b/src/services/ai/AIService.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * 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 services.ai; + +public class AIService { + +} diff --git a/src/services/ai/LairActor.java b/src/services/ai/LairActor.java new file mode 100644 index 00000000..1e7b3d6e --- /dev/null +++ b/src/services/ai/LairActor.java @@ -0,0 +1,137 @@ +/******************************************************************************* + * 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 services.ai; + +import java.util.Vector; + +import net.engio.mbassy.listener.Handler; + +import resources.objects.creature.CreatureObject; +import resources.objects.tangible.TangibleObject; +import services.combat.CombatEvents.DamageTaken; + +public class LairActor { + + private Vector creatures = new Vector(); + private TangibleObject lairObject; + private int maxSpawns; + private String creatureTemplate; + private volatile int spawnWave = 0; + + public LairActor(TangibleObject lairObject, String creatureTemplate) { + this.lairObject = lairObject; + this.creatureTemplate = creatureTemplate; + lairObject.getEventBus().subscribe(this); + } + + public LairActor(TangibleObject lairObject, String creatureTemplate, int maxSpawns) { + this.lairObject = lairObject; + this.creatureTemplate = creatureTemplate; + this.maxSpawns = maxSpawns; + lairObject.getEventBus().subscribe(this); + } + + + public Vector getCreatures() { + return creatures; + } + + public TangibleObject getLairObject() { + return lairObject; + } + + public void setLairObject(TangibleObject lairObject) { + this.lairObject = lairObject; + } + + @Handler + public void handleLairDamageEvent(DamageTaken event) { + + for(AIActor ai : creatures) { + ai.doAggro(event.attacker); + } + + spawnNewCreatures(); + + } + + private void spawnNewCreatures() { + + if(creatures.size() >= maxSpawns) + return; + + int currentCondition = lairObject.getConditionDamage(); + int maxCondition = lairObject.getMaxDamage(); + + switch(spawnWave) { + // TODO: play damage effect + case 0: + spawnWave++; + break; + case 1: + if((currentCondition / maxCondition) < 0.7) { + spawnWave++; + } else { + return; + } + case 2: + if((currentCondition / maxCondition) < 0.3) { + spawnWave++; + } else { + return; + } + break; + case 3: + return; + + default: + return; + + } + + // TODO: spawn creatures + + healLair(); + + } + + private void healLair() { + + + } + + public int getMaxSpawns() { + return maxSpawns; + } + + public void setMaxSpawns(int maxSpawns) { + this.maxSpawns = maxSpawns; + } + + public String getCreatureTemplate() { + return creatureTemplate; + } + + public void setCreatureTemplate(String creatureTemplate) { + this.creatureTemplate = creatureTemplate; + } +} diff --git a/src/services/chat/ChatService.java b/src/services/chat/ChatService.java index 0b32913a..2d0c26c4 100644 --- a/src/services/chat/ChatService.java +++ b/src/services/chat/ChatService.java @@ -46,6 +46,7 @@ import engine.resources.service.INetworkRemoteEvent; import resources.common.*; import resources.objects.creature.CreatureObject; import resources.objects.player.PlayerObject; +import protocol.swg.AddIgnoreMessage; import protocol.swg.ChatOnChangeFriendStatus; import protocol.swg.ChatDeletePersistentMessage; import protocol.swg.ChatFriendsListUpdate; @@ -71,6 +72,8 @@ public class ChatService implements INetworkDispatch { this.core = core; core.commandService.registerCommand("spatialchatinternal"); core.commandService.registerCommand("socialinternal"); + core.commandService.registerCommand("addignore"); + core.commandService.registerCommand("removeignore"); mailODB = core.getMailODB(); } @@ -177,10 +180,13 @@ public class ChatService implements INetworkDispatch { if(sender == null) return; - - SWGObject recipient = getObjectByFirstName(firstName); + PlayerObject recipientGhost = (PlayerObject) recipient.getSlottedObject("ghost"); + + if (recipientGhost.getIgnoreList().contains(sender.getCustomName().toLowerCase())) + return; + if(recipient == null || recipient.getClient() == null || recipient.getClient().getSession() == null) { ChatOnSendInstantMessage response = new ChatOnSendInstantMessage(4, chatInstantMsg.getSequence()); //System.out.println(response.serialize().getHexDump()); @@ -219,7 +225,12 @@ public class ChatService implements INetworkDispatch { return; SWGObject recipient = getObjectByFirstName(packet.getRecipient()); - + + PlayerObject recipientGhost = (PlayerObject) recipient.getSlottedObject("ghost"); + + if (recipientGhost.getIgnoreList().contains(sender.getCustomName().toLowerCase())) + return; + if(recipient == null || recipient.getSlottedObject("ghost" ) == null) { ChatOnSendPersistentMessage response = new ChatOnSendPersistentMessage(4, packet.getCounter()); session.write(response.serialize()); @@ -421,6 +432,50 @@ public class ChatService implements INetworkDispatch { //actor.friendAdd(friendShortName); } + public void addToIgnoreList(SWGObject actor, String ignoreName) { + PlayerObject ghost = (PlayerObject) actor.getSlottedObject("ghost"); + CreatureObject creature = (CreatureObject) actor; + List ignoreList = ghost.getIgnoreList(); + + if (ignoreList.contains(ignoreName.toLowerCase())) { + creature.sendSystemMessage(ignoreName + " is already in your ignore list.", (byte) 0); + return; + } else { + // TODO: Do check for valid names to ignore + + AddIgnoreMessage addIgnore = new AddIgnoreMessage(actor, ignoreName.toLowerCase(), true); + actor.getClient().getSession().write(addIgnore.serialize()); + Console.println("Sent the add ignore message!"); + ghost.ignoreAdd(ignoreName.toLowerCase()); + Console.println("Sent the add ignore delta!"); + creature.sendSystemMessage(ignoreName + " is now ignored.", (byte) 0); + } + + } + + public void removeFromIgnoreList(SWGObject actor, String ignoreName) { + PlayerObject ghost = (PlayerObject) actor.getSlottedObject("ghost"); + CreatureObject creature = (CreatureObject) actor; + List ignoreList = ghost.getIgnoreList(); + + if (ignoreList.contains(ignoreName.toLowerCase())) { + for (String name : ignoreList) { + if(name.equalsIgnoreCase(ignoreName)) { + //Console.println("Name found!"); + AddIgnoreMessage removeIgnore = new AddIgnoreMessage(actor, ignoreName.toLowerCase(), false); + actor.getClient().getSession().write(removeIgnore.serialize()); + //Console.println("Sent AddIgnoreMessage to remove friend!"); + ghost.ignoreRemove(ignoreName.toLowerCase()); + //Console.println("Sent ignoreRemove delta!"); + creature.sendSystemMessage(ignoreName + " is no longer ignored.", (byte) 0); + + // TODO: Find out why player must click on name twice in list for name to be removed. + break; + } + } + } else { return; } + } + public void sendPersistentMessageHeader(Client client, Mail mail) { if(client.getSession() == null) diff --git a/src/services/combat/CombatCommands.java b/src/services/combat/CombatCommands.java index b2ab9acd..7ba5c596 100644 --- a/src/services/combat/CombatCommands.java +++ b/src/services/combat/CombatCommands.java @@ -64,7 +64,6 @@ public class CombatCommands { core.commandService.registerCombatCommand("fireStunCannon"); core.commandService.registerCombatCommand("fireVoidRocketLauncher"); - // Bounty Hunter core.commandService.registerCombatCommand("bh_ae_dm_1"); @@ -130,8 +129,6 @@ public class CombatCommands { core.commandService.registerCombatCommand("bh_sh_2"); core.commandService.registerCombatCommand("bh_sh_3"); - - // Jedi core.commandService.registerCombatCommand("fs_sweep_1"); @@ -195,7 +192,6 @@ public class CombatCommands { core.commandService.registerCommand("fs_buff_invis_1"); // Force Cloak core.commandService.registerCombatCommand("fs_force_throw_1"); core.commandService.registerCommand("forceThrow"); - // Commando @@ -233,8 +229,8 @@ public class CombatCommands { core.commandService.registerCombatCommand("co_ae_hw_dot_kinetic_4"); core.commandService.registerCombatCommand("co_ae_hw_dot_kinetic_5"); core.commandService.registerCombatCommand("co_armor_cracker"); - core.commandService.registerCombatCommand("co_cluster_bomb"); - core.commandService.registerCombatCommand("co_cluster_bomblet"); + //core.commandService.registerCombatCommand("co_cluster_bomb"); + //core.commandService.registerCombatCommand("co_cluster_bomblet"); core.commandService.registerCombatCommand("co_del_ae_cc_1_1"); core.commandService.registerCombatCommand("co_del_ae_cc_1_2"); core.commandService.registerCombatCommand("co_del_ae_cc_1_3"); @@ -307,9 +303,10 @@ public class CombatCommands { core.commandService.registerCombatCommand("co_sh_1"); core.commandService.registerCombatCommand("co_sh_2"); core.commandService.registerCombatCommand("co_sh_3"); + core.commandService.registerCombatCommand("co_stand_fast"); core.commandService.registerCommand("co_hw_dot"); core.commandService.registerCommand("co_ae_hw_dot"); - + core.commandService.registerCommand("co_position_secured"); // Entertainer @@ -522,6 +519,12 @@ public class CombatCommands { core.commandService.registerCommand("of_purge_1"); core.commandService.registerCommand("of_scatter_1"); core.commandService.registerCommand("of_stimulator_1"); + core.commandService.registerCommand("of_tactical_sup_1"); + core.commandService.registerCommand("of_tactical_sup_2"); + core.commandService.registerCommand("of_tactical_sup_3"); + core.commandService.registerCommand("of_tactical_sup_4"); + core.commandService.registerCommand("of_tactical_sup_5"); + core.commandService.registerCommand("of_tactical_sup_6"); // Smuggler diff --git a/src/services/combat/CombatEvents.java b/src/services/combat/CombatEvents.java new file mode 100644 index 00000000..7814df76 --- /dev/null +++ b/src/services/combat/CombatEvents.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * 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 services.combat; + +import resources.objects.creature.CreatureObject; +import engine.resources.common.Event; + +public class CombatEvents { + + public class DamageTaken implements Event { + + public CreatureObject attacker; + + } + +} diff --git a/src/services/combat/CombatService.java b/src/services/combat/CombatService.java index 5d21e24f..423ecdbb 100644 --- a/src/services/combat/CombatService.java +++ b/src/services/combat/CombatService.java @@ -322,11 +322,16 @@ public class CombatService implements INetworkDispatch { int armorAbsorbed = (int) (damageBeforeArmor - damage); if(mitigationType == HitType.BLOCK) { - float blockValue = (attacker.getStrength() + attacker.getSkillMod("combat_block_value").getBase()) / 2 + 25; + float blockValue = (attacker.getStrength() + attacker.getSkillModBase("combat_block_value")) / 2 + 25; damage -= blockValue; } + if(command.getAttackType() != 1 && target.getSkillMod("area_damage_resist_full_percentage") != null) { + if(new Random().nextFloat() <= target.getSkillModBase("area_damage_resist_full_percentage")) + damage = 0; + } + if(damage > 0) applyDamage(attacker, target, (int) damage); @@ -433,6 +438,9 @@ public class CombatService implements INetworkDispatch { baseArmor = target.getSkillMod("electricity").getBase(); } + + if(target.getSkillMod("expertise_innate_reduction_all_player") != null) + baseArmor *= (100 - target.getSkillMod("expertise_innate_reduction_all_player").getBase()) / 100; float mitigation = (float) (90 * (1 - Math.exp(-0.000125 * baseArmor)) + baseArmor / 9000); @@ -479,8 +487,7 @@ public class CombatService implements INetworkDispatch { if(actionCost == 0 && healthCost == 0) return true; - if(attacker.getSkillMod("expertise_action_all") != null) - actionCost *= attacker.getSkillMod("expertise_action_all").getBase(); + actionCost *= getWeaponActionCostReduction(attacker, weapon); float newAction = attacker.getAction() - actionCost; if(newAction <= 0) @@ -558,6 +565,8 @@ public class CombatService implements INetworkDispatch { } + rawDamage *= getWeaponDamageIncrease(attacker, weapon); + if(target.getSkillMod("damage_decrease_percentage") != null) { rawDamage *= (1 - (target.getSkillMod("damage_decrease_percentage").getBase() / 100)); } @@ -565,11 +574,7 @@ public class CombatService implements INetworkDispatch { if(target.getSkillMod("combat_divide_damage_dealt") != null) { rawDamage *= (1 - (target.getSkillMod("combat_divide_damage_dealt").getBase() / 100)); } - - if(attacker.getSkillMod("expertise_damage_melee") != null) { - rawDamage *= (1 + (attacker.getSkillMod("expertise_damage_melee").getBase() / 100)); - } - + return rawDamage; } @@ -650,15 +655,16 @@ public class CombatService implements INetworkDispatch { if(r <= missChance) return HitType.MISS; } - float dodgeChance = (float) target.getSkillMod("display_only_dodge").getBase() / 10000; - - r = random.nextFloat(); - if(r <= dodgeChance) - return HitType.DODGE; - + if(target.getSkillMod("display_only_dodge") != null) { + float dodgeChance = (float) target.getSkillMod("display_only_dodge").getBase() / 10000; + + r = random.nextFloat(); + if(r <= dodgeChance) + return HitType.DODGE; + } WeaponObject weapon2 = (WeaponObject) core.objectService.getObject(((CreatureObject) target).getWeaponId()); - if(weapon2 != null && weapon2.isMelee()) { + if(weapon2 != null && weapon2.isMelee() && target.getSkillMod("display_only_parry") != null) { float parryChance = (float) target.getSkillMod("display_only_parry").getBase() / 10000; @@ -676,7 +682,7 @@ public class CombatService implements INetworkDispatch { } - float critChance = (float) attacker.getSkillMod("display_only_critical").getBase() / 10000; + float critChance = (float) (attacker.getSkillMod("display_only_critical").getBase() - target.getSkillModBase("display_only_expertise_critical_hit_reduction")) / 10000; r = random.nextFloat(); if(r <= critChance) return HitType.CRITICAL; @@ -692,7 +698,7 @@ public class CombatService implements INetworkDispatch { float r; Random random = new Random(); - float blockChance = (float) target.getSkillMod("display_only_block").getBase() / 10000; + float blockChance = (float) target.getSkillModBase("display_only_block") / 10000; r = random.nextFloat(); if(r <= blockChance) @@ -700,7 +706,7 @@ public class CombatService implements INetworkDispatch { if(command.getAttackType() == 0 || command.getAttackType() == 2 || command.getAttackType() == 3) { - float evasionChance = (float) target.getSkillMod("display_only_evasion").getBase() / 10000; + float evasionChance = (float) target.getSkillModBase("display_only_evasion") / 10000; r = random.nextFloat(); if(r <= evasionChance) @@ -708,9 +714,9 @@ public class CombatService implements INetworkDispatch { } - if(hitType == HitType.HIT) { + if(hitType == HitType.HIT && target.getSkillMod("display_only_glancing_blow") != null) { - float glanceChance = (float) target.getSkillMod("display_only_glancing_blow").getBase() / 10000; + float glanceChance = (float) target.getSkillModBase("display_only_glancing_blow") / 10000; r = random.nextFloat(); if(r <= glanceChance) @@ -844,6 +850,12 @@ public class CombatService implements INetworkDispatch { private void doSingleTargetHeal(CreatureObject healer, CreatureObject target, WeaponObject weapon, CombatCommand command, int actionCounter) { + if(command.getDotDuration() > 0) { + addHealOverTimeToCreature(healer, target, command); + return; + } + + int healAmount = command.getAddedDamage(); int healPotency = 0; @@ -1122,6 +1134,10 @@ public class CombatService implements INetworkDispatch { } + if(target.getSkillMod("expertise_innate_reduction_all_player") != null) { + baseArmor *= (100 - target.getSkillMod("expertise_innate_reduction_all_player").getBase()) / 100; + } + if(baseArmor > 0) { float mitigation = (float) (90 * (1 - Math.exp(-0.000125 * baseArmor)) + baseArmor / 9000); mitigation /= 100; @@ -1136,7 +1152,162 @@ public class CombatService implements INetworkDispatch { applyDamage(attacker, target, damage); } + + public void doSelfBuff(CreatureObject creature, WeaponObject weapon, CombatCommand command, int actionCounter) { + + boolean success = true; + + if(!applySpecialCost(creature, weapon, command)) + success = false; + + if(!success) { + IoSession session = creature.getClient().getSession(); + CommandEnqueueRemove commandRemove = new CommandEnqueueRemove(creature.getObjectId(), actionCounter); + session.write(new ObjControllerMessage(0x0B, commandRemove).serialize()); + StartTask startTask = new StartTask(actionCounter, creature.getObjectID(), command.getCommandCRC(), CRC.StringtoCRC(command.getCooldownGroup()), -1); + session.write(new ObjControllerMessage(0x0B, startTask).serialize()); + return; + } + + core.buffService.addBuffToCreature(creature, command.getBuffNameSelf()); + StartTask startTask = new StartTask(actionCounter, creature.getObjectID(), command.getCommandCRC(), CRC.StringtoCRC(command.getCooldownGroup()), command.getCooldown()); + ObjControllerMessage objController2 = new ObjControllerMessage(0x0B, startTask); + creature.getClient().getSession().write(objController2.serialize()); + + CommandEnqueueRemove commandRemove = new CommandEnqueueRemove(creature.getObjectID(), actionCounter); + ObjControllerMessage objController3 = new ObjControllerMessage(0x0B, commandRemove); + creature.getClient().getSession().write(objController3.serialize()); + + + } + + public void addHealOverTimeToCreature(final CreatureObject healer, final CreatureObject target, final CombatCommand command) { + + if(target.getDotByName(command.getCommandName()) != null) { + + DamageOverTime oldDot = target.getDotByName(command.getCommandName()); + oldDot.getTask().cancel(true); + target.removeDot(oldDot); + + } + + final DamageOverTime dot = new DamageOverTime(command.getCommandName(), null, command.getDotType(), command.getDotDuration(), command.getDotIntensity()); + target.addDot(dot); + dot.setStartTime(System.currentTimeMillis()); + + final ScheduledFuture task = scheduler.scheduleAtFixedRate(new Runnable() { + + @Override + public void run() { + + if(dot.getRemainingDuration() <= 0) { + target.removeDot(dot); + dot.getTask().cancel(true); + } + + doHealOverTimeTick(healer, target, command, dot); + + } + + + + }, 0, command.getDotDuration() / (command.getAddedDamage() / command.getDotIntensity()), TimeUnit.SECONDS); + + dot.setTask(task); + + + } + + private void doHealOverTimeTick(CreatureObject healer, CreatureObject target, CombatCommand command, DamageOverTime dot) { + + int healAmount = command.getDotIntensity(); + int healPotency = 0; + + if(healer.getSkillMod("expertise_healing_all") != null) + healPotency += healer.getSkillMod("expertise_healing_all").getBase(); + if(healer.getSkillMod("expertise_healing_line_me_heal") != null) + healPotency += healer.getSkillMod("expertise_healing_line_me_heal").getBase(); + if(healer.getSkillMod("expertise_healing_line_of_heal") != null) + healPotency += healer.getSkillMod("expertise_healing_line_of_heal").getBase(); + if(healer.getSkillMod("expertise_healing_line_sm_heal") != null) + healPotency += healer.getSkillMod("expertise_healing_line_sm_heal").getBase(); + if(healer.getSkillMod("expertise_healing_line_sp_heal") != null) + healPotency += healer.getSkillMod("expertise_healing_line_sp_heal").getBase(); + if(healPotency > 0) + healAmount += (healAmount * (healPotency / 100)); + if(target.getSkillMod("expertise_healing_reduction") != null) + healAmount *= (1 - target.getSkillMod("expertise_healing_reduction").getBase() / 100); + + synchronized(target.getMutex()) { + target.setHealth(target.getHealth() + healAmount); + } + + target.notifyObservers(new PlayClientEffectLocMessage("appearance/pt_heal_2.prt", target.getPlanet().getName(), target.getWorldPosition()), true); + + } + + public float getWeaponActionCostReduction(CreatureObject attacker, WeaponObject weapon) { + + int weaponType = weapon.getWeaponType(); + int actionReduction; + + switch(weaponType) { + + case 0: actionReduction = attacker.getSkillModBase("expertise_action_weapon_0"); + case 1: actionReduction = attacker.getSkillModBase("expertise_action_weapon_1"); + case 2: actionReduction = attacker.getSkillModBase("expertise_action_weapon_2"); + case 4: actionReduction = attacker.getSkillModBase("expertise_action_weapon_4"); + case 5: actionReduction = attacker.getSkillModBase("expertise_action_weapon_5"); + case 6: actionReduction = attacker.getSkillModBase("expertise_action_weapon_6"); + case 7: actionReduction = attacker.getSkillModBase("expertise_action_weapon_7"); + case 8: actionReduction = attacker.getSkillModBase("expertise_action_weapon_8"); + case 9: actionReduction = attacker.getSkillModBase("expertise_action_weapon_9"); + case 10: actionReduction = attacker.getSkillModBase("expertise_action_weapon_10"); + case 11: actionReduction = attacker.getSkillModBase("expertise_action_weapon_11"); + case 12: actionReduction = attacker.getSkillModBase("expertise_action_weapon_3"); + + default: actionReduction = 0; + + } + + actionReduction += attacker.getSkillModBase("expertise_action_all"); + + return 1 + (actionReduction / 100); + + } + + public float getWeaponDamageIncrease(CreatureObject attacker, WeaponObject weapon) { + + int weaponType = weapon.getWeaponType(); + int weaponDmgIncrease; + + switch(weaponType) { + + case 0: weaponDmgIncrease = attacker.getSkillModBase("expertise_damage_weapon_0"); + case 1: weaponDmgIncrease = attacker.getSkillModBase("expertise_damage_weapon_1"); + case 2: weaponDmgIncrease = attacker.getSkillModBase("expertise_damage_weapon_2"); + case 4: weaponDmgIncrease = attacker.getSkillModBase("expertise_damage_weapon_4"); + case 5: weaponDmgIncrease = attacker.getSkillModBase("expertise_damage_weapon_5"); + case 6: weaponDmgIncrease = attacker.getSkillModBase("expertise_damage_weapon_6"); + case 7: weaponDmgIncrease = attacker.getSkillModBase("expertise_damage_weapon_7"); + case 8: weaponDmgIncrease = attacker.getSkillModBase("expertise_damage_weapon_8"); + case 9: weaponDmgIncrease = attacker.getSkillModBase("expertise_damage_weapon_9"); + case 10: weaponDmgIncrease = attacker.getSkillModBase("expertise_damage_weapon_10"); + case 11: weaponDmgIncrease = attacker.getSkillModBase("expertise_damage_weapon_11"); + case 12: weaponDmgIncrease = attacker.getSkillModBase("expertise_damage_weapon_3"); + + default: weaponDmgIncrease = 0; + + } + + weaponDmgIncrease += attacker.getSkillModBase("expertise_damage_all"); + + + return 1 + (weaponDmgIncrease / 100); + + } + public enum HitType{; public static final byte MISS = 0; @@ -1165,4 +1336,6 @@ public class CombatService implements INetworkDispatch { } + + } diff --git a/src/services/command/CommandService.java b/src/services/command/CommandService.java index 0449ac0b..f6483fab 100644 --- a/src/services/command/CommandService.java +++ b/src/services/command/CommandService.java @@ -155,9 +155,10 @@ public class CommandService implements INetworkDispatch { // Check if the person has access to this ability. // Abilities (inc expertise ones) are added automatically as they level // by reading the datatables. - if (!attacker.hasAbility(command.getCommandName())) { - return; - } + // disabled for now (breaks all combat) + //if (!attacker.hasAbility(command.getCommandName())) { + // return; + //} if(FileUtilities.doesFileExist("scripts/commands/combat/" + command.getCommandName() + ".py")) core.scriptService.callScript("scripts/commands/combat/", command.getCommandName(), "setup", core, attacker, target, command); @@ -167,7 +168,7 @@ public class CommandService implements INetworkDispatch { //if((command.getHitType() == 5 || command.getHitType() == 7) && !(target instanceof CreatureObject)) // success = false; - if(!(command.getAttackType() == 2) && !(command.getHitType() == 5)) { + if(!(command.getAttackType() == 2) && !(command.getHitType() == 5) && !(command.getHitType() == 0)) { if(target == null || !(target instanceof TangibleObject) || target == attacker) success = false; } else { @@ -244,6 +245,11 @@ public class CommandService implements INetworkDispatch { core.combatService.doRevive(attacker, (CreatureObject) target, weapon, command, actionCounter); return; } + + if(command.getHitType() == 0 && command.getBuffNameSelf().length() > 0) { + core.combatService.doSelfBuff(attacker, weapon, command, actionCounter); + return; + } core.combatService.doCombat(attacker, (TangibleObject) target, weapon, command, actionCounter); } diff --git a/src/services/object/ObjectService.java b/src/services/object/ObjectService.java index 9c6d0e4f..27d19d93 100644 --- a/src/services/object/ObjectService.java +++ b/src/services/object/ObjectService.java @@ -57,6 +57,7 @@ import protocol.swg.ServerTimeMessage; import protocol.swg.UnkByteFlag; import engine.clientdata.ClientFileManager; import engine.clientdata.visitors.CrcStringTableVisitor; +import engine.clientdata.visitors.DatatableVisitor; import engine.clientdata.visitors.WorldSnapshotVisitor; import engine.clientdata.visitors.WorldSnapshotVisitor.SnapshotChunk; import engine.clients.Client; @@ -144,8 +145,11 @@ public class ObjectService implements INetworkDispatch { } catch (InstantiationException | IllegalAccessException e) { e.printStackTrace(); } + boolean isSnapshot = false; if(objectID == 0) objectID = generateObjectID(); + else + isSnapshot = true; if(Template.startsWith("object/creature")) { @@ -163,9 +167,17 @@ public class ObjectService implements INetworkDispatch { object = new WeaponObject(objectID, planet, Template, position, orientation); - } else if(Template.startsWith("object/building")){ + } else if(Template.startsWith("object/building") || Template.startsWith("object/static/worldbuilding/structures")){ object = new BuildingObject(objectID, planet, position, orientation, Template); + if(!isSnapshot && object.getPortalVisitor() != null) { + int cellCount = object.getPortalVisitor().cells.size() - 1; // -1 for index 0 cell which is outside the building and used for ai pathfinding + for (int i = 0; i < cellCount; i++) { + CellObject cell = (CellObject) createObject("object/cell/shared_cell.iff", planet); + cell.setCellNumber(i+1); + object.add(cell); + } + } } else if(Template.startsWith("object/cell")) { @@ -201,7 +213,8 @@ public class ObjectService implements INetworkDispatch { object.setAttachment("serverTemplate", ((customServerTemplate != null) ? customServerTemplate : object.getTemplate())); - loadServerTemplate(object); + object.setisInSnapshot(isSnapshot); + //loadServerTemplate(object); objectList.put(objectID, object); @@ -422,7 +435,7 @@ public class ObjectService implements INetworkDispatch { } catch (SQLException e) { e.printStackTrace(); } - if(getObject(newId) == null) + if(getObject(newId) == null && getCreatureFromDB(newId) == null) return newId; else return generateObjectID(); @@ -534,11 +547,11 @@ public class ObjectService implements INetworkDispatch { CmdStartScene startScene = new CmdStartScene((byte) 0, objectId, creature.getPlanet().getPath(), creature.getTemplate(), position.x, position.y, position.z, System.currentTimeMillis() / 1000, 0); session.write(startScene.serialize()); - creature.makeAware(creature); creature.makeAware(core.guildService.getGuildObject()); core.simulationService.handleZoneIn(client); + creature.makeAware(creature); CmdSceneReady sceneReady = new CmdSceneReady(); client.getSession().write(sceneReady.serialize()); @@ -574,7 +587,6 @@ public class ObjectService implements INetworkDispatch { if (object == null) { return; } - useObject(creature, object); } @@ -617,5 +629,137 @@ public class ObjectService implements INetworkDispatch { System.out.println("Finished loading client objects for: " + planet.getName()); } + /** + * Creates a child object and places it at a position and orientation offset from the parent object. + * @param parent The parent Object. + * @param template The template file of the child. + * @param position The position as an offset to the parent object. + * @param orientation The orientation as an offset to the parent object. + */ + public void createChildObject(SWGObject parent, String template, Point3D position, Quaternion orientation) { + + + float radians = parent.getRadians(); + Point3D parentPos = parent.getWorldPosition(); + + float x = (float) ((Math.cos(radians) * position.x) + (Math.sin(radians) * position.z)); + float y = position.y + parentPos.y; + float z = (float) ((Math.cos(radians) * position.z) - (Math.sin(radians) * position.x)); + + x += parentPos.x; + z += parentPos.z; + + position = new Point3D(x, y, z); + orientation = MathUtilities.rotateQuaternion(orientation, radians, new Point3D(0, 1, 0)); + SWGObject child = createObject(template, 0, parent.getPlanet(), position, orientation); + + core.simulationService.add(child, x, z); + + } + + public void createChildObject(SWGObject parent, String template, float x, float y, float z, float qy, float qw) { + createChildObject(parent, template, new Point3D(x, y, z), new Quaternion(qw, 0, qy, 0)); + } + + public void loadBuildoutObjects(Planet planet) throws InstantiationException, IllegalAccessException { + + DatatableVisitor buildoutTable = ClientFileManager.loadFile("datatables/buildout/areas_" + planet.getName() + ".iff", DatatableVisitor.class); + + for (int i = 0; i < buildoutTable.getRowCount(); i++) { + + String areaName = (String) buildoutTable.getObject(i, 0); + float x1 = (Float) buildoutTable.getObject(i, 1); + float z1 = (Float) buildoutTable.getObject(i, 2); + + readBuildoutDatatable(ClientFileManager.loadFile("datatables/buildout/" + planet.getName() + "/" + areaName + ".iff", DatatableVisitor.class), planet, x1, z1); + + } + } + + public void readBuildoutDatatable(DatatableVisitor buildoutTable, Planet planet, float x1, float z1) throws InstantiationException, IllegalAccessException { + + CrcStringTableVisitor crcTable = ClientFileManager.loadFile("misc/object_template_crc_string_table.iff", CrcStringTableVisitor.class); + + for (int i = 0; i < buildoutTable.getRowCount(); i++) { + + String template; + + if(buildoutTable.getColumnCount() <= 11) + template = crcTable.getTemplateString((Integer) buildoutTable.getObject(i, 0)); + else + template = crcTable.getTemplateString((Integer) buildoutTable.getObject(i, 3)); + + if(template != null) { + + float px, py, pz, qw, qx, qy, qz, radius; + long objectId = 0, containerId = 0; + int type = 0, cellIndex = 0, portalCRC; + + if(buildoutTable.getColumnCount() <= 11) { + + cellIndex = (Integer) buildoutTable.getObject(i, 1); + px = (Float) buildoutTable.getObject(i, 2); + py = (Float) buildoutTable.getObject(i, 3); + pz = (Float) buildoutTable.getObject(i, 4); + qw = (Float) buildoutTable.getObject(i, 5); + qx = (Float) buildoutTable.getObject(i, 6); + qy = (Float) buildoutTable.getObject(i, 7); + qz = (Float) buildoutTable.getObject(i, 8); + radius = (Float) buildoutTable.getObject(i, 9); + portalCRC = (Integer) buildoutTable.getObject(i, 10); + + } else { + + objectId = (Integer) buildoutTable.getObject(i, 0); + containerId = (Integer) buildoutTable.getObject(i, 1); + type = (Integer) buildoutTable.getObject(i, 2); + cellIndex = (Integer) buildoutTable.getObject(i, 4); + + px = (Float) buildoutTable.getObject(i, 5); + py = (Float) buildoutTable.getObject(i, 6); + pz = (Float) buildoutTable.getObject(i, 7); + qw = (Float) buildoutTable.getObject(i, 8); + qx = (Float) buildoutTable.getObject(i, 9); + qy = (Float) buildoutTable.getObject(i, 10); + qz = (Float) buildoutTable.getObject(i, 11); + radius = (Float) buildoutTable.getObject(i, 12); + portalCRC = (Integer) buildoutTable.getObject(i, 13); + + } + + SWGObject object; + + if(objectId != 0 && containerId == 0) { + if(portalCRC != 0) + objectId = 0; + object = createObject(template, objectId, planet, new Point3D(px + x1, py, pz + z1), new Quaternion(qw, qx, qy, qz)); + if(object == null) + continue; + if(radius > 256) + object.setAttachment("bigSpawnRange", new Boolean(true)); + core.simulationService.add(object, object.getPosition().x, object.getPosition().z); + } else if(objectId != 0 && containerId != 0 && cellIndex != 0) { + object = createObject(template, objectId, planet, new Point3D(px, py, pz), new Quaternion(qw, qx, qy, qz)); + if(object instanceof CellObject) + ((CellObject) object).setCellNumber(cellIndex); + SWGObject parent = getObject(containerId); + + if(parent != null && object != null) + parent.add(object); + } else { + object = createObject(template, 0, planet, new Point3D(px + x1, py, pz + z1), new Quaternion(qw, qx, qy, qz)); + core.simulationService.add(object, object.getPosition().x, object.getPosition().z); + } + + //System.out.println("Spawning: " + template + " at: X:" + object.getPosition().x + " Y: " + object.getPosition().y + " Z: " + object.getPosition().z); + + } + + + } + + + } + } diff --git a/src/services/sui/SUIService.java b/src/services/sui/SUIService.java index be3c2ecf..457c90e7 100644 --- a/src/services/sui/SUIService.java +++ b/src/services/sui/SUIService.java @@ -104,7 +104,6 @@ public class SUIService implements INetworkDispatch { objMenuSelect.deserialize(data); Client client = core.getClient((Integer) session.getAttribute("connectionId")); - if(client == null || client.getSession() == null) return; @@ -113,7 +112,7 @@ public class SUIService implements INetworkDispatch { if(target == null || owner == null) return; - + core.scriptService.callScript("scripts/radial/", getRadialFilename(target), "handleSelection", core, owner, target, objMenuSelect.getSelection()); } diff --git a/src/services/travel/ShuttleCountdown.java b/src/services/travel/ShuttleCountdown.java deleted file mode 100644 index ce4c7042..00000000 --- a/src/services/travel/ShuttleCountdown.java +++ /dev/null @@ -1,39 +0,0 @@ -package services.travel; - -import java.util.Vector; -import java.util.Map.Entry; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -import main.NGECore; -import resources.common.Console; -import engine.resources.scene.Planet; - -public class ShuttleCountdown implements Runnable { - - private NGECore core; - private final AtomicInteger runCount = new AtomicInteger(); - private final Runnable delegate; - private volatile ScheduledFuture self; - - public ShuttleCountdown(Runnable delegate, NGECore core) { - this.core = core; - this.delegate = delegate; - } - - @Override - public void run() { - delegate.run(); - Console.println("Atomic int: " + runCount.get()); - if (runCount.incrementAndGet() == 60) { - Console.println("Shutting down countdown!"); - self.cancel(false); - } - } - - public void startCountdown(ScheduledExecutorService scheduler) { - self = scheduler.scheduleAtFixedRate(delegate, 0, 1, TimeUnit.SECONDS); - } -} diff --git a/src/services/travel/TravelPoint.java b/src/services/travel/TravelPoint.java index 27baf809..1f1771bd 100644 --- a/src/services/travel/TravelPoint.java +++ b/src/services/travel/TravelPoint.java @@ -21,6 +21,10 @@ ******************************************************************************/ package services.travel; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; + import resources.common.SpawnPoint; import resources.objects.creature.CreatureObject; import engine.resources.scene.Point3D; @@ -37,6 +41,8 @@ public class TravelPoint { private boolean shuttleLanding; private int secondsRemaining; private boolean shuttleDeparting; + private ExecutorService scheduler = Executors.newFixedThreadPool(1); + private long departureTimestamp; public TravelPoint() { } @@ -96,6 +102,7 @@ public class TravelPoint { public void setShuttle(CreatureObject shuttleObj) { this.shuttle = shuttleObj; + startShuttleSchedule(); } public boolean isShuttleAvailable() { @@ -115,11 +122,15 @@ public class TravelPoint { } public int getSecondsRemaining() { - return secondsRemaining; + long currentTime = System.currentTimeMillis() / 1000; + long diff = currentTime - getDepartureTimestamp(); + + return (int) (60 - diff); } public void setSecondsRemaining(int secondsRemaining) { this.secondsRemaining = secondsRemaining; + System.out.println(secondsRemaining); } public boolean isShuttleDeparting() { @@ -129,4 +140,60 @@ public class TravelPoint { public void setShuttleDeparting(boolean shuttleDeparting) { this.shuttleDeparting = shuttleDeparting; } + + public boolean isStarport() { + if(getShuttle() != null) { + return (getShuttle().getTemplate().equals("object/creature/npc/theme_park/shared_player_transport.iff") || getShuttle().getTemplate().equals("object/creature/npc/theme_park/shared_player_transport_theed_hangar.iff")); + } else { + System.out.println("null shuttle at: " + getName()); + return false; + } + } + + private void startShuttleSchedule() { + + scheduler.execute(new Runnable() { + @Override + public void run() { + while(getShuttle() != null) { + + try { + setShuttleAvailable(true); + setShuttleLanding(false); + Thread.sleep(120000); + setShuttleAvailable(false); + setShuttleDeparting(true); + setDepartureTimestamp(System.currentTimeMillis() / 1000); + getShuttle().setPosture((byte) 2); + setShuttleDeparting(false); + Thread.sleep(60000); + setShuttleLanding(true); + getShuttle().setPosture((byte) 0); + if(isStarport()) + Thread.sleep(21000); + else + Thread.sleep(17000); + + + } catch (InterruptedException e) { + e.printStackTrace(); + } + + } + } + + }); + + + + + } + + public long getDepartureTimestamp() { + return departureTimestamp; + } + + public void setDepartureTimestamp(long depatureTimestamp) { + this.departureTimestamp = depatureTimestamp; + } } diff --git a/src/services/travel/TravelService.java b/src/services/travel/TravelService.java index 1464328a..956c34ca 100644 --- a/src/services/travel/TravelService.java +++ b/src/services/travel/TravelService.java @@ -28,6 +28,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Vector; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; @@ -96,137 +97,62 @@ public class TravelService implements INetworkDispatch { if(object == null) return; - List planetList = core.terrainService.getPlanetList(); + TravelPoint travelPoint = getNearestTravelPoint(object); - for (Planet planet : planetList) { - String planetString = planet.getName(); + if(travelPoint == null) + return; + + if(travelPoint.isStarport()) { + + List planetList = core.terrainService.getPlanetList(); - if (request.getPlanet().equals(planetString)) { - - PlanetTravelPointListResponse response = new PlanetTravelPointListResponse(planetString, travelMap.get(planet), planetList); - client.getSession().write(response.serialize()); - break; + for (Planet planet : planetList) { + String planetString = planet.getName(); + if (request.getPlanet().equals(planetString)) { + + Vector correctTravelPoints = new Vector(); + + for(TravelPoint tp : travelMap.get(planet)) { + if(tp.isStarport() || tp.getPlanetName().equalsIgnoreCase(object.getPlanet().getName())) + correctTravelPoints.add(tp); + } + PlanetTravelPointListResponse response = new PlanetTravelPointListResponse(planetString, correctTravelPoints); + client.getSession().write(response.serialize()); + break; + + } } + + } else { + + Planet planet = object.getPlanet(); + + PlanetTravelPointListResponse response = new PlanetTravelPointListResponse(planet.getName(), travelMap.get(planet)); + client.getSession().write(response.serialize()); + } + } }); - } - public void startShuttleSchedule() { - final Runnable shuttleRun = new Runnable() { - - @Override - public void run() { - - for (Entry> entry : travelMap.entrySet()) { - for(TravelPoint tp : entry.getValue()) { - if (tp.getShuttle() == null) - continue; - else { - - if (tp.isShuttleAvailable() == false) { - tp.getShuttle().setPosture((byte) 0); - tp.setShuttleLanding(true); - handleShuttleLanding(); - //Console.println("Started handle shuttle landing"); - } - else { - tp.getShuttle().setPosture((byte) 2); - tp.setShuttleAvailable(false); - tp.setShuttleLanding(false); - tp.setShuttleDeparting(true); - handleShuttleDeparture(); - //Console.println("Shuttle is not available."); - } - } - } - } - - } - - }; - - scheduler.scheduleAtFixedRate(shuttleRun, 83, 83, TimeUnit.SECONDS); - - //shuttleCountdown(); - } - - private void handleShuttleLanding() { - scheduler.schedule(new Runnable() { - - @Override - public void run() { - for (Entry> entry : travelMap.entrySet()) { - for(TravelPoint tp : entry.getValue()) { - if (tp.isShuttleLanding()) { - tp.setShuttleLanding(false); - tp.setShuttleAvailable(true); - //Console.println("Shuttle has landed!"); - } - } - } - } - - }, 27, TimeUnit.SECONDS); - - } - - private void handleShuttleDeparture() { - scheduler.schedule(new Runnable() { - - @Override - public void run() { - for (Entry> entry : travelMap.entrySet()) { - for(TravelPoint tp : entry.getValue()) { - tp.setShuttleDeparting(false); - tp.setSecondsRemaining(60); - - } - } - shuttleCountdown(); - //Console.println("Countdown initiated"); - } - - }, 20, TimeUnit.SECONDS); - } - - private void shuttleCountdown() { - Runnable countDown = new Runnable() { - @Override - public void run() { - for (Entry> entry : travelMap.entrySet()) { - for(TravelPoint tp : entry.getValue()) { - if (tp.getShuttle() == null || tp.isShuttleDeparting() == true || tp.isShuttleAvailable() == true || tp.getSecondsRemaining() == 0) - continue; - - else { - tp.setSecondsRemaining(tp.getSecondsRemaining() - 1); - //Console.println("Time Remaining: " + tp.getSecondsRemaining()); - } - } - } - } - - }; - - runCountdown(countDown, scheduler); - } public TravelPoint getNearestTravelPoint(SWGObject obj) { TravelPoint returnedPoint = null; Vector planetTp = travelMap.get(obj.getPlanet()); - for (TravelPoint tp : planetTp) { - //System.out.println("Distance for point " + tp.getName() + " is " + tp.getLocation().getDistance2D(obj.getWorldPosition())); - if (tp.getLocation().getDistance2D(obj.getWorldPosition()) <= 70) { - returnedPoint = tp; + synchronized(travelMap) { + for (TravelPoint tp : planetTp) { + //System.out.println("Distance for point " + tp.getName() + " is " + tp.getLocation().getDistance2D(obj.getWorldPosition())); + if (tp.getLocation().getDistance2D(obj.getWorldPosition()) <= 125) { + returnedPoint = tp; + } } } if (returnedPoint == null) { - System.out.println("NULL TravelPoint!"); + System.out.println("NULL TravelPoint at : " + core.mapService.getClosestCityName(obj)); } return returnedPoint; } @@ -238,11 +164,14 @@ public class TravelService implements INetworkDispatch { TravelPoint returnedPoint = null; - for (TravelPoint tp : tpMap) { - if (tp.getName().equals(tpName)) { - returnedPoint = tp; + synchronized(travelMap) { + for (TravelPoint tp : tpMap) { + if (tp.getName().equals(tpName)) { + returnedPoint = tp; + } } } + if (returnedPoint == null) { System.out.println("Couldn't find a travelpoint w/ name " + tpName); } return returnedPoint; } @@ -258,7 +187,6 @@ public class TravelService implements INetworkDispatch { TravelPoint travelPoint = new TravelPoint(name, x, y, z, 150); travelPoint.setPlanetName(WordUtils.capitalize(planet.getName())); - if (travelMap.containsKey(planet)) { travelMap.get(planet).add(travelPoint); @@ -271,6 +199,7 @@ public class TravelService implements INetworkDispatch { System.out.println("Added planet " + planet.getName() + " to TravelMap."); System.out.println("Added travel point " + travelPoint.getName()); } + } public void removeTravelPointByName(Planet planet, String name){ @@ -341,7 +270,7 @@ public class TravelService implements INetworkDispatch { SWGObject travelTicket = createTravelTicket(departurePlanet, departureLoc, arrivalPlanet, arrivalLoc); creatureObj.getSlottedObject("inventory").add(travelTicket); - Console.println("Total cost: " + fare); + //Console.println("Total cost: " + fare); SUIWindow window = core.suiService.createMessageBox(MessageBoxType.MESSAGE_BOX_OK, "STAR WARS GALAXIES", "Ticket purchase complete.", player, null, 0); core.suiService.openSUIWindow(window); @@ -377,14 +306,9 @@ public class TravelService implements INetworkDispatch { // TravelPoint = the travelpoint player is going to travel to! public void doTransport(SWGObject actor, TravelPoint tp) { - if (tp.getPlanetName().toLowerCase().equals(actor.getPlanet().name)) { - core.simulationService.teleport(actor, tp.getSpawnLocation().getPosition(), tp.getSpawnLocation().getOrientation(), 0); - } + Planet planet = core.terrainService.getPlanetByName(tp.getPlanetName()); + core.simulationService.transferToPlanet(actor, planet, tp.getSpawnLocation().getPosition(), tp.getSpawnLocation().getOrientation(), null); - else { - Planet planet = core.terrainService.getPlanetByName(tp.getPlanetName()); - core.simulationService.transferToPlanet(actor, planet, tp.getSpawnLocation().getPosition(), tp.getSpawnLocation().getOrientation(), null); - } } @@ -482,10 +406,6 @@ public class TravelService implements INetworkDispatch { return this.travelMap; } - public void runCountdown(Runnable task, ScheduledExecutorService executor) { - new ShuttleCountdown(task, this.core).startCountdown(executor); - } - @Override public void shutdown() {