mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-27 17:57:22 -04:00
Fixed Incap weaken immortality bug
This commit is contained in:
@@ -157,4 +157,31 @@ def addPlanetSpawns(core, planet):
|
||||
aiSvc.setLoiter(r3m6, float(1), float(3))
|
||||
aiSvc.setLoiter(eg1, float(1), float(3))
|
||||
aiSvc.setLoiter(r3j7, float(1), float(3))
|
||||
|
||||
# Looped Patrol must end in same cell like the start point!!!
|
||||
#building id: 1105845 Buildingid + cell !
|
||||
trehla = stcSvc.spawnObject('trehla', 'tatooine', long(1105845 + 8), float(24.21), float(2.12), float(73.49), float(0.92), float(0), float(-0.38), float(0))
|
||||
patrolpointsCells = Vector() # Vector Building reference Patrolpoint CellID
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(25.11), float(2.10), float(50.22)), 7)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(21.25), float(0.6), float(45.51)), 6)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(-11.78), float(0.59), float(45.78)), 6)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(-13.67), float(2.6), float(18.27)), 6)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(-6.63), float(2.6), float(17.87)), 6)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(-6.74), float(2.6), float(1.60)), 6)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(-17.92), float(0.6), float(1.88)), 5)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(-18.21), float(0.6), float(9.40)), 5)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(-24.18), float(0.6), float(9.40)), 5)
|
||||
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(-24.50), float(0.6), float(-4.08)), 2)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(0.03), float(0.6), float(-4.36)), 1)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(25.03), float(0.6), float(-4.10)), 3)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(24.38), float(0.6), float(9.42)), 3)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(17.98), float(0.6), float(9.14)), 4)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(5.44), float(2.6), float(2.33)), 6)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(9.3), float(2.6), float(18.64)), 6)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(14.65), float(0.92), float(40.72)), 6)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(23.9), float(0.93), float(48.22)), 7)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(26.64), float(2.12), float(57.42)), 7)
|
||||
aiSvc.addPatrolPointCell(patrolpointsCells, trehla.getGrandparent(), Point3D(float(27.64), float(2.12), float(70.07)), 8)
|
||||
aiSvc.setPatrol(trehla, patrolpointsCells)
|
||||
return
|
||||
@@ -1067,6 +1067,27 @@ public class SimulationService implements INetworkDispatch {
|
||||
|
||||
}
|
||||
|
||||
public Point3D convertModelSpaceToPoint(Point3D point, SWGObject object) {
|
||||
|
||||
Point3D position = object.getPosition();
|
||||
WB_M44 translateMatrix = new WB_M44(1, 0, 0, position.x, 0, 1, 0, position.y, 0, 0, 1, position.z, 0, 0, 0, 1);
|
||||
|
||||
float radians = object.getRadians();
|
||||
float sin = (float) Math.sin(radians);
|
||||
float cos = (float) Math.cos(radians);
|
||||
|
||||
WB_M44 rotationMatrix = new WB_M44(cos, 0, sin, 0, 0, 1, 0, 0, -sin, 0, cos, 0, 0, 0, 0, 1); //non-inverse matrix
|
||||
|
||||
WB_M44 modelSpace = translateMatrix.mult(rotationMatrix);
|
||||
|
||||
float x = (float) (modelSpace.m11 * point.x + modelSpace.m12 * point.y + modelSpace.m13 * point.z + modelSpace.m14);
|
||||
float y = (float) (modelSpace.m21 * point.x + modelSpace.m22 * point.y + modelSpace.m23 * point.z + modelSpace.m24);
|
||||
float z = (float) (modelSpace.m31 * point.x + modelSpace.m32 * point.y + modelSpace.m33 * point.z + modelSpace.m34);
|
||||
|
||||
return new Point3D(x, y, z);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Moved this to ConnectionService which will disconnect them
|
||||
* from the server if they don't send packets for 5 minutes or more
|
||||
|
||||
@@ -35,6 +35,8 @@ import resources.common.SpawnPoint;
|
||||
import resources.datatables.Difficulty;
|
||||
import resources.datatables.FactionStatus;
|
||||
import resources.datatables.GcwType;
|
||||
import resources.objects.building.BuildingObject;
|
||||
import resources.objects.cell.CellObject;
|
||||
import resources.objects.creature.CreatureObject;
|
||||
import resources.objects.group.GroupObject;
|
||||
import resources.objects.player.PlayerObject;
|
||||
@@ -213,6 +215,15 @@ public class AIService {
|
||||
actor.setCurrentState(new IdleState());
|
||||
}
|
||||
|
||||
public void addPatrolPointCell(Vector<Point3D> patrolpoints, BuildingObject building, Point3D position, int cellID){
|
||||
if (building==null)
|
||||
return;
|
||||
CellObject cellObj = building.getCellByCellNumber(cellID);
|
||||
if (cellObj!=null)
|
||||
position.setCell(cellObj);
|
||||
patrolpoints.add(position);
|
||||
}
|
||||
|
||||
public void setLoiter(CreatureObject creature, float minDist, float maxDist){
|
||||
AIActor actor = (AIActor) creature.getAttachment("AI");
|
||||
if (actor==null)
|
||||
|
||||
@@ -1238,21 +1238,19 @@ public class CombatService implements INetworkDispatch {
|
||||
|
||||
if(target.hasBuff("incapWeaken")) {
|
||||
if (!attacker.isPlayer()){
|
||||
AIActor aiActor = (AIActor)attacker.getAttachment("AI");
|
||||
if (aiActor.getMobileTemplate().isDeathblow())
|
||||
deathblowPlayer(attacker, target);
|
||||
deathblowPlayer(attacker, target);
|
||||
} else
|
||||
{
|
||||
deathblowPlayer(attacker, target);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!attacker.isPlayer()){
|
||||
AIActor aiActor = (AIActor)attacker.getAttachment("AI");
|
||||
if (aiActor.getMobileTemplate().isDeathblow()){
|
||||
deathblowPlayer(attacker, target);
|
||||
return;
|
||||
} else {
|
||||
if (!attacker.isPlayer()){
|
||||
AIActor aiActor = (AIActor)attacker.getAttachment("AI");
|
||||
if (aiActor.getMobileTemplate().isDeathblow()){
|
||||
deathblowPlayer(attacker, target);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user