public void Save() { StringBuilder sb = new StringBuilder(); sb.Append(" charName = '" + name + "'"); sb.Append(", charClass = " + cClass); sb.Append(", removeState = " + deleteState); sb.Append(", invPages = " + invPages); sb.Append(", face = " + face); sb.Append(", effect = " + effect); sb.Append(", faction = " + faction); sb.Append(", level = " + level); sb.Append(", curHP = " + curHP); sb.Append(", curMP = " + curMP); sb.Append(", curSP = " + curSP); sb.Append(", coin = " + coin); sb.Append(", fame = " + fame); sb.Append(", locX = '" + position[0]); sb.Append("', locY = '" + position[1]); sb.Append("', map = " + map); sb.Append(", Inte = " + inte); sb.Append(", Agi = " + agi); sb.Append(", Vit = " + vit); sb.Append(", Str = " + str); sb.Append(", Dex = " + dex); sb.Append(", statPointz = " + statPoints); sb.Append(", skillPointz = " + skillPoints); sb.Append(", karmaMessagingTimes = " + karmaMessagingTimes); sb.Append(", gmShoutMessagingTimes = " + gmShoutMessagingTimes); MySQLTool.Save("chars", sb, "charID", this.cID); MySQLTool.SaveEquipments(this); MySQLTool.SaveInventories(this); //MySQLTool.SaveCargo(this); MySQLTool.SaveSkills(this); MySQLTool.SaveSkillBar(this); MySQLTool.SaveCommunities(this); }
public static int createInventories(Character chr) { Inventory inv = chr.getInventory(); inv.setPages(chr.getInvPages()); List <int> seqhash = new List <int>(); for (int i = 0; i <= 240; i++) { seqhash.Add(-1); } inv.saveInv(); inv.setSeqSaved(seqhash); foreach (int[] entry in NewInventory.Instance.newInventory) { chr.getInventory().addItem(entry[0], (short)entry[1], new Item(entry[2], (short)entry[3], ItemDataCache.Instance.getItemData(entry[2]).getTimeToExpire())); } chr.getInventory().saveInv(); MySQLTool.SaveInventories(chr); return(1); }