diff --git a/scripts/conversation/byxle.py b/scripts/conversation/byxle.py new file mode 100644 index 00000000..71c08205 --- /dev/null +++ b/scripts/conversation/byxle.py @@ -0,0 +1,15 @@ +from resources.common import ConversationOption +from resources.common import OutOfBand +from resources.common import ProsePackage +from java.util import Vector +import sys + +def startConversation(core, actor, npc): + convSvc = core.conversationService + + core.conversationService.sendStopConversation(actor, npc, 'conversation/tatooine_eisley_byxle', 's_48') + return + +def endConversation(core, actor, npc): + core.conversationService.sendStopConversation(actor, npc, 'conversation/tatooine_eisley_byxle', 's_48') + return \ No newline at end of file diff --git a/scripts/conversation/dunir.py b/scripts/conversation/dunir.py new file mode 100644 index 00000000..189e1748 --- /dev/null +++ b/scripts/conversation/dunir.py @@ -0,0 +1,15 @@ +from resources.common import ConversationOption +from resources.common import OutOfBand +from resources.common import ProsePackage +from java.util import Vector +import sys + +def startConversation(core, actor, npc): + convSvc = core.conversationService + + core.conversationService.sendStopConversation(actor, npc, 'conversation/tatooine_eisley_dunir', 's_37') + return + +def endConversation(core, actor, npc): + core.conversationService.sendStopConversation(actor, npc, 'conversation/tatooine_eisley_dunir', 's_37') + return \ No newline at end of file diff --git a/scripts/conversation/gendra.py b/scripts/conversation/gendra.py new file mode 100644 index 00000000..25277b59 --- /dev/null +++ b/scripts/conversation/gendra.py @@ -0,0 +1,15 @@ +from resources.common import ConversationOption +from resources.common import OutOfBand +from resources.common import ProsePackage +from java.util import Vector +import sys + +def startConversation(core, actor, npc): + convSvc = core.conversationService + + core.conversationService.sendStopConversation(actor, npc, 'conversation/tatooine_eisley_gendra', 's_99') + return + +def endConversation(core, actor, npc): + core.conversationService.sendStopConversation(actor, npc, 'conversation/tatooine_eisley_gendra', 's_99') + return \ No newline at end of file diff --git a/scripts/conversation/imp_recruiter.py b/scripts/conversation/imp_recruiter.py index 399294b1..7659eb4b 100644 --- a/scripts/conversation/imp_recruiter.py +++ b/scripts/conversation/imp_recruiter.py @@ -546,7 +546,7 @@ def handleSecondScreen(core, actor, npc, selection): def handleThirdScreen(core, actor, npc, selection): if selection == 0: core.conversationService.sendStopConversation(actor, npc, 'conversation/faction_recruiter_imperial', 's_94') - actor.setFaction('neutral') + actor.setFaction('') return if selection == 1: diff --git a/scripts/conversation/mayor_mikdanyel_guhrantt.py b/scripts/conversation/mayor_mikdanyel_guhrantt.py new file mode 100644 index 00000000..32d86b84 --- /dev/null +++ b/scripts/conversation/mayor_mikdanyel_guhrantt.py @@ -0,0 +1,15 @@ +from resources.common import ConversationOption +from resources.common import OutOfBand +from resources.common import ProsePackage +from java.util import Vector +import sys + +def startConversation(core, actor, npc): + convSvc = core.conversationService + + core.conversationService.sendStopConversation(actor, npc, 'conversation/mos_eisley_mayor', 's_117') + return + +def endConversation(core, actor, npc): + core.conversationService.sendStopConversation(actor, npc, 'conversation/mos_eisley_mayor', 's_117') + return \ No newline at end of file diff --git a/scripts/conversation/niko.py b/scripts/conversation/niko.py new file mode 100644 index 00000000..87e9d576 --- /dev/null +++ b/scripts/conversation/niko.py @@ -0,0 +1,15 @@ +from resources.common import ConversationOption +from resources.common import OutOfBand +from resources.common import ProsePackage +from java.util import Vector +import sys + +def startConversation(core, actor, npc): + convSvc = core.conversationService + + core.conversationService.sendStopConversation(actor, npc, 'conversation/tatooine_eisley_niko', 's_71') + return + +def endConversation(core, actor, npc): + core.conversationService.sendStopConversation(actor, npc, 'conversation/tatooine_eisley_niko', 's_71') + return \ No newline at end of file diff --git a/scripts/conversation/reb_recruiter.py b/scripts/conversation/reb_recruiter.py index 9c8b803d..6cc16459 100644 --- a/scripts/conversation/reb_recruiter.py +++ b/scripts/conversation/reb_recruiter.py @@ -315,7 +315,7 @@ def handleSecondScreen(core, actor, npc, selection): if actor.getFaction() != 'rebel' and actor.getFaction() != 'imperial': if selection == 0: - actor.setFaction('imperial') + actor.setFaction('rebel') actor.setFactionStatus(FactionStatus.OnLeave) prose = ProsePackage('conversation/faction_recruiter_rebel', 's_99') @@ -546,7 +546,7 @@ def handleSecondScreen(core, actor, npc, selection): def handleThirdScreen(core, actor, npc, selection): if selection == 0: core.conversationService.sendStopConversation(actor, npc, 'conversation/faction_recruiter_rebel', 's_58') - actor.setFaction('neutral') + actor.setFaction('') return if selection == 1: diff --git a/scripts/conversation/reimos.py b/scripts/conversation/reimos.py new file mode 100644 index 00000000..dcc7a6e1 --- /dev/null +++ b/scripts/conversation/reimos.py @@ -0,0 +1,15 @@ +from resources.common import ConversationOption +from resources.common import OutOfBand +from resources.common import ProsePackage +from java.util import Vector +import sys + +def startConversation(core, actor, npc): + convSvc = core.conversationService + + core.conversationService.sendStopConversation(actor, npc, 'conversation/tatooine_eisley_reimos_v2', 's_36') + return + +def endConversation(core, actor, npc): + core.conversationService.sendStopConversation(actor, npc, 'conversation/tatooine_eisley_reimos_v2', 's_36') + return \ No newline at end of file diff --git a/scripts/conversation/toggi.py b/scripts/conversation/toggi.py new file mode 100644 index 00000000..0654f9c3 --- /dev/null +++ b/scripts/conversation/toggi.py @@ -0,0 +1,15 @@ +from resources.common import ConversationOption +from resources.common import OutOfBand +from resources.common import ProsePackage +from java.util import Vector +import sys + +def startConversation(core, actor, npc): + convSvc = core.conversationService + + core.conversationService.sendStopConversation(actor, npc, 'conversation/tatooine_eisley_toggi', 's_4') + return + +def endConversation(core, actor, npc): + core.conversationService.sendStopConversation(actor, npc, 'conversation/tatooine_eisley_toggi', 's_4') + return \ No newline at end of file diff --git a/scripts/expertise/expertise_of_medical_sup_1.py b/scripts/expertise/expertise_of_medical_sup_1.py index fe15a79d..3b3e1915 100644 --- a/scripts/expertise/expertise_of_medical_sup_1.py +++ b/scripts/expertise/expertise_of_medical_sup_1.py @@ -1,17 +1,17 @@ import sys def addAbilities(core, actor, player): - if actor.getLevel() >= 10: + if actor.getLevel() >= 18: actor.addAbility("of_medical_sup_1") - if actor.getLevel() >= 34: + if actor.getLevel() >= 30: actor.addAbility("of_medical_sup_2") - if actor.getLevel() >= 48: + if actor.getLevel() >= 44: actor.addAbility("of_medical_sup_3") - if actor.getLevel() >= 62: + if actor.getLevel() >= 58: actor.addAbility("of_medical_sup_4") - if actor.getLevel() >= 76: + if actor.getLevel() >= 72: actor.addAbility("of_medical_sup_5") - if actor.getLevel() >= 90: + if actor.getLevel() >= 86: actor.addAbility("of_medical_sup_6") return diff --git a/scripts/expertise/expertise_sm_general_bad_odds_1.py b/scripts/expertise/expertise_sm_general_bad_odds_1.py index fa70a2fc..5435e2e9 100644 --- a/scripts/expertise/expertise_sm_general_bad_odds_1.py +++ b/scripts/expertise/expertise_sm_general_bad_odds_1.py @@ -1,15 +1,15 @@ import sys def addAbilities(core, actor, player): - if actor.getLevel() >= 26: - actor.addAbility("sm_bad_odds_1") if actor.getLevel() >= 34: + actor.addAbility("sm_bad_odds_1") + if actor.getLevel() >= 46: actor.addAbility("sm_bad_odds_2") - if actor.getLevel() >= 48: + if actor.getLevel() >= 58: actor.addAbility("sm_bad_odds_3") - if actor.getLevel() >= 62: + if actor.getLevel() >= 74: actor.addAbility("sm_bad_odds_4") - if actor.getLevel() >= 76: + if actor.getLevel() >= 84: actor.addAbility("sm_bad_odds_5") return diff --git a/scripts/expertise/expertise_sm_path_shoot_first_1.py b/scripts/expertise/expertise_sm_path_shoot_first_1.py index 3cfcce30..3dbc049f 100644 --- a/scripts/expertise/expertise_sm_path_shoot_first_1.py +++ b/scripts/expertise/expertise_sm_path_shoot_first_1.py @@ -1,15 +1,15 @@ import sys def addAbilities(core, actor, player): - if actor.getLevel() >= 26: - actor.addAbility("sm_shoot_first_1") if actor.getLevel() >= 34: + actor.addAbility("sm_shoot_first_1") + if actor.getLevel() >= 46: actor.addAbility("sm_shoot_first_2") - if actor.getLevel() >= 48: - actor.addAbility("sm_shoot_first_3") if actor.getLevel() >= 62: + actor.addAbility("sm_shoot_first_3") + if actor.getLevel() >= 74: actor.addAbility("sm_shoot_first_4") - if actor.getLevel() >= 76: + if actor.getLevel() >= 90: actor.addAbility("sm_shoot_first_5") return diff --git a/scripts/mobiles/dantooine/dark_adept.py b/scripts/mobiles/dantooine/dark_adept.py new file mode 100644 index 00000000..5a0df6df --- /dev/null +++ b/scripts/mobiles/dantooine/dark_adept.py @@ -0,0 +1,40 @@ +import sys +from services.spawn import MobileTemplate +from services.spawn import WeaponTemplate +from java.util import Vector + +def addTemplate(core): + mobileTemplate = MobileTemplate() + + mobileTemplate.setCreatureName('dark_adept') + mobileTemplate.setLevel(70) + mobileTemplate.setMinLevel(60) + mobileTemplate.setMaxLevel(70) + mobileTemplate.setDifficulty(1) + mobileTemplate.setAttackRange(6) + mobileTemplate.setAttackSpeed(1.0) + mobileTemplate.setWeaponType(9) + mobileTemplate.setMinSpawnDistance(4) + mobileTemplate.setMaxSpawnDistance(8) + mobileTemplate.setDeathblow(True) + + + templates = Vector() + templates.add('object/mobile/shared_dressed_dark_jedi_elder_male_human_01.iff') + mobileTemplate.setTemplates(templates) + + weaponTemplates = Vector() + weapontemplate = WeaponTemplate('object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_gen5.iff', 9, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gen5.iff', 10, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_gen5.iff', 11, 1.0) + weaponTemplates.add(weapontemplate) + mobileTemplate.setWeaponTemplateVector(weaponTemplates) + + attacks = Vector() + mobileTemplate.setDefaultAttack('saberHit') + mobileTemplate.setAttacks(attacks) + + core.spawnService.addMobileTemplate('dark_adept', mobileTemplate) + \ No newline at end of file diff --git a/scripts/mobiles/dantooine/dark_force_crystal_hunter.py b/scripts/mobiles/dantooine/dark_force_crystal_hunter.py new file mode 100644 index 00000000..0c6ded2a --- /dev/null +++ b/scripts/mobiles/dantooine/dark_force_crystal_hunter.py @@ -0,0 +1,39 @@ +import sys +from services.spawn import MobileTemplate +from services.spawn import WeaponTemplate +from java.util import Vector + +def addTemplate(core): + mobileTemplate = MobileTemplate() + + mobileTemplate.setCreatureName('dark_force_crystal_hunter') + mobileTemplate.setLevel(90) + mobileTemplate.setMinLevel(60) + mobileTemplate.setMaxLevel(69) + mobileTemplate.setDifficulty(0) + mobileTemplate.setAttackRange(6) + mobileTemplate.setAttackSpeed(1.0) + mobileTemplate.setWeaponType(9) + mobileTemplate.setMinSpawnDistance(2) + mobileTemplate.setMaxSpawnDistance(4) + mobileTemplate.setDeathblow(True) + + templates = Vector() + templates.add('object/mobile/shared_dressed_dark_force_crystal_hunter.iff') + mobileTemplate.setTemplates(templates) + + weaponTemplates = Vector() + weapontemplate = WeaponTemplate('object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_gen5.iff', 9, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gen5.iff', 10, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_gen5.iff', 11, 1.0) + weaponTemplates.add(weapontemplate) + mobileTemplate.setWeaponTemplateVector(weaponTemplates) + + attacks = Vector() + mobileTemplate.setDefaultAttack('saberHit') + mobileTemplate.setAttacks(attacks) + + core.spawnService.addMobileTemplate('dark_force_crystal_hunter', mobileTemplate) + \ No newline at end of file diff --git a/scripts/mobiles/dantooine/dark_jedi_knight.py b/scripts/mobiles/dantooine/dark_jedi_knight.py new file mode 100644 index 00000000..337b7b82 --- /dev/null +++ b/scripts/mobiles/dantooine/dark_jedi_knight.py @@ -0,0 +1,62 @@ +import sys +from services.spawn import MobileTemplate +from services.spawn import WeaponTemplate +from java.util import Vector + +def addTemplate(core): + mobileTemplate = MobileTemplate() + + mobileTemplate.setCreatureName('dark_jedi_knight') + mobileTemplate.setLevel(90) + mobileTemplate.setMinLevel(62) + mobileTemplate.setMaxLevel(70) + mobileTemplate.setDifficulty(1) + mobileTemplate.setAttackRange(6) + mobileTemplate.setAttackSpeed(1.0) + mobileTemplate.setWeaponType(9) + mobileTemplate.setMinSpawnDistance(3) + mobileTemplate.setMaxSpawnDistance(5) + mobileTemplate.setDeathblow(True) + + templates = Vector() + templates.add('object/mobile/shared_dressed_dark_jedi_male_human_01.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_male_human_02.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_male_human_03.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_male_human_04.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_male_human_05.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_male_human_06.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_male_twk_01.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_male_twk_02.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_male_twk_03.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_male_zab_01.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_male_zab_02.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_male_zab_03.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_female_human_01.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_female_human_02.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_female_human_03.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_female_human_04.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_female_twk_01.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_female_twk_02.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_female_twk_03.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_female_zab_01.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_female_zab_02.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_female_zab_03.iff') + + + mobileTemplate.setTemplates(templates) + + weaponTemplates = Vector() + weapontemplate = WeaponTemplate('object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_gen5.iff', 9, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gen5.iff', 10, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_gen5.iff', 11, 1.0) + weaponTemplates.add(weapontemplate) + mobileTemplate.setWeaponTemplateVector(weaponTemplates) + + attacks = Vector() + mobileTemplate.setDefaultAttack('saberHit') + mobileTemplate.setAttacks(attacks) + + core.spawnService.addMobileTemplate('dark_jedi_knight', mobileTemplate) + \ No newline at end of file diff --git a/scripts/mobiles/dantooine/dark_jedi_master.py b/scripts/mobiles/dantooine/dark_jedi_master.py new file mode 100644 index 00000000..8ad845e3 --- /dev/null +++ b/scripts/mobiles/dantooine/dark_jedi_master.py @@ -0,0 +1,44 @@ +import sys +from services.spawn import MobileTemplate +from services.spawn import WeaponTemplate +from java.util import Vector + +def addTemplate(core): + mobileTemplate = MobileTemplate() + + mobileTemplate.setCreatureName('dark_jedi_master') + mobileTemplate.setLevel(90) + mobileTemplate.setDifficulty(2) + mobileTemplate.setAttackRange(6) + mobileTemplate.setAttackSpeed(1.0) + mobileTemplate.setWeaponType(9) + mobileTemplate.setMinSpawnDistance(3) + mobileTemplate.setMaxSpawnDistance(5) + mobileTemplate.setDeathblow(True) + + templates = Vector() + templates.add('object/mobile/shared_dressed_dark_jedi_master_female_twk_01.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_master_female_twk_02.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_master_female_zab_01.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_master_female_zab_02.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_master_male_human_01.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_master_male_human_04.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_master_male_human_05.iff') + templates.add('object/mobile/shared_dressed_dark_jedi_master_male_human_06.iff') + mobileTemplate.setTemplates(templates) + + weaponTemplates = Vector() + weapontemplate = WeaponTemplate('object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_gen5.iff', 9, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gen5.iff', 10, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_gen5.iff', 11, 1.0) + weaponTemplates.add(weapontemplate) + mobileTemplate.setWeaponTemplateVector(weaponTemplates) + + attacks = Vector() + mobileTemplate.setDefaultAttack('saberHit') + mobileTemplate.setAttacks(attacks) + + core.spawnService.addMobileTemplate('dark_jedi_master', mobileTemplate) + \ No newline at end of file diff --git a/scripts/mobiles/dantooine/dark_side_savage.py b/scripts/mobiles/dantooine/dark_side_savage.py new file mode 100644 index 00000000..dee96f19 --- /dev/null +++ b/scripts/mobiles/dantooine/dark_side_savage.py @@ -0,0 +1,37 @@ +import sys +from services.spawn import MobileTemplate +from services.spawn import WeaponTemplate +from java.util import Vector + +def addTemplate(core): + mobileTemplate = MobileTemplate() + + mobileTemplate.setCreatureName('eow_dark_side_savage') + mobileTemplate.setLevel(85) + mobileTemplate.setDifficulty(0) + mobileTemplate.setAttackRange(6) + mobileTemplate.setAttackSpeed(1.0) + mobileTemplate.setWeaponType(9) + mobileTemplate.setMinSpawnDistance(2) + mobileTemplate.setMaxSpawnDistance(4) + mobileTemplate.setDeathblow(False) + + templates = Vector() + templates.add('object/mobile/shared_dressed_dark_side_savage.iff') + mobileTemplate.setTemplates(templates) + + weaponTemplates = Vector() + weapontemplate = WeaponTemplate('object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_gen5.iff', 9, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gen5.iff', 10, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_gen5.iff', 11, 1.0) + weaponTemplates.add(weapontemplate) + mobileTemplate.setWeaponTemplateVector(weaponTemplates) + + attacks = Vector() + mobileTemplate.setDefaultAttack('saberHit') + mobileTemplate.setAttacks(attacks) + + core.spawnService.addMobileTemplate('dark_side_savage', mobileTemplate) + \ No newline at end of file diff --git a/scripts/mobiles/dantooine/force_sensitive_crypt_crawler.py b/scripts/mobiles/dantooine/force_sensitive_crypt_crawler.py new file mode 100644 index 00000000..a74916a2 --- /dev/null +++ b/scripts/mobiles/dantooine/force_sensitive_crypt_crawler.py @@ -0,0 +1,39 @@ +import sys +from services.spawn import MobileTemplate +from services.spawn import WeaponTemplate +from java.util import Vector + +def addTemplate(core): + mobileTemplate = MobileTemplate() + + mobileTemplate.setCreatureName('eow_force_sensitive_crypt_crawler') + mobileTemplate.setLevel(90) + mobileTemplate.setMinLevel(60) + mobileTemplate.setMaxLevel(70) + mobileTemplate.setDifficulty(0) + mobileTemplate.setAttackRange(6) + mobileTemplate.setAttackSpeed(1.0) + mobileTemplate.setWeaponType(9) + mobileTemplate.setMinSpawnDistance(3) + mobileTemplate.setMaxSpawnDistance(5) + mobileTemplate.setDeathblow(False) + + templates = Vector() + templates.add('object/mobile/shared_dressed_force_sensitive_crypt_crawler.iff') + mobileTemplate.setTemplates(templates) + + weaponTemplates = Vector() + weapontemplate = WeaponTemplate('object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_gen5.iff', 9, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gen5.iff', 10, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_gen5.iff', 11, 1.0) + weaponTemplates.add(weapontemplate) + mobileTemplate.setWeaponTemplateVector(weaponTemplates) + + attacks = Vector() + mobileTemplate.setDefaultAttack('saberHit') + mobileTemplate.setAttacks(attacks) + + core.spawnService.addMobileTemplate('force_sensitive_crypt_crawler', mobileTemplate) + \ No newline at end of file diff --git a/scripts/mobiles/dantooine/force_sensitive_renegade.py b/scripts/mobiles/dantooine/force_sensitive_renegade.py new file mode 100644 index 00000000..8d3d4257 --- /dev/null +++ b/scripts/mobiles/dantooine/force_sensitive_renegade.py @@ -0,0 +1,39 @@ +import sys +from services.spawn import MobileTemplate +from services.spawn import WeaponTemplate +from java.util import Vector + +def addTemplate(core): + mobileTemplate = MobileTemplate() + + mobileTemplate.setCreatureName('force_sensitive_renegade') + mobileTemplate.setLevel(90) + mobileTemplate.setMinLevel(61) + mobileTemplate.setMaxLevel(69) + mobileTemplate.setDifficulty(0) + mobileTemplate.setAttackRange(6) + mobileTemplate.setAttackSpeed(1.0) + mobileTemplate.setWeaponType(9) + mobileTemplate.setMinSpawnDistance(4) + mobileTemplate.setMaxSpawnDistance(7) + mobileTemplate.setDeathblow(False) + + templates = Vector() + templates.add('object/mobile/shared_dressed_force_sensitive_renegade.iff') + mobileTemplate.setTemplates(templates) + + weaponTemplates = Vector() + weapontemplate = WeaponTemplate('object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_gen5.iff', 9, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gen5.iff', 10, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_gen5.iff', 11, 1.0) + weaponTemplates.add(weapontemplate) + mobileTemplate.setWeaponTemplateVector(weaponTemplates) + + attacks = Vector() + mobileTemplate.setDefaultAttack('saberHit') + mobileTemplate.setAttacks(attacks) + + core.spawnService.addMobileTemplate('force_sensitive_renegade', mobileTemplate) + \ No newline at end of file diff --git a/scripts/mobiles/dantooine/forsaken_force_drifter.py b/scripts/mobiles/dantooine/forsaken_force_drifter.py new file mode 100644 index 00000000..1fbc8e26 --- /dev/null +++ b/scripts/mobiles/dantooine/forsaken_force_drifter.py @@ -0,0 +1,37 @@ +import sys +from services.spawn import MobileTemplate +from services.spawn import WeaponTemplate +from java.util import Vector + +def addTemplate(core): + mobileTemplate = MobileTemplate() + + mobileTemplate.setCreatureName('eow_forsaken_force_drifter') + mobileTemplate.setLevel(74) + mobileTemplate.setDifficulty(0) + mobileTemplate.setAttackRange(6) + mobileTemplate.setAttackSpeed(1.0) + mobileTemplate.setWeaponType(9) + mobileTemplate.setMinSpawnDistance(3) + mobileTemplate.setMaxSpawnDistance(6) + mobileTemplate.setDeathblow(False) + + templates = Vector() + templates.add('object/mobile/shared_dressed_forsaken_force_drifter.iff') + mobileTemplate.setTemplates(templates) + + weaponTemplates = Vector() + weapontemplate = WeaponTemplate('object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_gen5.iff', 9, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gen5.iff', 10, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_gen5.iff', 11, 1.0) + weaponTemplates.add(weapontemplate) + mobileTemplate.setWeaponTemplateVector(weaponTemplates) + + attacks = Vector() + mobileTemplate.setDefaultAttack('saberHit') + mobileTemplate.setAttacks(attacks) + + core.spawnService.addMobileTemplate('forsaken_force_drifter', mobileTemplate) + \ No newline at end of file diff --git a/scripts/mobiles/dantooine/novice_force_mystic.py b/scripts/mobiles/dantooine/novice_force_mystic.py new file mode 100644 index 00000000..d7313ad5 --- /dev/null +++ b/scripts/mobiles/dantooine/novice_force_mystic.py @@ -0,0 +1,37 @@ +import sys +from services.spawn import MobileTemplate +from services.spawn import WeaponTemplate +from java.util import Vector + +def addTemplate(core): + mobileTemplate = MobileTemplate() + + mobileTemplate.setCreatureName('novice_force_mystic') + mobileTemplate.setLevel(63) + mobileTemplate.setDifficulty(0) + mobileTemplate.setAttackRange(6) + mobileTemplate.setAttackSpeed(1.0) + mobileTemplate.setWeaponType(9) + mobileTemplate.setMinSpawnDistance(4) + mobileTemplate.setMaxSpawnDistance(7) + mobileTemplate.setDeathblow(False) + + templates = Vector() + templates.add('object/mobile/shared_dressed_novice_force_mystic.iff') + mobileTemplate.setTemplates(templates) + + weaponTemplates = Vector() + weapontemplate = WeaponTemplate('object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_gen5.iff', 9, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gen5.iff', 10, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_gen5.iff', 11, 1.0) + weaponTemplates.add(weapontemplate) + mobileTemplate.setWeaponTemplateVector(weaponTemplates) + + attacks = Vector() + mobileTemplate.setDefaultAttack('saberHit') + mobileTemplate.setAttacks(attacks) + + core.spawnService.addMobileTemplate('novice_force_mystic', mobileTemplate) + \ No newline at end of file diff --git a/scripts/mobiles/dantooine/untrained_wielder_of_the_dark_side.py b/scripts/mobiles/dantooine/untrained_wielder_of_the_dark_side.py new file mode 100644 index 00000000..65f54e75 --- /dev/null +++ b/scripts/mobiles/dantooine/untrained_wielder_of_the_dark_side.py @@ -0,0 +1,39 @@ +import sys +from services.spawn import MobileTemplate +from services.spawn import WeaponTemplate +from java.util import Vector + +def addTemplate(core): + mobileTemplate = MobileTemplate() + + mobileTemplate.setCreatureName('untrained_wielder_of_the_dark_side') + mobileTemplate.setLevel(90) + mobileTemplate.setMinLevel(61) + mobileTemplate.setMaxLevel(70) + mobileTemplate.setDifficulty(0) + mobileTemplate.setAttackRange(6) + mobileTemplate.setAttackSpeed(1.0) + mobileTemplate.setWeaponType(9) + mobileTemplate.setMinSpawnDistance(4) + mobileTemplate.setMaxSpawnDistance(6) + mobileTemplate.setDeathblow(False) + + templates = Vector() + templates.add('object/mobile/shared_dressed_untrained_wielder_of_the_darkside.iff') + mobileTemplate.setTemplates(templates) + + weaponTemplates = Vector() + weapontemplate = WeaponTemplate('object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_gen5.iff', 9, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gen5.iff', 10, 1.0) + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_gen5.iff', 11, 1.0) + weaponTemplates.add(weapontemplate) + mobileTemplate.setWeaponTemplateVector(weaponTemplates) + + attacks = Vector() + mobileTemplate.setDefaultAttack('saberHit') + mobileTemplate.setAttacks(attacks) + + core.spawnService.addMobileTemplate('untrained_wielder_of_the_dark_side', mobileTemplate) + \ No newline at end of file diff --git a/scripts/mobiles/dynamicgroups/dark_jedi_wild_1.py b/scripts/mobiles/dynamicgroups/dark_jedi_wild_1.py new file mode 100644 index 00000000..3bf8c043 --- /dev/null +++ b/scripts/mobiles/dynamicgroups/dark_jedi_wild_1.py @@ -0,0 +1,18 @@ +import sys +from services.spawn import DynamicSpawnGroup +from services.spawn import MobileTemplate +from java.util import Vector + +def addDynamicGroup(core): + dynamicGroup = DynamicSpawnGroup() + mobileTemplates = Vector() + mobileTemplates.add('dark_jedi_master') + mobileTemplates.add('dark_jedi_knight') + mobileTemplates.add('dark_adept') + dynamicGroup.setMobiles(mobileTemplates) + dynamicGroup.setGroupMembersNumber(3) + dynamicGroup.setName('dark_jedi_wild_1') + dynamicGroup.setMaxSpawns(-1) + dynamicGroup.setMinSpawnDistance(150) + core.spawnService.addDynamicGroup('dark_jedi_wild_1', dynamicGroup) + return \ No newline at end of file diff --git a/scripts/mobiles/dynamicgroups/force_sensitives_wild_1.py b/scripts/mobiles/dynamicgroups/force_sensitives_wild_1.py new file mode 100644 index 00000000..9ee91b60 --- /dev/null +++ b/scripts/mobiles/dynamicgroups/force_sensitives_wild_1.py @@ -0,0 +1,20 @@ +import sys +from services.spawn import DynamicSpawnGroup +from services.spawn import MobileTemplate +from java.util import Vector + +def addDynamicGroup(core): + dynamicGroup = DynamicSpawnGroup() + mobileTemplates = Vector() + mobileTemplates.add('force_sensitive_crypt_crawler') + mobileTemplates.add('force_sensitive_renegade') + mobileTemplates.add('forsaken_force_drifter') + mobileTemplates.add('novice_force_mystic') + mobileTemplates.add('untrained_wielder_of_the_dark_side') + dynamicGroup.setMobiles(mobileTemplates) + dynamicGroup.setGroupMembersNumber(-3) + dynamicGroup.setName('force_sensitives_wild_1') + dynamicGroup.setMaxSpawns(-1) + dynamicGroup.setMinSpawnDistance(150) + core.spawnService.addDynamicGroup('force_sensitives_wild_1', dynamicGroup) + return \ No newline at end of file diff --git a/scripts/mobiles/dynamicgroups/tuskens_wild_1.py b/scripts/mobiles/dynamicgroups/tuskens_wild_1.py new file mode 100644 index 00000000..472747c0 --- /dev/null +++ b/scripts/mobiles/dynamicgroups/tuskens_wild_1.py @@ -0,0 +1,15 @@ +import sys +from services.spawn import DynamicSpawnGroup +from services.spawn import MobileTemplate +from java.util import Vector + +def addDynamicGroup(core): + dynamicGroup = DynamicSpawnGroup() + mobileTemplates = Vector() + mobileTemplates.add('tusken_raider') + dynamicGroup.setMobiles(mobileTemplates) + dynamicGroup.setName('tuskens_wild_1') + dynamicGroup.setMaxSpawns(20) + dynamicGroup.setMinSpawnDistance(25) + core.spawnService.addDynamicGroup('tuskens_wild_1', dynamicGroup) + return \ No newline at end of file diff --git a/scripts/mobiles/spawnareas/force_sensitives_dynamic_1.py b/scripts/mobiles/spawnareas/force_sensitives_dynamic_1.py new file mode 100644 index 00000000..6c7638ea --- /dev/null +++ b/scripts/mobiles/spawnareas/force_sensitives_dynamic_1.py @@ -0,0 +1,9 @@ +import sys +from java.util import Vector + +def addSpawnArea(core): + dynamicGroups = Vector() + dynamicGroups.add('force_sensitives_wild_1') + dynamicGroups.add('dark_jedi_wild_1') + core.spawnService.addDynamicSpawnArea(dynamicGroups, 4083, 5780, 2048, 'dantooine') + return \ No newline at end of file diff --git a/scripts/mobiles/spawnareas/tuskens_dynamic_1.py b/scripts/mobiles/spawnareas/tuskens_dynamic_1.py new file mode 100644 index 00000000..4d9f5915 --- /dev/null +++ b/scripts/mobiles/spawnareas/tuskens_dynamic_1.py @@ -0,0 +1,5 @@ +import sys + +def addSpawnArea(core): + core.spawnService.addDynamicSpawnArea('tuskens_wild_1', 4310, -4786, 250, 'tatooine') + return \ No newline at end of file diff --git a/scripts/object/mobile/dressed_dark_force_crystal_hunter.py b/scripts/object/mobile/dressed_dark_force_crystal_hunter.py index ccad8904..dbbb65df 100644 --- a/scripts/object/mobile/dressed_dark_force_crystal_hunter.py +++ b/scripts/object/mobile/dressed_dark_force_crystal_hunter.py @@ -1,4 +1,27 @@ import sys def setup(core, object): - return \ No newline at end of file + + lootPoolNames_1 = ['Junk'] + lootPoolChances_1 = [100] + lootGroupChance_1 = 65 + object.addToLootGroups(lootPoolNames_1,lootPoolChances_1,lootGroupChance_1) + + lootPoolNames_2 = ['jedi_relic_1'] + lootPoolChances_2 = [100] + lootGroupChance_2 = 85 + object.addToLootGroups(lootPoolNames_2,lootPoolChances_2,lootGroupChance_2) + + lootPoolNames_3 = ['colorcrystals'] + lootPoolChances_3 = [100] + lootGroupChance_3 = 12 + object.addToLootGroups(lootPoolNames_3,lootPoolChances_3,lootGroupChance_3) + + lootPoolNames_4 = ['sithholocrons'] + lootPoolChances_4 = [100] + lootGroupChance_4 = 1 + object.addToLootGroups(lootPoolNames_4,lootPoolChances_4,lootGroupChance_4) + + + + return \ No newline at end of file diff --git a/scripts/object/mobile/dressed_dark_side_savage.py b/scripts/object/mobile/dressed_dark_side_savage.py index ccad8904..70052ae4 100644 --- a/scripts/object/mobile/dressed_dark_side_savage.py +++ b/scripts/object/mobile/dressed_dark_side_savage.py @@ -1,4 +1,21 @@ import sys def setup(core, object): - return \ No newline at end of file + + lootPoolNames_1 = ['Junk'] + lootPoolChances_1 = [100] + lootGroupChance_1 = 65 + object.addToLootGroups(lootPoolNames_1,lootPoolChances_1,lootGroupChance_1) + + lootPoolNames_2 = ['jedi_relic_1'] + lootPoolChances_2 = [100] + lootGroupChance_2 = 85 + object.addToLootGroups(lootPoolNames_2,lootPoolChances_2,lootGroupChance_2) + + lootPoolNames_3 = ['colorcrystals'] + lootPoolChances_3 = [100] + lootGroupChance_3 = 12 + object.addToLootGroups(lootPoolNames_3,lootPoolChances_3,lootGroupChance_3) + + + return \ No newline at end of file diff --git a/scripts/object/mobile/dressed_force_sensitive_crypt_crawler.py b/scripts/object/mobile/dressed_force_sensitive_crypt_crawler.py index ccad8904..2c42c975 100644 --- a/scripts/object/mobile/dressed_force_sensitive_crypt_crawler.py +++ b/scripts/object/mobile/dressed_force_sensitive_crypt_crawler.py @@ -1,4 +1,27 @@ import sys def setup(core, object): - return \ No newline at end of file + + lootPoolNames_1 = ['Junk'] + lootPoolChances_1 = [100] + lootGroupChance_1 = 65 + object.addToLootGroups(lootPoolNames_1,lootPoolChances_1,lootGroupChance_1) + + lootPoolNames_2 = ['jedi_relic_1'] + lootPoolChances_2 = [100] + lootGroupChance_2 = 85 + object.addToLootGroups(lootPoolNames_2,lootPoolChances_2,lootGroupChance_2) + + lootPoolNames_3 = ['colorcrystals'] + lootPoolChances_3 = [100] + lootGroupChance_3 = 12 + object.addToLootGroups(lootPoolNames_3,lootPoolChances_3,lootGroupChance_3) + + lootPoolNames_4 = ['jediholocrons'] + lootPoolChances_4 = [100] + lootGroupChance_4 = 1 + object.addToLootGroups(lootPoolNames_4,lootPoolChances_4,lootGroupChance_4) + + + + return \ No newline at end of file diff --git a/scripts/object/mobile/dressed_force_sensitive_renegade.py b/scripts/object/mobile/dressed_force_sensitive_renegade.py index ccad8904..2c42c975 100644 --- a/scripts/object/mobile/dressed_force_sensitive_renegade.py +++ b/scripts/object/mobile/dressed_force_sensitive_renegade.py @@ -1,4 +1,27 @@ import sys def setup(core, object): - return \ No newline at end of file + + lootPoolNames_1 = ['Junk'] + lootPoolChances_1 = [100] + lootGroupChance_1 = 65 + object.addToLootGroups(lootPoolNames_1,lootPoolChances_1,lootGroupChance_1) + + lootPoolNames_2 = ['jedi_relic_1'] + lootPoolChances_2 = [100] + lootGroupChance_2 = 85 + object.addToLootGroups(lootPoolNames_2,lootPoolChances_2,lootGroupChance_2) + + lootPoolNames_3 = ['colorcrystals'] + lootPoolChances_3 = [100] + lootGroupChance_3 = 12 + object.addToLootGroups(lootPoolNames_3,lootPoolChances_3,lootGroupChance_3) + + lootPoolNames_4 = ['jediholocrons'] + lootPoolChances_4 = [100] + lootGroupChance_4 = 1 + object.addToLootGroups(lootPoolNames_4,lootPoolChances_4,lootGroupChance_4) + + + + return \ No newline at end of file diff --git a/scripts/object/mobile/dressed_forsaken_force_drifter.py b/scripts/object/mobile/dressed_forsaken_force_drifter.py index ccad8904..2c42c975 100644 --- a/scripts/object/mobile/dressed_forsaken_force_drifter.py +++ b/scripts/object/mobile/dressed_forsaken_force_drifter.py @@ -1,4 +1,27 @@ import sys def setup(core, object): - return \ No newline at end of file + + lootPoolNames_1 = ['Junk'] + lootPoolChances_1 = [100] + lootGroupChance_1 = 65 + object.addToLootGroups(lootPoolNames_1,lootPoolChances_1,lootGroupChance_1) + + lootPoolNames_2 = ['jedi_relic_1'] + lootPoolChances_2 = [100] + lootGroupChance_2 = 85 + object.addToLootGroups(lootPoolNames_2,lootPoolChances_2,lootGroupChance_2) + + lootPoolNames_3 = ['colorcrystals'] + lootPoolChances_3 = [100] + lootGroupChance_3 = 12 + object.addToLootGroups(lootPoolNames_3,lootPoolChances_3,lootGroupChance_3) + + lootPoolNames_4 = ['jediholocrons'] + lootPoolChances_4 = [100] + lootGroupChance_4 = 1 + object.addToLootGroups(lootPoolNames_4,lootPoolChances_4,lootGroupChance_4) + + + + return \ No newline at end of file diff --git a/scripts/object/mobile/dressed_gendra.py b/scripts/object/mobile/dressed_gendra.py index ccad8904..ceee905c 100644 --- a/scripts/object/mobile/dressed_gendra.py +++ b/scripts/object/mobile/dressed_gendra.py @@ -1,4 +1,10 @@ import sys +from resources.datatables import Options def setup(core, object): - return \ No newline at end of file + object.setAttachment('radial_filename', 'object/conversation'); + object.setAttachment('conversationFile','gendra') + object.setOptionsBitmask(Options.CONVERSABLE | Options.INVULNERABLE) + object.setStfFilename('mob/creature_names') + object.setStfName('newbie_gendra') + return diff --git a/scripts/object/mobile/dressed_mayor_mikdanyell_guhrantt.py b/scripts/object/mobile/dressed_mayor_mikdanyell_guhrantt.py index ccad8904..e8e3da38 100644 --- a/scripts/object/mobile/dressed_mayor_mikdanyell_guhrantt.py +++ b/scripts/object/mobile/dressed_mayor_mikdanyell_guhrantt.py @@ -1,4 +1,10 @@ import sys +from resources.datatables import Options def setup(core, object): - return \ No newline at end of file + object.setAttachment('radial_filename', 'object/conversation'); + object.setAttachment('conversationFile','mayor_mikdanyel_guhrantt') + object.setOptionsBitmask(Options.CONVERSABLE | Options.INVULNERABLE) + object.setStfFilename('mob/creature_names') + object.setStfName('mos_eisley_mayor') + return diff --git a/scripts/object/mobile/dressed_novice_force_mystic.py b/scripts/object/mobile/dressed_novice_force_mystic.py index ccad8904..2c42c975 100644 --- a/scripts/object/mobile/dressed_novice_force_mystic.py +++ b/scripts/object/mobile/dressed_novice_force_mystic.py @@ -1,4 +1,27 @@ import sys def setup(core, object): - return \ No newline at end of file + + lootPoolNames_1 = ['Junk'] + lootPoolChances_1 = [100] + lootGroupChance_1 = 65 + object.addToLootGroups(lootPoolNames_1,lootPoolChances_1,lootGroupChance_1) + + lootPoolNames_2 = ['jedi_relic_1'] + lootPoolChances_2 = [100] + lootGroupChance_2 = 85 + object.addToLootGroups(lootPoolNames_2,lootPoolChances_2,lootGroupChance_2) + + lootPoolNames_3 = ['colorcrystals'] + lootPoolChances_3 = [100] + lootGroupChance_3 = 12 + object.addToLootGroups(lootPoolNames_3,lootPoolChances_3,lootGroupChance_3) + + lootPoolNames_4 = ['jediholocrons'] + lootPoolChances_4 = [100] + lootGroupChance_4 = 1 + object.addToLootGroups(lootPoolNames_4,lootPoolChances_4,lootGroupChance_4) + + + + return \ No newline at end of file diff --git a/scripts/object/mobile/dressed_tatooine_opening_byxle.py b/scripts/object/mobile/dressed_tatooine_opening_byxle.py index ccad8904..a9115a52 100644 --- a/scripts/object/mobile/dressed_tatooine_opening_byxle.py +++ b/scripts/object/mobile/dressed_tatooine_opening_byxle.py @@ -1,4 +1,10 @@ import sys +from resources.datatables import Options def setup(core, object): - return \ No newline at end of file + object.setAttachment('radial_filename', 'object/conversation'); + object.setAttachment('conversationFile','byxle') + object.setOptionsBitmask(Options.CONVERSABLE | Options.INVULNERABLE) + object.setStfFilename('mob/creature_names') + object.setStfName('tatooine_opening_byxle') + return diff --git a/scripts/object/mobile/dressed_tatooine_opening_dunir.py b/scripts/object/mobile/dressed_tatooine_opening_dunir.py index ccad8904..f9d28082 100644 --- a/scripts/object/mobile/dressed_tatooine_opening_dunir.py +++ b/scripts/object/mobile/dressed_tatooine_opening_dunir.py @@ -1,4 +1,10 @@ import sys +from resources.datatables import Options def setup(core, object): - return \ No newline at end of file + object.setAttachment('radial_filename', 'object/conversation'); + object.setAttachment('conversationFile','durni') + object.setOptionsBitmask(Options.CONVERSABLE | Options.INVULNERABLE) + object.setStfFilename('mob/creature_names') + object.setStfName('tatooine_opening_dunir') + return diff --git a/scripts/object/mobile/dressed_tatooine_opening_niko.py b/scripts/object/mobile/dressed_tatooine_opening_niko.py index ccad8904..bb8c0ab4 100644 --- a/scripts/object/mobile/dressed_tatooine_opening_niko.py +++ b/scripts/object/mobile/dressed_tatooine_opening_niko.py @@ -1,4 +1,10 @@ import sys +from resources.datatables import Options def setup(core, object): - return \ No newline at end of file + object.setAttachment('radial_filename', 'object/conversation'); + object.setAttachment('conversationFile','niko') + object.setOptionsBitmask(Options.CONVERSABLE | Options.INVULNERABLE) + object.setStfFilename('mob/creature_names') + object.setStfName('tatooine_opening_niko') + return diff --git a/scripts/object/mobile/dressed_tatooine_opening_reimos.py b/scripts/object/mobile/dressed_tatooine_opening_reimos.py index ccad8904..2b2075d4 100644 --- a/scripts/object/mobile/dressed_tatooine_opening_reimos.py +++ b/scripts/object/mobile/dressed_tatooine_opening_reimos.py @@ -1,4 +1,10 @@ import sys +from resources.datatables import Options def setup(core, object): - return \ No newline at end of file + object.setAttachment('radial_filename', 'object/conversation'); + object.setAttachment('conversationFile','reimos') + object.setOptionsBitmask(Options.CONVERSABLE | Options.INVULNERABLE) + object.setStfFilename('mob/creature_names') + object.setStfName('tatooine_opening_reimos') + return diff --git a/scripts/object/mobile/dressed_tatooine_opening_toggi.py b/scripts/object/mobile/dressed_tatooine_opening_toggi.py index ccad8904..ee3d1ccf 100644 --- a/scripts/object/mobile/dressed_tatooine_opening_toggi.py +++ b/scripts/object/mobile/dressed_tatooine_opening_toggi.py @@ -1,4 +1,10 @@ import sys +from resources.datatables import Options def setup(core, object): - return \ No newline at end of file + object.setAttachment('radial_filename', 'object/conversation'); + object.setAttachment('conversationFile','toggi') + object.setOptionsBitmask(Options.CONVERSABLE | Options.INVULNERABLE) + object.setStfFilename('mob/creature_names') + object.setStfName('tatooine_opening_toggi') + return diff --git a/scripts/object/mobile/dressed_untrained_wielder_of_the_darkside.py b/scripts/object/mobile/dressed_untrained_wielder_of_the_darkside.py index ccad8904..dbbb65df 100644 --- a/scripts/object/mobile/dressed_untrained_wielder_of_the_darkside.py +++ b/scripts/object/mobile/dressed_untrained_wielder_of_the_darkside.py @@ -1,4 +1,27 @@ import sys def setup(core, object): - return \ No newline at end of file + + lootPoolNames_1 = ['Junk'] + lootPoolChances_1 = [100] + lootGroupChance_1 = 65 + object.addToLootGroups(lootPoolNames_1,lootPoolChances_1,lootGroupChance_1) + + lootPoolNames_2 = ['jedi_relic_1'] + lootPoolChances_2 = [100] + lootGroupChance_2 = 85 + object.addToLootGroups(lootPoolNames_2,lootPoolChances_2,lootGroupChance_2) + + lootPoolNames_3 = ['colorcrystals'] + lootPoolChances_3 = [100] + lootGroupChance_3 = 12 + object.addToLootGroups(lootPoolNames_3,lootPoolChances_3,lootGroupChance_3) + + lootPoolNames_4 = ['sithholocrons'] + lootPoolChances_4 = [100] + lootGroupChance_4 = 1 + object.addToLootGroups(lootPoolNames_4,lootPoolChances_4,lootGroupChance_4) + + + + return \ No newline at end of file diff --git a/scripts/object/mobile/space_privateer_tier1_tatooine.py b/scripts/object/mobile/space_privateer_tier1_tatooine.py index ccad8904..b0f81354 100644 --- a/scripts/object/mobile/space_privateer_tier1_tatooine.py +++ b/scripts/object/mobile/space_privateer_tier1_tatooine.py @@ -1,4 +1,9 @@ import sys +from resources.datatables import Options def setup(core, object): - return \ No newline at end of file + #object.setAttachment('radial_filename', 'object/conversation'); + #object.setAttachment('conversationFile','imp_recruiter') + object.setOptionsBitmask(Options.INVULNERABLE) + object.setCustomName('Dravis') + return diff --git a/scripts/object/mobile/space_privateer_tier2_shamdon.py b/scripts/object/mobile/space_privateer_tier2_shamdon.py index ccad8904..f30504b0 100644 --- a/scripts/object/mobile/space_privateer_tier2_shamdon.py +++ b/scripts/object/mobile/space_privateer_tier2_shamdon.py @@ -1,4 +1,9 @@ import sys +from resources.datatables import Options def setup(core, object): - return \ No newline at end of file + #object.setAttachment('radial_filename', 'object/conversation'); + #object.setAttachment('conversationFile','imp_recruiter') + object.setOptionsBitmask(Options.INVULNERABLE) + object.setCustomName('Shamdon Kree ') + return diff --git a/scripts/skillMods/strength_modified.py b/scripts/skillMods/strength_modified.py index 45ac9940..469cc568 100644 --- a/scripts/skillMods/strength_modified.py +++ b/scripts/skillMods/strength_modified.py @@ -4,7 +4,7 @@ def add(core, actor, skillMod, divisor): core.skillModService.addSkillMod(actor, 'display_only_block', skillMod.getBase() / 2) return -def deduct(core, actor, name, base): +def deduct(core, actor, skillMod, divisor): core.skillModService.deductSkillMod(actor, 'display_only_block', skillMod.getBase() / 2) return \ No newline at end of file diff --git a/src/services/DevService.java b/src/services/DevService.java index 270587d7..8f3822bb 100644 --- a/src/services/DevService.java +++ b/src/services/DevService.java @@ -31,7 +31,6 @@ 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; @@ -79,7 +78,6 @@ public class DevService implements INetworkDispatch { 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, "Armor"); @@ -92,6 +90,7 @@ public class DevService implements INetworkDispatch { if(creature.getClient().isGM()) suiOptions.put((long) 125, "Crafting Tools"); if(creature.getClient().isGM()) suiOptions.put((long) 130, "Vehicle Deeds"); if(creature.getClient().isGM()) suiOptions.put((long) 121, "Sandbox City"); + if(creature.getClient().isGM()) suiOptions.put((long) 122, "Jedi Ruins"); break; case 3: // [Items] Weapons @@ -171,18 +170,7 @@ public class DevService implements INetworkDispatch { 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: // Armor sendCharacterBuilderSUI(player, 5); @@ -1180,6 +1168,10 @@ public class DevService implements INetworkDispatch { case 121: NGECore.getInstance().playerCityService.buildSandboxTestCity(player); + + case 122: + Point3D position = new Point3D(4086,15,5554); + core.simulationService.transferToPlanet(player, core.terrainService.getPlanetByName("dantooine"), position, player.getOrientation(), null); case 125: TangibleObject genericCraftingTool = (TangibleObject) core.objectService.createObject("object/tangible/crafting/station/shared_generic_tool.iff", planet); diff --git a/src/services/LoginService.java b/src/services/LoginService.java index 5f72c715..bad84964 100644 --- a/src/services/LoginService.java +++ b/src/services/LoginService.java @@ -26,6 +26,7 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Map; +import java.util.Properties; import java.util.Random; import java.util.concurrent.ScheduledExecutorService; @@ -42,7 +43,6 @@ import engine.resources.service.INetworkDispatch; import engine.resources.service.INetworkRemoteEvent; import engine.resources.service.LocalDbLoginProvider; import engine.resources.service.VBLoginProvider; - import protocol.swg.CharacterCreationDisabled; import protocol.swg.ClientUIErrorMessage; import protocol.swg.DeleteCharacterMessage; @@ -56,7 +56,6 @@ import protocol.swg.ServerNowEpochTime; import protocol.swg.StationIdHasJediSlot; import resources.common.*; import resources.datatables.PlayerFlags; - import resources.objects.creature.CreatureObject; @SuppressWarnings("unused") @@ -206,7 +205,12 @@ public class LoginService implements INetworkDispatch{ core.objectService.destroyObject(object); } - core.getSWGObjectODB().remove(object.getObjectID()); + try { + core.getSWGObjectODB().remove(object.getObjectID()); + } catch (Exception e) { + + } + DeleteCharacterReplyMessage reply = new DeleteCharacterReplyMessage(0); session.write(reply.serialize()); } @@ -224,7 +228,16 @@ public class LoginService implements INetworkDispatch{ } public boolean checkForGmPermission(int id) { + try { + if (core.getConfig().getInt("ADMIN") > 0) { + return true; + } + } catch (Exception e) { + + } + PreparedStatement preparedStatement; + try { preparedStatement = databaseConnection1.preparedStatement("SELECT * FROM accounts WHERE id=" + id + ""); ResultSet resultSet = preparedStatement.executeQuery(); @@ -233,6 +246,7 @@ public class LoginService implements INetworkDispatch{ } catch (SQLException e) { e.printStackTrace(); } + return false; } diff --git a/src/services/SimulationService.java b/src/services/SimulationService.java index fd7608b8..3cc57365 100644 --- a/src/services/SimulationService.java +++ b/src/services/SimulationService.java @@ -763,6 +763,8 @@ public class SimulationService implements INetworkDispatch { if(object.getAttachment("proposer") != null) object.setAttachment("proposer", null); + object.setPvPBitmask(0); + //session.suspendWrite(); final long objectId = object.getObjectID(); diff --git a/src/services/command/CommandService.java b/src/services/command/CommandService.java index cf14b35a..c778a25f 100644 --- a/src/services/command/CommandService.java +++ b/src/services/command/CommandService.java @@ -91,9 +91,9 @@ public class CommandService implements INetworkDispatch { return false; } - WeaponObject weapon = (WeaponObject) core.objectService.getObject(actor.getWeaponId()); + TangibleObject weapon = (TangibleObject) core.objectService.getObject(actor.getWeaponId()); - if (weapon != null && weapon.getWeaponType() == command.getInvalidWeapon()) { + if (weapon != null && weapon instanceof WeaponObject && ((WeaponObject) weapon).getWeaponType() == command.getInvalidWeapon()) { return false; } diff --git a/src/services/housing/HousingService.java b/src/services/housing/HousingService.java index 34bdb205..2b092b6f 100644 --- a/src/services/housing/HousingService.java +++ b/src/services/housing/HousingService.java @@ -154,15 +154,17 @@ public class HousingService implements INetworkDispatch { // Check for city founders joining a new city PlayerCity cityActorIsIn = core.playerCityService.getCityObjectIsIn(actor); - actor.setAttachment("Has24HZoningFor",cityActorIsIn.getCityID()); // for testing - - int cityActorHasZoning = (int)actor.getAttachment("Has24HZoningFor"); - if (cityActorIsIn!=null && cityActorHasZoning==cityActorIsIn.getCityID()){ - if (! cityActorIsIn.getCitizens().contains(actor.getObjectID())){ - building.setAttachment("structureCity", cityActorIsIn.getCityID()); - // actor.setAttachment("residentCity", cityActorIsIn.getCityID()); He must do it manually - cityActorIsIn.addCitizen(actor.getObjectID()); - cityActorIsIn.addNewStructure(building.getObjectID()); + if (cityActorIsIn!=null){ + actor.setAttachment("Has24HZoningFor",cityActorIsIn.getCityID()); // for testing + + int cityActorHasZoning = (int)actor.getAttachment("Has24HZoningFor"); + if (cityActorIsIn!=null && cityActorHasZoning==cityActorIsIn.getCityID()){ + if (! cityActorIsIn.getCitizens().contains(actor.getObjectID())){ + building.setAttachment("structureCity", cityActorIsIn.getCityID()); + // actor.setAttachment("residentCity", cityActorIsIn.getCityID()); He must do it manually + cityActorIsIn.addCitizen(actor.getObjectID()); + cityActorIsIn.addNewStructure(building.getObjectID()); + } } } diff --git a/src/services/object/ObjectService.java b/src/services/object/ObjectService.java index b9453038..56f6a8ae 100644 --- a/src/services/object/ObjectService.java +++ b/src/services/object/ObjectService.java @@ -524,6 +524,9 @@ public class ObjectService implements INetworkDispatch { } public SWGObject getObjectByCustomName(String customName) { + if (customName == null) { + return null; + } synchronized(objectList) { @@ -538,19 +541,27 @@ public class ObjectService implements INetworkDispatch { ODBCursor cursor = core.getSWGObjectODB().getCursor(); - while(cursor.hasNext()) { - if(((SWGObject) cursor.next()).getCustomName().equals(customName)) - return (SWGObject) cursor.next(); + while (cursor.hasNext()) { + SWGObject object = (SWGObject) cursor.next(); + + if (object == null) { + continue; + } + + if (object.getCustomName() != null && customName.length() > 0 && object.getCustomName().equals(customName)) { + return object; + } } - + return null; - } public SWGObject getObjectByFirstName(String customName) { + if (customName == null) { + return null; + } synchronized(objectList) { - for(SWGObject obj : objectList.values()) { if(obj.getCustomName() == null) continue; @@ -562,13 +573,19 @@ public class ObjectService implements INetworkDispatch { ODBCursor cursor = core.getSWGObjectODB().getCursor(); - while(cursor.hasNext()) { - if(((SWGObject) cursor.next()).getCustomName().startsWith(customName)) - return (SWGObject) cursor.next(); + while (cursor.hasNext()) { + SWGObject object = (SWGObject) cursor.next(); + + if (object == null) { + continue; + } + + if (object.getCustomName() != null && customName.length() > 0 && object.getCustomName().startsWith(customName)) { + return object; + } } - + return null; - } public CreatureObject getCreatureFromDB(long objectId) { diff --git a/src/services/spawn/DynamicSpawnArea.java b/src/services/spawn/DynamicSpawnArea.java index b47c9a65..388195c6 100644 --- a/src/services/spawn/DynamicSpawnArea.java +++ b/src/services/spawn/DynamicSpawnArea.java @@ -21,6 +21,7 @@ ******************************************************************************/ package services.spawn; +import java.util.Collections; import java.util.Iterator; import java.util.Random; import java.util.Vector; @@ -42,17 +43,23 @@ import engine.resources.scene.Point3D; public class DynamicSpawnArea extends SpawnArea { private DynamicSpawnGroup spawnGroup; + private Vector spawnGroups; private Vector mobiles = new Vector(); public DynamicSpawnArea(Planet planet, AbstractCollidable area, DynamicSpawnGroup spawnGroup) { super(planet, area); this.spawnGroup = spawnGroup; } + + public DynamicSpawnArea(Planet planet, AbstractCollidable area, Vector spawnGroups) { + super(planet, area); + this.spawnGroups = spawnGroups; + } @Override @Handler public void onEnter(EnterEvent event) { - + SWGObject object = event.object; if(object == null || !(object instanceof CreatureObject)) @@ -65,8 +72,35 @@ public class DynamicSpawnArea extends SpawnArea { creature.getEventBus().subscribe(this); // spawn some creatures - for(int i = 0; i < 5; i++) - spawnCreature(creature); + if (spawnGroups==null){ + if (spawnGroup.getGroupMembersNumber()==-1){ + for(int i = 0; i < 5; i++) + spawnCreature(creature); + } else { + Vector groupMembers = new Vector(); + Point3D randomGroupPosition = getRandomPosition(creature.getWorldPosition(), 32, 100); + for(int i = 0; i < spawnGroup.getGroupMembersNumber(); i++) {// A group with a specified number of members + CreatureObject spawnedCreature = spawnCreatureMember(creature, groupMembers, randomGroupPosition, i); + if (spawnedCreature!=null) + groupMembers.add(spawnedCreature); + } + } + } else { + // select randomly one of the spawngroups -> minimizes number of collidables for areas with multiple different NPC groups + // One spawnarea -> many NPC groups + int index = new Random().nextInt(spawnGroups.size()); + this.spawnGroup = spawnGroups.get(index); + Vector groupMembers = new Vector(); + Point3D randomGroupPosition = getRandomPosition(creature.getWorldPosition(), 32, 100); + int spawnCount = spawnGroup.getGroupMembersNumber(); + if (spawnCount<0) + spawnCount = Math.abs(spawnCount) + new Random().nextInt(spawnGroup.getMobiles().size()-Math.abs(spawnCount)); + for(int i = 0; i < spawnCount; i++) {// A group with a specified or random number of members + CreatureObject spawnedCreature = spawnCreatureMember(creature, groupMembers, randomGroupPosition, i); + if (spawnedCreature!=null) + groupMembers.add(spawnedCreature); + } + } } @@ -100,26 +134,62 @@ public class DynamicSpawnArea extends SpawnArea { if(creature.getSlottedObject("ghost") == null) return; - - if(new Random().nextFloat() <= 0.25) - spawnCreature(creature); + + if (spawnGroups==null){ + if (spawnGroup.getGroupMembersNumber()==-1){ + if(new Random().nextFloat() <= 0.25) + spawnCreature(creature); + } else + { + Vector groupMembers = new Vector(); + Point3D randomGroupPosition = getRandomPosition(creature.getWorldPosition(), 32, 100); + for(int i = 0; i < spawnGroup.getGroupMembersNumber(); i++) {// A group with a specified number of members + CreatureObject spawnedCreature = spawnCreatureMember(creature, groupMembers, randomGroupPosition, i); + if (spawnedCreature!=null) + groupMembers.add(spawnedCreature); + } + } + } else { + // select randomly one of the spawngroups -> minimizes number of collidables for areas with multiple different NPC groups + // One spawnarea -> many NPC groups + int index = new Random().nextInt(spawnGroups.size()); + this.spawnGroup = spawnGroups.get(index); + Vector groupMembers = new Vector(); + Point3D randomGroupPosition = getRandomPosition(creature.getWorldPosition(), 32, 100); + int spawnCount = spawnGroup.getGroupMembersNumber(); + if (spawnCount<0) + spawnCount = Math.abs(spawnCount) + new Random().nextInt(spawnGroup.getMobiles().size()-Math.abs(spawnCount)); + for(int i = 0; i < spawnCount; i++) {// A group with a specified or random number of members + CreatureObject spawnedCreature = spawnCreatureMember(creature, groupMembers, randomGroupPosition, i); + if (spawnedCreature!=null) + groupMembers.add(spawnedCreature); + } + } } private void spawnCreature(CreatureObject creature) { - + NGECore core = NGECore.getInstance(); - Iterator it = mobiles.iterator(); - it.forEachRemaining(mobile -> { - if(mobile.getPosture() == Posture.Dead) - it.remove(); - }); +// Iterator it = mobiles.iterator(); // This stops further execution of this method for some reason +// it.forEachRemaining(mobile -> { +// if(mobile.getPosture() == Posture.Dead) +// it.remove(); +// }); + + mobiles.removeAll(Collections.singleton(null)); + Vector removers = new Vector(); + for (CreatureObject ob : mobiles){ + if (ob.getPosture() == Posture.Dead) + removers.add(ob); + } + mobiles.removeAll(removers); if(mobiles.size() >= spawnGroup.getMaxSpawns()) return; - + boolean foundPos = false; int tries = 0; Point3D randomPosition = null; @@ -136,10 +206,12 @@ public class DynamicSpawnArea extends SpawnArea { float height = terrainSvc.getHeight(getPlanet().getID(), randomPosition.x, randomPosition.z); randomPosition.y = height; - for(CreatureObject mobile : mobiles) { - if(mobile.getWorldPosition().getDistance(randomPosition) > spawnGroup.getMinSpawnDistance()) - foundPos = true; - } + if (mobiles.size()>0){ // Fix, mobiles must be filled first, before doing this check + for(CreatureObject mobile : mobiles) { + if(mobile.getWorldPosition().getDistance(randomPosition) > spawnGroup.getMinSpawnDistance()) + foundPos = true; + } + } else {foundPos = true;} if(!terrainSvc.canBuildAtPosition(creature, randomPosition.x, randomPosition.z)) foundPos = false; @@ -153,9 +225,86 @@ public class DynamicSpawnArea extends SpawnArea { String mobileTemplate = spawnGroup.getMobiles().get(random.nextInt(spawnGroup.getMobiles().size())); CreatureObject spawnedCreature = core.spawnService.spawnCreature(mobileTemplate, getPlanet().getName(), 0, randomPosition.x, randomPosition.y, randomPosition.z); - if(spawnedCreature != null) + if(spawnedCreature != null){ mobiles.add(spawnedCreature); + } } + + + private CreatureObject spawnCreatureMember(CreatureObject creature, Vector groupMembers, Point3D randomGroupPosition, int spawnIndex) { + NGECore core = NGECore.getInstance(); + +// Iterator it = mobiles.iterator(); // This stops further execution of this method for some reason +// it.forEachRemaining(mobile -> { +// if(mobile.getPosture() == Posture.Dead) +// it.remove(); +// }); + + mobiles.removeAll(Collections.singleton(null)); + Vector removers = new Vector(); + for (CreatureObject ob : mobiles){ + if (ob.getPosture() == Posture.Dead) + removers.add(ob); + } + mobiles.removeAll(removers); + +// if(mobiles.size() >= spawnGroup.getMaxSpawns()) +// return; + + boolean foundPos = false; + int tries = 0; + Point3D randomPosition = null; + String template = spawnGroup.getMobiles().get(spawnIndex); + MobileTemplate mobileTemplate = NGECore.getInstance().spawnService.getMobileTemplate(template); + if (mobileTemplate==null){ + System.out.println("mobileTemplate==null"); + return null; + } + + while(!foundPos && ++tries < 30) { + + randomPosition = getRandomPosition(randomGroupPosition, mobileTemplate.getMinSpawnDistance(), mobileTemplate.getMaxSpawnDistance()); + + if(randomPosition == null){ + System.out.println("randomPosition == null"); + return null; + } + + TerrainService terrainSvc = core.terrainService; + + float height = terrainSvc.getHeight(getPlanet().getID(), randomPosition.x, randomPosition.z); + randomPosition.y = height; + + if (mobiles.size()>0){ // Fix, mobiles must be filled first, before doing this check + boolean minDistViolated = false; + for(CreatureObject mobile : mobiles) { + if(mobile.getWorldPosition().getDistance(randomPosition) < spawnGroup.getMinSpawnDistance() && ! groupMembers.contains(mobile)){ + minDistViolated = true; // Distance to other nearby groups + } + } + if (minDistViolated) + foundPos = false; + else + foundPos = true; + } else {foundPos = true;} + + if(!terrainSvc.canBuildAtPosition(creature, randomPosition.x, randomPosition.z)) + foundPos = false; + + } + + if(!foundPos){ + return null; + } + + + CreatureObject spawnedCreature = core.spawnService.spawnCreature(template, getPlanet().getName(), 0, randomPosition.x, randomPosition.y, randomPosition.z); + if(spawnedCreature != null){ + mobiles.add(spawnedCreature); + } + + return spawnedCreature; + } } diff --git a/src/services/spawn/DynamicSpawnGroup.java b/src/services/spawn/DynamicSpawnGroup.java index a29f6ae2..da3df12e 100644 --- a/src/services/spawn/DynamicSpawnGroup.java +++ b/src/services/spawn/DynamicSpawnGroup.java @@ -29,6 +29,7 @@ public class DynamicSpawnGroup { private String name; private int maxSpawns; private int minSpawnDistance; + private int groupMembersNumber = -1; public Vector getMobiles() { return mobiles; @@ -61,5 +62,13 @@ public class DynamicSpawnGroup { public void setMinSpawnDistance(int minSpawnDistance) { this.minSpawnDistance = minSpawnDistance; } + + public int getGroupMembersNumber() { + return groupMembersNumber; + } + + public void setGroupMembersNumber(int groupMembersNumber) { + this.groupMembersNumber = groupMembersNumber; + } } diff --git a/src/services/spawn/MobileTemplate.java b/src/services/spawn/MobileTemplate.java index 92f19f75..7f02ff25 100644 --- a/src/services/spawn/MobileTemplate.java +++ b/src/services/spawn/MobileTemplate.java @@ -32,6 +32,8 @@ public class MobileTemplate { private int optionBitmask = Options.ATTACKABLE; private int pvpBitmask = PvpStatus.Attackable; private short level; + private short minLevel; + private short maxLevel; private Vector attacks; private String defaultAttack; private int minDamage = 0; @@ -46,6 +48,9 @@ public class MobileTemplate { private int attackRange; private Vector weaponTemplates = new Vector(); private Vector weaponTemplateVector = new Vector(); + private int minSpawnDistance = 0; + private int maxSpawnDistance = 0; + private boolean deathblow = false; public Vector getTemplates() { return templates; @@ -190,4 +195,44 @@ public class MobileTemplate { public void setWeaponTemplateVector(Vector weaponTemplateVector) { this.weaponTemplateVector = weaponTemplateVector; } + + public int getMinSpawnDistance() { + return minSpawnDistance; + } + + public void setMinSpawnDistance(int minSpawnDistance) { + this.minSpawnDistance = minSpawnDistance; + } + + public int getMaxSpawnDistance() { + return maxSpawnDistance; + } + + public void setMaxSpawnDistance(int maxSpawnDistance) { + this.maxSpawnDistance = maxSpawnDistance; + } + + public short getMinLevel() { + return minLevel; + } + + public void setMinLevel(short minLevel) { + this.minLevel = minLevel; + } + + public short getMaxLevel() { + return maxLevel; + } + + public void setMaxLevel(short maxLevel) { + this.maxLevel = maxLevel; + } + + public boolean isDeathblow() { + return deathblow; + } + + public void setDeathblow(boolean deathblow) { + this.deathblow = deathblow; + } } diff --git a/src/services/spawn/SpawnService.java b/src/services/spawn/SpawnService.java index b388cd47..4008156d 100644 --- a/src/services/spawn/SpawnService.java +++ b/src/services/spawn/SpawnService.java @@ -107,10 +107,19 @@ public class SpawnService { creature.setHeight(mobileTemplate.getScale()); int difficulty = mobileTemplate.getDifficulty(); creature.setDifficulty((byte) difficulty); + if(level != -1) creature.setLevel(level); - else - creature.setLevel(mobileTemplate.getLevel()); + else { + creature.setLevel(mobileTemplate.getLevel()); + level = mobileTemplate.getLevel(); + } + + if (mobileTemplate.getMinLevel()!=0 && mobileTemplate.getMaxLevel()!=0){ + level = (short) (mobileTemplate.getMinLevel() + (new Random().nextInt(mobileTemplate.getMaxLevel()-mobileTemplate.getMinLevel()))); + creature.setLevel(level); + } + //WeaponObject defaultWeapon = (mobileTemplate.getWeaponTemplates().size() > 0) ? (WeaponObject) core.objectService.createObject(mobileTemplate.getWeaponTemplates().get(new Random().nextInt(mobileTemplate.getWeaponTemplates().size())), creature.getPlanet()) : (WeaponObject) core.objectService.createObject("object/weapon/creature/shared_creature_default_weapon.iff", creature.getPlanet()); @@ -172,6 +181,7 @@ public class SpawnService { creature.setMaxAction((int) (400 + level * 134)); creature.setAction((int) (400 + level * 134)); } else { + System.out.println("HERE"); creature.setMaxHealth(customHealth); creature.setHealth(customHealth); creature.setMaxAction((int) (level * 128)); @@ -252,7 +262,8 @@ public class SpawnService { FileVisitor fv = new SimpleFileVisitor() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - if(!file.toString().contains("lairs") && !file.toString().contains("spawnareas") && !file.toString().contains("lairgroups")) + if(!file.toString().contains("lairs") && !file.toString().contains("spawnareas") + && !file.toString().contains("lairgroups") && !file.toString().contains("dynamicgroups")) core.scriptService.callScript(file.toString().replace(file.getFileName().toString(), ""), file.getFileName().toString().replace(".py", ""), "addTemplate", core); return FileVisitResult.CONTINUE; } @@ -357,7 +368,7 @@ public class SpawnService { } public void addDynamicSpawnArea(String dynamicGroup, float x, float z, float radius, String planetName) { - DynamicSpawnGroup dynamicGroupTemplate = dynamicGroupTemplates .get(dynamicGroup); + DynamicSpawnGroup dynamicGroupTemplate = dynamicGroupTemplates.get(dynamicGroup); Planet planet = core.terrainService.getPlanetByName(planetName); if(dynamicGroupTemplate == null || planet == null) return; @@ -366,7 +377,32 @@ public class SpawnService { spawnAreas.get(planet).add(dynamicSpawnArea); core.simulationService.addCollidable(collidableCircle, x, z); } + + public void addDynamicSpawnArea(Vector dynamicGroups, float x, float z, float radius, String planetName) { + Vector dynamicSpawnGroups = new Vector(); + for (String template : dynamicGroups){ + if (dynamicGroupTemplates.get(template)==null){ + System.err.println("Dynamic Group template " + template +" not found in spawnservice collection!"); + return; + } + dynamicSpawnGroups.add(dynamicGroupTemplates.get(template)); + } + + Planet planet = core.terrainService.getPlanetByName(planetName); + if(dynamicSpawnGroups == null || dynamicSpawnGroups.size() == 0 || planet == null) + return; + CollidableCircle collidableCircle = new CollidableCircle(new Point3D(x, 0, z), radius, planet); + DynamicSpawnArea dynamicSpawnArea = new DynamicSpawnArea(planet, collidableCircle, dynamicSpawnGroups); + spawnAreas.get(planet).add(dynamicSpawnArea); + core.simulationService.addCollidable(collidableCircle, x, z); + } - + public Map getMobileTemplates() { + return mobileTemplates; + } + + public MobileTemplate getMobileTemplate(String template) { + return mobileTemplates.get(template); + } }