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

Cleaned up the emotes code.

This commit is contained in:
Filip Maj 2017-06-15 00:19:18 -04:00
parent 0e8de966a9
commit 1d9f57a385
3 changed files with 14 additions and 11 deletions

View file

@ -771,9 +771,9 @@ namespace FFXIVClassic_Map_Server.Actors
return mountState; return mountState;
} }
public void DoEmote(uint animId, uint descId) public void DoEmote(uint targettedActor, uint animId, uint descId)
{ {
BroadcastPacket(ActorDoEmotePacket.BuildPacket(actorId, actorId, currentTarget, animId, descId), true); BroadcastPacket(ActorDoEmotePacket.BuildPacket(actorId, actorId, targettedActor, animId, descId), true);
} }
public void SendGameMessage(Actor sourceActor, Actor textIdOwner, ushort textId, byte log, params object[] msgParams) public void SendGameMessage(Actor sourceActor, Actor textIdOwner, ushort textId, byte log, params object[] msgParams)

View file

@ -14,16 +14,18 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
{ {
byte[] data = new byte[PACKET_SIZE - 0x20]; byte[] data = new byte[PACKET_SIZE - 0x20];
if (targettedActorId == 0xC0000000) if (targettedActorId == 0)
{
targettedActorId = sourceActorId; targettedActorId = sourceActorId;
if (descriptionId != 10105)
descriptionId++;
}
using (MemoryStream mem = new MemoryStream(data)) using (MemoryStream mem = new MemoryStream(data))
{ {
using (BinaryWriter binWriter = new BinaryWriter(mem)) using (BinaryWriter binWriter = new BinaryWriter(mem))
{ {
uint realAnimID = 0x5000000 | (animationId << 12); uint realAnimID = 0x5000000 | (animationId << 12);
if (descriptionId != 10105 && targettedActorId == sourceActorId)
descriptionId++;
binWriter.Write((UInt32)realAnimID); binWriter.Write((UInt32)realAnimID);
binWriter.Write((UInt32)targettedActorId); binWriter.Write((UInt32)targettedActorId);
binWriter.Write((UInt32)descriptionId); binWriter.Write((UInt32)descriptionId);

View file

@ -63,12 +63,16 @@ emoteTable = {
}; };
function onEventStarted(player, actor, triggerName, emoteId) function onEventStarted(player, actor, triggerName, emoteId, unknownArg1, arg2, arg3, targetId)
if (targetId == nil) then
targetId = 0;
end
if (player:GetState() == 0) then if (player:GetState() == 0) then
emote = emoteTable[emoteId]; emote = emoteTable[emoteId];
if (emote ~= nil) then if (emote ~= nil) then
player:doEmote(emote.animId, emote.descId); player:doEmote(targetId, emote.animId, emote.descId);
else else
player:SendMessage(0x20, "", string.format("Not implemented; EmoteId: %d", emoteId)); player:SendMessage(0x20, "", string.format("Not implemented; EmoteId: %d", emoteId));
end end
@ -77,6 +81,3 @@ function onEventStarted(player, actor, triggerName, emoteId)
player:EndEvent(); player:EndEvent();
end end
function onEventUpdate(player, npc)
end