コード例 #1
0
        public void EncodeForRemote(ref BuffValueTypes flag, long currentTime, Action <BuffStat> func, BuffValueTypes specificFlag = BuffValueTypes.ALL)
        {
            if (!IsSet(currentTime) || !specificFlag.HasFlag(Flag))
            {
                return;
            }

            flag |= Flag;
            func?.Invoke(this);
        }
コード例 #2
0
        public void EncodeForLocal(Packet pw, ref BuffValueTypes flag, long currentTime, BuffValueTypes specificFlag = BuffValueTypes.ALL)
        {
            if (!IsSet(currentTime) || !specificFlag.HasFlag(Flag))
            {
                return;
            }

            flag |= Flag;
            pw.WriteShort(N);
            pw.WriteInt(R);
            pw.WriteShort((short)((TM - currentTime) / 100)); // If its not divided, it will not flash.
        }
コード例 #3
0
        private static void SendDebuffLocal(Character chr, BuffValueTypes removedFlags)
        {
            var pw = new PacketWriter(ServerOperationCode.SkillsGiveDebuff);

            pw.WriteUInt((uint)removedFlags);
            if (removedFlags.HasFlag(BuffValueTypes.SpeedBuffElement))
            {
                pw.WriteByte(0); // FIX: This should be the 'movement info index'
            }

            chr.Send(pw);
        }
コード例 #4
0
        public void EncodeForLocal(PacketWriter pw, ref BuffValueTypes flag, DateTime currentTime,
                                   BuffValueTypes specificFlag = BuffValueTypes.All)
        {
            if (!IsActive(currentTime) || !specificFlag.HasFlag(Flag))
            {
                return;
            }

            flag |= Flag;
            pw.WriteShort(Value);
            pw.WriteInt(ReferenceId);
            pw.WriteShort((short)((ExpireTime - currentTime).TotalMilliseconds / 100));
        }
コード例 #5
0
        private static void SendBuffLocal(Character chr, BuffValueTypes flagsAdded, short pDelay)
        {
            var pw = new PacketWriter(ServerOperationCode.SkillsGiveBuff);

            chr.PrimaryStats.EncodeForLocal(pw, flagsAdded);
            pw.WriteShort(pDelay);
            if (flagsAdded.HasFlag(BuffValueTypes.SpeedBuffElement))
            {
                pw.WriteByte(0); // FIX: This should be the 'movement info index'
            }
            pw.WriteLong(0);

            chr.Send(pw);
        }
コード例 #6
0
 public virtual bool DecodeForCC(Packet pr, BuffValueTypes flag)
 {
     if (!flag.HasFlag(Flag))
     {
         Reset();
         return(false);
     }
     else
     {
         N  = pr.ReadShort();
         R  = pr.ReadInt();
         TM = pr.ReadLong();
         return(true);
     }
 }