public static void SaveEquipments(Character chr) { Equipment eq = chr.getEquipment(); StringBuilder sb = new StringBuilder(); for(byte i = 0;i<17;i++) { Item item = new Item(); if(eq.getEquipments().ContainsKey(i)) item = eq.getEquipItem(i); sb.Append(",s" + i + "=" + item.getItemID()); sb.Append(",e" + i + "=" + item.getEnding()); } Save("chars_eq", sb, "charID", chr.getuID()); return; }
public static void SaveInventories(Character chr) { Inventory inv = chr.getInventory(); StringBuilder sb = new StringBuilder(); for(int i = 0;i < inv.getPages() * 40;i++) { Item item = new Item(); if(inv.getSeqSaved()[i] != -1) item = inv.getInvSaved()[inv.getSeqSaved()[i]]; sb.Append(",i" + i + "=" + item.getItemID()); sb.Append(",h" + i + "=" + inv.getSeqSaved()[i]); sb.Append(",q" + i + "=" + item.getQuantity()); sb.Append(",e" + i + "=" + item.getEnding()); } Save("chars_inv", sb, "charID", chr.getuID()); return; }
public static void SaveCargo(Character chr) { Cargo cargo = chr.getCargo(); StringBuilder sb = new StringBuilder(); for(int i = 0;i < 120;i++) { Item item = new Item(); if(cargo.getSeqSaved()[i] != -1) item = cargo.getCargoSaved()[cargo.getSeqSaved()[i]]; sb.Append(",i" + i + "=" + item.getItemID()); sb.Append(",h" + i + "=" + cargo.getSeqSaved()[i]); sb.Append(",q" + i + "=" + item.getQuantity()); sb.Append(",e" + i + "=" + item.getEnding()); } Save("chars_cargo", sb, "charID", chr.getuID()); return; }