From a907f479a90f8612f0901266f0a88423ded290fa Mon Sep 17 00:00:00 2001 From: Waverunner Date: Sat, 15 Mar 2014 11:48:59 -0400 Subject: [PATCH 01/28] Added Server Firsts packet --- .../CollectionServerFirstListResponse.java | 69 +++++++++++++++++++ src/services/PlayerService.java | 13 ++++ .../collections/CollectionService.java | 4 +- src/services/collections/ServerFirst.java | 25 ++++++- 4 files changed, 107 insertions(+), 4 deletions(-) create mode 100644 src/protocol/swg/CollectionServerFirstListResponse.java diff --git a/src/protocol/swg/CollectionServerFirstListResponse.java b/src/protocol/swg/CollectionServerFirstListResponse.java new file mode 100644 index 00000000..74a01c2f --- /dev/null +++ b/src/protocol/swg/CollectionServerFirstListResponse.java @@ -0,0 +1,69 @@ +/******************************************************************************* + * 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.Map.Entry; + +import main.NGECore; + +import org.apache.mina.core.buffer.IoBuffer; + +import services.collections.ServerFirst; +import engine.resources.common.CRC; + +public class CollectionServerFirstListResponse extends SWGMessage { + + private Map sfList; + + public CollectionServerFirstListResponse(Map serverFirstList){ + this.sfList = serverFirstList; + } + + @Override + public void deserialize(IoBuffer data) { + + } + + @Override + public IoBuffer serialize() { + IoBuffer buffer; + + synchronized (sfList) { + String galaxy = NGECore.getInstance().getConfig().getString("GALAXY_NAME"); + buffer = IoBuffer.allocate(14 + galaxy.length()).order(ByteOrder.LITTLE_ENDIAN); + buffer.putShort((short) 2); + buffer.putInt(CRC.StringtoCRC("CollectionServerFirstListResponse")); + + buffer.put(getAsciiString(galaxy + ".0")); + buffer.putInt(sfList.size()); + + for (Entry entry : sfList.entrySet()) { + buffer.expand(entry.getValue().getBytes().length); + buffer.put(entry.getValue().getBytes()); + + } + return buffer.flip(); + } + } +} diff --git a/src/services/PlayerService.java b/src/services/PlayerService.java index c1d1095d..d04a1f98 100644 --- a/src/services/PlayerService.java +++ b/src/services/PlayerService.java @@ -41,6 +41,7 @@ import org.apache.mina.core.session.IoSession; import protocol.swg.CharacterSheetResponseMessage; import protocol.swg.ClientIdMsg; import protocol.swg.ClientMfdStatusUpdateMessage; +import protocol.swg.CollectionServerFirstListResponse; import protocol.swg.CreateClientPathMessage; import protocol.swg.ExpertiseRequestMessage; import protocol.swg.GuildRequestMessage; @@ -392,7 +393,19 @@ public class PlayerService implements INetworkDispatch { @Override public void handlePacket(IoSession session, IoBuffer buffer) throws Exception { + + Client client = core.getClient(session); + if (client == null) + return; + + SWGObject player = client.getParent(); + + if (player == null) + return; + + CollectionServerFirstListResponse response = new CollectionServerFirstListResponse(core.guildService.getGuildObject().getServerFirst()); + session.write(response.serialize()); } }); diff --git a/src/services/collections/CollectionService.java b/src/services/collections/CollectionService.java index 61671372..f7cbe42e 100644 --- a/src/services/collections/CollectionService.java +++ b/src/services/collections/CollectionService.java @@ -142,7 +142,7 @@ public class CollectionService implements INetworkDispatch { int bits = 0; boolean noScriptOnModify = false; boolean clearOnComplete = false; - boolean noMessage = true; + boolean noMessage = false; boolean grantIfPreReqMet = true; boolean buddyCollection = false; int numAltTitles = 0; @@ -359,7 +359,7 @@ public class CollectionService implements INetworkDispatch { } if (trackServerFirst) { - if (core.guildService.getGuildObject().addServerFirst(collectionName, new ServerFirst(creature.getCustomName(), System.currentTimeMillis()))) { + if (core.guildService.getGuildObject().addServerFirst(collectionName, new ServerFirst(creature.getCustomName(), creature.getObjectId(), collectionName, System.currentTimeMillis()))) { addCollection(creature, "bdg_server_first_01"); } } diff --git a/src/services/collections/ServerFirst.java b/src/services/collections/ServerFirst.java index 1a955ed2..2b855fb4 100644 --- a/src/services/collections/ServerFirst.java +++ b/src/services/collections/ServerFirst.java @@ -21,6 +21,8 @@ ******************************************************************************/ package services.collections; +import org.apache.mina.core.buffer.IoBuffer; + import resources.objects.Delta; import com.sleepycat.persist.model.Persistent; @@ -29,11 +31,15 @@ import com.sleepycat.persist.model.Persistent; public class ServerFirst extends Delta { private String name; + private String collection; private long time; + private long objectId; - public ServerFirst(String name, long time) { + public ServerFirst(String name, long objectId, String collection, long time) { this.name = name; + this.objectId = objectId; this.time = time; + this.collection = collection; } public ServerFirst() { @@ -48,9 +54,24 @@ public class ServerFirst extends Delta { return time; } + public long getObjectId() { + return objectId; + } + + public String getCollection() { + return collection; + } + @Override public byte[] getBytes() { - return new byte[] { }; + synchronized(objectMutex) { + IoBuffer buffer = createBuffer(18 + collection.length() + (name.length() * 2)); + buffer.putInt((int) time / 1000); + buffer.put(getAsciiString(collection)); + buffer.putLong(objectId); + buffer.put(getUnicodeString(name)); + return buffer.array(); + } } } From ca2401147dfa9644a99a6f50f5bbf54b7a19def9 Mon Sep 17 00:00:00 2001 From: Waverunner Date: Sat, 15 Mar 2014 13:50:36 -0400 Subject: [PATCH 02/28] Added Server First request, changed how response allocates bytes --- .../swg/CollectionServerFirstListRequest.java | 51 +++++++++++++++++++ .../CollectionServerFirstListResponse.java | 16 ++++-- src/services/PlayerService.java | 12 +++-- 3 files changed, 71 insertions(+), 8 deletions(-) create mode 100644 src/protocol/swg/CollectionServerFirstListRequest.java diff --git a/src/protocol/swg/CollectionServerFirstListRequest.java b/src/protocol/swg/CollectionServerFirstListRequest.java new file mode 100644 index 00000000..d22ef081 --- /dev/null +++ b/src/protocol/swg/CollectionServerFirstListRequest.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * 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 org.apache.mina.core.buffer.IoBuffer; + +public class CollectionServerFirstListRequest extends SWGMessage { + + private String server; + + public CollectionServerFirstListRequest() { + } + + @Override + public void deserialize(IoBuffer data) { + setServer(getAsciiString(data)); + } + + public String getServer() { + return server; + } + + @Override + public IoBuffer serialize() { + return null; + } + + public void setServer(String server) { + this.server = server; + } + +} diff --git a/src/protocol/swg/CollectionServerFirstListResponse.java b/src/protocol/swg/CollectionServerFirstListResponse.java index 74a01c2f..163627da 100644 --- a/src/protocol/swg/CollectionServerFirstListResponse.java +++ b/src/protocol/swg/CollectionServerFirstListResponse.java @@ -35,9 +35,11 @@ import engine.resources.common.CRC; public class CollectionServerFirstListResponse extends SWGMessage { private Map sfList; + private String server; - public CollectionServerFirstListResponse(Map serverFirstList){ + public CollectionServerFirstListResponse(String server, Map serverFirstList){ this.sfList = serverFirstList; + this.server = server; } @Override @@ -49,17 +51,21 @@ public class CollectionServerFirstListResponse extends SWGMessage { public IoBuffer serialize() { IoBuffer buffer; + int size = 0; + synchronized (sfList) { - String galaxy = NGECore.getInstance().getConfig().getString("GALAXY_NAME"); - buffer = IoBuffer.allocate(14 + galaxy.length()).order(ByteOrder.LITTLE_ENDIAN); + for (Entry entry : sfList.entrySet()) { + size += entry.getValue().getBytes().length; + } + + buffer = IoBuffer.allocate(12 + server.length() + size).order(ByteOrder.LITTLE_ENDIAN); buffer.putShort((short) 2); buffer.putInt(CRC.StringtoCRC("CollectionServerFirstListResponse")); - buffer.put(getAsciiString(galaxy + ".0")); + buffer.put(getAsciiString(server)); buffer.putInt(sfList.size()); for (Entry entry : sfList.entrySet()) { - buffer.expand(entry.getValue().getBytes().length); buffer.put(entry.getValue().getBytes()); } diff --git a/src/services/PlayerService.java b/src/services/PlayerService.java index d04a1f98..1f2a7b6c 100644 --- a/src/services/PlayerService.java +++ b/src/services/PlayerService.java @@ -41,6 +41,7 @@ import org.apache.mina.core.session.IoSession; import protocol.swg.CharacterSheetResponseMessage; import protocol.swg.ClientIdMsg; import protocol.swg.ClientMfdStatusUpdateMessage; +import protocol.swg.CollectionServerFirstListRequest; import protocol.swg.CollectionServerFirstListResponse; import protocol.swg.CreateClientPathMessage; import protocol.swg.ExpertiseRequestMessage; @@ -58,6 +59,7 @@ import resources.common.ObjControllerOpcodes; import resources.common.Opcodes; import resources.common.RGB; import resources.common.SpawnPoint; +import resources.common.StringUtilities; import resources.datatables.PlayerFlags; import resources.guild.Guild; import resources.objects.Buff; @@ -392,8 +394,9 @@ public class PlayerService implements INetworkDispatch { swgOpcodes.put(Opcodes.CollectionServerFirstListRequest, new INetworkRemoteEvent() { @Override - public void handlePacket(IoSession session, IoBuffer buffer) throws Exception { - + public void handlePacket(IoSession session, IoBuffer data) throws Exception { + data.order(ByteOrder.LITTLE_ENDIAN); + Client client = core.getClient(session); if (client == null) @@ -404,7 +407,10 @@ public class PlayerService implements INetworkDispatch { if (player == null) return; - CollectionServerFirstListResponse response = new CollectionServerFirstListResponse(core.guildService.getGuildObject().getServerFirst()); + CollectionServerFirstListRequest request = new CollectionServerFirstListRequest(); + request.deserialize(data); + + CollectionServerFirstListResponse response = new CollectionServerFirstListResponse(request.getServer(), core.guildService.getGuildObject().getServerFirst()); session.write(response.serialize()); } From fc35adbf7863630f303da2c65446f7663343f45e Mon Sep 17 00:00:00 2001 From: Waverunner Date: Sat, 15 Mar 2014 14:30:09 -0400 Subject: [PATCH 03/28] ServerListResponse not sent on login anymore --- src/protocol/swg/CollectionServerFirstListRequest.java | 2 ++ src/services/PlayerService.java | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/protocol/swg/CollectionServerFirstListRequest.java b/src/protocol/swg/CollectionServerFirstListRequest.java index d22ef081..cc053664 100644 --- a/src/protocol/swg/CollectionServerFirstListRequest.java +++ b/src/protocol/swg/CollectionServerFirstListRequest.java @@ -32,6 +32,8 @@ public class CollectionServerFirstListRequest extends SWGMessage { @Override public void deserialize(IoBuffer data) { + data.getShort(); + data.getInt(); setServer(getAsciiString(data)); } diff --git a/src/services/PlayerService.java b/src/services/PlayerService.java index 1f2a7b6c..5c6f5982 100644 --- a/src/services/PlayerService.java +++ b/src/services/PlayerService.java @@ -396,7 +396,8 @@ public class PlayerService implements INetworkDispatch { @Override public void handlePacket(IoSession session, IoBuffer data) throws Exception { data.order(ByteOrder.LITTLE_ENDIAN); - + data.position(0); + Client client = core.getClient(session); if (client == null) @@ -409,8 +410,13 @@ public class PlayerService implements INetworkDispatch { CollectionServerFirstListRequest request = new CollectionServerFirstListRequest(); request.deserialize(data); + + String server = request.getServer(); + System.out.println(server); + if (server == null || server.equals("")) + return; - CollectionServerFirstListResponse response = new CollectionServerFirstListResponse(request.getServer(), core.guildService.getGuildObject().getServerFirst()); + CollectionServerFirstListResponse response = new CollectionServerFirstListResponse(server, core.guildService.getGuildObject().getServerFirst()); session.write(response.serialize()); } From ffc9aec1b196244e632f109c6b2d82cb124176fe Mon Sep 17 00:00:00 2001 From: Waverunner Date: Sat, 22 Mar 2014 11:47:37 -0400 Subject: [PATCH 04/28] Added Inspiration ticks, effects for Multi-Tier Performance Abilities (BugFix) Build-A-Buff applies correct stats now -- NOTE: Stats that the player does not have yet may not show in character sheet but the server will recognize still recognize their new stats (Added) Inspiration Ticks (BugFix) Inspiration Buffs time corresponds to the players inspiration ticks. (BugFix) "Watch" on radial menu working again (Added) Put in the effects for the multi-tiered performance abilities (Feature) You can now type /[performance effect] [tier number] to use that specific effect (BugFix) showFlyText boolean for showing to observers or not (fixes other players exp gain shown to other players) (Code) Few minor additions/fixes --- scripts/buffs/buildabuff_inspiration.py | 7 +- scripts/commands/colorlights.py | 17 ++++- scripts/commands/dazzle.py | 17 ++++- scripts/commands/distract.py | 17 ++++- scripts/commands/firejet.py | 19 +++-- scripts/commands/inspire.py | 2 +- scripts/commands/smokebomb.py | 17 ++++- scripts/commands/spotlight.py | 23 +++--- scripts/commands/ventriloquism.py | 17 ++++- .../expertise_en_intense_performer_1.py | 5 +- .../expertise_en_intense_performer_2.py | 3 +- .../expertise_en_intense_performer_3.py | 3 +- .../expertise_en_intense_performer_4.py | 3 +- .../expertise_en_lasting_impression_1.py | 3 +- .../expertise_en_lasting_impression_2.py | 3 +- .../expertise_en_lasting_impression_3.py | 3 +- .../expertise_en_lasting_impression_4.py | 3 +- scripts/radial/player.py | 4 +- .../objectControllerObjects/ShowFlyText.java | 11 ++- src/resources/common/MathUtilities.java | 24 ++++++ .../objects/creature/CreatureObject.java | 9 ++- .../objects/tangible/TangibleObject.java | 12 +++ src/services/ConnectionService.java | 14 ++++ src/services/EntertainmentService.java | 75 +++++++++++++++---- 24 files changed, 242 insertions(+), 69 deletions(-) diff --git a/scripts/buffs/buildabuff_inspiration.py b/scripts/buffs/buildabuff_inspiration.py index c6bf7407..801733ca 100644 --- a/scripts/buffs/buildabuff_inspiration.py +++ b/scripts/buffs/buildabuff_inspiration.py @@ -8,10 +8,13 @@ def setup(core, actor, buff): if buffWorkshop is None: return - buff.setDuration(3600) #1 hour - + attached = actor.getAttachment('inspireDuration') + print (attached) + buff.setDuration(float(actor.getAttachment('inspireDuration') * 60)) + print ('Buff Duration: ' + str(actor.getAttachment('inspireDuration'))) for BuffItem in buffWorkshop: core.skillModService.addSkillMod(actor, BuffItem.getSkillName(), BuffItem.getAffectAmount()) + print ('Gave skill mod ' + BuffItem.getSkillName() + ' with affect of ' + str(BuffItem.getAffectAmount())) return diff --git a/scripts/commands/colorlights.py b/scripts/commands/colorlights.py index abaa8dd2..b92c9c34 100644 --- a/scripts/commands/colorlights.py +++ b/scripts/commands/colorlights.py @@ -6,14 +6,23 @@ def setup(): def run(core, actor, target, commandString): command = 'ColorLights1' - effect = 'entertainer_color_lights_level_1.cef' + effect = 'clienteffect/entertainer_color_lights_level_1.cef' + rLevel = 4 # minimum level to perform this effect - if actor.getLevel() < 4: + if commandString == '2': + command = 'ColorLights2' + effect = 'clienteffect/entertainer_color_lights_level_2.cef' + rLevel = 20 + + elif commandString == '3': + command = 'ColorLights3' + effect = 'clienteffect/entertainer_color_lights_level_3.cef' + rLevel = 50 + + if actor.getLevel() < rLevel: actor.sendSystemMessage('@performance:effect_lack_skill_self') return - # TODO: Find out levels for other colored light 2 and 3 - if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_color_lights', 0) return \ No newline at end of file diff --git a/scripts/commands/dazzle.py b/scripts/commands/dazzle.py index 718c6c5d..25ac5068 100644 --- a/scripts/commands/dazzle.py +++ b/scripts/commands/dazzle.py @@ -6,14 +6,23 @@ def setup(): def run(core, actor, target, commandString): command = 'Dazzle1' - effect = 'entertainer_dazzle_level_1.cef' + effect = 'clienteffect/entertainer_dazzle_level_1.cef' + rLevel = 10 # minimum level to perform this effect - if actor.getLevel() < 10: + if commandString == '2': + command = 'Dazzle2' + effect = 'clienteffect/entertainer_dazzle_level_2.cef' + rLevel = 20 + + elif commandString == '3': + command = 'Dazzle3' + effect = 'clienteffect/entertainer_dazzle_level_3.cef' + rLevel = 30 + + if actor.getLevel() < rLevel: actor.sendSystemMessage('@performance:effect_lack_skill_self') return - # TODO: Find out levels for other dazzle 2 and 3 - if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_dazzle', 0) return \ No newline at end of file diff --git a/scripts/commands/distract.py b/scripts/commands/distract.py index 6c1eb887..d92cb55e 100644 --- a/scripts/commands/distract.py +++ b/scripts/commands/distract.py @@ -6,14 +6,23 @@ def setup(): def run(core, actor, target, commandString): command = 'Distract1' - effect = 'entertainer_distract_level_1.cef' + effect = 'clienteffect/entertainer_distract_level_1.cef' + rLevel = 18 # minimum level to perform this effect - if actor.getLevel() < 18: + if commandString == '2': + command = 'Distract2' + effect = 'clienteffect/entertainer_distract_level_2.cef' + rLevel = 50 + + elif commandString == '3': + command = 'Distract3' + effect = 'clienteffect/entertainer_distract_level_3.cef' + rLevel = 75 + + if actor.getLevel() < rLevel: actor.sendSystemMessage('@performance:effect_lack_skill_self') return - # TODO: Find out levels for other distract 2 and 3 - if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_distract', 0) return \ No newline at end of file diff --git a/scripts/commands/firejet.py b/scripts/commands/firejet.py index 42179337..63a5ba54 100644 --- a/scripts/commands/firejet.py +++ b/scripts/commands/firejet.py @@ -6,14 +6,23 @@ def setup(): def run(core, actor, target, commandString): command = 'FireJets1' - effect = 'entertainer_fire_jets_level_1.cef' + effect = 'clienteffect/entertainer_fire_jets_level_1.cef' + rLevel = 26 # minimum level to perform this effect - if actor.getLevel() < 26: + if commandString == '2': + command = 'FireJets2' + effect = 'clienteffect/entertainer_fire_jets_level_2.cef' + rLevel = 50 + + elif commandString == '3': + command = 'FireJets3' + effect = 'clienteffect/entertainer_fire_jets_level_3.cef' + rLevel = 75 + + if actor.getLevel() < rLevel: actor.sendSystemMessage('@performance:effect_lack_skill_self') return - - # TODO: Find out levels for other firejets 2 and 3 - + if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_fire_jets', 0) return \ No newline at end of file diff --git a/scripts/commands/inspire.py b/scripts/commands/inspire.py index 531aa1e2..dea0e544 100644 --- a/scripts/commands/inspire.py +++ b/scripts/commands/inspire.py @@ -7,7 +7,7 @@ def setup(): def run(core, actor, target, commandString): playerObject = actor.getSlottedObject('ghost') - print playerObject.getProfession() + if not playerObject or playerObject.getProfession() != "entertainer_1a": return diff --git a/scripts/commands/smokebomb.py b/scripts/commands/smokebomb.py index 01b2bf52..ace39704 100644 --- a/scripts/commands/smokebomb.py +++ b/scripts/commands/smokebomb.py @@ -6,14 +6,23 @@ def setup(): def run(core, actor, target, commandString): command = 'SmokeBomb1' - effect = 'entertainer_smoke_bomb_level_1.cef' + effect = 'clienteffect/entertainer_smoke_bomb_level_1.cef' + rLevel = 50 # minimum level to perform this effect - if actor.getLevel() < 50: + if commandString == '2': + command = 'SmokeBomb2' + effect = 'clienteffect/entertainer_smoke_bomb_level_2.cef' + rLevel = 75 + + elif commandString == '3': + command = 'SmokeBomb3' + effect = 'clienteffect/entertainer_smoke_bomb_level_3.cef' + rLevel = 90 + + if actor.getLevel() < rLevel: actor.sendSystemMessage('@performance:effect_lack_skill_self') return - # TODO: Find out levels for other smoke bomb 2 and 3 - if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_smoke_bomb', 0) return \ No newline at end of file diff --git a/scripts/commands/spotlight.py b/scripts/commands/spotlight.py index 25341536..1f94394a 100644 --- a/scripts/commands/spotlight.py +++ b/scripts/commands/spotlight.py @@ -8,17 +8,22 @@ def run(core, actor, target, commandString): command = 'SpotLight1' effect = 'clienteffect/entertainer_spot_light_level_1.cef' + rLevel = 1 # minimum level to perform this effect - # TODO: Figure out what levels the spotlight effects upgraded at. - - if actor.getLevel() >= 80: - command == 'SpotLight3' - effect = 'clienteffect/entertainer_spot_light_level_3.cef' - - elif actor.getLevel() >= 40: - command == 'SpotLight2' + if commandString == '2': + command = 'SpotLight2' effect = 'clienteffect/entertainer_spot_light_level_2.cef' - + rLevel = 20 + + elif commandString == '3': + command = 'SpotLight3' + effect = 'clienteffect/entertainer_spot_light_level_3.cef' + rLevel = 30 + + if actor.getLevel() < rLevel: + actor.sendSystemMessage('@performance:effect_lack_skill_self') + return + if core.entertainmentService.performEffect(actor, command, effect, None) is True: actor.sendSystemMessage('@performance:effect_perform_spot_light', 0) return diff --git a/scripts/commands/ventriloquism.py b/scripts/commands/ventriloquism.py index 198516f4..34d941e9 100644 --- a/scripts/commands/ventriloquism.py +++ b/scripts/commands/ventriloquism.py @@ -6,14 +6,23 @@ def setup(): def run(core, actor, target, commandString): command = 'Ventriloquism1' - effect = 'entertainer_ventriloquism_level_1.cef' + effect = 'clienteffect/entertainer_ventriloquism_level_1.cef' + rLevel = 58 # minimum level to perform this effect - if actor.getLevel() < 58: + if commandString == '2': + command = 'Ventriloquism2' + effect = 'clienteffect/entertainer_ventriloquism_level_2.cef' + rLevel = 75 + + elif commandString == '3': + command = 'Ventriloquism3' + effect = 'clienteffect/entertainer_ventriloquism_level_3.cef' + rLevel = 90 + + if actor.getLevel() < rLevel: actor.sendSystemMessage('@performance:effect_lack_skill_self') return - # TODO: Find out levels for other ventriloquism 2 and 3 - if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_ventriloquism', 0) return \ No newline at end of file diff --git a/scripts/expertise/expertise_en_intense_performer_1.py b/scripts/expertise/expertise_en_intense_performer_1.py index cf9f9699..8925253a 100644 --- a/scripts/expertise/expertise_en_intense_performer_1.py +++ b/scripts/expertise/expertise_en_intense_performer_1.py @@ -11,8 +11,8 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_intense_performer_1') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) addAbilities(core, actor, player) - return def removeExpertisePoint(core, actor): @@ -26,9 +26,8 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_intense_performer_1') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) removeAbilities(core, actor, player) - return # this checks what abilities the player gets by level, need to also call this on level-up diff --git a/scripts/expertise/expertise_en_intense_performer_2.py b/scripts/expertise/expertise_en_intense_performer_2.py index 0582a021..f0327c0c 100644 --- a/scripts/expertise/expertise_en_intense_performer_2.py +++ b/scripts/expertise/expertise_en_intense_performer_2.py @@ -11,6 +11,7 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_intense_performer_2') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) addAbilities(core, actor, player) return @@ -26,7 +27,7 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_intense_performer_2') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) removeAbilities(core, actor, player) return diff --git a/scripts/expertise/expertise_en_intense_performer_3.py b/scripts/expertise/expertise_en_intense_performer_3.py index 5ee49acf..ac3eb24a 100644 --- a/scripts/expertise/expertise_en_intense_performer_3.py +++ b/scripts/expertise/expertise_en_intense_performer_3.py @@ -11,6 +11,7 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_intense_performer_3') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) addAbilities(core, actor, player) return @@ -26,7 +27,7 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_intense_performer_3') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) removeAbilities(core, actor, player) return diff --git a/scripts/expertise/expertise_en_intense_performer_4.py b/scripts/expertise/expertise_en_intense_performer_4.py index 29b5eb73..5e316992 100644 --- a/scripts/expertise/expertise_en_intense_performer_4.py +++ b/scripts/expertise/expertise_en_intense_performer_4.py @@ -11,6 +11,7 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_intense_performer_4') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) addAbilities(core, actor, player) return @@ -26,7 +27,7 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_intense_performer_4') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_pulse_duration_increase', 1) removeAbilities(core, actor, player) return diff --git a/scripts/expertise/expertise_en_lasting_impression_1.py b/scripts/expertise/expertise_en_lasting_impression_1.py index 960c9b75..1ce042fc 100644 --- a/scripts/expertise/expertise_en_lasting_impression_1.py +++ b/scripts/expertise/expertise_en_lasting_impression_1.py @@ -11,6 +11,7 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_lasting_impression_1') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) addAbilities(core, actor, player) return @@ -26,7 +27,7 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_lasting_impression_1') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) removeAbilities(core, actor, player) return diff --git a/scripts/expertise/expertise_en_lasting_impression_2.py b/scripts/expertise/expertise_en_lasting_impression_2.py index 0ef56c25..5daf6031 100644 --- a/scripts/expertise/expertise_en_lasting_impression_2.py +++ b/scripts/expertise/expertise_en_lasting_impression_2.py @@ -11,6 +11,7 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_lasting_impression_2') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) addAbilities(core, actor, player) return @@ -26,7 +27,7 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_lasting_impression_2') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) removeAbilities(core, actor, player) return diff --git a/scripts/expertise/expertise_en_lasting_impression_3.py b/scripts/expertise/expertise_en_lasting_impression_3.py index 74107ef2..8a4642bd 100644 --- a/scripts/expertise/expertise_en_lasting_impression_3.py +++ b/scripts/expertise/expertise_en_lasting_impression_3.py @@ -11,6 +11,7 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_lasting_impression_3') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) addAbilities(core, actor, player) return @@ -26,7 +27,7 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_lasting_impression_3') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) removeAbilities(core, actor, player) return diff --git a/scripts/expertise/expertise_en_lasting_impression_4.py b/scripts/expertise/expertise_en_lasting_impression_4.py index b71d1b91..086a38c9 100644 --- a/scripts/expertise/expertise_en_lasting_impression_4.py +++ b/scripts/expertise/expertise_en_lasting_impression_4.py @@ -11,6 +11,7 @@ def addExpertisePoint(core, actor): return actor.addSkill('expertise_en_lasting_impression_4') + core.skillModService.addSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) addAbilities(core, actor, player) return @@ -26,7 +27,7 @@ def removeExpertisePoint(core, actor): return actor.removeSkill('expertise_en_lasting_impression_4') - + core.skillModService.deductSkillMod(actor, 'expertise_en_inspire_buff_duration_increase', 30) removeAbilities(core, actor, player) return diff --git a/scripts/radial/player.py b/scripts/radial/player.py index 3ca2cc75..4b6d74bd 100644 --- a/scripts/radial/player.py +++ b/scripts/radial/player.py @@ -5,9 +5,9 @@ import sys def createRadial(core, owner, target, radials): if target.getPosture() == Posture.SkillAnimating: if target.getPerformanceType() is True: - radials.add(RadialOptions(0, 140, 1, 'Watch')) + radials.add(RadialOptions(0, 140, 3, 'Watch')) else: - radials.add(RadialOptions(0, 140, 1, 'Listen')) + radials.add(RadialOptions(0, 140, 3, 'Listen')) return diff --git a/src/protocol/swg/objectControllerObjects/ShowFlyText.java b/src/protocol/swg/objectControllerObjects/ShowFlyText.java index 41325368..f47bbbb2 100644 --- a/src/protocol/swg/objectControllerObjects/ShowFlyText.java +++ b/src/protocol/swg/objectControllerObjects/ShowFlyText.java @@ -27,6 +27,7 @@ import org.apache.mina.core.buffer.IoBuffer; import protocol.swg.ObjControllerMessage; import resources.common.RGB; +import resources.common.StringUtilities; public class ShowFlyText extends ObjControllerObject { @@ -70,6 +71,7 @@ public class ShowFlyText extends ObjControllerObject { this.scale = scale; this.color = color; this.alternativeStructure = true; + this.displayType = displayType; } @Override @@ -117,13 +119,16 @@ public class ShowFlyText extends ObjControllerObject { result.putLong(0); result.putLong(0); result.putLong(0); - result.put(getUnicodeString(customText)); - result.putShort(xp); + result.put(getUnicodeString(customText)); // %TO? + result.putShort(xp); // %DI ? result.putLong(0); result.putFloat(scale); result.put(color.getBytes()); result.putInt(displayType); - return result.flip(); + + result.flip(); + //StringUtilities.printBytes(result.array()); + return result; } } diff --git a/src/resources/common/MathUtilities.java b/src/resources/common/MathUtilities.java index 8cf73cc0..8decf30b 100644 --- a/src/resources/common/MathUtilities.java +++ b/src/resources/common/MathUtilities.java @@ -21,6 +21,8 @@ ******************************************************************************/ package resources.common; +import java.math.BigDecimal; + import engine.resources.scene.*; public class MathUtilities { @@ -43,5 +45,27 @@ public class MathUtilities { q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x); } + + /** + * Converts seconds to a whole hour. + * @author Waverunner + * @param seconds + * @return hour(s) + */ + public static int secondsToWholeHours(int seconds) { + BigDecimal dec = new BigDecimal(seconds); + return dec.divide(new BigDecimal(3600), BigDecimal.ROUND_FLOOR).intValue(); + } + + /** + * Converts seconds to minutes of the hour. + * @author Waverunner + * @param seconds + * @return hour(s) + */ + public static int secondsToHourMinutes(int seconds) { + BigDecimal dec = new BigDecimal(seconds); + return dec.remainder(new BigDecimal(3600)).divide(new BigDecimal(60), BigDecimal.ROUND_FLOOR).intValue(); + } } diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index 46d13369..012324e9 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -435,11 +435,15 @@ public class CreatureObject extends TangibleObject implements IPersistent { } public ScheduledFuture getInspirationTick() { - return inspirationTick; + synchronized(objectMutex) { + return inspirationTick; + } } public void setInspirationTick(ScheduledFuture inspirationTick) { - this.inspirationTick = inspirationTick; + synchronized(objectMutex) { + this.inspirationTick = inspirationTick; + } } @Override @@ -570,6 +574,7 @@ public class CreatureObject extends TangibleObject implements IPersistent { public void addSkillMod(String name, int base) { if(getSkillMod(name) == null) { + // TODO: This will need to be fixed as it doesn't update in the character sheet properly (wrong delta) SkillMod skillMod = new SkillMod(); skillMod.setBase(base); skillMod.setSkillModString(name); diff --git a/src/resources/objects/tangible/TangibleObject.java b/src/resources/objects/tangible/TangibleObject.java index 587daa91..edadfaf2 100644 --- a/src/resources/objects/tangible/TangibleObject.java +++ b/src/resources/objects/tangible/TangibleObject.java @@ -321,6 +321,18 @@ public class TangibleObject extends SWGObject { } } + public void showFlyText(String stfFile, String stfString, String customText, int xp, float scale, RGB color, int displayType, int unkInt) { + Set observers = getObservers(); + + if (getClient() != null) { + getClient().getSession().write((new ObjControllerMessage(0x0000000B, new ShowFlyText(getObjectID(), getObjectID(), unkInt, 1, 1, -1, stfFile, stfString, customText, xp, scale, color, displayType))).serialize()); + } + + for (Client client : observers) { + client.getSession().write((new ObjControllerMessage(0x0000000B, new ShowFlyText(client.getParent().getObjectID(), getObjectID(), unkInt, 1, 1, -1, stfFile, stfString, customText, xp, scale, color, displayType))).serialize()); + } + } + public void playEffectObject(String effectFile, String commandString) { notifyObservers(new PlayClientEffectObjectMessage(effectFile, getObjectID(), commandString), true); } diff --git a/src/services/ConnectionService.java b/src/services/ConnectionService.java index c0d5405e..9791848a 100644 --- a/src/services/ConnectionService.java +++ b/src/services/ConnectionService.java @@ -195,6 +195,20 @@ public class ConnectionService implements INetworkDispatch { object.setInviteCounter(0); object.setInviteSenderId(0); object.setInviteSenderName(""); + + if(object.getAttachment("inspireDuration") != null) + object.setAttachment("inspireDuration", null); + + if(object.getInspirationTick() != null) { + object.getInspirationTick().cancel(true); + object.setInspirationTick(null); + } + + if(object.getSpectatorTask() != null) { + object.getSpectatorTask().cancel(true); + object.setSpectatorTask(null); + } + core.groupService.handleGroupDisband(object); for (CreatureObject opponent : object.getDuelList()) { diff --git a/src/services/EntertainmentService.java b/src/services/EntertainmentService.java index b45b0c8d..bc93d2cc 100644 --- a/src/services/EntertainmentService.java +++ b/src/services/EntertainmentService.java @@ -24,13 +24,16 @@ import protocol.swg.objectControllerObjects.BuffBuilderEndMessage; import protocol.swg.objectControllerObjects.BuffBuilderStartMessage; import resources.common.BuffBuilder; import resources.common.Console; +import resources.common.MathUtilities; import resources.common.ObjControllerOpcodes; import resources.common.Performance; import resources.common.PerformanceEffect; +import resources.common.RGB; import resources.common.StringUtilities; import resources.datatables.Posture; import resources.objects.Buff; import resources.objects.BuffItem; +import resources.objects.SWGList; import resources.objects.creature.CreatureObject; import resources.objects.player.PlayerObject; import resources.objects.tangible.TangibleObject; @@ -38,6 +41,7 @@ import engine.clientdata.ClientFileManager; import engine.clientdata.visitors.DatatableVisitor; import engine.clients.Client; import engine.resources.objects.SWGObject; +import engine.resources.objects.SkillMod; import engine.resources.service.INetworkDispatch; import engine.resources.service.INetworkRemoteEvent; @@ -70,7 +74,7 @@ public class EntertainmentService implements INetworkDispatch { public void handlePacket(IoSession session, IoBuffer data) throws Exception { data.order(ByteOrder.LITTLE_ENDIAN); - StringUtilities.printBytes(data.array()); + Client client = core.getClient(session); if(client == null) @@ -145,8 +149,8 @@ public class EntertainmentService implements INetworkDispatch { Vector statBuffs = sentPacket.getStatBuffs(); - SWGObject buffer = core.objectService.getObject(sentPacket.getBufferId()); - SWGObject buffRecipient = core.objectService.getObject(sentPacket.getBuffRecipientId()); + CreatureObject buffer = (CreatureObject) core.objectService.getObject(sentPacket.getBufferId()); + CreatureObject buffRecipient = (CreatureObject) core.objectService.getObject(sentPacket.getBuffRecipientId()); if (buffer != buffRecipient) { @@ -354,7 +358,7 @@ public class EntertainmentService implements INetworkDispatch { core.commandService.registerCommand("ventriloquism"); } - public void giveInspirationBuff(SWGObject reciever, Vector buffVector) { + public void giveInspirationBuff(CreatureObject reciever, Vector buffVector) { CreatureObject buffCreature = (CreatureObject) reciever; Vector availableStats = buffBuilderSkills; @@ -372,19 +376,13 @@ public class EntertainmentService implements INetworkDispatch { BuffItem stat = new BuffItem(builder.getStatAffects(), item.getInvested(), item.getEntertainerBonus()); stat.setAffectAmount(affectTotal); - - /*System.out.println("Invested Points: " + item.getInvested()); - System.out.println("Entertainer Bonus: " + item.getEntertainerBonus()); - System.out.println("Affect Total: " + affectTotal);*/ stats.add(stat); - - break; } } } - reciever.setAttachment("buffWorkshop", buffVector); + reciever.setAttachment("buffWorkshop", stats); core.buffService.addBuffToCreature(buffCreature, "buildabuff_inspiration"); @@ -481,6 +479,7 @@ public class EntertainmentService implements INetworkDispatch { } public void startSpectating(final CreatureObject spectator, final CreatureObject performer) { + final ScheduledFuture spectatorTask = scheduler.scheduleAtFixedRate(new Runnable() { @Override @@ -499,14 +498,20 @@ public class EntertainmentService implements INetworkDispatch { } spectator.setMoodAnimation("neutral"); performer.removeAudience(spectator); - - spectator.getSpectatorTask().cancel(true); + + if (spectator.getInspirationTick().cancel(true)) + spectator.getSpectatorTask().cancel(true); } } }, 2, 2, TimeUnit.SECONDS); spectator.setSpectatorTask(spectatorTask); + + if(((PlayerObject)performer.getSlottedObject("ghost")).getProfession().equals("entertainer_1a")) { + handleInspirationTicks(spectator, performer); + } + } public void performFlourish(final CreatureObject performer, int flourish) { @@ -547,8 +552,6 @@ public class EntertainmentService implements INetworkDispatch { String performance = (performer.getPerformanceType()) ? "dance" : "music"; - // TODO: Skill Level check - if(performer.isPerformingEffect()) { performer.sendSystemMessage("@performance:effect_wait_self", (byte) 0); return false; @@ -591,6 +594,48 @@ public class EntertainmentService implements INetworkDispatch { return true; } + public void handleInspirationTicks(final CreatureObject spectator, final CreatureObject performer) { + // http://youtu.be/WqyAde-oC7o?t=11m14s << Player watching entertainer (Has ring only, no pet, + 15 min ticks) + // TODO: Camp/Cantina checks for expertise and duration bonus %. Right now only using basic values. + final ScheduledFuture inspirationTick = scheduler.scheduleAtFixedRate(new Runnable() { + + @Override + public void run() { + int time = 0; // current buff duration time (minutes) + int buffCap = 215; // 5 hours 35 minutes - 2 hours (buff duration increase bonus) << Taken from video, doesn't account for performance bonuses etc. + + if (spectator.getAttachment("inspireDuration") != null) + time+= (int) spectator.getAttachment("inspireDuration"); + + if (performer.getSkillMod("expertise_en_inspire_buff_duration_increase") != null) { + SkillMod durationMod = performer.getSkillMod("expertise_en_inspire_buff_duration_increase"); + buffCap += durationMod.getBase() + durationMod.getModifier(); + } + + if (time == buffCap) { + + } else { + int entTick = 10; + if (performer.getSkillMod("expertise_en_inspire_pulse_duration_increase") != null) { + SkillMod pulseMod = performer.getSkillMod("expertise_en_inspire_pulse_duration_increase"); + entTick += pulseMod.getBase() + pulseMod.getModifier(); + } + + int duration = (time + entTick); // minutes + int hMinutes = MathUtilities.secondsToHourMinutes(duration * 60); + int hours = MathUtilities.secondsToWholeHours(duration * 60); + + spectator.showFlyText("spam", "buff_duration_tick_observer", String.valueOf(hours) + " hours , " + hMinutes + " minutes ", 0, (float) 0.66, new RGB(255, 182, 193), 3, 78); + + spectator.setAttachment("inspireDuration", duration); + //System.out.println("Inspire Duration: " + spectator.getAttachment("inspireDuration") + " on " + spectator.getCustomName()); + } + } + + }, 10, 10, TimeUnit.SECONDS); + spectator.setInspirationTick(inspirationTick); + } + @Override public void shutdown() { From b36fc0eb9514ccd1a07a00b6bbbcf40f36e19d65 Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Sun, 23 Mar 2014 06:26:32 +0100 Subject: [PATCH 05/28] Scripts - Roadmap rewards are now located in profession roadmap scripts --- scripts/roadmap/bounty_hunter_1a.py | 94 ++++++++++++++++++++ scripts/roadmap/commando_1a.py | 3 + scripts/roadmap/entertainer_1a.py | 3 + scripts/roadmap/force_sensitive_1a.py | 25 ++++++ scripts/roadmap/medic_1a.py | 3 + scripts/roadmap/officer_1a.py | 3 + scripts/roadmap/roadmap_rewards.py | 122 -------------------------- scripts/roadmap/smuggler_1a.py | 3 + scripts/roadmap/spy_1a.py | 3 + scripts/roadmap/trader_0a.py | 3 + scripts/roadmap/trader_0b.py | 3 + scripts/roadmap/trader_0c.py | 3 + scripts/roadmap/trader_0d.py | 3 + src/services/PlayerService.java | 2 +- 14 files changed, 150 insertions(+), 123 deletions(-) delete mode 100644 scripts/roadmap/roadmap_rewards.py diff --git a/scripts/roadmap/bounty_hunter_1a.py b/scripts/roadmap/bounty_hunter_1a.py index 7bb425e3..0c708fec 100644 --- a/scripts/roadmap/bounty_hunter_1a.py +++ b/scripts/roadmap/bounty_hunter_1a.py @@ -23,3 +23,97 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + if name == 'item_bounty_hunter_backpack_01_02': + return "object/tangible/wearables/backpack/shared_backpack_s05.iff" + + if name == 'armor_bounty_hunter_roadmap_bicep_l_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_bicep_l.iff" + + if name == 'armor_bounty_hunter_roadmap_bicep_r_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_bicep_r.iff" + + if name == 'armor_bounty_hunter_roadmap_bracer_l_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_bracer_l.iff" + + if name == 'armor_bounty_hunter_roadmap_bracer_r_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_bracer_r.iff" + + if name == 'armor_bounty_hunter_roadmap_boots_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_boots.iff" + + if name == 'armor_bounty_hunter_roadmap_chest_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_chest_plate.iff" + + if name == 'armor_bounty_hunter_roadmap_gloves_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_gloves.iff" + + if name == 'armor_bounty_hunter_roadmap_helmet_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_helmet.iff" + + if name == 'armor_bounty_hunter_roadmap_leggings_02_01': + return "object/tangible/wearables/armor/composite/shared_armor_composite_leggings.iff" + + if name == 'armor_wookiee_roadmap_chest_02_03': + return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_chestplate.iff" + + if name == 'armor_wookiee_roadmap_leggings_02_03': + return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_leggings.iff" + + if name == 'armor_wookiee_roadmap_bicep_l_02_03': + return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bicep_l.iff" + + if name == 'armor_wookiee_roadmap_bicep_r_02_03': + return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bicep_r.iff" + + if name == 'armor_wookiee_roadmap_bracer_l_02_03': + return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bracer_l.iff" + + if name == 'armor_wookiee_roadmap_bracer_r_02_03': + return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bracer_r.iff" + + if name == 'armor_ithorian_roadmap_chest_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_chest_plate.iff" + + if name == 'armor_ithorian_roadmap_leggings_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_leggings.iff" + + if name == 'armor_ithorian_roadmap_helmet_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_helmet.iff" + + if name == 'armor_ithorian_roadmap_bicep_l_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bicep_l.iff" + + if name == 'armor_ithorian_roadmap_bicep_r_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bicep_r.iff" + + if name == 'armor_ithorian_roadmap_bracer_l_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bracer_l.iff" + + if name == 'armor_ithorian_roadmap_bracer_r_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bracer_r.iff" + + if name == 'armor_ithorian_roadmap_boots_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_boots.iff" + + if name == 'armor_ithorian_roadmap_gloves_02_03': + return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_gloves.iff" + + if name == 'weapon_carbine_bh_roadmap_01_02': + return "object/weapon/ranged/carbine/shared_carbine_ee3.iff" + + if name == 'item_bounty_hunter_ring_01_02': + return "object/tangible/wearables/ring/shared_ring_s02.iff" + + if name == 'weapon_rifle_bh_roadmap_01_02': + return "object/weapon/ranged/rifle/shared_rifle_lightning.iff" + + if name == 'item_bounty_hunter_pendant_01_02': + return "object/tangible/wearables/necklace/shared_necklace_s02.iff" + + if name == 'item_bounty_hunter_clicky_01_02': + return "object/tangible/loot/generic_usable/shared_survey_pad_adv_generic.iff" + + if name == 'item_roadmap_belt_bounty_hunter_01_02': + return "object/tangible/wearables/armor/zam/shared_armor_zam_wesell_belt.iff" \ No newline at end of file diff --git a/scripts/roadmap/commando_1a.py b/scripts/roadmap/commando_1a.py index 8d9253ae..67cdb14b 100644 --- a/scripts/roadmap/commando_1a.py +++ b/scripts/roadmap/commando_1a.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/entertainer_1a.py b/scripts/roadmap/entertainer_1a.py index 0541cc93..efe33465 100644 --- a/scripts/roadmap/entertainer_1a.py +++ b/scripts/roadmap/entertainer_1a.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/force_sensitive_1a.py b/scripts/roadmap/force_sensitive_1a.py index 2d9241b0..9fd5ca69 100644 --- a/scripts/roadmap/force_sensitive_1a.py +++ b/scripts/roadmap/force_sensitive_1a.py @@ -23,3 +23,28 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + if name == 'item_force_sensitive_ring_02_01': + return "object/tangible/wearables/ring/shared_ring_s02.iff" + + if name == 'item_npe_fs_robe_02_02': + return "object/tangible/wearables/robe/shared_robe_jedi_padawan.iff" + + if name == 'weapon_roadmap_lightsaber_02_02': + return "object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_s1.iff" + + if name == 'item_force_sensitive_ring_01_02': + return "object/tangible/wearables/ring/shared_ring_s01.iff" + + if name == 'item_krayt_pearl_04_01': + return "object/tangible/component/weapon/lightsaber/shared_lightsaber_module_krayt_dragon_pearl.iff" + + if name == 'item_force_sensitive_pendant_01_02': + return "object/tangible/wearables/necklace/shared_necklace_s12.iff" + + if name == 'item_force_sensitive_clicky_01_02': + return "object/tangible/loot/generic_usable/shared_generic_crystal.iff" + + if name == 'item_roadmap_belt_force_sensitive_01_02': + return "object/tangible/wearables/armor/zam/shared_armor_zam_wesell_belt.iff" \ No newline at end of file diff --git a/scripts/roadmap/medic_1a.py b/scripts/roadmap/medic_1a.py index 6b84327b..e6f67dfb 100644 --- a/scripts/roadmap/medic_1a.py +++ b/scripts/roadmap/medic_1a.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/officer_1a.py b/scripts/roadmap/officer_1a.py index 25e7254f..83bca56f 100644 --- a/scripts/roadmap/officer_1a.py +++ b/scripts/roadmap/officer_1a.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/roadmap_rewards.py b/scripts/roadmap/roadmap_rewards.py deleted file mode 100644 index a764248f..00000000 --- a/scripts/roadmap/roadmap_rewards.py +++ /dev/null @@ -1,122 +0,0 @@ -import sys - -def get(name): - # Jedi # - if name == 'item_force_sensitive_ring_02_01': - return "object/tangible/wearables/ring/shared_ring_s02.iff" - - if name == 'item_npe_fs_robe_02_02': - return "object/tangible/wearables/robe/shared_robe_jedi_padawan.iff" - - if name == 'weapon_roadmap_lightsaber_02_02': - return "object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_s1.iff" - - if name == 'item_force_sensitive_ring_01_02': - return "object/tangible/wearables/ring/shared_ring_s01.iff" - - if name == 'item_krayt_pearl_04_01': - return "object/tangible/component/weapon/lightsaber/shared_lightsaber_module_krayt_dragon_pearl.iff" - - if name == 'item_force_sensitive_pendant_01_02': - return "object/tangible/wearables/necklace/shared_necklace_s12.iff" - - if name == 'item_force_sensitive_clicky_01_02': - return "object/tangible/loot/generic_usable/shared_generic_crystal.iff" - - if name == 'item_roadmap_belt_force_sensitive_01_02': - return "object/tangible/wearables/armor/zam/shared_armor_zam_wesell_belt.iff" - - # Bounty Hunter # - - if name == 'item_bounty_hunter_backpack_01_02': - return "object/tangible/wearables/backpack/shared_backpack_s05.iff" - - if name == 'armor_bounty_hunter_roadmap_bicep_l_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_bicep_l.iff" - - if name == 'armor_bounty_hunter_roadmap_bicep_r_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_bicep_r.iff" - - if name == 'armor_bounty_hunter_roadmap_bracer_l_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_bracer_l.iff" - - if name == 'armor_bounty_hunter_roadmap_bracer_r_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_bracer_r.iff" - - if name == 'armor_bounty_hunter_roadmap_boots_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_boots.iff" - - if name == 'armor_bounty_hunter_roadmap_chest_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_chest_plate.iff" - - if name == 'armor_bounty_hunter_roadmap_gloves_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_gloves.iff" - - if name == 'armor_bounty_hunter_roadmap_helmet_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_helmet.iff" - - if name == 'armor_bounty_hunter_roadmap_leggings_02_01': - return "object/tangible/wearables/armor/composite/shared_armor_composite_leggings.iff" - - if name == 'armor_wookiee_roadmap_chest_02_03': - return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_chestplate.iff" - - if name == 'armor_wookiee_roadmap_leggings_02_03': - return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_leggings.iff" - - if name == 'armor_wookiee_roadmap_bicep_l_02_03': - return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bicep_l.iff" - - if name == 'armor_wookiee_roadmap_bicep_r_02_03': - return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bicep_r.iff" - - if name == 'armor_wookiee_roadmap_bracer_l_02_03': - return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bracer_l.iff" - - if name == 'armor_wookiee_roadmap_bracer_r_02_03': - return "object/tangible/wearables/armor/kashyyykian_hunting/shared_armor_kashyyykian_hunting_bracer_r.iff" - - if name == 'armor_ithorian_roadmap_chest_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_chest_plate.iff" - - if name == 'armor_ithorian_roadmap_leggings_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_leggings.iff" - - if name == 'armor_ithorian_roadmap_helmet_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_helmet.iff" - - if name == 'armor_ithorian_roadmap_bicep_l_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bicep_l.iff" - - if name == 'armor_ithorian_roadmap_bicep_r_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bicep_r.iff" - - if name == 'armor_ithorian_roadmap_bracer_l_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bracer_l.iff" - - if name == 'armor_ithorian_roadmap_bracer_r_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_bracer_r.iff" - - if name == 'armor_ithorian_roadmap_boots_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_boots.iff" - - if name == 'armor_ithorian_roadmap_gloves_02_03': - return "object/tangible/wearables/armor/ithorian_sentinel/shared_ith_armor_s03_gloves.iff" - - if name == 'weapon_carbine_bh_roadmap_01_02': - return "object/weapon/ranged/carbine/shared_carbine_ee3.iff" - - if name == 'item_bounty_hunter_ring_01_02': - return "object/tangible/wearables/ring/shared_ring_s02.iff" - - if name == 'weapon_rifle_bh_roadmap_01_02': - return "object/weapon/ranged/rifle/shared_rifle_lightning.iff" - - if name == 'item_bounty_hunter_pendant_01_02': - return "object/tangible/wearables/necklace/shared_necklace_s02.iff" - - if name == 'item_bounty_hunter_clicky_01_02': - return "object/tangible/loot/generic_usable/shared_survey_pad_adv_generic.iff" - - if name == 'item_roadmap_belt_bounty_hunter_01_02': - return "object/tangible/wearables/armor/zam/shared_armor_zam_wesell_belt.iff" \ No newline at end of file diff --git a/scripts/roadmap/smuggler_1a.py b/scripts/roadmap/smuggler_1a.py index 8084fcd2..2b41cce4 100644 --- a/scripts/roadmap/smuggler_1a.py +++ b/scripts/roadmap/smuggler_1a.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/spy_1a.py b/scripts/roadmap/spy_1a.py index 6fe7c37a..079de728 100644 --- a/scripts/roadmap/spy_1a.py +++ b/scripts/roadmap/spy_1a.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/trader_0a.py b/scripts/roadmap/trader_0a.py index 2846dee7..203b6ad9 100644 --- a/scripts/roadmap/trader_0a.py +++ b/scripts/roadmap/trader_0a.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/trader_0b.py b/scripts/roadmap/trader_0b.py index 2846dee7..203b6ad9 100644 --- a/scripts/roadmap/trader_0b.py +++ b/scripts/roadmap/trader_0b.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/trader_0c.py b/scripts/roadmap/trader_0c.py index 2846dee7..203b6ad9 100644 --- a/scripts/roadmap/trader_0c.py +++ b/scripts/roadmap/trader_0c.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/scripts/roadmap/trader_0d.py b/scripts/roadmap/trader_0d.py index 2846dee7..203b6ad9 100644 --- a/scripts/roadmap/trader_0d.py +++ b/scripts/roadmap/trader_0d.py @@ -23,3 +23,6 @@ def getHealth(): def getAction(): return 75 + +def getRewards(name): + return \ No newline at end of file diff --git a/src/services/PlayerService.java b/src/services/PlayerService.java index 5c3eaf9c..ec4c9e7d 100644 --- a/src/services/PlayerService.java +++ b/src/services/PlayerService.java @@ -715,7 +715,7 @@ public class PlayerService implements INetworkDispatch { item = (item.substring(0, (item.lastIndexOf("/") + 1)) + "shared_" + item.substring((item.lastIndexOf("/") + 1))); } else { customServerTemplate = item; - item = core.scriptService.callScript("scripts/roadmap/", "roadmap_rewards", "get", item).asString(); + item = core.scriptService.callScript("scripts/roadmap/", player.getProfession(), "getRewards", item).asString(); } if (item != null && item != "") { From 9a82b2cd465f4a8f1931c6d01d6191bbb59ff01a Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Sun, 23 Mar 2014 06:38:41 +0100 Subject: [PATCH 06/28] Bounty Hunter - Added Assault Damage --- scripts/commands/combat/bh_dm_1.py | 6 +++++- scripts/commands/combat/bh_dm_2.py | 6 +++++- scripts/commands/combat/bh_dm_3.py | 6 +++++- scripts/commands/combat/bh_dm_4.py | 6 +++++- scripts/commands/combat/bh_dm_5.py | 6 +++++- scripts/commands/combat/bh_dm_6.py | 6 +++++- scripts/commands/combat/bh_dm_7.py | 6 +++++- scripts/commands/combat/bh_dm_8.py | 6 +++++- 8 files changed, 40 insertions(+), 8 deletions(-) diff --git a/scripts/commands/combat/bh_dm_1.py b/scripts/commands/combat/bh_dm_1.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_1.py +++ b/scripts/commands/combat/bh_dm_1.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_2.py b/scripts/commands/combat/bh_dm_2.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_2.py +++ b/scripts/commands/combat/bh_dm_2.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_3.py b/scripts/commands/combat/bh_dm_3.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_3.py +++ b/scripts/commands/combat/bh_dm_3.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_4.py b/scripts/commands/combat/bh_dm_4.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_4.py +++ b/scripts/commands/combat/bh_dm_4.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_5.py b/scripts/commands/combat/bh_dm_5.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_5.py +++ b/scripts/commands/combat/bh_dm_5.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_6.py b/scripts/commands/combat/bh_dm_6.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_6.py +++ b/scripts/commands/combat/bh_dm_6.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_7.py b/scripts/commands/combat/bh_dm_7.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_7.py +++ b/scripts/commands/combat/bh_dm_7.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_8.py b/scripts/commands/combat/bh_dm_8.py index 707a2c00..0506c54f 100644 --- a/scripts/commands/combat/bh_dm_8.py +++ b/scripts/commands/combat/bh_dm_8.py @@ -2,7 +2,11 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm')/10)) + + if actor.getSkillMod('expertise_damage_line_dm'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm'))/100)) + return def run(core, actor, target, commandString): return \ No newline at end of file From edd91900e6becf32b458687155bd4391de166707 Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Sun, 23 Mar 2014 06:53:06 +0100 Subject: [PATCH 07/28] Bounty Hunter - Added Ambush Damage/Critical/Action cost --- scripts/commands/combat/bh_dm_crit_1.py | 12 +++++++++++- scripts/commands/combat/bh_dm_crit_2.py | 12 +++++++++++- scripts/commands/combat/bh_dm_crit_3.py | 14 ++++++++++++-- scripts/commands/combat/bh_dm_crit_4.py | 14 ++++++++++++-- scripts/commands/combat/bh_dm_crit_5.py | 14 ++++++++++++-- scripts/commands/combat/bh_dm_crit_6.py | 14 ++++++++++++-- scripts/commands/combat/bh_dm_crit_7.py | 14 ++++++++++++-- scripts/commands/combat/bh_dm_crit_8.py | 14 ++++++++++++-- 8 files changed, 94 insertions(+), 14 deletions(-) diff --git a/scripts/commands/combat/bh_dm_crit_1.py b/scripts/commands/combat/bh_dm_crit_1.py index 94292ffd..aec51439 100644 --- a/scripts/commands/combat/bh_dm_crit_1.py +++ b/scripts/commands/combat/bh_dm_crit_1.py @@ -2,7 +2,17 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/bh_dm_crit_2.py b/scripts/commands/combat/bh_dm_crit_2.py index 94292ffd..aec51439 100644 --- a/scripts/commands/combat/bh_dm_crit_2.py +++ b/scripts/commands/combat/bh_dm_crit_2.py @@ -2,7 +2,17 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/bh_dm_crit_3.py b/scripts/commands/combat/bh_dm_crit_3.py index 94b54628..aec51439 100644 --- a/scripts/commands/combat/bh_dm_crit_3.py +++ b/scripts/commands/combat/bh_dm_crit_3.py @@ -2,8 +2,18 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + return - + def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_crit_4.py b/scripts/commands/combat/bh_dm_crit_4.py index 94b54628..aec51439 100644 --- a/scripts/commands/combat/bh_dm_crit_4.py +++ b/scripts/commands/combat/bh_dm_crit_4.py @@ -2,8 +2,18 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + return - + def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_crit_5.py b/scripts/commands/combat/bh_dm_crit_5.py index 94b54628..aec51439 100644 --- a/scripts/commands/combat/bh_dm_crit_5.py +++ b/scripts/commands/combat/bh_dm_crit_5.py @@ -2,8 +2,18 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + return - + def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_crit_6.py b/scripts/commands/combat/bh_dm_crit_6.py index 94b54628..aec51439 100644 --- a/scripts/commands/combat/bh_dm_crit_6.py +++ b/scripts/commands/combat/bh_dm_crit_6.py @@ -2,8 +2,18 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + return - + def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_crit_7.py b/scripts/commands/combat/bh_dm_crit_7.py index 94b54628..aec51439 100644 --- a/scripts/commands/combat/bh_dm_crit_7.py +++ b/scripts/commands/combat/bh_dm_crit_7.py @@ -2,8 +2,18 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + return - + def run(core, actor, target, commandString): return \ No newline at end of file diff --git a/scripts/commands/combat/bh_dm_crit_8.py b/scripts/commands/combat/bh_dm_crit_8.py index 94b54628..aec51439 100644 --- a/scripts/commands/combat/bh_dm_crit_8.py +++ b/scripts/commands/combat/bh_dm_crit_8.py @@ -2,8 +2,18 @@ import sys def setup(core, actor, target, command): if actor.getSkillMod('expertise_cooldown_line_dm_crit'): - command.setCooldown(command.getCooldown() - (actor.getSkillMod('expertise_cooldown_line_dm_crit').getBase()/10)) + command.setCooldown(command.getCooldown() - (actor.getSkillModBase('expertise_cooldown_line_dm_crit')/10)) + + if actor.getSkillMod('expertise_damage_line_dm_crit'): + command.setAddedDamage(command.getAddedDamage() + ((command.getAddedDamage()*actor.getSkillModBase('expertise_damage_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_action_line_dm_crit'): + command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) + + if actor.getSkillMod('expertise_critical_line_dm_crit'): + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + return - + def run(core, actor, target, commandString): return \ No newline at end of file From a024ea8feee4c6b274ce70e4394031ac3624c86c Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Sun, 23 Mar 2014 06:54:42 +0100 Subject: [PATCH 08/28] Jedi - Jedi Strike ACR was incorrectly affecting Flurry --- scripts/commands/combat/fs_flurry_1.py | 3 --- scripts/commands/combat/fs_flurry_2.py | 3 --- scripts/commands/combat/fs_flurry_3.py | 3 --- scripts/commands/combat/fs_flurry_4.py | 3 --- scripts/commands/combat/fs_flurry_5.py | 3 --- scripts/commands/combat/fs_flurry_6.py | 3 --- scripts/commands/combat/fs_flurry_7.py | 3 --- 7 files changed, 21 deletions(-) diff --git a/scripts/commands/combat/fs_flurry_1.py b/scripts/commands/combat/fs_flurry_1.py index 1d6cd02c..5e5c429e 100644 --- a/scripts/commands/combat/fs_flurry_1.py +++ b/scripts/commands/combat/fs_flurry_1.py @@ -7,9 +7,6 @@ def setup(core, actor, target, command): if actor.getSkillMod('expertise_critical_line_fs_dm'): command.setCriticalChance(command.getCriticalChance() + actor.getSkillMod('expertise_critical_line_fs_dm').getBase()) - if actor.getSkillMod('expertise_action_line_fs_dm'): - command.setActionCost(command.getActionCost() - ((command.getActionCost() * actor.getSkillMod('expertise_action_line_fs_dm').getBase())/100)) - return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/fs_flurry_2.py b/scripts/commands/combat/fs_flurry_2.py index 1d6cd02c..5e5c429e 100644 --- a/scripts/commands/combat/fs_flurry_2.py +++ b/scripts/commands/combat/fs_flurry_2.py @@ -7,9 +7,6 @@ def setup(core, actor, target, command): if actor.getSkillMod('expertise_critical_line_fs_dm'): command.setCriticalChance(command.getCriticalChance() + actor.getSkillMod('expertise_critical_line_fs_dm').getBase()) - if actor.getSkillMod('expertise_action_line_fs_dm'): - command.setActionCost(command.getActionCost() - ((command.getActionCost() * actor.getSkillMod('expertise_action_line_fs_dm').getBase())/100)) - return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/fs_flurry_3.py b/scripts/commands/combat/fs_flurry_3.py index 1d6cd02c..5e5c429e 100644 --- a/scripts/commands/combat/fs_flurry_3.py +++ b/scripts/commands/combat/fs_flurry_3.py @@ -7,9 +7,6 @@ def setup(core, actor, target, command): if actor.getSkillMod('expertise_critical_line_fs_dm'): command.setCriticalChance(command.getCriticalChance() + actor.getSkillMod('expertise_critical_line_fs_dm').getBase()) - if actor.getSkillMod('expertise_action_line_fs_dm'): - command.setActionCost(command.getActionCost() - ((command.getActionCost() * actor.getSkillMod('expertise_action_line_fs_dm').getBase())/100)) - return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/fs_flurry_4.py b/scripts/commands/combat/fs_flurry_4.py index 1d6cd02c..5e5c429e 100644 --- a/scripts/commands/combat/fs_flurry_4.py +++ b/scripts/commands/combat/fs_flurry_4.py @@ -7,9 +7,6 @@ def setup(core, actor, target, command): if actor.getSkillMod('expertise_critical_line_fs_dm'): command.setCriticalChance(command.getCriticalChance() + actor.getSkillMod('expertise_critical_line_fs_dm').getBase()) - if actor.getSkillMod('expertise_action_line_fs_dm'): - command.setActionCost(command.getActionCost() - ((command.getActionCost() * actor.getSkillMod('expertise_action_line_fs_dm').getBase())/100)) - return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/fs_flurry_5.py b/scripts/commands/combat/fs_flurry_5.py index 1d6cd02c..5e5c429e 100644 --- a/scripts/commands/combat/fs_flurry_5.py +++ b/scripts/commands/combat/fs_flurry_5.py @@ -7,9 +7,6 @@ def setup(core, actor, target, command): if actor.getSkillMod('expertise_critical_line_fs_dm'): command.setCriticalChance(command.getCriticalChance() + actor.getSkillMod('expertise_critical_line_fs_dm').getBase()) - if actor.getSkillMod('expertise_action_line_fs_dm'): - command.setActionCost(command.getActionCost() - ((command.getActionCost() * actor.getSkillMod('expertise_action_line_fs_dm').getBase())/100)) - return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/fs_flurry_6.py b/scripts/commands/combat/fs_flurry_6.py index 1d6cd02c..5e5c429e 100644 --- a/scripts/commands/combat/fs_flurry_6.py +++ b/scripts/commands/combat/fs_flurry_6.py @@ -7,9 +7,6 @@ def setup(core, actor, target, command): if actor.getSkillMod('expertise_critical_line_fs_dm'): command.setCriticalChance(command.getCriticalChance() + actor.getSkillMod('expertise_critical_line_fs_dm').getBase()) - if actor.getSkillMod('expertise_action_line_fs_dm'): - command.setActionCost(command.getActionCost() - ((command.getActionCost() * actor.getSkillMod('expertise_action_line_fs_dm').getBase())/100)) - return def run(core, actor, target, commandString): diff --git a/scripts/commands/combat/fs_flurry_7.py b/scripts/commands/combat/fs_flurry_7.py index 1d6cd02c..5e5c429e 100644 --- a/scripts/commands/combat/fs_flurry_7.py +++ b/scripts/commands/combat/fs_flurry_7.py @@ -7,9 +7,6 @@ def setup(core, actor, target, command): if actor.getSkillMod('expertise_critical_line_fs_dm'): command.setCriticalChance(command.getCriticalChance() + actor.getSkillMod('expertise_critical_line_fs_dm').getBase()) - if actor.getSkillMod('expertise_action_line_fs_dm'): - command.setActionCost(command.getActionCost() - ((command.getActionCost() * actor.getSkillMod('expertise_action_line_fs_dm').getBase())/100)) - return def run(core, actor, target, commandString): From 7f5c7dc03a1c4da615d8f7895a24e39192bbdfcd Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Sun, 23 Mar 2014 07:07:27 +0100 Subject: [PATCH 09/28] Officer - Fixed Tactics Duration --- scripts/buffs/of_buff_def_1.py | 1 - scripts/buffs/of_buff_def_2.py | 3 +++ scripts/buffs/of_buff_def_3.py | 3 +++ scripts/buffs/of_buff_def_4.py | 3 +++ scripts/buffs/of_buff_def_5.py | 3 +++ scripts/buffs/of_buff_def_6.py | 3 +++ scripts/buffs/of_buff_def_7.py | 3 +++ scripts/buffs/of_buff_def_8.py | 3 +++ scripts/buffs/of_buff_def_9.py | 3 +++ 9 files changed, 24 insertions(+), 1 deletion(-) diff --git a/scripts/buffs/of_buff_def_1.py b/scripts/buffs/of_buff_def_1.py index f1e27d04..01f17ada 100644 --- a/scripts/buffs/of_buff_def_1.py +++ b/scripts/buffs/of_buff_def_1.py @@ -3,7 +3,6 @@ import sys def setup(core, actor, buff): if actor.getSkillMod('expertise_aura_maintain'): buff.setDuration(-1) - return return diff --git a/scripts/buffs/of_buff_def_2.py b/scripts/buffs/of_buff_def_2.py index c1cb56b4..7536841f 100644 --- a/scripts/buffs/of_buff_def_2.py +++ b/scripts/buffs/of_buff_def_2.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): diff --git a/scripts/buffs/of_buff_def_3.py b/scripts/buffs/of_buff_def_3.py index 952b1963..dd577237 100644 --- a/scripts/buffs/of_buff_def_3.py +++ b/scripts/buffs/of_buff_def_3.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): diff --git a/scripts/buffs/of_buff_def_4.py b/scripts/buffs/of_buff_def_4.py index 3360e4e4..6a650b41 100644 --- a/scripts/buffs/of_buff_def_4.py +++ b/scripts/buffs/of_buff_def_4.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): diff --git a/scripts/buffs/of_buff_def_5.py b/scripts/buffs/of_buff_def_5.py index 5e0f8e8d..0dfd361a 100644 --- a/scripts/buffs/of_buff_def_5.py +++ b/scripts/buffs/of_buff_def_5.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): diff --git a/scripts/buffs/of_buff_def_6.py b/scripts/buffs/of_buff_def_6.py index 46293f6b..06dac062 100644 --- a/scripts/buffs/of_buff_def_6.py +++ b/scripts/buffs/of_buff_def_6.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): diff --git a/scripts/buffs/of_buff_def_7.py b/scripts/buffs/of_buff_def_7.py index a063f2fd..b18cd574 100644 --- a/scripts/buffs/of_buff_def_7.py +++ b/scripts/buffs/of_buff_def_7.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): diff --git a/scripts/buffs/of_buff_def_8.py b/scripts/buffs/of_buff_def_8.py index 4136a39d..1b16cad6 100644 --- a/scripts/buffs/of_buff_def_8.py +++ b/scripts/buffs/of_buff_def_8.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): diff --git a/scripts/buffs/of_buff_def_9.py b/scripts/buffs/of_buff_def_9.py index 2651fc29..ac342f70 100644 --- a/scripts/buffs/of_buff_def_9.py +++ b/scripts/buffs/of_buff_def_9.py @@ -1,6 +1,9 @@ import sys def setup(core, actor, buff): + if actor.getSkillMod('expertise_aura_maintain'): + buff.setDuration(-1) + return def add(core, actor, buff): From da30107933d250ffef3a78b7c6d64d89db40ccbe Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Sun, 23 Mar 2014 17:10:15 +0100 Subject: [PATCH 10/28] Commands - Fixed incorrect datatable values --- src/services/command/CombatCommand.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/services/command/CombatCommand.java b/src/services/command/CombatCommand.java index 16198a57..0741a44e 100644 --- a/src/services/command/CombatCommand.java +++ b/src/services/command/CombatCommand.java @@ -151,10 +151,10 @@ public class CombatCommand extends BaseSWGCommand { minDamage = (Integer) visitor.getObject(i, 77); maxDamage = (Integer) visitor.getObject(i, 78); maxRangeOverload = (Float) visitor.getObject(i, 79); - weaponCategory = ((Integer) visitor.getObject(i, 80)).byteValue(); - damageType = ((Integer) visitor.getObject(i, 81)).byteValue(); - elementalType = ((Integer) visitor.getObject(i, 82)).byteValue(); - elementalValue = (Integer) visitor.getObject(i, 83); + weaponCategory = ((Integer) visitor.getObject(i, 81)).byteValue(); + damageType = ((Integer) visitor.getObject(i, 82)).byteValue(); + elementalType = ((Integer) visitor.getObject(i, 83)); + elementalValue = (Integer) visitor.getObject(i, 84); performanceSpam = (String) visitor.getObject(i, 89); hitSpam = ((Integer) visitor.getObject(i, 90)).byteValue(); From ae402525f571e743791bf86fa825827f7e194d08 Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Sun, 23 Mar 2014 17:15:27 +0100 Subject: [PATCH 11/28] Commands - Renamed isBypassArmor() to getBypassArmor() It's not a actually a boolean so I changed the name to something more appropriate. --- src/services/command/CombatCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/command/CombatCommand.java b/src/services/command/CombatCommand.java index 0741a44e..2ec3f936 100644 --- a/src/services/command/CombatCommand.java +++ b/src/services/command/CombatCommand.java @@ -381,7 +381,7 @@ public class CombatCommand extends BaseSWGCommand { this.percentFromWeapon = percentFromWeapon; } - public float isBypassArmor() { + public float getBypassArmor() { return bypassArmor; } From 9de9bb37b49a9db98e27f6294b859942fb92045a Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Sun, 23 Mar 2014 17:23:26 +0100 Subject: [PATCH 12/28] Combat - Added ability specifc armor bypass and fixed incorrect armor mitigation calculation --- src/services/combat/CombatService.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/services/combat/CombatService.java b/src/services/combat/CombatService.java index 01f73d43..2b0c7815 100644 --- a/src/services/combat/CombatService.java +++ b/src/services/combat/CombatService.java @@ -85,7 +85,7 @@ public class CombatService implements INetworkDispatch { } public void doCombat(final CreatureObject attacker, final TangibleObject target, final WeaponObject weapon, final CombatCommand command, final int actionCounter) { - + boolean success = true; if((command.getAttackType() == 0 || command.getAttackType() == 1 || command.getAttackType() == 3) && !attemptCombat(attacker, target)) @@ -441,7 +441,7 @@ public class CombatService implements INetworkDispatch { } else { elementalType = command.getElementalType(); - + } int baseArmor = 0; @@ -460,14 +460,16 @@ public class CombatService implements INetworkDispatch { baseArmor = target.getSkillModBase("acid"); case ElementalType.ELECTRICITY: baseArmor = target.getSkillModBase("electricity"); - } if(target.getSkillMod("expertise_innate_reduction_all_player") != null) baseArmor *= (100 - target.getSkillMod("expertise_innate_reduction_all_player").getBase()) / 100; - float mitigation = (float) (90 * (1 - Math.exp(-0.000125 * baseArmor)) + baseArmor / 9000); + if(command.getBypassArmor() > 0) + baseArmor *= (100 - command.getBypassArmor()) / 100; + float mitigation = (float) (90 * (1 - Math.exp(-0.000125 * baseArmor))) + baseArmor / 9000; + if(hitType == HitType.STRIKETHROUGH) { float stMaxValue = attacker.getSkillMod("combat_strikethrough_value").getBase() / 2 + attacker.getLuck() / 10; @@ -480,7 +482,7 @@ public class CombatService implements INetworkDispatch { stValue = 1 - stValue; mitigation *= stValue; } - + return mitigation / 100; } From cf5c36dd297b446ba4c0c70b352dd44e8276ca0c Mon Sep 17 00:00:00 2001 From: Waverunner Date: Sun, 23 Mar 2014 13:42:18 -0400 Subject: [PATCH 13/28] Added Buff Workshop Collection, hologram variable to creatureobject (Added) BuffWorkshop Collection (Code) Added hologram variable to CreatureObject (BugFix) Inspiration ticks stop at max duration --- scripts/buffs/buildabuff_inspiration.py | 7 ++-- scripts/collections/col_entertainer_01.py | 12 ++++++ .../creature/CreatureMessageBuilder.java | 7 +++- .../objects/creature/CreatureObject.java | 15 ++++++- src/services/BuffService.java | 4 +- src/services/EntertainmentService.java | 39 +++++++++++++++---- .../collections/CollectionService.java | 4 +- 7 files changed, 72 insertions(+), 16 deletions(-) create mode 100644 scripts/collections/col_entertainer_01.py diff --git a/scripts/buffs/buildabuff_inspiration.py b/scripts/buffs/buildabuff_inspiration.py index 05e801fa..25ba7355 100644 --- a/scripts/buffs/buildabuff_inspiration.py +++ b/scripts/buffs/buildabuff_inspiration.py @@ -12,12 +12,11 @@ def add(core, actor, buff): return attached = actor.getAttachment('inspireDuration') - print (attached) + buff.setDuration(float(actor.getAttachment('inspireDuration') * 60)) - print ('Buff Duration: ' + str(actor.getAttachment('inspireDuration'))) + for BuffItem in buffWorkshop: core.skillModService.addSkillMod(actor, BuffItem.getSkillName(), BuffItem.getAffectAmount()) - print ('Gave skill mod ' + BuffItem.getSkillName() + ' with affect of ' + str(BuffItem.getAffectAmount())) return @@ -25,5 +24,5 @@ def remove(core, actor, buff): for BuffItem in actor.getAttachment('buffWorkshop'): core.skillModService.deductSkillMod(actor, BuffItem.getSkillName(), BuffItem.getAffectAmount()) - actor.setAttachment('buffWorkshop', 'none') + actor.setAttachment('buffWorkshop', None) return \ No newline at end of file diff --git a/scripts/collections/col_entertainer_01.py b/scripts/collections/col_entertainer_01.py new file mode 100644 index 00000000..100fa53e --- /dev/null +++ b/scripts/collections/col_entertainer_01.py @@ -0,0 +1,12 @@ +from java.lang import System +import sys + +def modify(core, actor, count): + return + +def complete(core, actor, collection): + ghost = actor.getSlottedObject('ghost') + + actor.sendSystemMessage('@collection_n:col_entertainer_01_finished', 0) + ghost.addAbility('bm_dancing_pet_entertainer') + return \ No newline at end of file diff --git a/src/resources/objects/creature/CreatureMessageBuilder.java b/src/resources/objects/creature/CreatureMessageBuilder.java index e3facb65..08f33a9b 100644 --- a/src/resources/objects/creature/CreatureMessageBuilder.java +++ b/src/resources/objects/creature/CreatureMessageBuilder.java @@ -379,7 +379,12 @@ public class CreatureMessageBuilder extends ObjectMessageBuilder { buffer.put((byte) 0); // performing? boolean buffer.put(creature.getDifficulty()); - buffer.putInt(0xFFFFFFFF); // -1 normal appearance, 0 hologram + + if(creature.isHologram()) + buffer.putInt(0); + else + buffer.putInt(0xFFFFFFFF); + buffer.put((byte) 1); // visibleOnRadar? boolean buffer.put((byte) 0); // no effect for 1? buffer.put((byte) 0); // no effect for 1? diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index 012324e9..510ce0ed 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -57,7 +57,7 @@ import engine.resources.scene.Quaternion; import resources.objects.tangible.TangibleObject; import resources.objects.weapon.WeaponObject; -@Entity(version=1) +@Entity(version=2) public class CreatureObject extends TangibleObject implements IPersistent { @NotPersistent @@ -118,6 +118,7 @@ public class CreatureObject extends TangibleObject implements IPersistent { private byte moodId = 0; private int performanceCounter = 0; private int performanceId = 0; + private boolean hologram = false; //FIXME: this is a bit of a hack. private boolean performanceType = false; //FIXME: hmm.. or persistent? @@ -1676,4 +1677,16 @@ public class CreatureObject extends TangibleObject implements IPersistent { this.performingEffect = hasEffect; } } + + public void setHologram(boolean isHologram) { + synchronized(objectMutex) { + this.hologram = isHologram; + } + } + + public boolean isHologram() { + synchronized(objectMutex) { + return hologram; + } + } } diff --git a/src/services/BuffService.java b/src/services/BuffService.java index 662dea25..21c31fa9 100644 --- a/src/services/BuffService.java +++ b/src/services/BuffService.java @@ -60,7 +60,7 @@ public class BuffService implements INetworkDispatch { } - public void addBuffToCreature(final CreatureObject creature, String buffName) { + public boolean addBuffToCreature(final CreatureObject creature, String buffName) { /*if(!FileUtilities.doesFileExist("scripts/buffs/" + buffName + ".py")) { //System.out.println("Buff script doesnt exist for: " + buffName); @@ -70,8 +70,10 @@ public class BuffService implements INetworkDispatch { final Buff buff = new Buff(buffName, creature.getObjectID()); if(buff.isGroupBuff()) { addGroupBuff(creature, buffName); + return true; } else { doAddBuff(creature, buffName, null); + return true; } } diff --git a/src/services/EntertainmentService.java b/src/services/EntertainmentService.java index bc93d2cc..96522779 100644 --- a/src/services/EntertainmentService.java +++ b/src/services/EntertainmentService.java @@ -4,6 +4,7 @@ import java.nio.ByteOrder; import java.util.HashMap; import java.util.Iterator; import java.util.Map; +import java.util.Random; import java.util.Vector; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executors; @@ -56,6 +57,8 @@ public class EntertainmentService implements INetworkDispatch { private ConcurrentHashMap performancesByIndex = new ConcurrentHashMap(); private ConcurrentHashMap danceMap = new ConcurrentHashMap(); + private Random ranWorkshop = new Random(); + private Map performanceEffects = new ConcurrentHashMap(); public EntertainmentService(NGECore core) { @@ -174,7 +177,7 @@ public class EntertainmentService implements INetworkDispatch { } } - giveInspirationBuff(buffRecipient, statBuffs); + giveInspirationBuff(buffRecipient, buffer, statBuffs); BuffBuilderEndMessage endBuilder = new BuffBuilderEndMessage(changeMessage); endBuilder.setObjectId(buffer.getObjectId()); @@ -204,7 +207,7 @@ public class EntertainmentService implements INetworkDispatch { } else { if (sentPacket.getAccepted() == true) { - giveInspirationBuff(buffRecipient, statBuffs); + giveInspirationBuff(buffRecipient, buffer, statBuffs); BuffBuilderEndMessage endBuilder = new BuffBuilderEndMessage(sentPacket); endBuilder.setObjectId(buffer.getObjectId()); @@ -358,8 +361,7 @@ public class EntertainmentService implements INetworkDispatch { core.commandService.registerCommand("ventriloquism"); } - public void giveInspirationBuff(CreatureObject reciever, Vector buffVector) { - CreatureObject buffCreature = (CreatureObject) reciever; + public void giveInspirationBuff(CreatureObject reciever, CreatureObject buffer, Vector buffVector) { Vector availableStats = buffBuilderSkills; Vector stats = new Vector(); @@ -384,8 +386,30 @@ public class EntertainmentService implements INetworkDispatch { reciever.setAttachment("buffWorkshop", stats); - core.buffService.addBuffToCreature(buffCreature, "buildabuff_inspiration"); + core.buffService.addBuffToCreature(reciever, "buildabuff_inspiration"); + /*PlayerObject rPlayer = (PlayerObject) reciever.getSlottedObject("ghost"); + + + long timeStamp = 0; + if (reciever.getAttachment("buffWorkshopTimestamp") != null) + timeStamp = (long) reciever.getAttachment("buffWorkshopTimestamp"); + + + if (core.buffService.addBuffToCreature(reciever, "buildabuff_inspiration") && !rPlayer.getProfession().equals("entertainer_1a")) { + if (timeStamp == 0 || (System.currentTimeMillis() - timeStamp > 86400000)) { + float random = ranWorkshop.nextFloat(); + if (random < 0.75f) { + + if(rPlayer.getProfession().contains("trader")) { core.collectionService.addCollection(buffer, "prof_trader"); } + + else { + core.collectionService.addCollection(buffer, rPlayer.getProfession()); + } + } + } else { buffer.sendSystemMessage("@collection:buffed_too_soon", (byte) 0); } + reciever.setAttachment("buffWorkshopTimestamp", System.currentTimeMillis()); + }*/ } public int getDanceVisualId(String danceName) { @@ -613,7 +637,8 @@ public class EntertainmentService implements INetworkDispatch { } if (time == buffCap) { - + System.out.println("Reached buff cap"); + spectator.getInspirationTick().cancel(true); } else { int entTick = 10; if (performer.getSkillMod("expertise_en_inspire_pulse_duration_increase") != null) { @@ -628,7 +653,7 @@ public class EntertainmentService implements INetworkDispatch { spectator.showFlyText("spam", "buff_duration_tick_observer", String.valueOf(hours) + " hours , " + hMinutes + " minutes ", 0, (float) 0.66, new RGB(255, 182, 193), 3, 78); spectator.setAttachment("inspireDuration", duration); - //System.out.println("Inspire Duration: " + spectator.getAttachment("inspireDuration") + " on " + spectator.getCustomName()); + System.out.println("Inspire Duration: " + spectator.getAttachment("inspireDuration") + " on " + spectator.getCustomName()); } } diff --git a/src/services/collections/CollectionService.java b/src/services/collections/CollectionService.java index e82c61d8..ae13cef3 100644 --- a/src/services/collections/CollectionService.java +++ b/src/services/collections/CollectionService.java @@ -225,10 +225,10 @@ public class CollectionService implements INetworkDispatch { BitSet maxValue = new BitSet(64); maxValue.set(64-maxSlotValue, 64); - if (bitValue.toLongArray()[0] < maxValue.toLongArray()[0]) { + /*if (bitValue.toLongArray()[0] < maxValue.toLongArray()[0]) { System.out.println(slotName + ", row " + c + ": counter-type slot uses " + bits + " bits, which can only hold a max value of " + bitValue.toLongArray()[0] + ", which is less than the specified max value of " + maxValue.toLongArray()[0]); throw new Exception(); - } + }*/ } } else { bits = 1; From e2a09f12d4f7c12c8fe46f2fcd301cb757cd92a9 Mon Sep 17 00:00:00 2001 From: Waverunner Date: Sun, 23 Mar 2014 14:04:21 -0400 Subject: [PATCH 14/28] Roadmap Rewards use giveItem, roadmap rewards call script based on profession --- src/services/PlayerService.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/services/PlayerService.java b/src/services/PlayerService.java index 5c3eaf9c..fb203434 100644 --- a/src/services/PlayerService.java +++ b/src/services/PlayerService.java @@ -691,6 +691,8 @@ public class PlayerService implements INetworkDispatch { try { roadmap = ClientFileManager.loadFile("datatables/roadmap/item_rewards.iff", DatatableVisitor.class); + Vector rewards = new Vector(); + for (int s = 0; s < roadmap.getRowCount(); s++) { if (roadmap.getObject(s, 0) != null) { if (((String) roadmap.getObject(s, 1)).equals(roadmapSkillName)) { @@ -715,11 +717,12 @@ public class PlayerService implements INetworkDispatch { item = (item.substring(0, (item.lastIndexOf("/") + 1)) + "shared_" + item.substring((item.lastIndexOf("/") + 1))); } else { customServerTemplate = item; - item = core.scriptService.callScript("scripts/roadmap/", "roadmap_rewards", "get", item).asString(); + item = core.scriptService.callScript("scripts/roadmap/", player.getProfession(), "getRewards", item).asString(); } if (item != null && item != "") { - creature.getSlottedObject("inventory").add(core.objectService.createObject(item, 0, creature.getPlanet(), new Point3D(0, 0, 0), new Quaternion(1, 0, 0, 0), customServerTemplate)); + SWGObject itemObj = core.objectService.createObject(item, 0, creature.getPlanet(), new Point3D(0, 0, 0), new Quaternion(1, 0, 0, 0), customServerTemplate); + rewards.add(itemObj); } else { //System.out.println("Can't find template: " + item); } @@ -731,6 +734,11 @@ public class PlayerService implements INetworkDispatch { } } } + + if (rewards != null && !rewards.isEmpty()) { + giveItems(creature, (SWGObject[]) rewards.toArray()); + } + } catch (InstantiationException | IllegalAccessException e) { e.printStackTrace(); } From bd228e971a82b805c15c3e00dcf05a6db79c148f Mon Sep 17 00:00:00 2001 From: Seefo Date: Sun, 23 Mar 2014 15:03:36 -0400 Subject: [PATCH 15/28] Fixed issue #227 and #202 --- scripts/commands/duel.py | 1 + src/services/combat/CombatService.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/commands/duel.py b/scripts/commands/duel.py index 4ce25bdf..cd26b240 100644 --- a/scripts/commands/duel.py +++ b/scripts/commands/duel.py @@ -22,6 +22,7 @@ def run(core, actor, target, commandString): if actor.getDuelList().contains(target): actor.sendSystemMessage('You already challenged ' + target.getCustomName() + ' to a duel.', 0) + return combatSvc.handleDuel(actor, target) diff --git a/src/services/combat/CombatService.java b/src/services/combat/CombatService.java index 01f73d43..3a3d8ddb 100644 --- a/src/services/combat/CombatService.java +++ b/src/services/combat/CombatService.java @@ -504,10 +504,10 @@ public class CombatService implements INetworkDispatch { if(attacker.getAttachment("AI") instanceof AIActor && target instanceof CreatureObject) { ((AIActor) attacker.getAttachment("AI")).addDefender((CreatureObject) target); } else { - attacker.addDefender(target); + attacker.addDefender(target); // See below comment } - attacker.addDefender(target); + //attacker.addDefender(target); // Why do we need to add target to defender list twice? return true; From 60e955f76b41cbc871287efbe1de99e032303758 Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Sun, 23 Mar 2014 20:49:40 +0100 Subject: [PATCH 16/28] Scripts - Fixed syntax error in Ambush command --- scripts/commands/combat/bh_dm_crit_1.py | 2 +- scripts/commands/combat/bh_dm_crit_2.py | 2 +- scripts/commands/combat/bh_dm_crit_3.py | 2 +- scripts/commands/combat/bh_dm_crit_4.py | 2 +- scripts/commands/combat/bh_dm_crit_5.py | 2 +- scripts/commands/combat/bh_dm_crit_6.py | 2 +- scripts/commands/combat/bh_dm_crit_7.py | 2 +- scripts/commands/combat/bh_dm_crit_8.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/commands/combat/bh_dm_crit_1.py b/scripts/commands/combat/bh_dm_crit_1.py index aec51439..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_1.py +++ b/scripts/commands/combat/bh_dm_crit_1.py @@ -11,7 +11,7 @@ def setup(core, actor, target, command): command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) if actor.getSkillMod('expertise_critical_line_dm_crit'): - command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) return diff --git a/scripts/commands/combat/bh_dm_crit_2.py b/scripts/commands/combat/bh_dm_crit_2.py index aec51439..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_2.py +++ b/scripts/commands/combat/bh_dm_crit_2.py @@ -11,7 +11,7 @@ def setup(core, actor, target, command): command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) if actor.getSkillMod('expertise_critical_line_dm_crit'): - command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) return diff --git a/scripts/commands/combat/bh_dm_crit_3.py b/scripts/commands/combat/bh_dm_crit_3.py index aec51439..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_3.py +++ b/scripts/commands/combat/bh_dm_crit_3.py @@ -11,7 +11,7 @@ def setup(core, actor, target, command): command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) if actor.getSkillMod('expertise_critical_line_dm_crit'): - command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) return diff --git a/scripts/commands/combat/bh_dm_crit_4.py b/scripts/commands/combat/bh_dm_crit_4.py index aec51439..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_4.py +++ b/scripts/commands/combat/bh_dm_crit_4.py @@ -11,7 +11,7 @@ def setup(core, actor, target, command): command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) if actor.getSkillMod('expertise_critical_line_dm_crit'): - command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) return diff --git a/scripts/commands/combat/bh_dm_crit_5.py b/scripts/commands/combat/bh_dm_crit_5.py index aec51439..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_5.py +++ b/scripts/commands/combat/bh_dm_crit_5.py @@ -11,7 +11,7 @@ def setup(core, actor, target, command): command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) if actor.getSkillMod('expertise_critical_line_dm_crit'): - command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) return diff --git a/scripts/commands/combat/bh_dm_crit_6.py b/scripts/commands/combat/bh_dm_crit_6.py index aec51439..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_6.py +++ b/scripts/commands/combat/bh_dm_crit_6.py @@ -11,7 +11,7 @@ def setup(core, actor, target, command): command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) if actor.getSkillMod('expertise_critical_line_dm_crit'): - command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) return diff --git a/scripts/commands/combat/bh_dm_crit_7.py b/scripts/commands/combat/bh_dm_crit_7.py index aec51439..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_7.py +++ b/scripts/commands/combat/bh_dm_crit_7.py @@ -11,7 +11,7 @@ def setup(core, actor, target, command): command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) if actor.getSkillMod('expertise_critical_line_dm_crit'): - command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) return diff --git a/scripts/commands/combat/bh_dm_crit_8.py b/scripts/commands/combat/bh_dm_crit_8.py index aec51439..c12e2a2a 100644 --- a/scripts/commands/combat/bh_dm_crit_8.py +++ b/scripts/commands/combat/bh_dm_crit_8.py @@ -11,7 +11,7 @@ def setup(core, actor, target, command): command.setActionCost(command.getActionCost() - ((command.getActionCost()*actor.getSkillModBase('expertise_action_line_dm_crit'))/100)) if actor.getSkillMod('expertise_critical_line_dm_crit'): - command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit') + command.setCriticalChance(command.getCriticalChance + actor.getSkillModBase('expertise_critical_line_dm_crit')) return From 0f390c063b21279bbfd57753eade7a4a31019b64 Mon Sep 17 00:00:00 2001 From: Waverunner Date: Sun, 23 Mar 2014 15:59:29 -0400 Subject: [PATCH 17/28] No exp for entertainer above 90, fixed unity radial, changed giveItems --- scripts/commands/startdance.py | 3 +- scripts/radial/player.py | 17 ++++++-- scripts/radial/ring/unity.py | 4 +- .../objectControllerObjects/ShowLootBox.java | 26 ++++++++---- .../objects/creature/CreatureObject.java | 1 + .../objects/tangible/TangibleObject.java | 6 +-- src/services/EntertainmentService.java | 15 +++---- src/services/PlayerService.java | 40 ++++++++++++++++--- .../collections/CollectionService.java | 2 +- 9 files changed, 81 insertions(+), 33 deletions(-) diff --git a/scripts/commands/startdance.py b/scripts/commands/startdance.py index 23b815c6..13aba090 100644 --- a/scripts/commands/startdance.py +++ b/scripts/commands/startdance.py @@ -77,7 +77,6 @@ def startDance(core, actor, danceName, visual): #TODO: check costume if actor.getPosture() != Posture.Upright: - print (' can\t dance because ' + str(actor.getPosture())) actor.sendSystemMessage('@performance:dance_fail', 0) return @@ -97,7 +96,7 @@ def startDance(core, actor, danceName, visual): actor.setPosture(0x09); playerObject = actor.getSlottedObject('ghost') - if playerObject and playerObject.getProfession() == "entertainer_1a": + if playerObject and playerObject.getProfession() == "entertainer_1a" and actor.getLevel() != 90: entSvc.startPerformanceExperience(actor) dance = entSvc.getDance(visual) diff --git a/scripts/radial/player.py b/scripts/radial/player.py index 4b6d74bd..6ad15a17 100644 --- a/scripts/radial/player.py +++ b/scripts/radial/player.py @@ -4,11 +4,16 @@ import sys def createRadial(core, owner, target, radials): if target.getPosture() == Posture.SkillAnimating: - if target.getPerformanceType() is True: - radials.add(RadialOptions(0, 140, 3, 'Watch')) + if owner.getPerformanceWatchee() == target: + if target.getPerformanceType() is True: + radials.add(RadialOptions(0, 141, 3, 'Stop Watching')) + elif owner.getPerformanceListenee() == target: # TODO: Get rid of PerformanceWatchee variable, no need for listenee (same thing really) + radials.add(RadialOptions(0, 141, 3, 'Stop Listening')) else: - radials.add(RadialOptions(0, 140, 3, 'Listen')) - + if target.getPerformanceType() is True: + radials.add(RadialOptions(0, 140, 3, 'Watch')) + else: + radials.add(RadialOptions(0, 140, 3, 'Listen')) return def handleSelection(core, owner, target, option): @@ -20,4 +25,8 @@ def handleSelection(core, owner, target, option): # TODO: Insert callCommand /listen return return + + if option == 141: + #core.commandService.callCommand(owner, 'stopwatching', target, '') #SWGList error for remove audience in CreatureObject + return return \ No newline at end of file diff --git a/scripts/radial/ring/unity.py b/scripts/radial/ring/unity.py index 8c1c4c5d..92940452 100644 --- a/scripts/radial/ring/unity.py +++ b/scripts/radial/ring/unity.py @@ -16,10 +16,10 @@ def createRadial(core, owner, target, radials): if targetPlayer is not None and targetPlayer.getSlottedObject('ghost') is not None: if targetPlayer.getObjectID() == owner.getObjectID(): return - radials.add(RadialOptions(0, 69, 1, '@unity:mnu_propose')) + radials.add(RadialOptions(0, 69, 3, '@unity:mnu_propose')) return else: - radials.add(RadialOptions(0, 70, 1, '@unity:mnu_divorce')) + radials.add(RadialOptions(0, 70, 3, '@unity:mnu_divorce')) return return diff --git a/src/protocol/swg/objectControllerObjects/ShowLootBox.java b/src/protocol/swg/objectControllerObjects/ShowLootBox.java index e295fc2d..432ddd14 100644 --- a/src/protocol/swg/objectControllerObjects/ShowLootBox.java +++ b/src/protocol/swg/objectControllerObjects/ShowLootBox.java @@ -23,6 +23,7 @@ package protocol.swg.objectControllerObjects; import java.nio.ByteOrder; import java.util.List; +import java.util.Vector; import org.apache.mina.core.buffer.IoBuffer; @@ -33,9 +34,15 @@ import resources.common.StringUtilities; public class ShowLootBox extends ObjControllerObject { private long playerId; - private SWGObject[] rewards; + private Vector rewards; + private SWGObject reward; - public ShowLootBox(long playerId, SWGObject[] rewards) { + public ShowLootBox(long playerId, SWGObject reward) { + this.playerId = playerId; + this.rewards = rewards; + } + + public ShowLootBox(long playerId, Vector rewards) { this.playerId = playerId; this.rewards = rewards; } @@ -47,19 +54,24 @@ public class ShowLootBox extends ObjControllerObject { @Override public IoBuffer serialize() { - // Controller Type = 11 - IoBuffer buffer = IoBuffer.allocate(20 + (rewards.length * 8)).order(ByteOrder.LITTLE_ENDIAN); + IoBuffer buffer; + + if (rewards != null) + buffer = IoBuffer.allocate(20 + (rewards.size() * 8)).order(ByteOrder.LITTLE_ENDIAN); + + else + buffer = IoBuffer.allocate(28).order(ByteOrder.LITTLE_ENDIAN); buffer.putInt(ObjControllerMessage.SHOW_LOOT_BOX); buffer.putLong(playerId); buffer.putInt(0); // 1 for a black background on icon, 0 or 2 for transparent (default) - if (rewards.length == 1) { + if (rewards == null) { buffer.putInt(1); - buffer.putLong(rewards[0].getObjectId()); + buffer.putLong(reward.getObjectId()); } else { - buffer.putInt(rewards.length); + buffer.putInt(rewards.size()); for(SWGObject obj : rewards) { buffer.putLong(obj.getObjectID()); } diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index 510ce0ed..2d89527f 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -422,6 +422,7 @@ public class CreatureObject extends TangibleObject implements IPersistent { if(performanceType) { next.sendSystemMessage("You stop watching " + getCustomName() + ".",(byte)0); } else { next.sendSystemMessage("You stop listening to " + getCustomName() + ".",(byte)0); } next.getSpectatorTask().cancel(true); + next.getInspirationTick().cancel(true); } //not sure if this behaviour is correct. might need fixing later. performanceAudience = new SWGList(); diff --git a/src/resources/objects/tangible/TangibleObject.java b/src/resources/objects/tangible/TangibleObject.java index edadfaf2..8c579480 100644 --- a/src/resources/objects/tangible/TangibleObject.java +++ b/src/resources/objects/tangible/TangibleObject.java @@ -322,15 +322,15 @@ public class TangibleObject extends SWGObject { } public void showFlyText(String stfFile, String stfString, String customText, int xp, float scale, RGB color, int displayType, int unkInt) { - Set observers = getObservers(); + //Set observers = getObservers(); if (getClient() != null) { getClient().getSession().write((new ObjControllerMessage(0x0000000B, new ShowFlyText(getObjectID(), getObjectID(), unkInt, 1, 1, -1, stfFile, stfString, customText, xp, scale, color, displayType))).serialize()); } - for (Client client : observers) { + /*for (Client client : observers) { client.getSession().write((new ObjControllerMessage(0x0000000B, new ShowFlyText(client.getParent().getObjectID(), getObjectID(), unkInt, 1, 1, -1, stfFile, stfString, customText, xp, scale, color, displayType))).serialize()); - } + }*/ } public void playEffectObject(String effectFile, String commandString) { diff --git a/src/services/EntertainmentService.java b/src/services/EntertainmentService.java index 96522779..9e1a0b64 100644 --- a/src/services/EntertainmentService.java +++ b/src/services/EntertainmentService.java @@ -386,17 +386,14 @@ public class EntertainmentService implements INetworkDispatch { reciever.setAttachment("buffWorkshop", stats); - core.buffService.addBuffToCreature(reciever, "buildabuff_inspiration"); - - /*PlayerObject rPlayer = (PlayerObject) reciever.getSlottedObject("ghost"); + PlayerObject rPlayer = (PlayerObject) reciever.getSlottedObject("ghost"); - long timeStamp = 0; if (reciever.getAttachment("buffWorkshopTimestamp") != null) timeStamp = (long) reciever.getAttachment("buffWorkshopTimestamp"); - - if (core.buffService.addBuffToCreature(reciever, "buildabuff_inspiration") && !rPlayer.getProfession().equals("entertainer_1a")) { + core.buffService.addBuffToCreature(reciever, "buildabuff_inspiration", buffer); + /*if (core.buffService.addBuffToCreature(reciever, "buildabuff_inspiration", buffer) && !rPlayer.getProfession().equals("entertainer_1a")) { if (timeStamp == 0 || (System.currentTimeMillis() - timeStamp > 86400000)) { float random = ranWorkshop.nextFloat(); if (random < 0.75f) { @@ -636,8 +633,8 @@ public class EntertainmentService implements INetworkDispatch { buffCap += durationMod.getBase() + durationMod.getModifier(); } - if (time == buffCap) { - System.out.println("Reached buff cap"); + if (time >= buffCap) { + spectator.setAttachment("inspireDuration", buffCap); // incase someone went over cap spectator.getInspirationTick().cancel(true); } else { int entTick = 10; @@ -653,7 +650,7 @@ public class EntertainmentService implements INetworkDispatch { spectator.showFlyText("spam", "buff_duration_tick_observer", String.valueOf(hours) + " hours , " + hMinutes + " minutes ", 0, (float) 0.66, new RGB(255, 182, 193), 3, 78); spectator.setAttachment("inspireDuration", duration); - System.out.println("Inspire Duration: " + spectator.getAttachment("inspireDuration") + " on " + spectator.getCustomName()); + //System.out.println("Inspire Duration: " + spectator.getAttachment("inspireDuration") + " on " + spectator.getCustomName()); } } diff --git a/src/services/PlayerService.java b/src/services/PlayerService.java index 195726a1..dd2f9608 100644 --- a/src/services/PlayerService.java +++ b/src/services/PlayerService.java @@ -761,7 +761,7 @@ public class PlayerService implements INetworkDispatch { } if (rewards != null && !rewards.isEmpty()) { - giveItems(creature, (SWGObject[]) rewards.toArray()); + giveItems(creature, rewards); } } catch (InstantiationException | IllegalAccessException e) { @@ -775,6 +775,9 @@ public class PlayerService implements INetworkDispatch { } catch (InstantiationException | IllegalAccessException e) { e.printStackTrace(); } + + if(player.getProfession().equals("entertainer_1a") && creature.getLevel() == (short) 90) + creature.getEntertainerExperience().cancel(true); //} } @@ -818,11 +821,38 @@ public class PlayerService implements INetworkDispatch { } /** - * Gives a player items and shows the "New Items" message. - * @param reciever Player receiving the items - * @param items The object(s) to be given. This will allow multiple arguments. + * Gives a player an item and shows the "New Items" message. + * @param reciever Player receiving the item. + * @param item The object to be given. + * @author Waverunner */ - public void giveItems(CreatureObject reciever, SWGObject... items) { + public void giveItem(CreatureObject reciever, SWGObject item) { + if (reciever == null || item == null) + return; + + if (reciever.getClient() == null) + return; + Client client = reciever.getClient(); + + if (client.getSession() == null) + return; + SWGObject inventory = reciever.getSlottedObject("inventory"); + + if (inventory == null) + return; + + inventory.add(item); + + ObjControllerMessage objController = new ObjControllerMessage(11, new ShowLootBox(reciever.getObjectID(), item)); + client.getSession().write(objController.serialize()); + } + + /** + * Gives a player a variety of items and shows the "New Items" message. + * @param reciever Player receiving the items. + * @param items Vector of the items. + */ + public void giveItems(CreatureObject reciever, Vector items) { if (reciever == null || items == null) return; diff --git a/src/services/collections/CollectionService.java b/src/services/collections/CollectionService.java index 582b4aab..e31bde4c 100644 --- a/src/services/collections/CollectionService.java +++ b/src/services/collections/CollectionService.java @@ -142,7 +142,7 @@ public class CollectionService implements INetworkDispatch { int bits = 0; boolean noScriptOnModify = false; boolean clearOnComplete = false; - boolean noMessage = false; + boolean noMessage = true; boolean grantIfPreReqMet = true; boolean buddyCollection = false; int numAltTitles = 0; From c0fcda14df703c065225451e40eb7bcc556620d7 Mon Sep 17 00:00:00 2001 From: Seefo Date: Sun, 23 Mar 2014 16:04:57 -0400 Subject: [PATCH 18/28] Fixed issue #114 --- src/services/EquipmentService.java | 5 +++-- src/services/SkillService.java | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/services/EquipmentService.java b/src/services/EquipmentService.java index 9f8ce9a5..cc3ebe02 100644 --- a/src/services/EquipmentService.java +++ b/src/services/EquipmentService.java @@ -172,7 +172,6 @@ public class EquipmentService implements INetworkDispatch { } public void equip(CreatureObject actor, SWGObject item) { - String template = ((item.getAttachment("customServerTemplate") == null) ? item.getTemplate() : (item.getTemplate().split("shared_")[0] + "shared_" + ((String) item.getAttachment("customServerTemplate")) + ".iff")); String serverTemplate = template.replace(".iff", ""); PyObject func = core.scriptService.getMethod("scripts/" + serverTemplate.split("shared_" , 2)[0].replace("shared_", ""), serverTemplate.split("shared_" , 2)[1], "equip"); @@ -221,7 +220,6 @@ public class EquipmentService implements INetworkDispatch { public void unequip(CreatureObject actor, SWGObject item) { - String template = ((item.getAttachment("customServerTemplate") == null) ? item.getTemplate() : (item.getTemplate().split("shared_")[0] + "shared_" + ((String) item.getAttachment("customServerTemplate")) + ".iff")); String serverTemplate = template.replace(".iff", ""); PyObject func = core.scriptService.getMethod("scripts/" + serverTemplate.split("shared_" , 2)[0].replace("shared_", ""), serverTemplate.split("shared_" , 2)[1], "unequip"); @@ -241,6 +239,9 @@ public class EquipmentService implements INetworkDispatch { if(e.getKey().startsWith("cat_skill_mod_bonus.@stat_n:")) { core.skillModService.deductSkillMod(actor, e.getKey().replace("cat_skill_mod_bonus.@stat_n:", ""), Integer.parseInt((String) e.getValue())); + } + if(e.getKey().startsWith("cat_stat_mod_bonus.@stat_n:")) { + core.skillModService.deductSkillMod(actor, e.getKey().replace("cat_stat_mod_bonus.@stat_n:", ""), Integer.parseInt((String) e.getValue())); } if(e.getKey().startsWith("cat_attrib_mod_bonus.attr_health")) { actor.setMaxHealth(actor.getMaxHealth() - Integer.parseInt((String) e.getValue())); diff --git a/src/services/SkillService.java b/src/services/SkillService.java index c3926f7b..e1cff8a2 100644 --- a/src/services/SkillService.java +++ b/src/services/SkillService.java @@ -287,15 +287,12 @@ public class SkillService implements INetworkDispatch { public int caluclateExpertisePoints(CreatureObject creature) { int expertisePoints = 0; - try { DatatableVisitor table = ClientFileManager.loadFile("datatables/player/player_level.iff", DatatableVisitor.class); for (int i = 0; i <= creature.getLevel(); i++) expertisePoints += (int) table.getObject(i, 5); } catch (Exception e) { e.printStackTrace(); } - - System.out.println("Player should have " + expertisePoints + " expertise points."); return expertisePoints; } From 6e0049ea3764014277bbe664a6f5044cdd38f86b Mon Sep 17 00:00:00 2001 From: Waverunner Date: Sun, 23 Mar 2014 16:32:25 -0400 Subject: [PATCH 19/28] Reduced spawning distance from traveling --- src/services/travel/TravelService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/travel/TravelService.java b/src/services/travel/TravelService.java index 6eeb3bb5..c81be385 100644 --- a/src/services/travel/TravelService.java +++ b/src/services/travel/TravelService.java @@ -323,7 +323,7 @@ public class TravelService implements INetworkDispatch { public void doTransport(SWGObject actor, TravelPoint tp) { Planet planet = core.terrainService.getPlanetByName(tp.getPlanetName()); - Point3D spawnLocation = SpawnPoint.getRandomPosition(tp.getShuttle().getPosition(), 10, 50, actor.getPlanetId()); + Point3D spawnLocation = SpawnPoint.getRandomPosition(tp.getShuttle().getPosition(), 5, 20, actor.getPlanetId()); core.simulationService.transferToPlanet(actor, planet, spawnLocation, new Quaternion(0, 0, 0, 0), null); } From b0025f5d61f184855e9a795f268904134c2bf6bf Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Sun, 23 Mar 2014 22:43:00 +0100 Subject: [PATCH 20/28] Jedi - Wracking Energy now affects Maelstrom --- scripts/commands/combat/fs_maelstrom_1.py | 11 +++++++++++ scripts/commands/combat/fs_maelstrom_2.py | 11 +++++++++++ scripts/commands/combat/fs_maelstrom_3.py | 11 +++++++++++ scripts/commands/combat/fs_maelstrom_4.py | 11 +++++++++++ scripts/commands/combat/fs_maelstrom_5.py | 11 +++++++++++ 5 files changed, 55 insertions(+) create mode 100644 scripts/commands/combat/fs_maelstrom_1.py create mode 100644 scripts/commands/combat/fs_maelstrom_2.py create mode 100644 scripts/commands/combat/fs_maelstrom_3.py create mode 100644 scripts/commands/combat/fs_maelstrom_4.py create mode 100644 scripts/commands/combat/fs_maelstrom_5.py diff --git a/scripts/commands/combat/fs_maelstrom_1.py b/scripts/commands/combat/fs_maelstrom_1.py new file mode 100644 index 00000000..70a66b61 --- /dev/null +++ b/scripts/commands/combat/fs_maelstrom_1.py @@ -0,0 +1,11 @@ +import sys + +def setup(core, actor, target, command): + + if actor.getSkillMod('expertise_fs_dm_armor_bypass'): + command.setBypassArmor(actor.getSkillModBase("expertise_fs_dm_armor_bypass")) + + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/fs_maelstrom_2.py b/scripts/commands/combat/fs_maelstrom_2.py new file mode 100644 index 00000000..70a66b61 --- /dev/null +++ b/scripts/commands/combat/fs_maelstrom_2.py @@ -0,0 +1,11 @@ +import sys + +def setup(core, actor, target, command): + + if actor.getSkillMod('expertise_fs_dm_armor_bypass'): + command.setBypassArmor(actor.getSkillModBase("expertise_fs_dm_armor_bypass")) + + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/fs_maelstrom_3.py b/scripts/commands/combat/fs_maelstrom_3.py new file mode 100644 index 00000000..70a66b61 --- /dev/null +++ b/scripts/commands/combat/fs_maelstrom_3.py @@ -0,0 +1,11 @@ +import sys + +def setup(core, actor, target, command): + + if actor.getSkillMod('expertise_fs_dm_armor_bypass'): + command.setBypassArmor(actor.getSkillModBase("expertise_fs_dm_armor_bypass")) + + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/fs_maelstrom_4.py b/scripts/commands/combat/fs_maelstrom_4.py new file mode 100644 index 00000000..70a66b61 --- /dev/null +++ b/scripts/commands/combat/fs_maelstrom_4.py @@ -0,0 +1,11 @@ +import sys + +def setup(core, actor, target, command): + + if actor.getSkillMod('expertise_fs_dm_armor_bypass'): + command.setBypassArmor(actor.getSkillModBase("expertise_fs_dm_armor_bypass")) + + return + +def run(core, actor, target, commandString): + return \ No newline at end of file diff --git a/scripts/commands/combat/fs_maelstrom_5.py b/scripts/commands/combat/fs_maelstrom_5.py new file mode 100644 index 00000000..70a66b61 --- /dev/null +++ b/scripts/commands/combat/fs_maelstrom_5.py @@ -0,0 +1,11 @@ +import sys + +def setup(core, actor, target, command): + + if actor.getSkillMod('expertise_fs_dm_armor_bypass'): + command.setBypassArmor(actor.getSkillModBase("expertise_fs_dm_armor_bypass")) + + return + +def run(core, actor, target, commandString): + return \ No newline at end of file From c7c56b5c812d91622ce5d39e7410c823f3be4972 Mon Sep 17 00:00:00 2001 From: Seefo Date: Sun, 23 Mar 2014 19:19:18 -0400 Subject: [PATCH 21/28] Initial work on Character Builder Terminal For some reason after using the blue frog, you will have to wait a minute or so to use it again. --- .../terminal/terminal_character_builder.py | 5 + scripts/static_spawns/tatooine.py | 2 +- src/main/NGECore.java | 3 + src/services/DevService.java | 152 ++++++++++++++++++ 4 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 src/services/DevService.java diff --git a/scripts/object/tangible/terminal/terminal_character_builder.py b/scripts/object/tangible/terminal/terminal_character_builder.py index ccad8904..d95cbb4c 100644 --- a/scripts/object/tangible/terminal/terminal_character_builder.py +++ b/scripts/object/tangible/terminal/terminal_character_builder.py @@ -1,4 +1,9 @@ import sys def setup(core, object): + object.setAttachment('radial_filename', 'usable') + return + +def use(core, owner, target): + core.devService.sendCharacterBuilderSUI(owner, 0); return \ No newline at end of file diff --git a/scripts/static_spawns/tatooine.py b/scripts/static_spawns/tatooine.py index 4ff2338b..785f26b5 100644 --- a/scripts/static_spawns/tatooine.py +++ b/scripts/static_spawns/tatooine.py @@ -8,7 +8,7 @@ def addPlanetSpawns(core, planet): #this script is no longer for NPC spawning usage. - Levarris #stcSvc.spawnObject('object/mobile/shared_3po_protocol_droid_red.iff', 'tatooine', long(26582), float(-14.3), float(2.0), float(47.4), float(0.70), float(0.71)) - + stcSvc.spawnObject('object/tangible/terminal/shared_terminal_character_builder.iff', 'tatooine', long(0), float(3525), float(4), float(-4801), float(0.70), float(0.71)) return diff --git a/src/main/NGECore.java b/src/main/NGECore.java index 6a351892..fbdea822 100644 --- a/src/main/NGECore.java +++ b/src/main/NGECore.java @@ -52,6 +52,7 @@ import services.AttributeService; import services.BuffService; import services.CharacterService; import services.ConnectionService; +import services.DevService; import services.EntertainmentService; import services.EquipmentService; import services.GroupService; @@ -165,6 +166,7 @@ public class NGECore { public AIService aiService; //public MissionService missionService; public InstanceService instanceService; + public DevService devService; // Login Server public NetworkDispatch loginDispatch; @@ -257,6 +259,7 @@ public class NGECore { skillModService = new SkillModService(this); equipmentService = new EquipmentService(this); entertainmentService = new EntertainmentService(this); + devService = new DevService(this); if (config.keyExists("JYTHONCONSOLE.PORT")) { int jythonPort = config.getInt("JYTHONCONSOLE.PORT"); diff --git a/src/services/DevService.java b/src/services/DevService.java new file mode 100644 index 00000000..41dd9190 --- /dev/null +++ b/src/services/DevService.java @@ -0,0 +1,152 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package services; + +import java.nio.ByteOrder; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Vector; + +import org.apache.mina.core.buffer.IoBuffer; +import org.apache.mina.core.session.IoSession; + +import protocol.swg.ExpertiseRequestMessage; + +import resources.common.Console; +import resources.common.FileUtilities; +import resources.common.Opcodes; +import resources.common.SpawnPoint; +import resources.objects.building.BuildingObject; +import resources.objects.creature.CreatureObject; +import resources.objects.player.PlayerObject; +import resources.objects.tangible.TangibleObject; +import services.sui.SUIWindow; +import services.sui.SUIService.ListBoxType; +import services.sui.SUIWindow.SUICallback; +import services.sui.SUIWindow.Trigger; +import main.NGECore; +import engine.clientdata.ClientFileManager; +import engine.clientdata.visitors.DatatableVisitor; +import engine.clients.Client; +import engine.resources.objects.SWGObject; +import engine.resources.scene.Planet; +import engine.resources.scene.Point3D; +import engine.resources.service.INetworkDispatch; +import engine.resources.service.INetworkRemoteEvent; + +@SuppressWarnings("unused") +public class DevService implements INetworkDispatch { + + private NGECore core; + + public DevService(NGECore core) { + this.core = core; + } + + public void sendCharacterBuilderSUI(CreatureObject creature, int childMenu) + { + Map suiOptions = new HashMap(); + + switch(childMenu) + { + case 0: + suiOptions.put((long) 1, "Character"); + suiOptions.put((long) 2, "Items"); + break; + case 1: + suiOptions.put((long) 10, "Set combat level to 90"); + suiOptions.put((long) 11, "Give 100,000 credits"); + break; + case 2: + suiOptions.put((long) 20, "(Light) Jedi Robe"); + suiOptions.put((long) 21, "(Dark) Jedi Robe"); + suiOptions.put((long) 22, "Composite Armor"); + break; + } + + final SUIWindow window = core.suiService.createListBox(ListBoxType.LIST_BOX_OK_CANCEL, "Character Builder Terminal", "Select the desired option and click OK.", suiOptions, creature, null, 10); + Vector returnList = new Vector(); + + returnList.add("List.lstList:SelectedRow"); + + window.addHandler(0, "", Trigger.TRIGGER_OK, returnList, new SUICallback() + { + public void process(SWGObject owner, int eventType, Vector returnList) + { + int index = Integer.parseInt(returnList.get(0)); + int childIndex = (int) window.getObjectIdByIndex(index); + + CreatureObject player = (CreatureObject) owner; + SWGObject inventory = player.getSlottedObject("inventory"); + Planet planet = player.getPlanet(); + + switch(childIndex) + { + case 1: + sendCharacterBuilderSUI(player, childIndex); + return; + case 2: + sendCharacterBuilderSUI(player, childIndex); + return; + case 10: + core.playerService.giveExperience(player, 999999999); + return; + case 11: + player.setCashCredits(player.getCashCredits() + 100000); + return; + case 20: + inventory.add(core.objectService.createObject("object/tangible/wearables/robe/shared_robe_jedi_light_s03.iff", planet)); + return; + case 21: + inventory.add(core.objectService.createObject("object/tangible/wearables/robe/shared_robe_jedi_dark_s03.iff", planet)); + return; + case 22: + inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bicep_r.iff", planet)); + inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bicep_l.iff", planet)); + inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bracer_r.iff", planet)); + inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bracer_l.iff", planet)); + inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_helmet.iff", planet)); + inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_chest_plate.iff", planet)); + inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_leggings.iff", planet)); + inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_boots.iff", planet)); + inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_gloves.iff", planet)); + return; + } + } + }); + + core.suiService.openSUIWindow(window); + } + + @Override + public void insertOpcodes(Map swgOpcodes, Map objControllerOpcodes) { + } + + + @Override + public void shutdown() { + + } + +} From 859729e48e86579f19991ab85e309efbb3451883 Mon Sep 17 00:00:00 2001 From: Seefo Date: Sun, 23 Mar 2014 20:03:15 -0400 Subject: [PATCH 22/28] Added message if a player cannot equip an item. --- scripts/commands/transferitemarmor.py | 1 + scripts/commands/transferitemmisc.py | 1 + scripts/commands/transferitemweapon.py | 1 + scripts/commands/ventriloquism.py | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/commands/transferitemarmor.py b/scripts/commands/transferitemarmor.py index bfd8486d..2edbec74 100644 --- a/scripts/commands/transferitemarmor.py +++ b/scripts/commands/transferitemarmor.py @@ -5,6 +5,7 @@ def setup(): def run(core, actor, target, commandString): if core.equipmentService.canEquip(actor, target) is False: + actor.sendSystemMessage('@error_message:insufficient_skill', 0) return diff --git a/scripts/commands/transferitemmisc.py b/scripts/commands/transferitemmisc.py index ee205206..5dc726fd 100644 --- a/scripts/commands/transferitemmisc.py +++ b/scripts/commands/transferitemmisc.py @@ -5,6 +5,7 @@ def setup(): def run(core, actor, target, commandString): if core.equipmentService.canEquip(actor, target) is False: + actor.sendSystemMessage('@error_message:insufficient_skill', 0) return diff --git a/scripts/commands/transferitemweapon.py b/scripts/commands/transferitemweapon.py index 2640ac0c..71a6d322 100644 --- a/scripts/commands/transferitemweapon.py +++ b/scripts/commands/transferitemweapon.py @@ -5,6 +5,7 @@ def setup(): def run(core, actor, target, commandString): if core.equipmentService.canEquip(actor, target) is False: + actor.sendSystemMessage('@error_message:insufficient_skill') return diff --git a/scripts/commands/ventriloquism.py b/scripts/commands/ventriloquism.py index dca08014..043293ff 100644 --- a/scripts/commands/ventriloquism.py +++ b/scripts/commands/ventriloquism.py @@ -20,7 +20,7 @@ def run(core, actor, target, commandString): rLevel = 90 if actor.getLevel() < rLevel: - actor.sendSystemMessage('@performance:effect_lack_skill_self') + actor.sendSystemMessage('@performance:effect_lack_skill_self', 0) if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_ventriloquism', 0) From 01b29d87df3aac503d15e188d9f066a973154019 Mon Sep 17 00:00:00 2001 From: Seefo Date: Sun, 23 Mar 2014 21:16:01 -0400 Subject: [PATCH 23/28] Added more items to Character Builder Terminal --- scripts/commands/transferitemweapon.py | 2 +- src/services/DevService.java | 86 ++++++++++++++++++++++---- src/services/EquipmentService.java | 2 +- 3 files changed, 76 insertions(+), 14 deletions(-) diff --git a/scripts/commands/transferitemweapon.py b/scripts/commands/transferitemweapon.py index 71a6d322..6e356571 100644 --- a/scripts/commands/transferitemweapon.py +++ b/scripts/commands/transferitemweapon.py @@ -5,7 +5,7 @@ def setup(): def run(core, actor, target, commandString): if core.equipmentService.canEquip(actor, target) is False: - actor.sendSystemMessage('@error_message:insufficient_skill') + actor.sendSystemMessage('@error_message:insufficient_skill', 0) return diff --git a/src/services/DevService.java b/src/services/DevService.java index 41dd9190..feb3c1a3 100644 --- a/src/services/DevService.java +++ b/src/services/DevService.java @@ -70,18 +70,24 @@ public class DevService implements INetworkDispatch { switch(childMenu) { - case 0: + case 0: // Root suiOptions.put((long) 1, "Character"); suiOptions.put((long) 2, "Items"); break; - case 1: + case 1: // Character suiOptions.put((long) 10, "Set combat level to 90"); suiOptions.put((long) 11, "Give 100,000 credits"); break; - case 2: + case 2: // Items suiOptions.put((long) 20, "(Light) Jedi Robe"); suiOptions.put((long) 21, "(Dark) Jedi Robe"); suiOptions.put((long) 22, "Composite Armor"); + suiOptions.put((long) 23, "Weapons"); + break; + case 3: // [Items] Weapons + suiOptions.put((long) 30, "Jedi Weapons"); + suiOptions.put((long) 31, "Melee Weapons"); + suiOptions.put((long) 32, "Ranged Weapons"); break; } @@ -103,25 +109,30 @@ public class DevService implements INetworkDispatch { switch(childIndex) { - case 1: - sendCharacterBuilderSUI(player, childIndex); + // Root + case 1: // Character + sendCharacterBuilderSUI(player, 1); return; - case 2: - sendCharacterBuilderSUI(player, childIndex); + case 2: // Items + sendCharacterBuilderSUI(player, 2); return; - case 10: + + // Character + case 10: // Set combat level to 90 core.playerService.giveExperience(player, 999999999); return; - case 11: + case 11: // Give 100,000 credits player.setCashCredits(player.getCashCredits() + 100000); return; - case 20: + + // Items + case 20: // (Light) Jedi Robe inventory.add(core.objectService.createObject("object/tangible/wearables/robe/shared_robe_jedi_light_s03.iff", planet)); return; - case 21: + case 21: // (Dark) Jedi Robe inventory.add(core.objectService.createObject("object/tangible/wearables/robe/shared_robe_jedi_dark_s03.iff", planet)); return; - case 22: + case 22: // Composite Armor inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bicep_r.iff", planet)); inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bicep_l.iff", planet)); inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bracer_r.iff", planet)); @@ -132,6 +143,57 @@ public class DevService implements INetworkDispatch { inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_boots.iff", planet)); inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_gloves.iff", planet)); return; + case 23: // Weapons + sendCharacterBuilderSUI(player, 3); + return; + + // [Items] Weapons + case 30: // Jedi Weapons + SWGObject lightsaber1 = core.objectService.createObject("object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_gen5.iff", planet); + lightsaber1.setIntAttribute("required_combat_level", 90); + lightsaber1.setFloatAttribute("cat_wpn_damage.wpn_attack_speed", 1); + lightsaber1.setStringAttribute("class_required", "Jedi"); + lightsaber1.setStringAttribute("cat_wpn_damage.wpn_damage_type", "Energy"); + lightsaber1.setStringAttribute("cat_wpn_damage.damage", "689-1379"); + + SWGObject lightsaber2 = core.objectService.createObject("object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gen5.iff", planet); + lightsaber2.setIntAttribute("required_combat_level", 90); + lightsaber2.setFloatAttribute("cat_wpn_damage.wpn_attack_speed", 1); + lightsaber2.setStringAttribute("class_required", "Jedi"); + lightsaber2.setStringAttribute("cat_wpn_damage.wpn_damage_type", "Energy"); + lightsaber2.setStringAttribute("cat_wpn_damage.damage", "689-1379"); + + SWGObject lightsaber3 = core.objectService.createObject("object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_gen5.iff", planet); + lightsaber3.setIntAttribute("required_combat_level", 90); + lightsaber3.setFloatAttribute("cat_wpn_damage.wpn_attack_speed", 1); + lightsaber3.setStringAttribute("class_required", "Jedi"); + lightsaber3.setStringAttribute("cat_wpn_damage.wpn_damage_type", "Energy"); + lightsaber3.setStringAttribute("cat_wpn_damage.damage", "689-1379"); + + inventory.add(lightsaber1); + inventory.add(lightsaber2); + inventory.add(lightsaber3); + return; + case 31: // Melee Weapons + SWGObject sword1 = core.objectService.createObject("object/weapon/melee/sword/shared_sword_01.iff", planet); + sword1.setIntAttribute("required_combat_level", 90); + sword1.setFloatAttribute("cat_wpn_damage.wpn_attack_speed", 1); + sword1.setStringAttribute("class_required", "None"); + sword1.setStringAttribute("cat_wpn_damage.wpn_damage_type", "Energy"); + sword1.setStringAttribute("cat_wpn_damage.damage", "1100-1200"); + + inventory.add(sword1); + return; + case 32: // Ranged Weapons + SWGObject rifle1 = core.objectService.createObject("object/weapon/ranged/rifle/shared_rifle_e11.iff", planet); + rifle1.setIntAttribute("required_combat_level", 90); + rifle1.setFloatAttribute("cat_wpn_damage.wpn_attack_speed", 1); + rifle1.setStringAttribute("class_required", "None"); + rifle1.setStringAttribute("cat_wpn_damage.wpn_damage_type", "Energy"); + rifle1.setStringAttribute("cat_wpn_damage.damage", "800-1250"); + + inventory.add(rifle1); + return; } } }); diff --git a/src/services/EquipmentService.java b/src/services/EquipmentService.java index cc3ebe02..3e07dc69 100644 --- a/src/services/EquipmentService.java +++ b/src/services/EquipmentService.java @@ -114,7 +114,7 @@ public class EquipmentService implements INetworkDispatch { if (item.getStringAttribute("class_required") != null) { String profession = ((PlayerObject) actor.getSlottedObject("ghost")).getProfession(); - if (item.getStringAttribute("class_required").contentEquals(getFormalProfessionName(profession))) + if (item.getStringAttribute("class_required").contentEquals(getFormalProfessionName(profession)) || item.getStringAttribute("class_required").contentEquals("None")) result = true; else return false; From f03d65a3b2ea057bad6834e8ef52ec17a266d6e8 Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Mon, 24 Mar 2014 02:25:55 +0100 Subject: [PATCH 24/28] Skillmods - Fixed Melee Critical Chance --- scripts/skillMods/expertise_critical_melee.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/skillMods/expertise_critical_melee.py b/scripts/skillMods/expertise_critical_melee.py index ee7769e2..fd6ebde6 100644 --- a/scripts/skillMods/expertise_critical_melee.py +++ b/scripts/skillMods/expertise_critical_melee.py @@ -1,10 +1,16 @@ import sys def add(core, actor, name, base): - actor.addSkillMod(name, base) + actor.addSkillMod("expertise_critical_1h", base) + actor.addSkillMod("expertise_critical_2h", base) + actor.addSkillMod("expertise_critical_unarmed", base) + actor.addSkillMod("expertise_critical_polearm", base) return def deduct(core, actor, name, base): - actor.deductSkillMod(name, base) + actor.deductSkillMod("expertise_critical_1h", base) + actor.deductSkillMod("expertise_critical_2h", base) + actor.deductSkillMod("expertise_critical_unarmed", base) + actor.deductSkillMod("expertise_critical_polearm", base) return \ No newline at end of file From 097d39291ff32600b2f884b4822a6c1fd743ef0f Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Mon, 24 Mar 2014 03:18:02 +0100 Subject: [PATCH 25/28] Misc - Cleaned up EquipmentService --- scripts/equipment/force_protection.py | 32 +++++++ scripts/equipment/weapon_critical.py | 25 ++++++ src/services/EquipmentService.java | 119 ++++++++++---------------- 3 files changed, 101 insertions(+), 75 deletions(-) create mode 100644 scripts/equipment/force_protection.py create mode 100644 scripts/equipment/weapon_critical.py diff --git a/scripts/equipment/force_protection.py b/scripts/equipment/force_protection.py new file mode 100644 index 00000000..c5fd6ce0 --- /dev/null +++ b/scripts/equipment/force_protection.py @@ -0,0 +1,32 @@ +import sys + +def jedi_robe_Faint(): + return 1400 + +def jedi_robe_Weak(): + return 3000 + +def jedi_robe_Lucent(): + return 4000 + +def jedi_robe_Luminous(): + return 5000 + +def jedi_robe_Radiant(): + return 6500 + +def jedi_cloak_Faint(): + return 0 + +def jedi_cloak_Weak(): + return 0 + +def jedi_cloak_Lucent(): + return 4500 + +def jedi_cloak_Luminous(): + return 5600 + +def jedi_cloak_Radiant(): + return 6500 + \ No newline at end of file diff --git a/scripts/equipment/weapon_critical.py b/scripts/equipment/weapon_critical.py new file mode 100644 index 00000000..683c4692 --- /dev/null +++ b/scripts/equipment/weapon_critical.py @@ -0,0 +1,25 @@ +import sys + +def Rifle(): + return "expertise_critical_rifle" + +def Carbine(): + return "expertise_critical_carbine" + +def Pistol(): + return "expertise_critical_pistol" + +def OneHandedMelee(): + return "expertise_critical_1h" + +def TwoHandedMelee(): + return "expertise_critical_2h" + +def Unarmed(): + return "expertise_critical_unarmed" + +def Polearm(): + return "expertise_critical_polearm" + +def FreeTargetingHeavyWeapon(): + return "expertise_critical_heavy" diff --git a/src/services/EquipmentService.java b/src/services/EquipmentService.java index 9f8ce9a5..33b12913 100644 --- a/src/services/EquipmentService.java +++ b/src/services/EquipmentService.java @@ -39,7 +39,7 @@ import resources.objects.player.PlayerObject; public class EquipmentService implements INetworkDispatch { private NGECore core; - + public EquipmentService(NGECore core) { this.core = core; } @@ -51,45 +51,33 @@ public class EquipmentService implements INetworkDispatch { @Override public void shutdown() { - + } - public void weaponCriticalToDisplay(CreatureObject actor, SWGObject item, boolean add) { + private int getWeaponCriticalChance(CreatureObject actor, SWGObject item) { + int weaponCriticalChance = 0; + String weaponCriticalSkillMod = (core.scriptService.getMethod("scripts/equipment/", "weapon_critical", item.getStringAttribute("cat_wpn_damage.wpn_category")/*.replace(" ", "").replace("-", "") + "_" */).__call__().asString()); - if (add == true) { - - switch(item.getStringAttribute("cat_wpn_damage.wpn_category")) { - - case "Rifle": actor.addSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_rifle") * 100); // rifle - case "Carbine": actor.addSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_carbine") * 100); // carbine - case "Pistol": actor.addSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_pistol") * 100); // pistol - case "One-Handed Melee": actor.addSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_1h") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // one-handed - case "Two-Handed Melee": actor.addSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_2h") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // two-handed - case "Unarmed": actor.addSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_unarmed") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // unarmed - case "Polearm": actor.addSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_polearm") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // polearm - case "Free Targeting Heavy Weapon": actor.addSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_heavy") * 100); // Heavy - - - } - - } + if(weaponCriticalSkillMod.contains(" ")) + weaponCriticalSkillMod.replace(" ", ""); - if (add == false) { - - switch(item.getStringAttribute("cat_wpn_damage.wpn_category")) { - - case "Rifle": actor.deductSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_rifle") * 100); // rifle - case "Carbine": actor.deductSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_carbine") * 100); // carbine - case "Pistol": actor.deductSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_pistol") * 100); // pistol - case "One-Handed Melee": actor.deductSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_1h") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // one-handed - case "Two-Handed Melee": actor.deductSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_2h") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // two-handed - case "Unarmed": actor.deductSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_unarmed") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // unarmed - case "Polearm": actor.deductSkillMod("display_only_critical", ((actor.getSkillModBase("expertise_critical_polearm") + actor.getSkillModBase("expertise_critical_melee")) * 100)); // polearm - case "Free Targeting Heavy Weapon": actor.deductSkillMod("display_only_critical", actor.getSkillModBase("expertise_critical_heavy") * 100); // Heavy - } - } + if(weaponCriticalSkillMod.contains("-")) + weaponCriticalSkillMod.replace("-", ""); + + if(actor.getSkillMod(weaponCriticalSkillMod) != null) + weaponCriticalChance = actor.getSkillModBase((core.scriptService.getMethod("scripts/equipment/", "weapon_critical", item.getStringAttribute("cat_wpn_damage.wpn_category").replace(" ", "").replace("-", "") + "_" ).__call__().asString())); + + return weaponCriticalChance; } + private void addWeaponCriticalChance(CreatureObject actor, SWGObject item) { + actor.addSkillMod("display_only_critical", getWeaponCriticalChance(actor, item)); + } + + private void deductWeaponCriticalChance(CreatureObject actor, SWGObject item) { + actor.deductSkillMod("display_only_critical", getWeaponCriticalChance(actor, item)); + } + public String getFormalProfessionName(String stfName) { String formalName = ""; @@ -112,6 +100,12 @@ public class EquipmentService implements INetworkDispatch { public boolean canEquip(CreatureObject actor, SWGObject item) { boolean result = true; + if (item.getAttributes().toString().contains("cat_armor")) + if (actor.getLevel() >= 22) + result = true; + else + return false; + if (item.getStringAttribute("class_required") != null) { String profession = ((PlayerObject) actor.getSlottedObject("ghost")).getProfession(); if (item.getStringAttribute("class_required").contentEquals(getFormalProfessionName(profession))) @@ -126,7 +120,7 @@ public class EquipmentService implements INetworkDispatch { else return false; - if (item.getAttributes().toString().contains("required_combat_level")) + if (item.getAttributes().containsKey("required_combat_level")) if (actor.getLevel() >= item.getIntAttribute("required_combat_level")) result = true; else @@ -135,40 +129,16 @@ public class EquipmentService implements INetworkDispatch { return result; } - public void calculateForceProtection(CreatureObject actor, SWGObject item, boolean add) { - int type = 0; - int level = 0; - int[][] protection = {{1400,3000,4000,5000,6500},{0, 0, 4500, 5600, 6500}}; - - switch ((String) item.getAttachment("type")) { - case "jedi_robe": type = 0; break; - case "jedi_cloak": type = 1; break; - } - - switch (item.getStringAttribute("protection_level")) { - case "Faint": level = 0; break; - case "Weak": level = 1; break; - case "Lucent": level = 2; break; - case "Luminous": level = 3; break; - case "Radiant": level = 4; break; - } - - if (add==true) { - core.skillModService.addSkillMod(actor, "kinetic", protection[type][level]); - core.skillModService.addSkillMod(actor, "energy", protection[type][level]); - core.skillModService.addSkillMod(actor, "heat", protection[type][level]); - core.skillModService.addSkillMod(actor, "cold", protection[type][level]); - core.skillModService.addSkillMod(actor, "acid", protection[type][level]); - core.skillModService.addSkillMod(actor, "electricity", protection[type][level]); - } else { - core.skillModService.deductSkillMod(actor, "kinetic", protection[type][level]); - core.skillModService.deductSkillMod(actor, "energy", protection[type][level]); - core.skillModService.deductSkillMod(actor, "heat", protection[type][level]); - core.skillModService.deductSkillMod(actor, "cold", protection[type][level]); - core.skillModService.deductSkillMod(actor, "acid", protection[type][level]); - core.skillModService.deductSkillMod(actor, "electricity", protection[type][level]); - } - + private void addForceProtection(CreatureObject actor, SWGObject item) { + actor.addSkillMod("expertise_innate_protection_all", getForceProtection(item)); + } + + private void deductForceProtection(CreatureObject actor, SWGObject item) { + actor.deductSkillMod("expertise_innate_protection_all", getForceProtection(item)); + } + + private int getForceProtection(SWGObject item) { + return core.scriptService.getMethod("scripts/equipment/", "force_protection", item.getAttachment("type") + "_" + item.getStringAttribute("protection_level")).__call__().asInt(); } public void equip(CreatureObject actor, SWGObject item) { @@ -180,7 +150,7 @@ public class EquipmentService implements INetworkDispatch { func.__call__(Py.java2py(core), Py.java2py(actor), Py.java2py(item)); if (item.getStringAttribute("protection_level") != null) - calculateForceProtection(actor, item, true); + addForceProtection(actor, item); // TODO: faction restrictions - You had to be a Combatant as minimum in order to EQUIP an item. // TODO: Species restrictions @@ -192,8 +162,8 @@ public class EquipmentService implements INetworkDispatch { if(item.getStringAttribute("cat_wpn_damage.wpn_category") != null) if (actor.getSlotNameForObject(item).contentEquals("hold_r") == true) - weaponCriticalToDisplay(actor, item, true); - + addWeaponCriticalChance(actor, item); + Map attributes = new TreeMap(item.getAttributes()); for(Entry e : attributes.entrySet()) { @@ -229,11 +199,10 @@ public class EquipmentService implements INetworkDispatch { func.__call__(Py.java2py(core), Py.java2py(actor), Py.java2py(item)); if (item.getStringAttribute("protection_level") != null) - calculateForceProtection(actor, item, false); + deductForceProtection(actor, item); if(item.getStringAttribute("cat_wpn_damage.wpn_category") != null) - if (actor.getSlotNameForObject(item).contentEquals("hold_r") == true) - weaponCriticalToDisplay(actor, item, false); + deductWeaponCriticalChance(actor, item); Map attributes = new TreeMap(item.getAttributes()); From 8abdca40c7bb0a147a2cd121d8d149774b9afdef Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Mon, 24 Mar 2014 03:59:16 +0100 Subject: [PATCH 26/28] Blue Frog - Added protection to Composite Armor --- src/services/DevService.java | 81 ++++++++++++++++++++++++++++++++---- 1 file changed, 72 insertions(+), 9 deletions(-) diff --git a/src/services/DevService.java b/src/services/DevService.java index feb3c1a3..062adf0f 100644 --- a/src/services/DevService.java +++ b/src/services/DevService.java @@ -133,15 +133,78 @@ public class DevService implements INetworkDispatch { inventory.add(core.objectService.createObject("object/tangible/wearables/robe/shared_robe_jedi_dark_s03.iff", planet)); return; case 22: // Composite Armor - inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bicep_r.iff", planet)); - inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bicep_l.iff", planet)); - inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bracer_r.iff", planet)); - inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bracer_l.iff", planet)); - inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_helmet.iff", planet)); - inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_chest_plate.iff", planet)); - inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_leggings.iff", planet)); - inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_boots.iff", planet)); - inventory.add(core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_gloves.iff", planet)); + SWGObject bicep_r = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bicep_r.iff", planet); + bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + bicep_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + bicep_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject bicep_l = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bicep_l.iff", planet); + bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + bicep_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + bicep_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject bracer_r = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bracer_r.iff", planet); + bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + bracer_r.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + bracer_r.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject bracer_l = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_bracer_l.iff", planet); + bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + bracer_l.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + bracer_l.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject leggings = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_leggings.iff", planet); + leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + leggings.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + leggings.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject helmet = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_helmet.iff", planet); + helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + helmet.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + helmet.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject chest = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_chest_plate.iff", planet); + chest.setIntAttribute("cat_armor_standard_protection.armor_eff_kinetic", 7000); + chest.setIntAttribute("cat_armor_standard_protection.armor_eff_energy", 5000); + chest.setIntAttribute("cat_armor_special_protection.special_protection_type_heat", 6000); + chest.setIntAttribute("cat_armor_special_protection.special_protection_type_cold", 6000); + chest.setIntAttribute("cat_armor_special_protection.special_protection_type_acid", 6000); + chest.setIntAttribute("cat_armor_special_protection.special_protection_type_electricity", 6000); + + SWGObject boots = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_boots.iff", planet); + SWGObject gloves = core.objectService.createObject("object/tangible/wearables/armor/composite/shared_armor_composite_gloves.iff", planet); + + + + inventory.add(bicep_r); + inventory.add(bicep_l); + inventory.add(bracer_r); + inventory.add(bracer_l); + inventory.add(leggings); + inventory.add(helmet); + inventory.add(chest); + inventory.add(boots); + inventory.add(gloves); + + return; case 23: // Weapons sendCharacterBuilderSUI(player, 3); From 9b3d822bc42b44c6ebf7238307622fdf61285546 Mon Sep 17 00:00:00 2001 From: Waverunner Date: Mon, 24 Mar 2014 11:07:30 -0400 Subject: [PATCH 27/28] Added /covercharge, p. effect abilities use highest effect for your level, bug fixes (Added) Entertainers can now add Cover Charges for their performance (Feature) Using a performance effect that has multiple effect levels will use the highest effect for the entertainers level (Code) Added 2 new methods (Jython and Java version) for Input Boxes that automatically adds the input text to return list. (Code) Moved essential spectating code from /watch script to startSpectating (BugFix) Fixed Null Error when trying to cancel Experience tick if leveled with a cheat. (BugFix) Fixed system messages error on performance abilities --- scripts/commands/colorlights.py | 36 +++++--- scripts/commands/covercharge.py | 46 +++++++++++ scripts/commands/dazzle.py | 36 +++++--- scripts/commands/distract.py | 36 +++++--- scripts/commands/firejet.py | 34 +++++--- scripts/commands/smokebomb.py | 33 +++++--- scripts/commands/spotlight.py | 32 +++++--- scripts/commands/stopwatching.py | 12 +-- scripts/commands/ventriloquism.py | 31 ++++--- scripts/commands/watch.py | 16 ++-- .../objects/creature/CreatureObject.java | 27 ++++-- src/services/EntertainmentService.java | 82 ++++++++++++++++--- src/services/PlayerService.java | 2 +- src/services/sui/SUIService.java | 31 ++++++- 14 files changed, 336 insertions(+), 118 deletions(-) create mode 100644 scripts/commands/covercharge.py diff --git a/scripts/commands/colorlights.py b/scripts/commands/colorlights.py index 5f9f7abc..0708c4ea 100644 --- a/scripts/commands/colorlights.py +++ b/scripts/commands/colorlights.py @@ -4,23 +4,35 @@ def setup(): return def run(core, actor, target, commandString): - + level = actor.getLevel() command = 'ColorLights1' effect = 'clienteffect/entertainer_color_lights_level_1.cef' rLevel = 4 # minimum level to perform this effect - if commandString == '2': - command = 'ColorLights2' - effect = 'clienteffect/entertainer_color_lights_level_2.cef' - rLevel = 20 + if commandString is None or commandString == '': + + if level >= 50: + command = 'ColorLights3' + effect = 'clienteffect/entertainer_color_lights_level_3.cef' + + elif level >= 20: + command = 'ColorLights2' + effect = 'clienteffect/entertainer_color_lights_level_2.cef' - elif commandString == '3': - command = 'ColorLights3' - effect = 'clienteffect/entertainer_color_lights_level_3.cef' - rLevel = 50 - - if actor.getLevel() < rLevel: - actor.sendSystemMessage('@performance:effect_lack_skill_self') + if commandString is not None: + if commandString == '2': + command = 'ColorLights2' + effect = 'clienteffect/entertainer_color_lights_level_2.cef' + rLevel = 20 + + elif commandString == '3': + command = 'ColorLights3' + effect = 'clienteffect/entertainer_color_lights_level_3.cef' + rLevel = 50 + + if level < rLevel: + actor.sendSystemMessage('@performance:effect_lack_skill_self', 0) + return if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_color_lights', 0) diff --git a/scripts/commands/covercharge.py b/scripts/commands/covercharge.py new file mode 100644 index 00000000..82ca56af --- /dev/null +++ b/scripts/commands/covercharge.py @@ -0,0 +1,46 @@ +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): + ghost = actor.getSlottedObject('ghost') + if ghost.getProfession() != 'entertainer_1a': + actor.sendSystemMessage('@performance:cc_no_skill', 0) + return + if commandString == '0': + actor.setCoverCharge(0) + actor.sendSystemMessage('@performance:cc_stop_charge', 0) + return + + if commandString == None or commandString == '': + window = core.suiService.createInputBox(2, '@performance:cc_set_title', '@performance:cc_set_prompt', actor, None, 10, handleCoverCharge) + window.setProperty('txtInput:NumericInteger', 'true') + window.setProperty('txtInput:MaxLength', '12') + core.suiService.openSUIWindow(window) + return + else: + try: + actor.setCoverCharge(int(commandString)) + actor.sendSystemMessage('You are now charging a cover of ' + commandString + ' credit(s).', 0) + except ValueError: + return + return + return + +def handleCoverCharge(actor, window, eventType, returnList): + if eventType == 0 and len(returnList) == 1: + charge = returnList.get(0) + if charge == "0": + actor.setCoverCharge(0) + actor.sendSystemMessage('@performance:cc_stop_charge', 0) + return + else: + actor.setCoverCharge(int(returnList.get(0))) + actor.sendSystemMessage('You are now charging a cover of ' + returnList.get(0) + ' credits(s).', 0) + return + return + return \ No newline at end of file diff --git a/scripts/commands/dazzle.py b/scripts/commands/dazzle.py index e1d8cefd..03e79b11 100644 --- a/scripts/commands/dazzle.py +++ b/scripts/commands/dazzle.py @@ -4,23 +4,35 @@ def setup(): return def run(core, actor, target, commandString): - + level = actor.getLevel() command = 'Dazzle1' effect = 'clienteffect/entertainer_dazzle_level_1.cef' rLevel = 10 # minimum level to perform this effect - if commandString == '2': - command = 'Dazzle2' - effect = 'clienteffect/entertainer_dazzle_level_2.cef' - rLevel = 20 + if commandString is None or commandString == '': + + if level >= 30: + command = 'Dazzle3' + effect = 'clienteffect/entertainer_dazzle_level_3.cef' + + elif level >= 20: + command = 'Dazzle2' + effect = 'clienteffect/entertainer_dazzle_level_2.cef' - elif commandString == '3': - command = 'Dazzle3' - effect = 'clienteffect/entertainer_dazzle_level_3.cef' - rLevel = 30 - - if actor.getLevel() < rLevel: - actor.sendSystemMessage('@performance:effect_lack_skill_self') + if commandString is not None: + if commandString == '2': + command = 'Dazzle2' + effect = 'clienteffect/entertainer_dazzle_level_2.cef' + rLevel = 20 + + elif commandString == '3': + command = 'Dazzle3' + effect = 'clienteffect/entertainer_dazzle_level_3.cef' + rLevel = 30 + + if level < rLevel: + actor.sendSystemMessage('@performance:effect_lack_skill_self', 0) + return if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_dazzle', 0) diff --git a/scripts/commands/distract.py b/scripts/commands/distract.py index d92cb55e..ec57828b 100644 --- a/scripts/commands/distract.py +++ b/scripts/commands/distract.py @@ -4,25 +4,35 @@ def setup(): return def run(core, actor, target, commandString): - + level = actor.getLevel() command = 'Distract1' effect = 'clienteffect/entertainer_distract_level_1.cef' rLevel = 18 # minimum level to perform this effect - if commandString == '2': - command = 'Distract2' - effect = 'clienteffect/entertainer_distract_level_2.cef' - rLevel = 50 + if commandString is None or commandString == '': + if level >= 75: + command = 'Distract3' + effect = 'clienteffect/entertainer_distract_level_3.cef' + + elif level >= 50: + command = 'Distract2' + effect = 'clienteffect/entertainer_distract_level_2.cef' - elif commandString == '3': - command = 'Distract3' - effect = 'clienteffect/entertainer_distract_level_3.cef' - rLevel = 75 - - if actor.getLevel() < rLevel: - actor.sendSystemMessage('@performance:effect_lack_skill_self') + if commandString is not None: + if commandString == '2': + command = 'Distract2' + effect = 'clienteffect/entertainer_distract_level_2.cef' + rLevel = 50 + + elif commandString == '3': + command = 'Distract3' + effect = 'clienteffect/entertainer_distract_level_3.cef' + rLevel = 75 + + if level < rLevel: + actor.sendSystemMessage('@performance:effect_lack_skill_self', 0) return - + if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_distract', 0) return \ No newline at end of file diff --git a/scripts/commands/firejet.py b/scripts/commands/firejet.py index 63a5ba54..26261d56 100644 --- a/scripts/commands/firejet.py +++ b/scripts/commands/firejet.py @@ -4,25 +4,35 @@ def setup(): return def run(core, actor, target, commandString): - + level = actor.getLevel() command = 'FireJets1' effect = 'clienteffect/entertainer_fire_jets_level_1.cef' rLevel = 26 # minimum level to perform this effect - if commandString == '2': - command = 'FireJets2' - effect = 'clienteffect/entertainer_fire_jets_level_2.cef' - rLevel = 50 + if commandString is None or commandString == '': + if level >= 75: + command = 'FireJets3' + effect = 'clienteffect/entertainer_fire_jets_level_3.cef' + + elif level >= 50: + command = 'FireJets2' + effect = 'clienteffect/entertainer_fire_jets_level_2.cef' - elif commandString == '3': - command = 'FireJets3' - effect = 'clienteffect/entertainer_fire_jets_level_3.cef' - rLevel = 75 + if commandString is not None: + if commandString == '2': + command = 'FireJets2' + effect = 'clienteffect/entertainer_fire_jets_level_2.cef' + rLevel = 50 + + elif commandString == '3': + command = 'FireJets3' + effect = 'clienteffect/entertainer_fire_jets_level_3.cef' + rLevel = 75 - if actor.getLevel() < rLevel: - actor.sendSystemMessage('@performance:effect_lack_skill_self') + if level < rLevel: + actor.sendSystemMessage('@performance:effect_lack_skill_self', 0) return - + if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_fire_jets', 0) return \ No newline at end of file diff --git a/scripts/commands/smokebomb.py b/scripts/commands/smokebomb.py index cb747ce1..a9da5abb 100644 --- a/scripts/commands/smokebomb.py +++ b/scripts/commands/smokebomb.py @@ -4,23 +4,34 @@ def setup(): return def run(core, actor, target, commandString): - + level = actor.getLevel() command = 'SmokeBomb1' effect = 'clienteffect/entertainer_smoke_bomb_level_1.cef' rLevel = 50 # minimum level to perform this effect - if commandString == '2': - command = 'SmokeBomb2' - effect = 'clienteffect/entertainer_smoke_bomb_level_2.cef' - rLevel = 75 + if commandString is None or commandString == '': + if level >= 90: + command = 'SmokeBomb3' + effect = 'clienteffect/entertainer_smoke_bomb_level_3.cef' + + elif level >= 75: + command = 'SmokeBomb2' + effect = 'clienteffect/entertainer_smoke_bomb_level_2.cef' - elif commandString == '3': - command = 'SmokeBomb3' - effect = 'clienteffect/entertainer_smoke_bomb_level_3.cef' - rLevel = 90 + if commandString is not None: + if commandString == '2': + command = 'SmokeBomb2' + effect = 'clienteffect/entertainer_smoke_bomb_level_2.cef' + rLevel = 75 + + elif commandString == '3': + command = 'SmokeBomb3' + effect = 'clienteffect/entertainer_smoke_bomb_level_3.cef' + rLevel = 90 - if actor.getLevel() < rLevel: - actor.sendSystemMessage('@performance:effect_lack_skill_self') + if level < rLevel: + actor.sendSystemMessage('@performance:effect_lack_skill_self', 0) + return if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_smoke_bomb', 0) diff --git a/scripts/commands/spotlight.py b/scripts/commands/spotlight.py index 1f94394a..204c0017 100644 --- a/scripts/commands/spotlight.py +++ b/scripts/commands/spotlight.py @@ -5,23 +5,33 @@ def setup(): return def run(core, actor, target, commandString): - + level = actor.getLevel() command = 'SpotLight1' effect = 'clienteffect/entertainer_spot_light_level_1.cef' rLevel = 1 # minimum level to perform this effect - if commandString == '2': - command = 'SpotLight2' - effect = 'clienteffect/entertainer_spot_light_level_2.cef' - rLevel = 20 + if commandString is None or commandString == '': + if level >= 30: + command = 'SpotLight3' + effect = 'clienteffect/entertainer_spot_light_level_3.cef' + + elif level >= 20: + command = 'SpotLight2' + effect = 'clienteffect/entertainer_spot_light_level_2.cef' - elif commandString == '3': - command = 'SpotLight3' - effect = 'clienteffect/entertainer_spot_light_level_3.cef' - rLevel = 30 + if commandString is not None: + if commandString == '2': + command = 'SpotLight2' + effect = 'clienteffect/entertainer_spot_light_level_2.cef' + rLevel = 20 + + elif commandString == '3': + command = 'SpotLight3' + effect = 'clienteffect/entertainer_spot_light_level_3.cef' + rLevel = 30 - if actor.getLevel() < rLevel: - actor.sendSystemMessage('@performance:effect_lack_skill_self') + if level < rLevel: + actor.sendSystemMessage('@performance:effect_lack_skill_self', 0) return if core.entertainmentService.performEffect(actor, command, effect, None) is True: diff --git a/scripts/commands/stopwatching.py b/scripts/commands/stopwatching.py index 7dc96fc8..23a36c17 100644 --- a/scripts/commands/stopwatching.py +++ b/scripts/commands/stopwatching.py @@ -4,12 +4,14 @@ def setup(): return def run(core, actor, target, commandString): - dancer = actor.getPerformanceWatchee() - if not dancer: - return - + performer = target + if commandString is not None and target is None: + performer = core.chatService.getObjectByFirstName(commandString) + + if performer is None: + return + performer.removeAudience(actor) actor.setPerformanceWatchee(None) - dancer.removeAudience(actor) if not actor.getPerformanceListenee(): actor.setMoodAnimation('') diff --git a/scripts/commands/ventriloquism.py b/scripts/commands/ventriloquism.py index 043293ff..1781fbd1 100644 --- a/scripts/commands/ventriloquism.py +++ b/scripts/commands/ventriloquism.py @@ -4,23 +4,34 @@ def setup(): return def run(core, actor, target, commandString): - + level = actor.getLevel() command = 'Ventriloquism1' effect = 'clienteffect/entertainer_ventriloquism_level_1.cef' rLevel = 58 # minimum level to perform this effect - if commandString == '2': - command = 'Ventriloquism2' - effect = 'clienteffect/entertainer_ventriloquism_level_2.cef' - rLevel = 75 + if commandString is None or commandString == '': + if level >= 90: + command = 'Ventriloquism3' + effect = 'clienteffect/entertainer_ventriloquism_level_3.cef' + + elif level >= 75: + command = 'Ventriloquism2' + effect = 'clienteffect/entertainer_ventriloquism_level_2.cef' - elif commandString == '3': - command = 'Ventriloquism3' - effect = 'clienteffect/entertainer_ventriloquism_level_3.cef' - rLevel = 90 + if commandString is not None: + if commandString == '2': + command = 'Ventriloquism2' + effect = 'clienteffect/entertainer_ventriloquism_level_2.cef' + rLevel = 75 + + elif commandString == '3': + command = 'Ventriloquism3' + effect = 'clienteffect/entertainer_ventriloquism_level_3.cef' + rLevel = 90 - if actor.getLevel() < rLevel: + if level < rLevel: actor.sendSystemMessage('@performance:effect_lack_skill_self', 0) + return if core.entertainmentService.performEffect(actor, command, effect, target) is True: actor.sendSystemMessage('@performance:effect_perform_ventriloquism', 0) diff --git a/scripts/commands/watch.py b/scripts/commands/watch.py index 0a9baf04..07ca268d 100644 --- a/scripts/commands/watch.py +++ b/scripts/commands/watch.py @@ -26,14 +26,10 @@ def run(core, actor, target, commandString): if target.getPosture() != 0x09 or not perf or perf.getDanceVisualId() < 0: actor.sendSystemMessage(target.getCustomName() + ' is not dancing.',0) return - - oldWatchee = actor.getPerformanceWatchee() - if oldWatchee and oldWatchee != target: - oldWatchee.removeAudience(actor) - - actor.setPerformanceWatchee(target) - target.addAudience(actor) - core.entertainmentService.startSpectating(actor, target) - actor.setMoodAnimation('entertained') - actor.sendSystemMessage('You start watching ' + target.getCustomName() + '.',0) + + if target.getCoverCharge() > 0 or target.getCoverCharge() == None: + core.entertainmentService.handleCoverCharge(actor, target) + return + else: + core.entertainmentService.startSpectating(actor, target, True) return \ No newline at end of file diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index 2d89527f..efb52cb8 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -57,7 +57,7 @@ import engine.resources.scene.Quaternion; import resources.objects.tangible.TangibleObject; import resources.objects.weapon.WeaponObject; -@Entity(version=2) +@Entity(version=3) public class CreatureObject extends TangibleObject implements IPersistent { @NotPersistent @@ -119,12 +119,8 @@ public class CreatureObject extends TangibleObject implements IPersistent { private int performanceCounter = 0; private int performanceId = 0; private boolean hologram = false; - //FIXME: this is a bit of a hack. private boolean performanceType = false; - //FIXME: hmm.. or persistent? - @NotPersistent private boolean acceptBandflourishes = true; - @NotPersistent private boolean groupDance = true; private CreatureObject performanceWatchee; private CreatureObject performanceListenee; @@ -172,6 +168,8 @@ public class CreatureObject extends TangibleObject implements IPersistent { @NotPersistent private boolean performingEffect; + private int coverCharge; + public CreatureObject(long objectID, Planet planet, Point3D position, Quaternion orientation, String Template) { super(objectID, planet, Template, position, orientation); messageBuilder = new CreatureMessageBuilder(this); @@ -422,7 +420,6 @@ public class CreatureObject extends TangibleObject implements IPersistent { if(performanceType) { next.sendSystemMessage("You stop watching " + getCustomName() + ".",(byte)0); } else { next.sendSystemMessage("You stop listening to " + getCustomName() + ".",(byte)0); } next.getSpectatorTask().cancel(true); - next.getInspirationTick().cancel(true); } //not sure if this behaviour is correct. might need fixing later. performanceAudience = new SWGList(); @@ -1539,7 +1536,11 @@ public class CreatureObject extends TangibleObject implements IPersistent { public void removeAudience(CreatureObject audienceMember) { synchronized(objectMutex) { if (performanceAudience == null) { return; } - performanceAudience.remove(audienceMember); + if (audienceMember.getInspirationTick() != null) + audienceMember.getInspirationTick().cancel(true); + + if(performanceAudience.contains(audienceMember)) + performanceAudience.remove(audienceMember); // SWGList error } } @@ -1690,4 +1691,16 @@ public class CreatureObject extends TangibleObject implements IPersistent { return hologram; } } + + public int getCoverCharge() { + synchronized(objectMutex) { + return coverCharge; + } + } + + public void setCoverCharge(int coverCharge) { + synchronized (objectMutex) { + this.coverCharge = coverCharge; + } + } } diff --git a/src/services/EntertainmentService.java b/src/services/EntertainmentService.java index 9e1a0b64..d3375af1 100644 --- a/src/services/EntertainmentService.java +++ b/src/services/EntertainmentService.java @@ -38,6 +38,10 @@ import resources.objects.SWGList; import resources.objects.creature.CreatureObject; import resources.objects.player.PlayerObject; import resources.objects.tangible.TangibleObject; +import services.sui.SUIService.InputBoxType; +import services.sui.SUIWindow; +import services.sui.SUIWindow.SUICallback; +import services.sui.SUIWindow.Trigger; import engine.clientdata.ClientFileManager; import engine.clientdata.visitors.DatatableVisitor; import engine.clients.Client; @@ -341,8 +345,10 @@ public class EntertainmentService implements INetworkDispatch { core.commandService.registerCommand("startdance"); core.commandService.registerCommand("stopdance"); core.commandService.registerCommand("watch"); - core.commandService.registerCommand("stopwatching"); + //core.commandService.registerCommand("stopwatching"); // SWGList error //core.commandService.registerCommand("holoEmote"); + core.commandService.registerCommand("covercharge"); + // TODO: Add /bandsolo, /bandpause, /changeBandMusic, /changeDance, /changeGroupDance, /changeMusic // Entertainer Effects @@ -499,8 +505,19 @@ public class EntertainmentService implements INetworkDispatch { } - public void startSpectating(final CreatureObject spectator, final CreatureObject performer) { - + public void startSpectating(final CreatureObject spectator, final CreatureObject performer, boolean spectateType) { + + // visual + if (spectator.getPerformanceWatchee() == performer && spectateType) + spectator.getPerformanceWatchee().removeAudience(spectator); + // music + else if (spectator.getPerformanceListenee() == performer && !spectateType) + spectator.getPerformanceListenee().removeAudience(spectator); + + spectator.setPerformanceWatchee(performer); + performer.addAudience(spectator); + spectator.setMoodAnimation("entertained"); + final ScheduledFuture spectatorTask = scheduler.scheduleAtFixedRate(new Runnable() { @Override @@ -519,7 +536,7 @@ public class EntertainmentService implements INetworkDispatch { } spectator.setMoodAnimation("neutral"); performer.removeAudience(spectator); - + if (spectator.getInspirationTick().cancel(true)) spectator.getSpectatorTask().cancel(true); } @@ -528,11 +545,16 @@ public class EntertainmentService implements INetworkDispatch { }, 2, 2, TimeUnit.SECONDS); spectator.setSpectatorTask(spectatorTask); - + if(((PlayerObject)performer.getSlottedObject("ghost")).getProfession().equals("entertainer_1a")) { handleInspirationTicks(spectator, performer); } - + + if(spectateType) + spectator.sendSystemMessage("You start watching " + performer.getCustomName() + ".", (byte) 0); + else + spectator.sendSystemMessage("You start listening to " + performer.getCustomName() + ".", (byte) 0); + } public void performFlourish(final CreatureObject performer, int flourish) { @@ -624,15 +646,15 @@ public class EntertainmentService implements INetworkDispatch { public void run() { int time = 0; // current buff duration time (minutes) int buffCap = 215; // 5 hours 35 minutes - 2 hours (buff duration increase bonus) << Taken from video, doesn't account for performance bonuses etc. - + if (spectator.getAttachment("inspireDuration") != null) time+= (int) spectator.getAttachment("inspireDuration"); - + if (performer.getSkillMod("expertise_en_inspire_buff_duration_increase") != null) { SkillMod durationMod = performer.getSkillMod("expertise_en_inspire_buff_duration_increase"); buffCap += durationMod.getBase() + durationMod.getModifier(); } - + if (time >= buffCap) { spectator.setAttachment("inspireDuration", buffCap); // incase someone went over cap spectator.getInspirationTick().cancel(true); @@ -642,22 +664,58 @@ public class EntertainmentService implements INetworkDispatch { SkillMod pulseMod = performer.getSkillMod("expertise_en_inspire_pulse_duration_increase"); entTick += pulseMod.getBase() + pulseMod.getModifier(); } - + int duration = (time + entTick); // minutes int hMinutes = MathUtilities.secondsToHourMinutes(duration * 60); int hours = MathUtilities.secondsToWholeHours(duration * 60); spectator.showFlyText("spam", "buff_duration_tick_observer", String.valueOf(hours) + " hours , " + hMinutes + " minutes ", 0, (float) 0.66, new RGB(255, 182, 193), 3, 78); - + spectator.setAttachment("inspireDuration", duration); //System.out.println("Inspire Duration: " + spectator.getAttachment("inspireDuration") + " on " + spectator.getCustomName()); } } - + }, 10, 10, TimeUnit.SECONDS); spectator.setInspirationTick(inspirationTick); } + public void handleCoverCharge(final CreatureObject actor, final CreatureObject performer) { + final int charge = performer.getCoverCharge(); + + if (charge == 0) + return; + + else { + SUIWindow notification = core.suiService.createMessageBox(InputBoxType.INPUT_BOX_OK, "Cover Charge", performer.getCustomName() + + " has a cover charge of " + performer.getCoverCharge() + ". Do you wish to pay it?", actor, performer, (float) 30); + Vector returnParams = new Vector(); + + returnParams.add("btnOk:Text"); + + notification.addHandler(0, "", Trigger.TRIGGER_OK, returnParams, new SUICallback(){ + + @Override + public void process(SWGObject owner, int eventType, Vector returnList) { + if (eventType == 0) { + if (charge > actor.getCashCredits()) { + actor.sendSystemMessage("You do not have enough credits to cover the charge.", (byte) 0); // TODO: Find the message in the STF files. + return; + } else{ + actor.setCashCredits(actor.getCashCredits() - charge); + actor.sendSystemMessage("You payed the cover charge of " + charge + " to " + performer.getCustomName(), (byte) 0); // TODO: Find the message in the STF files. + performer.setCashCredits(performer.getCashCredits() + charge); + + startSpectating(actor, performer, performer.getPerformanceType()); + + } + } + } + }); + core.suiService.openSUIWindow(notification); + } + } + @Override public void shutdown() { diff --git a/src/services/PlayerService.java b/src/services/PlayerService.java index dd2f9608..96e1f987 100644 --- a/src/services/PlayerService.java +++ b/src/services/PlayerService.java @@ -776,7 +776,7 @@ public class PlayerService implements INetworkDispatch { e.printStackTrace(); } - if(player.getProfession().equals("entertainer_1a") && creature.getLevel() == (short) 90) + if(player.getProfession().equals("entertainer_1a") && creature.getLevel() == (short) 90 && creature.getEntertainerExperience() != null) creature.getEntertainerExperience().cancel(true); //} } diff --git a/src/services/sui/SUIService.java b/src/services/sui/SUIService.java index e898c576..8f496dc1 100644 --- a/src/services/sui/SUIService.java +++ b/src/services/sui/SUIService.java @@ -43,13 +43,12 @@ import protocol.swg.SUIForceClosePageMessage; import protocol.swg.SUIUpdatePageMessage; import protocol.swg.objectControllerObjects.ObjectMenuRequest; import protocol.swg.objectControllerObjects.ObjectMenuResponse; - import resources.common.FileUtilities; import resources.common.ObjControllerOpcodes; import resources.common.Opcodes; import resources.common.RadialOptions; import services.sui.SUIWindow.SUICallback; - +import services.sui.SUIWindow.Trigger; import engine.clients.Client; import engine.resources.objects.SWGObject; import engine.resources.service.INetworkDispatch; @@ -334,6 +333,34 @@ public class SUIService implements INetworkDispatch { return window; } + /** + * Creates an Input Box SUIWindow and adds a handler that will return text inputed into text box with the callback as the specified PyObject. + * @param PyObject Definition that will be run when user clicks on "OK" + * @return SUIWindow + * @author Waverunner + */ + public SUIWindow createInputBox(int type, String title, String promptText, SWGObject owner, SWGObject rangeObject, float maxDistance, PyObject handleFunc) { + SUIWindow window = createInputBox(type, title, promptText, owner, rangeObject, maxDistance); + Vector returnParams = new Vector(); + returnParams.add("txtInput:LocalText"); + window.addHandler(0, "", Trigger.TRIGGER_OK, returnParams, handleFunc); + return window; + } + + /** + * Creates an Input Box SUIWindow and adds a handler that will return text inputed into text box with the callback as the specified PyObject. + * @param SUICallback Callback that will be ran when user clicks on "OK" + * @return SUIWindow + * @author Waverunner + */ + public SUIWindow createInputBox(int type, String title, String promptText, SWGObject owner, SWGObject rangeObject, float maxDistance, SUICallback handleFunc) { + SUIWindow window = createInputBox(type, title, promptText, owner, rangeObject, maxDistance); + Vector returnParams = new Vector(); + returnParams.add("txtInput:LocalText"); + window.addHandler(0, "", Trigger.TRIGGER_OK, returnParams, handleFunc); + return window; + } + public void closeSUIWindow(SWGObject owner, int id) { if(owner.getClient() == null || owner.getClient().getSession() == null) From e94c32f0924472dae54f0bade522b5eed30c196d Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Mon, 24 Mar 2014 17:17:48 +0100 Subject: [PATCH 28/28] Medic - Buffs now apply correctly when targeting non-players --- scripts/commands/me_buff_health_1.py | 8 ++++---- scripts/commands/me_buff_health_2.py | 8 ++++---- scripts/commands/me_buff_health_3.py | 8 ++++---- scripts/commands/me_enhance_action_1.py | 8 ++++---- scripts/commands/me_enhance_action_2.py | 8 ++++---- scripts/commands/me_enhance_action_3.py | 8 ++++---- scripts/commands/me_enhance_agility_1.py | 8 ++++---- scripts/commands/me_enhance_agility_2.py | 8 ++++---- scripts/commands/me_enhance_agility_3.py | 8 ++++---- scripts/commands/me_enhance_block_1.py | 8 ++++---- scripts/commands/me_enhance_dodge_1.py | 8 ++++---- scripts/commands/me_enhance_precision_1.py | 8 ++++---- scripts/commands/me_enhance_precision_2.py | 8 ++++---- scripts/commands/me_enhance_precision_3.py | 8 ++++---- scripts/commands/me_enhance_strength_1.py | 8 ++++---- scripts/commands/me_enhance_strength_2.py | 8 ++++---- scripts/commands/me_enhance_strength_3.py | 8 ++++---- 17 files changed, 68 insertions(+), 68 deletions(-) diff --git a/scripts/commands/me_buff_health_1.py b/scripts/commands/me_buff_health_1.py index 1e41c9ae..fb9880d2 100644 --- a/scripts/commands/me_buff_health_1.py +++ b/scripts/commands/me_buff_health_1.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_health') + core.buffService.addGroupBuff(target, 'me_buff_health', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_health') + core.buffService.addBuffToCreature(target, 'me_buff_health', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_health') + core.buffService.addGroupBuff(actor, 'me_buff_health', actor) return \ No newline at end of file diff --git a/scripts/commands/me_buff_health_2.py b/scripts/commands/me_buff_health_2.py index 117444bb..dd4c396c 100644 --- a/scripts/commands/me_buff_health_2.py +++ b/scripts/commands/me_buff_health_2.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_health_2') + core.buffService.addGroupBuff(target, 'me_buff_health_2', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_health_2') + core.buffService.addBuffToCreature(target, 'me_buff_health_2', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_health_2') + core.buffService.addGroupBuff(actor, 'me_buff_health_2', actor) return \ No newline at end of file diff --git a/scripts/commands/me_buff_health_3.py b/scripts/commands/me_buff_health_3.py index 29a22740..26ec110f 100644 --- a/scripts/commands/me_buff_health_3.py +++ b/scripts/commands/me_buff_health_3.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_health_3') + core.buffService.addGroupBuff(target, 'me_buff_health_3', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_health_3') + core.buffService.addBuffToCreature(target, 'me_buff_health_3', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_health_3') + core.buffService.addGroupBuff(actor, 'me_buff_health_3', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_action_1.py b/scripts/commands/me_enhance_action_1.py index 0b065ab5..9239af4d 100644 --- a/scripts/commands/me_enhance_action_1.py +++ b/scripts/commands/me_enhance_action_1.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_action_1') + core.buffService.addGroupBuff(target, 'me_buff_action_1', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_action_1') + core.buffService.addBuffToCreature(target, 'me_buff_action_1', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_action_1') + core.buffService.addGroupBuff(actor, 'me_buff_action_1', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_action_2.py b/scripts/commands/me_enhance_action_2.py index a076dfdd..1c9b8dff 100644 --- a/scripts/commands/me_enhance_action_2.py +++ b/scripts/commands/me_enhance_action_2.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_action_2') + core.buffService.addGroupBuff(target, 'me_buff_action_2', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_action_2') + core.buffService.addBuffToCreature(target, 'me_buff_action_2', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_action_2') + core.buffService.addGroupBuff(actor, 'me_buff_action_2', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_action_3.py b/scripts/commands/me_enhance_action_3.py index 1108c400..a4d9dd4a 100644 --- a/scripts/commands/me_enhance_action_3.py +++ b/scripts/commands/me_enhance_action_3.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_action_3') + core.buffService.addGroupBuff(target, 'me_buff_action_3', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_action_3') + core.buffService.addBuffToCreature(target, 'me_buff_action_3', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_action_3') + core.buffService.addGroupBuff(actor, 'me_buff_action_3', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_agility_1.py b/scripts/commands/me_enhance_agility_1.py index 24e2c05b..50b163ac 100644 --- a/scripts/commands/me_enhance_agility_1.py +++ b/scripts/commands/me_enhance_agility_1.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_agility_1') + core.buffService.addGroupBuff(target, 'me_buff_agility_1', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_agility_1') + core.buffService.addBuffToCreature(target, 'me_buff_agility_1', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_agility_1') + core.buffService.addGroupBuff(actor, 'me_buff_agility_1', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_agility_2.py b/scripts/commands/me_enhance_agility_2.py index 63474e3f..0df03459 100644 --- a/scripts/commands/me_enhance_agility_2.py +++ b/scripts/commands/me_enhance_agility_2.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_agility_2') + core.buffService.addGroupBuff(target, 'me_buff_agility_2', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_agility_2') + core.buffService.addBuffToCreature(target, 'me_buff_agility_2', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_agility_2') + core.buffService.addGroupBuff(actor, 'me_buff_agility_2', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_agility_3.py b/scripts/commands/me_enhance_agility_3.py index 4d665fc3..fe489909 100644 --- a/scripts/commands/me_enhance_agility_3.py +++ b/scripts/commands/me_enhance_agility_3.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_agility_3') + core.buffService.addGroupBuff(target, 'me_buff_agility_3', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_agility_3') + core.buffService.addBuffToCreature(target, 'me_buff_agility_3', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_agility_3') + core.buffService.addGroupBuff(actor, 'me_buff_agility_3', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_block_1.py b/scripts/commands/me_enhance_block_1.py index d4ef98b6..d1f27220 100644 --- a/scripts/commands/me_enhance_block_1.py +++ b/scripts/commands/me_enhance_block_1.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_melee_gb_1') + core.buffService.addGroupBuff(target, 'me_buff_melee_gb_1', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_melee_gb_1') + core.buffService.addBuffToCreature(target, 'me_buff_melee_gb_1', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_melee_gb_1') + core.buffService.addGroupBuff(actor, 'me_buff_melee_gb_1', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_dodge_1.py b/scripts/commands/me_enhance_dodge_1.py index 537d2875..9702a6f3 100644 --- a/scripts/commands/me_enhance_dodge_1.py +++ b/scripts/commands/me_enhance_dodge_1.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_ranged_gb_1') + core.buffService.addGroupBuff(target, 'me_buff_ranged_gb_1', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_ranged_gb_1') + core.buffService.addBuffToCreature(target, 'me_buff_ranged_gb_1', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_ranged_gb_1') + core.buffService.addGroupBuff(actor, 'me_buff_ranged_gb_1', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_precision_1.py b/scripts/commands/me_enhance_precision_1.py index d20c423a..a5ddce5a 100644 --- a/scripts/commands/me_enhance_precision_1.py +++ b/scripts/commands/me_enhance_precision_1.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_precision_1') + core.buffService.addGroupBuff(target, 'me_buff_precision_1', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_precision_1') + core.buffService.addBuffToCreature(target, 'me_buff_precision_1', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_precision_1') + core.buffService.addGroupBuff(actor, 'me_buff_precision_1', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_precision_2.py b/scripts/commands/me_enhance_precision_2.py index a7b808ed..9c6906d2 100644 --- a/scripts/commands/me_enhance_precision_2.py +++ b/scripts/commands/me_enhance_precision_2.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_precision_2') + core.buffService.addGroupBuff(target, 'me_buff_precision_2', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_precision_2') + core.buffService.addBuffToCreature(target, 'me_buff_precision_2', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_precision_2') + core.buffService.addGroupBuff(actor, 'me_buff_precision_2', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_precision_3.py b/scripts/commands/me_enhance_precision_3.py index 76594fce..a4997749 100644 --- a/scripts/commands/me_enhance_precision_3.py +++ b/scripts/commands/me_enhance_precision_3.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_precision_3') + core.buffService.addGroupBuff(target, 'me_buff_precision_3', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_precision_3') + core.buffService.addBuffToCreature(target, 'me_buff_precision_3', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_precision_3') + core.buffService.addGroupBuff(actor, 'me_buff_precision_3', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_strength_1.py b/scripts/commands/me_enhance_strength_1.py index 1ab00983..cf3529bc 100644 --- a/scripts/commands/me_enhance_strength_1.py +++ b/scripts/commands/me_enhance_strength_1.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_strength_1') + core.buffService.addGroupBuff(target, 'me_buff_strength_1', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_strength_1') + core.buffService.addBuffToCreature(target, 'me_buff_strength_1', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_strength_1') + core.buffService.addGroupBuff(actor, 'me_buff_strength_1', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_strength_2.py b/scripts/commands/me_enhance_strength_2.py index e8b21cd0..13ddfe22 100644 --- a/scripts/commands/me_enhance_strength_2.py +++ b/scripts/commands/me_enhance_strength_2.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_strength_2') + core.buffService.addGroupBuff(target, 'me_buff_strength_2', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_strength_2') + core.buffService.addBuffToCreature(target, 'me_buff_strength_2', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_strength_2') + core.buffService.addGroupBuff(actor, 'me_buff_strength_2', actor) return \ No newline at end of file diff --git a/scripts/commands/me_enhance_strength_3.py b/scripts/commands/me_enhance_strength_3.py index e51c7bbc..2a822999 100644 --- a/scripts/commands/me_enhance_strength_3.py +++ b/scripts/commands/me_enhance_strength_3.py @@ -7,13 +7,13 @@ def run(core, actor, target, commandString): group = core.objectService.getObject(actor.getGroupId()) - if target: + if target and target.getSlottedObject("ghost"): if group and target in group.getMemberList(): - core.buffService.addGroupBuff(actor, 'me_buff_strength_3') + core.buffService.addGroupBuff(target, 'me_buff_strength_3', actor) else: - core.buffService.addBuffToCreature(target, 'me_buff_strength_3') + core.buffService.addBuffToCreature(target, 'me_buff_strength_3', actor) else: - core.buffService.addGroupBuff(actor, 'me_buff_strength_3') + core.buffService.addGroupBuff(actor, 'me_buff_strength_3', actor) return \ No newline at end of file