diff --git a/scripts/buffs/set_bonus_medic_dps_1.py b/scripts/buffs/set_bonus_medic_dps_1.py new file mode 100644 index 00000000..178d4c76 --- /dev/null +++ b/scripts/buffs/set_bonus_medic_dps_1.py @@ -0,0 +1,16 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_action_line_me_dm', 5) + core.skillModService.addSkillMod(actor, 'expertise_action_line_me_burst', 5) + core.skillModService.addSkillMod(actor, 'expertise_action_line_me_smash', 5) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_action_line_me_dm', 5) + core.skillModService.deductSkillMod(actor, 'expertise_action_line_me_burst', 5) + core.skillModService.deductSkillMod(actor, 'expertise_action_line_me_smash', 5) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_medic_dps_2.py b/scripts/buffs/set_bonus_medic_dps_2.py new file mode 100644 index 00000000..36833f96 --- /dev/null +++ b/scripts/buffs/set_bonus_medic_dps_2.py @@ -0,0 +1,20 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_action_line_me_dm', 10) + core.skillModService.addSkillMod(actor, 'expertise_action_line_me_burst', 10) + core.skillModService.addSkillMod(actor, 'expertise_action_line_me_smash', 10) + core.skillModService.addSkillMod(actor, 'fast_attack_line_me_dm', 5) + core.skillModService.addSkillMod(actor, 'expertise_buff_duration_line_me_enhance', 900) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_action_line_me_dm', 10) + core.skillModService.deductSkillMod(actor, 'expertise_action_line_me_burst', 10) + core.skillModService.deductSkillMod(actor, 'expertise_action_line_me_smash', 10) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_me_dm', 5) + core.skillModService.deductSkillMod(actor, 'expertise_buff_duration_line_me_enhance', 900) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_medic_dps_3.py b/scripts/buffs/set_bonus_medic_dps_3.py new file mode 100644 index 00000000..f9082b73 --- /dev/null +++ b/scripts/buffs/set_bonus_medic_dps_3.py @@ -0,0 +1,20 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_action_line_me_dm', 15) + core.skillModService.addSkillMod(actor, 'expertise_action_line_me_burst', 20) + core.skillModService.addSkillMod(actor, 'expertise_action_line_me_smash', 20) + core.skillModService.addSkillMod(actor, 'fast_attack_line_me_dm', 15) + core.skillModService.addSkillMod(actor, 'expertise_buff_duration_line_me_enhance', 1800) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_action_line_me_dm', 15) + core.skillModService.deductSkillMod(actor, 'expertise_action_line_me_burst', 20) + core.skillModService.deductSkillMod(actor, 'expertise_action_line_me_smash', 20) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_me_dm', 15) + core.skillModService.deductSkillMod(actor, 'expertise_buff_duration_line_me_enhance', 1800) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_medic_utility_a_1.py b/scripts/buffs/set_bonus_medic_utility_a_1.py new file mode 100644 index 00000000..a04d1d33 --- /dev/null +++ b/scripts/buffs/set_bonus_medic_utility_a_1.py @@ -0,0 +1,16 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_freeshot_me_heal', 5) + core.skillModService.addSkillMod(actor, 'fast_attack_line_me_revive', 5) + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_me_evasion', 10) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_freeshot_me_heal', 5) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_me_revive', 5) + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_me_evasion', 10) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_medic_utility_a_2.py b/scripts/buffs/set_bonus_medic_utility_a_2.py new file mode 100644 index 00000000..3fd9f063 --- /dev/null +++ b/scripts/buffs/set_bonus_medic_utility_a_2.py @@ -0,0 +1,18 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'fast_attack_line_me_heal', 5) + core.skillModService.addSkillMod(actor, 'expertise_freeshot_me_heal', 10) + core.skillModService.addSkillMod(actor, 'fast_attack_line_me_revive', 10) + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_me_evasion', 20) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'fast_attack_line_me_heal', 5) + core.skillModService.deductSkillMod(actor, 'expertise_freeshot_me_heal', 10) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_me_revive', 10) + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_me_evasion', 20) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_medic_utility_a_3.py b/scripts/buffs/set_bonus_medic_utility_a_3.py new file mode 100644 index 00000000..11bad3ba --- /dev/null +++ b/scripts/buffs/set_bonus_medic_utility_a_3.py @@ -0,0 +1,20 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'fast_attack_line_me_heal', 10) + core.skillModService.addSkillMod(actor, 'expertise_freeshot_me_heal', 15) + core.skillModService.addSkillMod(actor, 'fast_attack_line_me_revive', 15) + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_me_evasion', 30) + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_me_stasis_self', 2) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'fast_attack_line_me_heal', 10) + core.skillModService.deductSkillMod(actor, 'expertise_freeshot_me_heal', 15) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_me_revive', 15) + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_me_evasion', 30) + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_me_stasis_self', 2) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_medic_utility_b_1.py b/scripts/buffs/set_bonus_medic_utility_b_1.py new file mode 100644 index 00000000..1ec0be40 --- /dev/null +++ b/scripts/buffs/set_bonus_medic_utility_b_1.py @@ -0,0 +1,16 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_me_dot', 10) + core.skillModService.addSkillMod(actor, 'expertise_buff_duration_line_me_debuff', 1) + core.skillModService.addSkillMod(actor, 'fast_attack_line_me_debuff', 5) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_me_dot', 10) + core.skillModService.deductSkillMod(actor, 'expertise_buff_duration_line_me_debuff', 1) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_me_debuff', 5) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_medic_utility_b_2.py b/scripts/buffs/set_bonus_medic_utility_b_2.py new file mode 100644 index 00000000..b6d95b63 --- /dev/null +++ b/scripts/buffs/set_bonus_medic_utility_b_2.py @@ -0,0 +1,18 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_me_dot', 20) + core.skillModService.addSkillMod(actor, 'expertise_buff_duration_line_me_debuff', 3) + core.skillModService.addSkillMod(actor, 'fast_attack_line_me_debuff', 10) + core.skillModService.addSkillMod(actor, 'expertise_freeshot_me_debuff', 10) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_me_dot', 20) + core.skillModService.deductSkillMod(actor, 'expertise_buff_duration_line_me_debuff', 3) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_me_debuff', 10) + core.skillModService.deductSkillMod(actor, 'expertise_freeshot_me_debuff', 10) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_medic_utility_b_3.py b/scripts/buffs/set_bonus_medic_utility_b_3.py new file mode 100644 index 00000000..4a5af114 --- /dev/null +++ b/scripts/buffs/set_bonus_medic_utility_b_3.py @@ -0,0 +1,20 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_me_dot', 30) + core.skillModService.addSkillMod(actor, 'expertise_buff_duration_line_me_debuff', 5) + core.skillModService.addSkillMod(actor, 'fast_attack_line_me_debuff', 15) + core.skillModService.addSkillMod(actor, 'expertise_freeshot_me_debuff', 15) + core.skillModService.addSkillMod(actor, 'me_doom_chance', 20) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_me_dot', 30) + core.skillModService.deductSkillMod(actor, 'expertise_buff_duration_line_me_debuff', 5) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_me_debuff', 15) + core.skillModService.deductSkillMod(actor, 'expertise_freeshot_me_debuff', 15) + core.skillModService.deductSkillMod(actor, 'me_doom_chance', 20) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_spy_dps_1.py b/scripts/buffs/set_bonus_spy_dps_1.py new file mode 100644 index 00000000..a375544a --- /dev/null +++ b/scripts/buffs/set_bonus_spy_dps_1.py @@ -0,0 +1,14 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_action_line_sp_dm', 10) + core.skillModService.addSkillMod(actor, 'fast_attack_line_sp_dm', 5) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_action_line_sp_dm', 10) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_sp_dm', 5) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_spy_dps_2.py b/scripts/buffs/set_bonus_spy_dps_2.py new file mode 100644 index 00000000..25132b6d --- /dev/null +++ b/scripts/buffs/set_bonus_spy_dps_2.py @@ -0,0 +1,16 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_action_line_sp_dm', 15) + core.skillModService.addSkillMod(actor, 'fast_attack_line_sp_dm', 10) + core.skillModService.addSkillMod(actor, 'expertise_action_line_sp_dot', 15) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_action_line_sp_dm', 15) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_sp_dm', 10) + core.skillModService.deductSkillMod(actor, 'expertise_action_line_sp_dot', 15) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_spy_dps_3.py b/scripts/buffs/set_bonus_spy_dps_3.py new file mode 100644 index 00000000..9fdedc7e --- /dev/null +++ b/scripts/buffs/set_bonus_spy_dps_3.py @@ -0,0 +1,20 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_action_line_sp_dm', 20) + core.skillModService.addSkillMod(actor, 'fast_attack_line_sp_dm', 15) + core.skillModService.addSkillMod(actor, 'expertise_freeshot_sp_dm', 20) + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_sp_dm', 20) + core.skillModService.addSkillMod(actor, 'expertise_action_line_sp_dot', 25) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_action_line_sp_dm', 20) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_sp_dm', 15) + core.skillModService.deductSkillMod(actor, 'expertise_freeshot_sp_dm', 20) + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_sp_dm', 20) + core.skillModService.deductSkillMod(actor, 'expertise_action_line_sp_dot', 25) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_spy_utility_a_1.py b/scripts/buffs/set_bonus_spy_utility_a_1.py new file mode 100644 index 00000000..dab7ff64 --- /dev/null +++ b/scripts/buffs/set_bonus_spy_utility_a_1.py @@ -0,0 +1,14 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_sp_preparation', 20) + core.skillModService.addSkillMod(actor, 'fast_attack_line_sp_smoke', 5) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_sp_preparation', 20) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_sp_smoke', 5) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_spy_utility_a_2.py b/scripts/buffs/set_bonus_spy_utility_a_2.py new file mode 100644 index 00000000..a1892f96 --- /dev/null +++ b/scripts/buffs/set_bonus_spy_utility_a_2.py @@ -0,0 +1,16 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_sp_preparation', 40) + core.skillModService.addSkillMod(actor, 'expertise_buff_duration_line_sp_preparation', 5) + core.skillModService.addSkillMod(actor, 'fast_attack_line_sp_smoke', 15) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_sp_preparation', 40) + core.skillModService.deductSkillMod(actor, 'expertise_buff_duration_line_sp_preparation', 5) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_sp_smoke', 15) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_spy_utility_a_3.py b/scripts/buffs/set_bonus_spy_utility_a_3.py new file mode 100644 index 00000000..22e3a920 --- /dev/null +++ b/scripts/buffs/set_bonus_spy_utility_a_3.py @@ -0,0 +1,18 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_cooldown_line_sp_preparation', 60) + core.skillModService.addSkillMod(actor, 'expertise_buff_duration_line_sp_preparation', 10) + core.skillModService.addSkillMod(actor, 'fast_attack_line_sp_smoke', 20) + core.skillModService.addSkillMod(actor, 'fast_attack_line_sp_perfect', 15) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_cooldown_line_sp_preparation', 60) + core.skillModService.deductSkillMod(actor, 'expertise_buff_duration_line_sp_preparation', 10) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_sp_smoke', 20) + core.skillModService.deductSkillMod(actor, 'fast_attack_line_sp_perfect', 15) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_spy_utility_b_1.py b/scripts/buffs/set_bonus_spy_utility_b_1.py new file mode 100644 index 00000000..74851b44 --- /dev/null +++ b/scripts/buffs/set_bonus_spy_utility_b_1.py @@ -0,0 +1,14 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_strikethrough_chance', 1) + core.skillModService.addSkillMod(actor, 'expertise_action_all', 5) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_strikethrough_chance', 1) + core.skillModService.deductSkillMod(actor, 'expertise_action_all', 5) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_spy_utility_b_2.py b/scripts/buffs/set_bonus_spy_utility_b_2.py new file mode 100644 index 00000000..c2f90380 --- /dev/null +++ b/scripts/buffs/set_bonus_spy_utility_b_2.py @@ -0,0 +1,14 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_strikethrough_chance', 2) + core.skillModService.addSkillMod(actor, 'expertise_action_all', 10) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_strikethrough_chance', 2) + core.skillModService.deductSkillMod(actor, 'expertise_action_all', 10) + return \ No newline at end of file diff --git a/scripts/buffs/set_bonus_spy_utility_b_3.py b/scripts/buffs/set_bonus_spy_utility_b_3.py new file mode 100644 index 00000000..41d58c47 --- /dev/null +++ b/scripts/buffs/set_bonus_spy_utility_b_3.py @@ -0,0 +1,20 @@ +import sys + +def setup(core, actor, buff): + return + +def add(core, actor, buff): + core.skillModService.addSkillMod(actor, 'expertise_strikethrough_chance', 3) + core.skillModService.addSkillMod(actor, 'expertise_action_all', 15) + core.skillModService.addSkillMod(actor, 'expertise_avoidance_overpower', 5) + core.skillModService.addSkillMod(actor, 'movement_resist_snare', 100) + core.skillModService.addSkillMod(actor, 'movement_resist_root', 100) + return + +def remove(core, actor, buff): + core.skillModService.deductSkillMod(actor, 'expertise_strikethrough_chance', 3) + core.skillModService.deductSkillMod(actor, 'expertise_action_all', 15) + core.skillModService.deductSkillMod(actor, 'expertise_avoidance_overpower', 5) + core.skillModService.deductSkillMod(actor, 'movement_resist_snare', 100) + core.skillModService.deductSkillMod(actor, 'movement_resist_root', 100) + return \ No newline at end of file diff --git a/scripts/commands/startdance.py b/scripts/commands/startdance.py index 13aba090..ce557827 100644 --- a/scripts/commands/startdance.py +++ b/scripts/commands/startdance.py @@ -46,7 +46,7 @@ def handleStartdance(core, owner, eventType, returnList): if not item: return - + #if eventType == 0: startDance(coreObject, actorObject, '', int(item.getObjectId())) return @@ -90,7 +90,7 @@ def startDance(core, actor, danceName, visual): if not actor.getPerformanceWatchee(): #this also notifies the client with a delta4 actor.setPerformanceWatchee(actor) - actor.addAudience(actor) + actor.addSpectator(actor) #this should send a CREO3 actor.setPosture(0x09); diff --git a/scripts/commands/stopdance.py b/scripts/commands/stopdance.py index e403a179..1427496b 100644 --- a/scripts/commands/stopdance.py +++ b/scripts/commands/stopdance.py @@ -11,10 +11,5 @@ def run(core, actor, target, commandString): actor.sendSystemMessage('@performance:dance_not_performing', 0) return - #since we need to stop performance for any posture change, - # all packets are triggered in setPosture. - # this may not be very consistent, but it prevents - # duplicate code. actor.stopPerformance() - return diff --git a/scripts/commands/stopwatching.py b/scripts/commands/stopwatching.py index 23a36c17..555ee4ab 100644 --- a/scripts/commands/stopwatching.py +++ b/scripts/commands/stopwatching.py @@ -10,7 +10,7 @@ def run(core, actor, target, commandString): if performer is None: return - performer.removeAudience(actor) + performer.removeSpectator(actor) actor.setPerformanceWatchee(None) if not actor.getPerformanceListenee(): actor.setMoodAnimation('') diff --git a/scripts/equipment/bonus_sets/set_bonus_jedi_robe.py b/scripts/equipment/bonus_sets/set_bonus_jedi_robe.py new file mode 100644 index 00000000..1a81f12a --- /dev/null +++ b/scripts/equipment/bonus_sets/set_bonus_jedi_robe.py @@ -0,0 +1,39 @@ +import sys +from services.equipment import BonusSetTemplate +from java.util import Vector + +def addBonusSet(core): + bonusSet = BonusSetTemplate("set_bonus_jedi_robe") + + # Waistpack + bonusSet.addRequiredTemplate("object/tangible/wearables/backpack/shared_fannypack_s01.iff") + + # Jedi Robes - Light + bonusSet.addRequiredTemplate("object/tangible/wearables/robe/shared_robe_jedi_light_s01.iff") + bonusSet.addRequiredTemplate("object/tangible/wearables/robe/shared_robe_jedi_light_s02.iff") + bonusSet.addRequiredTemplate("object/tangible/wearables/robe/shared_robe_jedi_light_s03.iff") + bonusSet.addRequiredTemplate("object/tangible/wearables/robe/shared_robe_jedi_light_s04.iff") + bonusSet.addRequiredTemplate("object/tangible/wearables/robe/shared_robe_jedi_light_s05.iff") + + # Jedi Robes - Dark + bonusSet.addRequiredTemplate("object/tangible/wearables/robe/shared_robe_jedi_dark_s01.iff") + bonusSet.addRequiredTemplate("object/tangible/wearables/robe/shared_robe_jedi_dark_s02.iff") + bonusSet.addRequiredTemplate("object/tangible/wearables/robe/shared_robe_jedi_dark_s03.iff") + bonusSet.addRequiredTemplate("object/tangible/wearables/robe/shared_robe_jedi_dark_s04.iff") + bonusSet.addRequiredTemplate("object/tangible/wearables/robe/shared_robe_jedi_dark_s05.iff") + + # Jedi Cloaks + bonusSet.addRequiredTemplate("object/tangible/wearables/robe/shared_robe_s32.iff") + bonusSet.addRequiredTemplate("object/tangible/wearables/robe/shared_robe_s32_h1.iff") + bonusSet.addRequiredTemplate("object/tangible/wearables/robe/shared_robe_s33.iff") + bonusSet.addRequiredTemplate("object/tangible/wearables/robe/shared_robe_s33_h1.iff") + + core.equipmentService.addBonusSetTemplate(bonusSet) + +def handleChange(core, creature, set): + wornItems = set.getWornTemplateCount(creature) + + if wornItems == 2: + core.buffService.addBuffToCreature(creature, "set_bonus_jedi_robe_1", creature) + else: + core.buffService.removeBuffFromCreatureByName(creature, "set_bonus_jedi_robe_1") \ No newline at end of file diff --git a/scripts/object/tangible/wearables/backpack/fannypack_s01.py b/scripts/object/tangible/wearables/backpack/fannypack_s01.py index ccad8904..b0e3e3ee 100644 --- a/scripts/object/tangible/wearables/backpack/fannypack_s01.py +++ b/scripts/object/tangible/wearables/backpack/fannypack_s01.py @@ -1,4 +1,16 @@ import sys def setup(core, object): + object.setStfFilename('static_item_n') + object.setStfName('item_fannypack_04_01') + object.setDetailFilename('static_item_d') + object.setDetailName('item_fannypack_04_01') + + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:constitution_modified', 50) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:luck_modified', 50) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:precision_modified', 50) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:strength_modified', 50) + + object.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_jedi_robe_1') + object.setAttachment('setBonus', 'set_bonus_jedi_robe') return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/robe/robe_jedi_light_s03.py b/scripts/object/tangible/wearables/robe/robe_jedi_light_s03.py index ba7c4c85..904d0be2 100644 --- a/scripts/object/tangible/wearables/robe/robe_jedi_light_s03.py +++ b/scripts/object/tangible/wearables/robe/robe_jedi_light_s03.py @@ -2,15 +2,20 @@ import sys def setup(core, object): object.setStfFilename('static_item_n') - object.setStfName('item_jedi_robe_light_04_04') + object.setStfName('item_jedi_robe_light_03_03') object.setDetailFilename('static_item_d') - object.setDetailName('item_jedi_robe_light_04_04') - object.setIntAttribute('cat_stat_mod_bonus.@stat_n:constitution_modified', 185) - object.setIntAttribute('cat_stat_mod_bonus.@stat_n:strength_modified', 185) - object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 185) + object.setDetailName('item_jedi_robe_light_03_03') + object.setStringAttribute('protection_level', 'Luminous') object.setStringAttribute('class_required', 'Jedi') object.setIntAttribute('required_combat_level', 80) - object.setAttachment('type', 'jedi_robe') + + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:constitution_modified', 185) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:strength_modified', 185) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 185) + object.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_jedi_robe_1') + + object.setAttachment('type', 'jedi_robe') + object.setAttachment('setBonus', 'set_bonus_jedi_robe') return diff --git a/scripts/object/tangible/wearables/robe/robe_jedi_light_s04.py b/scripts/object/tangible/wearables/robe/robe_jedi_light_s04.py index 07760bd3..cbbd49cd 100644 --- a/scripts/object/tangible/wearables/robe/robe_jedi_light_s04.py +++ b/scripts/object/tangible/wearables/robe/robe_jedi_light_s04.py @@ -5,15 +5,22 @@ def setup(core, object): object.setStfName('item_jedi_robe_light_04_04') object.setDetailFilename('static_item_d') object.setDetailName('item_jedi_robe_light_04_04') - object.setIntAttribute('cat_stat_mod_bonus.@stat_n:constitution_modified', 250) - object.setIntAttribute('cat_stat_mod_bonus.@stat_n:strength_modified', 250) - object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 250) + object.setStringAttribute('protection_level', 'Radiant') object.setStringAttribute('class_required', 'Jedi') object.setIntAttribute('required_combat_level', 90) - object.setAttachment('type', 'jedi_robe') + + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:constitution_modified', 250) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:strength_modified', 250) + object.setIntAttribute('cat_stat_mod_bonus.@stat_n:agility_modified', 250) + + object.setStringAttribute('proc_name', '@ui_buff:proc_old_light_jedi_gift') object.setStringAttribute('@set_bonus:piece_bonus_count_2', '@set_bonus:set_bonus_jedi_robe_1') + + object.setAttachment('type', 'jedi_robe') + object.setAttachment('setBonus', 'set_bonus_jedi_robe') + return \ No newline at end of file diff --git a/scripts/radial/player.py b/scripts/radial/player.py index 6ad15a17..08fa50e0 100644 --- a/scripts/radial/player.py +++ b/scripts/radial/player.py @@ -7,7 +7,7 @@ def createRadial(core, owner, target, radials): 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) + elif owner.getPerformanceListenee() == target: radials.add(RadialOptions(0, 141, 3, 'Stop Listening')) else: if target.getPerformanceType() is True: @@ -27,6 +27,6 @@ def handleSelection(core, owner, target, option): return if option == 141: - #core.commandService.callCommand(owner, 'stopwatching', target, '') #SWGList error for remove audience in CreatureObject + core.commandService.callCommand(owner, 'stopwatching', target, '') return return \ No newline at end of file diff --git a/scripts/skillMods/actionPercent.py b/scripts/skillMods/actionPercent.py index 97166ab2..aaae3c10 100644 --- a/scripts/skillMods/actionPercent.py +++ b/scripts/skillMods/actionPercent.py @@ -1,12 +1,14 @@ import sys +# Temporarily disabled until the skillmod calculation system is refactored + def add(core, actor, name, base): - actor.addSkillMod(name, base) - actor.setMaxAction(actor.getMaxAction() + int((float(actor.getMaxAction()) * (float(base) / float(100))))) + #actor.addSkillMod(name, base) + #actor.setMaxAction(actor.getMaxAction() + int((float(actor.getMaxAction()) * (float(base) / float(100))))) return def deduct(core, actor, name, base): - actor.deductSkillMod(name, base) - actor.setMaxAction(actor.getMaxAction() - int((float(actor.getMaxAction()) * (float(base) / float(100))))) + #actor.deductSkillMod(name, base) + #actor.setMaxAction(actor.getMaxAction() - int((float(actor.getMaxAction()) * (float(base) / float(100))))) return \ No newline at end of file diff --git a/scripts/skillMods/healthPercent.py b/scripts/skillMods/healthPercent.py index ed9b3e37..de8a3424 100644 --- a/scripts/skillMods/healthPercent.py +++ b/scripts/skillMods/healthPercent.py @@ -1,12 +1,14 @@ import sys +# Temporarily disabled until the skillmod calculation system is refactored + def add(core, actor, name, base): - actor.addSkillMod(name, base) - actor.setMaxHealth(actor.getMaxHealth() + int((float(actor.getMaxHealth()) * (float(base) / float(100))))) + #actor.addSkillMod(name, base) + #actor.setMaxHealth(actor.getMaxHealth() + int((float(actor.getMaxHealth()) * (float(base) / float(100))))) return def deduct(core, actor, name, base): - actor.deductSkillMod(name, base) - actor.setMaxHealth(actor.getMaxHealth() - int((actor.getMaxHealth() * (float(base) / float(100))))) + #actor.deductSkillMod(name, base) + #actor.setMaxHealth(actor.getMaxHealth() - int((actor.getMaxHealth() * (float(base) / float(100))))) return \ No newline at end of file diff --git a/src/main/NGECore.java b/src/main/NGECore.java index 88977fe3..9b9d392e 100644 --- a/src/main/NGECore.java +++ b/src/main/NGECore.java @@ -420,6 +420,8 @@ public class NGECore { spawnService.loadLairGroups(); spawnService.loadSpawnAreas(); + equipmentService.loadBonusSets(); + retroService.run(); didServerCrash = false; diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index b7478f6a..5a26a8bf 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -25,6 +25,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; +import java.util.Vector; import java.util.concurrent.ScheduledFuture; import org.apache.mina.core.buffer.IoBuffer; @@ -44,7 +45,6 @@ import com.sleepycat.persist.model.Entity; import com.sleepycat.persist.model.NotPersistent; import main.NGECore; - import engine.clients.Client; import resources.objects.Buff; import resources.objects.DamageOverTime; @@ -127,7 +127,7 @@ public class CreatureObject extends TangibleObject implements IPersistent { private CreatureObject performanceWatchee; private CreatureObject performanceListenee; @NotPersistent - private SWGList performanceAudience = new SWGList(); + private Vector performanceAudience = new Vector(); private int health = 1000; private int action = 300; @NotPersistent @@ -431,8 +431,6 @@ public class CreatureObject extends TangibleObject implements IPersistent { else { next.sendSystemMessage("You stop listening to " + getCustomName() + ".",(byte)0); } next.getSpectatorTask().cancel(true); } - //not sure if this behaviour is correct. might need fixing later. - performanceAudience = new SWGList(); } } public ScheduledFuture getEntertainerExperience() { @@ -1507,23 +1505,20 @@ public class CreatureObject extends TangibleObject implements IPersistent { } } - public void addAudience(CreatureObject audienceMember) { + public void addSpectator(CreatureObject audienceMember) { synchronized(objectMutex) { - if (performanceAudience == null) { - performanceAudience = new SWGList(); - } performanceAudience.add(audienceMember); } } - public void removeAudience(CreatureObject audienceMember) { + public void removeSpectator(CreatureObject audienceMember) { synchronized(objectMutex) { if (performanceAudience == null) { return; } if (audienceMember.getInspirationTick() != null) audienceMember.getInspirationTick().cancel(true); if(performanceAudience.contains(audienceMember)) - performanceAudience.remove(audienceMember); // SWGList error + performanceAudience.remove(audienceMember); } } diff --git a/src/services/CharacterService.java b/src/services/CharacterService.java index bb6c3015..7c17ac3c 100644 --- a/src/services/CharacterService.java +++ b/src/services/CharacterService.java @@ -317,6 +317,9 @@ public class CharacterService implements INetworkDispatch { Console.println("Added empty mission " + missionsAdded); }*/ + object.addAbility("startDance"); + object.addAbility("startDance+Basic"); + object.addObjectToEquipList(datapad); object.addObjectToEquipList(inventory); object.addObjectToEquipList(bank); diff --git a/src/services/ConnectionService.java b/src/services/ConnectionService.java index 913e6c79..1ca12d05 100644 --- a/src/services/ConnectionService.java +++ b/src/services/ConnectionService.java @@ -200,17 +200,17 @@ public class ConnectionService implements INetworkDispatch { if(object.getAttachment("inspireDuration") != null) object.setAttachment("inspireDuration", null); - if(object.getInspirationTick() != null) { - object.getInspirationTick().cancel(true); - object.setInspirationTick(null); + if(object.getPerformanceListenee() != null) { + object.getPerformanceListenee().removeSpectator(object); + object.setPerformanceListenee(null); } - if(object.getSpectatorTask() != null) { - object.getSpectatorTask().cancel(true); - object.setSpectatorTask(null); + if(object.getPerformanceWatchee() != null) { + object.getPerformanceWatchee().removeSpectator(object); + object.setPerformanceWatchee(null); } - core.groupService.handleGroupDisband(object); + core.groupService.handleGroupDisband(object, false); if (core.instanceService.isInInstance(object)) { core.instanceService.remove(core.instanceService.getActiveInstance(object), object); diff --git a/src/services/DevService.java b/src/services/DevService.java index c058b7df..102e6155 100644 --- a/src/services/DevService.java +++ b/src/services/DevService.java @@ -1,328 +1,909 @@ -/******************************************************************************* - * 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"); - suiOptions.put((long) 12, "Reset expertise"); - 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"); - suiOptions.put((long) 24, "Misc Items"); - break; - case 3: // [Items] Weapons - suiOptions.put((long) 30, "Jedi Weapons"); - suiOptions.put((long) 31, "Melee Weapons"); - suiOptions.put((long) 32, "Ranged Weapons"); - break; - case 4: // [Items] Misc Items - suiOptions.put((long) 40, "Unity Ring"); - suiOptions.put((long) 41, "Tusken rucksack"); - 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.grantLevel(player, 90); // Commented out until fixed - //core.playerService.giveExperience(player, 999999999); - return; - case 11: // Give 100,000 credits - player.setCashCredits(player.getCashCredits() + 100000); - return; - case 12: // Reset expertise - // Seefo->Light: I commented out the below line because it gave us an error and didn't properly remove the skill, could you try the method SWGList.reverseGet that I added? - //player.getSkills().get().stream().filter(s -> s.contains("expertise")).forEach(s -> core.skillService.removeSkill(creature, s)); - - // Using this for now - for(int i = creature.getSkills().size() - 1; i >= 0; i-- ) - { - String skill = creature.getSkills().get(i); - if(skill.contains("expertise")) core.skillService.removeSkill(player, skill); - } - 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; - - case 24: // Misc Items - sendCharacterBuilderSUI(player, 4); - return; - // [Items] Weapons - case 30: // Jedi Weapons - TangibleObject lightsaber1 = (TangibleObject) 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"); - - TangibleObject lightsaber2 = (TangibleObject) 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"); - - TangibleObject lightsaber3 = (TangibleObject) 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"); - - Random random = new Random(); - - lightsaber1.setCustomizationVariable("/private/index_color_blade", (byte) random.nextInt(47)); - lightsaber2.setCustomizationVariable("/private/index_color_blade", (byte) random.nextInt(47)); - lightsaber3.setCustomizationVariable("/private/index_color_blade", (byte) random.nextInt(47)); - - 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", (float) 0.8); - 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); - - SWGObject pistol = core.objectService.createObject("object/weapon/ranged/pistol/shared_pistol_cdef.iff", planet); - pistol.setIntAttribute("required_combat_level", 90); - pistol.setFloatAttribute("cat_wpn_damage.wpn_attack_speed", (float) 0.4); - pistol.setStringAttribute("class_required", "None"); - pistol.setStringAttribute("cat_wpn_damage.wpn_damage_type", "Energy"); - pistol.setStringAttribute("cat_wpn_damage.damage", "400-559"); - - inventory.add(pistol); - return; - case 40: - TangibleObject ring = (TangibleObject) core.objectService.createObject("object/tangible/wearables/ring/shared_ring_s01.iff", planet); - ring.setCustomName("Unity Ring"); - inventory.add(ring); - case 41: - TangibleObject backpack = (TangibleObject) core.objectService.createObject("object/tangible/wearables/backpack/shared_backpack_krayt_skull.iff", planet); - backpack.setIntAttribute("cat_stat_mod_bonus.@stat_n:agility_modified", 25); - backpack.setIntAttribute("cat_stat_mod_bonus.@stat_n:constitution_modified", 30); - backpack.setIntAttribute("cat_stat_mod_bonus.@stat_n:luck_modified", 25); - backpack.setIntAttribute("cat_stat_mod_bonus.@stat_n:precision_modified", 35); - backpack.setIntAttribute("cat_stat_mod_bonus.@stat_n:stamina_modified", 30); - backpack.setIntAttribute("cat_stat_mod_bonus.@stat_n:strength_modified", 35); - - inventory.add(backpack); - return; - } - } - }); - - core.suiService.openSUIWindow(window); - } - - @Override - public void insertOpcodes(Map swgOpcodes, Map objControllerOpcodes) { - } - - - @Override - public void shutdown() { - - } - -} +/******************************************************************************* + * 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"); + suiOptions.put((long) 12, "Reset expertise"); + break; + case 2: // Items + suiOptions.put((long) 20, "(Light) Jedi Robe"); + suiOptions.put((long) 21, "(Dark) Jedi Robe"); + suiOptions.put((long) 22, "Armor"); + suiOptions.put((long) 23, "Weapons"); + suiOptions.put((long) 24, "Misc Items"); + break; + case 3: // [Items] Weapons + suiOptions.put((long) 30, "Jedi Weapons"); + suiOptions.put((long) 31, "Melee Weapons"); + suiOptions.put((long) 32, "Ranged Weapons"); + break; + case 4: // [Items] Misc Items + suiOptions.put((long) 40, "Unity Ring"); + suiOptions.put((long) 41, "Tusken rucksack"); + break; + case 5: // [Items] Armor + suiOptions.put((long) 50, "Assault Armor"); + suiOptions.put((long) 51, "Battle Armor"); + suiOptions.put((long) 52, "Reconnaissance Armor"); + break; + case 6: // [Items] Assault Armor + suiOptions.put((long) 60, "Composite"); + suiOptions.put((long) 61, "Ithorian Sentinel"); + suiOptions.put((long) 62, "Kashyyykian Hunting"); + break; + case 7: // [Items] Battle Armor + suiOptions.put((long) 70, "Bone"); + suiOptions.put((long) 71, "Ithorian Defender"); + suiOptions.put((long) 72, "Kashyyykian Black Mountain"); + break; + case 8: // [Items] Reconnaissance Armor + suiOptions.put((long) 80, "Marauder"); + suiOptions.put((long) 81, "Ithorian Guardian"); + suiOptions.put((long) 82, "Kashyyykian Ceremonial"); + 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.grantLevel(player, 90); // Commented out until fixed + //core.playerService.giveExperience(player, 999999999); + return; + case 11: // Give 100,000 credits + player.setCashCredits(player.getCashCredits() + 100000); + return; + case 12: // Reset expertise + // Seefo->Light: I commented out the below line because it gave us an error and didn't properly remove the skill, could you try the method SWGList.reverseGet that I added? + //player.getSkills().get().stream().filter(s -> s.contains("expertise")).forEach(s -> core.skillService.removeSkill(creature, s)); + + // Using this for now + for(int i = creature.getSkills().size() - 1; i >= 0; i-- ) + { + String skill = creature.getSkills().get(i); + if(skill.contains("expertise")) core.skillService.removeSkill(player, skill); + } + 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: // Armor + sendCharacterBuilderSUI(player, 5); + return; + case 23: // Weapons + sendCharacterBuilderSUI(player, 3); + return; + + case 24: // Misc Items + sendCharacterBuilderSUI(player, 4); + return; + // [Items] Weapons + case 30: // Jedi Weapons + TangibleObject lightsaber1 = (TangibleObject) 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"); + + TangibleObject lightsaber2 = (TangibleObject) 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"); + + TangibleObject lightsaber3 = (TangibleObject) 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"); + + Random random = new Random(); + + lightsaber1.setCustomizationVariable("/private/index_color_blade", (byte) random.nextInt(47)); + lightsaber2.setCustomizationVariable("/private/index_color_blade", (byte) random.nextInt(47)); + lightsaber3.setCustomizationVariable("/private/index_color_blade", (byte) random.nextInt(47)); + + 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", (float) 0.8); + 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); + + SWGObject pistol = core.objectService.createObject("object/weapon/ranged/pistol/shared_pistol_cdef.iff", planet); + pistol.setIntAttribute("required_combat_level", 90); + pistol.setFloatAttribute("cat_wpn_damage.wpn_attack_speed", (float) 0.4); + pistol.setStringAttribute("class_required", "None"); + pistol.setStringAttribute("cat_wpn_damage.wpn_damage_type", "Energy"); + pistol.setStringAttribute("cat_wpn_damage.damage", "400-559"); + + inventory.add(pistol); + return; + case 40: + TangibleObject ring = (TangibleObject) core.objectService.createObject("object/tangible/wearables/ring/shared_ring_s01.iff", planet); + ring.setCustomName("Unity Ring"); + inventory.add(ring); + case 41: + TangibleObject backpack = (TangibleObject) core.objectService.createObject("object/tangible/wearables/backpack/shared_backpack_krayt_skull.iff", planet); + backpack.setIntAttribute("cat_stat_mod_bonus.@stat_n:agility_modified", 25); + backpack.setIntAttribute("cat_stat_mod_bonus.@stat_n:constitution_modified", 30); + backpack.setIntAttribute("cat_stat_mod_bonus.@stat_n:luck_modified", 25); + backpack.setIntAttribute("cat_stat_mod_bonus.@stat_n:precision_modified", 35); + backpack.setIntAttribute("cat_stat_mod_bonus.@stat_n:stamina_modified", 30); + backpack.setIntAttribute("cat_stat_mod_bonus.@stat_n:strength_modified", 35); + + inventory.add(backpack); + return; + case 50: // [Items] Assault Armor + sendCharacterBuilderSUI(player, 6); + return; + case 51: // [Items] Battle Armor + sendCharacterBuilderSUI(player, 7); + return; + case 52: // [Items] Reconnaissance Armor + sendCharacterBuilderSUI(player, 8); + return; + case 60: // Composite Armor + SWGObject comp_bicep_r = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bicep_r.iff", planet); + comp_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + comp_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + comp_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + comp_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + comp_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + comp_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject comp_bicep_l = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bicep_l.iff", planet); + comp_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + comp_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + comp_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + comp_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + comp_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + comp_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject comp_bracer_r = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bracer_r.iff", planet); + comp_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + comp_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + comp_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + comp_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + comp_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + comp_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject comp_bracer_l = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bracer_l.iff", planet); + comp_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + comp_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + comp_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + comp_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + comp_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + comp_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject comp_leggings = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_leggings.iff", planet); + comp_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + comp_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + comp_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + comp_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + comp_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + comp_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject comp_helmet = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_helmet.iff", planet); + comp_helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + comp_helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + comp_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + comp_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + comp_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + comp_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject comp_chest = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_chest_plate.iff", planet); + comp_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + comp_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + comp_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + comp_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + comp_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + comp_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject comp_boots = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_boots.iff", planet); + SWGObject comp_gloves = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_gloves.iff", planet); + + + + inventory.add(comp_bicep_r); + inventory.add(comp_bicep_l); + inventory.add(comp_bracer_r); + inventory.add(comp_bracer_l); + inventory.add(comp_leggings); + inventory.add(comp_helmet); + inventory.add(comp_chest); + inventory.add(comp_boots); + inventory.add(comp_gloves); + + + return; + case 61: // Ithorian Sentinel + SWGObject sent_bicep_r = core.objectService.createObject("object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bicep_r.iff", planet); + sent_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + sent_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + sent_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + sent_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + sent_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + sent_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject sent_bicep_l = core.objectService.createObject("object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bicep_l.iff", planet); + sent_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + sent_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + sent_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + sent_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + sent_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + sent_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject sent_bracer_r = core.objectService.createObject("object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bracer_r.iff", planet); + sent_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + sent_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + sent_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + sent_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + sent_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + sent_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject sent_bracer_l = core.objectService.createObject("object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bracer_l.iff", planet); + sent_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + sent_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + sent_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + sent_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + sent_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + sent_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject sent_leggings = core.objectService.createObject("object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_leggings.iff", planet); + sent_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + sent_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + sent_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + sent_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + sent_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + sent_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject sent_helmet = core.objectService.createObject("object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_helmet.iff", planet); + sent_helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + sent_helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + sent_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + sent_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + sent_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + sent_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject sent_chest = core.objectService.createObject("object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_chest_plate.iff", planet); + sent_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + sent_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + sent_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + sent_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + sent_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + sent_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject sent_boots = core.objectService.createObject("object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_boots.iff", planet); + SWGObject sent_gloves = core.objectService.createObject("object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_gloves.iff", planet); + + + + inventory.add(sent_bicep_r); + inventory.add(sent_bicep_l); + inventory.add(sent_bracer_r); + inventory.add(sent_bracer_l); + inventory.add(sent_leggings); + inventory.add(sent_helmet); + inventory.add(sent_chest); + inventory.add(sent_boots); + inventory.add(sent_gloves); + + + return; + case 62: // Kashyyykian Hunting + SWGObject hunt_bicep_r = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bicep_r.iff", planet); + hunt_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + hunt_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + hunt_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + hunt_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + hunt_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + hunt_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject hunt_bicep_l = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bicep_l.iff", planet); + hunt_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + hunt_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + hunt_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + hunt_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + hunt_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + hunt_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject hunt_bracer_r = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bracer_r.iff", planet); + hunt_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + hunt_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + hunt_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + hunt_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + hunt_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + hunt_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject hunt_bracer_l = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bracer_l.iff", planet); + hunt_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + hunt_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + hunt_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + hunt_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + hunt_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + hunt_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject hunt_leggings = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_leggings.iff", planet); + hunt_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + hunt_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + hunt_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + hunt_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + hunt_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + hunt_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject hunt_chest = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_chestplate.iff", planet); + hunt_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + hunt_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + hunt_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + hunt_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + hunt_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + hunt_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + + + inventory.add(hunt_bicep_r); + inventory.add(hunt_bicep_l); + inventory.add(hunt_bracer_r); + inventory.add(hunt_bracer_l); + inventory.add(hunt_leggings); + inventory.add(hunt_chest); + + + return; + case 70: // Bone Armor + SWGObject bone_bicep_r = core.objectService.createObject("object/tangible/wearables/armor/bone/shared_armor_bone_s01_bicep_r.iff", planet); + bone_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + bone_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + bone_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + bone_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + bone_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + bone_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject bone_bicep_l = core.objectService.createObject("object/tangible/wearables/armor/bone/shared_armor_bone_s01_bicep_l.iff", planet); + bone_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + bone_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + bone_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + bone_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + bone_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + bone_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject bone_bracer_r = core.objectService.createObject("object/tangible/wearables/armor/bone/shared_armor_bone_s01_bracer_r.iff", planet); + bone_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + bone_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + bone_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + bone_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + bone_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + bone_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject bone_bracer_l = core.objectService.createObject("object/tangible/wearables/armor/bone/shared_armor_bone_s01_bracer_l.iff", planet); + bone_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + bone_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + bone_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + bone_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + bone_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + bone_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject bone_leggings = core.objectService.createObject("object/tangible/wearables/armor/bone/shared_armor_bone_s01_leggings.iff", planet); + bone_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + bone_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + bone_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + bone_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + bone_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + bone_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject bone_helmet = core.objectService.createObject("object/tangible/wearables/armor/bone/shared_armor_bone_s01_helmet.iff", planet); + bone_helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + bone_helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + bone_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + bone_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + bone_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + bone_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject bone_chest = core.objectService.createObject("object/tangible/wearables/armor/bone/shared_armor_bone_s01_chest_plate.iff", planet); + bone_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + bone_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + bone_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + bone_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + bone_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + bone_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject bone_boots = core.objectService.createObject("object/tangible/wearables/armor/bone/shared_armor_bone_s01_boots.iff", planet); + SWGObject bone_gloves = core.objectService.createObject("object/tangible/wearables/armor/bone/shared_armor_bone_s01_gloves.iff", planet); + + + + inventory.add(bone_bicep_r); + inventory.add(bone_bicep_l); + inventory.add(bone_bracer_r); + inventory.add(bone_bracer_l); + inventory.add(bone_leggings); + inventory.add(bone_helmet); + inventory.add(bone_chest); + inventory.add(bone_boots); + inventory.add(bone_gloves); + + + return; + case 71: // Ithorian Defender + SWGObject def_bicep_r = core.objectService.createObject("object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_bicep_r.iff", planet); + def_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + def_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + def_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + def_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + def_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + def_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject def_bicep_l = core.objectService.createObject("object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_bicep_l.iff", planet); + def_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + def_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + def_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + def_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + def_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + def_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject def_bracer_r = core.objectService.createObject("object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_bracer_r.iff", planet); + def_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + def_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + def_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + def_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + def_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + def_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject def_bracer_l = core.objectService.createObject("object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_bracer_l.iff", planet); + def_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + def_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + def_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + def_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + def_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + def_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject def_leggings = core.objectService.createObject("object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_leggings.iff", planet); + def_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + def_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + def_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + def_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + def_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + def_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject def_helmet = core.objectService.createObject("object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_helmet.iff", planet); + def_helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + def_helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + def_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + def_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + def_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + def_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject def_chest = core.objectService.createObject("object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_chest_plate.iff", planet); + def_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + def_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + def_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + def_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + def_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + def_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject def_boots = core.objectService.createObject("object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_boots.iff", planet); + SWGObject def_gloves = core.objectService.createObject("object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_gloves.iff", planet); + + + + inventory.add(def_bicep_r); + inventory.add(def_bicep_l); + inventory.add(def_bracer_r); + inventory.add(def_bracer_l); + inventory.add(def_leggings); + inventory.add(def_helmet); + inventory.add(def_chest); + inventory.add(def_boots); + inventory.add(def_gloves); + + + return; + case 72: // Kashyyykian Black Mountain + SWGObject moun_bicep_r = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_black_mtn/shared_armor_kashyyykian_black_mtn_bicep_r.iff", planet); + moun_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + moun_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + moun_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + moun_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + moun_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + moun_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject moun_bicep_l = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_black_mtn/shared_armor_kashyyykian_black_mtn_bicep_l.iff", planet); + moun_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + moun_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + moun_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + moun_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + moun_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + moun_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject moun_bracer_r = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_black_mtn/shared_armor_kashyyykian_black_mtn_bracer_r.iff", planet); + moun_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + moun_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + moun_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + moun_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + moun_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + moun_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject moun_bracer_l = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_black_mtn/shared_armor_kashyyykian_black_mtn_bracer_l.iff", planet); + moun_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + moun_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + moun_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + moun_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + moun_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + moun_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject moun_leggings = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_black_mtn/shared_armor_kashyyykian_black_mtn_leggings.iff", planet); + moun_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + moun_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + moun_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + moun_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + moun_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + moun_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject moun_chest = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_black_mtn/shared_armor_kashyyykian_black_mtn_chestplate.iff", planet); + moun_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 6000); + moun_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 6000); + moun_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + moun_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + moun_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + moun_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + + + inventory.add(moun_bicep_r); + inventory.add(moun_bicep_l); + inventory.add(moun_bracer_r); + inventory.add(moun_bracer_l); + inventory.add(moun_leggings); + inventory.add(moun_chest); + + + return; + case 80: // Marauder Armor + SWGObject mar_bicep_r = core.objectService.createObject("object/tangible/wearables/armor/marauder/shared_armor_marauder_s02_bicep_r.iff", planet); + mar_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + mar_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + mar_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + mar_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + mar_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + mar_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject mar_bicep_l = core.objectService.createObject("object/tangible/wearables/armor/marauder/shared_armor_marauder_s02_bicep_l.iff", planet); + mar_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + mar_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + mar_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + mar_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + mar_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + mar_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject mar_bracer_r = core.objectService.createObject("object/tangible/wearables/armor/marauder/shared_armor_marauder_s02_bracer_r.iff", planet); + mar_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + mar_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + mar_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + mar_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + mar_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + mar_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject mar_bracer_l = core.objectService.createObject("object/tangible/wearables/armor/marauder/shared_armor_marauder_s02_bracer_l.iff", planet); + mar_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + mar_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + mar_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + mar_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + mar_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + mar_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject mar_leggings = core.objectService.createObject("object/tangible/wearables/armor/marauder/shared_armor_marauder_s02_leggings.iff", planet); + mar_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + mar_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + mar_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + mar_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + mar_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + mar_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject mar_helmet = core.objectService.createObject("object/tangible/wearables/armor/marauder/shared_armor_marauder_s02_helmet.iff", planet); + mar_helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + mar_helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + mar_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + mar_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + mar_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + mar_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject mar_chest = core.objectService.createObject("object/tangible/wearables/armor/marauder/shared_armor_marauder_s02_chest_plate.iff", planet); + mar_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + mar_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + mar_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + mar_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + mar_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + mar_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject mar_boots = core.objectService.createObject("object/tangible/wearables/armor/marauder/shared_armor_marauder_s02_boots.iff", planet); + SWGObject mar_gloves = core.objectService.createObject("object/tangible/wearables/armor/marauder/shared_armor_marauder_s02_gloves.iff", planet); + + + + inventory.add(mar_bicep_r); + inventory.add(mar_bicep_l); + inventory.add(mar_bracer_r); + inventory.add(mar_bracer_l); + inventory.add(mar_leggings); + inventory.add(mar_helmet); + inventory.add(mar_chest); + inventory.add(mar_boots); + inventory.add(mar_gloves); + + + return; + case 81: // Ithorian Guardian + SWGObject gau_bicep_r = core.objectService.createObject("object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_bicep_r.iff", planet); + gau_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + gau_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + gau_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + gau_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + gau_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + gau_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject gau_bicep_l = core.objectService.createObject("object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_bicep_l.iff", planet); + gau_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + gau_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + gau_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + gau_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + gau_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + gau_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject gau_bracer_r = core.objectService.createObject("object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_bracer_r.iff", planet); + gau_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + gau_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + gau_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + gau_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + gau_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + gau_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject gau_bracer_l = core.objectService.createObject("object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_bracer_l.iff", planet); + gau_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + gau_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + gau_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + gau_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + gau_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + gau_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject gau_leggings = core.objectService.createObject("object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_leggings.iff", planet); + gau_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + gau_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + gau_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + gau_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + gau_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + gau_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject gau_helmet = core.objectService.createObject("object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_helmet.iff", planet); + gau_helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + gau_helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + gau_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + gau_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + gau_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + gau_helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject gau_chest = core.objectService.createObject("object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_chest_plate.iff", planet); + gau_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + gau_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + gau_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + gau_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + gau_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + gau_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject gau_boots = core.objectService.createObject("object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_boots.iff", planet); + SWGObject gau_gloves = core.objectService.createObject("object/tangible/wearables/armor/ithorian_guardian/shared_ith_armor_s02_gloves.iff", planet); + + + + inventory.add(gau_bicep_r); + inventory.add(gau_bicep_l); + inventory.add(gau_bracer_r); + inventory.add(gau_bracer_l); + inventory.add(gau_leggings); + inventory.add(gau_helmet); + inventory.add(gau_chest); + inventory.add(gau_boots); + inventory.add(gau_gloves); + + + return; + case 82: // Kashyyykian Ceremonial + SWGObject cer_bicep_r = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_ceremonial/shared_armor_kashyyykian_ceremonial_bicep_r.iff", planet); + cer_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + cer_bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + cer_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + cer_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + cer_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + cer_bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject cer_bicep_l = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_ceremonial/shared_armor_kashyyykian_ceremonial_bicep_l.iff", planet); + cer_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + cer_bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + cer_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + cer_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + cer_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + cer_bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject cer_bracer_r = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_ceremonial/shared_armor_kashyyykian_ceremonial_bracer_r.iff", planet); + cer_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + cer_bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + cer_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + cer_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + cer_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + cer_bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject cer_bracer_l = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_ceremonial/shared_armor_kashyyykian_ceremonial_bracer_l.iff", planet); + cer_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + cer_bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + cer_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + cer_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + cer_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + cer_bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject cer_leggings = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_ceremonial/shared_armor_kashyyykian_ceremonial_leggings.iff", planet); + cer_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + cer_leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + cer_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + cer_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + cer_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + cer_leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject cer_chest = core.objectService.createObject("object/tangible/wearables/armor/kashyyykian_ceremonial/shared_armor_kashyyykian_ceremonial_chestplate.iff", planet); + cer_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 5000); + cer_chest.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 7000); + cer_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + cer_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + cer_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + cer_chest.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + + + inventory.add(cer_bicep_r); + inventory.add(cer_bicep_l); + inventory.add(cer_bracer_r); + inventory.add(cer_bracer_l); + inventory.add(cer_leggings); + inventory.add(cer_chest); + + 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 0457d94a..4d9a27f2 100644 --- a/src/services/EntertainmentService.java +++ b/src/services/EntertainmentService.java @@ -518,7 +518,7 @@ public class EntertainmentService implements INetworkDispatch { core.commandService.registerCommand("startdance"); core.commandService.registerCommand("stopdance"); core.commandService.registerCommand("watch"); - //core.commandService.registerCommand("stopwatching"); // SWGList error + core.commandService.registerCommand("stopwatching"); core.commandService.registerCommand("holoEmote"); core.commandService.registerCommand("covercharge"); //core.commandService.registerCommand("en_holographic_recall"); @@ -681,13 +681,13 @@ public class EntertainmentService implements INetworkDispatch { // visual if (spectator.getPerformanceWatchee() == performer && spectateType) - spectator.getPerformanceWatchee().removeAudience(spectator); + spectator.getPerformanceWatchee().removeSpectator(spectator); // music else if (spectator.getPerformanceListenee() == performer && !spectateType) - spectator.getPerformanceListenee().removeAudience(spectator); + spectator.getPerformanceListenee().removeSpectator(spectator); spectator.setPerformanceWatchee(performer); - performer.addAudience(spectator); + performer.addSpectator(spectator); spectator.setMoodAnimation("entertained"); final ScheduledFuture spectatorTask = scheduler.scheduleAtFixedRate(() -> { @@ -705,7 +705,7 @@ public class EntertainmentService implements INetworkDispatch { + " is out of range.", (byte) 0); } spectator.setMoodAnimation("neutral"); - performer.removeAudience(spectator); + performer.removeSpectator(spectator); if (spectator.getInspirationTick().cancel(true)) spectator.getSpectatorTask().cancel(true); diff --git a/src/services/EquipmentService.java b/src/services/EquipmentService.java index 9995f4a7..bcd0a519 100644 --- a/src/services/EquipmentService.java +++ b/src/services/EquipmentService.java @@ -21,10 +21,20 @@ ******************************************************************************/ package services; +import java.io.IOException; +import java.nio.file.FileVisitResult; +import java.nio.file.FileVisitor; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; import java.util.Map; import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; import java.util.TreeMap; +import org.python.antlr.ast.Str; import org.python.core.Py; import org.python.core.PyObject; @@ -35,10 +45,13 @@ import engine.resources.objects.SWGObject; import engine.resources.service.INetworkDispatch; import engine.resources.service.INetworkRemoteEvent; import resources.objects.player.PlayerObject; +import services.equipment.BonusSetTemplate; +import services.spawn.MobileTemplate; public class EquipmentService implements INetworkDispatch { private NGECore core; + private Map bonusSetTemplates = new ConcurrentHashMap(); public EquipmentService(NGECore core) { this.core = core; @@ -221,9 +234,14 @@ public class EquipmentService implements INetworkDispatch { if(!actor.getEquipmentList().contains(item)) actor.addObjectToEquipList(item); + + if(item.getAttachment("setBonus") != null) + { + BonusSetTemplate bonus = bonusSetTemplates.get((String)item.getAttachment("setBonus")); + bonus.callScript(actor); + } } - 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", ""); @@ -272,9 +290,35 @@ public class EquipmentService implements INetworkDispatch { if(item.getStringAttribute("proc_name") != null) core.buffService.removeBuffFromCreatureByName(actor, item.getStringAttribute("proc_name").replace("@ui_buff:", "")); + if(actor.getEquipmentList().contains(item)) actor.removeObjectFromEquipList(item); + if(item.getAttachment("setBonus") != null) + { + BonusSetTemplate bonus = bonusSetTemplates.get((String)item.getAttachment("setBonus")); + bonus.callScript(actor); + } } + public void addBonusSetTemplate(BonusSetTemplate bonusSet) + { + bonusSetTemplates.put(bonusSet.getName(), bonusSet); + } + + public void loadBonusSets() { + Path p = Paths.get("scripts/equipment/bonus_sets/"); + FileVisitor fv = new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + core.scriptService.callScript("scripts/equipment/bonus_sets/", file.getFileName().toString().replace(".py", ""), "addBonusSet", core); + return FileVisitResult.CONTINUE; + } + }; + try { + Files.walkFileTree(p, fv); + } catch (IOException e) { + e.printStackTrace(); + } + } } diff --git a/src/services/GroupService.java b/src/services/GroupService.java index 472c4f80..b9504a8c 100644 --- a/src/services/GroupService.java +++ b/src/services/GroupService.java @@ -211,7 +211,7 @@ public class GroupService implements INetworkDispatch { } } - public void handleGroupDisband(CreatureObject creature) { + public void handleGroupDisband(CreatureObject creature, boolean destroy) { if(creature.getGroupId() == 0) return; @@ -225,7 +225,7 @@ public class GroupService implements INetworkDispatch { List memberList = new ArrayList(group.getMemberList()); - if(group.getGroupLeader() != creature && group.getMemberList().size() > 2) { + if(group.getGroupLeader() != creature || !destroy || memberList.size() > 2) { group.removeMember(creature); creature.setInviteCounter(creature.getInviteCounter() + 1); @@ -245,6 +245,9 @@ public class GroupService implements INetworkDispatch { removeGroupBuffs(creature); + if (group.getMemberList().size() == 0) // ensure that there are no empty groups just incase.. + core.objectService.destroyObject(group.getObjectID()); + } else { for(SWGObject member : memberList) { @@ -264,14 +267,11 @@ public class GroupService implements INetworkDispatch { removeGroupBuffs((CreatureObject) member); } - core.objectService.destroyObject(group.getObjectID()); - } - } - - - + public void handleGroupDisband(CreatureObject creature) { + handleGroupDisband(creature, true); + } } diff --git a/src/services/equipment/BonusSetTemplate.java b/src/services/equipment/BonusSetTemplate.java new file mode 100644 index 00000000..c224c134 --- /dev/null +++ b/src/services/equipment/BonusSetTemplate.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 services.equipment; + +import java.util.Vector; + +import main.NGECore; + +import org.python.core.Py; +import org.python.core.PyObject; + +import engine.resources.objects.SWGObject; +import resources.objects.creature.CreatureObject; + +public class BonusSetTemplate +{ + private String name; + private Vector requiredWornTemplates; + + public BonusSetTemplate(String name) + { + this.name = name; + this.requiredWornTemplates = new Vector(); + } + + public void addRequiredTemplate(String template) + { + requiredWornTemplates.add(template); + } + + public String getName() + { + return this.name; + } + + public int getWornTemplateCount(CreatureObject creature) + { + int wornItems = 0; + + for (SWGObject item : creature.getEquipmentList().get()) + { + if(requiredWornTemplates.contains(item.getTemplate())) wornItems++; + } + + //System.out.println("[BonusSetTemplate] Worn items: " + wornItems); + return wornItems; + } + + public void callScript(CreatureObject creature) + { + //System.out.println("[BonusSetTemplate] Calling script for: " + this.getName()); + + PyObject func = NGECore.getInstance().scriptService.getMethod("scripts/equipment/bonus_sets/", name, "handleChange"); + if(func != null) func.__call__(Py.java2py(NGECore.getInstance()), Py.java2py(creature), Py.java2py(this)); + } +}