diff --git a/scripts/collections/gcwrank_imperial.py b/scripts/collections/gcwrank_imperial.py index 19e67fe5..584d18a6 100644 --- a/scripts/collections/gcwrank_imperial.py +++ b/scripts/collections/gcwrank_imperial.py @@ -3,23 +3,23 @@ from resources.datatables import GcwRank def handleRankUp(core, actor, newrank): if newrank >= GcwRank.LIEUTENANT: - actor.addAbility('pvp_retaliation_ability') + actor.addAbility('command_pvp_retaliation_ability') core.collectionService.addCollection(actor, 'pvp_imperial_lieutenant') if newrank >= GcwRank.CAPTAIN: - actor.addAbility('pvp_adrenaline_ability') + actor.addAbility('command_pvp_adrenaline_ability') core.collectionService.addCollection(actor, 'pvp_imperial_captain') if newrank >= GcwRank.MAJOR: - actor.addAbility('pvp_unstoppable_ability') + actor.addAbility('command_pvp_unstoppable_ability') core.collectionService.addCollection(actor, 'pvp_imperial_major') if newrank >= GcwRank.LTCOLONEL: - actor.addAbility('pvp_last_man_ability') + actor.addAbility('command_pvp_last_man_ability') core.collectionService.addCollection(actor, 'pvp_imperial_lt_colonel') if newrank >= GcwRank.COLONEL: - actor.addAbility('pvp_aura_buff_self_ability') + actor.addAbility('pvp_aura_buff_imperial_self') core.collectionService.addCollection(actor, 'pvp_imperial_colonel') if newrank >= GcwRank.GENERAL: @@ -30,19 +30,19 @@ def handleRankUp(core, actor, newrank): def handleRankDown(actor, newrank): if newrank < GcwRank.LIEUTENANT: - actor.removeAbility('pvp_retaliation_ability') + actor.removeAbility('command_pvp_retaliation_ability') if newrank < GcwRank.CAPTAIN: - actor.removeAbility('pvp_adrenaline_ability') + actor.removeAbility('command_pvp_adrenaline_ability') if newrank < GcwRank.MAJOR: - actor.removeAbility('pvp_unstoppable_ability') + actor.removeAbility('command_pvp_unstoppable_ability') if newrank < GcwRank.LTCOLONEL: - actor.removeAbility('pvp_last_man_ability') + actor.removeAbility('command_pvp_last_man_ability') if newrank < GcwRank.COLONEL: - actor.removeAbility('pvp_aura_buff_self_ability') + actor.removeAbility('pvp_aura_buff_imperial_self') if newrank < GcwRank.GENERAL: actor.removeAbility('pvp_airstrike_ability') diff --git a/scripts/collections/gcwrank_rebel.py b/scripts/collections/gcwrank_rebel.py index 7cd757fc..3ba4222b 100644 --- a/scripts/collections/gcwrank_rebel.py +++ b/scripts/collections/gcwrank_rebel.py @@ -3,23 +3,23 @@ from resources.datatables import GcwRank def handleRankUp(core, actor, newrank): if newrank >= GcwRank.LIEUTENANT: - actor.addAbility('pvp_retaliation_rebel_ability') + actor.addAbility('command_pvp_retaliation_rebel_ability') core.collectionService.addCollection(actor, 'pvp_rebel_lieutenant') if newrank >= GcwRank.CAPTAIN: - actor.addAbility('pvp_adrenaline_rebel_ability') + actor.addAbility('command_pvp_adrenaline_rebel_ability') core.collectionService.addCollection(actor, 'pvp_rebel_captain') if newrank >= GcwRank.MAJOR: - actor.addAbility('pvp_unstoppable_rebel_ability') + actor.addAbility('command_pvp_unstoppable_rebel_ability') core.collectionService.addCollection(actor, 'pvp_rebel_major') if newrank >= GcwRank.COMMANDER: - actor.addAbility('pvp_last_man_rebel_ability') + actor.addAbility('command_pvp_last_man_rebel_ability') core.collectionService.addCollection(actor, 'pvp_rebel_commander') if newrank >= GcwRank.COLONEL: - actor.addAbility('pvp_aura_buff_self_rebel_ability') + actor.addAbility('pvp_aura_buff_rebel_self') core.collectionService.addCollection(actor, 'pvp_rebel_colonel') if newrank >= GcwRank.GENERAL: @@ -30,19 +30,19 @@ def handleRankUp(core, actor, newrank): def handleRankDown(actor, newrank): if newrank < GcwRank.LIEUTENANT: - actor.removeAbility('pvp_retaliation_rebel_ability') + actor.removeAbility('command_pvp_retaliation_rebel_ability') if newrank < GcwRank.CAPTAIN: - actor.removeAbility('pvp_adrenaline_rebel_ability') + actor.removeAbility('command_pvp_adrenaline_rebel_ability') if newrank < GcwRank.MAJOR: - actor.removeAbility('pvp_unstoppable_rebel_ability') + actor.removeAbility('command_pvp_unstoppable_rebel_ability') if newrank < GcwRank.COMMANDER: - actor.removeAbility('pvp_last_man_rebel_ability') + actor.removeAbility('command_pvp_last_man_rebel_ability') if newrank < GcwRank.COLONEL: - actor.removeAbility('pvp_aura_buff_self_rebel_ability') + actor.removeAbility('pvp_aura_buff_rebel_self') if newrank < GcwRank.GENERAL: actor.removeAbility('pvp_airstrike_rebel_ability') diff --git a/scripts/commands/adjustLotCount.py b/scripts/commands/adjustLotCount.py new file mode 100644 index 00000000..4d20f4c7 --- /dev/null +++ b/scripts/commands/adjustLotCount.py @@ -0,0 +1,15 @@ +import sys + +def run(core, actor, target, commandString): + commandArgs = commandString.split(' ') + arg1 = commandArgs[0] + + if target is None: + target = actor + + if target: + playerObject = target.getSlottedObject('ghost') + playerObject.setLotsRemaining(playerObject.getLotsRemaining() + int(arg1)) + print(playerObject.getLotsRemaining()) + actor.sendSystemMessage('GM: Adjust Lot Count: Completed Successfully for ' + target.getFirstName(), 0) + return \ No newline at end of file diff --git a/scripts/commands/broadcastGalaxy.py b/scripts/commands/broadcastGalaxy.py new file mode 100644 index 00000000..04a1ae09 --- /dev/null +++ b/scripts/commands/broadcastGalaxy.py @@ -0,0 +1,12 @@ + +from services.sui import SUIWindow +from services.sui.SUIWindow import Trigger +from java.util import Vector +import sys + +def setup(): + return + +def run(core, actor, target, commandString): + core.chatService.broadcastGalaxy(commandString) + return \ No newline at end of file diff --git a/scripts/commands/broadcastPlanet.py b/scripts/commands/broadcastPlanet.py new file mode 100644 index 00000000..cb2956d2 --- /dev/null +++ b/scripts/commands/broadcastPlanet.py @@ -0,0 +1,11 @@ +from services.sui import SUIWindow +from services.sui.SUIWindow import Trigger +from java.util import Vector +import sys + +def setup(): + return + +def run(core, actor, target, commandString): + core.chatService.broadcastPlanet(commandString, actor.getPlanet()) + return \ No newline at end of file diff --git a/scripts/commands/credits.py b/scripts/commands/credits.py new file mode 100644 index 00000000..11d28a36 --- /dev/null +++ b/scripts/commands/credits.py @@ -0,0 +1,20 @@ +import sys + + + +def run(core, actor, target, commandString): + commandArgs = commandString.split(' ') + arg1 = commandArgs[0] + playerObject = actor.getSlottedObject('ghost') + + if actor: + actor.setCashCredits(actor.getCashCredits() + int(arg1)) + actor.sendSystemMessage(actor.getFirstName() + ' has removed ' + arg1 + ' credits from Project SWG\'s bank.', 0) + + if actor and target: + target.setCashCredits(target.getCashCredits() + int(arg1)) + target.sendSystemMessage('You have recieved ' + arg1 + ' credits from ' + actor.getFirstName(), 0) + actor.sendSystemMessage('You have transferred ' + arg1 + ' credits to ' + target.getFirstName(), 0) + + + return \ No newline at end of file diff --git a/scripts/commands/invulnerable.py b/scripts/commands/invulnerable.py new file mode 100644 index 00000000..90aab004 --- /dev/null +++ b/scripts/commands/invulnerable.py @@ -0,0 +1,33 @@ +import sys +from resources.datatables import Options + +def run(core, actor, target, commandString): + commandArgs = commandString.split(' ') + command = commandArgs[0] + + + if command == 'invisible': + if (actor.isInStealth()): + actor.setInStealth(False) + actor.setRadarVisible(True) + actor.sendSystemMessage('GM Command Successfull: You are no longer Invisible.', 0) + + else: + actor.setInStealth(True) + actor.setRadarVisible(False) + actor.sendSystemMessage('GM Command Successfull: You are now Invisible.', 0) + + if actor.getOptionsBitmask() == 128: + actor.setOptionsBitmask(Options.NONE) + actor.sendSystemMessage('GM Command Successfull: You are now Invulnerable.', 0) + + + elif actor.getOptionsBitmask() == 0: + actor.setOptionsBitmask(Options.ATTACKABLE) + print(actor.getOptionsBitmask()) + + actor.sendSystemMessage('GM Command Successfull: You are no longer Invulnerable.', 0) + + return + + \ No newline at end of file diff --git a/scripts/commands/server.py b/scripts/commands/server.py index 09765edc..fc7b1f5c 100644 --- a/scripts/commands/server.py +++ b/scripts/commands/server.py @@ -28,14 +28,18 @@ def run(core, actor, target, commandString): if command == 'lockServer': core.setGalaxyStatus(GalaxyStatus.Locked) + actor.sendSystemMessage('GM: Command completed successfully, Server is now in Locked Status', 0) if command == 'unlockServer': core.setGalaxyStatus(GalaxyStatus.Online) - if command == 'info': - actor.sendSystemMessage(str(core.getActiveZoneClients()) + ' online characters.', 0) + actor.sendSystemMessage('GM: Command completed successfully, Server is now in Online Status', 0) + #if command == 'restart': //This command currently causes an error at NGEcore.java like 593 whole attempting to close databaseConnection2 + #core.restart() + #actor.sendSystemMessage('GM: Command completed successfully, Server restart initiated', 0) if command == 'shutdown': core.initiateShutdown() - if command == 'getheight': - actor.sendSystemMessage(str(core.terrainService.getHeight(actor.getPlanetId(), actor.getWorldPosition().x, actor.getWorldPosition().z)), 0) - + actor.sendSystemMessage('GM: Command completed successfully, Server shutdown initiated', 0) + if command == 'stop': + core.initiateStop() + actor.sendSystemMessage('GM: Command completed successfully, Emergency server shutdown initiated', 0) return diff --git a/scripts/commands/setRank.py b/scripts/commands/setRank.py new file mode 100644 index 00000000..afdc5b16 --- /dev/null +++ b/scripts/commands/setRank.py @@ -0,0 +1,41 @@ +import sys +from resources.datatables import GcwRank +from services.gcw import GCWService + +def run(core, actor, target, commandString): + commandArgs = commandString.split(' ') + arg1 = commandArgs[0] + if len(commandArgs) > 1: + arg2 = commandArgs[1] + + if target is None: + target = actor + + if target.getFaction() == 'rebel' or 'imperial' and arg1 == 'up': + playerObject = target.getSlottedObject('ghost') + playerObject.setCurrentRank(int(arg2)) + newrank = playerObject.getCurrentRank() + core.scriptService.callScript("scripts/collections/", "gcwrank_" + target.getFaction(), "handleRankUp", core, target, newrank) + actor.sendSystemMessage('GM: Set Rank: Completed Successfully', 0) + if target.getFaction() == 'rebel' or 'imperial' and arg1 == 'down': + playerObject = target.getSlottedObject('ghost') + playerObject.setCurrentRank(int(arg2)) + newrank = playerObject.getCurrentRank() + core.scriptService.callScript("scripts/collections/", "gcwrank_" + target.getFaction(), "handleRankDown", target, newrank) + actor.sendSystemMessage('GM: Set Rank: Completed Successfully', 0) + +# if target.getFaction() == 'imperial' and arg1 == 'up': +# if arg1 == 'up': +# playerObject = actor.getSlottedObject('ghost') +# playerObject.setCurrentRank(int(arg2)) +# newrank = playerObject.getCurrentRank() +# core.scriptService.callScript("scripts/collections/", "gcwrank_" + target.getFaction(), "handleRankUp", core, target, newrank) +# actor.sendSystemMessage('GM: Set Rank: Completed Successfully', 0) +# if target.getFaction() == 'imperial' and arg1 == 'down': +# playerObject = actor.getSlottedObject('ghost') +# playerObject.setCurrentRank(int(arg2)) +# newrank = playerObject.getCurrentRank() +# core.scriptService.callScript("scripts/collections/", "gcwrank_" + target.getFaction(), "handleRankDown", target, newrank) +# actor.sendSystemMessage('GM: Set Rank: Completed Successfully', 0) + + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/armor/rebel_assault/armor_rebel_spec_ops_belt.py b/scripts/object/tangible/wearables/armor/rebel_assault/armor_rebel_spec_ops_belt.py index 1be134b6..b589b6e8 100644 --- a/scripts/object/tangible/wearables/armor/rebel_assault/armor_rebel_spec_ops_belt.py +++ b/scripts/object/tangible/wearables/armor/rebel_assault/armor_rebel_spec_ops_belt.py @@ -10,10 +10,4 @@ def setup(core, object): object.setIntAttribute('no_trade', 1) object.setStringAttribute('faction_restriction', 'Rebel') object.setStringAttribute('armor_category', '@obj_attr_n:armor_assault') - object.setIntAttribute('cat_armor_standard_protection.kinetic', 6608) - object.setIntAttribute('cat_armor_standard_protection.energy', 4608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_heat', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_cold', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_acid', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_electricity', 5608) return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/armor/rebel_assault/armor_rebel_spec_ops_boots.py b/scripts/object/tangible/wearables/armor/rebel_assault/armor_rebel_spec_ops_boots.py index f7d17219..c79a2747 100644 --- a/scripts/object/tangible/wearables/armor/rebel_assault/armor_rebel_spec_ops_boots.py +++ b/scripts/object/tangible/wearables/armor/rebel_assault/armor_rebel_spec_ops_boots.py @@ -10,10 +10,4 @@ def setup(core, object): object.setIntAttribute('no_trade', 1) object.setStringAttribute('faction_restriction', 'Rebel') object.setStringAttribute('armor_category', '@obj_attr_n:armor_assault') - object.setIntAttribute('cat_armor_standard_protection.kinetic', 6608) - object.setIntAttribute('cat_armor_standard_protection.energy', 4608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_heat', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_cold', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_acid', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_electricity', 5608) return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/armor/rebel_assault/armor_rebel_spec_ops_gloves.py b/scripts/object/tangible/wearables/armor/rebel_assault/armor_rebel_spec_ops_gloves.py index 2e0a2417..ff30b43a 100644 --- a/scripts/object/tangible/wearables/armor/rebel_assault/armor_rebel_spec_ops_gloves.py +++ b/scripts/object/tangible/wearables/armor/rebel_assault/armor_rebel_spec_ops_gloves.py @@ -10,10 +10,4 @@ def setup(core, object): object.setIntAttribute('no_trade', 1) object.setStringAttribute('faction_restriction', 'Rebel') object.setStringAttribute('armor_category', '@obj_attr_n:armor_assault') - object.setIntAttribute('cat_armor_standard_protection.kinetic', 6608) - object.setIntAttribute('cat_armor_standard_protection.energy', 4608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_heat', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_cold', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_acid', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_electricity', 5608) return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/armor/stormtrooper/armor_pvp_spec_ops_imperial_black_belt_05_01.py b/scripts/object/tangible/wearables/armor/stormtrooper/armor_pvp_spec_ops_imperial_black_belt_05_01.py index 3c98941f..3ebc0dbf 100644 --- a/scripts/object/tangible/wearables/armor/stormtrooper/armor_pvp_spec_ops_imperial_black_belt_05_01.py +++ b/scripts/object/tangible/wearables/armor/stormtrooper/armor_pvp_spec_ops_imperial_black_belt_05_01.py @@ -11,10 +11,4 @@ def setup(core, object): object.setIntAttribute('no_trade', 1) object.setStringAttribute('faction_restriction', 'Imperial') object.setStringAttribute('armor_category', '@obj_attr_n:armor_assault') - object.setIntAttribute('cat_armor_standard_protection.kinetic', 6608) - object.setIntAttribute('cat_armor_standard_protection.energy', 4608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_heat', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_cold', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_acid', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_electricity', 5608) return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/armor/stormtrooper/armor_pvp_spec_ops_imperial_black_boots_05_01.py b/scripts/object/tangible/wearables/armor/stormtrooper/armor_pvp_spec_ops_imperial_black_boots_05_01.py index 5e993cf8..ffcc1157 100644 --- a/scripts/object/tangible/wearables/armor/stormtrooper/armor_pvp_spec_ops_imperial_black_boots_05_01.py +++ b/scripts/object/tangible/wearables/armor/stormtrooper/armor_pvp_spec_ops_imperial_black_boots_05_01.py @@ -11,10 +11,4 @@ def setup(core, object): object.setIntAttribute('no_trade', 1) object.setStringAttribute('faction_restriction', 'Imperial') object.setStringAttribute('armor_category', '@obj_attr_n:armor_assault') - object.setIntAttribute('cat_armor_standard_protection.kinetic', 6608) - object.setIntAttribute('cat_armor_standard_protection.energy', 4608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_heat', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_cold', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_acid', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_electricity', 5608) return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/armor/stormtrooper/armor_pvp_spec_ops_imperial_black_gloves_05_01.py b/scripts/object/tangible/wearables/armor/stormtrooper/armor_pvp_spec_ops_imperial_black_gloves_05_01.py index bfcbba83..8781ee28 100644 --- a/scripts/object/tangible/wearables/armor/stormtrooper/armor_pvp_spec_ops_imperial_black_gloves_05_01.py +++ b/scripts/object/tangible/wearables/armor/stormtrooper/armor_pvp_spec_ops_imperial_black_gloves_05_01.py @@ -11,10 +11,4 @@ def setup(core, object): object.setIntAttribute('no_trade', 1) object.setStringAttribute('faction_restriction', 'Imperial') object.setStringAttribute('armor_category', '@obj_attr_n:armor_assault') - object.setIntAttribute('cat_armor_standard_protection.kinetic', 6608) - object.setIntAttribute('cat_armor_standard_protection.energy', 4608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_heat', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_cold', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_acid', 5608) - object.setIntAttribute('cat_armor_special_protection.special_protection_type_electricity', 5608) return \ No newline at end of file diff --git a/src/main/NGECore.java b/src/main/NGECore.java index 2bd40112..8e47a007 100644 --- a/src/main/NGECore.java +++ b/src/main/NGECore.java @@ -796,8 +796,26 @@ public class NGECore { } catch (InterruptedException e) { e.printStackTrace(); } + } - + public void initiateStop() { + if(isShuttingDown) + return; + try { + chatService.broadcastGalaxy("You will now be disconnected so the server can perform a final save before shutting down."); + Thread.sleep(10000); + synchronized(getActiveConnectionsMap()) { + for(Client client : getActiveConnectionsMap().values()) { + client.getSession().close(true); + connectionService.disconnect(client); + } + } + + System.exit(0); + + } catch (InterruptedException e) { + e.printStackTrace(); + } } diff --git a/src/resources/objects/creature/CreatureMessageBuilder.java b/src/resources/objects/creature/CreatureMessageBuilder.java index 80bd3f58..33367160 100644 --- a/src/resources/objects/creature/CreatureMessageBuilder.java +++ b/src/resources/objects/creature/CreatureMessageBuilder.java @@ -138,10 +138,10 @@ public class CreatureMessageBuilder extends TangibleMessageBuilder { buffer.putLong(creature.getOwnerId()); - //float height = creature.getHeight(); + float height = creature.getHeight(); //if (height < 0.7 || height > 1.5) // height = 1; - buffer.putFloat(creature.getHeight()); + buffer.putFloat(height); buffer.putInt(0); // battle fatigue buffer.putLong(creature.getStateBitmask()); int size = buffer.position(); @@ -150,6 +150,8 @@ public class CreatureMessageBuilder extends TangibleMessageBuilder { buffer.flip(); buffer = createBaseline("CREO", (byte) 3, buffer, size); + tools.CharonPacketUtils.printAnalysis(buffer, "CREO 3"); + return buffer; } diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index 814dca39..da1a2576 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -24,7 +24,6 @@ package resources.objects.creature; import java.io.Serializable; import java.lang.System; import java.util.ArrayList; -import java.util.BitSet; import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -57,7 +56,6 @@ import resources.objects.SWGList; import resources.objects.SWGMap; import resources.objects.SWGSet; import engine.resources.common.CRC; -import engine.resources.objects.Baseline; import engine.resources.objects.SWGObject; import engine.resources.scene.Planet; import engine.resources.scene.Point3D; @@ -238,38 +236,7 @@ public class CreatureObject extends TangibleObject implements Serializable { setTurnRadius((float) getTemplateData().getAttribute("turnRate"));*/ } - - /*@Override - public Baseline getBaseline1() { - Baseline baseline = super.getBaseline1(); - baseline.put("bankCredits", 0); - baseline.put("cashCredits", 0); - - // HAM base list stuff - baseline.put("baseHAM", 6); // list size - baseline.put("unk1", 0); // udpate count? - baseline.put("health", 1000); - baseline.put("spacer1", 0); - baseline.put("action", 300); - baseline.put("spacer2", 0); - baseline.put("unk2", 0x2C01); - baseline.put("unk3", 0); - - baseline.put("skills", new SWGList()); - return baseline; - } - @Override - public Baseline getBaseline3() { - Baseline baseline = super.getBaseline3(); - baseline.put("posture", (byte) 0); - baseline.put("creo3unk1", (byte) 0); - baseline.put("ownerId", (long) 0); - baseline.put("height", (float) 1.3); - baseline.put("battleFatigue", 0); - baseline.put("stateBitmask", new BitSet()); - return baseline; - }*/ public int getBankCredits() { synchronized(objectMutex) { return bankCredits;