diff --git a/scripts/faction/aakuans.py b/scripts/faction/aakuans.py new file mode 100644 index 00000000..a8fc0c39 --- /dev/null +++ b/scripts/faction/aakuans.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'fed_dub' or enemy == 'binayre' or enemy == 'liberation_party': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/afarathu.py b/scripts/faction/afarathu.py new file mode 100644 index 00000000..80a24805 --- /dev/null +++ b/scripts/faction/afarathu.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'corsec': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/alkhara.py b/scripts/faction/alkhara.py new file mode 100644 index 00000000..3553adcd --- /dev/null +++ b/scripts/faction/alkhara.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'tusken_raider': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/bandit.py b/scripts/faction/bandit.py new file mode 100644 index 00000000..bd97f757 --- /dev/null +++ b/scripts/faction/bandit.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'townsperson': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/beldonnas_league.py b/scripts/faction/beldonnas_league.py new file mode 100644 index 00000000..c15dab6d --- /dev/null +++ b/scripts/faction/beldonnas_league.py @@ -0,0 +1,11 @@ +import sys + +def isAlly(ally): + if ally == 'corsec': + return 1 + return 0 + +def isEnemy(enemy): + if enemy == 'followers_of_lord_nyax' or enemy == 'lost_aqualish': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/binayre.py b/scripts/faction/binayre.py new file mode 100644 index 00000000..5eb7703b --- /dev/null +++ b/scripts/faction/binayre.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'fed_dub' or enemy == 'aakuans' or enemy == 'corsec': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/bloodrazor.py b/scripts/faction/bloodrazor.py new file mode 100644 index 00000000..78220da0 --- /dev/null +++ b/scripts/faction/bloodrazor.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'canyon_corsair' or enemy == 'nym': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/borvo.py b/scripts/faction/borvo.py new file mode 100644 index 00000000..1dfa01f8 --- /dev/null +++ b/scripts/faction/borvo.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'gungan' or enemy == 'trade_federation' or enemy == 'jabba': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/canyon_corsair.py b/scripts/faction/canyon_corsair.py new file mode 100644 index 00000000..f978debe --- /dev/null +++ b/scripts/faction/canyon_corsair.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'bloodrazor' or enemy == 'nym': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/cobral.py b/scripts/faction/cobral.py new file mode 100644 index 00000000..139fe6a1 --- /dev/null +++ b/scripts/faction/cobral.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'restuss': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/cor_swoop.py b/scripts/faction/cor_swoop.py new file mode 100644 index 00000000..7d2ffab5 --- /dev/null +++ b/scripts/faction/cor_swoop.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'smashball': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/corsec.py b/scripts/faction/corsec.py new file mode 100644 index 00000000..30ca26bf --- /dev/null +++ b/scripts/faction/corsec.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'afarathu' or enemy == 'followers_of_lord_nyax' or enemy == 'beldonnas_league' or enemy == 'monumenter' or enemy == 'rogue_corsec' or enemy == 'lost_aqualish': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/dantari_raiders.py b/scripts/faction/dantari_raiders.py new file mode 100644 index 00000000..f1dd456b --- /dev/null +++ b/scripts/faction/dantari_raiders.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'kunga_tribe' or enemy == 'mokk_tribe' or enemy == 'janta_tribe': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/desert_demon.py b/scripts/faction/desert_demon.py new file mode 100644 index 00000000..9dd1a4d4 --- /dev/null +++ b/scripts/faction/desert_demon.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'swoop': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/donkuwah_tribe.py b/scripts/faction/donkuwah_tribe.py new file mode 100644 index 00000000..6db0ca51 --- /dev/null +++ b/scripts/faction/donkuwah_tribe.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'gondula_tribe' or enemy == 'panshee_tribe': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/drall.py b/scripts/faction/drall.py new file mode 100644 index 00000000..5059caaf --- /dev/null +++ b/scripts/faction/drall.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'corsec' or enemy == 'fed_dub': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/endor_marauder.py b/scripts/faction/endor_marauder.py new file mode 100644 index 00000000..6db0ca51 --- /dev/null +++ b/scripts/faction/endor_marauder.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'gondula_tribe' or enemy == 'panshee_tribe': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/fed_dub.py b/scripts/faction/fed_dub.py new file mode 100644 index 00000000..20a018fb --- /dev/null +++ b/scripts/faction/fed_dub.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'liberation_party' or enemy == 'binayre' or enemy == 'lost_aqualish' or enemy == 'drall': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/flail.py b/scripts/faction/flail.py new file mode 100644 index 00000000..37a3ff1d --- /dev/null +++ b/scripts/faction/flail.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'hidden_daggers': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/followers_of_lord_nyax.py b/scripts/faction/followers_of_lord_nyax.py new file mode 100644 index 00000000..35c07b91 --- /dev/null +++ b/scripts/faction/followers_of_lord_nyax.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'corsec' or enemy == 'beldonnas_league': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/forest_kerritamba.py b/scripts/faction/forest_kerritamba.py new file mode 100644 index 00000000..1213cf20 --- /dev/null +++ b/scripts/faction/forest_kerritamba.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'forest_outcast': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/forest_outcast.py b/scripts/faction/forest_outcast.py new file mode 100644 index 00000000..05faa8d3 --- /dev/null +++ b/scripts/faction/forest_outcast.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'forest_kerritamba': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/fs_villager.py b/scripts/faction/fs_villager.py new file mode 100644 index 00000000..0fd5d988 --- /dev/null +++ b/scripts/faction/fs_villager.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'sith_shadow': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/garyn.py b/scripts/faction/garyn.py new file mode 100644 index 00000000..139fe6a1 --- /dev/null +++ b/scripts/faction/garyn.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'restuss': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/gondula_tribe.py b/scripts/faction/gondula_tribe.py new file mode 100644 index 00000000..c0078e6a --- /dev/null +++ b/scripts/faction/gondula_tribe.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'donkuwah_tribe' or enemy == 'korga_tribe' or enemy == 'panshee_tribe' or enemy == 'pubam' or enemy == 'endor_marauder': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/gungan.py b/scripts/faction/gungan.py new file mode 100644 index 00000000..1f9355e5 --- /dev/null +++ b/scripts/faction/gungan.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'plasma_thief' or enemy == 'swamp_rat' or enemy == 'borvo': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/hidden_daggers.py b/scripts/faction/hidden_daggers.py new file mode 100644 index 00000000..34c20129 --- /dev/null +++ b/scripts/faction/hidden_daggers.py @@ -0,0 +1,11 @@ +import sys + +def isAlly(ally): + if ally == 'rogue_corsec': + return 1 + return 0 + +def isEnemy(enemy): + if enemy == 'corsec' or enemy == 'beldonnas_league' or enemy == 'flail': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/hutt.py b/scripts/faction/hutt.py new file mode 100644 index 00000000..0d468932 --- /dev/null +++ b/scripts/faction/hutt.py @@ -0,0 +1,11 @@ +import sys + +def isAlly(ally): + if ally == 'panshee_tribe': + return 1 + return 0 + +def isEnemy(enemy): + if enemy == 'naboo_security_force' or enemy == 'nym' or enemy == 'imperial' or enemy == 'jabba' or enemy == 'borvo' or enemy == 'corsec' or enemy == 'narmle': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/imperial.py b/scripts/faction/imperial.py new file mode 100644 index 00000000..b5bc8cc0 --- /dev/null +++ b/scripts/faction/imperial.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'rebel': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/jabba.py b/scripts/faction/jabba.py new file mode 100644 index 00000000..5840595b --- /dev/null +++ b/scripts/faction/jabba.py @@ -0,0 +1,11 @@ +import sys + +def isAlly(ally): + if ally == 'hutt': + return 1 + return 0 + +def isEnemy(enemy): + if enemy == 'valarian' or enemy == 'borvo': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/janta_tribe.py b/scripts/faction/janta_tribe.py new file mode 100644 index 00000000..b446a0a0 --- /dev/null +++ b/scripts/faction/janta_tribe.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'kunga_tribe' or enemy == 'dantari_raiders': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/jawa.py b/scripts/faction/jawa.py new file mode 100644 index 00000000..3553adcd --- /dev/null +++ b/scripts/faction/jawa.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'tusken_raider': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/kobola.py b/scripts/faction/kobola.py new file mode 100644 index 00000000..8befaec5 --- /dev/null +++ b/scripts/faction/kobola.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'narmle' or enemy == 'spice_collective': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/korga_tribe.py b/scripts/faction/korga_tribe.py new file mode 100644 index 00000000..6db0ca51 --- /dev/null +++ b/scripts/faction/korga_tribe.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'gondula_tribe' or enemy == 'panshee_tribe': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/kunga_tribe.py b/scripts/faction/kunga_tribe.py new file mode 100644 index 00000000..52e241cb --- /dev/null +++ b/scripts/faction/kunga_tribe.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'mokk_tribe' or enemy == 'dantari_raiders': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/liberation_party.py b/scripts/faction/liberation_party.py new file mode 100644 index 00000000..2fff2b6f --- /dev/null +++ b/scripts/faction/liberation_party.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'fed_dub' or enemy == 'corsec': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/lok_mercenaries.py b/scripts/faction/lok_mercenaries.py new file mode 100644 index 00000000..ebf10bf9 --- /dev/null +++ b/scripts/faction/lok_mercenaries.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'bloodrazor' or enemy == 'canyon_corsair': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/lost_aqualish.py b/scripts/faction/lost_aqualish.py new file mode 100644 index 00000000..9aef6e55 --- /dev/null +++ b/scripts/faction/lost_aqualish.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'beldonnas_league' or enemy == 'fed_dub' or enemy == 'corsec': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/meatlump.py b/scripts/faction/meatlump.py new file mode 100644 index 00000000..3e432825 --- /dev/null +++ b/scripts/faction/meatlump.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'corsec' or enemy == 'rogue_corsec' or enemy == 'beldonnas_league': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/mokk_tribe.py b/scripts/faction/mokk_tribe.py new file mode 100644 index 00000000..93e05b64 --- /dev/null +++ b/scripts/faction/mokk_tribe.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'janta_tribe' or enemy == 'dantari_raiders': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/monumenter.py b/scripts/faction/monumenter.py new file mode 100644 index 00000000..35c07b91 --- /dev/null +++ b/scripts/faction/monumenter.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'corsec' or enemy == 'beldonnas_league': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/mtn_clan.py b/scripts/faction/mtn_clan.py new file mode 100644 index 00000000..e2b7c145 --- /dev/null +++ b/scripts/faction/mtn_clan.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'nightsister': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/naboo.py b/scripts/faction/naboo.py new file mode 100644 index 00000000..22519151 --- /dev/null +++ b/scripts/faction/naboo.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'borvo': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/naboo_pirate.py b/scripts/faction/naboo_pirate.py new file mode 100644 index 00000000..d409c4ff --- /dev/null +++ b/scripts/faction/naboo_pirate.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'naboo_security_force': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/naboo_security_force.py b/scripts/faction/naboo_security_force.py new file mode 100644 index 00000000..ec32a708 --- /dev/null +++ b/scripts/faction/naboo_security_force.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'borvo' or enemy == 'naboo_pirate' or enemy == 'plasma_thief' or enemy == 'swamp_rat' or enemy == 'trade_federation': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/narmle.py b/scripts/faction/narmle.py new file mode 100644 index 00000000..3188e87c --- /dev/null +++ b/scripts/faction/narmle.py @@ -0,0 +1,11 @@ +import sys + +def isAlly(ally): + if ally == 'restuss': + return 1 + return 0 + +def isEnemy(enemy): + if enemy == 'narmle' or enemy == 'spice_collective' or enemy == 'kobola': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/nightsister.py b/scripts/faction/nightsister.py new file mode 100644 index 00000000..cf1f8c4e --- /dev/null +++ b/scripts/faction/nightsister.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'mtn_clan' or enemy == 'imperial': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/nym.py b/scripts/faction/nym.py new file mode 100644 index 00000000..ebf10bf9 --- /dev/null +++ b/scripts/faction/nym.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'bloodrazor' or enemy == 'canyon_corsair': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/olag_greck.py b/scripts/faction/olag_greck.py new file mode 100644 index 00000000..35c07b91 --- /dev/null +++ b/scripts/faction/olag_greck.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'corsec' or enemy == 'beldonnas_league': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/panshee_tribe.py b/scripts/faction/panshee_tribe.py new file mode 100644 index 00000000..6ea96a0d --- /dev/null +++ b/scripts/faction/panshee_tribe.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'donkuwah_tribe' or enemy == 'korga_tribe' or enemy == 'gondula_tribe' or enemy == 'pubam' or enemy == 'endor_marauder': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/pirate.py b/scripts/faction/pirate.py new file mode 100644 index 00000000..a8fc0c39 --- /dev/null +++ b/scripts/faction/pirate.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'fed_dub' or enemy == 'binayre' or enemy == 'liberation_party': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/plasma_thief.py b/scripts/faction/plasma_thief.py new file mode 100644 index 00000000..89a851e9 --- /dev/null +++ b/scripts/faction/plasma_thief.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'gungan': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/pubam.py b/scripts/faction/pubam.py new file mode 100644 index 00000000..6db0ca51 --- /dev/null +++ b/scripts/faction/pubam.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'gondula_tribe' or enemy == 'panshee_tribe': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/rebel.py b/scripts/faction/rebel.py new file mode 100644 index 00000000..0d685a6a --- /dev/null +++ b/scripts/faction/rebel.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'imperial': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/restuss.py b/scripts/faction/restuss.py new file mode 100644 index 00000000..9ce8318a --- /dev/null +++ b/scripts/faction/restuss.py @@ -0,0 +1,11 @@ +import sys + +def isAlly(ally): + if ally == 'narmle': + return 1 + return 0 + +def isEnemy(enemy): + if enemy == 'garyn' or enemy == 'cobral': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/rogue_corsec.py b/scripts/faction/rogue_corsec.py new file mode 100644 index 00000000..38fd4f3a --- /dev/null +++ b/scripts/faction/rogue_corsec.py @@ -0,0 +1,11 @@ +import sys + +def isAlly(ally): + if ally == 'hidden_daggers': + return 1 + return 0 + +def isEnemy(enemy): + if enemy == 'corsec': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/rorgungan.py b/scripts/faction/rorgungan.py new file mode 100644 index 00000000..f39573c6 --- /dev/null +++ b/scripts/faction/rorgungan.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'spice_collective': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/sif.py b/scripts/faction/sif.py new file mode 100644 index 00000000..04d90a0e --- /dev/null +++ b/scripts/faction/sif.py @@ -0,0 +1,11 @@ +import sys + +def isAlly(ally): + if ally == 'hutt': + return 1 + return 0 + +def isEnemy(enemy): + if enemy == 'rebel' or enemy == 'imperial': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/sith_shadow.py b/scripts/faction/sith_shadow.py new file mode 100644 index 00000000..e89c90da --- /dev/null +++ b/scripts/faction/sith_shadow.py @@ -0,0 +1,11 @@ +import sys + +def isAlly(ally): + if ally == 'rebel' or ally == 'imperial': + return 1 + return 0 + +def isEnemy(enemy): + if enemy == 'fs_villager': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/smashball.py b/scripts/faction/smashball.py new file mode 100644 index 00000000..89e21659 --- /dev/null +++ b/scripts/faction/smashball.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'corsec' or enemy == 'cor_swoop': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/spice_collective.py b/scripts/faction/spice_collective.py new file mode 100644 index 00000000..a95f585e --- /dev/null +++ b/scripts/faction/spice_collective.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'narmle' or enemy == 'rorgungan' or enemy == 'kobola': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/spider_nightsister.py b/scripts/faction/spider_nightsister.py new file mode 100644 index 00000000..90a4f892 --- /dev/null +++ b/scripts/faction/spider_nightsister.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'mtn_clan': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/swamp_rat.py b/scripts/faction/swamp_rat.py new file mode 100644 index 00000000..89a851e9 --- /dev/null +++ b/scripts/faction/swamp_rat.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'gungan': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/swoop.py b/scripts/faction/swoop.py new file mode 100644 index 00000000..24e9984a --- /dev/null +++ b/scripts/faction/swoop.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'desert_demon': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/thug.py b/scripts/faction/thug.py new file mode 100644 index 00000000..bd97f757 --- /dev/null +++ b/scripts/faction/thug.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'townsperson': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/townsperson.py b/scripts/faction/townsperson.py new file mode 100644 index 00000000..e747a256 --- /dev/null +++ b/scripts/faction/townsperson.py @@ -0,0 +1,11 @@ +import sys + +def isAlly(ally): + if ally == 'rebel' or ally == 'imperial': + return 1 + return 0 + +def isEnemy(enemy): + if enemy == 'thug' or enemy == 'bandit': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/trade_federation.py b/scripts/faction/trade_federation.py new file mode 100644 index 00000000..74674464 --- /dev/null +++ b/scripts/faction/trade_federation.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'borvo' or enemy == 'naboo_security_force': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/tusken_raider.py b/scripts/faction/tusken_raider.py new file mode 100644 index 00000000..4a81e25b --- /dev/null +++ b/scripts/faction/tusken_raider.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'jawa' or enemy == 'alkhara': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/valarian.py b/scripts/faction/valarian.py new file mode 100644 index 00000000..9d5ef701 --- /dev/null +++ b/scripts/faction/valarian.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'jabba': + return 1 + return 0 \ No newline at end of file diff --git a/scripts/faction/yavin_scavenger.py b/scripts/faction/yavin_scavenger.py new file mode 100644 index 00000000..0c95933c --- /dev/null +++ b/scripts/faction/yavin_scavenger.py @@ -0,0 +1,9 @@ +import sys + +def isAlly(ally): + return 0 + +def isEnemy(enemy): + if enemy == 'hutt' or enemy == 'jabba': + return 1 + return 0 \ No newline at end of file diff --git a/src/protocol/swg/FactionResponseMessage.java b/src/protocol/swg/FactionResponseMessage.java new file mode 100644 index 00000000..ad9f85e9 --- /dev/null +++ b/src/protocol/swg/FactionResponseMessage.java @@ -0,0 +1,77 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package protocol.swg; + +import java.nio.ByteOrder; +import java.util.Map; +import java.util.TreeMap; + +import org.apache.mina.core.buffer.IoBuffer; + +import resources.common.Opcodes; + +public class FactionResponseMessage extends SWGMessage { + + private Map factionStandingMap; + private int factionRank = 0; + private int rebelPoints = 0; + private int imperialPoints = 0; + + public FactionResponseMessage(Map factionStandingMap, int factionRank) { + this.factionStandingMap = new TreeMap(); + this.factionStandingMap.putAll(factionStandingMap); + this.factionRank = factionRank; + + if (this.factionStandingMap.containsKey("rebel")) { + this.rebelPoints = this.factionStandingMap.get("rebel"); + } + + if (this.factionStandingMap.containsKey("imperial")) { + this.imperialPoints = this.factionStandingMap.get("imperial"); + } + } + + public void deserialize(IoBuffer data) { + + } + + public IoBuffer serialize() { + IoBuffer result = IoBuffer.allocate(26).order(ByteOrder.LITTLE_ENDIAN); + result.setAutoExpand(true); + result.putShort((short) 2); + result.putInt(Opcodes.FactionResponseMessage); + result.putInt(factionRank); + result.putInt(rebelPoints); + result.putInt(imperialPoints); + result.putInt(factionStandingMap.size()); + for (String faction : factionStandingMap.keySet()) { + result.put(getAsciiString(faction)); + } + result.putInt(factionStandingMap.size()); + for (Integer points : factionStandingMap.values()) { + result.putInt(points); + } + + return result.flip(); + } + +} diff --git a/src/resources/common/Opcodes.java b/src/resources/common/Opcodes.java index 7b9b948f..5d03db30 100644 --- a/src/resources/common/Opcodes.java +++ b/src/resources/common/Opcodes.java @@ -56,5 +56,6 @@ public class Opcodes { public static int PlayMusicMessage = CRC.StringtoCRC("PlayMusicMessage"); public static int PlanetTravelPointListRequest = 0x96405D4D; public static int FactionRequestMessage = CRC.StringtoCRC("FactionRequestMessage"); + public static int FactionResponseMessage = CRC.StringtoCRC("FactionResponseMessage"); } diff --git a/src/resources/common/StateStatus.java b/src/resources/common/StateStatus.java index e4039a46..e97026c7 100644 --- a/src/resources/common/StateStatus.java +++ b/src/resources/common/StateStatus.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ package resources.common; public class StateStatus { diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index ea367d8f..45b76ada 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -143,7 +143,7 @@ public class CreatureObject extends TangibleObject implements IPersistent { private SWGList dotList = new SWGList(); @NotPersistent private ScheduledFuture incapTask; - + private boolean staticNPC = false; // temp public CreatureObject(long objectID, Planet planet, Point3D position, Quaternion orientation, String Template) { diff --git a/src/services/gcw/FactionService.java b/src/services/gcw/FactionService.java index 5792f2cd..ee1122c6 100644 --- a/src/services/gcw/FactionService.java +++ b/src/services/gcw/FactionService.java @@ -32,16 +32,17 @@ import org.apache.mina.core.session.IoSession; import org.python.core.Py; import org.python.core.PyObject; +import protocol.swg.FactionResponseMessage; + import resources.common.FileUtilities; import resources.common.Opcodes; import resources.objects.creature.CreatureObject; import resources.objects.player.PlayerObject; -import resources.objects.tangible.TangibleObject; import engine.clientdata.ClientFileManager; import engine.clientdata.visitors.DatatableVisitor; +import engine.clients.Client; import engine.resources.common.CRC; -import engine.resources.objects.SWGObject; import engine.resources.service.INetworkDispatch; import engine.resources.service.INetworkRemoteEvent; @@ -85,6 +86,10 @@ public class FactionService implements INetworkDispatch { } public void addFactionStanding(CreatureObject creature, String faction, int factionStanding) { + if (!isFaction(faction)) { + return; + } + if (creature == null) { return; } @@ -99,6 +104,10 @@ public class FactionService implements INetworkDispatch { } public void removeFactionStanding(CreatureObject creature, String faction, int factionStanding) { + if (!isFaction(faction)) { + return; + } + if (creature == null) { return; } @@ -109,32 +118,7 @@ public class FactionService implements INetworkDispatch { return; } - player.modifyFactionStanding(faction, factionStanding); - } - - public void updateFactionStanding(SWGObject killedObject) { - if (!(killedObject instanceof TangibleObject) || killedObject == null) { - return; - } - - TangibleObject target = (TangibleObject) killedObject; - - if (!(((TangibleObject) killedObject).getKiller() instanceof TangibleObject) || ((TangibleObject) killedObject).getKiller() == null) { - return; - } - - TangibleObject killer = ((TangibleObject) killedObject).getKiller(); - - if (killer != null && target != null && isFaction(target.getFaction())) { - if (FileUtilities.doesFileExist("scripts/faction/standing/" + target.getFaction() + ".py")) { - - PyObject method = core.scriptService.getMethod("scripts/faction/standing/", target.getFaction(), "update"); - - if (method != null && method.isCallable()) { - method.__call__(Py.java2py(core), Py.java2py(killer), Py.java2py(target)); - } - } - } + player.modifyFactionStanding(faction, -factionStanding); } public boolean isFaction(String faction) { @@ -145,6 +129,62 @@ public class FactionService implements INetworkDispatch { return false; } + /* + * Returns true if creature2 is an ally of creature1 + * + * Will be useful for NPC AI, so they know who to help and who to be indifferent to. + */ + public boolean isFactionAlly(CreatureObject creature1, CreatureObject creature2) { + if (creature1 == null || creature2 == null) { + return false; + } + + String faction1 = creature1.getFaction(); + String faction2 = creature2.getFaction(); + + if (!isFaction(faction1) || !isFaction(faction2)) { + return false; + } + + if (FileUtilities.doesFileExist("scripts/faction/" + faction1 + ".py")) { + PyObject method = core.scriptService.getMethod("scripts/faction/", faction1, "isAlly"); + + if (method != null && method.isCallable()) { + return ((method.__call__(Py.java2py(faction2)).asInt() == 1) ? true : false); + } + } + + return false; + } + + /* + * Returns true if creature2 is an enemy of creature1 + * + * Will be useful for NPC AI, so they know who to attack and who to be indifferent to. + */ + public boolean isFactionEnemy(CreatureObject creature1, CreatureObject creature2) { + if (creature1 == null || creature2 == null) { + return false; + } + + String faction1 = creature1.getFaction(); + String faction2 = creature2.getFaction(); + + if (!isFaction(faction1) || !isFaction(faction2)) { + return false; + } + + if (FileUtilities.doesFileExist("scripts/faction/" + faction1 + ".py")) { + PyObject method = core.scriptService.getMethod("scripts/faction/", faction1, "isEnemy"); + + if (method != null && method.isCallable()) { + return ((method.__call__(Py.java2py(faction2)).asInt() == 1) ? true : false); + } + } + + return false; + } + public Map getFactionMap() { return factionMap; } @@ -156,7 +196,25 @@ public class FactionService implements INetworkDispatch { @Override public void handlePacket(IoSession session, IoBuffer buffer) throws Exception { + Client client = core.getClient((int) session.getAttribute("connectionId")); + if (client == null) { + return; + } + + CreatureObject creature = (CreatureObject) client.getParent(); + + if (creature == null) { + return; + } + + PlayerObject player = (PlayerObject) creature.getSlottedObject("ghost"); + + if (player == null) { + return; + } + + session.write((new FactionResponseMessage(player.getFactionStandingMap(), 0)).serialize()); } }); diff --git a/src/services/object/ObjectService.java b/src/services/object/ObjectService.java index b08ad2f9..6ae5c535 100644 --- a/src/services/object/ObjectService.java +++ b/src/services/object/ObjectService.java @@ -219,7 +219,7 @@ public class ObjectService implements INetworkDispatch { object.setAttachment("serverTemplate", ((customServerTemplate != null) ? customServerTemplate : object.getTemplate())); object.setisInSnapshot(isSnapshot); - loadServerTemplate(object); + //loadServerTemplate(object); objectList.put(objectID, object); @@ -351,18 +351,6 @@ public class ObjectService implements INetworkDispatch { } } - if (object instanceof CreatureObject) { - if (core.factionService.getFactionMap().containsKey(((CreatureObject) object).getFaction())) { - if (FileUtilities.doesFileExist(filePath)) { - PyObject method = core.scriptService.getMethod("scripts/" + object.getTemplate().split("shared_" , 2)[0].replace("shared_", ""), object.getTemplate().split("shared_" , 2)[1].replace(".iff", ""), "destroy"); - - if (method != null && method.isCallable()) { - method.__call__(Py.java2py(core), Py.java2py(((TangibleObject) object).getKiller()), Py.java2py(object)); - } - } - } - } - if (object == null) { return; } @@ -456,10 +444,16 @@ public class ObjectService implements INetworkDispatch { String filePath = "scripts/" + object.getTemplate().split("shared_" , 2)[0].replace("shared_", "") + object.getTemplate().split("shared_" , 2)[1].replace(".iff", "") + ".py"; if (FileUtilities.doesFileExist(filePath)) { - PyObject method = core.scriptService.getMethod("scripts/" + object.getTemplate().split("shared_" , 2)[0].replace("shared_", ""), object.getTemplate().split("shared_" , 2)[1].replace(".iff", ""), "useObject"); + filePath = "scripts/" + object.getTemplate().split("shared_" , 2)[0].replace("shared_", ""); + String fileName = object.getTemplate().split("shared_" , 2)[1].replace(".iff", ""); - if (method != null && method.isCallable()) { - method.__call__(Py.java2py(core), Py.java2py(creature), Py.java2py(object)); + PyObject method1 = core.scriptService.getMethod("scripts/" + object.getTemplate().split("shared_" , 2)[0].replace("shared_", ""), object.getTemplate().split("shared_" , 2)[1].replace(".iff", ""), "use"); + PyObject method2 = core.scriptService.getMethod("scripts/" + object.getTemplate().split("shared_" , 2)[0].replace("shared_", ""), object.getTemplate().split("shared_" , 2)[1].replace(".iff", ""), "useObject"); + + if (method1 != null && method1.isCallable()) { + method1.__call__(Py.java2py(core), Py.java2py(creature), Py.java2py(object)); + } else if (method2 != null && method2.isCallable()) { + method2.__call__(Py.java2py(core), Py.java2py(creature), Py.java2py(object)); } } }