@Override
	public void setIngameTrades(List<IngameTrade> trades) {
		int tradeOffset = 0;
		try {
			NARCContents tradeNARC = this.readNARC(romEntry
					.getString("InGameTrades"));
			int[] spTrades = new int[0];
			if (romEntry.arrayEntries.containsKey("StaticPokemonTrades")) {
				spTrades = romEntry.arrayEntries.get("StaticPokemonTrades");
			}
			List<String> tradeStrings = getStrings(romEntry
					.getInt("IngameTradesTextOffset"));
			int tradeCount = tradeNARC.files.size();
			for (int i = 0; i < tradeCount; i++) {
				boolean isSP = false;
				for (int j = 0; j < spTrades.length; j++) {
					if (spTrades[j] == i) {
						isSP = true;
						break;
					}
				}
				if (isSP) {
					continue;
				}
				byte[] tfile = tradeNARC.files.get(i);
				IngameTrade trade = trades.get(tradeOffset++);
				tradeStrings.set(i, trade.nickname);
				tradeStrings.set(i + tradeCount, trade.otName);
				writeLong(tfile, 0, trade.givenPokemon.number);
				for (int iv = 0; iv < 6; iv++) {
					writeLong(tfile, 4 + iv * 4, trade.ivs[iv]);
				}
				writeWord(tfile, 0x20, trade.otId);
				writeLong(tfile, 0x3C, trade.item);
				writeLong(tfile, 0x4C, trade.requestedPokemon.number);
				if (tfile.length > 0x50) {
					writeLong(tfile, 0x50, 0); // disable gender
				}
			}
			this.writeNARC(romEntry.getString("InGameTrades"), tradeNARC);
			this.setStrings(romEntry.getInt("IngameTradesTextOffset"),
					tradeStrings);
		} catch (IOException ex) {
		}
	}