Ejemplo n.º 1
0
        public void DoBattleAction(ushort commandId, uint animationId, List <CommandResult> actions)
        {
            int currentIndex = 0;

            while (true)
            {
                if (actions.Count - currentIndex >= 10)
                {
                    zone.BroadcastPacketAroundActor(this, CommandResultX18Packet.BuildPacket(actorId, animationId, commandId, actions, ref currentIndex));
                }
                else if (actions.Count - currentIndex > 1)
                {
                    zone.BroadcastPacketAroundActor(this, CommandResultX10Packet.BuildPacket(actorId, animationId, commandId, actions, ref currentIndex));
                }
                else if (actions.Count - currentIndex == 1)
                {
                    zone.BroadcastPacketAroundActor(this, CommandResultX01Packet.BuildPacket(actorId, animationId, commandId, actions[currentIndex]));
                    currentIndex++;
                }
                else
                {
                    break;
                }

                //Sending multiple packets at once causes some issues. Setting any combination of these to zero changes what breaks
                //animationId = 0; //If more than one packet is sent out, only send the animation once to avoid double playing.
                //commandId = 0;
                //sourceActorId = 0;
            }
        }
Ejemplo n.º 2
0
        public void DoBattleAction(ushort commandId, uint animationId, CommandResult[] actions)
        {
            int currentIndex = 0;

            //AoE abilities only ever hit 16 people, so we probably won't need this loop anymore
            //Apparently aoe are limited to 8?
            while (true)
            {
                if (actions.Length - currentIndex >= 10)
                {
                    zone.BroadcastPacketAroundActor(this, CommandResultX18Packet.BuildPacket(actorId, animationId, commandId, actions, ref currentIndex));
                }
                else if (actions.Length - currentIndex > 1)
                {
                    zone.BroadcastPacketAroundActor(this, CommandResultX10Packet.BuildPacket(actorId, animationId, commandId, actions, ref currentIndex));
                }
                else if (actions.Length - currentIndex == 1)
                {
                    zone.BroadcastPacketAroundActor(this, CommandResultX01Packet.BuildPacket(actorId, animationId, commandId, actions[currentIndex]));
                    currentIndex++;
                }
                else
                {
                    break;
                }

                //I think aoe effects play on all hit enemies. Firaga does at least
                //animationId = 0; //If more than one packet is sent out, only send the animation once to avoid double playing.
            }
        }