Added expertise, added AoE/Cone combat, added some commando expertise boxes as an example for expertise scripts

This commit is contained in:
Light2
2013-08-28 17:56:35 +02:00
parent 6e9031d4d2
commit cfa5ea5a43
25 changed files with 1030 additions and 16 deletions
+5 -1
View File
@@ -23,7 +23,7 @@ package services.command;
import engine.resources.common.CRC;
public class BaseSWGCommand {
public class BaseSWGCommand implements Cloneable {
private String commandName;
private String clientEffectSelf;
@@ -75,5 +75,9 @@ public class BaseSWGCommand {
public void setCommandCRC(int commandCRC) {
this.commandCRC = commandCRC;
}
protected Object clone() throws CloneNotSupportedException {
return super.clone();
}
}
+9
View File
@@ -67,6 +67,7 @@ public class CombatCommand extends BaseSWGCommand {
private int damageType, elementalType, elementalValue;
private String performanceSpam;
private byte hitSpam;
private float cooldown;
public CombatCommand(String commandName) {
super(commandName);
@@ -584,6 +585,14 @@ public class CombatCommand extends BaseSWGCommand {
return animations[new Random().nextInt(animations.length)];
}
public float getCooldown() {
return cooldown;
}
public void setCooldown(float cooldown) {
this.cooldown = cooldown;
}
+17 -9
View File
@@ -24,7 +24,6 @@ package services.command;
import java.nio.ByteOrder;
import java.util.Map;
import java.util.Vector;
import main.NGECore;
import org.apache.mina.core.buffer.IoBuffer;
@@ -89,13 +88,15 @@ public class CommandService implements INetworkDispatch {
System.out.println("NULL Object");
return;
}
CreatureObject actor = (CreatureObject) client.getParent();
SWGObject target = core.objectService.getObject(commandEnqueue.getTargetID());
if(command instanceof CombatCommand) {
processCombatCommand(actor, target, (CombatCommand) command, commandEnqueue.getActionCounter());
CombatCommand command2 = (CombatCommand) command.clone();
core.scriptService.callScript("scripts/commands/combat", command.getCommandName(), "setup", core, actor, target, command2);
processCombatCommand(actor, target, command2, commandEnqueue.getActionCounter(), commandEnqueue.getCommandArguments());
return;
}
@@ -122,7 +123,6 @@ public class CommandService implements INetworkDispatch {
CombatCommand command = new CombatCommand(name);
commandLookup.add(command);
return command;
}
@@ -139,12 +139,19 @@ public class CommandService implements INetworkDispatch {
}
private void processCombatCommand(CreatureObject attacker, SWGObject target, CombatCommand command, int actionCounter) {
private void processCombatCommand(CreatureObject attacker, SWGObject target, CombatCommand command, int actionCounter, String commandArgs) {
boolean success = true;
if(target == null || !(target instanceof TangibleObject) || target == attacker)
success = false;
if(!(command.getAttackType() == 0) && !(command.getAttackType() == 2) && !(command.getAttackType() == 3)) {
if(target == null || !(target instanceof TangibleObject) || target == attacker)
success = false;
} else {
if(target == null)
target = attacker;
else if(!(target instanceof TangibleObject))
return;
}
if(attacker.getPosture() == 13 || attacker.getPosture() == 14)
success = false;
@@ -167,7 +174,7 @@ public class CommandService implements INetworkDispatch {
maxRange = weapon.getMaxRange();
else
maxRange = command.getMaxRange();
Point3D attackerPos = attacker.getWorldPosition();
Point3D defenderPos = attacker.getWorldPosition();
@@ -179,7 +186,8 @@ public class CommandService implements INetworkDispatch {
success = false;
}
if(!core.simulationService.checkLineOfSight(attacker, target)) {
if(target != attacker && success && !core.simulationService.checkLineOfSight(attacker, target)) {
ShowFlyText los = new ShowFlyText(attacker.getObjectID(), attacker.getObjectID(), "combat_effects", "cant_see", (float) 1.5, (float) 429664.031250);
ObjControllerMessage objController = new ObjControllerMessage(0x1B, los);