1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-20 11:47:48 +00:00

Fixed bug where when a mob was insta-killed they would disappear (not die). More renames for action -> result. Reverted result packet unknown from 0x801 to 0x810. Added hitnum. Fixed isolation.

This commit is contained in:
Filip Maj 2019-05-04 18:53:00 -04:00
parent e236e1d207
commit 080f9ea23d
5 changed files with 31 additions and 23 deletions

View file

@ -443,7 +443,7 @@ namespace FFXIVClassic_Map_Server.Actors
{ {
if (a is Player) if (a is Player)
{ {
if (isIsolated && packet.header.sourceId != a.actorId) if (isIsolated)
continue; continue;
SubPacket clonedPacket = new SubPacket(packet, a.actorId); SubPacket clonedPacket = new SubPacket(packet, a.actorId);

View file

@ -224,25 +224,25 @@ namespace FFXIVClassic_Map_Server.Actors
zone.BroadcastPacketAroundActor(this, CommandResultX00Packet.BuildPacket(actorId, animationId, commandId)); zone.BroadcastPacketAroundActor(this, CommandResultX00Packet.BuildPacket(actorId, animationId, commandId));
} }
public void DoBattleAction(ushort commandId, uint animationId, CommandResult action) public void DoBattleAction(ushort commandId, uint animationId, CommandResult result)
{ {
zone.BroadcastPacketAroundActor(this, CommandResultX01Packet.BuildPacket(actorId, animationId, commandId, action)); zone.BroadcastPacketAroundActor(this, CommandResultX01Packet.BuildPacket(actorId, animationId, commandId, result));
} }
public void DoBattleAction(ushort commandId, uint animationId, CommandResult[] actions) public void DoBattleAction(ushort commandId, uint animationId, CommandResult[] results)
{ {
int currentIndex = 0; int currentIndex = 0;
//AoE abilities only ever hit 16 people, so we probably won't need this loop anymore //AoE abilities only ever hit 16 people, so we probably won't need this loop anymore
//Apparently aoe are limited to 8? //Apparently aoe are limited to 8?
while (true) while (true)
{ {
if (actions.Length - currentIndex >= 10) if (results.Length - currentIndex >= 10)
zone.BroadcastPacketAroundActor(this, CommandResultX18Packet.BuildPacket(actorId, animationId, commandId, actions, ref currentIndex)); zone.BroadcastPacketAroundActor(this, CommandResultX18Packet.BuildPacket(actorId, animationId, commandId, results, ref currentIndex));
else if (actions.Length - currentIndex > 1) else if (results.Length - currentIndex > 1)
zone.BroadcastPacketAroundActor(this, CommandResultX10Packet.BuildPacket(actorId, animationId, commandId, actions, ref currentIndex)); zone.BroadcastPacketAroundActor(this, CommandResultX10Packet.BuildPacket(actorId, animationId, commandId, results, ref currentIndex));
else if (actions.Length - currentIndex == 1) else if (results.Length - currentIndex == 1)
{ {
zone.BroadcastPacketAroundActor(this, CommandResultX01Packet.BuildPacket(actorId, animationId, commandId, actions[currentIndex])); zone.BroadcastPacketAroundActor(this, CommandResultX01Packet.BuildPacket(actorId, animationId, commandId, results[currentIndex]));
currentIndex++; currentIndex++;
} }
else else
@ -253,19 +253,19 @@ namespace FFXIVClassic_Map_Server.Actors
} }
} }
public void DoBattleAction(ushort commandId, uint animationId, List<CommandResult> actions) public void DoBattleAction(ushort commandId, uint animationId, List<CommandResult> results)
{ {
int currentIndex = 0; int currentIndex = 0;
while (true) while (true)
{ {
if (actions.Count - currentIndex >= 10) if (results.Count - currentIndex >= 10)
zone.BroadcastPacketAroundActor(this, CommandResultX18Packet.BuildPacket(actorId, animationId, commandId, actions, ref currentIndex)); zone.BroadcastPacketAroundActor(this, CommandResultX18Packet.BuildPacket(actorId, animationId, commandId, results, ref currentIndex));
else if (actions.Count - currentIndex > 1) else if (results.Count - currentIndex > 1)
zone.BroadcastPacketAroundActor(this, CommandResultX10Packet.BuildPacket(actorId, animationId, commandId, actions, ref currentIndex)); zone.BroadcastPacketAroundActor(this, CommandResultX10Packet.BuildPacket(actorId, animationId, commandId, results, ref currentIndex));
else if (actions.Count - currentIndex == 1) else if (results.Count - currentIndex == 1)
{ {
zone.BroadcastPacketAroundActor(this, CommandResultX01Packet.BuildPacket(actorId, animationId, commandId, actions[currentIndex])); zone.BroadcastPacketAroundActor(this, CommandResultX01Packet.BuildPacket(actorId, animationId, commandId, results[currentIndex]));
currentIndex++; currentIndex++;
} }
else else
@ -374,9 +374,9 @@ namespace FFXIVClassic_Map_Server.Actors
if ((updateFlags & ActorUpdateFlags.SubState) != 0) if ((updateFlags & ActorUpdateFlags.SubState) != 0)
{ {
packets.Add(SetActorSubStatePacket.BuildPacket(actorId, currentSubState)); //packets.Add(SetActorSubStatePacket.BuildPacket(actorId, currentSubState));
packets.Add(CommandResultX00Packet.BuildPacket(actorId, 0x72000062, 0)); //packets.Add(CommandResultX00Packet.BuildPacket(actorId, 0x72000062, 0));
packets.Add(CommandResultX01Packet.BuildPacket(actorId, 0x7C000062, 21001, new CommandResult(actorId, 0, 1))); //packets.Add(CommandResultX01Packet.BuildPacket(actorId, 0x7C000062, 21001, new CommandResult(actorId, 0, 1)));
updateFlags &= ~ActorUpdateFlags.SubState; updateFlags &= ~ActorUpdateFlags.SubState;
//DoBattleAction(21001, 0x7C000062, new BattleAction(this.actorId, 0, 1, 0, 0, 1)); //Attack Mode //DoBattleAction(21001, 0x7C000062, new BattleAction(this.actorId, 0, 1, 0, 0, 1)); //Attack Mode

View file

@ -227,6 +227,14 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.utils
if (defender != null) if (defender != null)
{ {
//Bugfix, mobs that instantly died were insta disappearing due to lastAttacker == null.
if (defender is BattleNpc)
{
var bnpc = defender as BattleNpc;
if (bnpc.lastAttacker == null)
bnpc.lastAttacker = attacker;
}
defender.DelHP((short)action.amount); defender.DelHP((short)action.amount);
attacker.OnDamageDealt(defender, action, actionContainer); attacker.OnDamageDealt(defender, action, actionContainer);
defender.OnDamageTaken(attacker, action, actionContainer); defender.OnDamageTaken(attacker, action, actionContainer);

View file

@ -33,7 +33,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.battle
binWriter.Seek(0x20, SeekOrigin.Begin); binWriter.Seek(0x20, SeekOrigin.Begin);
binWriter.Write((UInt32)1); //Num actions (always 1 for this) binWriter.Write((UInt32)1); //Num actions (always 1 for this)
binWriter.Write((UInt16)commandId); binWriter.Write((UInt16)commandId);
binWriter.Write((UInt16)0x801); //? binWriter.Write((UInt16)0x810); //?
binWriter.Write((UInt32)action.targetId); binWriter.Write((UInt32)action.targetId);
@ -42,7 +42,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.battle
binWriter.Write((UInt32)action.effectId); binWriter.Write((UInt32)action.effectId);
binWriter.Write((Byte)action.param); binWriter.Write((Byte)action.param);
binWriter.Write((Byte)1); //? binWriter.Write((Byte)action.hitNum);
} }
} }

View file

@ -33,7 +33,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.battle
binWriter.Seek(0x20, SeekOrigin.Begin); binWriter.Seek(0x20, SeekOrigin.Begin);
binWriter.Write((UInt32)max); //Num actions binWriter.Write((UInt32)max); //Num actions
binWriter.Write((UInt16)commandId); binWriter.Write((UInt16)commandId);
binWriter.Write((UInt16)0x818); //? binWriter.Write((UInt16)0x810); //?
binWriter.Seek(0x28, SeekOrigin.Begin); binWriter.Seek(0x28, SeekOrigin.Begin);
for (int i = 0; i < max; i++) for (int i = 0; i < max; i++)