From aa0fe46fbacb18c17d6ae531ca7df2133ea17df1 Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Fri, 6 Dec 2013 23:21:31 +0100 Subject: [PATCH] Fixed Supply Drop command for officers. The Tactical Supply Drop command was removed from the game and was merged with the Medical Supply Drop and then became Supply Drop. The script can properly check if the actor has the tactical serum expertise box or not. --- scripts/commands/of_medical_sup_1.py | 52 ++++++++++++++ scripts/commands/of_tactical_sup_2.py | 13 ---- scripts/commands/of_tactical_sup_3.py | 13 ---- scripts/commands/of_tactical_sup_4.py | 13 ---- scripts/commands/of_tactical_sup_5.py | 13 ---- scripts/commands/of_tactical_sup_6.py | 70 ------------------- .../expertise/expertise_of_tactical_sup_1.py | 4 -- src/services/combat/CombatCommands.java | 7 +- 8 files changed, 53 insertions(+), 132 deletions(-) create mode 100644 scripts/commands/of_medical_sup_1.py delete mode 100644 scripts/commands/of_tactical_sup_2.py delete mode 100644 scripts/commands/of_tactical_sup_3.py delete mode 100644 scripts/commands/of_tactical_sup_4.py delete mode 100644 scripts/commands/of_tactical_sup_5.py delete mode 100644 scripts/commands/of_tactical_sup_6.py diff --git a/scripts/commands/of_medical_sup_1.py b/scripts/commands/of_medical_sup_1.py new file mode 100644 index 00000000..bc8c4935 --- /dev/null +++ b/scripts/commands/of_medical_sup_1.py @@ -0,0 +1,52 @@ +from engine.resources.container import StaticContainerPermissions +import time +import sys + +def setup(core, actor, target, command): + return + +def run(core, actor, target, commandString): + doStimDrop(core, actor) + return + +def doStimDrop(core, actor): + actor.sendSystemMessage('Stims incoming Mr. Bossman!', 0) + stcSvc = core.staticService + shuttle = stcSvc.spawnObject('object/creature/npc/theme_park/shared_lambda_shuttle.iff', actor.getPlanet().getName(), long(0), actor.getPosition().x, actor.getPosition().y, actor.getPosition().z, actor.getOrientation().y, actor.getOrientation().w) + shuttle.setPosture(0) + time.sleep(10) # Wait time before shuttle arrives after command is called + shuttle.setPosture(2) + time.sleep(20) # wait time for the crate to show (length of landing animation for shuttle) + spawnCrate(core, actor, shuttle) + time.sleep(5) # Wait time for the shuttle to leave after crate is spawned + shuttle.setPosture(0) + time.sleep(20) # How long the take-off sequence is, until the Shuttle is destroyed + core.objectService.destroyObject(shuttle) + return + +def spawnCrate(core, actor, shuttle): + crate = core.staticService.spawnObject('object/tangible/container/loot/shared_npe_loot_crate_low.iff', shuttle.getPlanet().getName(), long(0), shuttle.getPosition().x, shuttle.getPosition().y, shuttle.getPosition().z, shuttle.getOrientation().y, shuttle.getOrientation().w) + crate.setCustomName('Supply Crate') + + group = core.objectService.getObject(actor.getGroupId()) + + permissions = StaticContainerPermissions() + permissions.canRemove(group, crate) + permissions.canView(group, crate) + crate.setContainerPermissions(permissions) + + if actor.hasSkill('expertise_of_tactical_sup_1'): + for i in range(0, 8): + tactical = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) #FIXME: Use the correct template + tactical.setCustomName('Tactical Serum A') + crate.add(tactical) + + for i in range(0, 8): + stimpack = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_e.iff', actor.getPlanet()) #FIXME: Use the correct template + stimpack.setCustomName('Field Stimpack A') + crate.add(stimpack) + + time.sleep(60) + core.objectService.destroyObject(crate) + + return \ No newline at end of file diff --git a/scripts/commands/of_tactical_sup_2.py b/scripts/commands/of_tactical_sup_2.py deleted file mode 100644 index 76c7b5aa..00000000 --- a/scripts/commands/of_tactical_sup_2.py +++ /dev/null @@ -1,13 +0,0 @@ -import sys - -def setup(core, actor, buff): - return - -def run(core, actor, target, commandString): - print (' shuttle called!') - lambdaShuttle = stcSvc.spawnObject('object/creature/npc/theme_park/shared_event_lambda_shuttle.iff', actor.getPlanet().getName(), - long(0), actor.getPosition().x, actor.getPosition().y, actor.getPosition().z, actor.getOrientation().y, actor.getOrientation().w) - - lambdaShuttle.setPosture(0) # 0 or 2? - print ('posture set!') - return \ No newline at end of file diff --git a/scripts/commands/of_tactical_sup_3.py b/scripts/commands/of_tactical_sup_3.py deleted file mode 100644 index 76c7b5aa..00000000 --- a/scripts/commands/of_tactical_sup_3.py +++ /dev/null @@ -1,13 +0,0 @@ -import sys - -def setup(core, actor, buff): - return - -def run(core, actor, target, commandString): - print (' shuttle called!') - lambdaShuttle = stcSvc.spawnObject('object/creature/npc/theme_park/shared_event_lambda_shuttle.iff', actor.getPlanet().getName(), - long(0), actor.getPosition().x, actor.getPosition().y, actor.getPosition().z, actor.getOrientation().y, actor.getOrientation().w) - - lambdaShuttle.setPosture(0) # 0 or 2? - print ('posture set!') - return \ No newline at end of file diff --git a/scripts/commands/of_tactical_sup_4.py b/scripts/commands/of_tactical_sup_4.py deleted file mode 100644 index 76c7b5aa..00000000 --- a/scripts/commands/of_tactical_sup_4.py +++ /dev/null @@ -1,13 +0,0 @@ -import sys - -def setup(core, actor, buff): - return - -def run(core, actor, target, commandString): - print (' shuttle called!') - lambdaShuttle = stcSvc.spawnObject('object/creature/npc/theme_park/shared_event_lambda_shuttle.iff', actor.getPlanet().getName(), - long(0), actor.getPosition().x, actor.getPosition().y, actor.getPosition().z, actor.getOrientation().y, actor.getOrientation().w) - - lambdaShuttle.setPosture(0) # 0 or 2? - print ('posture set!') - return \ No newline at end of file diff --git a/scripts/commands/of_tactical_sup_5.py b/scripts/commands/of_tactical_sup_5.py deleted file mode 100644 index 76c7b5aa..00000000 --- a/scripts/commands/of_tactical_sup_5.py +++ /dev/null @@ -1,13 +0,0 @@ -import sys - -def setup(core, actor, buff): - return - -def run(core, actor, target, commandString): - print (' shuttle called!') - lambdaShuttle = stcSvc.spawnObject('object/creature/npc/theme_park/shared_event_lambda_shuttle.iff', actor.getPlanet().getName(), - long(0), actor.getPosition().x, actor.getPosition().y, actor.getPosition().z, actor.getOrientation().y, actor.getOrientation().w) - - lambdaShuttle.setPosture(0) # 0 or 2? - print ('posture set!') - return \ No newline at end of file diff --git a/scripts/commands/of_tactical_sup_6.py b/scripts/commands/of_tactical_sup_6.py deleted file mode 100644 index ec8f96db..00000000 --- a/scripts/commands/of_tactical_sup_6.py +++ /dev/null @@ -1,70 +0,0 @@ -from engine.resources.container import StaticContainerPermissions -import time -import sys - -def setup(core, actor, buff): - return - -def run(core, actor, target, commandString): - doStimDrop(core, actor) - return - -def doStimDrop(core, actor): - stcSvc = core.staticService - time.sleep(10) # Wait time before shuttle arrives after command is called - shuttle = stcSvc.spawnObject('object/creature/npc/theme_park/shared_lambda_shuttle.iff', actor.getPlanet().getName(), long(0), actor.getPosition().x, actor.getPosition().y, actor.getPosition().z, actor.getOrientation().y, actor.getOrientation().w) - shuttle.setPosture(0) - time.sleep(1) - shuttle.setPosture(2) - time.sleep(20) # wait time for the crate to show (length of landing animation for shuttle) - spawnCrate(core, actor, shuttle) - time.sleep(5) # Wait time for the shuttle to leave after crate is spawned - shuttle.setPosture(0) - time.sleep(20) # How long the take-off sequence is, until the Shuttle is destroyed - core.objectService.destroyObject(shuttle) - return - -def spawnCrate(core, actor, shuttle): - crate = core.staticService.spawnObject('object/tangible/container/loot/shared_npe_loot_crate_low.iff', shuttle.getPlanet().getName(), long(0), shuttle.getPosition().x, shuttle.getPosition().y, shuttle.getPosition().z, shuttle.getOrientation().y, shuttle.getOrientation().w) - crate.setCustomName('Supply Crate') - - permissions = StaticContainerPermissions() - permissions.canRemove(actor, crate) - permissions.canView(actor, crate) - crate.setContainerPermissions(permissions) - - tac1 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) - crate.add(tac1) - tac2 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) - crate.add(tac2) - tac3 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) - crate.add(tac3) - tac4 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) - crate.add(tac4) - tac5 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) - crate.add(tac5) - tac6 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) - crate.add(tac6) - tac7 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) - crate.add(tac7) - tac8 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_syren.iff', actor.getPlanet()) - crate.add(tac8) - - stim1 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) - crate.add(stim1) - stim2 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) - crate.add(stim2) - stim3 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) - crate.add(stim3) - stim4 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) - crate.add(stim4) - stim5 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) - crate.add(stim5) - stim6 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) - crate.add(stim6) - stim7 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) - crate.add(stim7) - stim8 = core.objectService.createObject('object/tangible/medicine/instant_stimpack/shared_stimpack_generic_a.iff', actor.getPlanet()) - crate.add(stim8) - - return \ No newline at end of file diff --git a/scripts/expertise/expertise_of_tactical_sup_1.py b/scripts/expertise/expertise_of_tactical_sup_1.py index d95ef2a5..451c6fbe 100644 --- a/scripts/expertise/expertise_of_tactical_sup_1.py +++ b/scripts/expertise/expertise_of_tactical_sup_1.py @@ -37,12 +37,8 @@ def removeExpertisePoint(core, actor): # this checks what abilities the player gets by level, need to also call this on level-up def addAbilities(core, actor, player): - actor.addAbility('of_tactical_sup_1') - return def removeAbilities(core, actor, player): - actor.removeAbility('of_tactical_sup_1') - return diff --git a/src/services/combat/CombatCommands.java b/src/services/combat/CombatCommands.java index 7ba5c596..1544a0ce 100644 --- a/src/services/combat/CombatCommands.java +++ b/src/services/combat/CombatCommands.java @@ -516,15 +516,10 @@ public class CombatCommands { core.commandService.registerCommand("of_buff_def_9"); core.commandService.registerCommand("of_emergency_shield"); core.commandService.registerCommand("of_firepower_1"); + core.commandService.registerCommand("of_medical_sup_1"); core.commandService.registerCommand("of_purge_1"); core.commandService.registerCommand("of_scatter_1"); core.commandService.registerCommand("of_stimulator_1"); - core.commandService.registerCommand("of_tactical_sup_1"); - core.commandService.registerCommand("of_tactical_sup_2"); - core.commandService.registerCommand("of_tactical_sup_3"); - core.commandService.registerCommand("of_tactical_sup_4"); - core.commandService.registerCommand("of_tactical_sup_5"); - core.commandService.registerCommand("of_tactical_sup_6"); // Smuggler