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); }
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. }
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); }
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)); }
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); }
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); } }