package other;
import lineage2.dat.DatNames;
import lineage2.utils.enums.ServerType;
import org.index.commons.CommonPair;
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.ArrayList;
import java.util.List;
public class Unknown
{
private final static List<CommonPair<Integer, Long>> ITEMS = new ArrayList<>();
static
{
ITEMS.add(new CommonPair<>(1, 1L));
ITEMS.add(new CommonPair<>(57, 1L));
ITEMS.add(new CommonPair<>(57, 2L));
ITEMS.add(new CommonPair<>(57, 3L));
ITEMS.add(new CommonPair<>(57, 4L));
ITEMS.add(new CommonPair<>(57, 5L));
}
public static void main(String[] args)
{
final DatNames names = new DatNames(ServerType.main);
final String header = "" +
"<param name=\"weight\" value=\"600\" />" + "\n" +
"<param name=\"minRestorationCount\" value=\"1\" />" + "\n" +
"<param name=\"maxRestorationCount\" value=\"1\" />" + "\n" +
"<restoration type=\"RANDOM\" >" + "\n";
final String footer = "</restoration>";
final BigDecimal chance = BigDecimal.valueOf((double) 100).divide(BigDecimal.valueOf((double) ITEMS.size()), MathContext.DECIMAL128);
final StringBuilder restoration = new StringBuilder(header);
for (CommonPair<Integer, Long> itemPair : ITEMS)
{
restoration.append("\t").
append("<item ").
append("id=\"").append(itemPair.getKey()).append("\" ").
append("count=\"").append(itemPair.getValue()).append("\" ").
append("chance=\"").append(chance.doubleValue()).append("\" ").
append("/>").append("\t").append(names.getItemCommentName(itemPair.getKey(), true))
.append("\n");
}
restoration.append(footer);
System.out.println(restoration);
}
}