Skip to content

Instantly share code, notes, and snippets.

package wardbc;
import java.nio.file.Paths;
import wardbc.lazy.LazyDBC;
import wardbc.lazy.rows.*;
public class Main {
static public void main(String[] args) {
package warkit.items;
import warbase.types.BindT;
import warbase.types.ClassT;
import warbase.types.EquipT;
import warbase.types.ProfT;
import warbase.types.QualityT;
import warbase.types.RaceT;
import warbase.types.TypeIntBit;
import warbase.types.WeaponT;
package wardbc;
import java.nio.file.Paths;
import wardbc.lazy.LazyDBC;
import wardbc.lazy.rows.*;
public class Main {
static public void main(String[] args) {
package warbase;
import warbase.data.ArmorCurve;
import warbase.types.ArmorT;
import warbase.types.ClassT;
import warbase.types.EquipT;
import warbase.types.GemT;
import warbase.types.QualityT;
import warbase.types.RaceT;
import warbase.types.SocketT;
package warkit;
import warbase.types.SpecT;
import warbase.types.ProfT;
import warkit.player.Player;
public class Main {
public static void main(String[] args) {
@adraffy
adraffy / gist:0a1a27e23ad48c0a80bb
Created November 5, 2014 00:01
Example of How to dump Items to JSON
package wktest;
import com.antistupid.warbase.data.ArmorCurve;
import com.antistupid.warbase.ids.ItemClass;
import com.antistupid.warbase.types.ArmorT;
import com.antistupid.warbase.types.ClassT;
import com.antistupid.warbase.types.EquipT;
import com.antistupid.warbase.types.QualityT;
import com.antistupid.warbase.types.RaceT;
import com.antistupid.warkit.WarKit;
static void dumpIds() {
WarKit wk = WarKit.load();
JSONObject root = new JSONObject();
root.put("items", wk.wearableMap.values().stream().map(x -> x.itemId).collect(Collectors.toCollection(JSONArray::new)));
root.put("gems", wk.gemMap.values().stream().map(x -> x.itemId).collect(Collectors.toCollection(JSONArray::new)));
// not all enchants have a corresponding item
root.put("enchants", wk.enchantMap.values().stream().filter(x -> x.itemId > 0).map(x -> x.itemId).collect(Collectors.toCollection(JSONArray::new)));
root.put("foods", wk.consumeMap.values().stream().filter(x -> x.type == ConsumeT.FOOD).map(x -> x.itemId).collect(Collectors.toCollection(JSONArray::new)));
root.put("potions", wk.consumeMap.values().stream().filter(x -> x.type == ConsumeT.POTION).map(x -> x.itemId).collect(Collectors.toCollection(JSONArray::new)));
// includes elixirs, flasks, scrolls
// Copyright 2018 Chia Network Inc
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
import os
import sys
import struct
# chia stuff
from chia.wallet.derive_keys import master_sk_to_local_sk
from chia.plotting.util import parse_plot_info
from chia.types.blockchain_format.proof_of_space import ProofOfSpace
# see: chiapos/src/plotter_disk.hpp WriteHeader()
import {keccak} from '@adraffy/keccak';
function namehash(name) {
let buf = new Uint8Array(64);
if (name.length > 0) {
for (let label of name.split('.').reverse()) {
buf.set(keccak().update(label).bytes, 32);
buf.set(keccak().update(buf).bytes, 0);
}
}