diff --git a/scripts/mobiles/forage/goon.py b/scripts/mobiles/forage/goon.py index 2ce75838..67637f5d 100644 --- a/scripts/mobiles/forage/goon.py +++ b/scripts/mobiles/forage/goon.py @@ -33,16 +33,16 @@ def addTemplate(core): mobileTemplate.setTemplates(templates) weaponTemplates = Vector() - #weapontemplate = WeaponTemplate('object/weapon/ranged/carbine/shared_carbine_dh17.iff', WeaponType.CARBINE, 0.6, 15, 'kinetic') - #weaponTemplates.add(weapontemplate) - #weapontemplate = WeaponTemplate('object/weapon/ranged/pistol/shared_pistol_dl44.iff', WeaponType.PISTOL, 0.4, 15, 'kinetic') - #weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/ranged/carbine/shared_carbine_dh17.iff', WeaponType.CARBINE, 0.6, 15, 'kinetic') + weaponTemplates.add(weapontemplate) + weapontemplate = WeaponTemplate('object/weapon/ranged/pistol/shared_pistol_dl44.iff', WeaponType.PISTOL, 0.4, 15, 'kinetic') + weaponTemplates.add(weapontemplate) weapontemplate = WeaponTemplate('object/weapon/ranged/rifle/shared_rifle_dlt20a.iff', WeaponType.RIFLE, 1.0, 24, 'kinetic') weaponTemplates.add(weapontemplate) mobileTemplate.setWeaponTemplateVector(weaponTemplates) attacks = Vector() - mobileTemplate.setDefaultAttack('rangedShotrifle') + mobileTemplate.setDefaultAttack('rangedShot') mobileTemplate.setAttacks(attacks) core.spawnService.addMobileTemplate('forage_goon', mobileTemplate) diff --git a/src/main/NGECore.java b/src/main/NGECore.java index d68e1493..cd3208c1 100644 --- a/src/main/NGECore.java +++ b/src/main/NGECore.java @@ -266,6 +266,12 @@ public class NGECore { config = DefaultConfig.getConfig(); } + DevLogQueuer devLogQueuer = new DevLogQueuer(); + + CharonPacketLogger packetLogger; + if (PACKET_DEBUG) + packetLogger = new CharonPacketLogger(); + options = new Config(); options.setFilePath("options.cfg"); if (!(options.loadConfigFile())) { @@ -573,12 +579,6 @@ public class NGECore { //battlefieldService = new BattlefieldService(this); adminService = new AdminService(this); - DevLogQueuer devLogQueuer = new DevLogQueuer(); - - CharonPacketLogger packetLogger; - if (PACKET_DEBUG) - packetLogger = new CharonPacketLogger(); - didServerCrash = false; System.out.println("Started Server."); cleanupCreatureODB(); diff --git a/src/services/ai/states/AttackState.java b/src/services/ai/states/AttackState.java index 383d251a..e5d64038 100644 --- a/src/services/ai/states/AttackState.java +++ b/src/services/ai/states/AttackState.java @@ -262,7 +262,6 @@ public class AttackState extends AIState { creature.setIntendedTarget(target.getObjectId()); if (attacks==null) { - //if(attacks.size() == 0) { core.commandService.callCommand(creature, actor.getMobileTemplate().getDefaultAttack(), target, ""); } else { Random rand = new Random(); diff --git a/src/services/command/CommandService.java b/src/services/command/CommandService.java index 88239133..72dbb552 100644 --- a/src/services/command/CommandService.java +++ b/src/services/command/CommandService.java @@ -73,7 +73,7 @@ public class CommandService implements INetworkDispatch { } public boolean callCommand(CreatureObject actor, SWGObject target, BaseSWGCommand command, int actionCounter, String commandArgs) { - + if (actor == null) return false; @@ -84,14 +84,17 @@ public class CommandService implements INetworkDispatch { if (command == null) return false; - if (command.getCharacterAbility().length() > 0 && !actor.hasAbility(command.getCharacterAbility())) + if (actor.isPlayer() && command.getCharacterAbility().length() > 0 && !actor.hasAbility(command.getCharacterAbility())){ return false; + } - if (command.isDisabled()) + if (command.isDisabled()){ return false; + } - if (actor.hasCooldown(command.getCooldownGroup()) || actor.hasCooldown(command.getCommandName())) + if (actor.hasCooldown(command.getCooldownGroup()) || actor.hasCooldown(command.getCommandName())){ return false; + } // Causes this service method to return with false after equipping a rifle, not allowing to unequip it anymore @@ -299,7 +302,7 @@ public class CommandService implements INetworkDispatch { default: break; } - + if (command.shouldCallOnTarget()) { if (target == null || !(target instanceof CreatureObject)) { return false; @@ -325,8 +328,9 @@ public class CommandService implements INetworkDispatch { e.printStackTrace(); } } - else + else { processCommand(actor, target, command, actionCounter, commandArgs); + } return true; @@ -687,7 +691,7 @@ public class CommandService implements INetworkDispatch { } public void processCommand(CreatureObject actor, SWGObject target, BaseSWGCommand command, int actionCounter, String commandArgs) { - + if (command.getGodLevel() > 0 || command.getCommandName().equals("setgodmode") || command.getCommandName().equals("server") || command.getCommandName().equals("teleport") || command.getCommandName().equals("teleportto") || command.getCommandName().equals("teleporttarget") ) { String accessLevel = core.adminService.getAccessLevelFromDB(actor.getClient().getAccountId()); @@ -708,6 +712,7 @@ public class CommandService implements INetworkDispatch { } if (!levelHasCommand) { + System.out.println("I am an NPC and can't sendSystemMessages " + actor.getCustomName()); actor.sendSystemMessage(" \\#FE2EF7 [GM] \\#FFFFFF " + command.getCommandName() + ": You do not have permission to use this command.", (byte) 0); return; }