public static void WriteSingleBuffMask(PacketWriter pw, BuffStat buffStat) { WriteBuffMask(pw, new List <BuffStat>() { buffStat }); }
public static PacketWriter RemoveBuffTestPacket(BuffStat buffstat) { PacketWriter pw = new PacketWriter(SendHeader.RemoveBuff); WriteSingleBuffMask(pw, buffstat); pw.WriteInt(0); //if stacked it shows remaining stacks I think; pw.WriteInt(0); return(pw); }
// Used for testing purposes public static PacketWriter GiveBuffTestPacket(BuffStat b, int value, int skillId = 1002, int duration = (5 * 60 * 1000)) { PacketWriter pw = new PacketWriter(SendHeader.GiveBuff); WriteSingleBuffMask(pw, b); bool stacked = false; if (b.IsStackingBuff) { if (!stacked) { stacked = true; pw.WriteInt(0); pw.WriteByte(0); //? pw.WriteInt(0); } pw.WriteInt(1); //amount of the same buffstat pw.WriteInt(skillId); pw.WriteInt(value); pw.WriteInt(0); //tickcount? pw.WriteInt(0); } else { pw.WriteShort((short)value); pw.WriteInt(skillId); } pw.WriteInt(duration); if (!stacked) { pw.WriteZeroBytes(9); } pw.WriteInt(0); pw.WriteInt(0); pw.WriteInt(0); return(pw); }