diff --git a/scripts/buffs/buildabuff_inspiration.py b/scripts/buffs/buildabuff_inspiration.py index 2bba8272..25ba7355 100644 --- a/scripts/buffs/buildabuff_inspiration.py +++ b/scripts/buffs/buildabuff_inspiration.py @@ -11,8 +11,10 @@ def add(core, actor, buff): if buffWorkshop is None: return - buff.setDuration(3600) #1 hour - + attached = actor.getAttachment('inspireDuration') + + buff.setDuration(float(actor.getAttachment('inspireDuration') * 60)) + for BuffItem in buffWorkshop: core.skillModService.addSkillMod(actor, BuffItem.getSkillName(), BuffItem.getAffectAmount()) @@ -22,5 +24,5 @@ def remove(core, actor, buff): for BuffItem in actor.getAttachment('buffWorkshop'): core.skillModService.deductSkillMod(actor, BuffItem.getSkillName(), BuffItem.getAffectAmount()) - actor.setAttachment('buffWorkshop', 'none') + actor.setAttachment('buffWorkshop', None) return \ No newline at end of file diff --git a/scripts/buffs/of_buff_def_1.py b/scripts/buffs/of_buff_def_1.py index f1e27d04..01f17ada 100644 --- a/scripts/buffs/of_buff_def_1.py +++ b/scripts/buffs/of_buff_def_1.py @@ -3,7 +3,6 @@ import sys def setup(core, actor, buff): if actor.getSkillMod('expertise_aura_maintain'): buff.setDuration(-1) - return return diff --git a/scripts/buffs/of_buff_def_2.py b/scripts/buffs/of_buff_def_2.py index c1cb56b4..7536841f 100644 --- a/scripts/buffs/of_buff_def_2.py +++ b/scripts/buffs/of_buff_def_2.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): diff --git a/scripts/buffs/of_buff_def_3.py b/scripts/buffs/of_buff_def_3.py index 952b1963..dd577237 100644 --- a/scripts/buffs/of_buff_def_3.py +++ b/scripts/buffs/of_buff_def_3.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): diff --git a/scripts/buffs/of_buff_def_4.py b/scripts/buffs/of_buff_def_4.py index 3360e4e4..6a650b41 100644 --- a/scripts/buffs/of_buff_def_4.py +++ b/scripts/buffs/of_buff_def_4.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): diff --git a/scripts/buffs/of_buff_def_5.py b/scripts/buffs/of_buff_def_5.py index 5e0f8e8d..0dfd361a 100644 --- a/scripts/buffs/of_buff_def_5.py +++ b/scripts/buffs/of_buff_def_5.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): diff --git a/scripts/buffs/of_buff_def_6.py b/scripts/buffs/of_buff_def_6.py index 46293f6b..06dac062 100644 --- a/scripts/buffs/of_buff_def_6.py +++ b/scripts/buffs/of_buff_def_6.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): diff --git a/scripts/buffs/of_buff_def_7.py b/scripts/buffs/of_buff_def_7.py index a063f2fd..b18cd574 100644 --- a/scripts/buffs/of_buff_def_7.py +++ b/scripts/buffs/of_buff_def_7.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): diff --git a/scripts/buffs/of_buff_def_8.py b/scripts/buffs/of_buff_def_8.py index 4136a39d..1b16cad6 100644 --- a/scripts/buffs/of_buff_def_8.py +++ b/scripts/buffs/of_buff_def_8.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): diff --git a/scripts/buffs/of_buff_def_9.py b/scripts/buffs/of_buff_def_9.py index 2651fc29..ac342f70 100644 --- a/scripts/buffs/of_buff_def_9.py +++ b/scripts/buffs/of_buff_def_9.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): diff --git a/scripts/collections/col_entertainer_01.py b/scripts/collections/col_entertainer_01.py new file mode 100644 index 00000000..100fa53e --- /dev/null +++ b/scripts/collections/col_entertainer_01.py @@ -0,0 +1,12 @@ +from java.lang import System +import sys + +def modify(core, actor, count): + return + +def complete(core, actor, collection): + ghost = actor.getSlottedObject('ghost') + + actor.sendSystemMessage('@collection_n:col_entertainer_01_finished', 0) + ghost.addAbility('bm_dancing_pet_entertainer') + return \ No newline at end of file diff --git a/scripts/commands/colorlights.py b/scripts/commands/colorlights.py index 62774dd0..0708c4ea 100644 --- a/scripts/commands/colorlights.py +++ b/scripts/commands/colorlights.py @@ -4,16 +4,36 @@ def setup(): return def run(core, actor, target, commandString): - + level = actor.getLevel() command = 'ColorLights1' - effect = 'entertainer_color_lights_level_1.cef' + effect = 'clienteffect/entertainer_color_lights_level_1.cef' + rLevel = 4 # minimum level to perform this effect - if actor.getLevel() < 4: + if commandString is None or commandString == '': + + if level >= 50: + command = 'ColorLights3' + effect = 'clienteffect/entertainer_color_lights_level_3.cef' + + elif level >= 20: + command = 'ColorLights2' + effect = 'clienteffect/entertainer_color_lights_level_2.cef' + + if commandString is not None: + if commandString == '2': + command = 'ColorLights2' + effect = 'clienteffect/entertainer_color_lights_level_2.cef' + rLevel = 20 + + elif commandString == '3': + command = 'ColorLights3' + effect = 'clienteffect/entertainer_color_lights_level_3.cef' + rLevel = 50 + + if level < rLevel: actor.sendSystemMessage('@performance:effect_lack_skill_self', 0) return - # TODO: Find out levels for other colored light 2 and 3 - if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_color_lights', 0) return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_1.py b/scripts/commands/combat/bh_dm_1.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_1.py +++ b/scripts/commands/combat/bh_dm_1.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_2.py b/scripts/commands/combat/bh_dm_2.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_2.py +++ b/scripts/commands/combat/bh_dm_2.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_3.py b/scripts/commands/combat/bh_dm_3.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_3.py +++ b/scripts/commands/combat/bh_dm_3.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_4.py b/scripts/commands/combat/bh_dm_4.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_4.py +++ b/scripts/commands/combat/bh_dm_4.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_5.py b/scripts/commands/combat/bh_dm_5.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_5.py +++ b/scripts/commands/combat/bh_dm_5.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_6.py b/scripts/commands/combat/bh_dm_6.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_6.py +++ b/scripts/commands/combat/bh_dm_6.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_7.py b/scripts/commands/combat/bh_dm_7.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_7.py +++ b/scripts/commands/combat/bh_dm_7.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_8.py b/scripts/commands/combat/bh_dm_8.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_8.py +++ b/scripts/commands/combat/bh_dm_8.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_crit_1.py b/scripts/commands/combat/bh_dm_crit_1.py index 94292ffd..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_1.py +++ b/scripts/commands/combat/bh_dm_crit_1.py @@ -2,7 +2,17 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) + return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/bh_dm_crit_2.py b/scripts/commands/combat/bh_dm_crit_2.py index 94292ffd..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_2.py +++ b/scripts/commands/combat/bh_dm_crit_2.py @@ -2,7 +2,17 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) + return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/bh_dm_crit_3.py b/scripts/commands/combat/bh_dm_crit_3.py index 94b54628..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_3.py +++ b/scripts/commands/combat/bh_dm_crit_3.py @@ -2,8 +2,18 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) + return - + def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_crit_4.py b/scripts/commands/combat/bh_dm_crit_4.py index 94b54628..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_4.py +++ b/scripts/commands/combat/bh_dm_crit_4.py @@ -2,8 +2,18 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) + return - + def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_crit_5.py b/scripts/commands/combat/bh_dm_crit_5.py index 94b54628..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_5.py +++ b/scripts/commands/combat/bh_dm_crit_5.py @@ -2,8 +2,18 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) + return - + def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_crit_6.py b/scripts/commands/combat/bh_dm_crit_6.py index 94b54628..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_6.py +++ b/scripts/commands/combat/bh_dm_crit_6.py @@ -2,8 +2,18 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) + return - + def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_crit_7.py b/scripts/commands/combat/bh_dm_crit_7.py index 94b54628..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_7.py +++ b/scripts/commands/combat/bh_dm_crit_7.py @@ -2,8 +2,18 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) + return - + def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_crit_8.py b/scripts/commands/combat/bh_dm_crit_8.py index 94b54628..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_8.py +++ b/scripts/commands/combat/bh_dm_crit_8.py @@ -2,8 +2,18 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) + return - + def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/fs_flurry_1.py b/scripts/commands/combat/fs_flurry_1.py index 1d6cd02c..5e5c429e 100644 --- a/scripts/commands/combat/fs_flurry_1.py +++ b/scripts/commands/combat/fs_flurry_1.py @@ -7,9 +7,6 @@ def setup(core, actor, target, command): if actor.getSkillMod('expertise_critical_line_fs_dm'): command.setCriticalChance(command.getCriticalChance() + actor.getSkillMod('expertise_critical_line_fs_dm').getBase()) - if actor.getSkillMod('expertise_action_line_fs_dm'): - command.setActionCost(command.getActionCost() - ((command.getActionCost() * actor.getSkillMod('expertise_action_line_fs_dm').getBase())/100)) - return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/fs_flurry_2.py b/scripts/commands/combat/fs_flurry_2.py index 1d6cd02c..5e5c429e 100644 --- a/scripts/commands/combat/fs_flurry_2.py +++ b/scripts/commands/combat/fs_flurry_2.py @@ -7,9 +7,6 @@ def setup(core, actor, target, command): if actor.getSkillMod('expertise_critical_line_fs_dm'): command.setCriticalChance(command.getCriticalChance() + actor.getSkillMod('expertise_critical_line_fs_dm').getBase()) - if actor.getSkillMod('expertise_action_line_fs_dm'): - command.setActionCost(command.getActionCost() - ((command.getActionCost() * actor.getSkillMod('expertise_action_line_fs_dm').getBase())/100)) - return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/fs_flurry_3.py b/scripts/commands/combat/fs_flurry_3.py index 1d6cd02c..5e5c429e 100644 --- a/scripts/commands/combat/fs_flurry_3.py +++ b/scripts/commands/combat/fs_flurry_3.py @@ -7,9 +7,6 @@ def setup(core, actor, target, command): if actor.getSkillMod('expertise_critical_line_fs_dm'): command.setCriticalChance(command.getCriticalChance() + actor.getSkillMod('expertise_critical_line_fs_dm').getBase()) - if actor.getSkillMod('expertise_action_line_fs_dm'): - command.setActionCost(command.getActionCost() - ((command.getActionCost() * actor.getSkillMod('expertise_action_line_fs_dm').getBase())/100)) - return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/fs_flurry_4.py b/scripts/commands/combat/fs_flurry_4.py index 1d6cd02c..5e5c429e 100644 --- a/scripts/commands/combat/fs_flurry_4.py +++ b/scripts/commands/combat/fs_flurry_4.py @@ -7,9 +7,6 @@ def setup(core, actor, target, command): if actor.getSkillMod('expertise_critical_line_fs_dm'): command.setCriticalChance(command.getCriticalChance() + actor.getSkillMod('expertise_critical_line_fs_dm').getBase()) - if actor.getSkillMod('expertise_action_line_fs_dm'): - command.setActionCost(command.getActionCost() - ((command.getActionCost() * actor.getSkillMod('expertise_action_line_fs_dm').getBase())/100)) - return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/fs_flurry_5.py b/scripts/commands/combat/fs_flurry_5.py index 1d6cd02c..5e5c429e 100644 --- a/scripts/commands/combat/fs_flurry_5.py +++ b/scripts/commands/combat/fs_flurry_5.py @@ -7,9 +7,6 @@ def setup(core, actor, target, command): if actor.getSkillMod('expertise_critical_line_fs_dm'): command.setCriticalChance(command.getCriticalChance() + actor.getSkillMod('expertise_critical_line_fs_dm').getBase()) - if actor.getSkillMod('expertise_action_line_fs_dm'): - command.setActionCost(command.getActionCost() - ((command.getActionCost() * actor.getSkillMod('expertise_action_line_fs_dm').getBase())/100)) - return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/fs_flurry_6.py b/scripts/commands/combat/fs_flurry_6.py index 1d6cd02c..5e5c429e 100644 --- a/scripts/commands/combat/fs_flurry_6.py +++ b/scripts/commands/combat/fs_flurry_6.py @@ -7,9 +7,6 @@ def setup(core, actor, target, command): if actor.getSkillMod('expertise_critical_line_fs_dm'): command.setCriticalChance(command.getCriticalChance() + actor.getSkillMod('expertise_critical_line_fs_dm').getBase()) - if actor.getSkillMod('expertise_action_line_fs_dm'): - command.setActionCost(command.getActionCost() - ((command.getActionCost() * actor.getSkillMod('expertise_action_line_fs_dm').getBase())/100)) - return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/fs_flurry_7.py b/scripts/commands/combat/fs_flurry_7.py index 1d6cd02c..5e5c429e 100644 --- a/scripts/commands/combat/fs_flurry_7.py +++ b/scripts/commands/combat/fs_flurry_7.py @@ -7,9 +7,6 @@ def setup(core, actor, target, command): if actor.getSkillMod('expertise_critical_line_fs_dm'): command.setCriticalChance(command.getCriticalChance() + actor.getSkillMod('expertise_critical_line_fs_dm').getBase()) - if actor.getSkillMod('expertise_action_line_fs_dm'): - command.setActionCost(command.getActionCost() - ((command.getActionCost() * actor.getSkillMod('expertise_action_line_fs_dm').getBase())/100)) - return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/fs_maelstrom_1.py b/scripts/commands/combat/fs_maelstrom_1.py new file mode 100644 index 00000000..70a66b61 --- /dev/null +++ b/scripts/commands/combat/fs_maelstrom_1.py @@ -0,0 +1,11 @@ +import sys + +def setup(core, actor, target, command): + + if actor.getSkillMod('expertise_fs_dm_armor_bypass'): + command.setBypassArmor(actor.getSkillModBase("expertise_fs_dm_armor_bypass")) + + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/fs_maelstrom_2.py b/scripts/commands/combat/fs_maelstrom_2.py new file mode 100644 index 00000000..70a66b61 --- /dev/null +++ b/scripts/commands/combat/fs_maelstrom_2.py @@ -0,0 +1,11 @@ +import sys + +def setup(core, actor, target, command): + + if actor.getSkillMod('expertise_fs_dm_armor_bypass'): + command.setBypassArmor(actor.getSkillModBase("expertise_fs_dm_armor_bypass")) + + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/fs_maelstrom_3.py b/scripts/commands/combat/fs_maelstrom_3.py new file mode 100644 index 00000000..70a66b61 --- /dev/null +++ b/scripts/commands/combat/fs_maelstrom_3.py @@ -0,0 +1,11 @@ +import sys + +def setup(core, actor, target, command): + + if actor.getSkillMod('expertise_fs_dm_armor_bypass'): + command.setBypassArmor(actor.getSkillModBase("expertise_fs_dm_armor_bypass")) + + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/fs_maelstrom_4.py b/scripts/commands/combat/fs_maelstrom_4.py new file mode 100644 index 00000000..70a66b61 --- /dev/null +++ b/scripts/commands/combat/fs_maelstrom_4.py @@ -0,0 +1,11 @@ +import sys + +def setup(core, actor, target, command): + + if actor.getSkillMod('expertise_fs_dm_armor_bypass'): + command.setBypassArmor(actor.getSkillModBase("expertise_fs_dm_armor_bypass")) + + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/fs_maelstrom_5.py b/scripts/commands/combat/fs_maelstrom_5.py new file mode 100644 index 00000000..70a66b61 --- /dev/null +++ b/scripts/commands/combat/fs_maelstrom_5.py @@ -0,0 +1,11 @@ +import sys + +def setup(core, actor, target, command): + + if actor.getSkillMod('expertise_fs_dm_armor_bypass'): + command.setBypassArmor(actor.getSkillModBase("expertise_fs_dm_armor_bypass")) + + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/covercharge.py b/scripts/commands/covercharge.py new file mode 100644 index 00000000..82ca56af --- /dev/null +++ b/scripts/commands/covercharge.py @@ -0,0 +1,46 @@ +from services.sui import SUIWindow +from services.sui.SUIWindow import Trigger +from java.util import Vector +import sys + +def setup(): + return + +def run(core, actor, target, commandString): + ghost = actor.getSlottedObject('ghost') + if ghost.getProfession() != 'entertainer_1a': + actor.sendSystemMessage('@performance:cc_no_skill', 0) + return + if commandString == '0': + actor.setCoverCharge(0) + actor.sendSystemMessage('@performance:cc_stop_charge', 0) + return + + if commandString == None or commandString == '': + window = core.suiService.createInputBox(2, '@performance:cc_set_title', '@performance:cc_set_prompt', actor, None, 10, handleCoverCharge) + window.setProperty('txtInput:NumericInteger', 'true') + window.setProperty('txtInput:MaxLength', '12') + core.suiService.openSUIWindow(window) + return + else: + try: + actor.setCoverCharge(int(commandString)) + actor.sendSystemMessage('You are now charging a cover of ' + commandString + ' credit(s).', 0) + except ValueError: + return + return + return + +def handleCoverCharge(actor, window, eventType, returnList): + if eventType == 0 and len(returnList) == 1: + charge = returnList.get(0) + if charge == "0": + actor.setCoverCharge(0) + actor.sendSystemMessage('@performance:cc_stop_charge', 0) + return + else: + actor.setCoverCharge(int(returnList.get(0))) + actor.sendSystemMessage('You are now charging a cover of ' + returnList.get(0) + ' credits(s).', 0) + return + return + return \ No newline at end of file diff --git a/scripts/commands/dazzle.py b/scripts/commands/dazzle.py index 4d93db65..03e79b11 100644 --- a/scripts/commands/dazzle.py +++ b/scripts/commands/dazzle.py @@ -4,16 +4,36 @@ def setup(): return def run(core, actor, target, commandString): - + level = actor.getLevel() command = 'Dazzle1' - effect = 'entertainer_dazzle_level_1.cef' + effect = 'clienteffect/entertainer_dazzle_level_1.cef' + rLevel = 10 # minimum level to perform this effect - if actor.getLevel() < 10: + if commandString is None or commandString == '': + + if level >= 30: + command = 'Dazzle3' + effect = 'clienteffect/entertainer_dazzle_level_3.cef' + + elif level >= 20: + command = 'Dazzle2' + effect = 'clienteffect/entertainer_dazzle_level_2.cef' + + if commandString is not None: + if commandString == '2': + command = 'Dazzle2' + effect = 'clienteffect/entertainer_dazzle_level_2.cef' + rLevel = 20 + + elif commandString == '3': + command = 'Dazzle3' + effect = 'clienteffect/entertainer_dazzle_level_3.cef' + rLevel = 30 + + if level < rLevel: actor.sendSystemMessage('@performance:effect_lack_skill_self', 0) return - # TODO: Find out levels for other dazzle 2 and 3 - if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_dazzle', 0) return \ No newline at end of file diff --git a/scripts/commands/distract.py b/scripts/commands/distract.py index 6c1eb887..ec57828b 100644 --- a/scripts/commands/distract.py +++ b/scripts/commands/distract.py @@ -4,16 +4,35 @@ def setup(): return def run(core, actor, target, commandString): - + level = actor.getLevel() command = 'Distract1' - effect = 'entertainer_distract_level_1.cef' + effect = 'clienteffect/entertainer_distract_level_1.cef' + rLevel = 18 # minimum level to perform this effect - if actor.getLevel() < 18: - actor.sendSystemMessage('@performance:effect_lack_skill_self') + if commandString is None or commandString == '': + if level >= 75: + command = 'Distract3' + effect = 'clienteffect/entertainer_distract_level_3.cef' + + elif level >= 50: + command = 'Distract2' + effect = 'clienteffect/entertainer_distract_level_2.cef' + + if commandString is not None: + if commandString == '2': + command = 'Distract2' + effect = 'clienteffect/entertainer_distract_level_2.cef' + rLevel = 50 + + elif commandString == '3': + command = 'Distract3' + effect = 'clienteffect/entertainer_distract_level_3.cef' + rLevel = 75 + + if level < rLevel: + actor.sendSystemMessage('@performance:effect_lack_skill_self', 0) return - - # TODO: Find out levels for other distract 2 and 3 - + if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_distract', 0) return \ No newline at end of file diff --git a/scripts/commands/duel.py b/scripts/commands/duel.py index 4ce25bdf..cd26b240 100644 --- a/scripts/commands/duel.py +++ b/scripts/commands/duel.py @@ -22,6 +22,7 @@ def run(core, actor, target, commandString): if actor.getDuelList().contains(target): actor.sendSystemMessage('You already challenged ' + target.getCustomName() + ' to a duel.', 0) + return combatSvc.handleDuel(actor, target) diff --git a/scripts/commands/firejet.py b/scripts/commands/firejet.py index 3e67676f..26261d56 100644 --- a/scripts/commands/firejet.py +++ b/scripts/commands/firejet.py @@ -4,16 +4,35 @@ def setup(): return def run(core, actor, target, commandString): - + level = actor.getLevel() command = 'FireJets1' - effect = 'entertainer_fire_jets_level_1.cef' + effect = 'clienteffect/entertainer_fire_jets_level_1.cef' + rLevel = 26 # minimum level to perform this effect - if actor.getLevel() < 26: + if commandString is None or commandString == '': + if level >= 75: + command = 'FireJets3' + effect = 'clienteffect/entertainer_fire_jets_level_3.cef' + + elif level >= 50: + command = 'FireJets2' + effect = 'clienteffect/entertainer_fire_jets_level_2.cef' + + if commandString is not None: + if commandString == '2': + command = 'FireJets2' + effect = 'clienteffect/entertainer_fire_jets_level_2.cef' + rLevel = 50 + + elif commandString == '3': + command = 'FireJets3' + effect = 'clienteffect/entertainer_fire_jets_level_3.cef' + rLevel = 75 + + if level < rLevel: actor.sendSystemMessage('@performance:effect_lack_skill_self', 0) return - # TODO: Find out levels for other firejets 2 and 3 - if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_fire_jets', 0) return \ No newline at end of file diff --git a/scripts/commands/inspire.py b/scripts/commands/inspire.py index 531aa1e2..dea0e544 100644 --- a/scripts/commands/inspire.py +++ b/scripts/commands/inspire.py @@ -7,7 +7,7 @@ def setup(): def run(core, actor, target, commandString): playerObject = actor.getSlottedObject('ghost') - print playerObject.getProfession() + if not playerObject or playerObject.getProfession() != "entertainer_1a": return diff --git a/scripts/commands/me_buff_health_1.py b/scripts/commands/me_buff_health_1.py index 1e41c9ae..fb9880d2 100644 --- a/scripts/commands/me_buff_health_1.py +++ b/scripts/commands/me_buff_health_1.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_health') + core.buffService.addGroupBuff(target, 'me_buff_health', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_health') + core.buffService.addBuffToCreature(target, 'me_buff_health', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_health') + core.buffService.addGroupBuff(actor, 'me_buff_health', actor) return \ No newline at end of file diff --git a/scripts/commands/me_buff_health_2.py b/scripts/commands/me_buff_health_2.py index 117444bb..dd4c396c 100644 --- a/scripts/commands/me_buff_health_2.py +++ b/scripts/commands/me_buff_health_2.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_health_2') + core.buffService.addGroupBuff(target, 'me_buff_health_2', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_health_2') + core.buffService.addBuffToCreature(target, 'me_buff_health_2', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_health_2') + core.buffService.addGroupBuff(actor, 'me_buff_health_2', actor) return \ No newline at end of file diff --git a/scripts/commands/me_buff_health_3.py b/scripts/commands/me_buff_health_3.py index 29a22740..26ec110f 100644 --- a/scripts/commands/me_buff_health_3.py +++ b/scripts/commands/me_buff_health_3.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_health_3') + core.buffService.addGroupBuff(target, 'me_buff_health_3', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_health_3') + core.buffService.addBuffToCreature(target, 'me_buff_health_3', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_health_3') + core.buffService.addGroupBuff(actor, 'me_buff_health_3', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_action_1.py b/scripts/commands/me_enhance_action_1.py index 0b065ab5..9239af4d 100644 --- a/scripts/commands/me_enhance_action_1.py +++ b/scripts/commands/me_enhance_action_1.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_action_1') + core.buffService.addGroupBuff(target, 'me_buff_action_1', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_action_1') + core.buffService.addBuffToCreature(target, 'me_buff_action_1', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_action_1') + core.buffService.addGroupBuff(actor, 'me_buff_action_1', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_action_2.py b/scripts/commands/me_enhance_action_2.py index a076dfdd..1c9b8dff 100644 --- a/scripts/commands/me_enhance_action_2.py +++ b/scripts/commands/me_enhance_action_2.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_action_2') + core.buffService.addGroupBuff(target, 'me_buff_action_2', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_action_2') + core.buffService.addBuffToCreature(target, 'me_buff_action_2', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_action_2') + core.buffService.addGroupBuff(actor, 'me_buff_action_2', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_action_3.py b/scripts/commands/me_enhance_action_3.py index 1108c400..a4d9dd4a 100644 --- a/scripts/commands/me_enhance_action_3.py +++ b/scripts/commands/me_enhance_action_3.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_action_3') + core.buffService.addGroupBuff(target, 'me_buff_action_3', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_action_3') + core.buffService.addBuffToCreature(target, 'me_buff_action_3', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_action_3') + core.buffService.addGroupBuff(actor, 'me_buff_action_3', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_agility_1.py b/scripts/commands/me_enhance_agility_1.py index 24e2c05b..50b163ac 100644 --- a/scripts/commands/me_enhance_agility_1.py +++ b/scripts/commands/me_enhance_agility_1.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_agility_1') + core.buffService.addGroupBuff(target, 'me_buff_agility_1', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_agility_1') + core.buffService.addBuffToCreature(target, 'me_buff_agility_1', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_agility_1') + core.buffService.addGroupBuff(actor, 'me_buff_agility_1', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_agility_2.py b/scripts/commands/me_enhance_agility_2.py index 63474e3f..0df03459 100644 --- a/scripts/commands/me_enhance_agility_2.py +++ b/scripts/commands/me_enhance_agility_2.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_agility_2') + core.buffService.addGroupBuff(target, 'me_buff_agility_2', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_agility_2') + core.buffService.addBuffToCreature(target, 'me_buff_agility_2', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_agility_2') + core.buffService.addGroupBuff(actor, 'me_buff_agility_2', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_agility_3.py b/scripts/commands/me_enhance_agility_3.py index 4d665fc3..fe489909 100644 --- a/scripts/commands/me_enhance_agility_3.py +++ b/scripts/commands/me_enhance_agility_3.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_agility_3') + core.buffService.addGroupBuff(target, 'me_buff_agility_3', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_agility_3') + core.buffService.addBuffToCreature(target, 'me_buff_agility_3', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_agility_3') + core.buffService.addGroupBuff(actor, 'me_buff_agility_3', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_block_1.py b/scripts/commands/me_enhance_block_1.py index d4ef98b6..d1f27220 100644 --- a/scripts/commands/me_enhance_block_1.py +++ b/scripts/commands/me_enhance_block_1.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_melee_gb_1') + core.buffService.addGroupBuff(target, 'me_buff_melee_gb_1', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_melee_gb_1') + core.buffService.addBuffToCreature(target, 'me_buff_melee_gb_1', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_melee_gb_1') + core.buffService.addGroupBuff(actor, 'me_buff_melee_gb_1', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_dodge_1.py b/scripts/commands/me_enhance_dodge_1.py index 537d2875..9702a6f3 100644 --- a/scripts/commands/me_enhance_dodge_1.py +++ b/scripts/commands/me_enhance_dodge_1.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_ranged_gb_1') + core.buffService.addGroupBuff(target, 'me_buff_ranged_gb_1', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_ranged_gb_1') + core.buffService.addBuffToCreature(target, 'me_buff_ranged_gb_1', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_ranged_gb_1') + core.buffService.addGroupBuff(actor, 'me_buff_ranged_gb_1', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_precision_1.py b/scripts/commands/me_enhance_precision_1.py index d20c423a..a5ddce5a 100644 --- a/scripts/commands/me_enhance_precision_1.py +++ b/scripts/commands/me_enhance_precision_1.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_precision_1') + core.buffService.addGroupBuff(target, 'me_buff_precision_1', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_precision_1') + core.buffService.addBuffToCreature(target, 'me_buff_precision_1', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_precision_1') + core.buffService.addGroupBuff(actor, 'me_buff_precision_1', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_precision_2.py b/scripts/commands/me_enhance_precision_2.py index a7b808ed..9c6906d2 100644 --- a/scripts/commands/me_enhance_precision_2.py +++ b/scripts/commands/me_enhance_precision_2.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_precision_2') + core.buffService.addGroupBuff(target, 'me_buff_precision_2', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_precision_2') + core.buffService.addBuffToCreature(target, 'me_buff_precision_2', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_precision_2') + core.buffService.addGroupBuff(actor, 'me_buff_precision_2', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_precision_3.py b/scripts/commands/me_enhance_precision_3.py index 76594fce..a4997749 100644 --- a/scripts/commands/me_enhance_precision_3.py +++ b/scripts/commands/me_enhance_precision_3.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_precision_3') + core.buffService.addGroupBuff(target, 'me_buff_precision_3', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_precision_3') + core.buffService.addBuffToCreature(target, 'me_buff_precision_3', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_precision_3') + core.buffService.addGroupBuff(actor, 'me_buff_precision_3', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_strength_1.py b/scripts/commands/me_enhance_strength_1.py index 1ab00983..cf3529bc 100644 --- a/scripts/commands/me_enhance_strength_1.py +++ b/scripts/commands/me_enhance_strength_1.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_strength_1') + core.buffService.addGroupBuff(target, 'me_buff_strength_1', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_strength_1') + core.buffService.addBuffToCreature(target, 'me_buff_strength_1', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_strength_1') + core.buffService.addGroupBuff(actor, 'me_buff_strength_1', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_strength_2.py b/scripts/commands/me_enhance_strength_2.py index e8b21cd0..13ddfe22 100644 --- a/scripts/commands/me_enhance_strength_2.py +++ b/scripts/commands/me_enhance_strength_2.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_strength_2') + core.buffService.addGroupBuff(target, 'me_buff_strength_2', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_strength_2') + core.buffService.addBuffToCreature(target, 'me_buff_strength_2', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_strength_2') + core.buffService.addGroupBuff(actor, 'me_buff_strength_2', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_strength_3.py b/scripts/commands/me_enhance_strength_3.py index e51c7bbc..2a822999 100644 --- a/scripts/commands/me_enhance_strength_3.py +++ b/scripts/commands/me_enhance_strength_3.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_strength_3') + core.buffService.addGroupBuff(target, 'me_buff_strength_3', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_strength_3') + core.buffService.addBuffToCreature(target, 'me_buff_strength_3', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_strength_3') + core.buffService.addGroupBuff(actor, 'me_buff_strength_3', actor) return \ No newline at end of file diff --git a/scripts/commands/smokebomb.py b/scripts/commands/smokebomb.py index 1bc0b2b9..a9da5abb 100644 --- a/scripts/commands/smokebomb.py +++ b/scripts/commands/smokebomb.py @@ -4,16 +4,35 @@ def setup(): return def run(core, actor, target, commandString): - + level = actor.getLevel() command = 'SmokeBomb1' - effect = 'entertainer_smoke_bomb_level_1.cef' + effect = 'clienteffect/entertainer_smoke_bomb_level_1.cef' + rLevel = 50 # minimum level to perform this effect - if actor.getLevel() < 50: + if commandString is None or commandString == '': + if level >= 90: + command = 'SmokeBomb3' + effect = 'clienteffect/entertainer_smoke_bomb_level_3.cef' + + elif level >= 75: + command = 'SmokeBomb2' + effect = 'clienteffect/entertainer_smoke_bomb_level_2.cef' + + if commandString is not None: + if commandString == '2': + command = 'SmokeBomb2' + effect = 'clienteffect/entertainer_smoke_bomb_level_2.cef' + rLevel = 75 + + elif commandString == '3': + command = 'SmokeBomb3' + effect = 'clienteffect/entertainer_smoke_bomb_level_3.cef' + rLevel = 90 + + if level < rLevel: actor.sendSystemMessage('@performance:effect_lack_skill_self', 0) return - # TODO: Find out levels for other smoke bomb 2 and 3 - if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_smoke_bomb', 0) return \ No newline at end of file diff --git a/scripts/commands/spotlight.py b/scripts/commands/spotlight.py index 25341536..204c0017 100644 --- a/scripts/commands/spotlight.py +++ b/scripts/commands/spotlight.py @@ -5,20 +5,35 @@ def setup(): return def run(core, actor, target, commandString): - + level = actor.getLevel() command = 'SpotLight1' effect = 'clienteffect/entertainer_spot_light_level_1.cef' + rLevel = 1 # minimum level to perform this effect - # TODO: Figure out what levels the spotlight effects upgraded at. - - if actor.getLevel() >= 80: - command == 'SpotLight3' - effect = 'clienteffect/entertainer_spot_light_level_3.cef' - - elif actor.getLevel() >= 40: - command == 'SpotLight2' - effect = 'clienteffect/entertainer_spot_light_level_2.cef' + if commandString is None or commandString == '': + if level >= 30: + command = 'SpotLight3' + effect = 'clienteffect/entertainer_spot_light_level_3.cef' + elif level >= 20: + command = 'SpotLight2' + effect = 'clienteffect/entertainer_spot_light_level_2.cef' + + if commandString is not None: + if commandString == '2': + command = 'SpotLight2' + effect = 'clienteffect/entertainer_spot_light_level_2.cef' + rLevel = 20 + + elif commandString == '3': + command = 'SpotLight3' + effect = 'clienteffect/entertainer_spot_light_level_3.cef' + rLevel = 30 + + if level < rLevel: + actor.sendSystemMessage('@performance:effect_lack_skill_self', 0) + return + if core.entertainmentService.performEffect(actor, command, effect, None) is True: actor.sendSystemMessage('@performance:effect_perform_spot_light', 0) return diff --git a/scripts/commands/startdance.py b/scripts/commands/startdance.py index 23b815c6..13aba090 100644 --- a/scripts/commands/startdance.py +++ b/scripts/commands/startdance.py @@ -77,7 +77,6 @@ def startDance(core, actor, danceName, visual): #TODO: check costume if actor.getPosture() != Posture.Upright: - print (' can\t dance because ' + str(actor.getPosture())) actor.sendSystemMessage('@performance:dance_fail', 0) return @@ -97,7 +96,7 @@ def startDance(core, actor, danceName, visual): actor.setPosture(0x09); playerObject = actor.getSlottedObject('ghost') - if playerObject and playerObject.getProfession() == "entertainer_1a": + if playerObject and playerObject.getProfession() == "entertainer_1a" and actor.getLevel() != 90: entSvc.startPerformanceExperience(actor) dance = entSvc.getDance(visual) diff --git a/scripts/commands/stopwatching.py b/scripts/commands/stopwatching.py index 7dc96fc8..23a36c17 100644 --- a/scripts/commands/stopwatching.py +++ b/scripts/commands/stopwatching.py @@ -4,12 +4,14 @@ def setup(): return def run(core, actor, target, commandString): - dancer = actor.getPerformanceWatchee() - if not dancer: - return - + performer = target + if commandString is not None and target is None: + performer = core.chatService.getObjectByFirstName(commandString) + + if performer is None: + return + performer.removeAudience(actor) actor.setPerformanceWatchee(None) - dancer.removeAudience(actor) if not actor.getPerformanceListenee(): actor.setMoodAnimation('') diff --git a/scripts/commands/transferitemarmor.py b/scripts/commands/transferitemarmor.py index bfd8486d..2edbec74 100644 --- a/scripts/commands/transferitemarmor.py +++ b/scripts/commands/transferitemarmor.py @@ -5,6 +5,7 @@ def setup(): def run(core, actor, target, commandString): if core.equipmentService.canEquip(actor, target) is False: + actor.sendSystemMessage('@error_message:insufficient_skill', 0) return diff --git a/scripts/commands/transferitemmisc.py b/scripts/commands/transferitemmisc.py index ee205206..5dc726fd 100644 --- a/scripts/commands/transferitemmisc.py +++ b/scripts/commands/transferitemmisc.py @@ -5,6 +5,7 @@ def setup(): def run(core, actor, target, commandString): if core.equipmentService.canEquip(actor, target) is False: + actor.sendSystemMessage('@error_message:insufficient_skill', 0) return diff --git a/scripts/commands/transferitemweapon.py b/scripts/commands/transferitemweapon.py index 2640ac0c..6e356571 100644 --- a/scripts/commands/transferitemweapon.py +++ b/scripts/commands/transferitemweapon.py @@ -5,6 +5,7 @@ def setup(): def run(core, actor, target, commandString): if core.equipmentService.canEquip(actor, target) is False: + actor.sendSystemMessage('@error_message:insufficient_skill', 0) return diff --git a/scripts/commands/ventriloquism.py b/scripts/commands/ventriloquism.py index 59d5f396..1781fbd1 100644 --- a/scripts/commands/ventriloquism.py +++ b/scripts/commands/ventriloquism.py @@ -4,16 +4,35 @@ def setup(): return def run(core, actor, target, commandString): - + level = actor.getLevel() command = 'Ventriloquism1' - effect = 'entertainer_ventriloquism_level_1.cef' + effect = 'clienteffect/entertainer_ventriloquism_level_1.cef' + rLevel = 58 # minimum level to perform this effect - if actor.getLevel() < 58: + if commandString is None or commandString == '': + if level >= 90: + command = 'Ventriloquism3' + effect = 'clienteffect/entertainer_ventriloquism_level_3.cef' + + elif level >= 75: + command = 'Ventriloquism2' + effect = 'clienteffect/entertainer_ventriloquism_level_2.cef' + + if commandString is not None: + if commandString == '2': + command = 'Ventriloquism2' + effect = 'clienteffect/entertainer_ventriloquism_level_2.cef' + rLevel = 75 + + elif commandString == '3': + command = 'Ventriloquism3' + effect = 'clienteffect/entertainer_ventriloquism_level_3.cef' + rLevel = 90 + + if level < rLevel: actor.sendSystemMessage('@performance:effect_lack_skill_self', 0) return - # TODO: Find out levels for other ventriloquism 2 and 3 - if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_ventriloquism', 0) return \ No newline at end of file diff --git a/scripts/commands/watch.py b/scripts/commands/watch.py index 0a9baf04..07ca268d 100644 --- a/scripts/commands/watch.py +++ b/scripts/commands/watch.py @@ -26,14 +26,10 @@ def run(core, actor, target, commandString): if target.getPosture() != 0x09 or not perf or perf.getDanceVisualId() < 0: actor.sendSystemMessage(target.getCustomName() + ' is not dancing.',0) return - - oldWatchee = actor.getPerformanceWatchee() - if oldWatchee and oldWatchee != target: - oldWatchee.removeAudience(actor) - - actor.setPerformanceWatchee(target) - target.addAudience(actor) - core.entertainmentService.startSpectating(actor, target) - actor.setMoodAnimation('entertained') - actor.sendSystemMessage('You start watching ' + target.getCustomName() + '.',0) + + if target.getCoverCharge() > 0 or target.getCoverCharge() == None: + core.entertainmentService.handleCoverCharge(actor, target) + return + else: + core.entertainmentService.startSpectating(actor, target, True) return \ No newline at end of file diff --git a/scripts/equipment/force_protection.py b/scripts/equipment/force_protection.py new file mode 100644 index 00000000..c5fd6ce0 --- /dev/null +++ b/scripts/equipment/force_protection.py @@ -0,0 +1,32 @@ +import sys + +def jedi_robe_Faint(): + return 1400 + +def jedi_robe_Weak(): + return 3000 + +def jedi_robe_Lucent(): + return 4000 + +def jedi_robe_Luminous(): + return 5000 + +def jedi_robe_Radiant(): + return 6500 + +def jedi_cloak_Faint(): + return 0 + +def jedi_cloak_Weak(): + return 0 + +def jedi_cloak_Lucent(): + return 4500 + +def jedi_cloak_Luminous(): + return 5600 + +def jedi_cloak_Radiant(): + return 6500 + \ No newline at end of file diff --git a/scripts/equipment/weapon_critical.py b/scripts/equipment/weapon_critical.py new file mode 100644 index 00000000..683c4692 --- /dev/null +++ b/scripts/equipment/weapon_critical.py @@ -0,0 +1,25 @@ +import sys + +def Rifle(): + return "expertise_critical_rifle" + +def Carbine(): + return "expertise_critical_carbine" + +def Pistol(): + return "expertise_critical_pistol" + +def OneHandedMelee(): + return "expertise_critical_1h" + +def TwoHandedMelee(): + return "expertise_critical_2h" + +def Unarmed(): + return "expertise_critical_unarmed" + +def Polearm(): + return "expertise_critical_polearm" + +def FreeTargetingHeavyWeapon(): + return "expertise_critical_heavy" diff --git a/scripts/expertise/expertise_en_intense_performer_1.py b/scripts/expertise/expertise_en_intense_performer_1.py index cf9f9699..8925253a 100644 --- a/scripts/expertise/expertise_en_intense_performer_1.py +++ b/scripts/expertise/expertise_en_intense_performer_1.py @@ -11,8 +11,8 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_intense_performer_1') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) addAbilities(core, actor, player) - return def removeExpertisePoint(core, actor): @@ -26,9 +26,8 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_intense_performer_1') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) removeAbilities(core, actor, player) - return # this checks what abilities the player gets by level, need to also call this on level-up diff --git a/scripts/expertise/expertise_en_intense_performer_2.py b/scripts/expertise/expertise_en_intense_performer_2.py index 0582a021..f0327c0c 100644 --- a/scripts/expertise/expertise_en_intense_performer_2.py +++ b/scripts/expertise/expertise_en_intense_performer_2.py @@ -11,6 +11,7 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_intense_performer_2') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) addAbilities(core, actor, player) return @@ -26,7 +27,7 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_intense_performer_2') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) removeAbilities(core, actor, player) return diff --git a/scripts/expertise/expertise_en_intense_performer_3.py b/scripts/expertise/expertise_en_intense_performer_3.py index 5ee49acf..ac3eb24a 100644 --- a/scripts/expertise/expertise_en_intense_performer_3.py +++ b/scripts/expertise/expertise_en_intense_performer_3.py @@ -11,6 +11,7 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_intense_performer_3') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) addAbilities(core, actor, player) return @@ -26,7 +27,7 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_intense_performer_3') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) removeAbilities(core, actor, player) return diff --git a/scripts/expertise/expertise_en_intense_performer_4.py b/scripts/expertise/expertise_en_intense_performer_4.py index 29b5eb73..5e316992 100644 --- a/scripts/expertise/expertise_en_intense_performer_4.py +++ b/scripts/expertise/expertise_en_intense_performer_4.py @@ -11,6 +11,7 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_intense_performer_4') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) addAbilities(core, actor, player) return @@ -26,7 +27,7 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_intense_performer_4') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) removeAbilities(core, actor, player) return diff --git a/scripts/expertise/expertise_en_lasting_impression_1.py b/scripts/expertise/expertise_en_lasting_impression_1.py index 960c9b75..1ce042fc 100644 --- a/scripts/expertise/expertise_en_lasting_impression_1.py +++ b/scripts/expertise/expertise_en_lasting_impression_1.py @@ -11,6 +11,7 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_lasting_impression_1') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) addAbilities(core, actor, player) return @@ -26,7 +27,7 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_lasting_impression_1') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) removeAbilities(core, actor, player) return diff --git a/scripts/expertise/expertise_en_lasting_impression_2.py b/scripts/expertise/expertise_en_lasting_impression_2.py index 0ef56c25..5daf6031 100644 --- a/scripts/expertise/expertise_en_lasting_impression_2.py +++ b/scripts/expertise/expertise_en_lasting_impression_2.py @@ -11,6 +11,7 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_lasting_impression_2') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) addAbilities(core, actor, player) return @@ -26,7 +27,7 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_lasting_impression_2') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) removeAbilities(core, actor, player) return diff --git a/scripts/expertise/expertise_en_lasting_impression_3.py b/scripts/expertise/expertise_en_lasting_impression_3.py index 74107ef2..8a4642bd 100644 --- a/scripts/expertise/expertise_en_lasting_impression_3.py +++ b/scripts/expertise/expertise_en_lasting_impression_3.py @@ -11,6 +11,7 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_lasting_impression_3') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) addAbilities(core, actor, player) return @@ -26,7 +27,7 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_lasting_impression_3') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) removeAbilities(core, actor, player) return diff --git a/scripts/expertise/expertise_en_lasting_impression_4.py b/scripts/expertise/expertise_en_lasting_impression_4.py index b71d1b91..086a38c9 100644 --- a/scripts/expertise/expertise_en_lasting_impression_4.py +++ b/scripts/expertise/expertise_en_lasting_impression_4.py @@ -11,6 +11,7 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_lasting_impression_4') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) addAbilities(core, actor, player) return @@ -26,7 +27,7 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_lasting_impression_4') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) removeAbilities(core, actor, player) return diff --git a/scripts/object/tangible/terminal/terminal_character_builder.py b/scripts/object/tangible/terminal/terminal_character_builder.py index ccad8904..d95cbb4c 100644 --- a/scripts/object/tangible/terminal/terminal_character_builder.py +++ b/scripts/object/tangible/terminal/terminal_character_builder.py @@ -1,4 +1,9 @@ import sys def setup(core, object): + object.setAttachment('radial_filename', 'usable') + return + +def use(core, owner, target): + core.devService.sendCharacterBuilderSUI(owner, 0); return \ No newline at end of file diff --git a/scripts/radial/player.py b/scripts/radial/player.py index 3ca2cc75..6ad15a17 100644 --- a/scripts/radial/player.py +++ b/scripts/radial/player.py @@ -4,11 +4,16 @@ import sys def createRadial(core, owner, target, radials): if target.getPosture() == Posture.SkillAnimating: - if target.getPerformanceType() is True: - radials.add(RadialOptions(0, 140, 1, 'Watch')) + if owner.getPerformanceWatchee() == target: + if target.getPerformanceType() is True: + radials.add(RadialOptions(0, 141, 3, 'Stop Watching')) + elif owner.getPerformanceListenee() == target: # TODO: Get rid of PerformanceWatchee variable, no need for listenee (same thing really) + radials.add(RadialOptions(0, 141, 3, 'Stop Listening')) else: - radials.add(RadialOptions(0, 140, 1, 'Listen')) - + if target.getPerformanceType() is True: + radials.add(RadialOptions(0, 140, 3, 'Watch')) + else: + radials.add(RadialOptions(0, 140, 3, 'Listen')) return def handleSelection(core, owner, target, option): @@ -20,4 +25,8 @@ def handleSelection(core, owner, target, option): # TODO: Insert callCommand /listen return return + + if option == 141: + #core.commandService.callCommand(owner, 'stopwatching', target, '') #SWGList error for remove audience in CreatureObject + return return \ No newline at end of file diff --git a/scripts/radial/ring/unity.py b/scripts/radial/ring/unity.py index 8c1c4c5d..92940452 100644 --- a/scripts/radial/ring/unity.py +++ b/scripts/radial/ring/unity.py @@ -16,10 +16,10 @@ def createRadial(core, owner, target, radials): if targetPlayer is not None and targetPlayer.getSlottedObject('ghost') is not None: if targetPlayer.getObjectID() == owner.getObjectID(): return - radials.add(RadialOptions(0, 69, 1, '@unity:mnu_propose')) + radials.add(RadialOptions(0, 69, 3, '@unity:mnu_propose')) return else: - radials.add(RadialOptions(0, 70, 1, '@unity:mnu_divorce')) + radials.add(RadialOptions(0, 70, 3, '@unity:mnu_divorce')) return return diff --git a/scripts/roadmap/bounty_hunter_1a.py b/scripts/roadmap/bounty_hunter_1a.py index 7bb425e3..0c708fec 100644 --- a/scripts/roadmap/bounty_hunter_1a.py +++ b/scripts/roadmap/bounty_hunter_1a.py @@ -23,3 +23,97 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + if name == 'item_bounty_hunter_backpack_01_02': + return "object/tangible/wearables/backpack/shared_backpack_s05.iff" + + if name == 'armor_bounty_hunter_roadmap_bicep_l_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_bicep_l.iff" + + if name == 'armor_bounty_hunter_roadmap_bicep_r_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_bicep_r.iff" + + if name == 'armor_bounty_hunter_roadmap_bracer_l_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_bracer_l.iff" + + if name == 'armor_bounty_hunter_roadmap_bracer_r_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_bracer_r.iff" + + if name == 'armor_bounty_hunter_roadmap_boots_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_boots.iff" + + if name == 'armor_bounty_hunter_roadmap_chest_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_chest_plate.iff" + + if name == 'armor_bounty_hunter_roadmap_gloves_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_gloves.iff" + + if name == 'armor_bounty_hunter_roadmap_helmet_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_helmet.iff" + + if name == 'armor_bounty_hunter_roadmap_leggings_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_leggings.iff" + + if name == 'armor_wookiee_roadmap_chest_02_03': + return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_chestplate.iff" + + if name == 'armor_wookiee_roadmap_leggings_02_03': + return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_leggings.iff" + + if name == 'armor_wookiee_roadmap_bicep_l_02_03': + return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bicep_l.iff" + + if name == 'armor_wookiee_roadmap_bicep_r_02_03': + return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bicep_r.iff" + + if name == 'armor_wookiee_roadmap_bracer_l_02_03': + return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bracer_l.iff" + + if name == 'armor_wookiee_roadmap_bracer_r_02_03': + return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bracer_r.iff" + + if name == 'armor_ithorian_roadmap_chest_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_chest_plate.iff" + + if name == 'armor_ithorian_roadmap_leggings_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_leggings.iff" + + if name == 'armor_ithorian_roadmap_helmet_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_helmet.iff" + + if name == 'armor_ithorian_roadmap_bicep_l_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bicep_l.iff" + + if name == 'armor_ithorian_roadmap_bicep_r_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bicep_r.iff" + + if name == 'armor_ithorian_roadmap_bracer_l_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bracer_l.iff" + + if name == 'armor_ithorian_roadmap_bracer_r_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bracer_r.iff" + + if name == 'armor_ithorian_roadmap_boots_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_boots.iff" + + if name == 'armor_ithorian_roadmap_gloves_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_gloves.iff" + + if name == 'weapon_carbine_bh_roadmap_01_02': + return "object/weapon/ranged/carbine/shared_carbine_ee3.iff" + + if name == 'item_bounty_hunter_ring_01_02': + return "object/tangible/wearables/ring/shared_ring_s02.iff" + + if name == 'weapon_rifle_bh_roadmap_01_02': + return "object/weapon/ranged/rifle/shared_rifle_lightning.iff" + + if name == 'item_bounty_hunter_pendant_01_02': + return "object/tangible/wearables/necklace/shared_necklace_s02.iff" + + if name == 'item_bounty_hunter_clicky_01_02': + return "object/tangible/loot/generic_usable/shared_survey_pad_adv_generic.iff" + + if name == 'item_roadmap_belt_bounty_hunter_01_02': + return "object/tangible/wearables/armor/zam/shared_armor_zam_wesell_belt.iff" \ No newline at end of file diff --git a/scripts/roadmap/commando_1a.py b/scripts/roadmap/commando_1a.py index 8d9253ae..67cdb14b 100644 --- a/scripts/roadmap/commando_1a.py +++ b/scripts/roadmap/commando_1a.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/entertainer_1a.py b/scripts/roadmap/entertainer_1a.py index 0541cc93..efe33465 100644 --- a/scripts/roadmap/entertainer_1a.py +++ b/scripts/roadmap/entertainer_1a.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/force_sensitive_1a.py b/scripts/roadmap/force_sensitive_1a.py index 2d9241b0..9fd5ca69 100644 --- a/scripts/roadmap/force_sensitive_1a.py +++ b/scripts/roadmap/force_sensitive_1a.py @@ -23,3 +23,28 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + if name == 'item_force_sensitive_ring_02_01': + return "object/tangible/wearables/ring/shared_ring_s02.iff" + + if name == 'item_npe_fs_robe_02_02': + return "object/tangible/wearables/robe/shared_robe_jedi_padawan.iff" + + if name == 'weapon_roadmap_lightsaber_02_02': + return "object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_s1.iff" + + if name == 'item_force_sensitive_ring_01_02': + return "object/tangible/wearables/ring/shared_ring_s01.iff" + + if name == 'item_krayt_pearl_04_01': + return "object/tangible/component/weapon/lightsaber/shared_lightsaber_module_krayt_dragon_pearl.iff" + + if name == 'item_force_sensitive_pendant_01_02': + return "object/tangible/wearables/necklace/shared_necklace_s12.iff" + + if name == 'item_force_sensitive_clicky_01_02': + return "object/tangible/loot/generic_usable/shared_generic_crystal.iff" + + if name == 'item_roadmap_belt_force_sensitive_01_02': + return "object/tangible/wearables/armor/zam/shared_armor_zam_wesell_belt.iff" \ No newline at end of file diff --git a/scripts/roadmap/medic_1a.py b/scripts/roadmap/medic_1a.py index 6b84327b..e6f67dfb 100644 --- a/scripts/roadmap/medic_1a.py +++ b/scripts/roadmap/medic_1a.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/officer_1a.py b/scripts/roadmap/officer_1a.py index 25e7254f..83bca56f 100644 --- a/scripts/roadmap/officer_1a.py +++ b/scripts/roadmap/officer_1a.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/roadmap_rewards.py b/scripts/roadmap/roadmap_rewards.py deleted file mode 100644 index a764248f..00000000 --- a/scripts/roadmap/roadmap_rewards.py +++ /dev/null @@ -1,122 +0,0 @@ -import sys - -def get(name): - # Jedi # - if name == 'item_force_sensitive_ring_02_01': - return "object/tangible/wearables/ring/shared_ring_s02.iff" - - if name == 'item_npe_fs_robe_02_02': - return "object/tangible/wearables/robe/shared_robe_jedi_padawan.iff" - - if name == 'weapon_roadmap_lightsaber_02_02': - return "object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_s1.iff" - - if name == 'item_force_sensitive_ring_01_02': - return "object/tangible/wearables/ring/shared_ring_s01.iff" - - if name == 'item_krayt_pearl_04_01': - return "object/tangible/component/weapon/lightsaber/shared_lightsaber_module_krayt_dragon_pearl.iff" - - if name == 'item_force_sensitive_pendant_01_02': - return "object/tangible/wearables/necklace/shared_necklace_s12.iff" - - if name == 'item_force_sensitive_clicky_01_02': - return "object/tangible/loot/generic_usable/shared_generic_crystal.iff" - - if name == 'item_roadmap_belt_force_sensitive_01_02': - return "object/tangible/wearables/armor/zam/shared_armor_zam_wesell_belt.iff" - - # Bounty Hunter # - - if name == 'item_bounty_hunter_backpack_01_02': - return "object/tangible/wearables/backpack/shared_backpack_s05.iff" - - if name == 'armor_bounty_hunter_roadmap_bicep_l_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_bicep_l.iff" - - if name == 'armor_bounty_hunter_roadmap_bicep_r_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_bicep_r.iff" - - if name == 'armor_bounty_hunter_roadmap_bracer_l_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_bracer_l.iff" - - if name == 'armor_bounty_hunter_roadmap_bracer_r_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_bracer_r.iff" - - if name == 'armor_bounty_hunter_roadmap_boots_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_boots.iff" - - if name == 'armor_bounty_hunter_roadmap_chest_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_chest_plate.iff" - - if name == 'armor_bounty_hunter_roadmap_gloves_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_gloves.iff" - - if name == 'armor_bounty_hunter_roadmap_helmet_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_helmet.iff" - - if name == 'armor_bounty_hunter_roadmap_leggings_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_leggings.iff" - - if name == 'armor_wookiee_roadmap_chest_02_03': - return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_chestplate.iff" - - if name == 'armor_wookiee_roadmap_leggings_02_03': - return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_leggings.iff" - - if name == 'armor_wookiee_roadmap_bicep_l_02_03': - return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bicep_l.iff" - - if name == 'armor_wookiee_roadmap_bicep_r_02_03': - return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bicep_r.iff" - - if name == 'armor_wookiee_roadmap_bracer_l_02_03': - return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bracer_l.iff" - - if name == 'armor_wookiee_roadmap_bracer_r_02_03': - return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bracer_r.iff" - - if name == 'armor_ithorian_roadmap_chest_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_chest_plate.iff" - - if name == 'armor_ithorian_roadmap_leggings_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_leggings.iff" - - if name == 'armor_ithorian_roadmap_helmet_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_helmet.iff" - - if name == 'armor_ithorian_roadmap_bicep_l_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bicep_l.iff" - - if name == 'armor_ithorian_roadmap_bicep_r_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bicep_r.iff" - - if name == 'armor_ithorian_roadmap_bracer_l_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bracer_l.iff" - - if name == 'armor_ithorian_roadmap_bracer_r_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bracer_r.iff" - - if name == 'armor_ithorian_roadmap_boots_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_boots.iff" - - if name == 'armor_ithorian_roadmap_gloves_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_gloves.iff" - - if name == 'weapon_carbine_bh_roadmap_01_02': - return "object/weapon/ranged/carbine/shared_carbine_ee3.iff" - - if name == 'item_bounty_hunter_ring_01_02': - return "object/tangible/wearables/ring/shared_ring_s02.iff" - - if name == 'weapon_rifle_bh_roadmap_01_02': - return "object/weapon/ranged/rifle/shared_rifle_lightning.iff" - - if name == 'item_bounty_hunter_pendant_01_02': - return "object/tangible/wearables/necklace/shared_necklace_s02.iff" - - if name == 'item_bounty_hunter_clicky_01_02': - return "object/tangible/loot/generic_usable/shared_survey_pad_adv_generic.iff" - - if name == 'item_roadmap_belt_bounty_hunter_01_02': - return "object/tangible/wearables/armor/zam/shared_armor_zam_wesell_belt.iff" \ No newline at end of file diff --git a/scripts/roadmap/smuggler_1a.py b/scripts/roadmap/smuggler_1a.py index 8084fcd2..2b41cce4 100644 --- a/scripts/roadmap/smuggler_1a.py +++ b/scripts/roadmap/smuggler_1a.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/spy_1a.py b/scripts/roadmap/spy_1a.py index 6fe7c37a..079de728 100644 --- a/scripts/roadmap/spy_1a.py +++ b/scripts/roadmap/spy_1a.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/trader_0a.py b/scripts/roadmap/trader_0a.py index 2846dee7..203b6ad9 100644 --- a/scripts/roadmap/trader_0a.py +++ b/scripts/roadmap/trader_0a.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/trader_0b.py b/scripts/roadmap/trader_0b.py index 2846dee7..203b6ad9 100644 --- a/scripts/roadmap/trader_0b.py +++ b/scripts/roadmap/trader_0b.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/trader_0c.py b/scripts/roadmap/trader_0c.py index 2846dee7..203b6ad9 100644 --- a/scripts/roadmap/trader_0c.py +++ b/scripts/roadmap/trader_0c.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/trader_0d.py b/scripts/roadmap/trader_0d.py index 2846dee7..203b6ad9 100644 --- a/scripts/roadmap/trader_0d.py +++ b/scripts/roadmap/trader_0d.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/skillMods/expertise_critical_melee.py b/scripts/skillMods/expertise_critical_melee.py index ee7769e2..fd6ebde6 100644 --- a/scripts/skillMods/expertise_critical_melee.py +++ b/scripts/skillMods/expertise_critical_melee.py @@ -1,10 +1,16 @@ import sys def add(core, actor, name, base): - actor.addSkillMod(name, base) + actor.addSkillMod("expertise_critical_1h", base) + actor.addSkillMod("expertise_critical_2h", base) + actor.addSkillMod("expertise_critical_unarmed", base) + actor.addSkillMod("expertise_critical_polearm", base) return def deduct(core, actor, name, base): - actor.deductSkillMod(name, base) + actor.deductSkillMod("expertise_critical_1h", base) + actor.deductSkillMod("expertise_critical_2h", base) + actor.deductSkillMod("expertise_critical_unarmed", base) + actor.deductSkillMod("expertise_critical_polearm", base) return \ No newline at end of file diff --git a/scripts/static_spawns/tatooine.py b/scripts/static_spawns/tatooine.py index 4ff2338b..785f26b5 100644 --- a/scripts/static_spawns/tatooine.py +++ b/scripts/static_spawns/tatooine.py @@ -8,7 +8,7 @@ def addPlanetSpawns(core, planet): #this script is no longer for NPC spawning usage. - Levarris #stcSvc.spawnObject('object/mobile/shared_3po_protocol_droid_red.iff', 'tatooine', long(26582), float(-14.3), float(2.0), float(47.4), float(0.70), float(0.71)) - + stcSvc.spawnObject('object/tangible/terminal/shared_terminal_character_builder.iff', 'tatooine', long(0), float(3525), float(4), float(-4801), float(0.70), float(0.71)) return diff --git a/src/main/NGECore.java b/src/main/NGECore.java index 6cff7196..b4b8eb5a 100644 --- a/src/main/NGECore.java +++ b/src/main/NGECore.java @@ -52,6 +52,7 @@ import services.AttributeService; import services.BuffService; import services.CharacterService; import services.ConnectionService; +import services.DevService; import services.EntertainmentService; import services.EquipmentService; import services.GroupService; @@ -165,6 +166,7 @@ public class NGECore { public AIService aiService; //public MissionService missionService; public InstanceService instanceService; + public DevService devService; // Login Server public NetworkDispatch loginDispatch; @@ -259,6 +261,7 @@ public class NGECore { skillModService = new SkillModService(this); equipmentService = new EquipmentService(this); entertainmentService = new EntertainmentService(this); + devService = new DevService(this); if (config.keyExists("JYTHONCONSOLE.PORT")) { int jythonPort = config.getInt("JYTHONCONSOLE.PORT"); diff --git a/src/protocol/swg/CollectionServerFirstListRequest.java b/src/protocol/swg/CollectionServerFirstListRequest.java new file mode 100644 index 00000000..cc053664 --- /dev/null +++ b/src/protocol/swg/CollectionServerFirstListRequest.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * 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 org.apache.mina.core.buffer.IoBuffer; + +public class CollectionServerFirstListRequest extends SWGMessage { + + private String server; + + public CollectionServerFirstListRequest() { + } + + @Override + public void deserialize(IoBuffer data) { + data.getShort(); + data.getInt(); + setServer(getAsciiString(data)); + } + + public String getServer() { + return server; + } + + @Override + public IoBuffer serialize() { + return null; + } + + public void setServer(String server) { + this.server = server; + } + +} diff --git a/src/protocol/swg/CollectionServerFirstListResponse.java b/src/protocol/swg/CollectionServerFirstListResponse.java new file mode 100644 index 00000000..163627da --- /dev/null +++ b/src/protocol/swg/CollectionServerFirstListResponse.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * 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 java.util.Map; +import java.util.Map.Entry; + +import main.NGECore; + +import org.apache.mina.core.buffer.IoBuffer; + +import services.collections.ServerFirst; +import engine.resources.common.CRC; + +public class CollectionServerFirstListResponse extends SWGMessage { + + private Map sfList; + private String server; + + public CollectionServerFirstListResponse(String server, Map serverFirstList){ + this.sfList = serverFirstList; + this.server = server; + } + + @Override + public void deserialize(IoBuffer data) { + + } + + @Override + public IoBuffer serialize() { + IoBuffer buffer; + + int size = 0; + + synchronized (sfList) { + for (Entry entry : sfList.entrySet()) { + size += entry.getValue().getBytes().length; + } + + buffer = IoBuffer.allocate(12 + server.length() + size).order(ByteOrder.LITTLE_ENDIAN); + buffer.putShort((short) 2); + buffer.putInt(CRC.StringtoCRC("CollectionServerFirstListResponse")); + + buffer.put(getAsciiString(server)); + buffer.putInt(sfList.size()); + + for (Entry entry : sfList.entrySet()) { + buffer.put(entry.getValue().getBytes()); + + } + return buffer.flip(); + } + } +} diff --git a/src/protocol/swg/objectControllerObjects/ShowFlyText.java b/src/protocol/swg/objectControllerObjects/ShowFlyText.java index 41325368..f47bbbb2 100644 --- a/src/protocol/swg/objectControllerObjects/ShowFlyText.java +++ b/src/protocol/swg/objectControllerObjects/ShowFlyText.java @@ -27,6 +27,7 @@ import org.apache.mina.core.buffer.IoBuffer; import protocol.swg.ObjControllerMessage; import resources.common.RGB; +import resources.common.StringUtilities; public class ShowFlyText extends ObjControllerObject { @@ -70,6 +71,7 @@ public class ShowFlyText extends ObjControllerObject { this.scale = scale; this.color = color; this.alternativeStructure = true; + this.displayType = displayType; } @Override @@ -117,13 +119,16 @@ public class ShowFlyText extends ObjControllerObject { result.putLong(0); result.putLong(0); result.putLong(0); - result.put(getUnicodeString(customText)); - result.putShort(xp); + result.put(getUnicodeString(customText)); // %TO? + result.putShort(xp); // %DI ? result.putLong(0); result.putFloat(scale); result.put(color.getBytes()); result.putInt(displayType); - return result.flip(); + + result.flip(); + //StringUtilities.printBytes(result.array()); + return result; } } diff --git a/src/protocol/swg/objectControllerObjects/ShowLootBox.java b/src/protocol/swg/objectControllerObjects/ShowLootBox.java index e295fc2d..432ddd14 100644 --- a/src/protocol/swg/objectControllerObjects/ShowLootBox.java +++ b/src/protocol/swg/objectControllerObjects/ShowLootBox.java @@ -23,6 +23,7 @@ package protocol.swg.objectControllerObjects; import java.nio.ByteOrder; import java.util.List; +import java.util.Vector; import org.apache.mina.core.buffer.IoBuffer; @@ -33,9 +34,15 @@ import resources.common.StringUtilities; public class ShowLootBox extends ObjControllerObject { private long playerId; - private SWGObject[] rewards; + private Vector rewards; + private SWGObject reward; - public ShowLootBox(long playerId, SWGObject[] rewards) { + public ShowLootBox(long playerId, SWGObject reward) { + this.playerId = playerId; + this.rewards = rewards; + } + + public ShowLootBox(long playerId, Vector rewards) { this.playerId = playerId; this.rewards = rewards; } @@ -47,19 +54,24 @@ public class ShowLootBox extends ObjControllerObject { @Override public IoBuffer serialize() { - // Controller Type = 11 - IoBuffer buffer = IoBuffer.allocate(20 + (rewards.length * 8)).order(ByteOrder.LITTLE_ENDIAN); + IoBuffer buffer; + + if (rewards != null) + buffer = IoBuffer.allocate(20 + (rewards.size() * 8)).order(ByteOrder.LITTLE_ENDIAN); + + else + buffer = IoBuffer.allocate(28).order(ByteOrder.LITTLE_ENDIAN); buffer.putInt(ObjControllerMessage.SHOW_LOOT_BOX); buffer.putLong(playerId); buffer.putInt(0); // 1 for a black background on icon, 0 or 2 for transparent (default) - if (rewards.length == 1) { + if (rewards == null) { buffer.putInt(1); - buffer.putLong(rewards[0].getObjectId()); + buffer.putLong(reward.getObjectId()); } else { - buffer.putInt(rewards.length); + buffer.putInt(rewards.size()); for(SWGObject obj : rewards) { buffer.putLong(obj.getObjectID()); } diff --git a/src/resources/common/MathUtilities.java b/src/resources/common/MathUtilities.java index 8cf73cc0..8decf30b 100644 --- a/src/resources/common/MathUtilities.java +++ b/src/resources/common/MathUtilities.java @@ -21,6 +21,8 @@ ******************************************************************************/ package resources.common; +import java.math.BigDecimal; + import engine.resources.scene.*; public class MathUtilities { @@ -43,5 +45,27 @@ public class MathUtilities { q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x); } + + /** + * Converts seconds to a whole hour. + * @author Waverunner + * @param seconds + * @return hour(s) + */ + public static int secondsToWholeHours(int seconds) { + BigDecimal dec = new BigDecimal(seconds); + return dec.divide(new BigDecimal(3600), BigDecimal.ROUND_FLOOR).intValue(); + } + + /** + * Converts seconds to minutes of the hour. + * @author Waverunner + * @param seconds + * @return hour(s) + */ + public static int secondsToHourMinutes(int seconds) { + BigDecimal dec = new BigDecimal(seconds); + return dec.remainder(new BigDecimal(3600)).divide(new BigDecimal(60), BigDecimal.ROUND_FLOOR).intValue(); + } } diff --git a/src/resources/objects/creature/CreatureMessageBuilder.java b/src/resources/objects/creature/CreatureMessageBuilder.java index e3facb65..08f33a9b 100644 --- a/src/resources/objects/creature/CreatureMessageBuilder.java +++ b/src/resources/objects/creature/CreatureMessageBuilder.java @@ -379,7 +379,12 @@ public class CreatureMessageBuilder extends ObjectMessageBuilder { buffer.put((byte) 0); // performing? boolean buffer.put(creature.getDifficulty()); - buffer.putInt(0xFFFFFFFF); // -1 normal appearance, 0 hologram + + if(creature.isHologram()) + buffer.putInt(0); + else + buffer.putInt(0xFFFFFFFF); + buffer.put((byte) 1); // visibleOnRadar? boolean buffer.put((byte) 0); // no effect for 1? buffer.put((byte) 0); // no effect for 1? diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index 46d13369..efb52cb8 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -57,7 +57,7 @@ import engine.resources.scene.Quaternion; import resources.objects.tangible.TangibleObject; import resources.objects.weapon.WeaponObject; -@Entity(version=1) +@Entity(version=3) public class CreatureObject extends TangibleObject implements IPersistent { @NotPersistent @@ -118,12 +118,9 @@ public class CreatureObject extends TangibleObject implements IPersistent { private byte moodId = 0; private int performanceCounter = 0; private int performanceId = 0; - //FIXME: this is a bit of a hack. + private boolean hologram = false; private boolean performanceType = false; - //FIXME: hmm.. or persistent? - @NotPersistent private boolean acceptBandflourishes = true; - @NotPersistent private boolean groupDance = true; private CreatureObject performanceWatchee; private CreatureObject performanceListenee; @@ -171,6 +168,8 @@ public class CreatureObject extends TangibleObject implements IPersistent { @NotPersistent private boolean performingEffect; + private int coverCharge; + public CreatureObject(long objectID, Planet planet, Point3D position, Quaternion orientation, String Template) { super(objectID, planet, Template, position, orientation); messageBuilder = new CreatureMessageBuilder(this); @@ -435,11 +434,15 @@ public class CreatureObject extends TangibleObject implements IPersistent { } public ScheduledFuture getInspirationTick() { - return inspirationTick; + synchronized(objectMutex) { + return inspirationTick; + } } public void setInspirationTick(ScheduledFuture inspirationTick) { - this.inspirationTick = inspirationTick; + synchronized(objectMutex) { + this.inspirationTick = inspirationTick; + } } @Override @@ -570,6 +573,7 @@ public class CreatureObject extends TangibleObject implements IPersistent { public void addSkillMod(String name, int base) { if(getSkillMod(name) == null) { + // TODO: This will need to be fixed as it doesn't update in the character sheet properly (wrong delta) SkillMod skillMod = new SkillMod(); skillMod.setBase(base); skillMod.setSkillModString(name); @@ -1532,7 +1536,11 @@ public class CreatureObject extends TangibleObject implements IPersistent { public void removeAudience(CreatureObject audienceMember) { synchronized(objectMutex) { if (performanceAudience == null) { return; } - performanceAudience.remove(audienceMember); + if (audienceMember.getInspirationTick() != null) + audienceMember.getInspirationTick().cancel(true); + + if(performanceAudience.contains(audienceMember)) + performanceAudience.remove(audienceMember); // SWGList error } } @@ -1671,4 +1679,28 @@ public class CreatureObject extends TangibleObject implements IPersistent { this.performingEffect = hasEffect; } } + + public void setHologram(boolean isHologram) { + synchronized(objectMutex) { + this.hologram = isHologram; + } + } + + public boolean isHologram() { + synchronized(objectMutex) { + return hologram; + } + } + + public int getCoverCharge() { + synchronized(objectMutex) { + return coverCharge; + } + } + + public void setCoverCharge(int coverCharge) { + synchronized (objectMutex) { + this.coverCharge = coverCharge; + } + } } diff --git a/src/resources/objects/tangible/TangibleObject.java b/src/resources/objects/tangible/TangibleObject.java index 587daa91..8c579480 100644 --- a/src/resources/objects/tangible/TangibleObject.java +++ b/src/resources/objects/tangible/TangibleObject.java @@ -321,6 +321,18 @@ public class TangibleObject extends SWGObject { } } + public void showFlyText(String stfFile, String stfString, String customText, int xp, float scale, RGB color, int displayType, int unkInt) { + //Set observers = getObservers(); + + if (getClient() != null) { + getClient().getSession().write((new ObjControllerMessage(0x0000000B, new ShowFlyText(getObjectID(), getObjectID(), unkInt, 1, 1, -1, stfFile, stfString, customText, xp, scale, color, displayType))).serialize()); + } + + /*for (Client client : observers) { + client.getSession().write((new ObjControllerMessage(0x0000000B, new ShowFlyText(client.getParent().getObjectID(), getObjectID(), unkInt, 1, 1, -1, stfFile, stfString, customText, xp, scale, color, displayType))).serialize()); + }*/ + } + public void playEffectObject(String effectFile, String commandString) { notifyObservers(new PlayClientEffectObjectMessage(effectFile, getObjectID(), commandString), true); } diff --git a/src/services/BuffService.java b/src/services/BuffService.java index f8a6bcb3..aa822001 100644 --- a/src/services/BuffService.java +++ b/src/services/BuffService.java @@ -72,7 +72,7 @@ public class BuffService implements INetworkDispatch { addBuffToCreature(creature, buffName, creature); } - public void addBuffToCreature(CreatureObject target, String buffName, CreatureObject buffer) { + public boolean addBuffToCreature(CreatureObject target, String buffName, CreatureObject buffer) { /*if(!FileUtilities.doesFileExist("scripts/buffs/" + buffName + ".py")) { //System.out.println("Buff script doesnt exist for: " + buffName); @@ -82,8 +82,10 @@ public class BuffService implements INetworkDispatch { final Buff buff = new Buff(buffName, buffer.getObjectID()); if(buff.isGroupBuff()) { addGroupBuff(buffer, buffName, buffer); + return true; } else { doAddBuff(target, buffName, buffer); + return true; } } diff --git a/src/services/ConnectionService.java b/src/services/ConnectionService.java index c0d5405e..9791848a 100644 --- a/src/services/ConnectionService.java +++ b/src/services/ConnectionService.java @@ -195,6 +195,20 @@ public class ConnectionService implements INetworkDispatch { object.setInviteCounter(0); object.setInviteSenderId(0); object.setInviteSenderName(""); + + if(object.getAttachment("inspireDuration") != null) + object.setAttachment("inspireDuration", null); + + if(object.getInspirationTick() != null) { + object.getInspirationTick().cancel(true); + object.setInspirationTick(null); + } + + if(object.getSpectatorTask() != null) { + object.getSpectatorTask().cancel(true); + object.setSpectatorTask(null); + } + core.groupService.handleGroupDisband(object); for (CreatureObject opponent : object.getDuelList()) { diff --git a/src/services/DevService.java b/src/services/DevService.java new file mode 100644 index 00000000..062adf0f --- /dev/null +++ b/src/services/DevService.java @@ -0,0 +1,277 @@ +/******************************************************************************* + * 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; + +import java.nio.ByteOrder; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Vector; + +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.common.SpawnPoint; +import resources.objects.building.BuildingObject; +import resources.objects.creature.CreatureObject; +import resources.objects.player.PlayerObject; +import resources.objects.tangible.TangibleObject; +import services.sui.SUIWindow; +import services.sui.SUIService.ListBoxType; +import services.sui.SUIWindow.SUICallback; +import services.sui.SUIWindow.Trigger; +import main.NGECore; +import engine.clientdata.ClientFileManager; +import engine.clientdata.visitors.DatatableVisitor; +import engine.clients.Client; +import engine.resources.objects.SWGObject; +import engine.resources.scene.Planet; +import engine.resources.scene.Point3D; +import engine.resources.service.INetworkDispatch; +import engine.resources.service.INetworkRemoteEvent; + +@SuppressWarnings("unused") +public class DevService implements INetworkDispatch { + + private NGECore core; + + public DevService(NGECore core) { + this.core = core; + } + + public void sendCharacterBuilderSUI(CreatureObject creature, int childMenu) + { + Map suiOptions = new HashMap(); + + switch(childMenu) + { + case 0: // Root + suiOptions.put((long) 1, "Character"); + suiOptions.put((long) 2, "Items"); + break; + case 1: // Character + suiOptions.put((long) 10, "Set combat level to 90"); + suiOptions.put((long) 11, "Give 100,000 credits"); + break; + case 2: // Items + suiOptions.put((long) 20, "(Light) Jedi Robe"); + suiOptions.put((long) 21, "(Dark) Jedi Robe"); + suiOptions.put((long) 22, "Composite Armor"); + suiOptions.put((long) 23, "Weapons"); + break; + case 3: // [Items] Weapons + suiOptions.put((long) 30, "Jedi Weapons"); + suiOptions.put((long) 31, "Melee Weapons"); + suiOptions.put((long) 32, "Ranged Weapons"); + break; + } + + final SUIWindow window = core.suiService.createListBox(ListBoxType.LIST_BOX_OK_CANCEL, "Character Builder Terminal", "Select the desired option and click OK.", suiOptions, creature, null, 10); + Vector returnList = new Vector(); + + returnList.add("List.lstList:SelectedRow"); + + window.addHandler(0, "", Trigger.TRIGGER_OK, returnList, new SUICallback() + { + public void process(SWGObject owner, int eventType, Vector returnList) + { + int index = Integer.parseInt(returnList.get(0)); + int childIndex = (int) window.getObjectIdByIndex(index); + + CreatureObject player = (CreatureObject) owner; + SWGObject inventory = player.getSlottedObject("inventory"); + Planet planet = player.getPlanet(); + + switch(childIndex) + { + // Root + case 1: // Character + sendCharacterBuilderSUI(player, 1); + return; + case 2: // Items + sendCharacterBuilderSUI(player, 2); + return; + + // Character + case 10: // Set combat level to 90 + core.playerService.giveExperience(player, 999999999); + return; + case 11: // Give 100,000 credits + player.setCashCredits(player.getCashCredits() + 100000); + return; + + // Items + case 20: // (Light) Jedi Robe + inventory.add(core.objectService.createObject("object/tangible/wearables/robe/shared_robe_jedi_light_s03.iff", planet)); + return; + case 21: // (Dark) Jedi Robe + inventory.add(core.objectService.createObject("object/tangible/wearables/robe/shared_robe_jedi_dark_s03.iff", planet)); + return; + case 22: // Composite Armor + SWGObject bicep_r = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bicep_r.iff", planet); + bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject bicep_l = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bicep_l.iff", planet); + bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject bracer_r = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bracer_r.iff", planet); + bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject bracer_l = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bracer_l.iff", planet); + bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject leggings = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_leggings.iff", planet); + leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject helmet = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_helmet.iff", planet); + helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject chest = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_chest_plate.iff", planet); + chest.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + chest.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + chest.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + chest.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + chest.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + chest.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject boots = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_boots.iff", planet); + SWGObject gloves = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_gloves.iff", planet); + + + + inventory.add(bicep_r); + inventory.add(bicep_l); + inventory.add(bracer_r); + inventory.add(bracer_l); + inventory.add(leggings); + inventory.add(helmet); + inventory.add(chest); + inventory.add(boots); + inventory.add(gloves); + + + return; + case 23: // Weapons + sendCharacterBuilderSUI(player, 3); + return; + + // [Items] Weapons + case 30: // Jedi Weapons + SWGObject lightsaber1 = core.objectService.createObject("object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_gen5.iff", planet); + lightsaber1.setIntAttribute("required_combat_level", 90); + lightsaber1.setFloatAttribute("cat_wpn_damage.wpn_attack_speed", 1); + lightsaber1.setStringAttribute("class_required", "Jedi"); + lightsaber1.setStringAttribute("cat_wpn_damage.wpn_damage_type", "Energy"); + lightsaber1.setStringAttribute("cat_wpn_damage.damage", "689-1379"); + + SWGObject lightsaber2 = core.objectService.createObject("object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gen5.iff", planet); + lightsaber2.setIntAttribute("required_combat_level", 90); + lightsaber2.setFloatAttribute("cat_wpn_damage.wpn_attack_speed", 1); + lightsaber2.setStringAttribute("class_required", "Jedi"); + lightsaber2.setStringAttribute("cat_wpn_damage.wpn_damage_type", "Energy"); + lightsaber2.setStringAttribute("cat_wpn_damage.damage", "689-1379"); + + SWGObject lightsaber3 = core.objectService.createObject("object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_gen5.iff", planet); + lightsaber3.setIntAttribute("required_combat_level", 90); + lightsaber3.setFloatAttribute("cat_wpn_damage.wpn_attack_speed", 1); + lightsaber3.setStringAttribute("class_required", "Jedi"); + lightsaber3.setStringAttribute("cat_wpn_damage.wpn_damage_type", "Energy"); + lightsaber3.setStringAttribute("cat_wpn_damage.damage", "689-1379"); + + inventory.add(lightsaber1); + inventory.add(lightsaber2); + inventory.add(lightsaber3); + return; + case 31: // Melee Weapons + SWGObject sword1 = core.objectService.createObject("object/weapon/melee/sword/shared_sword_01.iff", planet); + sword1.setIntAttribute("required_combat_level", 90); + sword1.setFloatAttribute("cat_wpn_damage.wpn_attack_speed", 1); + sword1.setStringAttribute("class_required", "None"); + sword1.setStringAttribute("cat_wpn_damage.wpn_damage_type", "Energy"); + sword1.setStringAttribute("cat_wpn_damage.damage", "1100-1200"); + + inventory.add(sword1); + return; + case 32: // Ranged Weapons + SWGObject rifle1 = core.objectService.createObject("object/weapon/ranged/rifle/shared_rifle_e11.iff", planet); + rifle1.setIntAttribute("required_combat_level", 90); + rifle1.setFloatAttribute("cat_wpn_damage.wpn_attack_speed", 1); + rifle1.setStringAttribute("class_required", "None"); + rifle1.setStringAttribute("cat_wpn_damage.wpn_damage_type", "Energy"); + rifle1.setStringAttribute("cat_wpn_damage.damage", "800-1250"); + + inventory.add(rifle1); + return; + } + } + }); + + core.suiService.openSUIWindow(window); + } + + @Override + public void insertOpcodes(Map swgOpcodes, Map objControllerOpcodes) { + } + + + @Override + public void shutdown() { + + } + +} diff --git a/src/services/EntertainmentService.java b/src/services/EntertainmentService.java index b45b0c8d..d3375af1 100644 --- a/src/services/EntertainmentService.java +++ b/src/services/EntertainmentService.java @@ -4,6 +4,7 @@ import java.nio.ByteOrder; import java.util.HashMap; import java.util.Iterator; import java.util.Map; +import java.util.Random; import java.util.Vector; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executors; @@ -24,20 +25,28 @@ import protocol.swg.objectControllerObjects.BuffBuilderEndMessage; import protocol.swg.objectControllerObjects.BuffBuilderStartMessage; import resources.common.BuffBuilder; import resources.common.Console; +import resources.common.MathUtilities; import resources.common.ObjControllerOpcodes; import resources.common.Performance; import resources.common.PerformanceEffect; +import resources.common.RGB; import resources.common.StringUtilities; import resources.datatables.Posture; import resources.objects.Buff; import resources.objects.BuffItem; +import resources.objects.SWGList; import resources.objects.creature.CreatureObject; import resources.objects.player.PlayerObject; import resources.objects.tangible.TangibleObject; +import services.sui.SUIService.InputBoxType; +import services.sui.SUIWindow; +import services.sui.SUIWindow.SUICallback; +import services.sui.SUIWindow.Trigger; import engine.clientdata.ClientFileManager; import engine.clientdata.visitors.DatatableVisitor; import engine.clients.Client; import engine.resources.objects.SWGObject; +import engine.resources.objects.SkillMod; import engine.resources.service.INetworkDispatch; import engine.resources.service.INetworkRemoteEvent; @@ -52,6 +61,8 @@ public class EntertainmentService implements INetworkDispatch { private ConcurrentHashMap performancesByIndex = new ConcurrentHashMap(); private ConcurrentHashMap danceMap = new ConcurrentHashMap(); + private Random ranWorkshop = new Random(); + private Map performanceEffects = new ConcurrentHashMap(); public EntertainmentService(NGECore core) { @@ -70,7 +81,7 @@ public class EntertainmentService implements INetworkDispatch { public void handlePacket(IoSession session, IoBuffer data) throws Exception { data.order(ByteOrder.LITTLE_ENDIAN); - StringUtilities.printBytes(data.array()); + Client client = core.getClient(session); if(client == null) @@ -145,8 +156,8 @@ public class EntertainmentService implements INetworkDispatch { Vector statBuffs = sentPacket.getStatBuffs(); - SWGObject buffer = core.objectService.getObject(sentPacket.getBufferId()); - SWGObject buffRecipient = core.objectService.getObject(sentPacket.getBuffRecipientId()); + CreatureObject buffer = (CreatureObject) core.objectService.getObject(sentPacket.getBufferId()); + CreatureObject buffRecipient = (CreatureObject) core.objectService.getObject(sentPacket.getBuffRecipientId()); if (buffer != buffRecipient) { @@ -170,7 +181,7 @@ public class EntertainmentService implements INetworkDispatch { } } - giveInspirationBuff(buffRecipient, statBuffs); + giveInspirationBuff(buffRecipient, buffer, statBuffs); BuffBuilderEndMessage endBuilder = new BuffBuilderEndMessage(changeMessage); endBuilder.setObjectId(buffer.getObjectId()); @@ -200,7 +211,7 @@ public class EntertainmentService implements INetworkDispatch { } else { if (sentPacket.getAccepted() == true) { - giveInspirationBuff(buffRecipient, statBuffs); + giveInspirationBuff(buffRecipient, buffer, statBuffs); BuffBuilderEndMessage endBuilder = new BuffBuilderEndMessage(sentPacket); endBuilder.setObjectId(buffer.getObjectId()); @@ -334,8 +345,10 @@ public class EntertainmentService implements INetworkDispatch { core.commandService.registerCommand("startdance"); core.commandService.registerCommand("stopdance"); core.commandService.registerCommand("watch"); - core.commandService.registerCommand("stopwatching"); + //core.commandService.registerCommand("stopwatching"); // SWGList error //core.commandService.registerCommand("holoEmote"); + core.commandService.registerCommand("covercharge"); + // TODO: Add /bandsolo, /bandpause, /changeBandMusic, /changeDance, /changeGroupDance, /changeMusic // Entertainer Effects @@ -354,8 +367,7 @@ public class EntertainmentService implements INetworkDispatch { core.commandService.registerCommand("ventriloquism"); } - public void giveInspirationBuff(SWGObject reciever, Vector buffVector) { - CreatureObject buffCreature = (CreatureObject) reciever; + public void giveInspirationBuff(CreatureObject reciever, CreatureObject buffer, Vector buffVector) { Vector availableStats = buffBuilderSkills; Vector stats = new Vector(); @@ -372,22 +384,35 @@ public class EntertainmentService implements INetworkDispatch { BuffItem stat = new BuffItem(builder.getStatAffects(), item.getInvested(), item.getEntertainerBonus()); stat.setAffectAmount(affectTotal); - - /*System.out.println("Invested Points: " + item.getInvested()); - System.out.println("Entertainer Bonus: " + item.getEntertainerBonus()); - System.out.println("Affect Total: " + affectTotal);*/ stats.add(stat); - - break; } } } - reciever.setAttachment("buffWorkshop", buffVector); - - core.buffService.addBuffToCreature(buffCreature, "buildabuff_inspiration"); + reciever.setAttachment("buffWorkshop", stats); + PlayerObject rPlayer = (PlayerObject) reciever.getSlottedObject("ghost"); + + long timeStamp = 0; + if (reciever.getAttachment("buffWorkshopTimestamp") != null) + timeStamp = (long) reciever.getAttachment("buffWorkshopTimestamp"); + + core.buffService.addBuffToCreature(reciever, "buildabuff_inspiration", buffer); + /*if (core.buffService.addBuffToCreature(reciever, "buildabuff_inspiration", buffer) && !rPlayer.getProfession().equals("entertainer_1a")) { + if (timeStamp == 0 || (System.currentTimeMillis() - timeStamp > 86400000)) { + float random = ranWorkshop.nextFloat(); + if (random < 0.75f) { + + if(rPlayer.getProfession().contains("trader")) { core.collectionService.addCollection(buffer, "prof_trader"); } + + else { + core.collectionService.addCollection(buffer, rPlayer.getProfession()); + } + } + } else { buffer.sendSystemMessage("@collection:buffed_too_soon", (byte) 0); } + reciever.setAttachment("buffWorkshopTimestamp", System.currentTimeMillis()); + }*/ } public int getDanceVisualId(String danceName) { @@ -480,7 +505,19 @@ public class EntertainmentService implements INetworkDispatch { } - public void startSpectating(final CreatureObject spectator, final CreatureObject performer) { + public void startSpectating(final CreatureObject spectator, final CreatureObject performer, boolean spectateType) { + + // visual + if (spectator.getPerformanceWatchee() == performer && spectateType) + spectator.getPerformanceWatchee().removeAudience(spectator); + // music + else if (spectator.getPerformanceListenee() == performer && !spectateType) + spectator.getPerformanceListenee().removeAudience(spectator); + + spectator.setPerformanceWatchee(performer); + performer.addAudience(spectator); + spectator.setMoodAnimation("entertained"); + final ScheduledFuture spectatorTask = scheduler.scheduleAtFixedRate(new Runnable() { @Override @@ -500,13 +537,24 @@ public class EntertainmentService implements INetworkDispatch { spectator.setMoodAnimation("neutral"); performer.removeAudience(spectator); - spectator.getSpectatorTask().cancel(true); + if (spectator.getInspirationTick().cancel(true)) + spectator.getSpectatorTask().cancel(true); } } }, 2, 2, TimeUnit.SECONDS); spectator.setSpectatorTask(spectatorTask); + + if(((PlayerObject)performer.getSlottedObject("ghost")).getProfession().equals("entertainer_1a")) { + handleInspirationTicks(spectator, performer); + } + + if(spectateType) + spectator.sendSystemMessage("You start watching " + performer.getCustomName() + ".", (byte) 0); + else + spectator.sendSystemMessage("You start listening to " + performer.getCustomName() + ".", (byte) 0); + } public void performFlourish(final CreatureObject performer, int flourish) { @@ -547,8 +595,6 @@ public class EntertainmentService implements INetworkDispatch { String performance = (performer.getPerformanceType()) ? "dance" : "music"; - // TODO: Skill Level check - if(performer.isPerformingEffect()) { performer.sendSystemMessage("@performance:effect_wait_self", (byte) 0); return false; @@ -591,6 +637,85 @@ public class EntertainmentService implements INetworkDispatch { return true; } + public void handleInspirationTicks(final CreatureObject spectator, final CreatureObject performer) { + // http://youtu.be/WqyAde-oC7o?t=11m14s << Player watching entertainer (Has ring only, no pet, + 15 min ticks) + // TODO: Camp/Cantina checks for expertise and duration bonus %. Right now only using basic values. + final ScheduledFuture inspirationTick = scheduler.scheduleAtFixedRate(new Runnable() { + + @Override + public void run() { + int time = 0; // current buff duration time (minutes) + int buffCap = 215; // 5 hours 35 minutes - 2 hours (buff duration increase bonus) << Taken from video, doesn't account for performance bonuses etc. + + if (spectator.getAttachment("inspireDuration") != null) + time+= (int) spectator.getAttachment("inspireDuration"); + + if (performer.getSkillMod("expertise_en_inspire_buff_duration_increase") != null) { + SkillMod durationMod = performer.getSkillMod("expertise_en_inspire_buff_duration_increase"); + buffCap += durationMod.getBase() + durationMod.getModifier(); + } + + if (time >= buffCap) { + spectator.setAttachment("inspireDuration", buffCap); // incase someone went over cap + spectator.getInspirationTick().cancel(true); + } else { + int entTick = 10; + if (performer.getSkillMod("expertise_en_inspire_pulse_duration_increase") != null) { + SkillMod pulseMod = performer.getSkillMod("expertise_en_inspire_pulse_duration_increase"); + entTick += pulseMod.getBase() + pulseMod.getModifier(); + } + + int duration = (time + entTick); // minutes + int hMinutes = MathUtilities.secondsToHourMinutes(duration * 60); + int hours = MathUtilities.secondsToWholeHours(duration * 60); + + spectator.showFlyText("spam", "buff_duration_tick_observer", String.valueOf(hours) + " hours , " + hMinutes + " minutes ", 0, (float) 0.66, new RGB(255, 182, 193), 3, 78); + + spectator.setAttachment("inspireDuration", duration); + //System.out.println("Inspire Duration: " + spectator.getAttachment("inspireDuration") + " on " + spectator.getCustomName()); + } + } + + }, 10, 10, TimeUnit.SECONDS); + spectator.setInspirationTick(inspirationTick); + } + + public void handleCoverCharge(final CreatureObject actor, final CreatureObject performer) { + final int charge = performer.getCoverCharge(); + + if (charge == 0) + return; + + else { + SUIWindow notification = core.suiService.createMessageBox(InputBoxType.INPUT_BOX_OK, "Cover Charge", performer.getCustomName() + + " has a cover charge of " + performer.getCoverCharge() + ". Do you wish to pay it?", actor, performer, (float) 30); + Vector returnParams = new Vector(); + + returnParams.add("btnOk:Text"); + + notification.addHandler(0, "", Trigger.TRIGGER_OK, returnParams, new SUICallback(){ + + @Override + public void process(SWGObject owner, int eventType, Vector returnList) { + if (eventType == 0) { + if (charge > actor.getCashCredits()) { + actor.sendSystemMessage("You do not have enough credits to cover the charge.", (byte) 0); // TODO: Find the message in the STF files. + return; + } else{ + actor.setCashCredits(actor.getCashCredits() - charge); + actor.sendSystemMessage("You payed the cover charge of " + charge + " to " + performer.getCustomName(), (byte) 0); // TODO: Find the message in the STF files. + performer.setCashCredits(performer.getCashCredits() + charge); + + startSpectating(actor, performer, performer.getPerformanceType()); + + } + } + } + }); + core.suiService.openSUIWindow(notification); + } + } + @Override public void shutdown() { diff --git a/src/services/EquipmentService.java b/src/services/EquipmentService.java index 9f8ce9a5..d9df1dc8 100644 --- a/src/services/EquipmentService.java +++ b/src/services/EquipmentService.java @@ -39,7 +39,7 @@ import resources.objects.player.PlayerObject; public class EquipmentService implements INetworkDispatch { private NGECore core; - + public EquipmentService(NGECore core) { this.core = core; } @@ -51,45 +51,33 @@ public class EquipmentService implements INetworkDispatch { @Override public void shutdown() { - + } - public void weaponCriticalToDisplay(CreatureObject actor, SWGObject item, boolean add) { + private int getWeaponCriticalChance(CreatureObject actor, SWGObject item) { + int weaponCriticalChance = 0; + String weaponCriticalSkillMod = (core.scriptService.getMethod("scripts/equipment/", "weapon_critical", item.getStringAttribute("cat_wpn_damage.wpn_category")/*.replace(" ", "").replace("-", "") + "_" */).__call__().asString()); - if (add == true) { - - switch(item.getStringAttribute("cat_wpn_damage.wpn_category")) { - - case "Rifle": actor.addSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_rifle") * 100); // rifle - case "Carbine": actor.addSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_carbine") * 100); // carbine - case "Pistol": actor.addSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_pistol") * 100); // pistol - case "One-Handed Melee": actor.addSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_1h") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // one-handed - case "Two-Handed Melee": actor.addSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_2h") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // two-handed - case "Unarmed": actor.addSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_unarmed") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // unarmed - case "Polearm": actor.addSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_polearm") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // polearm - case "Free Targeting Heavy Weapon": actor.addSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_heavy") * 100); // Heavy - - - } - - } + if(weaponCriticalSkillMod.contains(" ")) + weaponCriticalSkillMod.replace(" ", ""); - if (add == false) { - - switch(item.getStringAttribute("cat_wpn_damage.wpn_category")) { - - case "Rifle": actor.deductSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_rifle") * 100); // rifle - case "Carbine": actor.deductSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_carbine") * 100); // carbine - case "Pistol": actor.deductSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_pistol") * 100); // pistol - case "One-Handed Melee": actor.deductSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_1h") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // one-handed - case "Two-Handed Melee": actor.deductSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_2h") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // two-handed - case "Unarmed": actor.deductSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_unarmed") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // unarmed - case "Polearm": actor.deductSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_polearm") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // polearm - case "Free Targeting Heavy Weapon": actor.deductSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_heavy") * 100); // Heavy - } - } + if(weaponCriticalSkillMod.contains("-")) + weaponCriticalSkillMod.replace("-", ""); + + if(actor.getSkillMod(weaponCriticalSkillMod) != null) + weaponCriticalChance = actor.getSkillModBase((core.scriptService.getMethod("scripts/equipment/", "weapon_critical", item.getStringAttribute("cat_wpn_damage.wpn_category").replace(" ", "").replace("-", "") + "_" ).__call__().asString())); + + return weaponCriticalChance; } + private void addWeaponCriticalChance(CreatureObject actor, SWGObject item) { + actor.addSkillMod("display_only_critical", getWeaponCriticalChance(actor, item)); + } + + private void deductWeaponCriticalChance(CreatureObject actor, SWGObject item) { + actor.deductSkillMod("display_only_critical", getWeaponCriticalChance(actor, item)); + } + public String getFormalProfessionName(String stfName) { String formalName = ""; @@ -112,9 +100,15 @@ public class EquipmentService implements INetworkDispatch { public boolean canEquip(CreatureObject actor, SWGObject item) { boolean result = true; + if (item.getAttributes().toString().contains("cat_armor")) + if (actor.getLevel() >= 22) + result = true; + else + return false; + if (item.getStringAttribute("class_required") != null) { String profession = ((PlayerObject) actor.getSlottedObject("ghost")).getProfession(); - if (item.getStringAttribute("class_required").contentEquals(getFormalProfessionName(profession))) + if (item.getStringAttribute("class_required").contentEquals(getFormalProfessionName(profession)) || item.getStringAttribute("class_required").contentEquals("None")) result = true; else return false; @@ -126,7 +120,7 @@ public class EquipmentService implements INetworkDispatch { else return false; - if (item.getAttributes().toString().contains("required_combat_level")) + if (item.getAttributes().containsKey("required_combat_level")) if (actor.getLevel() >= item.getIntAttribute("required_combat_level")) result = true; else @@ -135,44 +129,19 @@ public class EquipmentService implements INetworkDispatch { return result; } - public void calculateForceProtection(CreatureObject actor, SWGObject item, boolean add) { - int type = 0; - int level = 0; - int[][] protection = {{1400,3000,4000,5000,6500},{0, 0, 4500, 5600, 6500}}; - - switch ((String) item.getAttachment("type")) { - case "jedi_robe": type = 0; break; - case "jedi_cloak": type = 1; break; - } - - switch (item.getStringAttribute("protection_level")) { - case "Faint": level = 0; break; - case "Weak": level = 1; break; - case "Lucent": level = 2; break; - case "Luminous": level = 3; break; - case "Radiant": level = 4; break; - } - - if (add==true) { - core.skillModService.addSkillMod(actor, "kinetic", protection[type][level]); - core.skillModService.addSkillMod(actor, "energy", protection[type][level]); - core.skillModService.addSkillMod(actor, "heat", protection[type][level]); - core.skillModService.addSkillMod(actor, "cold", protection[type][level]); - core.skillModService.addSkillMod(actor, "acid", protection[type][level]); - core.skillModService.addSkillMod(actor, "electricity", protection[type][level]); - } else { - core.skillModService.deductSkillMod(actor, "kinetic", protection[type][level]); - core.skillModService.deductSkillMod(actor, "energy", protection[type][level]); - core.skillModService.deductSkillMod(actor, "heat", protection[type][level]); - core.skillModService.deductSkillMod(actor, "cold", protection[type][level]); - core.skillModService.deductSkillMod(actor, "acid", protection[type][level]); - core.skillModService.deductSkillMod(actor, "electricity", protection[type][level]); - } - + private void addForceProtection(CreatureObject actor, SWGObject item) { + actor.addSkillMod("expertise_innate_protection_all", getForceProtection(item)); + } + + private void deductForceProtection(CreatureObject actor, SWGObject item) { + actor.deductSkillMod("expertise_innate_protection_all", getForceProtection(item)); + } + + private int getForceProtection(SWGObject item) { + return core.scriptService.getMethod("scripts/equipment/", "force_protection", item.getAttachment("type") + "_" + item.getStringAttribute("protection_level")).__call__().asInt(); } public void equip(CreatureObject actor, SWGObject item) { - String template = ((item.getAttachment("customServerTemplate") == null) ? item.getTemplate() : (item.getTemplate().split("shared_")[0] + "shared_" + ((String) item.getAttachment("customServerTemplate")) + ".iff")); String serverTemplate = template.replace(".iff", ""); PyObject func = core.scriptService.getMethod("scripts/" + serverTemplate.split("shared_" , 2)[0].replace("shared_", ""), serverTemplate.split("shared_" , 2)[1], "equip"); @@ -180,7 +149,7 @@ public class EquipmentService implements INetworkDispatch { func.__call__(Py.java2py(core), Py.java2py(actor), Py.java2py(item)); if (item.getStringAttribute("protection_level") != null) - calculateForceProtection(actor, item, true); + addForceProtection(actor, item); // TODO: faction restrictions - You had to be a Combatant as minimum in order to EQUIP an item. // TODO: Species restrictions @@ -192,8 +161,8 @@ public class EquipmentService implements INetworkDispatch { if(item.getStringAttribute("cat_wpn_damage.wpn_category") != null) if (actor.getSlotNameForObject(item).contentEquals("hold_r") == true) - weaponCriticalToDisplay(actor, item, true); - + addWeaponCriticalChance(actor, item); + Map attributes = new TreeMap(item.getAttributes()); for(Entry e : attributes.entrySet()) { @@ -221,7 +190,6 @@ public class EquipmentService implements INetworkDispatch { public void unequip(CreatureObject actor, SWGObject item) { - String template = ((item.getAttachment("customServerTemplate") == null) ? item.getTemplate() : (item.getTemplate().split("shared_")[0] + "shared_" + ((String) item.getAttachment("customServerTemplate")) + ".iff")); String serverTemplate = template.replace(".iff", ""); PyObject func = core.scriptService.getMethod("scripts/" + serverTemplate.split("shared_" , 2)[0].replace("shared_", ""), serverTemplate.split("shared_" , 2)[1], "unequip"); @@ -229,11 +197,10 @@ public class EquipmentService implements INetworkDispatch { func.__call__(Py.java2py(core), Py.java2py(actor), Py.java2py(item)); if (item.getStringAttribute("protection_level") != null) - calculateForceProtection(actor, item, false); + deductForceProtection(actor, item); if(item.getStringAttribute("cat_wpn_damage.wpn_category") != null) - if (actor.getSlotNameForObject(item).contentEquals("hold_r") == true) - weaponCriticalToDisplay(actor, item, false); + deductWeaponCriticalChance(actor, item); Map attributes = new TreeMap(item.getAttributes()); @@ -241,6 +208,9 @@ public class EquipmentService implements INetworkDispatch { if(e.getKey().startsWith("cat_skill_mod_bonus.@stat_n:")) { core.skillModService.deductSkillMod(actor, e.getKey().replace("cat_skill_mod_bonus.@stat_n:", ""), Integer.parseInt((String) e.getValue())); + } + if(e.getKey().startsWith("cat_stat_mod_bonus.@stat_n:")) { + core.skillModService.deductSkillMod(actor, e.getKey().replace("cat_stat_mod_bonus.@stat_n:", ""), Integer.parseInt((String) e.getValue())); } if(e.getKey().startsWith("cat_attrib_mod_bonus.attr_health")) { actor.setMaxHealth(actor.getMaxHealth() - Integer.parseInt((String) e.getValue())); diff --git a/src/services/PlayerService.java b/src/services/PlayerService.java index 5c3eaf9c..96e1f987 100644 --- a/src/services/PlayerService.java +++ b/src/services/PlayerService.java @@ -41,6 +41,8 @@ import org.apache.mina.core.session.IoSession; import protocol.swg.CharacterSheetResponseMessage; import protocol.swg.ClientIdMsg; import protocol.swg.ClientMfdStatusUpdateMessage; +import protocol.swg.CollectionServerFirstListRequest; +import protocol.swg.CollectionServerFirstListResponse; import protocol.swg.CreateClientPathMessage; import protocol.swg.ExpertiseRequestMessage; import protocol.swg.GuildRequestMessage; @@ -57,6 +59,7 @@ import resources.common.ObjControllerOpcodes; import resources.common.Opcodes; import resources.common.RGB; import resources.common.SpawnPoint; +import resources.common.StringUtilities; import resources.datatables.PlayerFlags; import resources.guild.Guild; import resources.objects.Buff; @@ -391,8 +394,30 @@ public class PlayerService implements INetworkDispatch { swgOpcodes.put(Opcodes.CollectionServerFirstListRequest, new INetworkRemoteEvent() { @Override - public void handlePacket(IoSession session, IoBuffer buffer) throws Exception { + public void handlePacket(IoSession session, IoBuffer data) throws Exception { + data.order(ByteOrder.LITTLE_ENDIAN); + data.position(0); + + Client client = core.getClient(session); + if (client == null) + return; + + SWGObject player = client.getParent(); + + if (player == null) + return; + + CollectionServerFirstListRequest request = new CollectionServerFirstListRequest(); + request.deserialize(data); + + String server = request.getServer(); + System.out.println(server); + if (server == null || server.equals("")) + return; + + CollectionServerFirstListResponse response = new CollectionServerFirstListResponse(server, core.guildService.getGuildObject().getServerFirst()); + session.write(response.serialize()); } }); @@ -691,6 +716,8 @@ public class PlayerService implements INetworkDispatch { try { roadmap = ClientFileManager.loadFile("datatables/roadmap/item_rewards.iff", DatatableVisitor.class); + Vector rewards = new Vector(); + for (int s = 0; s < roadmap.getRowCount(); s++) { if (roadmap.getObject(s, 0) != null) { if (((String) roadmap.getObject(s, 1)).equals(roadmapSkillName)) { @@ -715,11 +742,12 @@ public class PlayerService implements INetworkDispatch { item = (item.substring(0, (item.lastIndexOf("/") + 1)) + "shared_" + item.substring((item.lastIndexOf("/") + 1))); } else { customServerTemplate = item; - item = core.scriptService.callScript("scripts/roadmap/", "roadmap_rewards", "get", item).asString(); + item = core.scriptService.callScript("scripts/roadmap/", player.getProfession(), "getRewards", item).asString(); } if (item != null && item != "") { - creature.getSlottedObject("inventory").add(core.objectService.createObject(item, 0, creature.getPlanet(), new Point3D(0, 0, 0), new Quaternion(1, 0, 0, 0), customServerTemplate)); + SWGObject itemObj = core.objectService.createObject(item, 0, creature.getPlanet(), new Point3D(0, 0, 0), new Quaternion(1, 0, 0, 0), customServerTemplate); + rewards.add(itemObj); } else { //System.out.println("Can't find template: " + item); } @@ -731,6 +759,11 @@ public class PlayerService implements INetworkDispatch { } } } + + if (rewards != null && !rewards.isEmpty()) { + giveItems(creature, rewards); + } + } catch (InstantiationException | IllegalAccessException e) { e.printStackTrace(); } @@ -742,6 +775,9 @@ public class PlayerService implements INetworkDispatch { } catch (InstantiationException | IllegalAccessException e) { e.printStackTrace(); } + + if(player.getProfession().equals("entertainer_1a") && creature.getLevel() == (short) 90 && creature.getEntertainerExperience() != null) + creature.getEntertainerExperience().cancel(true); //} } @@ -785,11 +821,38 @@ public class PlayerService implements INetworkDispatch { } /** - * Gives a player items and shows the "New Items" message. - * @param reciever Player receiving the items - * @param items The object(s) to be given. This will allow multiple arguments. + * Gives a player an item and shows the "New Items" message. + * @param reciever Player receiving the item. + * @param item The object to be given. + * @author Waverunner */ - public void giveItems(CreatureObject reciever, SWGObject... items) { + public void giveItem(CreatureObject reciever, SWGObject item) { + if (reciever == null || item == null) + return; + + if (reciever.getClient() == null) + return; + Client client = reciever.getClient(); + + if (client.getSession() == null) + return; + SWGObject inventory = reciever.getSlottedObject("inventory"); + + if (inventory == null) + return; + + inventory.add(item); + + ObjControllerMessage objController = new ObjControllerMessage(11, new ShowLootBox(reciever.getObjectID(), item)); + client.getSession().write(objController.serialize()); + } + + /** + * Gives a player a variety of items and shows the "New Items" message. + * @param reciever Player receiving the items. + * @param items Vector of the items. + */ + public void giveItems(CreatureObject reciever, Vector items) { if (reciever == null || items == null) return; diff --git a/src/services/SkillService.java b/src/services/SkillService.java index c3926f7b..e1cff8a2 100644 --- a/src/services/SkillService.java +++ b/src/services/SkillService.java @@ -287,15 +287,12 @@ public class SkillService implements INetworkDispatch { public int caluclateExpertisePoints(CreatureObject creature) { int expertisePoints = 0; - try { DatatableVisitor table = ClientFileManager.loadFile("datatables/player/player_level.iff", DatatableVisitor.class); for (int i = 0; i <= creature.getLevel(); i++) expertisePoints += (int) table.getObject(i, 5); } catch (Exception e) { e.printStackTrace(); } - - System.out.println("Player should have " + expertisePoints + " expertise points."); return expertisePoints; } diff --git a/src/services/collections/CollectionService.java b/src/services/collections/CollectionService.java index c74e3993..e31bde4c 100644 --- a/src/services/collections/CollectionService.java +++ b/src/services/collections/CollectionService.java @@ -362,7 +362,7 @@ public class CollectionService implements INetworkDispatch { } if (trackServerFirst) { - if (core.guildService.getGuildObject().addServerFirst(collectionName, new ServerFirst(creature.getCustomName(), System.currentTimeMillis()))) { + if (core.guildService.getGuildObject().addServerFirst(collectionName, new ServerFirst(creature.getCustomName(), creature.getObjectId(), collectionName, System.currentTimeMillis()))) { addCollection(creature, "bdg_server_first_01"); } } diff --git a/src/services/collections/ServerFirst.java b/src/services/collections/ServerFirst.java index 1a955ed2..2b855fb4 100644 --- a/src/services/collections/ServerFirst.java +++ b/src/services/collections/ServerFirst.java @@ -21,6 +21,8 @@ ******************************************************************************/ package services.collections; +import org.apache.mina.core.buffer.IoBuffer; + import resources.objects.Delta; import com.sleepycat.persist.model.Persistent; @@ -29,11 +31,15 @@ import com.sleepycat.persist.model.Persistent; public class ServerFirst extends Delta { private String name; + private String collection; private long time; + private long objectId; - public ServerFirst(String name, long time) { + public ServerFirst(String name, long objectId, String collection, long time) { this.name = name; + this.objectId = objectId; this.time = time; + this.collection = collection; } public ServerFirst() { @@ -48,9 +54,24 @@ public class ServerFirst extends Delta { return time; } + public long getObjectId() { + return objectId; + } + + public String getCollection() { + return collection; + } + @Override public byte[] getBytes() { - return new byte[] { }; + synchronized(objectMutex) { + IoBuffer buffer = createBuffer(18 + collection.length() + (name.length() * 2)); + buffer.putInt((int) time / 1000); + buffer.put(getAsciiString(collection)); + buffer.putLong(objectId); + buffer.put(getUnicodeString(name)); + return buffer.array(); + } } } diff --git a/src/services/combat/CombatService.java b/src/services/combat/CombatService.java index 01f73d43..a69039af 100644 --- a/src/services/combat/CombatService.java +++ b/src/services/combat/CombatService.java @@ -85,7 +85,7 @@ public class CombatService implements INetworkDispatch { } public void doCombat(final CreatureObject attacker, final TangibleObject target, final WeaponObject weapon, final CombatCommand command, final int actionCounter) { - + boolean success = true; if((command.getAttackType() == 0 || command.getAttackType() == 1 || command.getAttackType() == 3) && !attemptCombat(attacker, target)) @@ -441,7 +441,7 @@ public class CombatService implements INetworkDispatch { } else { elementalType = command.getElementalType(); - + } int baseArmor = 0; @@ -460,14 +460,16 @@ public class CombatService implements INetworkDispatch { baseArmor = target.getSkillModBase("acid"); case ElementalType.ELECTRICITY: baseArmor = target.getSkillModBase("electricity"); - } 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); + if(command.getBypassArmor() > 0) + baseArmor *= (100 - command.getBypassArmor()) / 100; + float mitigation = (float) (90 * (1 - Math.exp(-0.000125 * baseArmor))) + baseArmor / 9000; + if(hitType == HitType.STRIKETHROUGH) { float stMaxValue = attacker.getSkillMod("combat_strikethrough_value").getBase() / 2 + attacker.getLuck() / 10; @@ -480,7 +482,7 @@ public class CombatService implements INetworkDispatch { stValue = 1 - stValue; mitigation *= stValue; } - + return mitigation / 100; } @@ -504,10 +506,10 @@ public class CombatService implements INetworkDispatch { if(attacker.getAttachment("AI") instanceof AIActor && target instanceof CreatureObject) { ((AIActor) attacker.getAttachment("AI")).addDefender((CreatureObject) target); } else { - attacker.addDefender(target); + attacker.addDefender(target); // See below comment } - attacker.addDefender(target); + //attacker.addDefender(target); // Why do we need to add target to defender list twice? return true; diff --git a/src/services/command/CombatCommand.java b/src/services/command/CombatCommand.java index 16198a57..2ec3f936 100644 --- a/src/services/command/CombatCommand.java +++ b/src/services/command/CombatCommand.java @@ -151,10 +151,10 @@ public class CombatCommand extends BaseSWGCommand { minDamage = (Integer) visitor.getObject(i, 77); maxDamage = (Integer) visitor.getObject(i, 78); maxRangeOverload = (Float) visitor.getObject(i, 79); - weaponCategory = ((Integer) visitor.getObject(i, 80)).byteValue(); - damageType = ((Integer) visitor.getObject(i, 81)).byteValue(); - elementalType = ((Integer) visitor.getObject(i, 82)).byteValue(); - elementalValue = (Integer) visitor.getObject(i, 83); + weaponCategory = ((Integer) visitor.getObject(i, 81)).byteValue(); + damageType = ((Integer) visitor.getObject(i, 82)).byteValue(); + elementalType = ((Integer) visitor.getObject(i, 83)); + elementalValue = (Integer) visitor.getObject(i, 84); performanceSpam = (String) visitor.getObject(i, 89); hitSpam = ((Integer) visitor.getObject(i, 90)).byteValue(); @@ -381,7 +381,7 @@ public class CombatCommand extends BaseSWGCommand { this.percentFromWeapon = percentFromWeapon; } - public float isBypassArmor() { + public float getBypassArmor() { return bypassArmor; } diff --git a/src/services/sui/SUIService.java b/src/services/sui/SUIService.java index e898c576..8f496dc1 100644 --- a/src/services/sui/SUIService.java +++ b/src/services/sui/SUIService.java @@ -43,13 +43,12 @@ import protocol.swg.SUIForceClosePageMessage; import protocol.swg.SUIUpdatePageMessage; import protocol.swg.objectControllerObjects.ObjectMenuRequest; import protocol.swg.objectControllerObjects.ObjectMenuResponse; - import resources.common.FileUtilities; import resources.common.ObjControllerOpcodes; import resources.common.Opcodes; import resources.common.RadialOptions; import services.sui.SUIWindow.SUICallback; - +import services.sui.SUIWindow.Trigger; import engine.clients.Client; import engine.resources.objects.SWGObject; import engine.resources.service.INetworkDispatch; @@ -334,6 +333,34 @@ public class SUIService implements INetworkDispatch { return window; } + /** + * Creates an Input Box SUIWindow and adds a handler that will return text inputed into text box with the callback as the specified PyObject. + * @param PyObject Definition that will be run when user clicks on "OK" + * @return SUIWindow + * @author Waverunner + */ + public SUIWindow createInputBox(int type, String title, String promptText, SWGObject owner, SWGObject rangeObject, float maxDistance, PyObject handleFunc) { + SUIWindow window = createInputBox(type, title, promptText, owner, rangeObject, maxDistance); + Vector returnParams = new Vector(); + returnParams.add("txtInput:LocalText"); + window.addHandler(0, "", Trigger.TRIGGER_OK, returnParams, handleFunc); + return window; + } + + /** + * Creates an Input Box SUIWindow and adds a handler that will return text inputed into text box with the callback as the specified PyObject. + * @param SUICallback Callback that will be ran when user clicks on "OK" + * @return SUIWindow + * @author Waverunner + */ + public SUIWindow createInputBox(int type, String title, String promptText, SWGObject owner, SWGObject rangeObject, float maxDistance, SUICallback handleFunc) { + SUIWindow window = createInputBox(type, title, promptText, owner, rangeObject, maxDistance); + Vector returnParams = new Vector(); + returnParams.add("txtInput:LocalText"); + window.addHandler(0, "", Trigger.TRIGGER_OK, returnParams, handleFunc); + return window; + } + public void closeSUIWindow(SWGObject owner, int id) { if(owner.getClient() == null || owner.getClient().getSession() == null) diff --git a/src/services/travel/TravelService.java b/src/services/travel/TravelService.java index 6eeb3bb5..c81be385 100644 --- a/src/services/travel/TravelService.java +++ b/src/services/travel/TravelService.java @@ -323,7 +323,7 @@ public class TravelService implements INetworkDispatch { public void doTransport(SWGObject actor, TravelPoint tp) { Planet planet = core.terrainService.getPlanetByName(tp.getPlanetName()); - Point3D spawnLocation = SpawnPoint.getRandomPosition(tp.getShuttle().getPosition(), 10, 50, actor.getPlanetId()); + Point3D spawnLocation = SpawnPoint.getRandomPosition(tp.getShuttle().getPosition(), 5, 20, actor.getPlanetId()); core.simulationService.transferToPlanet(actor, planet, spawnLocation, new Quaternion(0, 0, 0, 0), null); }