public static ACTI get_water_instance() { if (water_mesh == null) { water_mesh = new ACTI("mw_water_default"); water_mesh.isWater = true; string model_ = "Water\\Water2048.nif"; water_mesh.addField(new Field("EDID", Text.editor_id(water_mesh.editor_id))); water_mesh.addField(new Field("MODL", Text.zstring(model_))); water_mesh.addField(new Field("WNAM", Binary.toBin((uint)water_mesh.water))); } return(water_mesh); }
public void addWater(float height) { HasWater = true; float padding = 1024; max_x = max_x + padding; min_x = min_x - padding; max_y += padding; min_y -= padding; float size_x = Math.Abs(max_x - min_x); float size_y = Math.Abs(max_y - min_y); float size = Math.Max(size_x, size_y); if (size / 2048f <= 10.0f) { REFR water_mesh = new REFR(ACTI.get_water_instance().id, (max_x + min_x) / 2f, (max_y + min_y) / 2f, height, 0, 0, 0, size / 2048f); persistent_references.addRecord(water_mesh); water_mesh.make_persistent(); } else { for (float x = min_x; x <= max_x; x = x + 20480) { for (float y = min_y; y <= max_y; y = y + 20480) { Log.confirm("TES5.CELL addwater() FULL-SIZE: This functionality is untested. Are you sure you want to continue?"); REFR water_mesh = new REFR(ACTI.get_water_instance().id, x, y, height, 0, 0, 0, 10); persistent_references.addRecord(water_mesh); } } } }