This commit is contained in:
yogurt 2017-10-06 20:45:36 -05:00
commit 9fc99faa5c
9 changed files with 64 additions and 60 deletions

View file

@ -33,6 +33,7 @@ namespace FFXIVClassic_Map_Server.Actors
class Actor
{
public static uint INVALID_ACTORID = 0xC0000000;
public uint actorId;
public string actorName;

View file

@ -84,8 +84,8 @@ namespace FFXIVClassic_Map_Server.Actors
public uint animationId = 0;
public uint currentTarget = 0xC0000000;
public uint currentLockedTarget = 0xC0000000;
public uint currentTarget = Actor.INVALID_ACTORID;
public uint currentLockedTarget = Actor.INVALID_ACTORID;
public uint currentActorIcon = 0;
@ -391,9 +391,9 @@ namespace FFXIVClassic_Map_Server.Actors
{
if (targid == 0)
{
if (currentTarget != 0xC0000000)
if (currentTarget != Actor.INVALID_ACTORID)
targid = currentTarget;
else if (currentLockedTarget != 0xC0000000)
else if (currentLockedTarget != Actor.INVALID_ACTORID)
targid = currentLockedTarget;
}
//if (targid != 0)
@ -416,7 +416,7 @@ namespace FFXIVClassic_Map_Server.Actors
{
this.newMainState = newMainState;
}
else
else if (IsEngaged())
{
aiContainer.Disengage();
return true;

View file

@ -153,11 +153,11 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.controllers
waitTime = tick.AddSeconds(10);
owner.OnRoam(tick);
if (!owner.aiContainer.pathFind.IsFollowingPath() && CanMoveForward(0.0f))
if (CanMoveForward(0.0f) && !owner.aiContainer.pathFind.IsFollowingPath())
{
// will move on next tick
owner.aiContainer.pathFind.SetPathFlags(PathFindFlags.None);
owner.aiContainer.pathFind.PathInRange(owner.spawnX, owner.spawnY, owner.spawnZ, 1.5f, 20.0f);
owner.aiContainer.pathFind.PathInRange(owner.spawnX, owner.spawnY, owner.spawnZ, 1.5f, 50.0f);
}
}
@ -173,7 +173,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.controllers
if (!owner.isMovingToSpawn && owner.aiContainer.pathFind.AtPoint() && owner.detectionType != DetectionType.None)
{
uint levelDifference = (uint)Math.Abs(owner.charaWork.parameterSave.state_mainSkillLevel - chara.charaWork.parameterSave.state_mainSkillLevel);
uint levelDifference = (uint)Math.Abs(owner.GetLevel() - chara.GetLevel());
if (levelDifference <= 10 || (owner.detectionType & DetectionType.IgnoreLevelDifference) != 0 && CanAggroTarget(chara))
{
@ -375,8 +375,8 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.controllers
public override void ChangeTarget(Character target)
{
owner.target = target;
owner.currentLockedTarget = target?.actorId ?? 0xC0000000;
owner.currentTarget = target?.actorId ?? 0xC0000000;
owner.currentLockedTarget = target?.actorId ?? Actor.INVALID_ACTORID;
owner.currentTarget = target?.actorId ?? Actor.INVALID_ACTORID;
foreach (var player in owner.zone.GetActorsAroundActor<Player>(owner, 50))
player.QueuePacket(owner.GetHateTypePacket(player));