public bool LoadTemplate(int id) { ItemHandler.Item it = new ItemHandler.Item(id); foreach (AOItemAttribute ia in it.ItemAttributes) { this.Stats.Set(ia.Stat, (uint)ia.Value); } fillInventory(); return(true); }
public void Create(int _templateid) { ItemHandler.Item i = new ItemHandler.Item(_templateid); int c; for (c = 0; c < i.ItemAttributes.Count; c++) { Stats.Set(i.ItemAttributes[c].Stat, (uint)i.ItemAttributes[c].Value); } i.applyon(this, ItemHandler.eventtype_ontrade, false, false, 0); }
public bool LoadTemplate(string hash) { SqlWrapper Sql = new SqlWrapper(); DataTable dt = Sql.ReadDT("SELECT * from vendortemplate WHERE HASH='" + hash + "'"); if (dt.Rows.Count > 0) { TemplateID = (Int32)dt.Rows[0]["itemtemplate"]; Name = (string)dt.Rows[0]["Name"]; ItemHandler.Item it = new ItemHandler.Item(TemplateID); foreach (AOItemAttribute ia in it.ItemAttributes) { this.Stats.Set(ia.Stat, (uint)ia.Value); } Sql.sqlclose(); fillInventory(); return(true); } return(false); }